@mxtommy/kip 3.10.4 → 3.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -1
- package/README.md +21 -9
- package/package.json +1 -1
- package/public/3rdpartylicenses.txt +61 -61
- package/public/assets/help-docs/community.md +78 -0
- package/public/assets/help-docs/configuration.md +1 -1
- package/public/assets/help-docs/contact-us.md +58 -8
- package/public/assets/help-docs/dashboards.md +117 -42
- package/public/assets/help-docs/datainspector.md +1 -1
- package/public/assets/help-docs/datasets.md +1 -1
- package/public/assets/help-docs/embedwidget.md +1 -1
- package/public/assets/help-docs/grafana.md +1 -1
- package/public/assets/help-docs/influxdb.md +1 -1
- package/public/assets/help-docs/kiosk.md +17 -1
- package/public/assets/help-docs/menu.json +4 -3
- package/public/assets/help-docs/putcontrols.md +5 -5
- package/public/assets/help-docs/welcome.md +46 -23
- package/public/assets/help-docs/zones.md +1 -1
- package/public/assets/svg/icons.svg +26 -18
- package/public/{chunk-X5HFS54R.js → chunk-3LKIOGV7.js} +1 -1
- package/public/{chunk-FPMCI7XZ.js → chunk-65TR3CWM.js} +1 -1
- package/public/{chunk-G4B4D3XR.js → chunk-6MRJ4C55.js} +1 -1
- package/public/{chunk-KPOCVRYH.js → chunk-7S37JBY2.js} +1 -1
- package/public/chunk-A5CYPNMD.js +2 -0
- package/public/chunk-BSAAN2EI.js +2 -0
- package/public/{chunk-2MAVQD65.js → chunk-CDPHRRZR.js} +1 -1
- package/public/chunk-D4DROTBC.js +8 -0
- package/public/{chunk-PYBIMDD3.js → chunk-D4MWDRNW.js} +1 -1
- package/public/chunk-EPTIEPMQ.js +4 -0
- package/public/chunk-F5X5MWHG.js +0 -0
- package/public/{chunk-XE352AKG.js → chunk-I454VRMK.js} +1 -1
- package/public/chunk-IQG4DDQX.js +1 -0
- package/public/{chunk-VZ77T3BF.js → chunk-K5OOC3CF.js} +3 -3
- package/public/{chunk-IZAPOSYM.js → chunk-NOLKBYOV.js} +1 -1
- package/public/chunk-QOXZFV6P.js +47 -0
- package/public/{chunk-GMZROOAF.js → chunk-RMLGKVWE.js} +1 -1
- package/public/chunk-T6TC7KWG.js +1 -0
- package/public/{chunk-6NRGS3BZ.js → chunk-UHKP2PC3.js} +1 -1
- package/public/{chunk-I6UWIF55.js → chunk-UTCRLFYC.js} +1 -1
- package/public/{chunk-XFU5YJJP.js → chunk-VEJNBHWJ.js} +1 -1
- package/public/{chunk-F4VOQO2M.js → chunk-XLJT6YPP.js} +1 -1
- package/public/chunk-YCW2UBVQ.js +1 -0
- package/public/{chunk-ANRGX57I.js → chunk-YPUCOH35.js} +12 -12
- package/public/chunk-YVLZ2UAQ.js +2 -0
- package/public/{chunk-FFE275CO.js → chunk-Z5MCM3TT.js} +10 -10
- package/public/{chunk-EJ4JM3HG.js → chunk-ZEV6YXHP.js} +1 -1
- package/public/{chunk-TIXQ3FAF.js → chunk-ZPCYFQPB.js} +1 -1
- package/public/index.html +1 -1
- package/public/main-7TSLA2U5.js +5 -0
- package/public/chunk-66OJ5PZF.js +0 -2
- package/public/chunk-CS5U3NWY.js +0 -8
- package/public/chunk-GIZH6HIB.js +0 -2
- package/public/chunk-OX4U3HT6.js +0 -2
- package/public/chunk-TARCFDF4.js +0 -4
- package/public/chunk-Z4FDWG2W.js +0 -1
- package/public/main-ASCSBNAW.js +0 -51
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Oe,b as Ai,ca as zs}from"./chunk-ANRGX57I.js";var Op=(()=>{class i{DEFAULT_FONT="Roboto";EDGE_BUFFER=10;debug=!1;scaleFactor=window.devicePixelRatio||1;fontsReadyPromise;sharedResizeObserver=null;observedCanvases=new Map;dprMediaQuery=null;resizeCallbacks=new WeakMap;constructor(){this.fontsReadyPromise=document.fonts.ready}registerCanvas(t,r={}){if(r=Oe({autoRelease:!0},r),!t)return;if(t.style.width="100%",t.style.height="100%",r.onResize){let s=(o,a)=>{o===0||a===0||r.onResize(o,a)};this.resizeCallbacks.set(t,s)}this.sharedResizeObserver||(this.debug&&console.log("[CanvasService] Creating shared ResizeObserver for all canvases"),this.sharedResizeObserver=new ResizeObserver(s=>{this.debug&&console.log("[CanvasService] Shared ResizeObserver callback fired",s.map(o=>{let a=o.target,l=a.parentElement;return{tag:a.tagName,id:a.id,class:a.className,parent:l?{tag:l.tagName,class:l.className,id:l.id}:null,contentRect:o.contentRect,style:{width:a.style.width,height:a.style.height},backingStore:{width:a.width,height:a.height}}}));for(let o of s){let a=o.target;if(this.debug){let c=a.parentElement;console.log("[CanvasService] Shared ResizeObserver entry (detailed)",{tag:a.tagName,id:a.id,class:a.className,parent:c?{tag:c.tagName,class:c.className,id:c.id}:null,contentRect:o.contentRect,style:{width:a.style.width,height:a.style.height},backingStore:{width:a.width,height:a.height}})}this.setHighDPISize(a,o.contentRect);let l=this.resizeCallbacks.get(a);l&&l(Math.round(o.contentRect.width),Math.round(o.contentRect.height))}})),this.sharedResizeObserver.observe(t),this.debug&&console.log("[CanvasService] Started observing canvas (shared observer)",{tag:t.tagName,id:t.id,class:t.className,selector:t.getAttribute("ng-reflect-ng-if")||"",parent:t.parentElement?{tag:t.parentElement.tagName,class:t.parentElement.className,id:t.parentElement.id}:null}),this.observedCanvases.set(t,r||{}),this.setHighDPISize(t,t.getBoundingClientRect());let n=this.resizeCallbacks.get(t);if(n){let s=t.getBoundingClientRect();n(Math.round(s.width),Math.round(s.height))}}unregisterCanvas(t){if(!t||!this.observedCanvases.has(t))return;this.sharedResizeObserver&&(this.sharedResizeObserver.unobserve(t),this.observedCanvases.size<=1&&(this.sharedResizeObserver.disconnect(),this.sharedResizeObserver=null,this.debug&&console.log("[CanvasService] Shared ResizeObserver disconnected (no canvases left)"))),this.resizeCallbacks.delete(t),this.observedCanvases.get(t)?.autoRelease&&this.releaseCanvas(t,{clear:!0,removeFromDom:!0}),this.observedCanvases.delete(t),this.observedCanvases.size===0&&this.cleanupDPRListener()}onDPRChange=()=>{let t=window.devicePixelRatio||1;t!==this.scaleFactor&&(this.scaleFactor=t,this.observedCanvases.forEach((r,n)=>{try{this.setHighDPISize(n,n.getBoundingClientRect())}catch(s){console.warn("[CanvasService] onDPRChange failed for canvas",s)}}),this.cleanupDPRListener(),this.setupDPRListener())};setupDPRListener(){try{this.cleanupDPRListener();let t=`(resolution: ${window.devicePixelRatio||1}dppx)`;this.dprMediaQuery=window.matchMedia(t),this.dprMediaQuery&&((n,s)=>{"addEventListener"in n?n.addEventListener("change",s):"addListener"in n&&n.addListener(s)})(this.dprMediaQuery,this.onDPRChange)}catch(t){console.warn("[CanvasService] setupDPRListener failed",t)}}cleanupDPRListener(){if(this.dprMediaQuery){try{((r,n)=>{"removeEventListener"in r?r.removeEventListener("change",n):"removeListener"in r&&r.removeListener(n)})(this.dprMediaQuery,this.onDPRChange)}catch{}this.dprMediaQuery=null}}setHighDPISize(t,r){let n=Math.floor(r.width),s=Math.floor(r.height);t.width=Math.round(n*this.scaleFactor),t.height=Math.round(s*this.scaleFactor),t.style.width=`${n}px`,t.style.height=`${s}px`;try{let o=t.getContext("2d");o&&(o.setTransform(this.scaleFactor,0,0,this.scaleFactor,0,0),o.clearRect(0,0,t.width,t.height))}catch(o){console.warn("[CanvasService] setHighDPISize: failed to set context transform",o)}}drawTitle(t,r,n,s="normal",o,a,l=.1){if(!t)return;let c=()=>{let u=!1;try{let f=t;if(typeof f.getTransform=="function"){let d=f.getTransform(),h=d&&d.a?d.a:1;Math.abs(h-this.scaleFactor)>1e-6&&(t.save(),t.setTransform(this.scaleFactor,0,0,this.scaleFactor,0,0),u=!0)}else try{t.save(),t.setTransform(this.scaleFactor,0,0,this.scaleFactor,0,0),u=!0}catch{}this.drawTitleInternal(t,r,n,s,o,a,l),u&&t.restore()}catch(f){console.warn("[CanvasService] drawTitle failed",f);try{this.drawTitleInternal(t,r,n,s,o,a,l)}catch{}}};document.fonts.status==="loaded"?this.fontsReadyPromise.then(()=>requestAnimationFrame(c)).catch(()=>requestAnimationFrame(c)):this.fontsReadyPromise.then(()=>requestAnimationFrame(c)).catch(u=>{console.warn(`[CanvasService] Font readiness failed: ${u}`),requestAnimationFrame(c)})}drawTitleInternal(t,r,n,s="normal",o,a,l){if(!t)return;let c=o-2*this.EDGE_BUFFER,u=Math.floor(a*l),f=this.calculateOptimalFontSize(t,r,c,u,s);t.clearRect(0,0,o,a),t.font=`${s} ${f}px ${this.DEFAULT_FONT}`,t.fillStyle=n,t.textAlign="left",t.textBaseline="top",t.fillText(r,this.EDGE_BUFFER,this.EDGE_BUFFER,c)}clearCanvas(t,r,n){t.clearRect(0,0,r,n)}drawText(t,r,n=this.EDGE_BUFFER,s=this.EDGE_BUFFER,o,a,l="normal",c="#000",u="center",f="middle"){if(!t)return;let d=()=>{try{t.save(),t.setTransform(this.scaleFactor,0,0,this.scaleFactor,0,0),this.drawTextInternal(t,r,n,s,o,a,l,c,u,f)}finally{try{t.restore()}catch{}}};document.fonts.status==="loaded"?d():this.fontsReadyPromise.then(d).catch(h=>{console.warn(`[Canvas Service] Font readiness failed: ${h}`),d()})}drawTextInternal(t,r,n=this.EDGE_BUFFER,s=this.EDGE_BUFFER,o,a,l="normal",c="#000",u="center",f="middle"){let d=this.calculateOptimalFontSize(t,r,o,a,l);t.font=`${l} ${d}px ${this.DEFAULT_FONT}`,t.fillStyle=c,t.textAlign=u,t.textBaseline=f,t.fillText(r,n,s,o)}calculateOptimalFontSize(t,r,n,s,o="normal"){let a=1,l=s,c=l;for(;a<=l;)c=Math.floor((a+l)/2),t.font=`${o} ${c}px ${this.DEFAULT_FONT}`,t.measureText(r).width>n?l=c-1:a=c+1;return l}createTitleBitmap(t,r,n,s,o,a=.1){let l=document.createElement("canvas");l.width=Math.round(s*this.scaleFactor),l.height=Math.round(o*this.scaleFactor),l.style.width=`${s}px`,l.style.height=`${o}px`;let c=l.getContext("2d");return c&&(c.setTransform(this.scaleFactor,0,0,this.scaleFactor,0,0),this.drawTitleInternal(c,t,r,n,s,o,a),document.fonts.status!=="loaded"&&document.fonts.ready.then(()=>{try{c.setTransform(this.scaleFactor,0,0,this.scaleFactor,0,0),this.drawTitleInternal(c,t,r,n,s,o,a)}catch{}}).catch(()=>{})),l}renderStaticToBitmap(t,r,n,s){let o=document.createElement("canvas");o.width=r*this.scaleFactor,o.height=n*this.scaleFactor;let a=o.getContext("2d");return a&&(a.setTransform(this.scaleFactor,0,0,this.scaleFactor,0,0),s(a)),o}drawRectangle(t,r,n,s,o,a){t.fillStyle=a,t.fillRect(r,n,s,o)}releaseCanvas(t,r={removeFromDom:!0,clear:!0}){if(!t)return;let{removeFromDom:n=!0,clear:s=!0}=r;try{let o=t.getContext("2d");s&&o&&o.clearRect(0,0,t.width,t.height),t.width=0,t.height=0,n&&t.parentNode&&t.parentNode.removeChild(t)}catch(o){console.warn("[CanvasService] releaseCanvas failed",o)}}releaseCanvases(t,r){t.forEach(n=>this.releaseCanvas(n,r))}static \u0275fac=function(r){return new(r||i)};static \u0275prov=zs({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function ii(i){return i+.5|0}var te=(i,e,t)=>Math.max(Math.min(i,t),e);function ti(i){return te(ii(i*2.55),0,255)}function ee(i){return te(ii(i*255),0,255)}function Yt(i){return te(ii(i/2.55)/100,0,1)}function Ns(i){return te(ii(i*100),0,100)}var kt={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},en=[..."0123456789ABCDEF"],Jl=i=>en[i&15],tc=i=>en[(i&240)>>4]+en[i&15],Ii=i=>(i&240)>>4===(i&15),ec=i=>Ii(i.r)&&Ii(i.g)&&Ii(i.b)&&Ii(i.a);function ic(i){var e=i.length,t;return i[0]==="#"&&(e===4||e===5?t={r:255&kt[i[1]]*17,g:255&kt[i[2]]*17,b:255&kt[i[3]]*17,a:e===5?kt[i[4]]*17:255}:(e===7||e===9)&&(t={r:kt[i[1]]<<4|kt[i[2]],g:kt[i[3]]<<4|kt[i[4]],b:kt[i[5]]<<4|kt[i[6]],a:e===9?kt[i[7]]<<4|kt[i[8]]:255})),t}var rc=(i,e)=>i<255?e(i):"";function nc(i){var e=ec(i)?Jl:tc;return i?"#"+e(i.r)+e(i.g)+e(i.b)+rc(i.a,e):void 0}var sc=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ys(i,e,t){let r=e*Math.min(t,1-t),n=(s,o=(s+i/30)%12)=>t-r*Math.max(Math.min(o-3,9-o,1),-1);return[n(0),n(8),n(4)]}function oc(i,e,t){let r=(n,s=(n+i/60)%6)=>t-t*e*Math.max(Math.min(s,4-s,1),0);return[r(5),r(3),r(1)]}function ac(i,e,t){let r=Ys(i,1,.5),n;for(e+t>1&&(n=1/(e+t),e*=n,t*=n),n=0;n<3;n++)r[n]*=1-e-t,r[n]+=e;return r}function lc(i,e,t,r,n){return i===n?(e-t)/r+(e<t?6:0):e===n?(t-i)/r+2:(i-e)/r+4}function rn(i){let t=i.r/255,r=i.g/255,n=i.b/255,s=Math.max(t,r,n),o=Math.min(t,r,n),a=(s+o)/2,l,c,u;return s!==o&&(u=s-o,c=a>.5?u/(2-s-o):u/(s+o),l=lc(t,r,n,u,s),l=l*60+.5),[l|0,c||0,a]}function nn(i,e,t,r){return(Array.isArray(e)?i(e[0],e[1],e[2]):i(e,t,r)).map(ee)}function sn(i,e,t){return nn(Ys,i,e,t)}function cc(i,e,t){return nn(ac,i,e,t)}function uc(i,e,t){return nn(oc,i,e,t)}function Us(i){return(i%360+360)%360}function fc(i){let e=sc.exec(i),t=255,r;if(!e)return;e[5]!==r&&(t=e[6]?ti(+e[5]):ee(+e[5]));let n=Us(+e[2]),s=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?r=cc(n,s,o):e[1]==="hsv"?r=uc(n,s,o):r=sn(n,s,o),{r:r[0],g:r[1],b:r[2],a:t}}function dc(i,e){var t=rn(i);t[0]=Us(t[0]+e),t=sn(t),i.r=t[0],i.g=t[1],i.b=t[2]}function hc(i){if(!i)return;let e=rn(i),t=e[0],r=Ns(e[1]),n=Ns(e[2]);return i.a<255?`hsla(${t}, ${r}%, ${n}%, ${Yt(i.a)})`:`hsl(${t}, ${r}%, ${n}%)`}var Ws={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"},Hs={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 mc(){let i={},e=Object.keys(Hs),t=Object.keys(Ws),r,n,s,o,a;for(r=0;r<e.length;r++){for(o=a=e[r],n=0;n<t.length;n++)s=t[n],a=a.replace(s,Ws[s]);s=parseInt(Hs[o],16),i[a]=[s>>16&255,s>>8&255,s&255]}return i}var Li;function pc(i){Li||(Li=mc(),Li.transparent=[0,0,0,0]);let e=Li[i.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}var gc=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function bc(i){let e=gc.exec(i),t=255,r,n,s;if(e){if(e[7]!==r){let o=+e[7];t=e[8]?ti(o):te(o*255,0,255)}return r=+e[1],n=+e[3],s=+e[5],r=255&(e[2]?ti(r):te(r,0,255)),n=255&(e[4]?ti(n):te(n,0,255)),s=255&(e[6]?ti(s):te(s,0,255)),{r,g:n,b:s,a:t}}}function xc(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${Yt(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}var tn=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,Se=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function vc(i,e,t){let r=Se(Yt(i.r)),n=Se(Yt(i.g)),s=Se(Yt(i.b));return{r:ee(tn(r+t*(Se(Yt(e.r))-r))),g:ee(tn(n+t*(Se(Yt(e.g))-n))),b:ee(tn(s+t*(Se(Yt(e.b))-s))),a:i.a+t*(e.a-i.a)}}function Ei(i,e,t){if(i){let r=rn(i);r[e]=Math.max(0,Math.min(r[e]+r[e]*t,e===0?360:1)),r=sn(r),i.r=r[0],i.g=r[1],i.b=r[2]}}function Vs(i,e){return i&&Object.assign(e||{},i)}function Bs(i){var e={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(e={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(e.a=ee(i[3]))):(e=Vs(i,{r:0,g:0,b:0,a:1}),e.a=ee(e.a)),e}function yc(i){return i.charAt(0)==="r"?bc(i):fc(i)}var ei=class i{constructor(e){if(e instanceof i)return e;let t=typeof e,r;t==="object"?r=Bs(e):t==="string"&&(r=ic(e)||pc(e)||yc(e)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var e=Vs(this._rgb);return e&&(e.a=Yt(e.a)),e}set rgb(e){this._rgb=Bs(e)}rgbString(){return this._valid?xc(this._rgb):void 0}hexString(){return this._valid?nc(this._rgb):void 0}hslString(){return this._valid?hc(this._rgb):void 0}mix(e,t){if(e){let r=this.rgb,n=e.rgb,s,o=t===s?.5:t,a=2*o-1,l=r.a-n.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;s=1-c,r.r=255&c*r.r+s*n.r+.5,r.g=255&c*r.g+s*n.g+.5,r.b=255&c*r.b+s*n.b+.5,r.a=o*r.a+(1-o)*n.a,this.rgb=r}return this}interpolate(e,t){return e&&(this._rgb=vc(this._rgb,e._rgb,t)),this}clone(){return new i(this.rgb)}alpha(e){return this._rgb.a=ee(e),this}clearer(e){let t=this._rgb;return t.a*=1-e,this}greyscale(){let e=this._rgb,t=ii(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=t,this}opaquer(e){let t=this._rgb;return t.a*=1+e,this}negate(){let e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Ei(this._rgb,2,e),this}darken(e){return Ei(this._rgb,2,-e),this}saturate(e){return Ei(this._rgb,1,e),this}desaturate(e){return Ei(this._rgb,1,-e),this}rotate(e){return dc(this._rgb,e),this}};function Ft(){}var eo=(()=>{let i=0;return()=>i++})();function U(i){return i==null}function tt(i){if(Array.isArray&&Array.isArray(i))return!0;let e=Object.prototype.toString.call(i);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function V(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function nt(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function bt(i,e){return nt(i)?i:e}function W(i,e){return typeof i>"u"?e:i}var io=(i,e)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:+i/e,cn=(i,e)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*e:+i;function Z(i,e,t){if(i&&typeof i.call=="function")return i.apply(t,e)}function Q(i,e,t,r){let n,s,o;if(tt(i))if(s=i.length,r)for(n=s-1;n>=0;n--)e.call(t,i[n],n);else for(n=0;n<s;n++)e.call(t,i[n],n);else if(V(i))for(o=Object.keys(i),s=o.length,n=0;n<s;n++)e.call(t,i[o[n]],o[n])}function si(i,e){let t,r,n,s;if(!i||!e||i.length!==e.length)return!1;for(t=0,r=i.length;t<r;++t)if(n=i[t],s=e[t],n.datasetIndex!==s.datasetIndex||n.index!==s.index)return!1;return!0}function Wi(i){if(tt(i))return i.map(Wi);if(V(i)){let e=Object.create(null),t=Object.keys(i),r=t.length,n=0;for(;n<r;++n)e[t[n]]=Wi(i[t[n]]);return e}return i}function ro(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function _c(i,e,t,r){if(!ro(i))return;let n=e[i],s=t[i];V(n)&&V(s)?Ie(n,s,r):e[i]=Wi(s)}function Ie(i,e,t){let r=tt(e)?e:[e],n=r.length;if(!V(i))return i;t=t||{};let s=t.merger||_c,o;for(let a=0;a<n;++a){if(o=r[a],!V(o))continue;let l=Object.keys(o);for(let c=0,u=l.length;c<u;++c)s(l[c],i,o,t)}return i}function Ee(i,e){return Ie(i,e,{merger:wc})}function wc(i,e,t){if(!ro(i))return;let r=e[i],n=t[i];V(r)&&V(n)?Ee(r,n):Object.prototype.hasOwnProperty.call(e,i)||(e[i]=Wi(n))}var js={"":i=>i,x:i=>i.x,y:i=>i.y};function Mc(i){let e=i.split("."),t=[],r="";for(let n of e)r+=n,r.endsWith("\\")?r=r.slice(0,-1)+".":(t.push(r),r="");return t}function Tc(i){let e=Mc(i);return t=>{for(let r of e){if(r==="")break;t=t&&t[r]}return t}}function jt(i,e){return(js[e]||(js[e]=Tc(e)))(i)}function Ui(i){return i.charAt(0).toUpperCase()+i.slice(1)}var Re=i=>typeof i<"u",Ut=i=>typeof i=="function",un=(i,e)=>{if(i.size!==e.size)return!1;for(let t of i)if(!e.has(t))return!1;return!0};function no(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}var $=Math.PI,et=2*$,kc=et+$,Hi=Number.POSITIVE_INFINITY,Dc=$/180,st=$/2,he=$/4,qs=$*2/3,Vt=Math.log10,At=Math.sign;function Fe(i,e,t){return Math.abs(i-e)<t}function fn(i){let e=Math.round(i);i=Fe(i,e,i/1e3)?e:i;let t=Math.pow(10,Math.floor(Vt(i))),r=i/t;return(r<=1?1:r<=2?2:r<=5?5:10)*t}function so(i){let e=[],t=Math.sqrt(i),r;for(r=1;r<t;r++)i%r===0&&(e.push(r),e.push(i/r));return t===(t|0)&&e.push(t),e.sort((n,s)=>n-s).pop(),e}function Cc(i){return typeof i=="symbol"||typeof i=="object"&&i!==null&&!(Symbol.toPrimitive in i||"toString"in i||"valueOf"in i)}function ge(i){return!Cc(i)&&!isNaN(parseFloat(i))&&isFinite(i)}function oo(i,e){let t=Math.round(i);return t-e<=i&&t+e>=i}function dn(i,e,t){let r,n,s;for(r=0,n=i.length;r<n;r++)s=i[r][t],isNaN(s)||(e.min=Math.min(e.min,s),e.max=Math.max(e.max,s))}function Dt(i){return i*($/180)}function Vi(i){return i*(180/$)}function hn(i){if(!nt(i))return;let e=1,t=0;for(;Math.round(i*e)/e!==i;)e*=10,t++;return t}function mn(i,e){let t=e.x-i.x,r=e.y-i.y,n=Math.sqrt(t*t+r*r),s=Math.atan2(r,t);return s<-.5*$&&(s+=et),{angle:s,distance:n}}function Bi(i,e){return Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2))}function Pc(i,e){return(i-e+kc)%et-$}function ft(i){return(i%et+et)%et}function ze(i,e,t,r){let n=ft(i),s=ft(e),o=ft(t),a=ft(s-n),l=ft(o-n),c=ft(n-s),u=ft(n-o);return n===s||n===o||r&&s===o||a>l&&c<u}function lt(i,e,t){return Math.max(e,Math.min(t,i))}function ao(i){return lt(i,-32768,32767)}function zt(i,e,t,r=1e-6){return i>=Math.min(e,t)-r&&i<=Math.max(e,t)+r}function ji(i,e,t){t=t||(o=>i[o]<e);let r=i.length-1,n=0,s;for(;r-n>1;)s=n+r>>1,t(s)?n=s:r=s;return{lo:n,hi:r}}var Et=(i,e,t,r)=>ji(i,t,r?n=>{let s=i[n][e];return s<t||s===t&&i[n+1][e]===t}:n=>i[n][e]<t),lo=(i,e,t)=>ji(i,t,r=>i[r][e]>=t);function co(i,e,t){let r=0,n=i.length;for(;r<n&&i[r]<e;)r++;for(;n>r&&i[n-1]>t;)n--;return r>0||n<i.length?i.slice(r,n):i}var uo=["push","pop","shift","splice","unshift"];function fo(i,e){if(i._chartjs){i._chartjs.listeners.push(e);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),uo.forEach(t=>{let r="_onData"+Ui(t),n=i[t];Object.defineProperty(i,t,{configurable:!0,enumerable:!1,value(...s){let o=n.apply(this,s);return i._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...s)}),o}})})}function pn(i,e){let t=i._chartjs;if(!t)return;let r=t.listeners,n=r.indexOf(e);n!==-1&&r.splice(n,1),!(r.length>0)&&(uo.forEach(s=>{delete i[s]}),delete i._chartjs)}function gn(i){let e=new Set(i);return e.size===i.length?i:Array.from(e)}var bn=(function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame})();function xn(i,e){let t=[],r=!1;return function(...n){t=n,r||(r=!0,bn.call(window,()=>{r=!1,i.apply(e,t)}))}}function ho(i,e){let t;return function(...r){return e?(clearTimeout(t),t=setTimeout(i,e,r)):i.apply(this,r),e}}var qi=i=>i==="start"?"left":i==="end"?"right":"center",dt=(i,e,t)=>i==="start"?e:i==="end"?t:(e+t)/2,mo=(i,e,t,r)=>i===(r?"left":"right")?t:i==="center"?(e+t)/2:e;function vn(i,e,t){let r=e.length,n=0,s=r;if(i._sorted){let{iScale:o,vScale:a,_parsed:l}=i,c=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null,u=o.axis,{min:f,max:d,minDefined:h,maxDefined:m}=o.getUserBounds();if(h){if(n=Math.min(Et(l,u,f).lo,t?r:Et(e,u,o.getPixelForValue(f)).lo),c){let p=l.slice(0,n+1).reverse().findIndex(g=>!U(g[a.axis]));n-=Math.max(0,p)}n=lt(n,0,r-1)}if(m){let p=Math.max(Et(l,o.axis,d,!0).hi+1,t?0:Et(e,u,o.getPixelForValue(d),!0).hi+1);if(c){let g=l.slice(p-1).findIndex(b=>!U(b[a.axis]));p+=Math.max(0,g)}s=lt(p,n,r)-n}else s=r-n}return{start:n,count:s}}function yn(i){let{xScale:e,yScale:t,_scaleRanges:r}=i,n={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!r)return i._scaleRanges=n,!0;let s=r.xmin!==e.min||r.xmax!==e.max||r.ymin!==t.min||r.ymax!==t.max;return Object.assign(r,n),s}var Ri=i=>i===0||i===1,$s=(i,e,t)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-e)*et/t)),Xs=(i,e,t)=>Math.pow(2,-10*i)*Math.sin((i-e)*et/t)+1,Ae={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*st)+1,easeOutSine:i=>Math.sin(i*st),easeInOutSine:i=>-.5*(Math.cos($*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>Ri(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=>Ri(i)?i:$s(i,.075,.3),easeOutElastic:i=>Ri(i)?i:Xs(i,.075,.3),easeInOutElastic(i){return Ri(i)?i:i<.5?.5*$s(i*2,.1125,.45):.5+.5*Xs(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 e=1.70158;return(i/=.5)<1?.5*(i*i*(((e*=1.525)+1)*i-e)):.5*((i-=2)*i*(((e*=1.525)+1)*i+e)+2)},easeInBounce:i=>1-Ae.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?Ae.easeInBounce(i*2)*.5:Ae.easeOutBounce(i*2-1)*.5+.5};function _n(i){if(i&&typeof i=="object"){let e=i.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function wn(i){return _n(i)?i:new ei(i)}function on(i){return _n(i)?i:new ei(i).saturate(.5).darken(.1).hexString()}var Oc=["x","y","borderWidth","radius","tension"],Sc=["color","borderColor","backgroundColor"];function Ac(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:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),i.set("animations",{colors:{type:"color",properties:Sc},numbers:{type:"number",properties:Oc}}),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:e=>e|0}}}})}function Ic(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var Qs=new Map;function Lc(i,e){e=e||{};let t=i+JSON.stringify(e),r=Qs.get(t);return r||(r=new Intl.NumberFormat(i,e),Qs.set(t,r)),r}function Ne(i,e,t){return Lc(e,t).format(i)}var po={values(i){return tt(i)?i:""+i},numeric(i,e,t){if(i===0)return"0";let r=this.chart.options.locale,n,s=i;if(t.length>1){let c=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(c<1e-4||c>1e15)&&(n="scientific"),s=Ec(i,t)}let o=Vt(Math.abs(s)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Ne(i,r,l)},logarithmic(i,e,t){if(i===0)return"0";let r=t[e].significand||i/Math.pow(10,Math.floor(Vt(i)));return[1,2,3,5,10,15].includes(r)||e>.8*t.length?po.numeric.call(this,i,e,t):""}};function Ec(i,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&i!==Math.floor(i)&&(t=i-Math.floor(i)),t}var oi={formatters:po};function Rc(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:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:oi.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:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}var re=Object.create(null),$i=Object.create(null);function ri(i,e){if(!e)return i;let t=e.split(".");for(let r=0,n=t.length;r<n;++r){let s=t[r];i=i[s]||(i[s]=Object.create(null))}return i}function an(i,e,t){return typeof e=="string"?Ie(ri(i,e),t):Ie(ri(i,""),e)}var ln=class{constructor(e,t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,n)=>on(n.backgroundColor),this.hoverBorderColor=(r,n)=>on(n.borderColor),this.hoverColor=(r,n)=>on(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(e),this.apply(t)}set(e,t){return an(this,e,t)}get(e){return ri(this,e)}describe(e,t){return an($i,e,t)}override(e,t){return an(re,e,t)}route(e,t,r,n){let s=ri(this,e),o=ri(this,r),a="_"+t;Object.defineProperties(s,{[a]:{value:s[t],writable:!0},[t]:{enumerable:!0,get(){let l=this[a],c=o[n];return V(l)?Object.assign({},c,l):W(l,c)},set(l){this[a]=l}}})}apply(e){e.forEach(t=>t(this))}},it=new ln({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Ac,Ic,Rc]);function Fc(i){return!i||U(i.size)||U(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function ni(i,e,t,r,n){let s=e[n];return s||(s=e[n]=i.measureText(n).width,t.push(n)),s>r&&(r=s),r}function go(i,e,t,r){r=r||{};let n=r.data=r.data||{},s=r.garbageCollect=r.garbageCollect||[];r.font!==e&&(n=r.data={},s=r.garbageCollect=[],r.font=e),i.save(),i.font=e;let o=0,a=t.length,l,c,u,f,d;for(l=0;l<a;l++)if(f=t[l],f!=null&&!tt(f))o=ni(i,n,s,o,f);else if(tt(f))for(c=0,u=f.length;c<u;c++)d=f[c],d!=null&&!tt(d)&&(o=ni(i,n,s,o,d));i.restore();let h=s.length/2;if(h>t.length){for(l=0;l<h;l++)delete n[s[l]];s.splice(0,h)}return o}function ne(i,e,t){let r=i.currentDevicePixelRatio,n=t!==0?Math.max(t/2,.5):0;return Math.round((e-n)*r)/r+n}function Mn(i,e){!e&&!i||(e=e||i.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,i.width,i.height),e.restore())}function Xi(i,e,t,r){Tn(i,e,t,r,null)}function Tn(i,e,t,r,n){let s,o,a,l,c,u,f,d,h=e.pointStyle,m=e.rotation,p=e.radius,g=(m||0)*Dc;if(h&&typeof h=="object"&&(s=h.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){i.save(),i.translate(t,r),i.rotate(g),i.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),i.restore();return}if(!(isNaN(p)||p<=0)){switch(i.beginPath(),h){default:n?i.ellipse(t,r,n/2,p,0,0,et):i.arc(t,r,p,0,et),i.closePath();break;case"triangle":u=n?n/2:p,i.moveTo(t+Math.sin(g)*u,r-Math.cos(g)*p),g+=qs,i.lineTo(t+Math.sin(g)*u,r-Math.cos(g)*p),g+=qs,i.lineTo(t+Math.sin(g)*u,r-Math.cos(g)*p),i.closePath();break;case"rectRounded":c=p*.516,l=p-c,o=Math.cos(g+he)*l,f=Math.cos(g+he)*(n?n/2-c:l),a=Math.sin(g+he)*l,d=Math.sin(g+he)*(n?n/2-c:l),i.arc(t-f,r-a,c,g-$,g-st),i.arc(t+d,r-o,c,g-st,g),i.arc(t+f,r+a,c,g,g+st),i.arc(t-d,r+o,c,g+st,g+$),i.closePath();break;case"rect":if(!m){l=Math.SQRT1_2*p,u=n?n/2:l,i.rect(t-u,r-l,2*u,2*l);break}g+=he;case"rectRot":f=Math.cos(g)*(n?n/2:p),o=Math.cos(g)*p,a=Math.sin(g)*p,d=Math.sin(g)*(n?n/2:p),i.moveTo(t-f,r-a),i.lineTo(t+d,r-o),i.lineTo(t+f,r+a),i.lineTo(t-d,r+o),i.closePath();break;case"crossRot":g+=he;case"cross":f=Math.cos(g)*(n?n/2:p),o=Math.cos(g)*p,a=Math.sin(g)*p,d=Math.sin(g)*(n?n/2:p),i.moveTo(t-f,r-a),i.lineTo(t+f,r+a),i.moveTo(t+d,r-o),i.lineTo(t-d,r+o);break;case"star":f=Math.cos(g)*(n?n/2:p),o=Math.cos(g)*p,a=Math.sin(g)*p,d=Math.sin(g)*(n?n/2:p),i.moveTo(t-f,r-a),i.lineTo(t+f,r+a),i.moveTo(t+d,r-o),i.lineTo(t-d,r+o),g+=he,f=Math.cos(g)*(n?n/2:p),o=Math.cos(g)*p,a=Math.sin(g)*p,d=Math.sin(g)*(n?n/2:p),i.moveTo(t-f,r-a),i.lineTo(t+f,r+a),i.moveTo(t+d,r-o),i.lineTo(t-d,r+o);break;case"line":o=n?n/2:Math.cos(g)*p,a=Math.sin(g)*p,i.moveTo(t-o,r-a),i.lineTo(t+o,r+a);break;case"dash":i.moveTo(t,r),i.lineTo(t+Math.cos(g)*(n?n/2:p),r+Math.sin(g)*p);break;case!1:i.closePath();break}i.fill(),e.borderWidth>0&&i.stroke()}}function Rt(i,e,t){return t=t||.5,!e||i&&i.x>e.left-t&&i.x<e.right+t&&i.y>e.top-t&&i.y<e.bottom+t}function ai(i,e){i.save(),i.beginPath(),i.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),i.clip()}function li(i){i.restore()}function bo(i,e,t,r,n){if(!e)return i.lineTo(t.x,t.y);if(n==="middle"){let s=(e.x+t.x)/2;i.lineTo(s,e.y),i.lineTo(s,t.y)}else n==="after"!=!!r?i.lineTo(e.x,t.y):i.lineTo(t.x,e.y);i.lineTo(t.x,t.y)}function xo(i,e,t,r){if(!e)return i.lineTo(t.x,t.y);i.bezierCurveTo(r?e.cp1x:e.cp2x,r?e.cp1y:e.cp2y,r?t.cp2x:t.cp1x,r?t.cp2y:t.cp1y,t.x,t.y)}function zc(i,e){e.translation&&i.translate(e.translation[0],e.translation[1]),U(e.rotation)||i.rotate(e.rotation),e.color&&(i.fillStyle=e.color),e.textAlign&&(i.textAlign=e.textAlign),e.textBaseline&&(i.textBaseline=e.textBaseline)}function Nc(i,e,t,r,n){if(n.strikethrough||n.underline){let s=i.measureText(r),o=e-s.actualBoundingBoxLeft,a=e+s.actualBoundingBoxRight,l=t-s.actualBoundingBoxAscent,c=t+s.actualBoundingBoxDescent,u=n.strikethrough?(l+c)/2:c;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=n.decorationWidth||2,i.moveTo(o,u),i.lineTo(a,u),i.stroke()}}function Wc(i,e){let t=i.fillStyle;i.fillStyle=e.color,i.fillRect(e.left,e.top,e.width,e.height),i.fillStyle=t}function se(i,e,t,r,n,s={}){let o=tt(e)?e:[e],a=s.strokeWidth>0&&s.strokeColor!=="",l,c;for(i.save(),i.font=n.string,zc(i,s),l=0;l<o.length;++l)c=o[l],s.backdrop&&Wc(i,s.backdrop),a&&(s.strokeColor&&(i.strokeStyle=s.strokeColor),U(s.strokeWidth)||(i.lineWidth=s.strokeWidth),i.strokeText(c,t,r,s.maxWidth)),i.fillText(c,t,r,s.maxWidth),Nc(i,t,r,c,s),r+=Number(n.lineHeight);i.restore()}function We(i,e){let{x:t,y:r,w:n,h:s,radius:o}=e;i.arc(t+o.topLeft,r+o.topLeft,o.topLeft,1.5*$,$,!0),i.lineTo(t,r+s-o.bottomLeft),i.arc(t+o.bottomLeft,r+s-o.bottomLeft,o.bottomLeft,$,st,!0),i.lineTo(t+n-o.bottomRight,r+s),i.arc(t+n-o.bottomRight,r+s-o.bottomRight,o.bottomRight,st,0,!0),i.lineTo(t+n,r+o.topRight),i.arc(t+n-o.topRight,r+o.topRight,o.topRight,0,-st,!0),i.lineTo(t+o.topLeft,r)}var Hc=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Bc=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Yc(i,e){let t=(""+i).match(Hc);if(!t||t[1]==="normal")return e*1.2;switch(i=+t[2],t[3]){case"px":return i;case"%":i/=100;break}return e*i}var Uc=i=>+i||0;function Qi(i,e){let t={},r=V(e),n=r?Object.keys(e):e,s=V(i)?r?o=>W(i[o],i[e[o]]):o=>i[o]:()=>i;for(let o of n)t[o]=Uc(s(o));return t}function kn(i){return Qi(i,{top:"y",right:"x",bottom:"y",left:"x"})}function oe(i){return Qi(i,["topLeft","topRight","bottomLeft","bottomRight"])}function ht(i){let e=kn(i);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function ot(i,e){i=i||{},e=e||it.font;let t=W(i.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let r=W(i.style,e.style);r&&!(""+r).match(Bc)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);let n={family:W(i.family,e.family),lineHeight:Yc(W(i.lineHeight,e.lineHeight),t),size:t,style:r,weight:W(i.weight,e.weight),string:""};return n.string=Fc(n),n}function He(i,e,t,r){let n=!0,s,o,a;for(s=0,o=i.length;s<o;++s)if(a=i[s],a!==void 0&&(e!==void 0&&typeof a=="function"&&(a=a(e),n=!1),t!==void 0&&tt(a)&&(a=a[t%a.length],n=!1),a!==void 0))return r&&!n&&(r.cacheable=!1),a}function vo(i,e,t){let{min:r,max:n}=i,s=cn(e,(n-r)/2),o=(a,l)=>t&&a===0?0:a+l;return{min:o(r,-Math.abs(s)),max:o(n,s)}}function qt(i,e){return Object.assign(Object.create(i),e)}function Gi(i,e=[""],t,r,n=()=>i[0]){let s=t||i;typeof r>"u"&&(r=wo("_fallback",i));let o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:s,_fallback:r,_getTarget:n,override:a=>Gi([a,...i],e,s,r)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete i[0][l],!0},get(a,l){return yo(a,l,()=>Kc(l,e,i,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(a,l){return Ks(a).includes(l)},ownKeys(a){return Ks(a)},set(a,l,c){let u=a._storage||(a._storage=n());return a[l]=u[l]=c,delete a._keys,!0}})}function pe(i,e,t,r){let n={_cacheable:!1,_proxy:i,_context:e,_subProxy:t,_stack:new Set,_descriptors:Dn(i,r),setContext:s=>pe(i,s,t,r),override:s=>pe(i.override(s),e,t,r)};return new Proxy(n,{deleteProperty(s,o){return delete s[o],delete i[o],!0},get(s,o,a){return yo(s,o,()=>jc(s,o,a))},getOwnPropertyDescriptor(s,o){return s._descriptors.allKeys?Reflect.has(i,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,o)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(s,o){return Reflect.has(i,o)},ownKeys(){return Reflect.ownKeys(i)},set(s,o,a){return i[o]=a,delete s[o],!0}})}function Dn(i,e={scriptable:!0,indexable:!0}){let{_scriptable:t=e.scriptable,_indexable:r=e.indexable,_allKeys:n=e.allKeys}=i;return{allKeys:n,scriptable:t,indexable:r,isScriptable:Ut(t)?t:()=>t,isIndexable:Ut(r)?r:()=>r}}var Vc=(i,e)=>i?i+Ui(e):e,Cn=(i,e)=>V(e)&&i!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function yo(i,e,t){if(Object.prototype.hasOwnProperty.call(i,e)||e==="constructor")return i[e];let r=t();return i[e]=r,r}function jc(i,e,t){let{_proxy:r,_context:n,_subProxy:s,_descriptors:o}=i,a=r[e];return Ut(a)&&o.isScriptable(e)&&(a=qc(e,a,i,t)),tt(a)&&a.length&&(a=$c(e,a,i,o.isIndexable)),Cn(e,a)&&(a=pe(a,n,s&&s[e],o)),a}function qc(i,e,t,r){let{_proxy:n,_context:s,_subProxy:o,_stack:a}=t;if(a.has(i))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+i);a.add(i);let l=e(s,o||r);return a.delete(i),Cn(i,l)&&(l=Pn(n._scopes,n,i,l)),l}function $c(i,e,t,r){let{_proxy:n,_context:s,_subProxy:o,_descriptors:a}=t;if(typeof s.index<"u"&&r(i))return e[s.index%e.length];if(V(e[0])){let l=e,c=n._scopes.filter(u=>u!==l);e=[];for(let u of l){let f=Pn(c,n,i,u);e.push(pe(f,s,o&&o[i],a))}}return e}function _o(i,e,t){return Ut(i)?i(e,t):i}var Xc=(i,e)=>i===!0?e:typeof i=="string"?jt(e,i):void 0;function Qc(i,e,t,r,n){for(let s of e){let o=Xc(t,s);if(o){i.add(o);let a=_o(o._fallback,t,n);if(typeof a<"u"&&a!==t&&a!==r)return a}else if(o===!1&&typeof r<"u"&&t!==r)return null}return!1}function Pn(i,e,t,r){let n=e._rootScopes,s=_o(e._fallback,t,r),o=[...i,...n],a=new Set;a.add(r);let l=Gs(a,o,t,s||t,r);return l===null||typeof s<"u"&&s!==t&&(l=Gs(a,o,s,l,r),l===null)?!1:Gi(Array.from(a),[""],n,s,()=>Gc(e,t,r))}function Gs(i,e,t,r,n){for(;t;)t=Qc(i,e,t,r,n);return t}function Gc(i,e,t){let r=i._getTarget();e in r||(r[e]={});let n=r[e];return tt(n)&&V(t)?t:n||{}}function Kc(i,e,t,r){let n;for(let s of e)if(n=wo(Vc(s,i),t),typeof n<"u")return Cn(i,n)?Pn(t,r,i,n):n}function wo(i,e){for(let t of e){if(!t)continue;let r=t[i];if(typeof r<"u")return r}}function Ks(i){let e=i._keys;return e||(e=i._keys=Zc(i._scopes)),e}function Zc(i){let e=new Set;for(let t of i)for(let r of Object.keys(t).filter(n=>!n.startsWith("_")))e.add(r);return Array.from(e)}function On(i,e,t,r){let{iScale:n}=i,{key:s="r"}=this._parsing,o=new Array(r),a,l,c,u;for(a=0,l=r;a<l;++a)c=a+t,u=e[c],o[a]={r:n.parse(jt(u,s),c)};return o}var Jc=Number.EPSILON||1e-14,Le=(i,e)=>e<i.length&&!i[e].skip&&i[e],Mo=i=>i==="x"?"y":"x";function tu(i,e,t,r){let n=i.skip?e:i,s=e,o=t.skip?e:t,a=Bi(s,n),l=Bi(o,s),c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;let f=r*c,d=r*u;return{previous:{x:s.x-f*(o.x-n.x),y:s.y-f*(o.y-n.y)},next:{x:s.x+d*(o.x-n.x),y:s.y+d*(o.y-n.y)}}}function eu(i,e,t){let r=i.length,n,s,o,a,l,c=Le(i,0);for(let u=0;u<r-1;++u)if(l=c,c=Le(i,u+1),!(!l||!c)){if(Fe(e[u],0,Jc)){t[u]=t[u+1]=0;continue}n=t[u]/e[u],s=t[u+1]/e[u],a=Math.pow(n,2)+Math.pow(s,2),!(a<=9)&&(o=3/Math.sqrt(a),t[u]=n*o*e[u],t[u+1]=s*o*e[u])}}function iu(i,e,t="x"){let r=Mo(t),n=i.length,s,o,a,l=Le(i,0);for(let c=0;c<n;++c){if(o=a,a=l,l=Le(i,c+1),!a)continue;let u=a[t],f=a[r];o&&(s=(u-o[t])/3,a[`cp1${t}`]=u-s,a[`cp1${r}`]=f-s*e[c]),l&&(s=(l[t]-u)/3,a[`cp2${t}`]=u+s,a[`cp2${r}`]=f+s*e[c])}}function ru(i,e="x"){let t=Mo(e),r=i.length,n=Array(r).fill(0),s=Array(r),o,a,l,c=Le(i,0);for(o=0;o<r;++o)if(a=l,l=c,c=Le(i,o+1),!!l){if(c){let u=c[e]-l[e];n[o]=u!==0?(c[t]-l[t])/u:0}s[o]=a?c?At(n[o-1])!==At(n[o])?0:(n[o-1]+n[o])/2:n[o-1]:n[o]}eu(i,n,s),iu(i,s,e)}function Fi(i,e,t){return Math.max(Math.min(i,t),e)}function nu(i,e){let t,r,n,s,o,a=Rt(i[0],e);for(t=0,r=i.length;t<r;++t)o=s,s=a,a=t<r-1&&Rt(i[t+1],e),s&&(n=i[t],o&&(n.cp1x=Fi(n.cp1x,e.left,e.right),n.cp1y=Fi(n.cp1y,e.top,e.bottom)),a&&(n.cp2x=Fi(n.cp2x,e.left,e.right),n.cp2y=Fi(n.cp2y,e.top,e.bottom)))}function To(i,e,t,r,n){let s,o,a,l;if(e.spanGaps&&(i=i.filter(c=>!c.skip)),e.cubicInterpolationMode==="monotone")ru(i,n);else{let c=r?i[i.length-1]:i[0];for(s=0,o=i.length;s<o;++s)a=i[s],l=tu(c,a,i[Math.min(s+1,o-(r?0:1))%o],e.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}e.capBezierPoints&&nu(i,t)}function Ki(){return typeof window<"u"&&typeof document<"u"}function Zi(i){let e=i.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function Yi(i,e,t){let r;return typeof i=="string"?(r=parseInt(i,10),i.indexOf("%")!==-1&&(r=r/100*e.parentNode[t])):r=i,r}var Ji=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function su(i,e){return Ji(i).getPropertyValue(e)}var ou=["top","right","bottom","left"];function me(i,e,t){let r={};t=t?"-"+t:"";for(let n=0;n<4;n++){let s=ou[n];r[s]=parseFloat(i[e+"-"+s+t])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}var au=(i,e,t)=>(i>0||e>0)&&(!t||!t.shadowRoot);function lu(i,e){let t=i.touches,r=t&&t.length?t[0]:i,{offsetX:n,offsetY:s}=r,o=!1,a,l;if(au(n,s,i.target))a=n,l=s;else{let c=e.getBoundingClientRect();a=r.clientX-c.left,l=r.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function ae(i,e){if("native"in i)return i;let{canvas:t,currentDevicePixelRatio:r}=e,n=Ji(t),s=n.boxSizing==="border-box",o=me(n,"padding"),a=me(n,"border","width"),{x:l,y:c,box:u}=lu(i,t),f=o.left+(u&&a.left),d=o.top+(u&&a.top),{width:h,height:m}=e;return s&&(h-=o.width+a.width,m-=o.height+a.height),{x:Math.round((l-f)/h*t.width/r),y:Math.round((c-d)/m*t.height/r)}}function cu(i,e,t){let r,n;if(e===void 0||t===void 0){let s=i&&Zi(i);if(!s)e=i.clientWidth,t=i.clientHeight;else{let o=s.getBoundingClientRect(),a=Ji(s),l=me(a,"border","width"),c=me(a,"padding");e=o.width-c.width-l.width,t=o.height-c.height-l.height,r=Yi(a.maxWidth,s,"clientWidth"),n=Yi(a.maxHeight,s,"clientHeight")}}return{width:e,height:t,maxWidth:r||Hi,maxHeight:n||Hi}}var zi=i=>Math.round(i*10)/10;function ko(i,e,t,r){let n=Ji(i),s=me(n,"margin"),o=Yi(n.maxWidth,i,"clientWidth")||Hi,a=Yi(n.maxHeight,i,"clientHeight")||Hi,l=cu(i,e,t),{width:c,height:u}=l;if(n.boxSizing==="content-box"){let d=me(n,"border","width"),h=me(n,"padding");c-=h.width+d.width,u-=h.height+d.height}return c=Math.max(0,c-s.width),u=Math.max(0,r?c/r:u-s.height),c=zi(Math.min(c,o,l.maxWidth)),u=zi(Math.min(u,a,l.maxHeight)),c&&!u&&(u=zi(c/2)),(e!==void 0||t!==void 0)&&r&&l.height&&u>l.height&&(u=l.height,c=zi(Math.floor(u*r))),{width:c,height:u}}function Sn(i,e,t){let r=e||1,n=Math.floor(i.height*r),s=Math.floor(i.width*r);i.height=Math.floor(i.height),i.width=Math.floor(i.width);let o=i.canvas;return o.style&&(t||!o.style.height&&!o.style.width)&&(o.style.height=`${i.height}px`,o.style.width=`${i.width}px`),i.currentDevicePixelRatio!==r||o.height!==n||o.width!==s?(i.currentDevicePixelRatio=r,o.height=n,o.width=s,i.ctx.setTransform(r,0,0,r,0,0),!0):!1}var Do=(function(){let i=!1;try{let e={get passive(){return i=!0,!1}};Ki()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return i})();function An(i,e){let t=su(i,e),r=t&&t.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function ie(i,e,t,r){return{x:i.x+t*(e.x-i.x),y:i.y+t*(e.y-i.y)}}function Co(i,e,t,r){return{x:i.x+t*(e.x-i.x),y:r==="middle"?t<.5?i.y:e.y:r==="after"?t<1?i.y:e.y:t>0?e.y:i.y}}function Po(i,e,t,r){let n={x:i.cp2x,y:i.cp2y},s={x:e.cp1x,y:e.cp1y},o=ie(i,n,t),a=ie(n,s,t),l=ie(s,e,t),c=ie(o,a,t),u=ie(a,l,t);return ie(c,u,t)}var uu=function(i,e){return{x(t){return i+i+e-t},setWidth(t){e=t},textAlign(t){return t==="center"?t:t==="right"?"left":"right"},xPlus(t,r){return t-r},leftForLtr(t,r){return t-r}}},fu=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,e){return i+e},leftForLtr(i,e){return i}}};function be(i,e,t){return i?uu(e,t):fu()}function In(i,e){let t,r;(e==="ltr"||e==="rtl")&&(t=i.canvas.style,r=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",e,"important"),i.prevTextDirection=r)}function Ln(i,e){e!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",e[0],e[1]))}function Oo(i){return i==="angle"?{between:ze,compare:Pc,normalize:ft}:{between:zt,compare:(e,t)=>e-t,normalize:e=>e}}function Zs({start:i,end:e,count:t,loop:r,style:n}){return{start:i%t,end:e%t,loop:r&&(e-i+1)%t===0,style:n}}function du(i,e,t){let{property:r,start:n,end:s}=t,{between:o,normalize:a}=Oo(r),l=e.length,{start:c,end:u,loop:f}=i,d,h;if(f){for(c+=l,u+=l,d=0,h=l;d<h&&o(a(e[c%l][r]),n,s);++d)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:f,style:i.style}}function En(i,e,t){if(!t)return[i];let{property:r,start:n,end:s}=t,o=e.length,{compare:a,between:l,normalize:c}=Oo(r),{start:u,end:f,loop:d,style:h}=du(i,e,t),m=[],p=!1,g=null,b,x,w,T=()=>l(n,w,b)&&a(n,w)!==0,v=()=>a(s,b)===0||l(s,w,b),_=()=>p||T(),P=()=>!p||v();for(let C=u,O=u;C<=f;++C)x=e[C%o],!x.skip&&(b=c(x[r]),b!==w&&(p=l(b,n,s),g===null&&_()&&(g=a(b,n)===0?C:O),g!==null&&P()&&(m.push(Zs({start:g,end:C,loop:d,count:o,style:h})),g=null),O=C,w=b));return g!==null&&m.push(Zs({start:g,end:f,loop:d,count:o,style:h})),m}function Rn(i,e){let t=[],r=i.segments;for(let n=0;n<r.length;n++){let s=En(r[n],i.points,e);s.length&&t.push(...s)}return t}function hu(i,e,t,r){let n=0,s=e-1;if(t&&!r)for(;n<e&&!i[n].skip;)n++;for(;n<e&&i[n].skip;)n++;for(n%=e,t&&(s+=n);s>n&&i[s%e].skip;)s--;return s%=e,{start:n,end:s}}function mu(i,e,t,r){let n=i.length,s=[],o=e,a=i[e],l;for(l=e+1;l<=t;++l){let c=i[l%n];c.skip||c.stop?a.skip||(r=!1,s.push({start:e%n,end:(l-1)%n,loop:r}),e=o=c.stop?l:null):(o=l,a.skip&&(e=l)),a=c}return o!==null&&s.push({start:e%n,end:o%n,loop:r}),s}function So(i,e){let t=i.points,r=i.options.spanGaps,n=t.length;if(!n)return[];let s=!!i._loop,{start:o,end:a}=hu(t,n,s,r);if(r===!0)return Js(i,[{start:o,end:a,loop:s}],t,e);let l=a<o?a+n:a,c=!!i._fullLoop&&o===0&&a===n-1;return Js(i,mu(t,o,l,c),t,e)}function Js(i,e,t,r){return!r||!r.setContext||!t?e:pu(i,e,t,r)}function pu(i,e,t,r){let n=i._chart.getContext(),s=to(i.options),{_datasetIndex:o,options:{spanGaps:a}}=i,l=t.length,c=[],u=s,f=e[0].start,d=f;function h(m,p,g,b){let x=a?-1:1;if(m!==p){for(m+=l;t[m%l].skip;)m-=x;for(;t[p%l].skip;)p+=x;m%l!==p%l&&(c.push({start:m%l,end:p%l,loop:g,style:b}),u=b,f=p%l)}}for(let m of e){f=a?f:m.start;let p=t[f%l],g;for(d=f+1;d<=m.end;d++){let b=t[d%l];g=to(r.setContext(qt(n,{type:"segment",p0:p,p1:b,p0DataIndex:(d-1)%l,p1DataIndex:d%l,datasetIndex:o}))),gu(g,u)&&h(f,d-1,m.loop,u),p=b,u=g}f<d-1&&h(f,d-1,m.loop,u)}return c}function to(i){return{backgroundColor:i.backgroundColor,borderCapStyle:i.borderCapStyle,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderJoinStyle:i.borderJoinStyle,borderWidth:i.borderWidth,borderColor:i.borderColor}}function gu(i,e){if(!e)return!1;let t=[],r=function(n,s){return _n(s)?(t.includes(s)||t.push(s),t.indexOf(s)):s};return JSON.stringify(i,r)!==JSON.stringify(e,r)}function Ni(i,e,t){return i.options.clip?i[t]:e[t]}function bu(i,e){let{xScale:t,yScale:r}=i;return t&&r?{left:Ni(t,e,"left"),right:Ni(t,e,"right"),top:Ni(r,e,"top"),bottom:Ni(r,e,"bottom")}:e}function Fn(i,e){let t=e._clip;if(t.disabled)return!1;let r=bu(e,i.chartArea);return{left:t.left===!1?0:r.left-(t.left===!0?0:t.left),right:t.right===!1?i.width:r.right+(t.right===!0?0:t.right),top:t.top===!1?0:r.top-(t.top===!0?0:t.top),bottom:t.bottom===!1?i.height:r.bottom+(t.bottom===!0?0:t.bottom)}}var Xn=class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,r,n){let s=t.listeners[n],o=t.duration;s.forEach(a=>a({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(r-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=bn.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((r,n)=>{if(!r.running||!r.items.length)return;let s=r.items,o=s.length-1,a=!1,l;for(;o>=0;--o)l=s[o],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(e),a=!0):(s[o]=s[s.length-1],s.pop());a&&(n.draw(),this._notify(n,r,e,"progress")),s.length||(r.running=!1,this._notify(n,r,e,"complete"),r.initial=!1),t+=s.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){let t=this._charts,r=t.get(e);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,r)),r}listen(e,t,r){this._getAnims(e).listeners[t].push(r)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){let t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((r,n)=>Math.max(r,n._duration),0),this._refresh())}running(e){if(!this._running)return!1;let t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){let t=this._charts.get(e);if(!t||!t.items.length)return;let r=t.items,n=r.length-1;for(;n>=0;--n)r[n].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}},$t=new Xn,Ao="transparent",xu={boolean(i,e,t){return t>.5?e:i},color(i,e,t){let r=wn(i||Ao),n=r.valid&&wn(e||Ao);return n&&n.valid?n.mix(r,t).hexString():e},number(i,e,t){return i+(e-i)*t}},Qn=class{constructor(e,t,r,n){let s=t[r];n=He([e.to,n,s,e.from]);let o=He([e.from,s,n]);this._active=!0,this._fn=e.fn||xu[e.type||typeof o],this._easing=Ae[e.easing]||Ae.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=r,this._from=o,this._to=n,this._promises=void 0}active(){return this._active}update(e,t,r){if(this._active){this._notify(!1);let n=this._target[this._prop],s=r-this._start,o=this._duration-s;this._start=r,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=s,this._loop=!!e.loop,this._to=He([e.to,t,n,e.from]),this._from=He([e.from,n,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){let t=e-this._start,r=this._duration,n=this._prop,s=this._from,o=this._loop,a=this._to,l;if(this._active=s!==a&&(o||t<r),!this._active){this._target[n]=a,this._notify(!0);return}if(t<0){this._target[n]=s;return}l=t/r%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(s,a,l)}wait(){let e=this._promises||(this._promises=[]);return new Promise((t,r)=>{e.push({res:t,rej:r})})}_notify(e){let t=e?"res":"rej",r=this._promises||[];for(let n=0;n<r.length;n++)r[n][t]()}},lr=class{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!V(e))return;let t=Object.keys(it.animation),r=this._properties;Object.getOwnPropertyNames(e).forEach(n=>{let s=e[n];if(!V(s))return;let o={};for(let a of t)o[a]=s[a];(tt(s.properties)&&s.properties||[n]).forEach(a=>{(a===n||!r.has(a))&&r.set(a,o)})})}_animateOptions(e,t){let r=t.options,n=yu(e,r);if(!n)return[];let s=this._createAnimations(n,r);return r.$shared&&vu(e.options.$animations,r).then(()=>{e.options=r},()=>{}),s}_createAnimations(e,t){let r=this._properties,n=[],s=e.$animations||(e.$animations={}),o=Object.keys(t),a=Date.now(),l;for(l=o.length-1;l>=0;--l){let c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(e,t));continue}let u=t[c],f=s[c],d=r.get(c);if(f)if(d&&f.active()){f.update(d,u,a);continue}else f.cancel();if(!d||!d.duration){e[c]=u;continue}s[c]=f=new Qn(d,e,c,u),n.push(f)}return n}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}let r=this._createAnimations(e,t);if(r.length)return $t.add(this._chart,r),!0}};function vu(i,e){let t=[],r=Object.keys(e);for(let n=0;n<r.length;n++){let s=i[r[n]];s&&s.active()&&t.push(s.wait())}return Promise.all(t)}function yu(i,e){if(!e)return;let t=i.options;if(!t){i.options=e;return}return t.$shared&&(i.options=t=Object.assign({},t,{$shared:!1,$animations:{}})),t}function Io(i,e){let t=i&&i.options||{},r=t.reverse,n=t.min===void 0?e:0,s=t.max===void 0?e:0;return{start:r?s:n,end:r?n:s}}function _u(i,e,t){if(t===!1)return!1;let r=Io(i,t),n=Io(e,t);return{top:n.end,right:r.end,bottom:n.start,left:r.start}}function wu(i){let e,t,r,n;return V(i)?(e=i.top,t=i.right,r=i.bottom,n=i.left):e=t=r=n=i,{top:e,right:t,bottom:r,left:n,disabled:i===!1}}function Aa(i,e){let t=[],r=i._getSortedDatasetMetas(e),n,s;for(n=0,s=r.length;n<s;++n)t.push(r[n].index);return t}function Lo(i,e,t,r={}){let n=i.keys,s=r.mode==="single",o,a,l,c;if(e===null)return;let u=!1;for(o=0,a=n.length;o<a;++o){if(l=+n[o],l===t){if(u=!0,r.all)continue;break}c=i.values[l],nt(c)&&(s||e===0||At(e)===At(c))&&(e+=c)}return!u&&!r.all?0:e}function Mu(i,e){let{iScale:t,vScale:r}=e,n=t.axis==="x"?"x":"y",s=r.axis==="x"?"x":"y",o=Object.keys(i),a=new Array(o.length),l,c,u;for(l=0,c=o.length;l<c;++l)u=o[l],a[l]={[n]:u,[s]:i[u]};return a}function zn(i,e){let t=i&&i.options.stacked;return t||t===void 0&&e.stack!==void 0}function Tu(i,e,t){return`${i.id}.${e.id}.${t.stack||t.type}`}function ku(i){let{min:e,max:t,minDefined:r,maxDefined:n}=i.getUserBounds();return{min:r?e:Number.NEGATIVE_INFINITY,max:n?t:Number.POSITIVE_INFINITY}}function Du(i,e,t){let r=i[e]||(i[e]={});return r[t]||(r[t]={})}function Eo(i,e,t,r){for(let n of e.getMatchingVisibleMetas(r).reverse()){let s=i[n.index];if(t&&s>0||!t&&s<0)return n.index}return null}function Ro(i,e){let{chart:t,_cachedMeta:r}=i,n=t._stacks||(t._stacks={}),{iScale:s,vScale:o,index:a}=r,l=s.axis,c=o.axis,u=Tu(s,o,r),f=e.length,d;for(let h=0;h<f;++h){let m=e[h],{[l]:p,[c]:g}=m,b=m._stacks||(m._stacks={});d=b[c]=Du(n,u,p),d[a]=g,d._top=Eo(d,o,!0,r.type),d._bottom=Eo(d,o,!1,r.type);let x=d._visualValues||(d._visualValues={});x[a]=g}}function Nn(i,e){let t=i.scales;return Object.keys(t).filter(r=>t[r].axis===e).shift()}function Cu(i,e){return qt(i,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function Pu(i,e,t){return qt(i,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function ci(i,e){let t=i.controller.index,r=i.vScale&&i.vScale.axis;if(r){e=e||i._parsed;for(let n of e){let s=n._stacks;if(!s||s[r]===void 0||s[r][t]===void 0)return;delete s[r][t],s[r]._visualValues!==void 0&&s[r]._visualValues[t]!==void 0&&delete s[r]._visualValues[t]}}}var Wn=i=>i==="reset"||i==="none",Fo=(i,e)=>e?i:Object.assign({},i),Ou=(i,e,t)=>i&&!e.hidden&&e._stacked&&{keys:Aa(t,!0),values:null},ce=(()=>{class i{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,r){this.chart=t,this._ctx=t.ctx,this.index=r,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=zn(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&&ci(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,r=this._cachedMeta,n=this.getDataset(),s=(d,h,m,p)=>d==="x"?h:d==="r"?p:m,o=r.xAxisID=W(n.xAxisID,Nn(t,"x")),a=r.yAxisID=W(n.yAxisID,Nn(t,"y")),l=r.rAxisID=W(n.rAxisID,Nn(t,"r")),c=r.indexAxis,u=r.iAxisID=s(c,o,a,l),f=r.vAxisID=s(c,a,o,l);r.xScale=this.getScaleForId(o),r.yScale=this.getScaleForId(a),r.rScale=this.getScaleForId(l),r.iScale=this.getScaleForId(u),r.vScale=this.getScaleForId(f)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let r=this._cachedMeta;return t===r.iScale?r.vScale:r.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&pn(this._data,this),t._stacked&&ci(t)}_dataCheck(){let t=this.getDataset(),r=t.data||(t.data=[]),n=this._data;if(V(r)){let s=this._cachedMeta;this._data=Mu(r,s)}else if(n!==r){if(n){pn(n,this);let s=this._cachedMeta;ci(s),s._parsed=[]}r&&Object.isExtensible(r)&&fo(r,this),this._syncList=[],this._data=r}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let r=this._cachedMeta,n=this.getDataset(),s=!1;this._dataCheck();let o=r._stacked;r._stacked=zn(r.vScale,r),r.stack!==n.stack&&(s=!0,ci(r),r.stack=n.stack),this._resyncElements(t),(s||o!==r._stacked)&&(Ro(this,r._parsed),r._stacked=zn(r.vScale,r))}configure(){let t=this.chart.config,r=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),r,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,r){let{_cachedMeta:n,_data:s}=this,{iScale:o,_stacked:a}=n,l=o.axis,c=t===0&&r===s.length?!0:n._sorted,u=t>0&&n._parsed[t-1],f,d,h;if(this._parsing===!1)n._parsed=s,n._sorted=!0,h=s;else{tt(s[t])?h=this.parseArrayData(n,s,t,r):V(s[t])?h=this.parseObjectData(n,s,t,r):h=this.parsePrimitiveData(n,s,t,r);let m=()=>d[l]===null||u&&d[l]<u[l];for(f=0;f<r;++f)n._parsed[f+t]=d=h[f],c&&(m()&&(c=!1),u=d);n._sorted=c}a&&Ro(this,h)}parsePrimitiveData(t,r,n,s){let{iScale:o,vScale:a}=t,l=o.axis,c=a.axis,u=o.getLabels(),f=o===a,d=new Array(s),h,m,p;for(h=0,m=s;h<m;++h)p=h+n,d[h]={[l]:f||o.parse(u[p],p),[c]:a.parse(r[p],p)};return d}parseArrayData(t,r,n,s){let{xScale:o,yScale:a}=t,l=new Array(s),c,u,f,d;for(c=0,u=s;c<u;++c)f=c+n,d=r[f],l[c]={x:o.parse(d[0],f),y:a.parse(d[1],f)};return l}parseObjectData(t,r,n,s){let{xScale:o,yScale:a}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,u=new Array(s),f,d,h,m;for(f=0,d=s;f<d;++f)h=f+n,m=r[h],u[f]={x:o.parse(jt(m,l),h),y:a.parse(jt(m,c),h)};return u}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,r,n){let s=this.chart,o=this._cachedMeta,a=r[t.axis],l={keys:Aa(s,!0),values:r._stacks[t.axis]._visualValues};return Lo(l,a,o.index,{mode:n})}updateRangeFromParsed(t,r,n,s){let o=n[r.axis],a=o===null?NaN:o,l=s&&n._stacks[r.axis];s&&l&&(s.values=l,a=Lo(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,r){let n=this._cachedMeta,s=n._parsed,o=n._sorted&&t===n.iScale,a=s.length,l=this._getOtherScale(t),c=Ou(r,n,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:f,max:d}=ku(l),h,m;function p(){m=s[h];let g=m[l.axis];return!nt(m[t.axis])||f>g||d<g}for(h=0;h<a&&!(!p()&&(this.updateRangeFromParsed(u,t,m,c),o));++h);if(o){for(h=a-1;h>=0;--h)if(!p()){this.updateRangeFromParsed(u,t,m,c);break}}return u}getAllParsedValues(t){let r=this._cachedMeta._parsed,n=[],s,o,a;for(s=0,o=r.length;s<o;++s)a=r[s][t.axis],nt(a)&&n.push(a);return n}getMaxOverflow(){return!1}getLabelAndValue(t){let r=this._cachedMeta,n=r.iScale,s=r.vScale,o=this.getParsed(t);return{label:n?""+n.getLabelForValue(o[n.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){let r=this._cachedMeta;this.update(t||"default"),r._clip=wu(W(this.options.clip,_u(r.xScale,r.yScale,this.getMaxOverflow())))}update(t){}draw(){let t=this._ctx,r=this.chart,n=this._cachedMeta,s=n.data||[],o=r.chartArea,a=[],l=this._drawStart||0,c=this._drawCount||s.length-l,u=this.options.drawActiveElementsOnTop,f;for(n.dataset&&n.dataset.draw(t,o,l,c),f=l;f<l+c;++f){let d=s[f];d.hidden||(d.active&&u?a.push(d):d.draw(t,o))}for(f=0;f<a.length;++f)a[f].draw(t,o)}getStyle(t,r){let n=r?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,r,n){let s=this.getDataset(),o;if(t>=0&&t<this._cachedMeta.data.length){let a=this._cachedMeta.data[t];o=a.$context||(a.$context=Pu(this.getContext(),t,a)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=Cu(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!r,o.mode=n,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,r){return this._resolveElementOptions(this.dataElementType.id,r,t)}_resolveElementOptions(t,r="default",n){let s=r==="active",o=this._cachedDataOpts,a=t+"-"+r,l=o[a],c=this.enableOptionSharing&&Re(n);if(l)return Fo(l,c);let u=this.chart.config,f=u.datasetElementScopeKeys(this._type,t),d=s?[`${t}Hover`,"hover",t,""]:[t,""],h=u.getOptionScopes(this.getDataset(),f),m=Object.keys(it.elements[t]),p=()=>this.getContext(n,s,r),g=u.resolveNamedOptions(h,m,p,d);return g.$shared&&(g.$shared=c,o[a]=Object.freeze(Fo(g,c))),g}_resolveAnimations(t,r,n){let s=this.chart,o=this._cachedDataOpts,a=`animation-${r}`,l=o[a];if(l)return l;let c;if(s.options.animation!==!1){let f=this.chart.config,d=f.datasetAnimationScopeKeys(this._type,r),h=f.getOptionScopes(this.getDataset(),d);c=f.createResolver(h,this.getContext(t,n,r))}let u=new lr(s,c&&c.animations);return c&&c._cacheable&&(o[a]=Object.freeze(u)),u}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,r){return!r||Wn(t)||this.chart._animationsDisabled}_getSharedOptions(t,r){let n=this.resolveDataElementOptions(t,r),s=this._sharedOptions,o=this.getSharedOptions(n),a=this.includeOptions(r,o)||o!==s;return this.updateSharedOptions(o,r,n),{sharedOptions:o,includeOptions:a}}updateElement(t,r,n,s){Wn(s)?Object.assign(t,n):this._resolveAnimations(r,s).update(t,n)}updateSharedOptions(t,r,n){t&&!Wn(r)&&this._resolveAnimations(void 0,r).update(t,n)}_setStyle(t,r,n,s){t.active=s;let o=this.getStyle(r,s);this._resolveAnimations(r,n,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,r,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,r,n){this._setStyle(t,n,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let r=this._data,n=this._cachedMeta.data;for(let[l,c,u]of this._syncList)this[l](c,u);this._syncList=[];let s=n.length,o=r.length,a=Math.min(o,s);a&&this.parse(0,a),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,r,n=!0){let s=this._cachedMeta,o=s.data,a=t+r,l,c=u=>{for(u.length+=r,l=u.length-1;l>=a;l--)u[l]=u[l-r]};for(c(o),l=t;l<a;++l)o[l]=new this.dataElementType;this._parsing&&c(s._parsed),this.parse(t,r),n&&this.updateElements(o,t,r,"reset")}updateElements(t,r,n,s){}_removeElements(t,r){let n=this._cachedMeta;if(this._parsing){let s=n._parsed.splice(t,r);n._stacked&&ci(n,s)}n.data.splice(t,r)}_sync(t){if(this._parsing)this._syncList.push(t);else{let[r,n,s]=t;this[r](n,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){let t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,r){r&&this._sync(["_removeElements",t,r]);let n=arguments.length-2;n&&this._sync(["_insertElements",t,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}return i})();function Su(i,e){if(!i._cache.$bar){let t=i.getMatchingVisibleMetas(e),r=[];for(let n=0,s=t.length;n<s;n++)r=r.concat(t[n].controller.getAllParsedValues(i));i._cache.$bar=gn(r.sort((n,s)=>n-s))}return i._cache.$bar}function Au(i){let e=i.iScale,t=Su(e,i.type),r=e._length,n,s,o,a,l=()=>{o===32767||o===-32768||(Re(a)&&(r=Math.min(r,Math.abs(o-a)||r)),a=o)};for(n=0,s=t.length;n<s;++n)o=e.getPixelForValue(t[n]),l();for(a=void 0,n=0,s=e.ticks.length;n<s;++n)o=e.getPixelForTick(n),l();return r}function Iu(i,e,t,r){let n=t.barThickness,s,o;return U(n)?(s=e.min*t.categoryPercentage,o=t.barPercentage):(s=n*r,o=1),{chunk:s/r,ratio:o,start:e.pixels[i]-s/2}}function Lu(i,e,t,r){let n=e.pixels,s=n[i],o=i>0?n[i-1]:null,a=i<n.length-1?n[i+1]:null,l=t.categoryPercentage;o===null&&(o=s-(a===null?e.end-e.start:a-s)),a===null&&(a=s+s-o);let c=s-(s-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/r,ratio:t.barPercentage,start:c}}function Eu(i,e,t,r){let n=t.parse(i[0],r),s=t.parse(i[1],r),o=Math.min(n,s),a=Math.max(n,s),l=o,c=a;Math.abs(o)>Math.abs(a)&&(l=a,c=o),e[t.axis]=c,e._custom={barStart:l,barEnd:c,start:n,end:s,min:o,max:a}}function Ia(i,e,t,r){return tt(i)?Eu(i,e,t,r):e[t.axis]=t.parse(i,r),e}function zo(i,e,t,r){let n=i.iScale,s=i.vScale,o=n.getLabels(),a=n===s,l=[],c,u,f,d;for(c=t,u=t+r;c<u;++c)d=e[c],f={},f[n.axis]=a||n.parse(o[c],c),l.push(Ia(d,f,s,c));return l}function Hn(i){return i&&i.barStart!==void 0&&i.barEnd!==void 0}function Ru(i,e,t){return i!==0?At(i):(e.isHorizontal()?1:-1)*(e.min>=t?1:-1)}function Fu(i){let e,t,r,n,s;return i.horizontal?(e=i.base>i.x,t="left",r="right"):(e=i.base<i.y,t="bottom",r="top"),e?(n="end",s="start"):(n="start",s="end"),{start:t,end:r,reverse:e,top:n,bottom:s}}function zu(i,e,t,r){let n=e.borderSkipped,s={};if(!n){i.borderSkipped=s;return}if(n===!0){i.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}let{start:o,end:a,reverse:l,top:c,bottom:u}=Fu(i);n==="middle"&&t&&(i.enableBorderRadius=!0,(t._top||0)===r?n=c:(t._bottom||0)===r?n=u:(s[No(u,o,a,l)]=!0,n=c)),s[No(n,o,a,l)]=!0,i.borderSkipped=s}function No(i,e,t,r){return r?(i=Nu(i,e,t),i=Wo(i,t,e)):i=Wo(i,e,t),i}function Nu(i,e,t){return i===e?t:i===t?e:i}function Wo(i,e,t){return i==="start"?e:i==="end"?t:i}function Wu(i,{inflateAmount:e},t){i.inflateAmount=e==="auto"?t===1?.33:0:e}var Hu=(()=>{class i extends ce{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,r,n,s){return zo(t,r,n,s)}parseArrayData(t,r,n,s){return zo(t,r,n,s)}parseObjectData(t,r,n,s){let{iScale:o,vScale:a}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,u=o.axis==="x"?l:c,f=a.axis==="x"?l:c,d=[],h,m,p,g;for(h=n,m=n+s;h<m;++h)g=r[h],p={},p[o.axis]=o.parse(jt(g,u),h),d.push(Ia(jt(g,f),p,a,h));return d}updateRangeFromParsed(t,r,n,s){super.updateRangeFromParsed(t,r,n,s);let o=n._custom;o&&r===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){let r=this._cachedMeta,{iScale:n,vScale:s}=r,o=this.getParsed(t),a=o._custom,l=Hn(a)?"["+a.start+", "+a.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+n.getLabelForValue(o[n.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();let t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){let r=this._cachedMeta;this.updateElements(r.data,0,r.data.length,t)}updateElements(t,r,n,s){let o=s==="reset",{index:a,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),u=l.isHorizontal(),f=this._getRuler(),{sharedOptions:d,includeOptions:h}=this._getSharedOptions(r,s);for(let m=r;m<r+n;m++){let p=this.getParsed(m),g=o||U(p[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(m),b=this._calculateBarIndexPixels(m,f),x=(p._stacks||{})[l.axis],w={horizontal:u,base:g.base,enableBorderRadius:!x||Hn(p._custom)||a===x._top||a===x._bottom,x:u?g.head:b.center,y:u?b.center:g.head,height:u?b.size:Math.abs(g.size),width:u?Math.abs(g.size):b.size};h&&(w.options=d||this.resolveDataElementOptions(m,t[m].active?"active":s));let T=w.options||t[m].options;zu(w,T,x,a),Wu(w,T,f.ratio),this.updateElement(t[m],m,w,s)}}_getStacks(t,r){let{iScale:n}=this._cachedMeta,s=n.getMatchingVisibleMetas(this._type).filter(f=>f.controller.options.grouped),o=n.options.stacked,a=[],l=this._cachedMeta.controller.getParsed(r),c=l&&l[n.axis],u=f=>{let d=f._parsed.find(m=>m[n.axis]===c),h=d&&d[f.vScale.axis];if(U(h)||isNaN(h))return!0};for(let f of s)if(!(r!==void 0&&u(f))&&((o===!1||a.indexOf(f.stack)===-1||o===void 0&&f.stack===void 0)&&a.push(f.stack),f.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){let t=this.chart.scales,r=this.chart.options.indexAxis;return Object.keys(t).filter(n=>t[n].axis===r).shift()}_getAxis(){let t={},r=this.getFirstScaleIdForIndexAxis();for(let n of this.chart.data.datasets)t[W(this.chart.options.indexAxis==="x"?n.xAxisID:n.yAxisID,r)]=!0;return Object.keys(t)}_getStackIndex(t,r,n){let s=this._getStacks(t,n),o=r!==void 0?s.indexOf(r):-1;return o===-1?s.length-1:o}_getRuler(){let t=this.options,r=this._cachedMeta,n=r.iScale,s=[],o,a;for(o=0,a=r.data.length;o<a;++o)s.push(n.getPixelForValue(this.getParsed(o)[n.axis],o));let l=t.barThickness;return{min:l||Au(r),pixels:s,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:t.grouped,ratio:l?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){let{_cachedMeta:{vScale:r,_stacked:n,index:s},options:{base:o,minBarLength:a}}=this,l=o||0,c=this.getParsed(t),u=c._custom,f=Hn(u),d=c[r.axis],h=0,m=n?this.applyStack(r,c,n):d,p,g;m!==d&&(h=m-d,m=d),f&&(d=u.barStart,m=u.barEnd-u.barStart,d!==0&&At(d)!==At(u.barEnd)&&(h=0),h+=d);let b=!U(o)&&!f?o:h,x=r.getPixelForValue(b);if(this.chart.getDataVisibility(t)?p=r.getPixelForValue(h+m):p=x,g=p-x,Math.abs(g)<a){g=Ru(g,r,l)*a,d===l&&(x-=g/2);let w=r.getPixelForDecimal(0),T=r.getPixelForDecimal(1),v=Math.min(w,T),_=Math.max(w,T);x=Math.max(Math.min(x,_),v),p=x+g,n&&!f&&(c._stacks[r.axis]._visualValues[s]=r.getValueForPixel(p)-r.getValueForPixel(x))}if(x===r.getPixelForValue(l)){let w=At(g)*r.getLineWidthForValue(l)/2;x+=w,g-=w}return{size:g,base:x,head:p,center:p+g/2}}_calculateBarIndexPixels(t,r){let n=r.scale,s=this.options,o=s.skipNull,a=W(s.maxBarThickness,1/0),l,c,u=this._getAxisCount();if(r.grouped){let f=o?this._getStackCount(t):r.stackCount,d=s.barThickness==="flex"?Lu(t,r,s,f*u):Iu(t,r,s,f*u),h=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(W(h,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+m;l=d.start+d.chunk*p+d.chunk/2,c=Math.min(a,d.chunk*d.ratio)}else l=n.getPixelForValue(this.getParsed(t)[n.axis],t),c=Math.min(a,r.min*r.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){let t=this._cachedMeta,r=t.vScale,n=t.data,s=n.length,o=0;for(;o<s;++o)this.getParsed(o)[r.axis]!==null&&!n[o].hidden&&n[o].draw(this._ctx)}}return i})(),Bu=(()=>{class i extends ce{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,r,n,s){let o=super.parsePrimitiveData(t,r,n,s);for(let a=0;a<o.length;a++)o[a]._custom=this.resolveDataElementOptions(a+n).radius;return o}parseArrayData(t,r,n,s){let o=super.parseArrayData(t,r,n,s);for(let a=0;a<o.length;a++){let l=r[n+a];o[a]._custom=W(l[2],this.resolveDataElementOptions(a+n).radius)}return o}parseObjectData(t,r,n,s){let o=super.parseObjectData(t,r,n,s);for(let a=0;a<o.length;a++){let l=r[n+a];o[a]._custom=W(l&&l.r&&+l.r,this.resolveDataElementOptions(a+n).radius)}return o}getMaxOverflow(){let t=this._cachedMeta.data,r=0;for(let n=t.length-1;n>=0;--n)r=Math.max(r,t[n].size(this.resolveDataElementOptions(n))/2);return r>0&&r}getLabelAndValue(t){let r=this._cachedMeta,n=this.chart.data.labels||[],{xScale:s,yScale:o}=r,a=this.getParsed(t),l=s.getLabelForValue(a.x),c=o.getLabelForValue(a.y),u=a._custom;return{label:n[t]||"",value:"("+l+", "+c+(u?", "+u:"")+")"}}update(t){let r=this._cachedMeta.data;this.updateElements(r,0,r.length,t)}updateElements(t,r,n,s){let o=s==="reset",{iScale:a,vScale:l}=this._cachedMeta,{sharedOptions:c,includeOptions:u}=this._getSharedOptions(r,s),f=a.axis,d=l.axis;for(let h=r;h<r+n;h++){let m=t[h],p=!o&&this.getParsed(h),g={},b=g[f]=o?a.getPixelForDecimal(.5):a.getPixelForValue(p[f]),x=g[d]=o?l.getBasePixel():l.getPixelForValue(p[d]);g.skip=isNaN(b)||isNaN(x),u&&(g.options=c||this.resolveDataElementOptions(h,m.active?"active":s),o&&(g.options.radius=0)),this.updateElement(m,h,g,s)}}resolveDataElementOptions(t,r){let n=this.getParsed(t),s=super.resolveDataElementOptions(t,r);s.$shared&&(s=Object.assign({},s,{$shared:!1}));let o=s.radius;return r!=="active"&&(s.radius=0),s.radius+=W(n&&n._custom,o),s}}return i})();function Yu(i,e,t){let r=1,n=1,s=0,o=0;if(e<et){let a=i,l=a+e,c=Math.cos(a),u=Math.sin(a),f=Math.cos(l),d=Math.sin(l),h=(w,T,v)=>ze(w,a,l,!0)?1:Math.max(T,T*t,v,v*t),m=(w,T,v)=>ze(w,a,l,!0)?-1:Math.min(T,T*t,v,v*t),p=h(0,c,f),g=h(st,u,d),b=m($,c,f),x=m($+st,u,d);r=(p-b)/2,n=(g-x)/2,s=-(p+b)/2,o=-(g+x)/2}return{ratioX:r,ratioY:n,offsetX:s,offsetY:o}}var ps=(()=>{class i extends ce{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let r=t.data;if(r.labels.length&&r.datasets.length){let{labels:{pointStyle:n,color:s}}=t.legend.options;return r.labels.map((o,a)=>{let c=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:s,lineWidth:c.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,r,n){n.chart.toggleDataVisibility(r.index),n.chart.update()}}}};constructor(t,r){super(t,r),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,r){let n=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=n;else{let o=c=>+n[c];if(V(n[t])){let{key:c="value"}=this._parsing;o=u=>+jt(n[u],c)}let a,l;for(a=t,l=t+r;a<l;++a)s._parsed[a]=o(a)}}_getRotation(){return Dt(this.options.rotation-90)}_getCircumference(){return Dt(this.options.circumference)}_getRotationExtents(){let t=et,r=-et;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){let s=this.chart.getDatasetMeta(n).controller,o=s._getRotation(),a=s._getCircumference();t=Math.min(t,o),r=Math.max(r,o+a)}return{rotation:t,circumference:r-t}}update(t){let r=this.chart,{chartArea:n}=r,s=this._cachedMeta,o=s.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,l=Math.max((Math.min(n.width,n.height)-a)/2,0),c=Math.min(io(this.options.cutout,l),1),u=this._getRingWeight(this.index),{circumference:f,rotation:d}=this._getRotationExtents(),{ratioX:h,ratioY:m,offsetX:p,offsetY:g}=Yu(d,f,c),b=(n.width-a)/h,x=(n.height-a)/m,w=Math.max(Math.min(b,x)/2,0),T=cn(this.options.radius,w),v=Math.max(T*c,0),_=(T-v)/this._getVisibleDatasetWeightTotal();this.offsetX=p*T,this.offsetY=g*T,s.total=this.calculateTotal(),this.outerRadius=T-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*u,0),this.updateElements(o,0,o.length,t)}_circumference(t,r){let n=this.options,s=this._cachedMeta,o=this._getCircumference();return r&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/et)}updateElements(t,r,n,s){let o=s==="reset",a=this.chart,l=a.chartArea,u=a.options.animation,f=(l.left+l.right)/2,d=(l.top+l.bottom)/2,h=o&&u.animateScale,m=h?0:this.innerRadius,p=h?0:this.outerRadius,{sharedOptions:g,includeOptions:b}=this._getSharedOptions(r,s),x=this._getRotation(),w;for(w=0;w<r;++w)x+=this._circumference(w,o);for(w=r;w<r+n;++w){let T=this._circumference(w,o),v=t[w],_={x:f+this.offsetX,y:d+this.offsetY,startAngle:x,endAngle:x+T,circumference:T,outerRadius:p,innerRadius:m};b&&(_.options=g||this.resolveDataElementOptions(w,v.active?"active":s)),x+=T,this.updateElement(v,w,_,s)}}calculateTotal(){let t=this._cachedMeta,r=t.data,n=0,s;for(s=0;s<r.length;s++){let o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!r[s].hidden&&(n+=Math.abs(o))}return n}calculateCircumference(t){let r=this._cachedMeta.total;return r>0&&!isNaN(t)?et*(Math.abs(t)/r):0}getLabelAndValue(t){let r=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=Ne(r._parsed[t],n.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let r=0,n=this.chart,s,o,a,l,c;if(!t){for(s=0,o=n.data.datasets.length;s<o;++s)if(n.isDatasetVisible(s)){a=n.getDatasetMeta(s),t=a.data,l=a.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)c=l.resolveDataElementOptions(s),c.borderAlign!=="inner"&&(r=Math.max(r,c.borderWidth||0,c.hoverBorderWidth||0));return r}getMaxOffset(t){let r=0;for(let n=0,s=t.length;n<s;++n){let o=this.resolveDataElementOptions(n);r=Math.max(r,o.offset||0,o.hoverOffset||0)}return r}_getRingWeightOffset(t){let r=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(r+=this._getRingWeight(n));return r}_getRingWeight(t){return Math.max(W(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}return i})(),Uu=(()=>{class i extends ce{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){let r=this._cachedMeta,{dataset:n,data:s=[],_dataset:o}=r,a=this.chart._animationsDisabled,{start:l,count:c}=vn(r,s,a);this._drawStart=l,this._drawCount=c,yn(r)&&(l=0,c=s.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!o._decimated,n.points=s;let u=this.resolveDatasetElementOptions(t);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(n,void 0,{animated:!a,options:u},t),this.updateElements(s,l,c,t)}updateElements(t,r,n,s){let o=s==="reset",{iScale:a,vScale:l,_stacked:c,_dataset:u}=this._cachedMeta,{sharedOptions:f,includeOptions:d}=this._getSharedOptions(r,s),h=a.axis,m=l.axis,{spanGaps:p,segment:g}=this.options,b=ge(p)?p:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||s==="none",w=r+n,T=t.length,v=r>0&&this.getParsed(r-1);for(let _=0;_<T;++_){let P=t[_],C=x?P:{};if(_<r||_>=w){C.skip=!0;continue}let O=this.getParsed(_),R=U(O[m]),z=C[h]=a.getPixelForValue(O[h],_),H=C[m]=o||R?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,O,c):O[m],_);C.skip=isNaN(z)||isNaN(H)||R,C.stop=_>0&&Math.abs(O[h]-v[h])>b,g&&(C.parsed=O,C.raw=u.data[_]),d&&(C.options=f||this.resolveDataElementOptions(_,P.active?"active":s)),x||this.updateElement(P,_,C,s),v=O}}getMaxOverflow(){let t=this._cachedMeta,r=t.dataset,n=r.options&&r.options.borderWidth||0,s=t.data||[];if(!s.length)return n;let o=s[0].size(this.resolveDataElementOptions(0)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(n,o,a)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}return i})(),La=(()=>{class i extends ce{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let r=t.data;if(r.labels.length&&r.datasets.length){let{labels:{pointStyle:n,color:s}}=t.legend.options;return r.labels.map((o,a)=>{let c=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:s,lineWidth:c.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,r,n){n.chart.toggleDataVisibility(r.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,r){super(t,r),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){let r=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=Ne(r._parsed[t].r,n.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,r,n,s){return On.bind(this)(t,r,n,s)}update(t){let r=this._cachedMeta.data;this._updateRadius(),this.updateElements(r,0,r.length,t)}getMinMax(){let t=this._cachedMeta,r={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((n,s)=>{let o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<r.min&&(r.min=o),o>r.max&&(r.max=o))}),r}_updateRadius(){let t=this.chart,r=t.chartArea,n=t.options,s=Math.min(r.right-r.left,r.bottom-r.top),o=Math.max(s/2,0),a=Math.max(n.cutoutPercentage?o/100*n.cutoutPercentage:1,0),l=(o-a)/t.getVisibleDatasetCount();this.outerRadius=o-l*this.index,this.innerRadius=this.outerRadius-l}updateElements(t,r,n,s){let o=s==="reset",a=this.chart,c=a.options.animation,u=this._cachedMeta.rScale,f=u.xCenter,d=u.yCenter,h=u.getIndexAngle(0)-.5*$,m=h,p,g=360/this.countVisibleElements();for(p=0;p<r;++p)m+=this._computeAngle(p,s,g);for(p=r;p<r+n;p++){let b=t[p],x=m,w=m+this._computeAngle(p,s,g),T=a.getDataVisibility(p)?u.getDistanceFromCenterForValue(this.getParsed(p).r):0;m=w,o&&(c.animateScale&&(T=0),c.animateRotate&&(x=w=h));let v={x:f,y:d,innerRadius:0,outerRadius:T,startAngle:x,endAngle:w,options:this.resolveDataElementOptions(p,b.active?"active":s)};this.updateElement(b,p,v,s)}}countVisibleElements(){let t=this._cachedMeta,r=0;return t.data.forEach((n,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&r++}),r}_computeAngle(t,r,n){return this.chart.getDataVisibility(t)?Dt(this.resolveDataElementOptions(t,r).angle||n):0}}return i})(),Vu=(()=>{class i extends ps{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}return i})(),ju=(()=>{class i extends ce{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){let r=this._cachedMeta.vScale,n=this.getParsed(t);return{label:r.getLabels()[t],value:""+r.getLabelForValue(n[r.axis])}}parseObjectData(t,r,n,s){return On.bind(this)(t,r,n,s)}update(t){let r=this._cachedMeta,n=r.dataset,s=r.data||[],o=r.iScale.getLabels();if(n.points=s,t!=="resize"){let a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);let l={_loop:!0,_fullLoop:o.length===s.length,options:a};this.updateElement(n,void 0,l,t)}this.updateElements(s,0,s.length,t)}updateElements(t,r,n,s){let o=this._cachedMeta.rScale,a=s==="reset";for(let l=r;l<r+n;l++){let c=t[l],u=this.resolveDataElementOptions(l,c.active?"active":s),f=o.getPointPositionForValue(l,this.getParsed(l).r),d=a?o.xCenter:f.x,h=a?o.yCenter:f.y,m={x:d,y:h,angle:f.angle,skip:isNaN(d)||isNaN(h),options:u};this.updateElement(c,l,m,s)}}}return i})(),qu=(()=>{class i extends ce{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){let r=this._cachedMeta,n=this.chart.data.labels||[],{xScale:s,yScale:o}=r,a=this.getParsed(t),l=s.getLabelForValue(a.x),c=o.getLabelForValue(a.y);return{label:n[t]||"",value:"("+l+", "+c+")"}}update(t){let r=this._cachedMeta,{data:n=[]}=r,s=this.chart._animationsDisabled,{start:o,count:a}=vn(r,n,s);if(this._drawStart=o,this._drawCount=a,yn(r)&&(o=0,a=n.length),this.options.showLine){this.datasetElementType||this.addElements();let{dataset:l,_dataset:c}=r;l._chart=this.chart,l._datasetIndex=this.index,l._decimated=!!c._decimated,l.points=n;let u=this.resolveDatasetElementOptions(t);u.segment=this.options.segment,this.updateElement(l,void 0,{animated:!s,options:u},t)}else this.datasetElementType&&(delete r.dataset,this.datasetElementType=!1);this.updateElements(n,o,a,t)}addElements(){let{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,r,n,s){let o=s==="reset",{iScale:a,vScale:l,_stacked:c,_dataset:u}=this._cachedMeta,f=this.resolveDataElementOptions(r,s),d=this.getSharedOptions(f),h=this.includeOptions(s,d),m=a.axis,p=l.axis,{spanGaps:g,segment:b}=this.options,x=ge(g)?g:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||o||s==="none",T=r>0&&this.getParsed(r-1);for(let v=r;v<r+n;++v){let _=t[v],P=this.getParsed(v),C=w?_:{},O=U(P[p]),R=C[m]=a.getPixelForValue(P[m],v),z=C[p]=o||O?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,P,c):P[p],v);C.skip=isNaN(R)||isNaN(z)||O,C.stop=v>0&&Math.abs(P[m]-T[m])>x,b&&(C.parsed=P,C.raw=u.data[v]),h&&(C.options=d||this.resolveDataElementOptions(v,_.active?"active":s)),w||this.updateElement(_,v,C,s),T=P}this.updateSharedOptions(d,s,f)}getMaxOverflow(){let t=this._cachedMeta,r=t.data||[];if(!this.options.showLine){let l=0;for(let c=r.length-1;c>=0;--c)l=Math.max(l,r[c].size(this.resolveDataElementOptions(c))/2);return l>0&&l}let n=t.dataset,s=n.options&&n.options.borderWidth||0;if(!r.length)return s;let o=r[0].size(this.resolveDataElementOptions(0)),a=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(s,o,a)/2}}return i})(),$u=Object.freeze({__proto__:null,BarController:Hu,BubbleController:Bu,DoughnutController:ps,LineController:Uu,PieController:Vu,PolarAreaController:La,RadarController:ju,ScatterController:qu});function xe(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var Gn=class i{static override(e){Object.assign(i.prototype,e)}options;constructor(e){this.options=e||{}}init(){}formats(){return xe()}parse(){return xe()}format(){return xe()}add(){return xe()}diff(){return xe()}startOf(){return xe()}endOf(){return xe()}},gs={_date:Gn};function Xu(i,e,t,r){let{controller:n,data:s,_sorted:o}=i,a=n._cachedMeta.iScale,l=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null;if(a&&e===a.axis&&e!=="r"&&o&&s.length){let c=a._reversePixels?lo:Et;if(r){if(n._sharedOptions){let u=s[0],f=typeof u.getRange=="function"&&u.getRange(e);if(f){let d=c(s,e,t-f),h=c(s,e,t+f);return{lo:d.lo,hi:h.hi}}}}else{let u=c(s,e,t);if(l){let{vScale:f}=n._cachedMeta,{_parsed:d}=i,h=d.slice(0,u.lo+1).reverse().findIndex(p=>!U(p[f.axis]));u.lo-=Math.max(0,h);let m=d.slice(u.hi).findIndex(p=>!U(p[f.axis]));u.hi+=Math.max(0,m)}return u}}return{lo:0,hi:s.length-1}}function vi(i,e,t,r,n){let s=i.getSortedVisibleDatasetMetas(),o=t[e];for(let a=0,l=s.length;a<l;++a){let{index:c,data:u}=s[a],{lo:f,hi:d}=Xu(s[a],e,o,n);for(let h=f;h<=d;++h){let m=u[h];m.skip||r(m,c,h)}}}function Qu(i){let e=i.indexOf("x")!==-1,t=i.indexOf("y")!==-1;return function(r,n){let s=e?Math.abs(r.x-n.x):0,o=t?Math.abs(r.y-n.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(o,2))}}function Bn(i,e,t,r,n){let s=[];return!n&&!i.isPointInArea(e)||vi(i,t,e,function(a,l,c){!n&&!Rt(a,i.chartArea,0)||a.inRange(e.x,e.y,r)&&s.push({element:a,datasetIndex:l,index:c})},!0),s}function Gu(i,e,t,r){let n=[];function s(o,a,l){let{startAngle:c,endAngle:u}=o.getProps(["startAngle","endAngle"],r),{angle:f}=mn(o,{x:e.x,y:e.y});ze(f,c,u)&&n.push({element:o,datasetIndex:a,index:l})}return vi(i,t,e,s),n}function Ku(i,e,t,r,n,s){let o=[],a=Qu(t),l=Number.POSITIVE_INFINITY;function c(u,f,d){let h=u.inRange(e.x,e.y,n);if(r&&!h)return;let m=u.getCenterPoint(n);if(!(!!s||i.isPointInArea(m))&&!h)return;let g=a(e,m);g<l?(o=[{element:u,datasetIndex:f,index:d}],l=g):g===l&&o.push({element:u,datasetIndex:f,index:d})}return vi(i,t,e,c),o}function Yn(i,e,t,r,n,s){return!s&&!i.isPointInArea(e)?[]:t==="r"&&!r?Gu(i,e,t,n):Ku(i,e,t,r,n,s)}function Ho(i,e,t,r,n){let s=[],o=t==="x"?"inXRange":"inYRange",a=!1;return vi(i,t,e,(l,c,u)=>{l[o]&&l[o](e[t],n)&&(s.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(e.x,e.y,n))}),r&&!a?[]:s}var Zu={evaluateInteractionItems:vi,modes:{index(i,e,t,r){let n=ae(e,i),s=t.axis||"x",o=t.includeInvisible||!1,a=t.intersect?Bn(i,n,s,r,o):Yn(i,n,s,!1,r,o),l=[];return a.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{let u=a[0].index,f=c.data[u];f&&!f.skip&&l.push({element:f,datasetIndex:c.index,index:u})}),l):[]},dataset(i,e,t,r){let n=ae(e,i),s=t.axis||"xy",o=t.includeInvisible||!1,a=t.intersect?Bn(i,n,s,r,o):Yn(i,n,s,!1,r,o);if(a.length>0){let l=a[0].datasetIndex,c=i.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(i,e,t,r){let n=ae(e,i),s=t.axis||"xy",o=t.includeInvisible||!1;return Bn(i,n,s,r,o)},nearest(i,e,t,r){let n=ae(e,i),s=t.axis||"xy",o=t.includeInvisible||!1;return Yn(i,n,s,t.intersect,r,o)},x(i,e,t,r){let n=ae(e,i);return Ho(i,n,"x",t.intersect,r)},y(i,e,t,r){let n=ae(e,i);return Ho(i,n,"y",t.intersect,r)}}},Ea=["left","top","right","bottom"];function ui(i,e){return i.filter(t=>t.pos===e)}function Bo(i,e){return i.filter(t=>Ea.indexOf(t.pos)===-1&&t.box.axis===e)}function fi(i,e){return i.sort((t,r)=>{let n=e?r:t,s=e?t:r;return n.weight===s.weight?n.index-s.index:n.weight-s.weight})}function Ju(i){let e=[],t,r,n,s,o,a;for(t=0,r=(i||[]).length;t<r;++t)n=i[t],{position:s,options:{stack:o,stackWeight:a=1}}=n,e.push({index:t,box:n,pos:s,horizontal:n.isHorizontal(),weight:n.weight,stack:o&&s+o,stackWeight:a});return e}function tf(i){let e={};for(let t of i){let{stack:r,pos:n,stackWeight:s}=t;if(!r||!Ea.includes(n))continue;let o=e[r]||(e[r]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=s}return e}function ef(i,e){let t=tf(i),{vBoxMaxWidth:r,hBoxMaxHeight:n}=e,s,o,a;for(s=0,o=i.length;s<o;++s){a=i[s];let{fullSize:l}=a.box,c=t[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*r:l&&e.availableWidth,a.height=n):(a.width=r,a.height=u?u*n:l&&e.availableHeight)}return t}function rf(i){let e=Ju(i),t=fi(e.filter(c=>c.box.fullSize),!0),r=fi(ui(e,"left"),!0),n=fi(ui(e,"right")),s=fi(ui(e,"top"),!0),o=fi(ui(e,"bottom")),a=Bo(e,"x"),l=Bo(e,"y");return{fullSize:t,leftAndTop:r.concat(s),rightAndBottom:n.concat(l).concat(o).concat(a),chartArea:ui(e,"chartArea"),vertical:r.concat(n).concat(l),horizontal:s.concat(o).concat(a)}}function Yo(i,e,t,r){return Math.max(i[t],e[t])+Math.max(i[r],e[r])}function Ra(i,e){i.top=Math.max(i.top,e.top),i.left=Math.max(i.left,e.left),i.bottom=Math.max(i.bottom,e.bottom),i.right=Math.max(i.right,e.right)}function nf(i,e,t,r){let{pos:n,box:s}=t,o=i.maxPadding;if(!V(n)){t.size&&(i[n]-=t.size);let f=r[t.stack]||{size:0,count:1};f.size=Math.max(f.size,t.horizontal?s.height:s.width),t.size=f.size/f.count,i[n]+=t.size}s.getPadding&&Ra(o,s.getPadding());let a=Math.max(0,e.outerWidth-Yo(o,i,"left","right")),l=Math.max(0,e.outerHeight-Yo(o,i,"top","bottom")),c=a!==i.w,u=l!==i.h;return i.w=a,i.h=l,t.horizontal?{same:c,other:u}:{same:u,other:c}}function sf(i){let e=i.maxPadding;function t(r){let n=Math.max(e[r]-i[r],0);return i[r]+=n,n}i.y+=t("top"),i.x+=t("left"),t("right"),t("bottom")}function of(i,e){let t=e.maxPadding;function r(n){let s={left:0,top:0,right:0,bottom:0};return n.forEach(o=>{s[o]=Math.max(e[o],t[o])}),s}return r(i?["left","right"]:["top","bottom"])}function mi(i,e,t,r){let n=[],s,o,a,l,c,u;for(s=0,o=i.length,c=0;s<o;++s){a=i[s],l=a.box,l.update(a.width||e.w,a.height||e.h,of(a.horizontal,e));let{same:f,other:d}=nf(e,t,a,r);c|=f&&n.length,u=u||d,l.fullSize||n.push(a)}return c&&mi(n,e,t,r)||u}function tr(i,e,t,r,n){i.top=t,i.left=e,i.right=e+r,i.bottom=t+n,i.width=r,i.height=n}function Uo(i,e,t,r){let n=t.padding,{x:s,y:o}=e;for(let a of i){let l=a.box,c=r[a.stack]||{count:1,placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){let f=e.w*u,d=c.size||l.height;Re(c.start)&&(o=c.start),l.fullSize?tr(l,n.left,o,t.outerWidth-n.right-n.left,d):tr(l,e.left+c.placed,o,f,d),c.start=o,c.placed+=f,o=l.bottom}else{let f=e.h*u,d=c.size||l.width;Re(c.start)&&(s=c.start),l.fullSize?tr(l,s,n.top,d,t.outerHeight-n.bottom-n.top):tr(l,s,e.top+c.placed,d,f),c.start=s,c.placed+=f,s=l.right}}e.x=s,e.y=o}var mt={addBox(i,e){i.boxes||(i.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},i.boxes.push(e)},removeBox(i,e){let t=i.boxes?i.boxes.indexOf(e):-1;t!==-1&&i.boxes.splice(t,1)},configure(i,e,t){e.fullSize=t.fullSize,e.position=t.position,e.weight=t.weight},update(i,e,t,r){if(!i)return;let n=ht(i.options.layout.padding),s=Math.max(e-n.width,0),o=Math.max(t-n.height,0),a=rf(i.boxes),l=a.vertical,c=a.horizontal;Q(i.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});let u=l.reduce((p,g)=>g.box.options&&g.box.options.display===!1?p:p+1,0)||1,f=Object.freeze({outerWidth:e,outerHeight:t,padding:n,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/u,hBoxMaxHeight:o/2}),d=Object.assign({},n);Ra(d,ht(r));let h=Object.assign({maxPadding:d,w:s,h:o,x:n.left,y:n.top},n),m=ef(l.concat(c),f);mi(a.fullSize,h,f,m),mi(l,h,f,m),mi(c,h,f,m)&&mi(l,h,f,m),sf(h),Uo(a.leftAndTop,h,f,m),h.x+=h.w,h.y+=h.h,Uo(a.rightAndBottom,h,f,m),i.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Q(a.chartArea,p=>{let g=p.box;Object.assign(g,i.chartArea),g.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}},cr=class{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,r){}removeEventListener(e,t,r){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,r,n){return t=Math.max(0,t||e.width),r=r||e.height,{width:t,height:Math.max(0,n?Math.floor(t/n):r)}}isAttached(e){return!0}updateConfig(e){}},Kn=class extends cr{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}},or="$chartjs",af={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Vo=i=>i===null||i==="";function lf(i,e){let t=i.style,r=i.getAttribute("height"),n=i.getAttribute("width");if(i[or]={initial:{height:r,width:n,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",Vo(n)){let s=An(i,"width");s!==void 0&&(i.width=s)}if(Vo(r))if(i.style.height==="")i.height=i.width/(e||2);else{let s=An(i,"height");s!==void 0&&(i.height=s)}return i}var Fa=Do?{passive:!0}:!1;function cf(i,e,t){i&&i.addEventListener(e,t,Fa)}function uf(i,e,t){i&&i.canvas&&i.canvas.removeEventListener(e,t,Fa)}function ff(i,e){let t=af[i.type]||i.type,{x:r,y:n}=ae(i,e);return{type:t,chart:e,native:i,x:r!==void 0?r:null,y:n!==void 0?n:null}}function ur(i,e){for(let t of i)if(t===e||t.contains(e))return!0}function df(i,e,t){let r=i.canvas,n=new MutationObserver(s=>{let o=!1;for(let a of s)o=o||ur(a.addedNodes,r),o=o&&!ur(a.removedNodes,r);o&&t()});return n.observe(document,{childList:!0,subtree:!0}),n}function hf(i,e,t){let r=i.canvas,n=new MutationObserver(s=>{let o=!1;for(let a of s)o=o||ur(a.removedNodes,r),o=o&&!ur(a.addedNodes,r);o&&t()});return n.observe(document,{childList:!0,subtree:!0}),n}var gi=new Map,jo=0;function za(){let i=window.devicePixelRatio;i!==jo&&(jo=i,gi.forEach((e,t)=>{t.currentDevicePixelRatio!==i&&e()}))}function mf(i,e){gi.size||window.addEventListener("resize",za),gi.set(i,e)}function pf(i){gi.delete(i),gi.size||window.removeEventListener("resize",za)}function gf(i,e,t){let r=i.canvas,n=r&&Zi(r);if(!n)return;let s=xn((a,l)=>{let c=n.clientWidth;t(a,l),c<n.clientWidth&&t()},window),o=new ResizeObserver(a=>{let l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||s(c,u)});return o.observe(n),mf(i,s),o}function Un(i,e,t){t&&t.disconnect(),e==="resize"&&pf(i)}function bf(i,e,t){let r=i.canvas,n=xn(s=>{i.ctx!==null&&t(ff(s,i))},i);return cf(r,e,n),n}var Zn=class extends cr{acquireContext(e,t){let r=e&&e.getContext&&e.getContext("2d");return r&&r.canvas===e?(lf(e,t),r):null}releaseContext(e){let t=e.canvas;if(!t[or])return!1;let r=t[or].initial;["height","width"].forEach(s=>{let o=r[s];U(o)?t.removeAttribute(s):t.setAttribute(s,o)});let n=r.style||{};return Object.keys(n).forEach(s=>{t.style[s]=n[s]}),t.width=t.width,delete t[or],!0}addEventListener(e,t,r){this.removeEventListener(e,t);let n=e.$proxies||(e.$proxies={}),o={attach:df,detach:hf,resize:gf}[t]||bf;n[t]=o(e,t,r)}removeEventListener(e,t){let r=e.$proxies||(e.$proxies={}),n=r[t];if(!n)return;({attach:Un,detach:Un,resize:Un}[t]||uf)(e,t,n),r[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,r,n){return ko(e,t,r,n)}isAttached(e){let t=e&&Zi(e);return!!(t&&t.isConnected)}};function xf(i){return!Ki()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?Kn:Zn}var It=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){let{x:t,y:r}=this.getProps(["x","y"],e);return{x:t,y:r}}hasValue(){return ge(this.x)&&ge(this.y)}getProps(e,t){let r=this.$animations;if(!t||!r)return this;let n={};return e.forEach(s=>{n[s]=r[s]&&r[s].active()?r[s]._to:this[s]}),n}};function vf(i,e){let t=i.options.ticks,r=yf(i),n=Math.min(t.maxTicksLimit||r,r),s=t.major.enabled?wf(e):[],o=s.length,a=s[0],l=s[o-1],c=[];if(o>n)return Mf(e,c,s,o/n),c;let u=_f(s,e,n);if(o>0){let f,d,h=o>1?Math.round((l-a)/(o-1)):null;for(er(e,c,u,U(h)?0:a-h,a),f=0,d=o-1;f<d;f++)er(e,c,u,s[f],s[f+1]);return er(e,c,u,l,U(h)?e.length:l+h),c}return er(e,c,u),c}function yf(i){let e=i.options.offset,t=i._tickSize(),r=i._length/t+(e?0:1),n=i._maxLength/t;return Math.floor(Math.min(r,n))}function _f(i,e,t){let r=Tf(i),n=e.length/t;if(!r)return Math.max(n,1);let s=so(r);for(let o=0,a=s.length-1;o<a;o++){let l=s[o];if(l>n)return l}return Math.max(n,1)}function wf(i){let e=[],t,r;for(t=0,r=i.length;t<r;t++)i[t].major&&e.push(t);return e}function Mf(i,e,t,r){let n=0,s=t[0],o;for(r=Math.ceil(r),o=0;o<i.length;o++)o===s&&(e.push(i[o]),n++,s=t[n*r])}function er(i,e,t,r,n){let s=W(r,0),o=Math.min(W(n,i.length),i.length),a=0,l,c,u;for(t=Math.ceil(t),n&&(l=n-r,t=l/Math.floor(l/t)),u=s;u<0;)a++,u=Math.round(s+a*t);for(c=Math.max(s,0);c<o;c++)c===u&&(e.push(i[c]),a++,u=Math.round(s+a*t))}function Tf(i){let e=i.length,t,r;if(e<2)return!1;for(r=i[0],t=1;t<e;++t)if(i[t]-i[t-1]!==r)return!1;return r}var kf=i=>i==="left"?"right":i==="right"?"left":i,qo=(i,e,t)=>e==="top"||e==="left"?i[e]+t:i[e]-t,$o=(i,e)=>Math.min(e||i,i);function Xo(i,e){let t=[],r=i.length/e,n=i.length,s=0;for(;s<n;s+=r)t.push(i[Math.floor(s)]);return t}function Df(i,e,t){let r=i.ticks.length,n=Math.min(e,r-1),s=i._startPixel,o=i._endPixel,a=1e-6,l=i.getPixelForTick(n),c;if(!(t&&(r===1?c=Math.max(l-s,o-l):e===0?c=(i.getPixelForTick(1)-l)/2:c=(l-i.getPixelForTick(n-1))/2,l+=n<e?c:-c,l<s-a||l>o+a)))return l}function Cf(i,e){Q(i,t=>{let r=t.gc,n=r.length/2,s;if(n>e){for(s=0;s<n;++s)delete t.data[r[s]];r.splice(0,n)}})}function di(i){return i.drawTicks?i.tickLength:0}function Qo(i,e){if(!i.display)return 0;let t=ot(i.font,e),r=ht(i.padding);return(tt(i.text)?i.text.length:1)*t.lineHeight+r.height}function Pf(i,e){return qt(i,{scale:e,type:"scale"})}function Of(i,e,t){return qt(i,{tick:t,index:e,type:"tick"})}function Sf(i,e,t){let r=qi(i);return(t&&e!=="right"||!t&&e==="right")&&(r=kf(r)),r}function Af(i,e,t,r){let{top:n,left:s,bottom:o,right:a,chart:l}=i,{chartArea:c,scales:u}=l,f=0,d,h,m,p=o-n,g=a-s;if(i.isHorizontal()){if(h=dt(r,s,a),V(t)){let b=Object.keys(t)[0],x=t[b];m=u[b].getPixelForValue(x)+p-e}else t==="center"?m=(c.bottom+c.top)/2+p-e:m=qo(i,t,e);d=a-s}else{if(V(t)){let b=Object.keys(t)[0],x=t[b];h=u[b].getPixelForValue(x)-g+e}else t==="center"?h=(c.left+c.right)/2-g+e:h=qo(i,t,e);m=dt(r,o,n),f=t==="left"?-st:st}return{titleX:h,titleY:m,maxWidth:d,rotation:f}}var ye=class i extends It{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:r,_suggestedMax:n}=this;return e=bt(e,Number.POSITIVE_INFINITY),t=bt(t,Number.NEGATIVE_INFINITY),r=bt(r,Number.POSITIVE_INFINITY),n=bt(n,Number.NEGATIVE_INFINITY),{min:bt(e,r),max:bt(t,n),minDefined:nt(e),maxDefined:nt(t)}}getMinMax(e){let{min:t,max:r,minDefined:n,maxDefined:s}=this.getUserBounds(),o;if(n&&s)return{min:t,max:r};let a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)o=a[l].controller.getMinMax(this,e),n||(t=Math.min(t,o.min)),s||(r=Math.max(r,o.max));return t=s&&t>r?r:t,r=n&&t>r?t:r,{min:bt(t,bt(r,t)),max:bt(r,bt(t,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Z(this.options.beforeUpdate,[this])}update(e,t,r){let{beginAtZero:n,grace:s,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=vo(this,s,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=a<this.ticks.length;this._convertTicksToLabels(l?Xo(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=vf(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,t,r;this.isHorizontal()?(t=this.left,r=this.right):(t=this.top,r=this.bottom,e=!e),this._startPixel=t,this._endPixel=r,this._reversePixels=e,this._length=r-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Z(this.options.afterUpdate,[this])}beforeSetDimensions(){Z(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){Z(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),Z(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Z(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){let t=this.options.ticks,r,n,s;for(r=0,n=e.length;r<n;r++)s=e[r],s.label=Z(t.callback,[s.value,r,e],this)}afterTickToLabelConversion(){Z(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Z(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let e=this.options,t=e.ticks,r=$o(this.ticks.length,e.ticks.maxTicksLimit),n=t.minRotation||0,s=t.maxRotation,o=n,a,l,c;if(!this._isVisible()||!t.display||n>=s||r<=1||!this.isHorizontal()){this.labelRotation=n;return}let u=this._getLabelSizes(),f=u.widest.width,d=u.highest.height,h=lt(this.chart.width-f,0,this.maxWidth);a=e.offset?this.maxWidth/r:h/(r-1),f+6>a&&(a=h/(r-(e.offset?.5:1)),l=this.maxHeight-di(e.grid)-t.padding-Qo(e.title,this.chart.options.font),c=Math.sqrt(f*f+d*d),o=Vi(Math.min(Math.asin(lt((u.highest.height+6)/a,-1,1)),Math.asin(lt(l/c,-1,1))-Math.asin(lt(d/c,-1,1)))),o=Math.max(n,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){Z(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Z(this.options.beforeFit,[this])}fit(){let e={width:0,height:0},{chart:t,options:{ticks:r,title:n,grid:s}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){let l=Qo(n,t.options.font);if(a?(e.width=this.maxWidth,e.height=di(s)+l):(e.height=this.maxHeight,e.width=di(s)+l),r.display&&this.ticks.length){let{first:c,last:u,widest:f,highest:d}=this._getLabelSizes(),h=r.padding*2,m=Dt(this.labelRotation),p=Math.cos(m),g=Math.sin(m);if(a){let b=r.mirror?0:g*f.width+p*d.height;e.height=Math.min(this.maxHeight,e.height+b+h)}else{let b=r.mirror?0:p*f.width+g*d.height;e.width=Math.min(this.maxWidth,e.width+b+h)}this._calculatePadding(c,u,g,p)}}this._handleMargins(),a?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,r,n){let{ticks:{align:s,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){let u=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1),d=0,h=0;l?c?(d=n*e.width,h=r*t.height):(d=r*e.height,h=n*t.width):s==="start"?h=t.width:s==="end"?d=e.width:s!=="inner"&&(d=e.width/2,h=t.width/2),this.paddingLeft=Math.max((d-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-f+o)*this.width/(this.width-f),0)}else{let u=t.height/2,f=e.height/2;s==="start"?(u=0,f=e.height):s==="end"&&(u=t.height,f=0),this.paddingTop=u+o,this.paddingBottom=f+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Z(this.options.afterFit,[this])}isHorizontal(){let{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,r;for(t=0,r=e.length;t<r;t++)U(e[t].label)&&(e.splice(t,1),r--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){let t=this.options.ticks.sampleSize,r=this.ticks;t<r.length&&(r=Xo(r,t)),this._labelSizes=e=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,t,r){let{ctx:n,_longestTextCache:s}=this,o=[],a=[],l=Math.floor(t/$o(t,r)),c=0,u=0,f,d,h,m,p,g,b,x,w,T,v;for(f=0;f<t;f+=l){if(m=e[f].label,p=this._resolveTickFontOptions(f),n.font=g=p.string,b=s[g]=s[g]||{data:{},gc:[]},x=p.lineHeight,w=T=0,!U(m)&&!tt(m))w=ni(n,b.data,b.gc,w,m),T=x;else if(tt(m))for(d=0,h=m.length;d<h;++d)v=m[d],!U(v)&&!tt(v)&&(w=ni(n,b.data,b.gc,w,v),T+=x);o.push(w),a.push(T),c=Math.max(w,c),u=Math.max(T,u)}Cf(s,t);let _=o.indexOf(c),P=a.indexOf(u),C=O=>({width:o[O]||0,height:a[O]||0});return{first:C(0),last:C(t-1),widest:C(_),highest:C(P),widths:o,heights:a}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){let t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);let t=this._startPixel+e*this._length;return ao(this._alignToPixels?ne(this.chart,t,0):t)}getDecimalForPixel(e){let t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){let t=this.ticks||[];if(e>=0&&e<t.length){let r=t[e];return r.$context||(r.$context=Of(this.getContext(),e,r))}return this.$context||(this.$context=Pf(this.chart.getContext(),this))}_tickSize(){let e=this.options.ticks,t=Dt(this.labelRotation),r=Math.abs(Math.cos(t)),n=Math.abs(Math.sin(t)),s=this._getLabelSizes(),o=e.autoSkipPadding||0,a=s?s.widest.width+o:0,l=s?s.highest.height+o:0;return this.isHorizontal()?l*r>a*n?a/r:l/n:l*n<a*r?l/r:a/n}_isVisible(){let e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){let t=this.axis,r=this.chart,n=this.options,{grid:s,position:o,border:a}=n,l=s.offset,c=this.isHorizontal(),f=this.ticks.length+(l?1:0),d=di(s),h=[],m=a.setContext(this.getContext()),p=m.display?m.width:0,g=p/2,b=function(Y){return ne(r,Y,p)},x,w,T,v,_,P,C,O,R,z,H,rt;if(o==="top")x=b(this.bottom),P=this.bottom-d,O=x-g,z=b(e.top)+g,rt=e.bottom;else if(o==="bottom")x=b(this.top),z=e.top,rt=b(e.bottom)-g,P=x+g,O=this.top+d;else if(o==="left")x=b(this.right),_=this.right-d,C=x-g,R=b(e.left)+g,H=e.right;else if(o==="right")x=b(this.left),R=e.left,H=b(e.right)-g,_=x+g,C=this.left+d;else if(t==="x"){if(o==="center")x=b((e.top+e.bottom)/2+.5);else if(V(o)){let Y=Object.keys(o)[0],G=o[Y];x=b(this.chart.scales[Y].getPixelForValue(G))}z=e.top,rt=e.bottom,P=x+g,O=P+d}else if(t==="y"){if(o==="center")x=b((e.left+e.right)/2);else if(V(o)){let Y=Object.keys(o)[0],G=o[Y];x=b(this.chart.scales[Y].getPixelForValue(G))}_=x-g,C=_-d,R=e.left,H=e.right}let ut=W(n.ticks.maxTicksLimit,f),N=Math.max(1,Math.ceil(f/ut));for(w=0;w<f;w+=N){let Y=this.getContext(w),G=s.setContext(Y),yt=a.setContext(Y),at=G.lineWidth,Gt=G.color,Kt=yt.dash||[],wt=yt.dashOffset,Zt=G.tickWidth,Mt=G.tickColor,Jt=G.tickBorderDash||[],Lt=G.tickBorderDashOffset;T=Df(this,w,l),T!==void 0&&(v=ne(r,T,at),c?_=C=R=H=v:P=O=z=rt=v,h.push({tx1:_,ty1:P,tx2:C,ty2:O,x1:R,y1:z,x2:H,y2:rt,width:at,color:Gt,borderDash:Kt,borderDashOffset:wt,tickWidth:Zt,tickColor:Mt,tickBorderDash:Jt,tickBorderDashOffset:Lt}))}return this._ticksLength=f,this._borderValue=x,h}_computeLabelItems(e){let t=this.axis,r=this.options,{position:n,ticks:s}=r,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:f}=s,d=di(r.grid),h=d+u,m=f?-u:h,p=-Dt(this.labelRotation),g=[],b,x,w,T,v,_,P,C,O,R,z,H,rt="middle";if(n==="top")_=this.bottom-m,P=this._getXAxisLabelAlignment();else if(n==="bottom")_=this.top+m,P=this._getXAxisLabelAlignment();else if(n==="left"){let N=this._getYAxisLabelAlignment(d);P=N.textAlign,v=N.x}else if(n==="right"){let N=this._getYAxisLabelAlignment(d);P=N.textAlign,v=N.x}else if(t==="x"){if(n==="center")_=(e.top+e.bottom)/2+h;else if(V(n)){let N=Object.keys(n)[0],Y=n[N];_=this.chart.scales[N].getPixelForValue(Y)+h}P=this._getXAxisLabelAlignment()}else if(t==="y"){if(n==="center")v=(e.left+e.right)/2-h;else if(V(n)){let N=Object.keys(n)[0],Y=n[N];v=this.chart.scales[N].getPixelForValue(Y)}P=this._getYAxisLabelAlignment(d).textAlign}t==="y"&&(l==="start"?rt="top":l==="end"&&(rt="bottom"));let ut=this._getLabelSizes();for(b=0,x=a.length;b<x;++b){w=a[b],T=w.label;let N=s.setContext(this.getContext(b));C=this.getPixelForTick(b)+s.labelOffset,O=this._resolveTickFontOptions(b),R=O.lineHeight,z=tt(T)?T.length:1;let Y=z/2,G=N.color,yt=N.textStrokeColor,at=N.textStrokeWidth,Gt=P;o?(v=C,P==="inner"&&(b===x-1?Gt=this.options.reverse?"left":"right":b===0?Gt=this.options.reverse?"right":"left":Gt="center"),n==="top"?c==="near"||p!==0?H=-z*R+R/2:c==="center"?H=-ut.highest.height/2-Y*R+R:H=-ut.highest.height+R/2:c==="near"||p!==0?H=R/2:c==="center"?H=ut.highest.height/2-Y*R:H=ut.highest.height-z*R,f&&(H*=-1),p!==0&&!N.showLabelBackdrop&&(v+=R/2*Math.sin(p))):(_=C,H=(1-z)*R/2);let Kt;if(N.showLabelBackdrop){let wt=ht(N.backdropPadding),Zt=ut.heights[b],Mt=ut.widths[b],Jt=H-wt.top,Lt=0-wt.left;switch(rt){case"middle":Jt-=Zt/2;break;case"bottom":Jt-=Zt;break}switch(P){case"center":Lt-=Mt/2;break;case"right":Lt-=Mt;break;case"inner":b===x-1?Lt-=Mt:b>0&&(Lt-=Mt/2);break}Kt={left:Lt,top:Jt,width:Mt+wt.width,height:Zt+wt.height,color:N.backdropColor}}g.push({label:T,font:O,textOffset:H,options:{rotation:p,color:G,strokeColor:yt,strokeWidth:at,textAlign:Gt,textBaseline:rt,translation:[v,_],backdrop:Kt}})}return g}_getXAxisLabelAlignment(){let{position:e,ticks:t}=this.options;if(-Dt(this.labelRotation))return e==="top"?"left":"right";let n="center";return t.align==="start"?n="left":t.align==="end"?n="right":t.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(e){let{position:t,ticks:{crossAlign:r,mirror:n,padding:s}}=this.options,o=this._getLabelSizes(),a=e+s,l=o.widest.width,c,u;return t==="left"?n?(u=this.right+s,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):t==="right"?n?(u=this.left+s,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;let e=this.chart,t=this.options.position;if(t==="left"||t==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(t==="top"||t==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){let{ctx:e,options:{backgroundColor:t},left:r,top:n,width:s,height:o}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(r,n,s,o),e.restore())}getLineWidthForValue(e){let t=this.options.grid;if(!this._isVisible()||!t.display)return 0;let n=this.ticks.findIndex(s=>s.value===e);return n>=0?t.setContext(this.getContext(n)).lineWidth:0}drawGrid(e){let t=this.options.grid,r=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e)),s,o,a=(l,c,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(t.display)for(s=0,o=n.length;s<o;++s){let l=n[s];t.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),t.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){let{chart:e,ctx:t,options:{border:r,grid:n}}=this,s=r.setContext(this.getContext()),o=r.display?s.width:0;if(!o)return;let a=n.setContext(this.getContext(0)).lineWidth,l=this._borderValue,c,u,f,d;this.isHorizontal()?(c=ne(e,this.left,o)-o/2,u=ne(e,this.right,a)+a/2,f=d=l):(f=ne(e,this.top,o)-o/2,d=ne(e,this.bottom,a)+a/2,c=u=l),t.save(),t.lineWidth=s.width,t.strokeStyle=s.color,t.beginPath(),t.moveTo(c,f),t.lineTo(u,d),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;let r=this.ctx,n=this._computeLabelArea();n&&ai(r,n);let s=this.getLabelItems(e);for(let o of s){let a=o.options,l=o.font,c=o.label,u=o.textOffset;se(r,c,0,u,l,a)}n&&li(r)}drawTitle(){let{ctx:e,options:{position:t,title:r,reverse:n}}=this;if(!r.display)return;let s=ot(r.font),o=ht(r.padding),a=r.align,l=s.lineHeight/2;t==="bottom"||t==="center"||V(t)?(l+=o.bottom,tt(r.text)&&(l+=s.lineHeight*(r.text.length-1))):l+=o.top;let{titleX:c,titleY:u,maxWidth:f,rotation:d}=Af(this,l,t,a);se(e,r.text,0,0,s,{color:r.color,maxWidth:f,rotation:d,textAlign:Sf(a,t,n),textBaseline:"middle",translation:[c,u]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){let e=this.options,t=e.ticks&&e.ticks.z||0,r=W(e.grid&&e.grid.z,-1),n=W(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==i.prototype.draw?[{z:t,draw:s=>{this.draw(s)}}]:[{z:r,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:t,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){let t=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",n=[],s,o;for(s=0,o=t.length;s<o;++s){let a=t[s];a[r]===this.id&&(!e||a.type===e)&&n.push(a)}return n}_resolveTickFontOptions(e){let t=this.options.ticks.setContext(this.getContext(e));return ot(t.font)}_maxDigits(){let e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}},Ye=class{constructor(e,t,r){this.type=e,this.scope=t,this.override=r,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){let t=Object.getPrototypeOf(e),r;Ef(t)&&(r=this.register(t));let n=this.items,s=e.id,o=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+e);return s in n||(n[s]=e,If(e,o,r),this.override&&it.override(e.id,e.overrides)),o}get(e){return this.items[e]}unregister(e){let t=this.items,r=e.id,n=this.scope;r in t&&delete t[r],n&&r in it[n]&&(delete it[n][r],this.override&&delete re[r])}};function If(i,e,t){let r=Ie(Object.create(null),[t?it.get(t):{},it.get(e),i.defaults]);it.set(e,r),i.defaultRoutes&&Lf(e,i.defaultRoutes),i.descriptors&&it.describe(e,i.descriptors)}function Lf(i,e){Object.keys(e).forEach(t=>{let r=t.split("."),n=r.pop(),s=[i].concat(r).join("."),o=e[t].split("."),a=o.pop(),l=o.join(".");it.route(s,n,l,a)})}function Ef(i){return"id"in i&&"defaults"in i}var Jn=class{constructor(){this.controllers=new Ye(ce,"datasets",!0),this.elements=new Ye(It,"elements"),this.plugins=new Ye(Object,"plugins"),this.scales=new Ye(ye,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,r){[...t].forEach(n=>{let s=r||this._getRegistryForType(n);r||s.isForType(n)||s===this.plugins&&n.id?this._exec(e,s,n):Q(n,o=>{let a=r||this._getRegistryForType(o);this._exec(e,a,o)})})}_exec(e,t,r){let n=Ui(e);Z(r["before"+n],[],r),t[e](r),Z(r["after"+n],[],r)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){let r=this._typedRegistries[t];if(r.isForType(e))return r}return this.plugins}_get(e,t,r){let n=t.get(e);if(n===void 0)throw new Error('"'+e+'" is not a registered '+r+".");return n}},Wt=new Jn,ts=class{constructor(){this._init=[]}notify(e,t,r,n){t==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));let s=n?this._descriptors(e).filter(n):this._descriptors(e),o=this._notify(s,e,t,r);return t==="afterDestroy"&&(this._notify(s,e,"stop"),this._notify(this._init,e,"uninstall")),o}_notify(e,t,r,n){n=n||{};for(let s of e){let o=s.plugin,a=o[r],l=[t,n,s.options];if(Z(a,l,o)===!1&&n.cancelable)return!1}return!0}invalidate(){U(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;let t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){let r=e&&e.config,n=W(r.options&&r.options.plugins,{}),s=Rf(r);return n===!1&&!t?[]:zf(e,s,n,t)}_notifyStateChanges(e){let t=this._oldCache||[],r=this._cache,n=(s,o)=>s.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(n(t,r),e,"stop"),this._notify(n(r,t),e,"start")}};function Rf(i){let e={},t=[],r=Object.keys(Wt.plugins.items);for(let s=0;s<r.length;s++)t.push(Wt.getPlugin(r[s]));let n=i.plugins||[];for(let s=0;s<n.length;s++){let o=n[s];t.indexOf(o)===-1&&(t.push(o),e[o.id]=!0)}return{plugins:t,localIds:e}}function Ff(i,e){return!e&&i===!1?null:i===!0?{}:i}function zf(i,{plugins:e,localIds:t},r,n){let s=[],o=i.getContext();for(let a of e){let l=a.id,c=Ff(r[l],n);c!==null&&s.push({plugin:a,options:Nf(i.config,{plugin:a,local:t[l]},c,o)})}return s}function Nf(i,{plugin:e,local:t},r,n){let s=i.pluginScopeKeys(e),o=i.getOptionScopes(r,s);return t&&e.defaults&&o.push(e.defaults),i.createResolver(o,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function es(i,e){let t=it.datasets[i]||{};return((e.datasets||{})[i]||{}).indexAxis||e.indexAxis||t.indexAxis||"x"}function Wf(i,e){let t=i;return i==="_index_"?t=e:i==="_value_"&&(t=e==="x"?"y":"x"),t}function Hf(i,e){return i===e?"_index_":"_value_"}function Go(i){if(i==="x"||i==="y"||i==="r")return i}function Bf(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function is(i,...e){if(Go(i))return i;for(let t of e){let r=t.axis||Bf(t.position)||i.length>1&&Go(i[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function Ko(i,e,t){if(t[e+"AxisID"]===i)return{axis:e}}function Yf(i,e){if(e.data&&e.data.datasets){let t=e.data.datasets.filter(r=>r.xAxisID===i||r.yAxisID===i);if(t.length)return Ko(i,"x",t[0])||Ko(i,"y",t[0])}return{}}function Uf(i,e){let t=re[i.type]||{scales:{}},r=e.scales||{},n=es(i.type,e),s=Object.create(null);return Object.keys(r).forEach(o=>{let a=r[o];if(!V(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);let l=is(o,a,Yf(o,i),it.scales[a.type]),c=Hf(l,n),u=t.scales||{};s[o]=Ee(Object.create(null),[{axis:l},a,u[l],u[c]])}),i.data.datasets.forEach(o=>{let a=o.type||i.type,l=o.indexAxis||es(a,e),u=(re[a]||{}).scales||{};Object.keys(u).forEach(f=>{let d=Wf(f,l),h=o[d+"AxisID"]||d;s[h]=s[h]||Object.create(null),Ee(s[h],[{axis:d},r[h],u[f]])})}),Object.keys(s).forEach(o=>{let a=s[o];Ee(a,[it.scales[a.type],it.scale])}),s}function Na(i){let e=i.options||(i.options={});e.plugins=W(e.plugins,{}),e.scales=Uf(i,e)}function Wa(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function Vf(i){return i=i||{},i.data=Wa(i.data),Na(i),i}var Zo=new Map,Ha=new Set;function ir(i,e){let t=Zo.get(i);return t||(t=e(),Zo.set(i,t),Ha.add(t)),t}var hi=(i,e,t)=>{let r=jt(e,t);r!==void 0&&i.add(r)},rs=class{constructor(e){this._config=Vf(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=Wa(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){let e=this._config;this.clearCache(),Na(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return ir(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return ir(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return ir(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){let t=e.id,r=this.type;return ir(`${r}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){let r=this._scopeCache,n=r.get(e);return(!n||t)&&(n=new Map,r.set(e,n)),n}getOptionScopes(e,t,r){let{options:n,type:s}=this,o=this._cachedScopes(e,r),a=o.get(t);if(a)return a;let l=new Set;t.forEach(u=>{e&&(l.add(e),u.forEach(f=>hi(l,e,f))),u.forEach(f=>hi(l,n,f)),u.forEach(f=>hi(l,re[s]||{},f)),u.forEach(f=>hi(l,it,f)),u.forEach(f=>hi(l,$i,f))});let c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Ha.has(t)&&o.set(t,c),c}chartOptionScopes(){let{options:e,type:t}=this;return[e,re[t]||{},it.datasets[t]||{},{type:t},it,$i]}resolveNamedOptions(e,t,r,n=[""]){let s={$shared:!0},{resolver:o,subPrefixes:a}=Jo(this._resolverCache,e,n),l=o;if(qf(o,t)){s.$shared=!1,r=Ut(r)?r():r;let c=this.createResolver(e,r,a);l=pe(o,r,c)}for(let c of t)s[c]=l[c];return s}createResolver(e,t,r=[""],n){let{resolver:s}=Jo(this._resolverCache,e,r);return V(t)?pe(s,t,void 0,n):s}};function Jo(i,e,t){let r=i.get(e);r||(r=new Map,i.set(e,r));let n=t.join(),s=r.get(n);return s||(s={resolver:Gi(e,t),subPrefixes:t.filter(a=>!a.toLowerCase().includes("hover"))},r.set(n,s)),s}var jf=i=>V(i)&&Object.getOwnPropertyNames(i).some(e=>Ut(i[e]));function qf(i,e){let{isScriptable:t,isIndexable:r}=Dn(i);for(let n of e){let s=t(n),o=r(n),a=(o||s)&&i[n];if(s&&(Ut(a)||jf(a))||o&&tt(a))return!0}return!1}var $f="4.5.0",Xf=["top","bottom","left","right","chartArea"];function ta(i,e){return i==="top"||i==="bottom"||Xf.indexOf(i)===-1&&e==="x"}function ea(i,e){return function(t,r){return t[i]===r[i]?t[e]-r[e]:t[i]-r[i]}}function ia(i){let e=i.chart,t=e.options.animation;e.notifyPlugins("afterRender"),Z(t&&t.onComplete,[i],e)}function Qf(i){let e=i.chart,t=e.options.animation;Z(t&&t.onProgress,[i],e)}function Ba(i){return Ki()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}var ar={},ra=i=>{let e=Ba(i);return Object.values(ar).filter(t=>t.canvas===e).pop()};function Gf(i,e,t){let r=Object.keys(i);for(let n of r){let s=+n;if(s>=e){let o=i[n];delete i[n],(t>0||s>e)&&(i[s+t]=o)}}}function Kf(i,e,t,r){return!t||i.type==="mouseout"?null:r?e:i}var Zf=(()=>{class i{static defaults=it;static instances=ar;static overrides=re;static registry=Wt;static version=$f;static getChart=ra;static register(...t){Wt.add(...t),na()}static unregister(...t){Wt.remove(...t),na()}constructor(t,r){let n=this.config=new rs(r),s=Ba(t),o=ra(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");let a=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||xf(s)),this.platform.updateConfig(n);let l=this.platform.acquireContext(s,a.aspectRatio),c=l&&l.canvas,u=c&&c.height,f=c&&c.width;if(this.id=eo(),this.ctx=l,this.canvas=c,this.width=f,this.height=u,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new ts,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=ho(d=>this.update(d),a.resizeDelay||0),this._dataChanges=[],ar[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}$t.listen(this,"complete",ia),$t.listen(this,"progress",Qf),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:r},width:n,height:s,_aspectRatio:o}=this;return U(t)?r&&o?o:s?n/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Wt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Sn(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Mn(this.canvas,this.ctx),this}stop(){return $t.stop(this),this}resize(t,r){$t.running(this)?this._resizeBeforeDraw={width:t,height:r}:this._resize(t,r)}_resize(t,r){let n=this.options,s=this.canvas,o=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,t,r,o),l=n.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Sn(this,l,!0)&&(this.notifyPlugins("resize",{size:a}),Z(n.onResize,[this,a],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){let r=this.options.scales||{};Q(r,(n,s)=>{n.id=s})}buildOrUpdateScales(){let t=this.options,r=t.scales,n=this.scales,s=Object.keys(n).reduce((a,l)=>(a[l]=!1,a),{}),o=[];r&&(o=o.concat(Object.keys(r).map(a=>{let l=r[a],c=is(a,l),u=c==="r",f=c==="x";return{options:l,dposition:u?"chartArea":f?"bottom":"left",dtype:u?"radialLinear":f?"category":"linear"}}))),Q(o,a=>{let l=a.options,c=l.id,u=is(c,l),f=W(l.type,a.dtype);(l.position===void 0||ta(l.position,u)!==ta(a.dposition))&&(l.position=a.dposition),s[c]=!0;let d=null;if(c in n&&n[c].type===f)d=n[c];else{let h=Wt.getScale(f);d=new h({id:c,type:f,ctx:this.ctx,chart:this}),n[d.id]=d}d.init(l,t)}),Q(s,(a,l)=>{a||delete n[l]}),Q(n,a=>{mt.configure(this,a,a.options),mt.addBox(this,a)})}_updateMetasets(){let t=this._metasets,r=this.data.datasets.length,n=t.length;if(t.sort((s,o)=>s.index-o.index),n>r){for(let s=r;s<n;++s)this._destroyDatasetMeta(s);t.splice(r,n-r)}this._sortedMetasets=t.slice(0).sort(ea("order","index"))}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:r}}=this;t.length>r.length&&delete this._stacks,t.forEach((n,s)=>{r.filter(o=>o===n._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){let t=[],r=this.data.datasets,n,s;for(this._removeUnreferencedMetasets(),n=0,s=r.length;n<s;n++){let o=r[n],a=this.getDatasetMeta(n),l=o.type||this.config.type;if(a.type&&a.type!==l&&(this._destroyDatasetMeta(n),a=this.getDatasetMeta(n)),a.type=l,a.indexAxis=o.indexAxis||es(l,this.options),a.order=o.order||0,a.index=n,a.label=""+o.label,a.visible=this.isDatasetVisible(n),a.controller)a.controller.updateIndex(n),a.controller.linkScales();else{let c=Wt.getController(l),{datasetElementType:u,dataElementType:f}=it.datasets[l];Object.assign(c,{dataElementType:Wt.getElement(f),datasetElementType:u&&Wt.getElement(u)}),a.controller=new c(this,n),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){Q(this.data.datasets,(t,r)=>{this.getDatasetMeta(r).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let r=this.config;r.update();let n=this._options=r.createResolver(r.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;let o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let u=0,f=this.data.datasets.length;u<f;u++){let{controller:d}=this.getDatasetMeta(u),h=!s&&o.indexOf(d)===-1;d.buildOrUpdateElements(h),a=Math.max(+d.getMaxOverflow(),a)}a=this._minPadding=n.layout.autoPadding?a:0,this._updateLayout(a),s||Q(o,u=>{u.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(ea("z","_idx"));let{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Q(this.scales,t=>{mt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,r=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!un(r,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,r=this._getUniformDataChanges()||[];for(let{method:n,start:s,count:o}of r){let a=n==="_removeElements"?-o:o;Gf(t,s,a)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let r=this.data.datasets.length,n=o=>new Set(t.filter(a=>a[0]===o).map((a,l)=>l+","+a.splice(1).join(","))),s=n(0);for(let o=1;o<r;o++)if(!un(s,n(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;mt.update(this,this.width,this.height,t);let r=this.chartArea,n=r.width<=0||r.height<=0;this._layers=[],Q(this.boxes,s=>{n&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let r=0,n=this.data.datasets.length;r<n;++r)this.getDatasetMeta(r).controller.configure();for(let r=0,n=this.data.datasets.length;r<n;++r)this._updateDataset(r,Ut(t)?t({datasetIndex:r}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,r){let n=this.getDatasetMeta(t),s={meta:n,index:t,mode:r,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(n.controller._update(r),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&($t.has(this)?this.attached&&!$t.running(this)&&$t.start(this):(this.draw(),ia({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){let{width:n,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(n,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;let r=this._layers;for(t=0;t<r.length&&r[t].z<=0;++t)r[t].draw(this.chartArea);for(this._drawDatasets();t<r.length;++t)r[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){let r=this._sortedMetasets,n=[],s,o;for(s=0,o=r.length;s<o;++s){let a=r[s];(!t||a.visible)&&n.push(a)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;let t=this.getSortedVisibleDatasetMetas();for(let r=t.length-1;r>=0;--r)this._drawDataset(t[r]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let r=this.ctx,n={meta:t,index:t.index,cancelable:!0},s=Fn(this,t);this.notifyPlugins("beforeDatasetDraw",n)!==!1&&(s&&ai(r,s),t.controller.draw(),s&&li(r),n.cancelable=!1,this.notifyPlugins("afterDatasetDraw",n))}isPointInArea(t){return Rt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,r,n,s){let o=Zu.modes[r];return typeof o=="function"?o(this,t,n,s):[]}getDatasetMeta(t){let r=this.data.datasets[t],n=this._metasets,s=n.filter(o=>o&&o._dataset===r).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:r&&r.order||0,index:t,_dataset:r,_parsed:[],_sorted:!1},n.push(s)),s}getContext(){return this.$context||(this.$context=qt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let r=this.data.datasets[t];if(!r)return!1;let n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!r.hidden}setDatasetVisibility(t,r){let n=this.getDatasetMeta(t);n.hidden=!r}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,r,n){let s=n?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,s);Re(r)?(o.data[r].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),a.update(o,{visible:n}),this.update(l=>l.datasetIndex===t?s:void 0))}hide(t,r){this._updateVisibility(t,r,!1)}show(t,r){this._updateVisibility(t,r,!0)}_destroyDatasetMeta(t){let r=this._metasets[t];r&&r.controller&&r.controller._destroy(),delete this._metasets[t]}_stop(){let t,r;for(this.stop(),$t.remove(this),t=0,r=this.data.datasets.length;t<r;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:r}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Mn(t,r),this.platform.releaseContext(r),this.canvas=null,this.ctx=null),delete ar[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let t=this._listeners,r=this.platform,n=(o,a)=>{r.addEventListener(this,o,a),t[o]=a},s=(o,a,l)=>{o.offsetX=a,o.offsetY=l,this._eventHandler(o)};Q(this.options.events,o=>n(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,r=this.platform,n=(c,u)=>{r.addEventListener(this,c,u),t[c]=u},s=(c,u)=>{t[c]&&(r.removeEventListener(this,c,u),delete t[c])},o=(c,u)=>{this.canvas&&this.resize(c,u)},a,l=()=>{s("attach",l),this.attached=!0,this.resize(),n("resize",o),n("detach",a)};a=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),n("attach",l)},r.isAttached(this.canvas)?l():a()}unbindEvents(){Q(this._listeners,(t,r)=>{this.platform.removeEventListener(this,r,t)}),this._listeners={},Q(this._responsiveListeners,(t,r)=>{this.platform.removeEventListener(this,r,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,r,n){let s=n?"set":"remove",o,a,l,c;for(r==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),l=0,c=t.length;l<c;++l){a=t[l];let u=a&&this.getDatasetMeta(a.datasetIndex).controller;u&&u[s+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){let r=this._active||[],n=t.map(({datasetIndex:o,index:a})=>{let l=this.getDatasetMeta(o);if(!l)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:l.data[a],index:a}});!si(n,r)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,r))}notifyPlugins(t,r,n){return this._plugins.notify(this,t,r,n)}isPluginEnabled(t){return this._plugins._cache.filter(r=>r.plugin.id===t).length===1}_updateHoverStyles(t,r,n){let s=this.options.hover,o=(c,u)=>c.filter(f=>!u.some(d=>f.datasetIndex===d.datasetIndex&&f.index===d.index)),a=o(r,t),l=n?t:o(t,r);a.length&&this.updateHoverStyle(a,s.mode,!1),l.length&&s.mode&&this.updateHoverStyle(l,s.mode,!0)}_eventHandler(t,r){let n={event:t,replay:r,cancelable:!0,inChartArea:this.isPointInArea(t)},s=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",n,s)===!1)return;let o=this._handleEvent(t,r,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,s),(o||n.changed)&&this.render(),this}_handleEvent(t,r,n){let{_active:s=[],options:o}=this,a=r,l=this._getActiveElements(t,s,n,a),c=no(t),u=Kf(t,this._lastEvent,n,c);n&&(this._lastEvent=null,Z(o.onHover,[t,l,this],this),c&&Z(o.onClick,[t,l,this],this));let f=!si(l,s);return(f||r)&&(this._active=l,this._updateHoverStyles(l,s,r)),this._lastEvent=u,f}_getActiveElements(t,r,n,s){if(t.type==="mouseout")return[];if(!n)return r;let o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}}return i})();function na(){return Q(Zf.instances,i=>i._plugins.invalidate())}function Jf(i,e,t){let{startAngle:r,x:n,y:s,outerRadius:o,innerRadius:a,options:l}=e,{borderWidth:c,borderJoinStyle:u}=l,f=Math.min(c/o,ft(r-t));if(i.beginPath(),i.arc(n,s,o-c/2,r+f/2,t-f/2),a>0){let d=Math.min(c/a,ft(r-t));i.arc(n,s,a+c/2,t-d/2,r+d/2,!0)}else{let d=Math.min(c/2,o*ft(r-t));if(u==="round")i.arc(n,s,d,t-$/2,r+$/2,!0);else if(u==="bevel"){let h=2*d*d,m=-h*Math.cos(t+$/2)+n,p=-h*Math.sin(t+$/2)+s,g=h*Math.cos(r+$/2)+n,b=h*Math.sin(r+$/2)+s;i.lineTo(m,p),i.lineTo(g,b)}}i.closePath(),i.moveTo(0,0),i.rect(0,0,i.canvas.width,i.canvas.height),i.clip("evenodd")}function td(i,e,t){let{startAngle:r,pixelMargin:n,x:s,y:o,outerRadius:a,innerRadius:l}=e,c=n/a;i.beginPath(),i.arc(s,o,a,r-c,t+c),l>n?(c=n/l,i.arc(s,o,l,t+c,r-c,!0)):i.arc(s,o,n,t+st,r-st),i.closePath(),i.clip()}function ed(i){return Qi(i,["outerStart","outerEnd","innerStart","innerEnd"])}function id(i,e,t,r){let n=ed(i.options.borderRadius),s=(t-e)/2,o=Math.min(s,r*e/2),a=l=>{let c=(t-Math.min(s,l))*r/2;return lt(l,0,Math.min(s,c))};return{outerStart:a(n.outerStart),outerEnd:a(n.outerEnd),innerStart:lt(n.innerStart,0,o),innerEnd:lt(n.innerEnd,0,o)}}function Be(i,e,t,r){return{x:t+i*Math.cos(e),y:r+i*Math.sin(e)}}function fr(i,e,t,r,n,s){let{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=e,f=Math.max(e.outerRadius+r+t-c,0),d=u>0?u+r+t+c:0,h=0,m=n-l;if(r){let N=u>0?u-r:0,Y=f>0?f-r:0,G=(N+Y)/2,yt=G!==0?m*G/(G+r):m;h=(m-yt)/2}let p=Math.max(.001,m*f-t/$)/f,g=(m-p)/2,b=l+g+h,x=n-g-h,{outerStart:w,outerEnd:T,innerStart:v,innerEnd:_}=id(e,d,f,x-b),P=f-w,C=f-T,O=b+w/P,R=x-T/C,z=d+v,H=d+_,rt=b+v/z,ut=x-_/H;if(i.beginPath(),s){let N=(O+R)/2;if(i.arc(o,a,f,O,N),i.arc(o,a,f,N,R),T>0){let at=Be(C,R,o,a);i.arc(at.x,at.y,T,R,x+st)}let Y=Be(H,x,o,a);if(i.lineTo(Y.x,Y.y),_>0){let at=Be(H,ut,o,a);i.arc(at.x,at.y,_,x+st,ut+Math.PI)}let G=(x-_/d+(b+v/d))/2;if(i.arc(o,a,d,x-_/d,G,!0),i.arc(o,a,d,G,b+v/d,!0),v>0){let at=Be(z,rt,o,a);i.arc(at.x,at.y,v,rt+Math.PI,b-st)}let yt=Be(P,b,o,a);if(i.lineTo(yt.x,yt.y),w>0){let at=Be(P,O,o,a);i.arc(at.x,at.y,w,b-st,O)}}else{i.moveTo(o,a);let N=Math.cos(O)*f+o,Y=Math.sin(O)*f+a;i.lineTo(N,Y);let G=Math.cos(R)*f+o,yt=Math.sin(R)*f+a;i.lineTo(G,yt)}i.closePath()}function rd(i,e,t,r,n){let{fullCircles:s,startAngle:o,circumference:a}=e,l=e.endAngle;if(s){fr(i,e,t,r,l,n);for(let c=0;c<s;++c)i.fill();isNaN(a)||(l=o+(a%et||et))}return fr(i,e,t,r,l,n),i.fill(),l}function nd(i,e,t,r,n){let{fullCircles:s,startAngle:o,circumference:a,options:l}=e,{borderWidth:c,borderJoinStyle:u,borderDash:f,borderDashOffset:d,borderRadius:h}=l,m=l.borderAlign==="inner";if(!c)return;i.setLineDash(f||[]),i.lineDashOffset=d,m?(i.lineWidth=c*2,i.lineJoin=u||"round"):(i.lineWidth=c,i.lineJoin=u||"bevel");let p=e.endAngle;if(s){fr(i,e,t,r,p,n);for(let g=0;g<s;++g)i.stroke();isNaN(a)||(p=o+(a%et||et))}m&&td(i,e,p),l.selfJoin&&p-o>=$&&h===0&&u!=="miter"&&Jf(i,e,p),s||(fr(i,e,t,r,p,n),i.stroke())}var ns=class extends It{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:e=>e!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,t,r){let n=this.getProps(["x","y"],r),{angle:s,distance:o}=mn(n,{x:e,y:t}),{startAngle:a,endAngle:l,innerRadius:c,outerRadius:u,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],r),d=(this.options.spacing+this.options.borderWidth)/2,h=W(f,l-a),m=ze(s,a,l)&&a!==l,p=h>=et||m,g=zt(o,c+d,u+d);return p&&g}getCenterPoint(e){let{x:t,y:r,startAngle:n,endAngle:s,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:l,spacing:c}=this.options,u=(n+s)/2,f=(o+a+c+l)/2;return{x:t+Math.cos(u)*f,y:r+Math.sin(u)*f}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){let{options:t,circumference:r}=this,n=(t.offset||0)/4,s=(t.spacing||0)/2,o=t.circular;if(this.pixelMargin=t.borderAlign==="inner"?.33:0,this.fullCircles=r>et?Math.floor(r/et):0,r===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let a=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(a)*n,Math.sin(a)*n);let l=1-Math.sin(Math.min($,r||0)),c=n*l;e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,rd(e,this,c,s,o),nd(e,this,c,s,o),e.restore()}};function Ya(i,e,t=e){i.lineCap=W(t.borderCapStyle,e.borderCapStyle),i.setLineDash(W(t.borderDash,e.borderDash)),i.lineDashOffset=W(t.borderDashOffset,e.borderDashOffset),i.lineJoin=W(t.borderJoinStyle,e.borderJoinStyle),i.lineWidth=W(t.borderWidth,e.borderWidth),i.strokeStyle=W(t.borderColor,e.borderColor)}function sd(i,e,t){i.lineTo(t.x,t.y)}function od(i){return i.stepped?bo:i.tension||i.cubicInterpolationMode==="monotone"?xo:sd}function Ua(i,e,t={}){let r=i.length,{start:n=0,end:s=r-1}=t,{start:o,end:a}=e,l=Math.max(n,o),c=Math.min(s,a),u=n<o&&s<o||n>a&&s>a;return{count:r,start:l,loop:e.loop,ilen:c<l&&!u?r+c-l:c-l}}function ad(i,e,t,r){let{points:n,options:s}=e,{count:o,start:a,loop:l,ilen:c}=Ua(n,t,r),u=od(s),{move:f=!0,reverse:d}=r||{},h,m,p;for(h=0;h<=c;++h)m=n[(a+(d?c-h:h))%o],!m.skip&&(f?(i.moveTo(m.x,m.y),f=!1):u(i,p,m,d,s.stepped),p=m);return l&&(m=n[(a+(d?c:0))%o],u(i,p,m,d,s.stepped)),!!l}function ld(i,e,t,r){let n=e.points,{count:s,start:o,ilen:a}=Ua(n,t,r),{move:l=!0,reverse:c}=r||{},u=0,f=0,d,h,m,p,g,b,x=T=>(o+(c?a-T:T))%s,w=()=>{p!==g&&(i.lineTo(u,g),i.lineTo(u,p),i.lineTo(u,b))};for(l&&(h=n[x(0)],i.moveTo(h.x,h.y)),d=0;d<=a;++d){if(h=n[x(d)],h.skip)continue;let T=h.x,v=h.y,_=T|0;_===m?(v<p?p=v:v>g&&(g=v),u=(f*u+T)/++f):(w(),i.lineTo(T,v),m=_,f=0,p=g=v),b=v}w()}function ss(i){let e=i.options,t=e.borderDash&&e.borderDash.length;return!i._decimated&&!i._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?ld:ad}function cd(i){return i.stepped?Co:i.tension||i.cubicInterpolationMode==="monotone"?Po:ie}function ud(i,e,t,r){let n=e._path;n||(n=e._path=new Path2D,e.path(n,t,r)&&n.closePath()),Ya(i,e.options),i.stroke(n)}function fd(i,e,t,r){let{segments:n,options:s}=e,o=ss(e);for(let a of n)Ya(i,s,a.style),i.beginPath(),o(i,e,a,{start:t,end:t+r-1})&&i.closePath(),i.stroke()}var dd=typeof Path2D=="function";function hd(i,e,t,r){dd&&!e.options.segment?ud(i,e,t,r):fd(i,e,t,r)}var mr=(()=>{class i 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,r){let n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){let s=n.spanGaps?this._loop:this._fullLoop;To(this._points,n,t,s,r),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=So(this,this.options.segment))}first(){let t=this.segments,r=this.points;return t.length&&r[t[0].start]}last(){let t=this.segments,r=this.points,n=t.length;return n&&r[t[n-1].end]}interpolate(t,r){let n=this.options,s=t[r],o=this.points,a=Rn(this,{property:r,start:s,end:s});if(!a.length)return;let l=[],c=cd(n),u,f;for(u=0,f=a.length;u<f;++u){let{start:d,end:h}=a[u],m=o[d],p=o[h];if(m===p){l.push(m);continue}let g=Math.abs((s-m[r])/(p[r]-m[r])),b=c(m,p,g,n.stepped);b[r]=t[r],l.push(b)}return l.length===1?l[0]:l}pathSegment(t,r,n){return ss(this)(t,this,r,n)}path(t,r,n){let s=this.segments,o=ss(this),a=this._loop;r=r||0,n=n||this.points.length-r;for(let l of s)a&=o(t,this,l,{start:r,end:r+n-1});return!!a}draw(t,r,n,s){let o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),hd(t,this,n,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}return i})();function sa(i,e,t,r){let n=i.options,{[t]:s}=i.getProps([t],r);return Math.abs(e-s)<n.radius+n.hitRadius}var md=(()=>{class i 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,r,n){let s=this.options,{x:o,y:a}=this.getProps(["x","y"],n);return Math.pow(t-o,2)+Math.pow(r-a,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,r){return sa(this,t,"x",r)}inYRange(t,r){return sa(this,t,"y",r)}getCenterPoint(t){let{x:r,y:n}=this.getProps(["x","y"],t);return{x:r,y:n}}size(t){t=t||this.options||{};let r=t.radius||0;r=Math.max(r,r&&t.hoverRadius||0);let n=r&&t.borderWidth||0;return(r+n)*2}draw(t,r){let n=this.options;this.skip||n.radius<.1||!Rt(this,r,this.size(n)/2)||(t.strokeStyle=n.borderColor,t.lineWidth=n.borderWidth,t.fillStyle=n.backgroundColor,Xi(t,n,this.x,this.y))}getRange(){let t=this.options||{};return t.radius+t.hitRadius}}return i})();function Va(i,e){let{x:t,y:r,base:n,width:s,height:o}=i.getProps(["x","y","base","width","height"],e),a,l,c,u,f;return i.horizontal?(f=o/2,a=Math.min(t,n),l=Math.max(t,n),c=r-f,u=r+f):(f=s/2,a=t-f,l=t+f,c=Math.min(r,n),u=Math.max(r,n)),{left:a,top:c,right:l,bottom:u}}function le(i,e,t,r){return i?0:lt(e,t,r)}function pd(i,e,t){let r=i.options.borderWidth,n=i.borderSkipped,s=kn(r);return{t:le(n.top,s.top,0,t),r:le(n.right,s.right,0,e),b:le(n.bottom,s.bottom,0,t),l:le(n.left,s.left,0,e)}}function gd(i,e,t){let{enableBorderRadius:r}=i.getProps(["enableBorderRadius"]),n=i.options.borderRadius,s=oe(n),o=Math.min(e,t),a=i.borderSkipped,l=r||V(n);return{topLeft:le(!l||a.top||a.left,s.topLeft,0,o),topRight:le(!l||a.top||a.right,s.topRight,0,o),bottomLeft:le(!l||a.bottom||a.left,s.bottomLeft,0,o),bottomRight:le(!l||a.bottom||a.right,s.bottomRight,0,o)}}function bd(i){let e=Va(i),t=e.right-e.left,r=e.bottom-e.top,n=pd(i,t/2,r/2),s=gd(i,t/2,r/2);return{outer:{x:e.left,y:e.top,w:t,h:r,radius:s},inner:{x:e.left+n.l,y:e.top+n.t,w:t-n.l-n.r,h:r-n.t-n.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,s.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(n.b,n.r))}}}}function Vn(i,e,t,r){let n=e===null,s=t===null,a=i&&!(n&&s)&&Va(i,r);return a&&(n||zt(e,a.left,a.right))&&(s||zt(t,a.top,a.bottom))}function xd(i){return i.topLeft||i.topRight||i.bottomLeft||i.bottomRight}function vd(i,e){i.rect(e.x,e.y,e.w,e.h)}function jn(i,e,t={}){let r=i.x!==t.x?-e:0,n=i.y!==t.y?-e:0,s=(i.x+i.w!==t.x+t.w?e:0)-r,o=(i.y+i.h!==t.y+t.h?e:0)-n;return{x:i.x+r,y:i.y+n,w:i.w+s,h:i.h+o,radius:i.radius}}var os=class extends It{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){let{inflateAmount:t,options:{borderColor:r,backgroundColor:n}}=this,{inner:s,outer:o}=bd(this),a=xd(o.radius)?We:vd;e.save(),(o.w!==s.w||o.h!==s.h)&&(e.beginPath(),a(e,jn(o,t,s)),e.clip(),a(e,jn(s,-t,o)),e.fillStyle=r,e.fill("evenodd")),e.beginPath(),a(e,jn(s,t)),e.fillStyle=n,e.fill(),e.restore()}inRange(e,t,r){return Vn(this,e,t,r)}inXRange(e,t){return Vn(this,e,null,t)}inYRange(e,t){return Vn(this,null,e,t)}getCenterPoint(e){let{x:t,y:r,base:n,horizontal:s}=this.getProps(["x","y","base","horizontal"],e);return{x:s?(t+n)/2:t,y:s?r:(r+n)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}},yd=Object.freeze({__proto__:null,ArcElement:ns,BarElement:os,LineElement:mr,PointElement:md}),as=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],oa=as.map(i=>i.replace("rgb(","rgba(").replace(")",", 0.5)"));function ja(i){return as[i%as.length]}function qa(i){return oa[i%oa.length]}function _d(i,e){return i.borderColor=ja(e),i.backgroundColor=qa(e),++e}function wd(i,e){return i.backgroundColor=i.data.map(()=>ja(e++)),e}function Md(i,e){return i.backgroundColor=i.data.map(()=>qa(e++)),e}function Td(i){let e=0;return(t,r)=>{let n=i.getDatasetMeta(r).controller;n instanceof ps?e=wd(t,e):n instanceof La?e=Md(t,e):n&&(e=_d(t,e))}}function aa(i){let e;for(e in i)if(i[e].borderColor||i[e].backgroundColor)return!0;return!1}function kd(i){return i&&(i.borderColor||i.backgroundColor)}function Dd(){return it.borderColor!=="rgba(0,0,0,0.1)"||it.backgroundColor!=="rgba(0,0,0,0.1)"}var Cd={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(i,e,t){if(!t.enabled)return;let{data:{datasets:r},options:n}=i.config,{elements:s}=n,o=aa(r)||kd(n)||s&&aa(s)||Dd();if(!t.forceOverride&&o)return;let a=Td(i);r.forEach(a)}};function Pd(i,e,t,r,n){let s=n.samples||r;if(s>=t)return i.slice(e,e+t);let o=[],a=(t-2)/(s-2),l=0,c=e+t-1,u=e,f,d,h,m,p;for(o[l++]=i[u],f=0;f<s-2;f++){let g=0,b=0,x,w=Math.floor((f+1)*a)+1+e,T=Math.min(Math.floor((f+2)*a)+1,t)+e,v=T-w;for(x=w;x<T;x++)g+=i[x].x,b+=i[x].y;g/=v,b/=v;let _=Math.floor(f*a)+1+e,P=Math.min(Math.floor((f+1)*a)+1,t)+e,{x:C,y:O}=i[u];for(h=m=-1,x=_;x<P;x++)m=.5*Math.abs((C-g)*(i[x].y-O)-(C-i[x].x)*(b-O)),m>h&&(h=m,d=i[x],p=x);o[l++]=d,u=p}return o[l++]=i[c],o}function Od(i,e,t,r){let n=0,s=0,o,a,l,c,u,f,d,h,m,p,g=[],b=e+t-1,x=i[e].x,T=i[b].x-x;for(o=e;o<e+t;++o){a=i[o],l=(a.x-x)/T*r,c=a.y;let v=l|0;if(v===u)c<m?(m=c,f=o):c>p&&(p=c,d=o),n=(s*n+a.x)/++s;else{let _=o-1;if(!U(f)&&!U(d)){let P=Math.min(f,d),C=Math.max(f,d);P!==h&&P!==_&&g.push(Ai(Oe({},i[P]),{x:n})),C!==h&&C!==_&&g.push(Ai(Oe({},i[C]),{x:n}))}o>0&&_!==h&&g.push(i[_]),g.push(a),u=v,s=0,m=p=c,f=d=h=o}}return g}function $a(i){if(i._decimated){let e=i._data;delete i._decimated,delete i._data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function la(i){i.data.datasets.forEach(e=>{$a(e)})}function Sd(i,e){let t=e.length,r=0,n,{iScale:s}=i,{min:o,max:a,minDefined:l,maxDefined:c}=s.getUserBounds();return l&&(r=lt(Et(e,s.axis,o).lo,0,t-1)),c?n=lt(Et(e,s.axis,a).hi+1,r,t)-r:n=t-r,{start:r,count:n}}var Ad={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(i,e,t)=>{if(!t.enabled){la(i);return}let r=i.width;i.data.datasets.forEach((n,s)=>{let{_data:o,indexAxis:a}=n,l=i.getDatasetMeta(s),c=o||n.data;if(He([a,i.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;let u=i.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||i.options.parsing)return;let{start:f,count:d}=Sd(l,c),h=t.threshold||4*r;if(d<=h){$a(n);return}U(o)&&(n._data=c,delete n.data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(p){this._data=p}}));let m;switch(t.algorithm){case"lttb":m=Pd(c,f,d,r,t);break;case"min-max":m=Od(c,f,d,r);break;default:throw new Error(`Unsupported decimation algorithm '${t.algorithm}'`)}n._decimated=m})},destroy(i){la(i)}};function Id(i,e,t){let r=i.segments,n=i.points,s=e.points,o=[];for(let a of r){let{start:l,end:c}=a;c=pr(l,c,n);let u=ls(t,n[l],n[c],a.loop);if(!e.segments){o.push({source:a,target:u,start:n[l],end:n[c]});continue}let f=Rn(e,u);for(let d of f){let h=ls(t,s[d.start],s[d.end],d.loop),m=En(a,n,h);for(let p of m)o.push({source:p,target:d,start:{[t]:ca(u,h,"start",Math.max)},end:{[t]:ca(u,h,"end",Math.min)}})}}return o}function ls(i,e,t,r){if(r)return;let n=e[i],s=t[i];return i==="angle"&&(n=ft(n),s=ft(s)),{property:i,start:n,end:s}}function Ld(i,e){let{x:t=null,y:r=null}=i||{},n=e.points,s=[];return e.segments.forEach(({start:o,end:a})=>{a=pr(o,a,n);let l=n[o],c=n[a];r!==null?(s.push({x:l.x,y:r}),s.push({x:c.x,y:r})):t!==null&&(s.push({x:t,y:l.y}),s.push({x:t,y:c.y}))}),s}function pr(i,e,t){for(;e>i;e--){let r=t[e];if(!isNaN(r.x)&&!isNaN(r.y))break}return e}function ca(i,e,t,r){return i&&e?r(i[t],e[t]):i?i[t]:e?e[t]:0}function Xa(i,e){let t=[],r=!1;return tt(i)?(r=!0,t=i):t=Ld(i,e),t.length?new mr({points:t,options:{tension:0},_loop:r,_fullLoop:r}):null}function ua(i){return i&&i.fill!==!1}function Ed(i,e,t){let n=i[e].fill,s=[e],o;if(!t)return n;for(;n!==!1&&s.indexOf(n)===-1;){if(!nt(n))return n;if(o=i[n],!o)return!1;if(o.visible)return n;s.push(n),n=o.fill}return!1}function Rd(i,e,t){let r=Wd(i);if(V(r))return isNaN(r.value)?!1:r;let n=parseFloat(r);return nt(n)&&Math.floor(n)===n?Fd(r[0],e,n,t):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function Fd(i,e,t,r){return(i==="-"||i==="+")&&(t=e+t),t===e||t<0||t>=r?!1:t}function zd(i,e){let t=null;return i==="start"?t=e.bottom:i==="end"?t=e.top:V(i)?t=e.getPixelForValue(i.value):e.getBasePixel&&(t=e.getBasePixel()),t}function Nd(i,e,t){let r;return i==="start"?r=t:i==="end"?r=e.options.reverse?e.min:e.max:V(i)?r=i.value:r=e.getBaseValue(),r}function Wd(i){let e=i.options,t=e.fill,r=W(t&&t.target,t);return r===void 0&&(r=!!e.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function Hd(i){let{scale:e,index:t,line:r}=i,n=[],s=r.segments,o=r.points,a=Bd(e,t);a.push(Xa({x:null,y:e.bottom},r));for(let l=0;l<s.length;l++){let c=s[l];for(let u=c.start;u<=c.end;u++)Yd(n,o[u],a)}return new mr({points:n,options:{}})}function Bd(i,e){let t=[],r=i.getMatchingVisibleMetas("line");for(let n=0;n<r.length;n++){let s=r[n];if(s.index===e)break;s.hidden||t.unshift(s.dataset)}return t}function Yd(i,e,t){let r=[];for(let n=0;n<t.length;n++){let s=t[n],{first:o,last:a,point:l}=Ud(s,e,"x");if(!(!l||o&&a)){if(o)r.unshift(l);else if(i.push(l),!a)break}}i.push(...r)}function Ud(i,e,t){let r=i.interpolate(e,t);if(!r)return{};let n=r[t],s=i.segments,o=i.points,a=!1,l=!1;for(let c=0;c<s.length;c++){let u=s[c],f=o[u.start][t],d=o[u.end][t];if(zt(n,f,d)){a=n===f,l=n===d;break}}return{first:a,last:l,point:r}}var dr=class{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,r){let{x:n,y:s,radius:o}=this;return t=t||{start:0,end:et},e.arc(n,s,o,t.end,t.start,!0),!r.bounds}interpolate(e){let{x:t,y:r,radius:n}=this,s=e.angle;return{x:t+Math.cos(s)*n,y:r+Math.sin(s)*n,angle:s}}};function Vd(i){let{chart:e,fill:t,line:r}=i;if(nt(t))return jd(e,t);if(t==="stack")return Hd(i);if(t==="shape")return!0;let n=qd(i);return n instanceof dr?n:Xa(n,r)}function jd(i,e){let t=i.getDatasetMeta(e);return t&&i.isDatasetVisible(e)?t.dataset:null}function qd(i){return(i.scale||{}).getPointPositionForValue?Xd(i):$d(i)}function $d(i){let{scale:e={},fill:t}=i,r=zd(t,e);if(nt(r)){let n=e.isHorizontal();return{x:n?r:null,y:n?null:r}}return null}function Xd(i){let{scale:e,fill:t}=i,r=e.options,n=e.getLabels().length,s=r.reverse?e.max:e.min,o=Nd(t,e,s),a=[];if(r.grid.circular){let l=e.getPointPositionForValue(0,s);return new dr({x:l.x,y:l.y,radius:e.getDistanceFromCenterForValue(o)})}for(let l=0;l<n;++l)a.push(e.getPointPositionForValue(l,o));return a}function qn(i,e,t){let r=Vd(e),{chart:n,index:s,line:o,scale:a,axis:l}=e,c=o.options,u=c.fill,f=c.backgroundColor,{above:d=f,below:h=f}=u||{},m=n.getDatasetMeta(s),p=Fn(n,m);r&&o.points.length&&(ai(i,t),Qd(i,{line:o,target:r,above:d,below:h,area:t,scale:a,axis:l,clip:p}),li(i))}function Qd(i,e){let{line:t,target:r,above:n,below:s,area:o,scale:a,clip:l}=e,c=t._loop?"angle":e.axis;i.save();let u=s;s!==n&&(c==="x"?(fa(i,r,o.top),$n(i,{line:t,target:r,color:n,scale:a,property:c,clip:l}),i.restore(),i.save(),fa(i,r,o.bottom)):c==="y"&&(da(i,r,o.left),$n(i,{line:t,target:r,color:s,scale:a,property:c,clip:l}),i.restore(),i.save(),da(i,r,o.right),u=n)),$n(i,{line:t,target:r,color:u,scale:a,property:c,clip:l}),i.restore()}function fa(i,e,t){let{segments:r,points:n}=e,s=!0,o=!1;i.beginPath();for(let a of r){let{start:l,end:c}=a,u=n[l],f=n[pr(l,c,n)];s?(i.moveTo(u.x,u.y),s=!1):(i.lineTo(u.x,t),i.lineTo(u.x,u.y)),o=!!e.pathSegment(i,a,{move:o}),o?i.closePath():i.lineTo(f.x,t)}i.lineTo(e.first().x,t),i.closePath(),i.clip()}function da(i,e,t){let{segments:r,points:n}=e,s=!0,o=!1;i.beginPath();for(let a of r){let{start:l,end:c}=a,u=n[l],f=n[pr(l,c,n)];s?(i.moveTo(u.x,u.y),s=!1):(i.lineTo(t,u.y),i.lineTo(u.x,u.y)),o=!!e.pathSegment(i,a,{move:o}),o?i.closePath():i.lineTo(t,f.y)}i.lineTo(t,e.first().y),i.closePath(),i.clip()}function $n(i,e){let{line:t,target:r,property:n,color:s,scale:o,clip:a}=e,l=Id(t,r,n);for(let{source:c,target:u,start:f,end:d}of l){let{style:{backgroundColor:h=s}={}}=c,m=r!==!0;i.save(),i.fillStyle=h,Gd(i,o,a,m&&ls(n,f,d)),i.beginPath();let p=!!t.pathSegment(i,c),g;if(m){p?i.closePath():ha(i,r,d,n);let b=!!r.pathSegment(i,u,{move:p,reverse:!0});g=p&&b,g||ha(i,r,f,n)}i.closePath(),i.fill(g?"evenodd":"nonzero"),i.restore()}}function Gd(i,e,t,r){let n=e.chart.chartArea,{property:s,start:o,end:a}=r||{};if(s==="x"||s==="y"){let l,c,u,f;s==="x"?(l=o,c=n.top,u=a,f=n.bottom):(l=n.left,c=o,u=n.right,f=a),i.beginPath(),t&&(l=Math.max(l,t.left),u=Math.min(u,t.right),c=Math.max(c,t.top),f=Math.min(f,t.bottom)),i.rect(l,c,u-l,f-c),i.clip()}}function ha(i,e,t,r){let n=e.interpolate(t,r);n&&i.lineTo(n.x,n.y)}var Kd={id:"filler",afterDatasetsUpdate(i,e,t){let r=(i.data.datasets||[]).length,n=[],s,o,a,l;for(o=0;o<r;++o)s=i.getDatasetMeta(o),a=s.dataset,l=null,a&&a.options&&a instanceof mr&&(l={visible:i.isDatasetVisible(o),index:o,fill:Rd(a,o,r),chart:i,axis:s.controller.options.indexAxis,scale:s.vScale,line:a}),s.$filler=l,n.push(l);for(o=0;o<r;++o)l=n[o],!(!l||l.fill===!1)&&(l.fill=Ed(n,o,t.propagate))},beforeDraw(i,e,t){let r=t.drawTime==="beforeDraw",n=i.getSortedVisibleDatasetMetas(),s=i.chartArea;for(let o=n.length-1;o>=0;--o){let a=n[o].$filler;a&&(a.line.updateControlPoints(s,a.axis),r&&a.fill&&qn(i.ctx,a,s))}},beforeDatasetsDraw(i,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;let r=i.getSortedVisibleDatasetMetas();for(let n=r.length-1;n>=0;--n){let s=r[n].$filler;ua(s)&&qn(i.ctx,s,i.chartArea)}},beforeDatasetDraw(i,e,t){let r=e.meta.$filler;!ua(r)||t.drawTime!=="beforeDatasetDraw"||qn(i.ctx,r,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},ma=(i,e)=>{let{boxHeight:t=e,boxWidth:r=e}=i;return i.usePointStyle&&(t=Math.min(t,e),r=i.pointStyleWidth||Math.min(r,e)),{boxWidth:r,boxHeight:t,itemHeight:Math.max(e,t)}},Zd=(i,e)=>i!==null&&e!==null&&i.datasetIndex===e.datasetIndex&&i.index===e.index,hr=class extends It{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t,r){this.maxWidth=e,this.maxHeight=t,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let e=this.options.labels||{},t=Z(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter(r=>e.filter(r,this.chart.data))),e.sort&&(t=t.sort((r,n)=>e.sort(r,n,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){let{options:e,ctx:t}=this;if(!e.display){this.width=this.height=0;return}let r=e.labels,n=ot(r.font),s=n.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=ma(r,s),c,u;t.font=n.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,s,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,n,a,l)+10),this.width=Math.min(c,e.maxWidth||this.maxWidth),this.height=Math.min(u,e.maxHeight||this.maxHeight)}_fitRows(e,t,r,n){let{ctx:s,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=n+a,f=e;s.textAlign="left",s.textBaseline="middle";let d=-1,h=-u;return this.legendItems.forEach((m,p)=>{let g=r+t/2+s.measureText(m.text).width;(p===0||c[c.length-1]+g+2*a>o)&&(f+=u,c[c.length-(p>0?0:1)]=0,h+=u,d++),l[p]={left:0,top:h,row:d,width:g,height:n},c[c.length-1]+=g+a}),f}_fitCols(e,t,r,n){let{ctx:s,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-e,f=a,d=0,h=0,m=0,p=0;return this.legendItems.forEach((g,b)=>{let{itemWidth:x,itemHeight:w}=Jd(r,t,s,g,n);b>0&&h+w+2*a>u&&(f+=d+a,c.push({width:d,height:h}),m+=d+a,p++,d=h=0),l[b]={left:m,top:h,col:p,width:x,height:w},d=Math.max(d,x),h+=w+a}),f+=d,c.push({width:d,height:h}),f}adjustHitBoxes(){if(!this.options.display)return;let e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:r,labels:{padding:n},rtl:s}}=this,o=be(s,this.left,this.width);if(this.isHorizontal()){let a=0,l=dt(r,this.left+n,this.right-this.lineWidths[a]);for(let c of t)a!==c.row&&(a=c.row,l=dt(r,this.left+n,this.right-this.lineWidths[a])),c.top+=this.top+e+n,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+n}else{let a=0,l=dt(r,this.top+e+n,this.bottom-this.columnSizes[a].height);for(let c of t)c.col!==a&&(a=c.col,l=dt(r,this.top+e+n,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+n,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){let e=this.ctx;ai(e,this),this._draw(),li(e)}}_draw(){let{options:e,columnSizes:t,lineWidths:r,ctx:n}=this,{align:s,labels:o}=e,a=it.color,l=be(e.rtl,this.left,this.width),c=ot(o.font),{padding:u}=o,f=c.size,d=f/2,h;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;let{boxWidth:m,boxHeight:p,itemHeight:g}=ma(o,f),b=function(_,P,C){if(isNaN(m)||m<=0||isNaN(p)||p<0)return;n.save();let O=W(C.lineWidth,1);if(n.fillStyle=W(C.fillStyle,a),n.lineCap=W(C.lineCap,"butt"),n.lineDashOffset=W(C.lineDashOffset,0),n.lineJoin=W(C.lineJoin,"miter"),n.lineWidth=O,n.strokeStyle=W(C.strokeStyle,a),n.setLineDash(W(C.lineDash,[])),o.usePointStyle){let R={radius:p*Math.SQRT2/2,pointStyle:C.pointStyle,rotation:C.rotation,borderWidth:O},z=l.xPlus(_,m/2),H=P+d;Tn(n,R,z,H,o.pointStyleWidth&&m)}else{let R=P+Math.max((f-p)/2,0),z=l.leftForLtr(_,m),H=oe(C.borderRadius);n.beginPath(),Object.values(H).some(rt=>rt!==0)?We(n,{x:z,y:R,w:m,h:p,radius:H}):n.rect(z,R,m,p),n.fill(),O!==0&&n.stroke()}n.restore()},x=function(_,P,C){se(n,C.text,_,P+g/2,c,{strikethrough:C.hidden,textAlign:l.textAlign(C.textAlign)})},w=this.isHorizontal(),T=this._computeTitleHeight();w?h={x:dt(s,this.left+u,this.right-r[0]),y:this.top+u+T,line:0}:h={x:this.left+u,y:dt(s,this.top+T+u,this.bottom-t[0].height),line:0},In(this.ctx,e.textDirection);let v=g+u;this.legendItems.forEach((_,P)=>{n.strokeStyle=_.fontColor,n.fillStyle=_.fontColor;let C=n.measureText(_.text).width,O=l.textAlign(_.textAlign||(_.textAlign=o.textAlign)),R=m+d+C,z=h.x,H=h.y;l.setWidth(this.width),w?P>0&&z+R+u>this.right&&(H=h.y+=v,h.line++,z=h.x=dt(s,this.left+u,this.right-r[h.line])):P>0&&H+v>this.bottom&&(z=h.x=z+t[h.line].width+u,h.line++,H=h.y=dt(s,this.top+T+u,this.bottom-t[h.line].height));let rt=l.x(z);if(b(rt,H,_),z=mo(O,z+m+d,w?z+R:this.right,e.rtl),x(l.x(z),H,_),w)h.x+=R+u;else if(typeof _.text!="string"){let ut=c.lineHeight;h.y+=Qa(_,ut)+u}else h.y+=v}),Ln(this.ctx,e.textDirection)}drawTitle(){let e=this.options,t=e.title,r=ot(t.font),n=ht(t.padding);if(!t.display)return;let s=be(e.rtl,this.left,this.width),o=this.ctx,a=t.position,l=r.size/2,c=n.top+l,u,f=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),u=this.top+c,f=dt(e.align,f,this.right-d);else{let m=this.columnSizes.reduce((p,g)=>Math.max(p,g.height),0);u=c+dt(e.align,this.top,this.bottom-m-e.labels.padding-this._computeTitleHeight())}let h=dt(a,f,f+d);o.textAlign=s.textAlign(qi(a)),o.textBaseline="middle",o.strokeStyle=t.color,o.fillStyle=t.color,o.font=r.string,se(o,t.text,h,u,r)}_computeTitleHeight(){let e=this.options.title,t=ot(e.font),r=ht(e.padding);return e.display?t.lineHeight+r.height:0}_getLegendItemAt(e,t){let r,n,s;if(zt(e,this.left,this.right)&&zt(t,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(n=s[r],zt(e,n.left,n.left+n.width)&&zt(t,n.top,n.top+n.height))return this.legendItems[r]}return null}handleEvent(e){let t=this.options;if(!ih(e.type,t))return;let r=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){let n=this._hoveredItem,s=Zd(n,r);n&&!s&&Z(t.onLeave,[e,n,this],this),this._hoveredItem=r,r&&!s&&Z(t.onHover,[e,r,this],this)}else r&&Z(t.onClick,[e,r,this],this)}};function Jd(i,e,t,r,n){let s=th(r,i,e,t),o=eh(n,r,e.lineHeight);return{itemWidth:s,itemHeight:o}}function th(i,e,t,r){let n=i.text;return n&&typeof n!="string"&&(n=n.reduce((s,o)=>s.length>o.length?s:o)),e+t.size/2+r.measureText(n).width}function eh(i,e,t){let r=i;return typeof e.text!="string"&&(r=Qa(e,t)),r}function Qa(i,e){let t=i.text?i.text.length:0;return e*t}function ih(i,e){return!!((i==="mousemove"||i==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(i==="click"||i==="mouseup"))}var rh={id:"legend",_element:hr,start(i,e,t){let r=i.legend=new hr({ctx:i.ctx,options:t,chart:i});mt.configure(i,r,t),mt.addBox(i,r)},stop(i){mt.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,e,t){let r=i.legend;mt.configure(i,r,t),r.options=t},afterUpdate(i){let e=i.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(i,e){e.replay||i.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,e,t){let r=e.datasetIndex,n=t.chart;n.isDatasetVisible(r)?(n.hide(r),e.hidden=!0):(n.show(r),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){let e=i.data.datasets,{labels:{usePointStyle:t,pointStyle:r,textAlign:n,color:s,useBorderRadius:o,borderRadius:a}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{let c=l.controller.getStyle(t?0:void 0),u=ht(c.borderWidth);return{text:e[l.index].label,fillStyle:c.backgroundColor,fontColor:s,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:n||c.textAlign,borderRadius:o&&(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)}}},bi=class extends It{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t){let r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=t;let n=tt(r.text)?r.text.length:1;this._padding=ht(r.padding);let s=n*ot(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){let e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){let{top:t,left:r,bottom:n,right:s,options:o}=this,a=o.align,l=0,c,u,f;return this.isHorizontal()?(u=dt(a,r,s),f=t+e,c=s-r):(o.position==="left"?(u=r+e,f=dt(a,n,t),l=$*-.5):(u=s-e,f=dt(a,t,n),l=$*.5),c=n-t),{titleX:u,titleY:f,maxWidth:c,rotation:l}}draw(){let e=this.ctx,t=this.options;if(!t.display)return;let r=ot(t.font),s=r.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(s);se(e,t.text,0,0,r,{color:t.color,maxWidth:l,rotation:c,textAlign:qi(t.align),textBaseline:"middle",translation:[o,a]})}};function nh(i,e){let t=new bi({ctx:i.ctx,options:e,chart:i});mt.configure(i,t,e),mt.addBox(i,t),i.titleBlock=t}var sh={id:"title",_element:bi,start(i,e,t){nh(i,t)},stop(i){let e=i.titleBlock;mt.removeBox(i,e),delete i.titleBlock},beforeUpdate(i,e,t){let r=i.titleBlock;mt.configure(i,r,t),r.options=t},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}},rr=new WeakMap,oh={id:"subtitle",start(i,e,t){let r=new bi({ctx:i.ctx,options:t,chart:i});mt.configure(i,r,t),mt.addBox(i,r),rr.set(i,r)},stop(i){mt.removeBox(i,rr.get(i)),rr.delete(i)},beforeUpdate(i,e,t){let r=rr.get(i);mt.configure(i,r,t),r.options=t},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},pi={average(i){if(!i.length)return!1;let e,t,r=new Set,n=0,s=0;for(e=0,t=i.length;e<t;++e){let a=i[e].element;if(a&&a.hasValue()){let l=a.tooltipPosition();r.add(l.x),n+=l.y,++s}}return s===0||r.size===0?!1:{x:[...r].reduce((a,l)=>a+l)/r.size,y:n/s}},nearest(i,e){if(!i.length)return!1;let t=e.x,r=e.y,n=Number.POSITIVE_INFINITY,s,o,a;for(s=0,o=i.length;s<o;++s){let l=i[s].element;if(l&&l.hasValue()){let c=l.getCenterPoint(),u=Bi(e,c);u<n&&(n=u,a=l)}}if(a){let l=a.tooltipPosition();t=l.x,r=l.y}return{x:t,y:r}}};function Nt(i,e){return e&&(tt(e)?Array.prototype.push.apply(i,e):i.push(e)),i}function Xt(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
|
|
1
|
+
import{a as Oe,b as Ai,ca as zs}from"./chunk-YPUCOH35.js";var gp=(()=>{class i{DEFAULT_FONT="Roboto";EDGE_BUFFER=10;debug=!1;scaleFactor=window.devicePixelRatio||1;fontsReadyPromise;sharedResizeObserver=null;observedCanvases=new Map;dprMediaQuery=null;resizeCallbacks=new WeakMap;constructor(){this.fontsReadyPromise=document.fonts.ready}registerCanvas(t,r={}){if(r=Oe({autoRelease:!0},r),!t)return;if(t.style.width="100%",t.style.height="100%",r.onResize){let s=(o,a)=>{o===0||a===0||r.onResize(o,a)};this.resizeCallbacks.set(t,s)}this.sharedResizeObserver||(this.debug&&console.log("[CanvasService] Creating shared ResizeObserver for all canvases"),this.sharedResizeObserver=new ResizeObserver(s=>{this.debug&&console.log("[CanvasService] Shared ResizeObserver callback fired",s.map(o=>{let a=o.target,l=a.parentElement;return{tag:a.tagName,id:a.id,class:a.className,parent:l?{tag:l.tagName,class:l.className,id:l.id}:null,contentRect:o.contentRect,style:{width:a.style.width,height:a.style.height},backingStore:{width:a.width,height:a.height}}}));for(let o of s){let a=o.target;if(this.debug){let c=a.parentElement;console.log("[CanvasService] Shared ResizeObserver entry (detailed)",{tag:a.tagName,id:a.id,class:a.className,parent:c?{tag:c.tagName,class:c.className,id:c.id}:null,contentRect:o.contentRect,style:{width:a.style.width,height:a.style.height},backingStore:{width:a.width,height:a.height}})}this.setHighDPISize(a,o.contentRect);let l=this.resizeCallbacks.get(a);l&&l(Math.round(o.contentRect.width),Math.round(o.contentRect.height))}})),this.sharedResizeObserver.observe(t),this.debug&&console.log("[CanvasService] Started observing canvas (shared observer)",{tag:t.tagName,id:t.id,class:t.className,selector:t.getAttribute("ng-reflect-ng-if")||"",parent:t.parentElement?{tag:t.parentElement.tagName,class:t.parentElement.className,id:t.parentElement.id}:null}),this.observedCanvases.set(t,r||{}),this.setHighDPISize(t,t.getBoundingClientRect());let n=this.resizeCallbacks.get(t);if(n){let s=t.getBoundingClientRect();n(Math.round(s.width),Math.round(s.height))}}unregisterCanvas(t){if(!t||!this.observedCanvases.has(t))return;this.sharedResizeObserver&&(this.sharedResizeObserver.unobserve(t),this.observedCanvases.size<=1&&(this.sharedResizeObserver.disconnect(),this.sharedResizeObserver=null,this.debug&&console.log("[CanvasService] Shared ResizeObserver disconnected (no canvases left)"))),this.resizeCallbacks.delete(t),this.observedCanvases.get(t)?.autoRelease&&this.releaseCanvas(t,{clear:!0,removeFromDom:!0}),this.observedCanvases.delete(t),this.observedCanvases.size===0&&this.cleanupDPRListener()}onDPRChange=()=>{let t=window.devicePixelRatio||1;t!==this.scaleFactor&&(this.scaleFactor=t,this.observedCanvases.forEach((r,n)=>{try{this.setHighDPISize(n,n.getBoundingClientRect())}catch(s){console.warn("[CanvasService] onDPRChange failed for canvas",s)}}),this.cleanupDPRListener(),this.setupDPRListener())};setupDPRListener(){try{this.cleanupDPRListener();let t=`(resolution: ${window.devicePixelRatio||1}dppx)`;this.dprMediaQuery=window.matchMedia(t),this.dprMediaQuery&&((n,s)=>{"addEventListener"in n?n.addEventListener("change",s):"addListener"in n&&n.addListener(s)})(this.dprMediaQuery,this.onDPRChange)}catch(t){console.warn("[CanvasService] setupDPRListener failed",t)}}cleanupDPRListener(){if(this.dprMediaQuery){try{((r,n)=>{"removeEventListener"in r?r.removeEventListener("change",n):"removeListener"in r&&r.removeListener(n)})(this.dprMediaQuery,this.onDPRChange)}catch{}this.dprMediaQuery=null}}setHighDPISize(t,r){let n=Math.floor(r.width),s=Math.floor(r.height);t.width=Math.round(n*this.scaleFactor),t.height=Math.round(s*this.scaleFactor),t.style.width=`${n}px`,t.style.height=`${s}px`;try{let o=t.getContext("2d");o&&(o.setTransform(this.scaleFactor,0,0,this.scaleFactor,0,0),o.clearRect(0,0,t.width,t.height))}catch(o){console.warn("[CanvasService] setHighDPISize: failed to set context transform",o)}}drawTitle(t,r,n,s="normal",o,a,l=.1){if(!t)return;let c=()=>{let u=!1;try{let f=t;if(typeof f.getTransform=="function"){let d=f.getTransform(),h=d&&d.a?d.a:1;Math.abs(h-this.scaleFactor)>1e-6&&(t.save(),t.setTransform(this.scaleFactor,0,0,this.scaleFactor,0,0),u=!0)}else try{t.save(),t.setTransform(this.scaleFactor,0,0,this.scaleFactor,0,0),u=!0}catch{}this.drawTitleInternal(t,r,n,s,o,a,l),u&&t.restore()}catch(f){console.warn("[CanvasService] drawTitle failed",f);try{this.drawTitleInternal(t,r,n,s,o,a,l)}catch{}}};document.fonts.status==="loaded"?this.fontsReadyPromise.then(()=>requestAnimationFrame(c)).catch(()=>requestAnimationFrame(c)):this.fontsReadyPromise.then(()=>requestAnimationFrame(c)).catch(u=>{console.warn(`[CanvasService] Font readiness failed: ${u}`),requestAnimationFrame(c)})}drawTitleInternal(t,r,n,s="normal",o,a,l){if(!t)return;let c=o-2*this.EDGE_BUFFER,u=Math.floor(a*l),f=this.calculateOptimalFontSize(t,r,c,u,s);t.clearRect(0,0,o,a),t.font=`${s} ${f}px ${this.DEFAULT_FONT}`,t.fillStyle=n,t.textAlign="left",t.textBaseline="top",t.fillText(r,this.EDGE_BUFFER,this.EDGE_BUFFER,c)}clearCanvas(t,r,n){t.clearRect(0,0,r,n)}drawText(t,r,n=this.EDGE_BUFFER,s=this.EDGE_BUFFER,o,a,l="normal",c="#000",u="center",f="middle"){if(!t)return;let d=()=>{try{t.save(),t.setTransform(this.scaleFactor,0,0,this.scaleFactor,0,0),this.drawTextInternal(t,r,n,s,o,a,l,c,u,f)}finally{try{t.restore()}catch{}}};document.fonts.status==="loaded"?d():this.fontsReadyPromise.then(d).catch(h=>{console.warn(`[Canvas Service] Font readiness failed: ${h}`),d()})}drawTextInternal(t,r,n=this.EDGE_BUFFER,s=this.EDGE_BUFFER,o,a,l="normal",c="#000",u="center",f="middle"){let d=this.calculateOptimalFontSize(t,r,o,a,l);t.font=`${l} ${d}px ${this.DEFAULT_FONT}`,t.fillStyle=c,t.textAlign=u,t.textBaseline=f,t.fillText(r,n,s,o)}calculateOptimalFontSize(t,r,n,s,o="normal"){let a=1,l=s,c=l;for(;a<=l;)c=Math.floor((a+l)/2),t.font=`${o} ${c}px ${this.DEFAULT_FONT}`,t.measureText(r).width>n?l=c-1:a=c+1;return l}createTitleBitmap(t,r,n,s,o,a=.1){let l=document.createElement("canvas");l.width=Math.round(s*this.scaleFactor),l.height=Math.round(o*this.scaleFactor),l.style.width=`${s}px`,l.style.height=`${o}px`;let c=l.getContext("2d");return c&&(c.setTransform(this.scaleFactor,0,0,this.scaleFactor,0,0),this.drawTitleInternal(c,t,r,n,s,o,a),document.fonts.status!=="loaded"&&document.fonts.ready.then(()=>{try{c.setTransform(this.scaleFactor,0,0,this.scaleFactor,0,0),this.drawTitleInternal(c,t,r,n,s,o,a)}catch{}}).catch(()=>{})),l}renderStaticToBitmap(t,r,n,s){let o=document.createElement("canvas");o.width=r*this.scaleFactor,o.height=n*this.scaleFactor;let a=o.getContext("2d");return a&&(a.setTransform(this.scaleFactor,0,0,this.scaleFactor,0,0),s(a)),o}drawRectangle(t,r,n,s,o,a){t.fillStyle=a,t.fillRect(r,n,s,o)}releaseCanvas(t,r={removeFromDom:!0,clear:!0}){if(!t)return;let{removeFromDom:n=!0,clear:s=!0}=r;try{let o=t.getContext("2d");s&&o&&o.clearRect(0,0,t.width,t.height),t.width=0,t.height=0,n&&t.parentNode&&t.parentNode.removeChild(t)}catch(o){console.warn("[CanvasService] releaseCanvas failed",o)}}releaseCanvases(t,r){t.forEach(n=>this.releaseCanvas(n,r))}static \u0275fac=function(r){return new(r||i)};static \u0275prov=zs({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function ii(i){return i+.5|0}var te=(i,e,t)=>Math.max(Math.min(i,t),e);function ti(i){return te(ii(i*2.55),0,255)}function ee(i){return te(ii(i*255),0,255)}function Yt(i){return te(ii(i/2.55)/100,0,1)}function Ns(i){return te(ii(i*100),0,100)}var Dt={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},en=[..."0123456789ABCDEF"],Jl=i=>en[i&15],tc=i=>en[(i&240)>>4]+en[i&15],Ii=i=>(i&240)>>4===(i&15),ec=i=>Ii(i.r)&&Ii(i.g)&&Ii(i.b)&&Ii(i.a);function ic(i){var e=i.length,t;return i[0]==="#"&&(e===4||e===5?t={r:255&Dt[i[1]]*17,g:255&Dt[i[2]]*17,b:255&Dt[i[3]]*17,a:e===5?Dt[i[4]]*17:255}:(e===7||e===9)&&(t={r:Dt[i[1]]<<4|Dt[i[2]],g:Dt[i[3]]<<4|Dt[i[4]],b:Dt[i[5]]<<4|Dt[i[6]],a:e===9?Dt[i[7]]<<4|Dt[i[8]]:255})),t}var rc=(i,e)=>i<255?e(i):"";function nc(i){var e=ec(i)?Jl:tc;return i?"#"+e(i.r)+e(i.g)+e(i.b)+rc(i.a,e):void 0}var sc=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ys(i,e,t){let r=e*Math.min(t,1-t),n=(s,o=(s+i/30)%12)=>t-r*Math.max(Math.min(o-3,9-o,1),-1);return[n(0),n(8),n(4)]}function oc(i,e,t){let r=(n,s=(n+i/60)%6)=>t-t*e*Math.max(Math.min(s,4-s,1),0);return[r(5),r(3),r(1)]}function ac(i,e,t){let r=Ys(i,1,.5),n;for(e+t>1&&(n=1/(e+t),e*=n,t*=n),n=0;n<3;n++)r[n]*=1-e-t,r[n]+=e;return r}function lc(i,e,t,r,n){return i===n?(e-t)/r+(e<t?6:0):e===n?(t-i)/r+2:(i-e)/r+4}function rn(i){let t=i.r/255,r=i.g/255,n=i.b/255,s=Math.max(t,r,n),o=Math.min(t,r,n),a=(s+o)/2,l,c,u;return s!==o&&(u=s-o,c=a>.5?u/(2-s-o):u/(s+o),l=lc(t,r,n,u,s),l=l*60+.5),[l|0,c||0,a]}function nn(i,e,t,r){return(Array.isArray(e)?i(e[0],e[1],e[2]):i(e,t,r)).map(ee)}function sn(i,e,t){return nn(Ys,i,e,t)}function cc(i,e,t){return nn(ac,i,e,t)}function uc(i,e,t){return nn(oc,i,e,t)}function Us(i){return(i%360+360)%360}function fc(i){let e=sc.exec(i),t=255,r;if(!e)return;e[5]!==r&&(t=e[6]?ti(+e[5]):ee(+e[5]));let n=Us(+e[2]),s=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?r=cc(n,s,o):e[1]==="hsv"?r=uc(n,s,o):r=sn(n,s,o),{r:r[0],g:r[1],b:r[2],a:t}}function dc(i,e){var t=rn(i);t[0]=Us(t[0]+e),t=sn(t),i.r=t[0],i.g=t[1],i.b=t[2]}function hc(i){if(!i)return;let e=rn(i),t=e[0],r=Ns(e[1]),n=Ns(e[2]);return i.a<255?`hsla(${t}, ${r}%, ${n}%, ${Yt(i.a)})`:`hsl(${t}, ${r}%, ${n}%)`}var Ws={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"},Hs={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 mc(){let i={},e=Object.keys(Hs),t=Object.keys(Ws),r,n,s,o,a;for(r=0;r<e.length;r++){for(o=a=e[r],n=0;n<t.length;n++)s=t[n],a=a.replace(s,Ws[s]);s=parseInt(Hs[o],16),i[a]=[s>>16&255,s>>8&255,s&255]}return i}var Li;function pc(i){Li||(Li=mc(),Li.transparent=[0,0,0,0]);let e=Li[i.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}var gc=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function bc(i){let e=gc.exec(i),t=255,r,n,s;if(e){if(e[7]!==r){let o=+e[7];t=e[8]?ti(o):te(o*255,0,255)}return r=+e[1],n=+e[3],s=+e[5],r=255&(e[2]?ti(r):te(r,0,255)),n=255&(e[4]?ti(n):te(n,0,255)),s=255&(e[6]?ti(s):te(s,0,255)),{r,g:n,b:s,a:t}}}function xc(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${Yt(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}var tn=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,Se=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function vc(i,e,t){let r=Se(Yt(i.r)),n=Se(Yt(i.g)),s=Se(Yt(i.b));return{r:ee(tn(r+t*(Se(Yt(e.r))-r))),g:ee(tn(n+t*(Se(Yt(e.g))-n))),b:ee(tn(s+t*(Se(Yt(e.b))-s))),a:i.a+t*(e.a-i.a)}}function Ei(i,e,t){if(i){let r=rn(i);r[e]=Math.max(0,Math.min(r[e]+r[e]*t,e===0?360:1)),r=sn(r),i.r=r[0],i.g=r[1],i.b=r[2]}}function Vs(i,e){return i&&Object.assign(e||{},i)}function Bs(i){var e={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(e={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(e.a=ee(i[3]))):(e=Vs(i,{r:0,g:0,b:0,a:1}),e.a=ee(e.a)),e}function yc(i){return i.charAt(0)==="r"?bc(i):fc(i)}var ei=class i{constructor(e){if(e instanceof i)return e;let t=typeof e,r;t==="object"?r=Bs(e):t==="string"&&(r=ic(e)||pc(e)||yc(e)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var e=Vs(this._rgb);return e&&(e.a=Yt(e.a)),e}set rgb(e){this._rgb=Bs(e)}rgbString(){return this._valid?xc(this._rgb):void 0}hexString(){return this._valid?nc(this._rgb):void 0}hslString(){return this._valid?hc(this._rgb):void 0}mix(e,t){if(e){let r=this.rgb,n=e.rgb,s,o=t===s?.5:t,a=2*o-1,l=r.a-n.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;s=1-c,r.r=255&c*r.r+s*n.r+.5,r.g=255&c*r.g+s*n.g+.5,r.b=255&c*r.b+s*n.b+.5,r.a=o*r.a+(1-o)*n.a,this.rgb=r}return this}interpolate(e,t){return e&&(this._rgb=vc(this._rgb,e._rgb,t)),this}clone(){return new i(this.rgb)}alpha(e){return this._rgb.a=ee(e),this}clearer(e){let t=this._rgb;return t.a*=1-e,this}greyscale(){let e=this._rgb,t=ii(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=t,this}opaquer(e){let t=this._rgb;return t.a*=1+e,this}negate(){let e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Ei(this._rgb,2,e),this}darken(e){return Ei(this._rgb,2,-e),this}saturate(e){return Ei(this._rgb,1,e),this}desaturate(e){return Ei(this._rgb,1,-e),this}rotate(e){return dc(this._rgb,e),this}};function Ft(){}var eo=(()=>{let i=0;return()=>i++})();function U(i){return i==null}function tt(i){if(Array.isArray&&Array.isArray(i))return!0;let e=Object.prototype.toString.call(i);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function V(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function nt(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function bt(i,e){return nt(i)?i:e}function W(i,e){return typeof i>"u"?e:i}var io=(i,e)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:+i/e,cn=(i,e)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*e:+i;function Z(i,e,t){if(i&&typeof i.call=="function")return i.apply(t,e)}function Q(i,e,t,r){let n,s,o;if(tt(i))if(s=i.length,r)for(n=s-1;n>=0;n--)e.call(t,i[n],n);else for(n=0;n<s;n++)e.call(t,i[n],n);else if(V(i))for(o=Object.keys(i),s=o.length,n=0;n<s;n++)e.call(t,i[o[n]],o[n])}function si(i,e){let t,r,n,s;if(!i||!e||i.length!==e.length)return!1;for(t=0,r=i.length;t<r;++t)if(n=i[t],s=e[t],n.datasetIndex!==s.datasetIndex||n.index!==s.index)return!1;return!0}function Wi(i){if(tt(i))return i.map(Wi);if(V(i)){let e=Object.create(null),t=Object.keys(i),r=t.length,n=0;for(;n<r;++n)e[t[n]]=Wi(i[t[n]]);return e}return i}function ro(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function _c(i,e,t,r){if(!ro(i))return;let n=e[i],s=t[i];V(n)&&V(s)?Ie(n,s,r):e[i]=Wi(s)}function Ie(i,e,t){let r=tt(e)?e:[e],n=r.length;if(!V(i))return i;t=t||{};let s=t.merger||_c,o;for(let a=0;a<n;++a){if(o=r[a],!V(o))continue;let l=Object.keys(o);for(let c=0,u=l.length;c<u;++c)s(l[c],i,o,t)}return i}function Ee(i,e){return Ie(i,e,{merger:wc})}function wc(i,e,t){if(!ro(i))return;let r=e[i],n=t[i];V(r)&&V(n)?Ee(r,n):Object.prototype.hasOwnProperty.call(e,i)||(e[i]=Wi(n))}var js={"":i=>i,x:i=>i.x,y:i=>i.y};function Mc(i){let e=i.split("."),t=[],r="";for(let n of e)r+=n,r.endsWith("\\")?r=r.slice(0,-1)+".":(t.push(r),r="");return t}function kc(i){let e=Mc(i);return t=>{for(let r of e){if(r==="")break;t=t&&t[r]}return t}}function jt(i,e){return(js[e]||(js[e]=kc(e)))(i)}function Ui(i){return i.charAt(0).toUpperCase()+i.slice(1)}var Re=i=>typeof i<"u",Ut=i=>typeof i=="function",un=(i,e)=>{if(i.size!==e.size)return!1;for(let t of i)if(!e.has(t))return!1;return!0};function no(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}var $=Math.PI,et=2*$,Dc=et+$,Hi=Number.POSITIVE_INFINITY,Tc=$/180,st=$/2,he=$/4,qs=$*2/3,Vt=Math.log10,At=Math.sign;function Fe(i,e,t){return Math.abs(i-e)<t}function fn(i){let e=Math.round(i);i=Fe(i,e,i/1e3)?e:i;let t=Math.pow(10,Math.floor(Vt(i))),r=i/t;return(r<=1?1:r<=2?2:r<=5?5:10)*t}function so(i){let e=[],t=Math.sqrt(i),r;for(r=1;r<t;r++)i%r===0&&(e.push(r),e.push(i/r));return t===(t|0)&&e.push(t),e.sort((n,s)=>n-s).pop(),e}function Cc(i){return typeof i=="symbol"||typeof i=="object"&&i!==null&&!(Symbol.toPrimitive in i||"toString"in i||"valueOf"in i)}function ge(i){return!Cc(i)&&!isNaN(parseFloat(i))&&isFinite(i)}function oo(i,e){let t=Math.round(i);return t-e<=i&&t+e>=i}function dn(i,e,t){let r,n,s;for(r=0,n=i.length;r<n;r++)s=i[r][t],isNaN(s)||(e.min=Math.min(e.min,s),e.max=Math.max(e.max,s))}function Tt(i){return i*($/180)}function Vi(i){return i*(180/$)}function hn(i){if(!nt(i))return;let e=1,t=0;for(;Math.round(i*e)/e!==i;)e*=10,t++;return t}function mn(i,e){let t=e.x-i.x,r=e.y-i.y,n=Math.sqrt(t*t+r*r),s=Math.atan2(r,t);return s<-.5*$&&(s+=et),{angle:s,distance:n}}function Bi(i,e){return Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2))}function Pc(i,e){return(i-e+Dc)%et-$}function ft(i){return(i%et+et)%et}function ze(i,e,t,r){let n=ft(i),s=ft(e),o=ft(t),a=ft(s-n),l=ft(o-n),c=ft(n-s),u=ft(n-o);return n===s||n===o||r&&s===o||a>l&&c<u}function lt(i,e,t){return Math.max(e,Math.min(t,i))}function ao(i){return lt(i,-32768,32767)}function zt(i,e,t,r=1e-6){return i>=Math.min(e,t)-r&&i<=Math.max(e,t)+r}function ji(i,e,t){t=t||(o=>i[o]<e);let r=i.length-1,n=0,s;for(;r-n>1;)s=n+r>>1,t(s)?n=s:r=s;return{lo:n,hi:r}}var Et=(i,e,t,r)=>ji(i,t,r?n=>{let s=i[n][e];return s<t||s===t&&i[n+1][e]===t}:n=>i[n][e]<t),lo=(i,e,t)=>ji(i,t,r=>i[r][e]>=t);function co(i,e,t){let r=0,n=i.length;for(;r<n&&i[r]<e;)r++;for(;n>r&&i[n-1]>t;)n--;return r>0||n<i.length?i.slice(r,n):i}var uo=["push","pop","shift","splice","unshift"];function fo(i,e){if(i._chartjs){i._chartjs.listeners.push(e);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),uo.forEach(t=>{let r="_onData"+Ui(t),n=i[t];Object.defineProperty(i,t,{configurable:!0,enumerable:!1,value(...s){let o=n.apply(this,s);return i._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...s)}),o}})})}function pn(i,e){let t=i._chartjs;if(!t)return;let r=t.listeners,n=r.indexOf(e);n!==-1&&r.splice(n,1),!(r.length>0)&&(uo.forEach(s=>{delete i[s]}),delete i._chartjs)}function gn(i){let e=new Set(i);return e.size===i.length?i:Array.from(e)}var bn=(function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame})();function xn(i,e){let t=[],r=!1;return function(...n){t=n,r||(r=!0,bn.call(window,()=>{r=!1,i.apply(e,t)}))}}function ho(i,e){let t;return function(...r){return e?(clearTimeout(t),t=setTimeout(i,e,r)):i.apply(this,r),e}}var qi=i=>i==="start"?"left":i==="end"?"right":"center",dt=(i,e,t)=>i==="start"?e:i==="end"?t:(e+t)/2,mo=(i,e,t,r)=>i===(r?"left":"right")?t:i==="center"?(e+t)/2:e;function vn(i,e,t){let r=e.length,n=0,s=r;if(i._sorted){let{iScale:o,vScale:a,_parsed:l}=i,c=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null,u=o.axis,{min:f,max:d,minDefined:h,maxDefined:m}=o.getUserBounds();if(h){if(n=Math.min(Et(l,u,f).lo,t?r:Et(e,u,o.getPixelForValue(f)).lo),c){let p=l.slice(0,n+1).reverse().findIndex(g=>!U(g[a.axis]));n-=Math.max(0,p)}n=lt(n,0,r-1)}if(m){let p=Math.max(Et(l,o.axis,d,!0).hi+1,t?0:Et(e,u,o.getPixelForValue(d),!0).hi+1);if(c){let g=l.slice(p-1).findIndex(b=>!U(b[a.axis]));p+=Math.max(0,g)}s=lt(p,n,r)-n}else s=r-n}return{start:n,count:s}}function yn(i){let{xScale:e,yScale:t,_scaleRanges:r}=i,n={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!r)return i._scaleRanges=n,!0;let s=r.xmin!==e.min||r.xmax!==e.max||r.ymin!==t.min||r.ymax!==t.max;return Object.assign(r,n),s}var Ri=i=>i===0||i===1,$s=(i,e,t)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-e)*et/t)),Xs=(i,e,t)=>Math.pow(2,-10*i)*Math.sin((i-e)*et/t)+1,Ae={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*st)+1,easeOutSine:i=>Math.sin(i*st),easeInOutSine:i=>-.5*(Math.cos($*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>Ri(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=>Ri(i)?i:$s(i,.075,.3),easeOutElastic:i=>Ri(i)?i:Xs(i,.075,.3),easeInOutElastic(i){return Ri(i)?i:i<.5?.5*$s(i*2,.1125,.45):.5+.5*Xs(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 e=1.70158;return(i/=.5)<1?.5*(i*i*(((e*=1.525)+1)*i-e)):.5*((i-=2)*i*(((e*=1.525)+1)*i+e)+2)},easeInBounce:i=>1-Ae.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?Ae.easeInBounce(i*2)*.5:Ae.easeOutBounce(i*2-1)*.5+.5};function _n(i){if(i&&typeof i=="object"){let e=i.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function wn(i){return _n(i)?i:new ei(i)}function on(i){return _n(i)?i:new ei(i).saturate(.5).darken(.1).hexString()}var Oc=["x","y","borderWidth","radius","tension"],Sc=["color","borderColor","backgroundColor"];function Ac(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:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),i.set("animations",{colors:{type:"color",properties:Sc},numbers:{type:"number",properties:Oc}}),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:e=>e|0}}}})}function Ic(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var Qs=new Map;function Lc(i,e){e=e||{};let t=i+JSON.stringify(e),r=Qs.get(t);return r||(r=new Intl.NumberFormat(i,e),Qs.set(t,r)),r}function Ne(i,e,t){return Lc(e,t).format(i)}var po={values(i){return tt(i)?i:""+i},numeric(i,e,t){if(i===0)return"0";let r=this.chart.options.locale,n,s=i;if(t.length>1){let c=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(c<1e-4||c>1e15)&&(n="scientific"),s=Ec(i,t)}let o=Vt(Math.abs(s)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Ne(i,r,l)},logarithmic(i,e,t){if(i===0)return"0";let r=t[e].significand||i/Math.pow(10,Math.floor(Vt(i)));return[1,2,3,5,10,15].includes(r)||e>.8*t.length?po.numeric.call(this,i,e,t):""}};function Ec(i,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&i!==Math.floor(i)&&(t=i-Math.floor(i)),t}var oi={formatters:po};function Rc(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:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:oi.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:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}var re=Object.create(null),$i=Object.create(null);function ri(i,e){if(!e)return i;let t=e.split(".");for(let r=0,n=t.length;r<n;++r){let s=t[r];i=i[s]||(i[s]=Object.create(null))}return i}function an(i,e,t){return typeof e=="string"?Ie(ri(i,e),t):Ie(ri(i,""),e)}var ln=class{constructor(e,t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,n)=>on(n.backgroundColor),this.hoverBorderColor=(r,n)=>on(n.borderColor),this.hoverColor=(r,n)=>on(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(e),this.apply(t)}set(e,t){return an(this,e,t)}get(e){return ri(this,e)}describe(e,t){return an($i,e,t)}override(e,t){return an(re,e,t)}route(e,t,r,n){let s=ri(this,e),o=ri(this,r),a="_"+t;Object.defineProperties(s,{[a]:{value:s[t],writable:!0},[t]:{enumerable:!0,get(){let l=this[a],c=o[n];return V(l)?Object.assign({},c,l):W(l,c)},set(l){this[a]=l}}})}apply(e){e.forEach(t=>t(this))}},it=new ln({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Ac,Ic,Rc]);function Fc(i){return!i||U(i.size)||U(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function ni(i,e,t,r,n){let s=e[n];return s||(s=e[n]=i.measureText(n).width,t.push(n)),s>r&&(r=s),r}function go(i,e,t,r){r=r||{};let n=r.data=r.data||{},s=r.garbageCollect=r.garbageCollect||[];r.font!==e&&(n=r.data={},s=r.garbageCollect=[],r.font=e),i.save(),i.font=e;let o=0,a=t.length,l,c,u,f,d;for(l=0;l<a;l++)if(f=t[l],f!=null&&!tt(f))o=ni(i,n,s,o,f);else if(tt(f))for(c=0,u=f.length;c<u;c++)d=f[c],d!=null&&!tt(d)&&(o=ni(i,n,s,o,d));i.restore();let h=s.length/2;if(h>t.length){for(l=0;l<h;l++)delete n[s[l]];s.splice(0,h)}return o}function ne(i,e,t){let r=i.currentDevicePixelRatio,n=t!==0?Math.max(t/2,.5):0;return Math.round((e-n)*r)/r+n}function Mn(i,e){!e&&!i||(e=e||i.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,i.width,i.height),e.restore())}function Xi(i,e,t,r){kn(i,e,t,r,null)}function kn(i,e,t,r,n){let s,o,a,l,c,u,f,d,h=e.pointStyle,m=e.rotation,p=e.radius,g=(m||0)*Tc;if(h&&typeof h=="object"&&(s=h.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){i.save(),i.translate(t,r),i.rotate(g),i.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),i.restore();return}if(!(isNaN(p)||p<=0)){switch(i.beginPath(),h){default:n?i.ellipse(t,r,n/2,p,0,0,et):i.arc(t,r,p,0,et),i.closePath();break;case"triangle":u=n?n/2:p,i.moveTo(t+Math.sin(g)*u,r-Math.cos(g)*p),g+=qs,i.lineTo(t+Math.sin(g)*u,r-Math.cos(g)*p),g+=qs,i.lineTo(t+Math.sin(g)*u,r-Math.cos(g)*p),i.closePath();break;case"rectRounded":c=p*.516,l=p-c,o=Math.cos(g+he)*l,f=Math.cos(g+he)*(n?n/2-c:l),a=Math.sin(g+he)*l,d=Math.sin(g+he)*(n?n/2-c:l),i.arc(t-f,r-a,c,g-$,g-st),i.arc(t+d,r-o,c,g-st,g),i.arc(t+f,r+a,c,g,g+st),i.arc(t-d,r+o,c,g+st,g+$),i.closePath();break;case"rect":if(!m){l=Math.SQRT1_2*p,u=n?n/2:l,i.rect(t-u,r-l,2*u,2*l);break}g+=he;case"rectRot":f=Math.cos(g)*(n?n/2:p),o=Math.cos(g)*p,a=Math.sin(g)*p,d=Math.sin(g)*(n?n/2:p),i.moveTo(t-f,r-a),i.lineTo(t+d,r-o),i.lineTo(t+f,r+a),i.lineTo(t-d,r+o),i.closePath();break;case"crossRot":g+=he;case"cross":f=Math.cos(g)*(n?n/2:p),o=Math.cos(g)*p,a=Math.sin(g)*p,d=Math.sin(g)*(n?n/2:p),i.moveTo(t-f,r-a),i.lineTo(t+f,r+a),i.moveTo(t+d,r-o),i.lineTo(t-d,r+o);break;case"star":f=Math.cos(g)*(n?n/2:p),o=Math.cos(g)*p,a=Math.sin(g)*p,d=Math.sin(g)*(n?n/2:p),i.moveTo(t-f,r-a),i.lineTo(t+f,r+a),i.moveTo(t+d,r-o),i.lineTo(t-d,r+o),g+=he,f=Math.cos(g)*(n?n/2:p),o=Math.cos(g)*p,a=Math.sin(g)*p,d=Math.sin(g)*(n?n/2:p),i.moveTo(t-f,r-a),i.lineTo(t+f,r+a),i.moveTo(t+d,r-o),i.lineTo(t-d,r+o);break;case"line":o=n?n/2:Math.cos(g)*p,a=Math.sin(g)*p,i.moveTo(t-o,r-a),i.lineTo(t+o,r+a);break;case"dash":i.moveTo(t,r),i.lineTo(t+Math.cos(g)*(n?n/2:p),r+Math.sin(g)*p);break;case!1:i.closePath();break}i.fill(),e.borderWidth>0&&i.stroke()}}function Rt(i,e,t){return t=t||.5,!e||i&&i.x>e.left-t&&i.x<e.right+t&&i.y>e.top-t&&i.y<e.bottom+t}function ai(i,e){i.save(),i.beginPath(),i.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),i.clip()}function li(i){i.restore()}function bo(i,e,t,r,n){if(!e)return i.lineTo(t.x,t.y);if(n==="middle"){let s=(e.x+t.x)/2;i.lineTo(s,e.y),i.lineTo(s,t.y)}else n==="after"!=!!r?i.lineTo(e.x,t.y):i.lineTo(t.x,e.y);i.lineTo(t.x,t.y)}function xo(i,e,t,r){if(!e)return i.lineTo(t.x,t.y);i.bezierCurveTo(r?e.cp1x:e.cp2x,r?e.cp1y:e.cp2y,r?t.cp2x:t.cp1x,r?t.cp2y:t.cp1y,t.x,t.y)}function zc(i,e){e.translation&&i.translate(e.translation[0],e.translation[1]),U(e.rotation)||i.rotate(e.rotation),e.color&&(i.fillStyle=e.color),e.textAlign&&(i.textAlign=e.textAlign),e.textBaseline&&(i.textBaseline=e.textBaseline)}function Nc(i,e,t,r,n){if(n.strikethrough||n.underline){let s=i.measureText(r),o=e-s.actualBoundingBoxLeft,a=e+s.actualBoundingBoxRight,l=t-s.actualBoundingBoxAscent,c=t+s.actualBoundingBoxDescent,u=n.strikethrough?(l+c)/2:c;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=n.decorationWidth||2,i.moveTo(o,u),i.lineTo(a,u),i.stroke()}}function Wc(i,e){let t=i.fillStyle;i.fillStyle=e.color,i.fillRect(e.left,e.top,e.width,e.height),i.fillStyle=t}function se(i,e,t,r,n,s={}){let o=tt(e)?e:[e],a=s.strokeWidth>0&&s.strokeColor!=="",l,c;for(i.save(),i.font=n.string,zc(i,s),l=0;l<o.length;++l)c=o[l],s.backdrop&&Wc(i,s.backdrop),a&&(s.strokeColor&&(i.strokeStyle=s.strokeColor),U(s.strokeWidth)||(i.lineWidth=s.strokeWidth),i.strokeText(c,t,r,s.maxWidth)),i.fillText(c,t,r,s.maxWidth),Nc(i,t,r,c,s),r+=Number(n.lineHeight);i.restore()}function We(i,e){let{x:t,y:r,w:n,h:s,radius:o}=e;i.arc(t+o.topLeft,r+o.topLeft,o.topLeft,1.5*$,$,!0),i.lineTo(t,r+s-o.bottomLeft),i.arc(t+o.bottomLeft,r+s-o.bottomLeft,o.bottomLeft,$,st,!0),i.lineTo(t+n-o.bottomRight,r+s),i.arc(t+n-o.bottomRight,r+s-o.bottomRight,o.bottomRight,st,0,!0),i.lineTo(t+n,r+o.topRight),i.arc(t+n-o.topRight,r+o.topRight,o.topRight,0,-st,!0),i.lineTo(t+o.topLeft,r)}var Hc=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Bc=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Yc(i,e){let t=(""+i).match(Hc);if(!t||t[1]==="normal")return e*1.2;switch(i=+t[2],t[3]){case"px":return i;case"%":i/=100;break}return e*i}var Uc=i=>+i||0;function Qi(i,e){let t={},r=V(e),n=r?Object.keys(e):e,s=V(i)?r?o=>W(i[o],i[e[o]]):o=>i[o]:()=>i;for(let o of n)t[o]=Uc(s(o));return t}function Dn(i){return Qi(i,{top:"y",right:"x",bottom:"y",left:"x"})}function oe(i){return Qi(i,["topLeft","topRight","bottomLeft","bottomRight"])}function ht(i){let e=Dn(i);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function ot(i,e){i=i||{},e=e||it.font;let t=W(i.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let r=W(i.style,e.style);r&&!(""+r).match(Bc)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);let n={family:W(i.family,e.family),lineHeight:Yc(W(i.lineHeight,e.lineHeight),t),size:t,style:r,weight:W(i.weight,e.weight),string:""};return n.string=Fc(n),n}function He(i,e,t,r){let n=!0,s,o,a;for(s=0,o=i.length;s<o;++s)if(a=i[s],a!==void 0&&(e!==void 0&&typeof a=="function"&&(a=a(e),n=!1),t!==void 0&&tt(a)&&(a=a[t%a.length],n=!1),a!==void 0))return r&&!n&&(r.cacheable=!1),a}function vo(i,e,t){let{min:r,max:n}=i,s=cn(e,(n-r)/2),o=(a,l)=>t&&a===0?0:a+l;return{min:o(r,-Math.abs(s)),max:o(n,s)}}function qt(i,e){return Object.assign(Object.create(i),e)}function Gi(i,e=[""],t,r,n=()=>i[0]){let s=t||i;typeof r>"u"&&(r=wo("_fallback",i));let o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:s,_fallback:r,_getTarget:n,override:a=>Gi([a,...i],e,s,r)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete i[0][l],!0},get(a,l){return yo(a,l,()=>Kc(l,e,i,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(a,l){return Ks(a).includes(l)},ownKeys(a){return Ks(a)},set(a,l,c){let u=a._storage||(a._storage=n());return a[l]=u[l]=c,delete a._keys,!0}})}function pe(i,e,t,r){let n={_cacheable:!1,_proxy:i,_context:e,_subProxy:t,_stack:new Set,_descriptors:Tn(i,r),setContext:s=>pe(i,s,t,r),override:s=>pe(i.override(s),e,t,r)};return new Proxy(n,{deleteProperty(s,o){return delete s[o],delete i[o],!0},get(s,o,a){return yo(s,o,()=>jc(s,o,a))},getOwnPropertyDescriptor(s,o){return s._descriptors.allKeys?Reflect.has(i,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,o)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(s,o){return Reflect.has(i,o)},ownKeys(){return Reflect.ownKeys(i)},set(s,o,a){return i[o]=a,delete s[o],!0}})}function Tn(i,e={scriptable:!0,indexable:!0}){let{_scriptable:t=e.scriptable,_indexable:r=e.indexable,_allKeys:n=e.allKeys}=i;return{allKeys:n,scriptable:t,indexable:r,isScriptable:Ut(t)?t:()=>t,isIndexable:Ut(r)?r:()=>r}}var Vc=(i,e)=>i?i+Ui(e):e,Cn=(i,e)=>V(e)&&i!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function yo(i,e,t){if(Object.prototype.hasOwnProperty.call(i,e)||e==="constructor")return i[e];let r=t();return i[e]=r,r}function jc(i,e,t){let{_proxy:r,_context:n,_subProxy:s,_descriptors:o}=i,a=r[e];return Ut(a)&&o.isScriptable(e)&&(a=qc(e,a,i,t)),tt(a)&&a.length&&(a=$c(e,a,i,o.isIndexable)),Cn(e,a)&&(a=pe(a,n,s&&s[e],o)),a}function qc(i,e,t,r){let{_proxy:n,_context:s,_subProxy:o,_stack:a}=t;if(a.has(i))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+i);a.add(i);let l=e(s,o||r);return a.delete(i),Cn(i,l)&&(l=Pn(n._scopes,n,i,l)),l}function $c(i,e,t,r){let{_proxy:n,_context:s,_subProxy:o,_descriptors:a}=t;if(typeof s.index<"u"&&r(i))return e[s.index%e.length];if(V(e[0])){let l=e,c=n._scopes.filter(u=>u!==l);e=[];for(let u of l){let f=Pn(c,n,i,u);e.push(pe(f,s,o&&o[i],a))}}return e}function _o(i,e,t){return Ut(i)?i(e,t):i}var Xc=(i,e)=>i===!0?e:typeof i=="string"?jt(e,i):void 0;function Qc(i,e,t,r,n){for(let s of e){let o=Xc(t,s);if(o){i.add(o);let a=_o(o._fallback,t,n);if(typeof a<"u"&&a!==t&&a!==r)return a}else if(o===!1&&typeof r<"u"&&t!==r)return null}return!1}function Pn(i,e,t,r){let n=e._rootScopes,s=_o(e._fallback,t,r),o=[...i,...n],a=new Set;a.add(r);let l=Gs(a,o,t,s||t,r);return l===null||typeof s<"u"&&s!==t&&(l=Gs(a,o,s,l,r),l===null)?!1:Gi(Array.from(a),[""],n,s,()=>Gc(e,t,r))}function Gs(i,e,t,r,n){for(;t;)t=Qc(i,e,t,r,n);return t}function Gc(i,e,t){let r=i._getTarget();e in r||(r[e]={});let n=r[e];return tt(n)&&V(t)?t:n||{}}function Kc(i,e,t,r){let n;for(let s of e)if(n=wo(Vc(s,i),t),typeof n<"u")return Cn(i,n)?Pn(t,r,i,n):n}function wo(i,e){for(let t of e){if(!t)continue;let r=t[i];if(typeof r<"u")return r}}function Ks(i){let e=i._keys;return e||(e=i._keys=Zc(i._scopes)),e}function Zc(i){let e=new Set;for(let t of i)for(let r of Object.keys(t).filter(n=>!n.startsWith("_")))e.add(r);return Array.from(e)}function On(i,e,t,r){let{iScale:n}=i,{key:s="r"}=this._parsing,o=new Array(r),a,l,c,u;for(a=0,l=r;a<l;++a)c=a+t,u=e[c],o[a]={r:n.parse(jt(u,s),c)};return o}var Jc=Number.EPSILON||1e-14,Le=(i,e)=>e<i.length&&!i[e].skip&&i[e],Mo=i=>i==="x"?"y":"x";function tu(i,e,t,r){let n=i.skip?e:i,s=e,o=t.skip?e:t,a=Bi(s,n),l=Bi(o,s),c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;let f=r*c,d=r*u;return{previous:{x:s.x-f*(o.x-n.x),y:s.y-f*(o.y-n.y)},next:{x:s.x+d*(o.x-n.x),y:s.y+d*(o.y-n.y)}}}function eu(i,e,t){let r=i.length,n,s,o,a,l,c=Le(i,0);for(let u=0;u<r-1;++u)if(l=c,c=Le(i,u+1),!(!l||!c)){if(Fe(e[u],0,Jc)){t[u]=t[u+1]=0;continue}n=t[u]/e[u],s=t[u+1]/e[u],a=Math.pow(n,2)+Math.pow(s,2),!(a<=9)&&(o=3/Math.sqrt(a),t[u]=n*o*e[u],t[u+1]=s*o*e[u])}}function iu(i,e,t="x"){let r=Mo(t),n=i.length,s,o,a,l=Le(i,0);for(let c=0;c<n;++c){if(o=a,a=l,l=Le(i,c+1),!a)continue;let u=a[t],f=a[r];o&&(s=(u-o[t])/3,a[`cp1${t}`]=u-s,a[`cp1${r}`]=f-s*e[c]),l&&(s=(l[t]-u)/3,a[`cp2${t}`]=u+s,a[`cp2${r}`]=f+s*e[c])}}function ru(i,e="x"){let t=Mo(e),r=i.length,n=Array(r).fill(0),s=Array(r),o,a,l,c=Le(i,0);for(o=0;o<r;++o)if(a=l,l=c,c=Le(i,o+1),!!l){if(c){let u=c[e]-l[e];n[o]=u!==0?(c[t]-l[t])/u:0}s[o]=a?c?At(n[o-1])!==At(n[o])?0:(n[o-1]+n[o])/2:n[o-1]:n[o]}eu(i,n,s),iu(i,s,e)}function Fi(i,e,t){return Math.max(Math.min(i,t),e)}function nu(i,e){let t,r,n,s,o,a=Rt(i[0],e);for(t=0,r=i.length;t<r;++t)o=s,s=a,a=t<r-1&&Rt(i[t+1],e),s&&(n=i[t],o&&(n.cp1x=Fi(n.cp1x,e.left,e.right),n.cp1y=Fi(n.cp1y,e.top,e.bottom)),a&&(n.cp2x=Fi(n.cp2x,e.left,e.right),n.cp2y=Fi(n.cp2y,e.top,e.bottom)))}function ko(i,e,t,r,n){let s,o,a,l;if(e.spanGaps&&(i=i.filter(c=>!c.skip)),e.cubicInterpolationMode==="monotone")ru(i,n);else{let c=r?i[i.length-1]:i[0];for(s=0,o=i.length;s<o;++s)a=i[s],l=tu(c,a,i[Math.min(s+1,o-(r?0:1))%o],e.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}e.capBezierPoints&&nu(i,t)}function Ki(){return typeof window<"u"&&typeof document<"u"}function Zi(i){let e=i.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function Yi(i,e,t){let r;return typeof i=="string"?(r=parseInt(i,10),i.indexOf("%")!==-1&&(r=r/100*e.parentNode[t])):r=i,r}var Ji=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function su(i,e){return Ji(i).getPropertyValue(e)}var ou=["top","right","bottom","left"];function me(i,e,t){let r={};t=t?"-"+t:"";for(let n=0;n<4;n++){let s=ou[n];r[s]=parseFloat(i[e+"-"+s+t])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}var au=(i,e,t)=>(i>0||e>0)&&(!t||!t.shadowRoot);function lu(i,e){let t=i.touches,r=t&&t.length?t[0]:i,{offsetX:n,offsetY:s}=r,o=!1,a,l;if(au(n,s,i.target))a=n,l=s;else{let c=e.getBoundingClientRect();a=r.clientX-c.left,l=r.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function ae(i,e){if("native"in i)return i;let{canvas:t,currentDevicePixelRatio:r}=e,n=Ji(t),s=n.boxSizing==="border-box",o=me(n,"padding"),a=me(n,"border","width"),{x:l,y:c,box:u}=lu(i,t),f=o.left+(u&&a.left),d=o.top+(u&&a.top),{width:h,height:m}=e;return s&&(h-=o.width+a.width,m-=o.height+a.height),{x:Math.round((l-f)/h*t.width/r),y:Math.round((c-d)/m*t.height/r)}}function cu(i,e,t){let r,n;if(e===void 0||t===void 0){let s=i&&Zi(i);if(!s)e=i.clientWidth,t=i.clientHeight;else{let o=s.getBoundingClientRect(),a=Ji(s),l=me(a,"border","width"),c=me(a,"padding");e=o.width-c.width-l.width,t=o.height-c.height-l.height,r=Yi(a.maxWidth,s,"clientWidth"),n=Yi(a.maxHeight,s,"clientHeight")}}return{width:e,height:t,maxWidth:r||Hi,maxHeight:n||Hi}}var zi=i=>Math.round(i*10)/10;function Do(i,e,t,r){let n=Ji(i),s=me(n,"margin"),o=Yi(n.maxWidth,i,"clientWidth")||Hi,a=Yi(n.maxHeight,i,"clientHeight")||Hi,l=cu(i,e,t),{width:c,height:u}=l;if(n.boxSizing==="content-box"){let d=me(n,"border","width"),h=me(n,"padding");c-=h.width+d.width,u-=h.height+d.height}return c=Math.max(0,c-s.width),u=Math.max(0,r?c/r:u-s.height),c=zi(Math.min(c,o,l.maxWidth)),u=zi(Math.min(u,a,l.maxHeight)),c&&!u&&(u=zi(c/2)),(e!==void 0||t!==void 0)&&r&&l.height&&u>l.height&&(u=l.height,c=zi(Math.floor(u*r))),{width:c,height:u}}function Sn(i,e,t){let r=e||1,n=Math.floor(i.height*r),s=Math.floor(i.width*r);i.height=Math.floor(i.height),i.width=Math.floor(i.width);let o=i.canvas;return o.style&&(t||!o.style.height&&!o.style.width)&&(o.style.height=`${i.height}px`,o.style.width=`${i.width}px`),i.currentDevicePixelRatio!==r||o.height!==n||o.width!==s?(i.currentDevicePixelRatio=r,o.height=n,o.width=s,i.ctx.setTransform(r,0,0,r,0,0),!0):!1}var To=(function(){let i=!1;try{let e={get passive(){return i=!0,!1}};Ki()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return i})();function An(i,e){let t=su(i,e),r=t&&t.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function ie(i,e,t,r){return{x:i.x+t*(e.x-i.x),y:i.y+t*(e.y-i.y)}}function Co(i,e,t,r){return{x:i.x+t*(e.x-i.x),y:r==="middle"?t<.5?i.y:e.y:r==="after"?t<1?i.y:e.y:t>0?e.y:i.y}}function Po(i,e,t,r){let n={x:i.cp2x,y:i.cp2y},s={x:e.cp1x,y:e.cp1y},o=ie(i,n,t),a=ie(n,s,t),l=ie(s,e,t),c=ie(o,a,t),u=ie(a,l,t);return ie(c,u,t)}var uu=function(i,e){return{x(t){return i+i+e-t},setWidth(t){e=t},textAlign(t){return t==="center"?t:t==="right"?"left":"right"},xPlus(t,r){return t-r},leftForLtr(t,r){return t-r}}},fu=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,e){return i+e},leftForLtr(i,e){return i}}};function be(i,e,t){return i?uu(e,t):fu()}function In(i,e){let t,r;(e==="ltr"||e==="rtl")&&(t=i.canvas.style,r=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",e,"important"),i.prevTextDirection=r)}function Ln(i,e){e!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",e[0],e[1]))}function Oo(i){return i==="angle"?{between:ze,compare:Pc,normalize:ft}:{between:zt,compare:(e,t)=>e-t,normalize:e=>e}}function Zs({start:i,end:e,count:t,loop:r,style:n}){return{start:i%t,end:e%t,loop:r&&(e-i+1)%t===0,style:n}}function du(i,e,t){let{property:r,start:n,end:s}=t,{between:o,normalize:a}=Oo(r),l=e.length,{start:c,end:u,loop:f}=i,d,h;if(f){for(c+=l,u+=l,d=0,h=l;d<h&&o(a(e[c%l][r]),n,s);++d)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:f,style:i.style}}function En(i,e,t){if(!t)return[i];let{property:r,start:n,end:s}=t,o=e.length,{compare:a,between:l,normalize:c}=Oo(r),{start:u,end:f,loop:d,style:h}=du(i,e,t),m=[],p=!1,g=null,b,x,w,k=()=>l(n,w,b)&&a(n,w)!==0,v=()=>a(s,b)===0||l(s,w,b),_=()=>p||k(),P=()=>!p||v();for(let C=u,O=u;C<=f;++C)x=e[C%o],!x.skip&&(b=c(x[r]),b!==w&&(p=l(b,n,s),g===null&&_()&&(g=a(b,n)===0?C:O),g!==null&&P()&&(m.push(Zs({start:g,end:C,loop:d,count:o,style:h})),g=null),O=C,w=b));return g!==null&&m.push(Zs({start:g,end:f,loop:d,count:o,style:h})),m}function Rn(i,e){let t=[],r=i.segments;for(let n=0;n<r.length;n++){let s=En(r[n],i.points,e);s.length&&t.push(...s)}return t}function hu(i,e,t,r){let n=0,s=e-1;if(t&&!r)for(;n<e&&!i[n].skip;)n++;for(;n<e&&i[n].skip;)n++;for(n%=e,t&&(s+=n);s>n&&i[s%e].skip;)s--;return s%=e,{start:n,end:s}}function mu(i,e,t,r){let n=i.length,s=[],o=e,a=i[e],l;for(l=e+1;l<=t;++l){let c=i[l%n];c.skip||c.stop?a.skip||(r=!1,s.push({start:e%n,end:(l-1)%n,loop:r}),e=o=c.stop?l:null):(o=l,a.skip&&(e=l)),a=c}return o!==null&&s.push({start:e%n,end:o%n,loop:r}),s}function So(i,e){let t=i.points,r=i.options.spanGaps,n=t.length;if(!n)return[];let s=!!i._loop,{start:o,end:a}=hu(t,n,s,r);if(r===!0)return Js(i,[{start:o,end:a,loop:s}],t,e);let l=a<o?a+n:a,c=!!i._fullLoop&&o===0&&a===n-1;return Js(i,mu(t,o,l,c),t,e)}function Js(i,e,t,r){return!r||!r.setContext||!t?e:pu(i,e,t,r)}function pu(i,e,t,r){let n=i._chart.getContext(),s=to(i.options),{_datasetIndex:o,options:{spanGaps:a}}=i,l=t.length,c=[],u=s,f=e[0].start,d=f;function h(m,p,g,b){let x=a?-1:1;if(m!==p){for(m+=l;t[m%l].skip;)m-=x;for(;t[p%l].skip;)p+=x;m%l!==p%l&&(c.push({start:m%l,end:p%l,loop:g,style:b}),u=b,f=p%l)}}for(let m of e){f=a?f:m.start;let p=t[f%l],g;for(d=f+1;d<=m.end;d++){let b=t[d%l];g=to(r.setContext(qt(n,{type:"segment",p0:p,p1:b,p0DataIndex:(d-1)%l,p1DataIndex:d%l,datasetIndex:o}))),gu(g,u)&&h(f,d-1,m.loop,u),p=b,u=g}f<d-1&&h(f,d-1,m.loop,u)}return c}function to(i){return{backgroundColor:i.backgroundColor,borderCapStyle:i.borderCapStyle,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderJoinStyle:i.borderJoinStyle,borderWidth:i.borderWidth,borderColor:i.borderColor}}function gu(i,e){if(!e)return!1;let t=[],r=function(n,s){return _n(s)?(t.includes(s)||t.push(s),t.indexOf(s)):s};return JSON.stringify(i,r)!==JSON.stringify(e,r)}function Ni(i,e,t){return i.options.clip?i[t]:e[t]}function bu(i,e){let{xScale:t,yScale:r}=i;return t&&r?{left:Ni(t,e,"left"),right:Ni(t,e,"right"),top:Ni(r,e,"top"),bottom:Ni(r,e,"bottom")}:e}function Fn(i,e){let t=e._clip;if(t.disabled)return!1;let r=bu(e,i.chartArea);return{left:t.left===!1?0:r.left-(t.left===!0?0:t.left),right:t.right===!1?i.width:r.right+(t.right===!0?0:t.right),top:t.top===!1?0:r.top-(t.top===!0?0:t.top),bottom:t.bottom===!1?i.height:r.bottom+(t.bottom===!0?0:t.bottom)}}var Xn=class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,r,n){let s=t.listeners[n],o=t.duration;s.forEach(a=>a({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(r-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=bn.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((r,n)=>{if(!r.running||!r.items.length)return;let s=r.items,o=s.length-1,a=!1,l;for(;o>=0;--o)l=s[o],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(e),a=!0):(s[o]=s[s.length-1],s.pop());a&&(n.draw(),this._notify(n,r,e,"progress")),s.length||(r.running=!1,this._notify(n,r,e,"complete"),r.initial=!1),t+=s.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){let t=this._charts,r=t.get(e);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,r)),r}listen(e,t,r){this._getAnims(e).listeners[t].push(r)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){let t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((r,n)=>Math.max(r,n._duration),0),this._refresh())}running(e){if(!this._running)return!1;let t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){let t=this._charts.get(e);if(!t||!t.items.length)return;let r=t.items,n=r.length-1;for(;n>=0;--n)r[n].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}},$t=new Xn,Ao="transparent",xu={boolean(i,e,t){return t>.5?e:i},color(i,e,t){let r=wn(i||Ao),n=r.valid&&wn(e||Ao);return n&&n.valid?n.mix(r,t).hexString():e},number(i,e,t){return i+(e-i)*t}},Qn=class{constructor(e,t,r,n){let s=t[r];n=He([e.to,n,s,e.from]);let o=He([e.from,s,n]);this._active=!0,this._fn=e.fn||xu[e.type||typeof o],this._easing=Ae[e.easing]||Ae.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=r,this._from=o,this._to=n,this._promises=void 0}active(){return this._active}update(e,t,r){if(this._active){this._notify(!1);let n=this._target[this._prop],s=r-this._start,o=this._duration-s;this._start=r,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=s,this._loop=!!e.loop,this._to=He([e.to,t,n,e.from]),this._from=He([e.from,n,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){let t=e-this._start,r=this._duration,n=this._prop,s=this._from,o=this._loop,a=this._to,l;if(this._active=s!==a&&(o||t<r),!this._active){this._target[n]=a,this._notify(!0);return}if(t<0){this._target[n]=s;return}l=t/r%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(s,a,l)}wait(){let e=this._promises||(this._promises=[]);return new Promise((t,r)=>{e.push({res:t,rej:r})})}_notify(e){let t=e?"res":"rej",r=this._promises||[];for(let n=0;n<r.length;n++)r[n][t]()}},lr=class{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!V(e))return;let t=Object.keys(it.animation),r=this._properties;Object.getOwnPropertyNames(e).forEach(n=>{let s=e[n];if(!V(s))return;let o={};for(let a of t)o[a]=s[a];(tt(s.properties)&&s.properties||[n]).forEach(a=>{(a===n||!r.has(a))&&r.set(a,o)})})}_animateOptions(e,t){let r=t.options,n=yu(e,r);if(!n)return[];let s=this._createAnimations(n,r);return r.$shared&&vu(e.options.$animations,r).then(()=>{e.options=r},()=>{}),s}_createAnimations(e,t){let r=this._properties,n=[],s=e.$animations||(e.$animations={}),o=Object.keys(t),a=Date.now(),l;for(l=o.length-1;l>=0;--l){let c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(e,t));continue}let u=t[c],f=s[c],d=r.get(c);if(f)if(d&&f.active()){f.update(d,u,a);continue}else f.cancel();if(!d||!d.duration){e[c]=u;continue}s[c]=f=new Qn(d,e,c,u),n.push(f)}return n}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}let r=this._createAnimations(e,t);if(r.length)return $t.add(this._chart,r),!0}};function vu(i,e){let t=[],r=Object.keys(e);for(let n=0;n<r.length;n++){let s=i[r[n]];s&&s.active()&&t.push(s.wait())}return Promise.all(t)}function yu(i,e){if(!e)return;let t=i.options;if(!t){i.options=e;return}return t.$shared&&(i.options=t=Object.assign({},t,{$shared:!1,$animations:{}})),t}function Io(i,e){let t=i&&i.options||{},r=t.reverse,n=t.min===void 0?e:0,s=t.max===void 0?e:0;return{start:r?s:n,end:r?n:s}}function _u(i,e,t){if(t===!1)return!1;let r=Io(i,t),n=Io(e,t);return{top:n.end,right:r.end,bottom:n.start,left:r.start}}function wu(i){let e,t,r,n;return V(i)?(e=i.top,t=i.right,r=i.bottom,n=i.left):e=t=r=n=i,{top:e,right:t,bottom:r,left:n,disabled:i===!1}}function Aa(i,e){let t=[],r=i._getSortedDatasetMetas(e),n,s;for(n=0,s=r.length;n<s;++n)t.push(r[n].index);return t}function Lo(i,e,t,r={}){let n=i.keys,s=r.mode==="single",o,a,l,c;if(e===null)return;let u=!1;for(o=0,a=n.length;o<a;++o){if(l=+n[o],l===t){if(u=!0,r.all)continue;break}c=i.values[l],nt(c)&&(s||e===0||At(e)===At(c))&&(e+=c)}return!u&&!r.all?0:e}function Mu(i,e){let{iScale:t,vScale:r}=e,n=t.axis==="x"?"x":"y",s=r.axis==="x"?"x":"y",o=Object.keys(i),a=new Array(o.length),l,c,u;for(l=0,c=o.length;l<c;++l)u=o[l],a[l]={[n]:u,[s]:i[u]};return a}function zn(i,e){let t=i&&i.options.stacked;return t||t===void 0&&e.stack!==void 0}function ku(i,e,t){return`${i.id}.${e.id}.${t.stack||t.type}`}function Du(i){let{min:e,max:t,minDefined:r,maxDefined:n}=i.getUserBounds();return{min:r?e:Number.NEGATIVE_INFINITY,max:n?t:Number.POSITIVE_INFINITY}}function Tu(i,e,t){let r=i[e]||(i[e]={});return r[t]||(r[t]={})}function Eo(i,e,t,r){for(let n of e.getMatchingVisibleMetas(r).reverse()){let s=i[n.index];if(t&&s>0||!t&&s<0)return n.index}return null}function Ro(i,e){let{chart:t,_cachedMeta:r}=i,n=t._stacks||(t._stacks={}),{iScale:s,vScale:o,index:a}=r,l=s.axis,c=o.axis,u=ku(s,o,r),f=e.length,d;for(let h=0;h<f;++h){let m=e[h],{[l]:p,[c]:g}=m,b=m._stacks||(m._stacks={});d=b[c]=Tu(n,u,p),d[a]=g,d._top=Eo(d,o,!0,r.type),d._bottom=Eo(d,o,!1,r.type);let x=d._visualValues||(d._visualValues={});x[a]=g}}function Nn(i,e){let t=i.scales;return Object.keys(t).filter(r=>t[r].axis===e).shift()}function Cu(i,e){return qt(i,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function Pu(i,e,t){return qt(i,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function ci(i,e){let t=i.controller.index,r=i.vScale&&i.vScale.axis;if(r){e=e||i._parsed;for(let n of e){let s=n._stacks;if(!s||s[r]===void 0||s[r][t]===void 0)return;delete s[r][t],s[r]._visualValues!==void 0&&s[r]._visualValues[t]!==void 0&&delete s[r]._visualValues[t]}}}var Wn=i=>i==="reset"||i==="none",Fo=(i,e)=>e?i:Object.assign({},i),Ou=(i,e,t)=>i&&!e.hidden&&e._stacked&&{keys:Aa(t,!0),values:null},ce=(()=>{class i{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,r){this.chart=t,this._ctx=t.ctx,this.index=r,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=zn(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&&ci(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,r=this._cachedMeta,n=this.getDataset(),s=(d,h,m,p)=>d==="x"?h:d==="r"?p:m,o=r.xAxisID=W(n.xAxisID,Nn(t,"x")),a=r.yAxisID=W(n.yAxisID,Nn(t,"y")),l=r.rAxisID=W(n.rAxisID,Nn(t,"r")),c=r.indexAxis,u=r.iAxisID=s(c,o,a,l),f=r.vAxisID=s(c,a,o,l);r.xScale=this.getScaleForId(o),r.yScale=this.getScaleForId(a),r.rScale=this.getScaleForId(l),r.iScale=this.getScaleForId(u),r.vScale=this.getScaleForId(f)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let r=this._cachedMeta;return t===r.iScale?r.vScale:r.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&pn(this._data,this),t._stacked&&ci(t)}_dataCheck(){let t=this.getDataset(),r=t.data||(t.data=[]),n=this._data;if(V(r)){let s=this._cachedMeta;this._data=Mu(r,s)}else if(n!==r){if(n){pn(n,this);let s=this._cachedMeta;ci(s),s._parsed=[]}r&&Object.isExtensible(r)&&fo(r,this),this._syncList=[],this._data=r}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let r=this._cachedMeta,n=this.getDataset(),s=!1;this._dataCheck();let o=r._stacked;r._stacked=zn(r.vScale,r),r.stack!==n.stack&&(s=!0,ci(r),r.stack=n.stack),this._resyncElements(t),(s||o!==r._stacked)&&(Ro(this,r._parsed),r._stacked=zn(r.vScale,r))}configure(){let t=this.chart.config,r=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),r,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,r){let{_cachedMeta:n,_data:s}=this,{iScale:o,_stacked:a}=n,l=o.axis,c=t===0&&r===s.length?!0:n._sorted,u=t>0&&n._parsed[t-1],f,d,h;if(this._parsing===!1)n._parsed=s,n._sorted=!0,h=s;else{tt(s[t])?h=this.parseArrayData(n,s,t,r):V(s[t])?h=this.parseObjectData(n,s,t,r):h=this.parsePrimitiveData(n,s,t,r);let m=()=>d[l]===null||u&&d[l]<u[l];for(f=0;f<r;++f)n._parsed[f+t]=d=h[f],c&&(m()&&(c=!1),u=d);n._sorted=c}a&&Ro(this,h)}parsePrimitiveData(t,r,n,s){let{iScale:o,vScale:a}=t,l=o.axis,c=a.axis,u=o.getLabels(),f=o===a,d=new Array(s),h,m,p;for(h=0,m=s;h<m;++h)p=h+n,d[h]={[l]:f||o.parse(u[p],p),[c]:a.parse(r[p],p)};return d}parseArrayData(t,r,n,s){let{xScale:o,yScale:a}=t,l=new Array(s),c,u,f,d;for(c=0,u=s;c<u;++c)f=c+n,d=r[f],l[c]={x:o.parse(d[0],f),y:a.parse(d[1],f)};return l}parseObjectData(t,r,n,s){let{xScale:o,yScale:a}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,u=new Array(s),f,d,h,m;for(f=0,d=s;f<d;++f)h=f+n,m=r[h],u[f]={x:o.parse(jt(m,l),h),y:a.parse(jt(m,c),h)};return u}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,r,n){let s=this.chart,o=this._cachedMeta,a=r[t.axis],l={keys:Aa(s,!0),values:r._stacks[t.axis]._visualValues};return Lo(l,a,o.index,{mode:n})}updateRangeFromParsed(t,r,n,s){let o=n[r.axis],a=o===null?NaN:o,l=s&&n._stacks[r.axis];s&&l&&(s.values=l,a=Lo(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,r){let n=this._cachedMeta,s=n._parsed,o=n._sorted&&t===n.iScale,a=s.length,l=this._getOtherScale(t),c=Ou(r,n,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:f,max:d}=Du(l),h,m;function p(){m=s[h];let g=m[l.axis];return!nt(m[t.axis])||f>g||d<g}for(h=0;h<a&&!(!p()&&(this.updateRangeFromParsed(u,t,m,c),o));++h);if(o){for(h=a-1;h>=0;--h)if(!p()){this.updateRangeFromParsed(u,t,m,c);break}}return u}getAllParsedValues(t){let r=this._cachedMeta._parsed,n=[],s,o,a;for(s=0,o=r.length;s<o;++s)a=r[s][t.axis],nt(a)&&n.push(a);return n}getMaxOverflow(){return!1}getLabelAndValue(t){let r=this._cachedMeta,n=r.iScale,s=r.vScale,o=this.getParsed(t);return{label:n?""+n.getLabelForValue(o[n.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){let r=this._cachedMeta;this.update(t||"default"),r._clip=wu(W(this.options.clip,_u(r.xScale,r.yScale,this.getMaxOverflow())))}update(t){}draw(){let t=this._ctx,r=this.chart,n=this._cachedMeta,s=n.data||[],o=r.chartArea,a=[],l=this._drawStart||0,c=this._drawCount||s.length-l,u=this.options.drawActiveElementsOnTop,f;for(n.dataset&&n.dataset.draw(t,o,l,c),f=l;f<l+c;++f){let d=s[f];d.hidden||(d.active&&u?a.push(d):d.draw(t,o))}for(f=0;f<a.length;++f)a[f].draw(t,o)}getStyle(t,r){let n=r?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,r,n){let s=this.getDataset(),o;if(t>=0&&t<this._cachedMeta.data.length){let a=this._cachedMeta.data[t];o=a.$context||(a.$context=Pu(this.getContext(),t,a)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=Cu(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!r,o.mode=n,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,r){return this._resolveElementOptions(this.dataElementType.id,r,t)}_resolveElementOptions(t,r="default",n){let s=r==="active",o=this._cachedDataOpts,a=t+"-"+r,l=o[a],c=this.enableOptionSharing&&Re(n);if(l)return Fo(l,c);let u=this.chart.config,f=u.datasetElementScopeKeys(this._type,t),d=s?[`${t}Hover`,"hover",t,""]:[t,""],h=u.getOptionScopes(this.getDataset(),f),m=Object.keys(it.elements[t]),p=()=>this.getContext(n,s,r),g=u.resolveNamedOptions(h,m,p,d);return g.$shared&&(g.$shared=c,o[a]=Object.freeze(Fo(g,c))),g}_resolveAnimations(t,r,n){let s=this.chart,o=this._cachedDataOpts,a=`animation-${r}`,l=o[a];if(l)return l;let c;if(s.options.animation!==!1){let f=this.chart.config,d=f.datasetAnimationScopeKeys(this._type,r),h=f.getOptionScopes(this.getDataset(),d);c=f.createResolver(h,this.getContext(t,n,r))}let u=new lr(s,c&&c.animations);return c&&c._cacheable&&(o[a]=Object.freeze(u)),u}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,r){return!r||Wn(t)||this.chart._animationsDisabled}_getSharedOptions(t,r){let n=this.resolveDataElementOptions(t,r),s=this._sharedOptions,o=this.getSharedOptions(n),a=this.includeOptions(r,o)||o!==s;return this.updateSharedOptions(o,r,n),{sharedOptions:o,includeOptions:a}}updateElement(t,r,n,s){Wn(s)?Object.assign(t,n):this._resolveAnimations(r,s).update(t,n)}updateSharedOptions(t,r,n){t&&!Wn(r)&&this._resolveAnimations(void 0,r).update(t,n)}_setStyle(t,r,n,s){t.active=s;let o=this.getStyle(r,s);this._resolveAnimations(r,n,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,r,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,r,n){this._setStyle(t,n,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let r=this._data,n=this._cachedMeta.data;for(let[l,c,u]of this._syncList)this[l](c,u);this._syncList=[];let s=n.length,o=r.length,a=Math.min(o,s);a&&this.parse(0,a),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,r,n=!0){let s=this._cachedMeta,o=s.data,a=t+r,l,c=u=>{for(u.length+=r,l=u.length-1;l>=a;l--)u[l]=u[l-r]};for(c(o),l=t;l<a;++l)o[l]=new this.dataElementType;this._parsing&&c(s._parsed),this.parse(t,r),n&&this.updateElements(o,t,r,"reset")}updateElements(t,r,n,s){}_removeElements(t,r){let n=this._cachedMeta;if(this._parsing){let s=n._parsed.splice(t,r);n._stacked&&ci(n,s)}n.data.splice(t,r)}_sync(t){if(this._parsing)this._syncList.push(t);else{let[r,n,s]=t;this[r](n,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){let t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,r){r&&this._sync(["_removeElements",t,r]);let n=arguments.length-2;n&&this._sync(["_insertElements",t,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}return i})();function Su(i,e){if(!i._cache.$bar){let t=i.getMatchingVisibleMetas(e),r=[];for(let n=0,s=t.length;n<s;n++)r=r.concat(t[n].controller.getAllParsedValues(i));i._cache.$bar=gn(r.sort((n,s)=>n-s))}return i._cache.$bar}function Au(i){let e=i.iScale,t=Su(e,i.type),r=e._length,n,s,o,a,l=()=>{o===32767||o===-32768||(Re(a)&&(r=Math.min(r,Math.abs(o-a)||r)),a=o)};for(n=0,s=t.length;n<s;++n)o=e.getPixelForValue(t[n]),l();for(a=void 0,n=0,s=e.ticks.length;n<s;++n)o=e.getPixelForTick(n),l();return r}function Iu(i,e,t,r){let n=t.barThickness,s,o;return U(n)?(s=e.min*t.categoryPercentage,o=t.barPercentage):(s=n*r,o=1),{chunk:s/r,ratio:o,start:e.pixels[i]-s/2}}function Lu(i,e,t,r){let n=e.pixels,s=n[i],o=i>0?n[i-1]:null,a=i<n.length-1?n[i+1]:null,l=t.categoryPercentage;o===null&&(o=s-(a===null?e.end-e.start:a-s)),a===null&&(a=s+s-o);let c=s-(s-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/r,ratio:t.barPercentage,start:c}}function Eu(i,e,t,r){let n=t.parse(i[0],r),s=t.parse(i[1],r),o=Math.min(n,s),a=Math.max(n,s),l=o,c=a;Math.abs(o)>Math.abs(a)&&(l=a,c=o),e[t.axis]=c,e._custom={barStart:l,barEnd:c,start:n,end:s,min:o,max:a}}function Ia(i,e,t,r){return tt(i)?Eu(i,e,t,r):e[t.axis]=t.parse(i,r),e}function zo(i,e,t,r){let n=i.iScale,s=i.vScale,o=n.getLabels(),a=n===s,l=[],c,u,f,d;for(c=t,u=t+r;c<u;++c)d=e[c],f={},f[n.axis]=a||n.parse(o[c],c),l.push(Ia(d,f,s,c));return l}function Hn(i){return i&&i.barStart!==void 0&&i.barEnd!==void 0}function Ru(i,e,t){return i!==0?At(i):(e.isHorizontal()?1:-1)*(e.min>=t?1:-1)}function Fu(i){let e,t,r,n,s;return i.horizontal?(e=i.base>i.x,t="left",r="right"):(e=i.base<i.y,t="bottom",r="top"),e?(n="end",s="start"):(n="start",s="end"),{start:t,end:r,reverse:e,top:n,bottom:s}}function zu(i,e,t,r){let n=e.borderSkipped,s={};if(!n){i.borderSkipped=s;return}if(n===!0){i.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}let{start:o,end:a,reverse:l,top:c,bottom:u}=Fu(i);n==="middle"&&t&&(i.enableBorderRadius=!0,(t._top||0)===r?n=c:(t._bottom||0)===r?n=u:(s[No(u,o,a,l)]=!0,n=c)),s[No(n,o,a,l)]=!0,i.borderSkipped=s}function No(i,e,t,r){return r?(i=Nu(i,e,t),i=Wo(i,t,e)):i=Wo(i,e,t),i}function Nu(i,e,t){return i===e?t:i===t?e:i}function Wo(i,e,t){return i==="start"?e:i==="end"?t:i}function Wu(i,{inflateAmount:e},t){i.inflateAmount=e==="auto"?t===1?.33:0:e}var Hu=(()=>{class i extends ce{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,r,n,s){return zo(t,r,n,s)}parseArrayData(t,r,n,s){return zo(t,r,n,s)}parseObjectData(t,r,n,s){let{iScale:o,vScale:a}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,u=o.axis==="x"?l:c,f=a.axis==="x"?l:c,d=[],h,m,p,g;for(h=n,m=n+s;h<m;++h)g=r[h],p={},p[o.axis]=o.parse(jt(g,u),h),d.push(Ia(jt(g,f),p,a,h));return d}updateRangeFromParsed(t,r,n,s){super.updateRangeFromParsed(t,r,n,s);let o=n._custom;o&&r===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){let r=this._cachedMeta,{iScale:n,vScale:s}=r,o=this.getParsed(t),a=o._custom,l=Hn(a)?"["+a.start+", "+a.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+n.getLabelForValue(o[n.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();let t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){let r=this._cachedMeta;this.updateElements(r.data,0,r.data.length,t)}updateElements(t,r,n,s){let o=s==="reset",{index:a,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),u=l.isHorizontal(),f=this._getRuler(),{sharedOptions:d,includeOptions:h}=this._getSharedOptions(r,s);for(let m=r;m<r+n;m++){let p=this.getParsed(m),g=o||U(p[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(m),b=this._calculateBarIndexPixels(m,f),x=(p._stacks||{})[l.axis],w={horizontal:u,base:g.base,enableBorderRadius:!x||Hn(p._custom)||a===x._top||a===x._bottom,x:u?g.head:b.center,y:u?b.center:g.head,height:u?b.size:Math.abs(g.size),width:u?Math.abs(g.size):b.size};h&&(w.options=d||this.resolveDataElementOptions(m,t[m].active?"active":s));let k=w.options||t[m].options;zu(w,k,x,a),Wu(w,k,f.ratio),this.updateElement(t[m],m,w,s)}}_getStacks(t,r){let{iScale:n}=this._cachedMeta,s=n.getMatchingVisibleMetas(this._type).filter(f=>f.controller.options.grouped),o=n.options.stacked,a=[],l=this._cachedMeta.controller.getParsed(r),c=l&&l[n.axis],u=f=>{let d=f._parsed.find(m=>m[n.axis]===c),h=d&&d[f.vScale.axis];if(U(h)||isNaN(h))return!0};for(let f of s)if(!(r!==void 0&&u(f))&&((o===!1||a.indexOf(f.stack)===-1||o===void 0&&f.stack===void 0)&&a.push(f.stack),f.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){let t=this.chart.scales,r=this.chart.options.indexAxis;return Object.keys(t).filter(n=>t[n].axis===r).shift()}_getAxis(){let t={},r=this.getFirstScaleIdForIndexAxis();for(let n of this.chart.data.datasets)t[W(this.chart.options.indexAxis==="x"?n.xAxisID:n.yAxisID,r)]=!0;return Object.keys(t)}_getStackIndex(t,r,n){let s=this._getStacks(t,n),o=r!==void 0?s.indexOf(r):-1;return o===-1?s.length-1:o}_getRuler(){let t=this.options,r=this._cachedMeta,n=r.iScale,s=[],o,a;for(o=0,a=r.data.length;o<a;++o)s.push(n.getPixelForValue(this.getParsed(o)[n.axis],o));let l=t.barThickness;return{min:l||Au(r),pixels:s,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:t.grouped,ratio:l?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){let{_cachedMeta:{vScale:r,_stacked:n,index:s},options:{base:o,minBarLength:a}}=this,l=o||0,c=this.getParsed(t),u=c._custom,f=Hn(u),d=c[r.axis],h=0,m=n?this.applyStack(r,c,n):d,p,g;m!==d&&(h=m-d,m=d),f&&(d=u.barStart,m=u.barEnd-u.barStart,d!==0&&At(d)!==At(u.barEnd)&&(h=0),h+=d);let b=!U(o)&&!f?o:h,x=r.getPixelForValue(b);if(this.chart.getDataVisibility(t)?p=r.getPixelForValue(h+m):p=x,g=p-x,Math.abs(g)<a){g=Ru(g,r,l)*a,d===l&&(x-=g/2);let w=r.getPixelForDecimal(0),k=r.getPixelForDecimal(1),v=Math.min(w,k),_=Math.max(w,k);x=Math.max(Math.min(x,_),v),p=x+g,n&&!f&&(c._stacks[r.axis]._visualValues[s]=r.getValueForPixel(p)-r.getValueForPixel(x))}if(x===r.getPixelForValue(l)){let w=At(g)*r.getLineWidthForValue(l)/2;x+=w,g-=w}return{size:g,base:x,head:p,center:p+g/2}}_calculateBarIndexPixels(t,r){let n=r.scale,s=this.options,o=s.skipNull,a=W(s.maxBarThickness,1/0),l,c,u=this._getAxisCount();if(r.grouped){let f=o?this._getStackCount(t):r.stackCount,d=s.barThickness==="flex"?Lu(t,r,s,f*u):Iu(t,r,s,f*u),h=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(W(h,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+m;l=d.start+d.chunk*p+d.chunk/2,c=Math.min(a,d.chunk*d.ratio)}else l=n.getPixelForValue(this.getParsed(t)[n.axis],t),c=Math.min(a,r.min*r.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){let t=this._cachedMeta,r=t.vScale,n=t.data,s=n.length,o=0;for(;o<s;++o)this.getParsed(o)[r.axis]!==null&&!n[o].hidden&&n[o].draw(this._ctx)}}return i})(),Bu=(()=>{class i extends ce{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,r,n,s){let o=super.parsePrimitiveData(t,r,n,s);for(let a=0;a<o.length;a++)o[a]._custom=this.resolveDataElementOptions(a+n).radius;return o}parseArrayData(t,r,n,s){let o=super.parseArrayData(t,r,n,s);for(let a=0;a<o.length;a++){let l=r[n+a];o[a]._custom=W(l[2],this.resolveDataElementOptions(a+n).radius)}return o}parseObjectData(t,r,n,s){let o=super.parseObjectData(t,r,n,s);for(let a=0;a<o.length;a++){let l=r[n+a];o[a]._custom=W(l&&l.r&&+l.r,this.resolveDataElementOptions(a+n).radius)}return o}getMaxOverflow(){let t=this._cachedMeta.data,r=0;for(let n=t.length-1;n>=0;--n)r=Math.max(r,t[n].size(this.resolveDataElementOptions(n))/2);return r>0&&r}getLabelAndValue(t){let r=this._cachedMeta,n=this.chart.data.labels||[],{xScale:s,yScale:o}=r,a=this.getParsed(t),l=s.getLabelForValue(a.x),c=o.getLabelForValue(a.y),u=a._custom;return{label:n[t]||"",value:"("+l+", "+c+(u?", "+u:"")+")"}}update(t){let r=this._cachedMeta.data;this.updateElements(r,0,r.length,t)}updateElements(t,r,n,s){let o=s==="reset",{iScale:a,vScale:l}=this._cachedMeta,{sharedOptions:c,includeOptions:u}=this._getSharedOptions(r,s),f=a.axis,d=l.axis;for(let h=r;h<r+n;h++){let m=t[h],p=!o&&this.getParsed(h),g={},b=g[f]=o?a.getPixelForDecimal(.5):a.getPixelForValue(p[f]),x=g[d]=o?l.getBasePixel():l.getPixelForValue(p[d]);g.skip=isNaN(b)||isNaN(x),u&&(g.options=c||this.resolveDataElementOptions(h,m.active?"active":s),o&&(g.options.radius=0)),this.updateElement(m,h,g,s)}}resolveDataElementOptions(t,r){let n=this.getParsed(t),s=super.resolveDataElementOptions(t,r);s.$shared&&(s=Object.assign({},s,{$shared:!1}));let o=s.radius;return r!=="active"&&(s.radius=0),s.radius+=W(n&&n._custom,o),s}}return i})();function Yu(i,e,t){let r=1,n=1,s=0,o=0;if(e<et){let a=i,l=a+e,c=Math.cos(a),u=Math.sin(a),f=Math.cos(l),d=Math.sin(l),h=(w,k,v)=>ze(w,a,l,!0)?1:Math.max(k,k*t,v,v*t),m=(w,k,v)=>ze(w,a,l,!0)?-1:Math.min(k,k*t,v,v*t),p=h(0,c,f),g=h(st,u,d),b=m($,c,f),x=m($+st,u,d);r=(p-b)/2,n=(g-x)/2,s=-(p+b)/2,o=-(g+x)/2}return{ratioX:r,ratioY:n,offsetX:s,offsetY:o}}var ps=(()=>{class i extends ce{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let r=t.data;if(r.labels.length&&r.datasets.length){let{labels:{pointStyle:n,color:s}}=t.legend.options;return r.labels.map((o,a)=>{let c=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:s,lineWidth:c.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,r,n){n.chart.toggleDataVisibility(r.index),n.chart.update()}}}};constructor(t,r){super(t,r),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,r){let n=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=n;else{let o=c=>+n[c];if(V(n[t])){let{key:c="value"}=this._parsing;o=u=>+jt(n[u],c)}let a,l;for(a=t,l=t+r;a<l;++a)s._parsed[a]=o(a)}}_getRotation(){return Tt(this.options.rotation-90)}_getCircumference(){return Tt(this.options.circumference)}_getRotationExtents(){let t=et,r=-et;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){let s=this.chart.getDatasetMeta(n).controller,o=s._getRotation(),a=s._getCircumference();t=Math.min(t,o),r=Math.max(r,o+a)}return{rotation:t,circumference:r-t}}update(t){let r=this.chart,{chartArea:n}=r,s=this._cachedMeta,o=s.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,l=Math.max((Math.min(n.width,n.height)-a)/2,0),c=Math.min(io(this.options.cutout,l),1),u=this._getRingWeight(this.index),{circumference:f,rotation:d}=this._getRotationExtents(),{ratioX:h,ratioY:m,offsetX:p,offsetY:g}=Yu(d,f,c),b=(n.width-a)/h,x=(n.height-a)/m,w=Math.max(Math.min(b,x)/2,0),k=cn(this.options.radius,w),v=Math.max(k*c,0),_=(k-v)/this._getVisibleDatasetWeightTotal();this.offsetX=p*k,this.offsetY=g*k,s.total=this.calculateTotal(),this.outerRadius=k-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*u,0),this.updateElements(o,0,o.length,t)}_circumference(t,r){let n=this.options,s=this._cachedMeta,o=this._getCircumference();return r&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/et)}updateElements(t,r,n,s){let o=s==="reset",a=this.chart,l=a.chartArea,u=a.options.animation,f=(l.left+l.right)/2,d=(l.top+l.bottom)/2,h=o&&u.animateScale,m=h?0:this.innerRadius,p=h?0:this.outerRadius,{sharedOptions:g,includeOptions:b}=this._getSharedOptions(r,s),x=this._getRotation(),w;for(w=0;w<r;++w)x+=this._circumference(w,o);for(w=r;w<r+n;++w){let k=this._circumference(w,o),v=t[w],_={x:f+this.offsetX,y:d+this.offsetY,startAngle:x,endAngle:x+k,circumference:k,outerRadius:p,innerRadius:m};b&&(_.options=g||this.resolveDataElementOptions(w,v.active?"active":s)),x+=k,this.updateElement(v,w,_,s)}}calculateTotal(){let t=this._cachedMeta,r=t.data,n=0,s;for(s=0;s<r.length;s++){let o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!r[s].hidden&&(n+=Math.abs(o))}return n}calculateCircumference(t){let r=this._cachedMeta.total;return r>0&&!isNaN(t)?et*(Math.abs(t)/r):0}getLabelAndValue(t){let r=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=Ne(r._parsed[t],n.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let r=0,n=this.chart,s,o,a,l,c;if(!t){for(s=0,o=n.data.datasets.length;s<o;++s)if(n.isDatasetVisible(s)){a=n.getDatasetMeta(s),t=a.data,l=a.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)c=l.resolveDataElementOptions(s),c.borderAlign!=="inner"&&(r=Math.max(r,c.borderWidth||0,c.hoverBorderWidth||0));return r}getMaxOffset(t){let r=0;for(let n=0,s=t.length;n<s;++n){let o=this.resolveDataElementOptions(n);r=Math.max(r,o.offset||0,o.hoverOffset||0)}return r}_getRingWeightOffset(t){let r=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(r+=this._getRingWeight(n));return r}_getRingWeight(t){return Math.max(W(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}return i})(),Uu=(()=>{class i extends ce{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){let r=this._cachedMeta,{dataset:n,data:s=[],_dataset:o}=r,a=this.chart._animationsDisabled,{start:l,count:c}=vn(r,s,a);this._drawStart=l,this._drawCount=c,yn(r)&&(l=0,c=s.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!o._decimated,n.points=s;let u=this.resolveDatasetElementOptions(t);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(n,void 0,{animated:!a,options:u},t),this.updateElements(s,l,c,t)}updateElements(t,r,n,s){let o=s==="reset",{iScale:a,vScale:l,_stacked:c,_dataset:u}=this._cachedMeta,{sharedOptions:f,includeOptions:d}=this._getSharedOptions(r,s),h=a.axis,m=l.axis,{spanGaps:p,segment:g}=this.options,b=ge(p)?p:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||s==="none",w=r+n,k=t.length,v=r>0&&this.getParsed(r-1);for(let _=0;_<k;++_){let P=t[_],C=x?P:{};if(_<r||_>=w){C.skip=!0;continue}let O=this.getParsed(_),R=U(O[m]),z=C[h]=a.getPixelForValue(O[h],_),H=C[m]=o||R?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,O,c):O[m],_);C.skip=isNaN(z)||isNaN(H)||R,C.stop=_>0&&Math.abs(O[h]-v[h])>b,g&&(C.parsed=O,C.raw=u.data[_]),d&&(C.options=f||this.resolveDataElementOptions(_,P.active?"active":s)),x||this.updateElement(P,_,C,s),v=O}}getMaxOverflow(){let t=this._cachedMeta,r=t.dataset,n=r.options&&r.options.borderWidth||0,s=t.data||[];if(!s.length)return n;let o=s[0].size(this.resolveDataElementOptions(0)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(n,o,a)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}return i})(),La=(()=>{class i extends ce{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let r=t.data;if(r.labels.length&&r.datasets.length){let{labels:{pointStyle:n,color:s}}=t.legend.options;return r.labels.map((o,a)=>{let c=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:s,lineWidth:c.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,r,n){n.chart.toggleDataVisibility(r.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,r){super(t,r),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){let r=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=Ne(r._parsed[t].r,n.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,r,n,s){return On.bind(this)(t,r,n,s)}update(t){let r=this._cachedMeta.data;this._updateRadius(),this.updateElements(r,0,r.length,t)}getMinMax(){let t=this._cachedMeta,r={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((n,s)=>{let o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<r.min&&(r.min=o),o>r.max&&(r.max=o))}),r}_updateRadius(){let t=this.chart,r=t.chartArea,n=t.options,s=Math.min(r.right-r.left,r.bottom-r.top),o=Math.max(s/2,0),a=Math.max(n.cutoutPercentage?o/100*n.cutoutPercentage:1,0),l=(o-a)/t.getVisibleDatasetCount();this.outerRadius=o-l*this.index,this.innerRadius=this.outerRadius-l}updateElements(t,r,n,s){let o=s==="reset",a=this.chart,c=a.options.animation,u=this._cachedMeta.rScale,f=u.xCenter,d=u.yCenter,h=u.getIndexAngle(0)-.5*$,m=h,p,g=360/this.countVisibleElements();for(p=0;p<r;++p)m+=this._computeAngle(p,s,g);for(p=r;p<r+n;p++){let b=t[p],x=m,w=m+this._computeAngle(p,s,g),k=a.getDataVisibility(p)?u.getDistanceFromCenterForValue(this.getParsed(p).r):0;m=w,o&&(c.animateScale&&(k=0),c.animateRotate&&(x=w=h));let v={x:f,y:d,innerRadius:0,outerRadius:k,startAngle:x,endAngle:w,options:this.resolveDataElementOptions(p,b.active?"active":s)};this.updateElement(b,p,v,s)}}countVisibleElements(){let t=this._cachedMeta,r=0;return t.data.forEach((n,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&r++}),r}_computeAngle(t,r,n){return this.chart.getDataVisibility(t)?Tt(this.resolveDataElementOptions(t,r).angle||n):0}}return i})(),Vu=(()=>{class i extends ps{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}return i})(),ju=(()=>{class i extends ce{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){let r=this._cachedMeta.vScale,n=this.getParsed(t);return{label:r.getLabels()[t],value:""+r.getLabelForValue(n[r.axis])}}parseObjectData(t,r,n,s){return On.bind(this)(t,r,n,s)}update(t){let r=this._cachedMeta,n=r.dataset,s=r.data||[],o=r.iScale.getLabels();if(n.points=s,t!=="resize"){let a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);let l={_loop:!0,_fullLoop:o.length===s.length,options:a};this.updateElement(n,void 0,l,t)}this.updateElements(s,0,s.length,t)}updateElements(t,r,n,s){let o=this._cachedMeta.rScale,a=s==="reset";for(let l=r;l<r+n;l++){let c=t[l],u=this.resolveDataElementOptions(l,c.active?"active":s),f=o.getPointPositionForValue(l,this.getParsed(l).r),d=a?o.xCenter:f.x,h=a?o.yCenter:f.y,m={x:d,y:h,angle:f.angle,skip:isNaN(d)||isNaN(h),options:u};this.updateElement(c,l,m,s)}}}return i})(),qu=(()=>{class i extends ce{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){let r=this._cachedMeta,n=this.chart.data.labels||[],{xScale:s,yScale:o}=r,a=this.getParsed(t),l=s.getLabelForValue(a.x),c=o.getLabelForValue(a.y);return{label:n[t]||"",value:"("+l+", "+c+")"}}update(t){let r=this._cachedMeta,{data:n=[]}=r,s=this.chart._animationsDisabled,{start:o,count:a}=vn(r,n,s);if(this._drawStart=o,this._drawCount=a,yn(r)&&(o=0,a=n.length),this.options.showLine){this.datasetElementType||this.addElements();let{dataset:l,_dataset:c}=r;l._chart=this.chart,l._datasetIndex=this.index,l._decimated=!!c._decimated,l.points=n;let u=this.resolveDatasetElementOptions(t);u.segment=this.options.segment,this.updateElement(l,void 0,{animated:!s,options:u},t)}else this.datasetElementType&&(delete r.dataset,this.datasetElementType=!1);this.updateElements(n,o,a,t)}addElements(){let{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,r,n,s){let o=s==="reset",{iScale:a,vScale:l,_stacked:c,_dataset:u}=this._cachedMeta,f=this.resolveDataElementOptions(r,s),d=this.getSharedOptions(f),h=this.includeOptions(s,d),m=a.axis,p=l.axis,{spanGaps:g,segment:b}=this.options,x=ge(g)?g:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||o||s==="none",k=r>0&&this.getParsed(r-1);for(let v=r;v<r+n;++v){let _=t[v],P=this.getParsed(v),C=w?_:{},O=U(P[p]),R=C[m]=a.getPixelForValue(P[m],v),z=C[p]=o||O?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,P,c):P[p],v);C.skip=isNaN(R)||isNaN(z)||O,C.stop=v>0&&Math.abs(P[m]-k[m])>x,b&&(C.parsed=P,C.raw=u.data[v]),h&&(C.options=d||this.resolveDataElementOptions(v,_.active?"active":s)),w||this.updateElement(_,v,C,s),k=P}this.updateSharedOptions(d,s,f)}getMaxOverflow(){let t=this._cachedMeta,r=t.data||[];if(!this.options.showLine){let l=0;for(let c=r.length-1;c>=0;--c)l=Math.max(l,r[c].size(this.resolveDataElementOptions(c))/2);return l>0&&l}let n=t.dataset,s=n.options&&n.options.borderWidth||0;if(!r.length)return s;let o=r[0].size(this.resolveDataElementOptions(0)),a=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(s,o,a)/2}}return i})(),$u=Object.freeze({__proto__:null,BarController:Hu,BubbleController:Bu,DoughnutController:ps,LineController:Uu,PieController:Vu,PolarAreaController:La,RadarController:ju,ScatterController:qu});function xe(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var Gn=class i{static override(e){Object.assign(i.prototype,e)}options;constructor(e){this.options=e||{}}init(){}formats(){return xe()}parse(){return xe()}format(){return xe()}add(){return xe()}diff(){return xe()}startOf(){return xe()}endOf(){return xe()}},gs={_date:Gn};function Xu(i,e,t,r){let{controller:n,data:s,_sorted:o}=i,a=n._cachedMeta.iScale,l=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null;if(a&&e===a.axis&&e!=="r"&&o&&s.length){let c=a._reversePixels?lo:Et;if(r){if(n._sharedOptions){let u=s[0],f=typeof u.getRange=="function"&&u.getRange(e);if(f){let d=c(s,e,t-f),h=c(s,e,t+f);return{lo:d.lo,hi:h.hi}}}}else{let u=c(s,e,t);if(l){let{vScale:f}=n._cachedMeta,{_parsed:d}=i,h=d.slice(0,u.lo+1).reverse().findIndex(p=>!U(p[f.axis]));u.lo-=Math.max(0,h);let m=d.slice(u.hi).findIndex(p=>!U(p[f.axis]));u.hi+=Math.max(0,m)}return u}}return{lo:0,hi:s.length-1}}function vi(i,e,t,r,n){let s=i.getSortedVisibleDatasetMetas(),o=t[e];for(let a=0,l=s.length;a<l;++a){let{index:c,data:u}=s[a],{lo:f,hi:d}=Xu(s[a],e,o,n);for(let h=f;h<=d;++h){let m=u[h];m.skip||r(m,c,h)}}}function Qu(i){let e=i.indexOf("x")!==-1,t=i.indexOf("y")!==-1;return function(r,n){let s=e?Math.abs(r.x-n.x):0,o=t?Math.abs(r.y-n.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(o,2))}}function Bn(i,e,t,r,n){let s=[];return!n&&!i.isPointInArea(e)||vi(i,t,e,function(a,l,c){!n&&!Rt(a,i.chartArea,0)||a.inRange(e.x,e.y,r)&&s.push({element:a,datasetIndex:l,index:c})},!0),s}function Gu(i,e,t,r){let n=[];function s(o,a,l){let{startAngle:c,endAngle:u}=o.getProps(["startAngle","endAngle"],r),{angle:f}=mn(o,{x:e.x,y:e.y});ze(f,c,u)&&n.push({element:o,datasetIndex:a,index:l})}return vi(i,t,e,s),n}function Ku(i,e,t,r,n,s){let o=[],a=Qu(t),l=Number.POSITIVE_INFINITY;function c(u,f,d){let h=u.inRange(e.x,e.y,n);if(r&&!h)return;let m=u.getCenterPoint(n);if(!(!!s||i.isPointInArea(m))&&!h)return;let g=a(e,m);g<l?(o=[{element:u,datasetIndex:f,index:d}],l=g):g===l&&o.push({element:u,datasetIndex:f,index:d})}return vi(i,t,e,c),o}function Yn(i,e,t,r,n,s){return!s&&!i.isPointInArea(e)?[]:t==="r"&&!r?Gu(i,e,t,n):Ku(i,e,t,r,n,s)}function Ho(i,e,t,r,n){let s=[],o=t==="x"?"inXRange":"inYRange",a=!1;return vi(i,t,e,(l,c,u)=>{l[o]&&l[o](e[t],n)&&(s.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(e.x,e.y,n))}),r&&!a?[]:s}var Zu={evaluateInteractionItems:vi,modes:{index(i,e,t,r){let n=ae(e,i),s=t.axis||"x",o=t.includeInvisible||!1,a=t.intersect?Bn(i,n,s,r,o):Yn(i,n,s,!1,r,o),l=[];return a.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{let u=a[0].index,f=c.data[u];f&&!f.skip&&l.push({element:f,datasetIndex:c.index,index:u})}),l):[]},dataset(i,e,t,r){let n=ae(e,i),s=t.axis||"xy",o=t.includeInvisible||!1,a=t.intersect?Bn(i,n,s,r,o):Yn(i,n,s,!1,r,o);if(a.length>0){let l=a[0].datasetIndex,c=i.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(i,e,t,r){let n=ae(e,i),s=t.axis||"xy",o=t.includeInvisible||!1;return Bn(i,n,s,r,o)},nearest(i,e,t,r){let n=ae(e,i),s=t.axis||"xy",o=t.includeInvisible||!1;return Yn(i,n,s,t.intersect,r,o)},x(i,e,t,r){let n=ae(e,i);return Ho(i,n,"x",t.intersect,r)},y(i,e,t,r){let n=ae(e,i);return Ho(i,n,"y",t.intersect,r)}}},Ea=["left","top","right","bottom"];function ui(i,e){return i.filter(t=>t.pos===e)}function Bo(i,e){return i.filter(t=>Ea.indexOf(t.pos)===-1&&t.box.axis===e)}function fi(i,e){return i.sort((t,r)=>{let n=e?r:t,s=e?t:r;return n.weight===s.weight?n.index-s.index:n.weight-s.weight})}function Ju(i){let e=[],t,r,n,s,o,a;for(t=0,r=(i||[]).length;t<r;++t)n=i[t],{position:s,options:{stack:o,stackWeight:a=1}}=n,e.push({index:t,box:n,pos:s,horizontal:n.isHorizontal(),weight:n.weight,stack:o&&s+o,stackWeight:a});return e}function tf(i){let e={};for(let t of i){let{stack:r,pos:n,stackWeight:s}=t;if(!r||!Ea.includes(n))continue;let o=e[r]||(e[r]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=s}return e}function ef(i,e){let t=tf(i),{vBoxMaxWidth:r,hBoxMaxHeight:n}=e,s,o,a;for(s=0,o=i.length;s<o;++s){a=i[s];let{fullSize:l}=a.box,c=t[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*r:l&&e.availableWidth,a.height=n):(a.width=r,a.height=u?u*n:l&&e.availableHeight)}return t}function rf(i){let e=Ju(i),t=fi(e.filter(c=>c.box.fullSize),!0),r=fi(ui(e,"left"),!0),n=fi(ui(e,"right")),s=fi(ui(e,"top"),!0),o=fi(ui(e,"bottom")),a=Bo(e,"x"),l=Bo(e,"y");return{fullSize:t,leftAndTop:r.concat(s),rightAndBottom:n.concat(l).concat(o).concat(a),chartArea:ui(e,"chartArea"),vertical:r.concat(n).concat(l),horizontal:s.concat(o).concat(a)}}function Yo(i,e,t,r){return Math.max(i[t],e[t])+Math.max(i[r],e[r])}function Ra(i,e){i.top=Math.max(i.top,e.top),i.left=Math.max(i.left,e.left),i.bottom=Math.max(i.bottom,e.bottom),i.right=Math.max(i.right,e.right)}function nf(i,e,t,r){let{pos:n,box:s}=t,o=i.maxPadding;if(!V(n)){t.size&&(i[n]-=t.size);let f=r[t.stack]||{size:0,count:1};f.size=Math.max(f.size,t.horizontal?s.height:s.width),t.size=f.size/f.count,i[n]+=t.size}s.getPadding&&Ra(o,s.getPadding());let a=Math.max(0,e.outerWidth-Yo(o,i,"left","right")),l=Math.max(0,e.outerHeight-Yo(o,i,"top","bottom")),c=a!==i.w,u=l!==i.h;return i.w=a,i.h=l,t.horizontal?{same:c,other:u}:{same:u,other:c}}function sf(i){let e=i.maxPadding;function t(r){let n=Math.max(e[r]-i[r],0);return i[r]+=n,n}i.y+=t("top"),i.x+=t("left"),t("right"),t("bottom")}function of(i,e){let t=e.maxPadding;function r(n){let s={left:0,top:0,right:0,bottom:0};return n.forEach(o=>{s[o]=Math.max(e[o],t[o])}),s}return r(i?["left","right"]:["top","bottom"])}function mi(i,e,t,r){let n=[],s,o,a,l,c,u;for(s=0,o=i.length,c=0;s<o;++s){a=i[s],l=a.box,l.update(a.width||e.w,a.height||e.h,of(a.horizontal,e));let{same:f,other:d}=nf(e,t,a,r);c|=f&&n.length,u=u||d,l.fullSize||n.push(a)}return c&&mi(n,e,t,r)||u}function tr(i,e,t,r,n){i.top=t,i.left=e,i.right=e+r,i.bottom=t+n,i.width=r,i.height=n}function Uo(i,e,t,r){let n=t.padding,{x:s,y:o}=e;for(let a of i){let l=a.box,c=r[a.stack]||{count:1,placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){let f=e.w*u,d=c.size||l.height;Re(c.start)&&(o=c.start),l.fullSize?tr(l,n.left,o,t.outerWidth-n.right-n.left,d):tr(l,e.left+c.placed,o,f,d),c.start=o,c.placed+=f,o=l.bottom}else{let f=e.h*u,d=c.size||l.width;Re(c.start)&&(s=c.start),l.fullSize?tr(l,s,n.top,d,t.outerHeight-n.bottom-n.top):tr(l,s,e.top+c.placed,d,f),c.start=s,c.placed+=f,s=l.right}}e.x=s,e.y=o}var mt={addBox(i,e){i.boxes||(i.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},i.boxes.push(e)},removeBox(i,e){let t=i.boxes?i.boxes.indexOf(e):-1;t!==-1&&i.boxes.splice(t,1)},configure(i,e,t){e.fullSize=t.fullSize,e.position=t.position,e.weight=t.weight},update(i,e,t,r){if(!i)return;let n=ht(i.options.layout.padding),s=Math.max(e-n.width,0),o=Math.max(t-n.height,0),a=rf(i.boxes),l=a.vertical,c=a.horizontal;Q(i.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});let u=l.reduce((p,g)=>g.box.options&&g.box.options.display===!1?p:p+1,0)||1,f=Object.freeze({outerWidth:e,outerHeight:t,padding:n,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/u,hBoxMaxHeight:o/2}),d=Object.assign({},n);Ra(d,ht(r));let h=Object.assign({maxPadding:d,w:s,h:o,x:n.left,y:n.top},n),m=ef(l.concat(c),f);mi(a.fullSize,h,f,m),mi(l,h,f,m),mi(c,h,f,m)&&mi(l,h,f,m),sf(h),Uo(a.leftAndTop,h,f,m),h.x+=h.w,h.y+=h.h,Uo(a.rightAndBottom,h,f,m),i.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Q(a.chartArea,p=>{let g=p.box;Object.assign(g,i.chartArea),g.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}},cr=class{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,r){}removeEventListener(e,t,r){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,r,n){return t=Math.max(0,t||e.width),r=r||e.height,{width:t,height:Math.max(0,n?Math.floor(t/n):r)}}isAttached(e){return!0}updateConfig(e){}},Kn=class extends cr{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}},or="$chartjs",af={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Vo=i=>i===null||i==="";function lf(i,e){let t=i.style,r=i.getAttribute("height"),n=i.getAttribute("width");if(i[or]={initial:{height:r,width:n,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",Vo(n)){let s=An(i,"width");s!==void 0&&(i.width=s)}if(Vo(r))if(i.style.height==="")i.height=i.width/(e||2);else{let s=An(i,"height");s!==void 0&&(i.height=s)}return i}var Fa=To?{passive:!0}:!1;function cf(i,e,t){i&&i.addEventListener(e,t,Fa)}function uf(i,e,t){i&&i.canvas&&i.canvas.removeEventListener(e,t,Fa)}function ff(i,e){let t=af[i.type]||i.type,{x:r,y:n}=ae(i,e);return{type:t,chart:e,native:i,x:r!==void 0?r:null,y:n!==void 0?n:null}}function ur(i,e){for(let t of i)if(t===e||t.contains(e))return!0}function df(i,e,t){let r=i.canvas,n=new MutationObserver(s=>{let o=!1;for(let a of s)o=o||ur(a.addedNodes,r),o=o&&!ur(a.removedNodes,r);o&&t()});return n.observe(document,{childList:!0,subtree:!0}),n}function hf(i,e,t){let r=i.canvas,n=new MutationObserver(s=>{let o=!1;for(let a of s)o=o||ur(a.removedNodes,r),o=o&&!ur(a.addedNodes,r);o&&t()});return n.observe(document,{childList:!0,subtree:!0}),n}var gi=new Map,jo=0;function za(){let i=window.devicePixelRatio;i!==jo&&(jo=i,gi.forEach((e,t)=>{t.currentDevicePixelRatio!==i&&e()}))}function mf(i,e){gi.size||window.addEventListener("resize",za),gi.set(i,e)}function pf(i){gi.delete(i),gi.size||window.removeEventListener("resize",za)}function gf(i,e,t){let r=i.canvas,n=r&&Zi(r);if(!n)return;let s=xn((a,l)=>{let c=n.clientWidth;t(a,l),c<n.clientWidth&&t()},window),o=new ResizeObserver(a=>{let l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||s(c,u)});return o.observe(n),mf(i,s),o}function Un(i,e,t){t&&t.disconnect(),e==="resize"&&pf(i)}function bf(i,e,t){let r=i.canvas,n=xn(s=>{i.ctx!==null&&t(ff(s,i))},i);return cf(r,e,n),n}var Zn=class extends cr{acquireContext(e,t){let r=e&&e.getContext&&e.getContext("2d");return r&&r.canvas===e?(lf(e,t),r):null}releaseContext(e){let t=e.canvas;if(!t[or])return!1;let r=t[or].initial;["height","width"].forEach(s=>{let o=r[s];U(o)?t.removeAttribute(s):t.setAttribute(s,o)});let n=r.style||{};return Object.keys(n).forEach(s=>{t.style[s]=n[s]}),t.width=t.width,delete t[or],!0}addEventListener(e,t,r){this.removeEventListener(e,t);let n=e.$proxies||(e.$proxies={}),o={attach:df,detach:hf,resize:gf}[t]||bf;n[t]=o(e,t,r)}removeEventListener(e,t){let r=e.$proxies||(e.$proxies={}),n=r[t];if(!n)return;({attach:Un,detach:Un,resize:Un}[t]||uf)(e,t,n),r[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,r,n){return Do(e,t,r,n)}isAttached(e){let t=e&&Zi(e);return!!(t&&t.isConnected)}};function xf(i){return!Ki()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?Kn:Zn}var It=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){let{x:t,y:r}=this.getProps(["x","y"],e);return{x:t,y:r}}hasValue(){return ge(this.x)&&ge(this.y)}getProps(e,t){let r=this.$animations;if(!t||!r)return this;let n={};return e.forEach(s=>{n[s]=r[s]&&r[s].active()?r[s]._to:this[s]}),n}};function vf(i,e){let t=i.options.ticks,r=yf(i),n=Math.min(t.maxTicksLimit||r,r),s=t.major.enabled?wf(e):[],o=s.length,a=s[0],l=s[o-1],c=[];if(o>n)return Mf(e,c,s,o/n),c;let u=_f(s,e,n);if(o>0){let f,d,h=o>1?Math.round((l-a)/(o-1)):null;for(er(e,c,u,U(h)?0:a-h,a),f=0,d=o-1;f<d;f++)er(e,c,u,s[f],s[f+1]);return er(e,c,u,l,U(h)?e.length:l+h),c}return er(e,c,u),c}function yf(i){let e=i.options.offset,t=i._tickSize(),r=i._length/t+(e?0:1),n=i._maxLength/t;return Math.floor(Math.min(r,n))}function _f(i,e,t){let r=kf(i),n=e.length/t;if(!r)return Math.max(n,1);let s=so(r);for(let o=0,a=s.length-1;o<a;o++){let l=s[o];if(l>n)return l}return Math.max(n,1)}function wf(i){let e=[],t,r;for(t=0,r=i.length;t<r;t++)i[t].major&&e.push(t);return e}function Mf(i,e,t,r){let n=0,s=t[0],o;for(r=Math.ceil(r),o=0;o<i.length;o++)o===s&&(e.push(i[o]),n++,s=t[n*r])}function er(i,e,t,r,n){let s=W(r,0),o=Math.min(W(n,i.length),i.length),a=0,l,c,u;for(t=Math.ceil(t),n&&(l=n-r,t=l/Math.floor(l/t)),u=s;u<0;)a++,u=Math.round(s+a*t);for(c=Math.max(s,0);c<o;c++)c===u&&(e.push(i[c]),a++,u=Math.round(s+a*t))}function kf(i){let e=i.length,t,r;if(e<2)return!1;for(r=i[0],t=1;t<e;++t)if(i[t]-i[t-1]!==r)return!1;return r}var Df=i=>i==="left"?"right":i==="right"?"left":i,qo=(i,e,t)=>e==="top"||e==="left"?i[e]+t:i[e]-t,$o=(i,e)=>Math.min(e||i,i);function Xo(i,e){let t=[],r=i.length/e,n=i.length,s=0;for(;s<n;s+=r)t.push(i[Math.floor(s)]);return t}function Tf(i,e,t){let r=i.ticks.length,n=Math.min(e,r-1),s=i._startPixel,o=i._endPixel,a=1e-6,l=i.getPixelForTick(n),c;if(!(t&&(r===1?c=Math.max(l-s,o-l):e===0?c=(i.getPixelForTick(1)-l)/2:c=(l-i.getPixelForTick(n-1))/2,l+=n<e?c:-c,l<s-a||l>o+a)))return l}function Cf(i,e){Q(i,t=>{let r=t.gc,n=r.length/2,s;if(n>e){for(s=0;s<n;++s)delete t.data[r[s]];r.splice(0,n)}})}function di(i){return i.drawTicks?i.tickLength:0}function Qo(i,e){if(!i.display)return 0;let t=ot(i.font,e),r=ht(i.padding);return(tt(i.text)?i.text.length:1)*t.lineHeight+r.height}function Pf(i,e){return qt(i,{scale:e,type:"scale"})}function Of(i,e,t){return qt(i,{tick:t,index:e,type:"tick"})}function Sf(i,e,t){let r=qi(i);return(t&&e!=="right"||!t&&e==="right")&&(r=Df(r)),r}function Af(i,e,t,r){let{top:n,left:s,bottom:o,right:a,chart:l}=i,{chartArea:c,scales:u}=l,f=0,d,h,m,p=o-n,g=a-s;if(i.isHorizontal()){if(h=dt(r,s,a),V(t)){let b=Object.keys(t)[0],x=t[b];m=u[b].getPixelForValue(x)+p-e}else t==="center"?m=(c.bottom+c.top)/2+p-e:m=qo(i,t,e);d=a-s}else{if(V(t)){let b=Object.keys(t)[0],x=t[b];h=u[b].getPixelForValue(x)-g+e}else t==="center"?h=(c.left+c.right)/2-g+e:h=qo(i,t,e);m=dt(r,o,n),f=t==="left"?-st:st}return{titleX:h,titleY:m,maxWidth:d,rotation:f}}var ye=class i extends It{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:r,_suggestedMax:n}=this;return e=bt(e,Number.POSITIVE_INFINITY),t=bt(t,Number.NEGATIVE_INFINITY),r=bt(r,Number.POSITIVE_INFINITY),n=bt(n,Number.NEGATIVE_INFINITY),{min:bt(e,r),max:bt(t,n),minDefined:nt(e),maxDefined:nt(t)}}getMinMax(e){let{min:t,max:r,minDefined:n,maxDefined:s}=this.getUserBounds(),o;if(n&&s)return{min:t,max:r};let a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)o=a[l].controller.getMinMax(this,e),n||(t=Math.min(t,o.min)),s||(r=Math.max(r,o.max));return t=s&&t>r?r:t,r=n&&t>r?t:r,{min:bt(t,bt(r,t)),max:bt(r,bt(t,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Z(this.options.beforeUpdate,[this])}update(e,t,r){let{beginAtZero:n,grace:s,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=vo(this,s,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=a<this.ticks.length;this._convertTicksToLabels(l?Xo(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=vf(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,t,r;this.isHorizontal()?(t=this.left,r=this.right):(t=this.top,r=this.bottom,e=!e),this._startPixel=t,this._endPixel=r,this._reversePixels=e,this._length=r-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Z(this.options.afterUpdate,[this])}beforeSetDimensions(){Z(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){Z(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),Z(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Z(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){let t=this.options.ticks,r,n,s;for(r=0,n=e.length;r<n;r++)s=e[r],s.label=Z(t.callback,[s.value,r,e],this)}afterTickToLabelConversion(){Z(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Z(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let e=this.options,t=e.ticks,r=$o(this.ticks.length,e.ticks.maxTicksLimit),n=t.minRotation||0,s=t.maxRotation,o=n,a,l,c;if(!this._isVisible()||!t.display||n>=s||r<=1||!this.isHorizontal()){this.labelRotation=n;return}let u=this._getLabelSizes(),f=u.widest.width,d=u.highest.height,h=lt(this.chart.width-f,0,this.maxWidth);a=e.offset?this.maxWidth/r:h/(r-1),f+6>a&&(a=h/(r-(e.offset?.5:1)),l=this.maxHeight-di(e.grid)-t.padding-Qo(e.title,this.chart.options.font),c=Math.sqrt(f*f+d*d),o=Vi(Math.min(Math.asin(lt((u.highest.height+6)/a,-1,1)),Math.asin(lt(l/c,-1,1))-Math.asin(lt(d/c,-1,1)))),o=Math.max(n,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){Z(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Z(this.options.beforeFit,[this])}fit(){let e={width:0,height:0},{chart:t,options:{ticks:r,title:n,grid:s}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){let l=Qo(n,t.options.font);if(a?(e.width=this.maxWidth,e.height=di(s)+l):(e.height=this.maxHeight,e.width=di(s)+l),r.display&&this.ticks.length){let{first:c,last:u,widest:f,highest:d}=this._getLabelSizes(),h=r.padding*2,m=Tt(this.labelRotation),p=Math.cos(m),g=Math.sin(m);if(a){let b=r.mirror?0:g*f.width+p*d.height;e.height=Math.min(this.maxHeight,e.height+b+h)}else{let b=r.mirror?0:p*f.width+g*d.height;e.width=Math.min(this.maxWidth,e.width+b+h)}this._calculatePadding(c,u,g,p)}}this._handleMargins(),a?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,r,n){let{ticks:{align:s,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){let u=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1),d=0,h=0;l?c?(d=n*e.width,h=r*t.height):(d=r*e.height,h=n*t.width):s==="start"?h=t.width:s==="end"?d=e.width:s!=="inner"&&(d=e.width/2,h=t.width/2),this.paddingLeft=Math.max((d-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-f+o)*this.width/(this.width-f),0)}else{let u=t.height/2,f=e.height/2;s==="start"?(u=0,f=e.height):s==="end"&&(u=t.height,f=0),this.paddingTop=u+o,this.paddingBottom=f+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Z(this.options.afterFit,[this])}isHorizontal(){let{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,r;for(t=0,r=e.length;t<r;t++)U(e[t].label)&&(e.splice(t,1),r--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){let t=this.options.ticks.sampleSize,r=this.ticks;t<r.length&&(r=Xo(r,t)),this._labelSizes=e=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,t,r){let{ctx:n,_longestTextCache:s}=this,o=[],a=[],l=Math.floor(t/$o(t,r)),c=0,u=0,f,d,h,m,p,g,b,x,w,k,v;for(f=0;f<t;f+=l){if(m=e[f].label,p=this._resolveTickFontOptions(f),n.font=g=p.string,b=s[g]=s[g]||{data:{},gc:[]},x=p.lineHeight,w=k=0,!U(m)&&!tt(m))w=ni(n,b.data,b.gc,w,m),k=x;else if(tt(m))for(d=0,h=m.length;d<h;++d)v=m[d],!U(v)&&!tt(v)&&(w=ni(n,b.data,b.gc,w,v),k+=x);o.push(w),a.push(k),c=Math.max(w,c),u=Math.max(k,u)}Cf(s,t);let _=o.indexOf(c),P=a.indexOf(u),C=O=>({width:o[O]||0,height:a[O]||0});return{first:C(0),last:C(t-1),widest:C(_),highest:C(P),widths:o,heights:a}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){let t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);let t=this._startPixel+e*this._length;return ao(this._alignToPixels?ne(this.chart,t,0):t)}getDecimalForPixel(e){let t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){let t=this.ticks||[];if(e>=0&&e<t.length){let r=t[e];return r.$context||(r.$context=Of(this.getContext(),e,r))}return this.$context||(this.$context=Pf(this.chart.getContext(),this))}_tickSize(){let e=this.options.ticks,t=Tt(this.labelRotation),r=Math.abs(Math.cos(t)),n=Math.abs(Math.sin(t)),s=this._getLabelSizes(),o=e.autoSkipPadding||0,a=s?s.widest.width+o:0,l=s?s.highest.height+o:0;return this.isHorizontal()?l*r>a*n?a/r:l/n:l*n<a*r?l/r:a/n}_isVisible(){let e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){let t=this.axis,r=this.chart,n=this.options,{grid:s,position:o,border:a}=n,l=s.offset,c=this.isHorizontal(),f=this.ticks.length+(l?1:0),d=di(s),h=[],m=a.setContext(this.getContext()),p=m.display?m.width:0,g=p/2,b=function(Y){return ne(r,Y,p)},x,w,k,v,_,P,C,O,R,z,H,rt;if(o==="top")x=b(this.bottom),P=this.bottom-d,O=x-g,z=b(e.top)+g,rt=e.bottom;else if(o==="bottom")x=b(this.top),z=e.top,rt=b(e.bottom)-g,P=x+g,O=this.top+d;else if(o==="left")x=b(this.right),_=this.right-d,C=x-g,R=b(e.left)+g,H=e.right;else if(o==="right")x=b(this.left),R=e.left,H=b(e.right)-g,_=x+g,C=this.left+d;else if(t==="x"){if(o==="center")x=b((e.top+e.bottom)/2+.5);else if(V(o)){let Y=Object.keys(o)[0],G=o[Y];x=b(this.chart.scales[Y].getPixelForValue(G))}z=e.top,rt=e.bottom,P=x+g,O=P+d}else if(t==="y"){if(o==="center")x=b((e.left+e.right)/2);else if(V(o)){let Y=Object.keys(o)[0],G=o[Y];x=b(this.chart.scales[Y].getPixelForValue(G))}_=x-g,C=_-d,R=e.left,H=e.right}let ut=W(n.ticks.maxTicksLimit,f),N=Math.max(1,Math.ceil(f/ut));for(w=0;w<f;w+=N){let Y=this.getContext(w),G=s.setContext(Y),yt=a.setContext(Y),at=G.lineWidth,Gt=G.color,Kt=yt.dash||[],wt=yt.dashOffset,Zt=G.tickWidth,Mt=G.tickColor,Jt=G.tickBorderDash||[],Lt=G.tickBorderDashOffset;k=Tf(this,w,l),k!==void 0&&(v=ne(r,k,at),c?_=C=R=H=v:P=O=z=rt=v,h.push({tx1:_,ty1:P,tx2:C,ty2:O,x1:R,y1:z,x2:H,y2:rt,width:at,color:Gt,borderDash:Kt,borderDashOffset:wt,tickWidth:Zt,tickColor:Mt,tickBorderDash:Jt,tickBorderDashOffset:Lt}))}return this._ticksLength=f,this._borderValue=x,h}_computeLabelItems(e){let t=this.axis,r=this.options,{position:n,ticks:s}=r,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:f}=s,d=di(r.grid),h=d+u,m=f?-u:h,p=-Tt(this.labelRotation),g=[],b,x,w,k,v,_,P,C,O,R,z,H,rt="middle";if(n==="top")_=this.bottom-m,P=this._getXAxisLabelAlignment();else if(n==="bottom")_=this.top+m,P=this._getXAxisLabelAlignment();else if(n==="left"){let N=this._getYAxisLabelAlignment(d);P=N.textAlign,v=N.x}else if(n==="right"){let N=this._getYAxisLabelAlignment(d);P=N.textAlign,v=N.x}else if(t==="x"){if(n==="center")_=(e.top+e.bottom)/2+h;else if(V(n)){let N=Object.keys(n)[0],Y=n[N];_=this.chart.scales[N].getPixelForValue(Y)+h}P=this._getXAxisLabelAlignment()}else if(t==="y"){if(n==="center")v=(e.left+e.right)/2-h;else if(V(n)){let N=Object.keys(n)[0],Y=n[N];v=this.chart.scales[N].getPixelForValue(Y)}P=this._getYAxisLabelAlignment(d).textAlign}t==="y"&&(l==="start"?rt="top":l==="end"&&(rt="bottom"));let ut=this._getLabelSizes();for(b=0,x=a.length;b<x;++b){w=a[b],k=w.label;let N=s.setContext(this.getContext(b));C=this.getPixelForTick(b)+s.labelOffset,O=this._resolveTickFontOptions(b),R=O.lineHeight,z=tt(k)?k.length:1;let Y=z/2,G=N.color,yt=N.textStrokeColor,at=N.textStrokeWidth,Gt=P;o?(v=C,P==="inner"&&(b===x-1?Gt=this.options.reverse?"left":"right":b===0?Gt=this.options.reverse?"right":"left":Gt="center"),n==="top"?c==="near"||p!==0?H=-z*R+R/2:c==="center"?H=-ut.highest.height/2-Y*R+R:H=-ut.highest.height+R/2:c==="near"||p!==0?H=R/2:c==="center"?H=ut.highest.height/2-Y*R:H=ut.highest.height-z*R,f&&(H*=-1),p!==0&&!N.showLabelBackdrop&&(v+=R/2*Math.sin(p))):(_=C,H=(1-z)*R/2);let Kt;if(N.showLabelBackdrop){let wt=ht(N.backdropPadding),Zt=ut.heights[b],Mt=ut.widths[b],Jt=H-wt.top,Lt=0-wt.left;switch(rt){case"middle":Jt-=Zt/2;break;case"bottom":Jt-=Zt;break}switch(P){case"center":Lt-=Mt/2;break;case"right":Lt-=Mt;break;case"inner":b===x-1?Lt-=Mt:b>0&&(Lt-=Mt/2);break}Kt={left:Lt,top:Jt,width:Mt+wt.width,height:Zt+wt.height,color:N.backdropColor}}g.push({label:k,font:O,textOffset:H,options:{rotation:p,color:G,strokeColor:yt,strokeWidth:at,textAlign:Gt,textBaseline:rt,translation:[v,_],backdrop:Kt}})}return g}_getXAxisLabelAlignment(){let{position:e,ticks:t}=this.options;if(-Tt(this.labelRotation))return e==="top"?"left":"right";let n="center";return t.align==="start"?n="left":t.align==="end"?n="right":t.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(e){let{position:t,ticks:{crossAlign:r,mirror:n,padding:s}}=this.options,o=this._getLabelSizes(),a=e+s,l=o.widest.width,c,u;return t==="left"?n?(u=this.right+s,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):t==="right"?n?(u=this.left+s,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;let e=this.chart,t=this.options.position;if(t==="left"||t==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(t==="top"||t==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){let{ctx:e,options:{backgroundColor:t},left:r,top:n,width:s,height:o}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(r,n,s,o),e.restore())}getLineWidthForValue(e){let t=this.options.grid;if(!this._isVisible()||!t.display)return 0;let n=this.ticks.findIndex(s=>s.value===e);return n>=0?t.setContext(this.getContext(n)).lineWidth:0}drawGrid(e){let t=this.options.grid,r=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e)),s,o,a=(l,c,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(t.display)for(s=0,o=n.length;s<o;++s){let l=n[s];t.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),t.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){let{chart:e,ctx:t,options:{border:r,grid:n}}=this,s=r.setContext(this.getContext()),o=r.display?s.width:0;if(!o)return;let a=n.setContext(this.getContext(0)).lineWidth,l=this._borderValue,c,u,f,d;this.isHorizontal()?(c=ne(e,this.left,o)-o/2,u=ne(e,this.right,a)+a/2,f=d=l):(f=ne(e,this.top,o)-o/2,d=ne(e,this.bottom,a)+a/2,c=u=l),t.save(),t.lineWidth=s.width,t.strokeStyle=s.color,t.beginPath(),t.moveTo(c,f),t.lineTo(u,d),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;let r=this.ctx,n=this._computeLabelArea();n&&ai(r,n);let s=this.getLabelItems(e);for(let o of s){let a=o.options,l=o.font,c=o.label,u=o.textOffset;se(r,c,0,u,l,a)}n&&li(r)}drawTitle(){let{ctx:e,options:{position:t,title:r,reverse:n}}=this;if(!r.display)return;let s=ot(r.font),o=ht(r.padding),a=r.align,l=s.lineHeight/2;t==="bottom"||t==="center"||V(t)?(l+=o.bottom,tt(r.text)&&(l+=s.lineHeight*(r.text.length-1))):l+=o.top;let{titleX:c,titleY:u,maxWidth:f,rotation:d}=Af(this,l,t,a);se(e,r.text,0,0,s,{color:r.color,maxWidth:f,rotation:d,textAlign:Sf(a,t,n),textBaseline:"middle",translation:[c,u]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){let e=this.options,t=e.ticks&&e.ticks.z||0,r=W(e.grid&&e.grid.z,-1),n=W(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==i.prototype.draw?[{z:t,draw:s=>{this.draw(s)}}]:[{z:r,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:t,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){let t=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",n=[],s,o;for(s=0,o=t.length;s<o;++s){let a=t[s];a[r]===this.id&&(!e||a.type===e)&&n.push(a)}return n}_resolveTickFontOptions(e){let t=this.options.ticks.setContext(this.getContext(e));return ot(t.font)}_maxDigits(){let e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}},Ye=class{constructor(e,t,r){this.type=e,this.scope=t,this.override=r,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){let t=Object.getPrototypeOf(e),r;Ef(t)&&(r=this.register(t));let n=this.items,s=e.id,o=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+e);return s in n||(n[s]=e,If(e,o,r),this.override&&it.override(e.id,e.overrides)),o}get(e){return this.items[e]}unregister(e){let t=this.items,r=e.id,n=this.scope;r in t&&delete t[r],n&&r in it[n]&&(delete it[n][r],this.override&&delete re[r])}};function If(i,e,t){let r=Ie(Object.create(null),[t?it.get(t):{},it.get(e),i.defaults]);it.set(e,r),i.defaultRoutes&&Lf(e,i.defaultRoutes),i.descriptors&&it.describe(e,i.descriptors)}function Lf(i,e){Object.keys(e).forEach(t=>{let r=t.split("."),n=r.pop(),s=[i].concat(r).join("."),o=e[t].split("."),a=o.pop(),l=o.join(".");it.route(s,n,l,a)})}function Ef(i){return"id"in i&&"defaults"in i}var Jn=class{constructor(){this.controllers=new Ye(ce,"datasets",!0),this.elements=new Ye(It,"elements"),this.plugins=new Ye(Object,"plugins"),this.scales=new Ye(ye,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,r){[...t].forEach(n=>{let s=r||this._getRegistryForType(n);r||s.isForType(n)||s===this.plugins&&n.id?this._exec(e,s,n):Q(n,o=>{let a=r||this._getRegistryForType(o);this._exec(e,a,o)})})}_exec(e,t,r){let n=Ui(e);Z(r["before"+n],[],r),t[e](r),Z(r["after"+n],[],r)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){let r=this._typedRegistries[t];if(r.isForType(e))return r}return this.plugins}_get(e,t,r){let n=t.get(e);if(n===void 0)throw new Error('"'+e+'" is not a registered '+r+".");return n}},Wt=new Jn,ts=class{constructor(){this._init=[]}notify(e,t,r,n){t==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));let s=n?this._descriptors(e).filter(n):this._descriptors(e),o=this._notify(s,e,t,r);return t==="afterDestroy"&&(this._notify(s,e,"stop"),this._notify(this._init,e,"uninstall")),o}_notify(e,t,r,n){n=n||{};for(let s of e){let o=s.plugin,a=o[r],l=[t,n,s.options];if(Z(a,l,o)===!1&&n.cancelable)return!1}return!0}invalidate(){U(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;let t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){let r=e&&e.config,n=W(r.options&&r.options.plugins,{}),s=Rf(r);return n===!1&&!t?[]:zf(e,s,n,t)}_notifyStateChanges(e){let t=this._oldCache||[],r=this._cache,n=(s,o)=>s.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(n(t,r),e,"stop"),this._notify(n(r,t),e,"start")}};function Rf(i){let e={},t=[],r=Object.keys(Wt.plugins.items);for(let s=0;s<r.length;s++)t.push(Wt.getPlugin(r[s]));let n=i.plugins||[];for(let s=0;s<n.length;s++){let o=n[s];t.indexOf(o)===-1&&(t.push(o),e[o.id]=!0)}return{plugins:t,localIds:e}}function Ff(i,e){return!e&&i===!1?null:i===!0?{}:i}function zf(i,{plugins:e,localIds:t},r,n){let s=[],o=i.getContext();for(let a of e){let l=a.id,c=Ff(r[l],n);c!==null&&s.push({plugin:a,options:Nf(i.config,{plugin:a,local:t[l]},c,o)})}return s}function Nf(i,{plugin:e,local:t},r,n){let s=i.pluginScopeKeys(e),o=i.getOptionScopes(r,s);return t&&e.defaults&&o.push(e.defaults),i.createResolver(o,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function es(i,e){let t=it.datasets[i]||{};return((e.datasets||{})[i]||{}).indexAxis||e.indexAxis||t.indexAxis||"x"}function Wf(i,e){let t=i;return i==="_index_"?t=e:i==="_value_"&&(t=e==="x"?"y":"x"),t}function Hf(i,e){return i===e?"_index_":"_value_"}function Go(i){if(i==="x"||i==="y"||i==="r")return i}function Bf(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function is(i,...e){if(Go(i))return i;for(let t of e){let r=t.axis||Bf(t.position)||i.length>1&&Go(i[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function Ko(i,e,t){if(t[e+"AxisID"]===i)return{axis:e}}function Yf(i,e){if(e.data&&e.data.datasets){let t=e.data.datasets.filter(r=>r.xAxisID===i||r.yAxisID===i);if(t.length)return Ko(i,"x",t[0])||Ko(i,"y",t[0])}return{}}function Uf(i,e){let t=re[i.type]||{scales:{}},r=e.scales||{},n=es(i.type,e),s=Object.create(null);return Object.keys(r).forEach(o=>{let a=r[o];if(!V(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);let l=is(o,a,Yf(o,i),it.scales[a.type]),c=Hf(l,n),u=t.scales||{};s[o]=Ee(Object.create(null),[{axis:l},a,u[l],u[c]])}),i.data.datasets.forEach(o=>{let a=o.type||i.type,l=o.indexAxis||es(a,e),u=(re[a]||{}).scales||{};Object.keys(u).forEach(f=>{let d=Wf(f,l),h=o[d+"AxisID"]||d;s[h]=s[h]||Object.create(null),Ee(s[h],[{axis:d},r[h],u[f]])})}),Object.keys(s).forEach(o=>{let a=s[o];Ee(a,[it.scales[a.type],it.scale])}),s}function Na(i){let e=i.options||(i.options={});e.plugins=W(e.plugins,{}),e.scales=Uf(i,e)}function Wa(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function Vf(i){return i=i||{},i.data=Wa(i.data),Na(i),i}var Zo=new Map,Ha=new Set;function ir(i,e){let t=Zo.get(i);return t||(t=e(),Zo.set(i,t),Ha.add(t)),t}var hi=(i,e,t)=>{let r=jt(e,t);r!==void 0&&i.add(r)},rs=class{constructor(e){this._config=Vf(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=Wa(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){let e=this._config;this.clearCache(),Na(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return ir(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return ir(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return ir(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){let t=e.id,r=this.type;return ir(`${r}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){let r=this._scopeCache,n=r.get(e);return(!n||t)&&(n=new Map,r.set(e,n)),n}getOptionScopes(e,t,r){let{options:n,type:s}=this,o=this._cachedScopes(e,r),a=o.get(t);if(a)return a;let l=new Set;t.forEach(u=>{e&&(l.add(e),u.forEach(f=>hi(l,e,f))),u.forEach(f=>hi(l,n,f)),u.forEach(f=>hi(l,re[s]||{},f)),u.forEach(f=>hi(l,it,f)),u.forEach(f=>hi(l,$i,f))});let c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Ha.has(t)&&o.set(t,c),c}chartOptionScopes(){let{options:e,type:t}=this;return[e,re[t]||{},it.datasets[t]||{},{type:t},it,$i]}resolveNamedOptions(e,t,r,n=[""]){let s={$shared:!0},{resolver:o,subPrefixes:a}=Jo(this._resolverCache,e,n),l=o;if(qf(o,t)){s.$shared=!1,r=Ut(r)?r():r;let c=this.createResolver(e,r,a);l=pe(o,r,c)}for(let c of t)s[c]=l[c];return s}createResolver(e,t,r=[""],n){let{resolver:s}=Jo(this._resolverCache,e,r);return V(t)?pe(s,t,void 0,n):s}};function Jo(i,e,t){let r=i.get(e);r||(r=new Map,i.set(e,r));let n=t.join(),s=r.get(n);return s||(s={resolver:Gi(e,t),subPrefixes:t.filter(a=>!a.toLowerCase().includes("hover"))},r.set(n,s)),s}var jf=i=>V(i)&&Object.getOwnPropertyNames(i).some(e=>Ut(i[e]));function qf(i,e){let{isScriptable:t,isIndexable:r}=Tn(i);for(let n of e){let s=t(n),o=r(n),a=(o||s)&&i[n];if(s&&(Ut(a)||jf(a))||o&&tt(a))return!0}return!1}var $f="4.5.0",Xf=["top","bottom","left","right","chartArea"];function ta(i,e){return i==="top"||i==="bottom"||Xf.indexOf(i)===-1&&e==="x"}function ea(i,e){return function(t,r){return t[i]===r[i]?t[e]-r[e]:t[i]-r[i]}}function ia(i){let e=i.chart,t=e.options.animation;e.notifyPlugins("afterRender"),Z(t&&t.onComplete,[i],e)}function Qf(i){let e=i.chart,t=e.options.animation;Z(t&&t.onProgress,[i],e)}function Ba(i){return Ki()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}var ar={},ra=i=>{let e=Ba(i);return Object.values(ar).filter(t=>t.canvas===e).pop()};function Gf(i,e,t){let r=Object.keys(i);for(let n of r){let s=+n;if(s>=e){let o=i[n];delete i[n],(t>0||s>e)&&(i[s+t]=o)}}}function Kf(i,e,t,r){return!t||i.type==="mouseout"?null:r?e:i}var Zf=(()=>{class i{static defaults=it;static instances=ar;static overrides=re;static registry=Wt;static version=$f;static getChart=ra;static register(...t){Wt.add(...t),na()}static unregister(...t){Wt.remove(...t),na()}constructor(t,r){let n=this.config=new rs(r),s=Ba(t),o=ra(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");let a=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||xf(s)),this.platform.updateConfig(n);let l=this.platform.acquireContext(s,a.aspectRatio),c=l&&l.canvas,u=c&&c.height,f=c&&c.width;if(this.id=eo(),this.ctx=l,this.canvas=c,this.width=f,this.height=u,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new ts,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=ho(d=>this.update(d),a.resizeDelay||0),this._dataChanges=[],ar[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}$t.listen(this,"complete",ia),$t.listen(this,"progress",Qf),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:r},width:n,height:s,_aspectRatio:o}=this;return U(t)?r&&o?o:s?n/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Wt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Sn(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Mn(this.canvas,this.ctx),this}stop(){return $t.stop(this),this}resize(t,r){$t.running(this)?this._resizeBeforeDraw={width:t,height:r}:this._resize(t,r)}_resize(t,r){let n=this.options,s=this.canvas,o=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,t,r,o),l=n.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Sn(this,l,!0)&&(this.notifyPlugins("resize",{size:a}),Z(n.onResize,[this,a],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){let r=this.options.scales||{};Q(r,(n,s)=>{n.id=s})}buildOrUpdateScales(){let t=this.options,r=t.scales,n=this.scales,s=Object.keys(n).reduce((a,l)=>(a[l]=!1,a),{}),o=[];r&&(o=o.concat(Object.keys(r).map(a=>{let l=r[a],c=is(a,l),u=c==="r",f=c==="x";return{options:l,dposition:u?"chartArea":f?"bottom":"left",dtype:u?"radialLinear":f?"category":"linear"}}))),Q(o,a=>{let l=a.options,c=l.id,u=is(c,l),f=W(l.type,a.dtype);(l.position===void 0||ta(l.position,u)!==ta(a.dposition))&&(l.position=a.dposition),s[c]=!0;let d=null;if(c in n&&n[c].type===f)d=n[c];else{let h=Wt.getScale(f);d=new h({id:c,type:f,ctx:this.ctx,chart:this}),n[d.id]=d}d.init(l,t)}),Q(s,(a,l)=>{a||delete n[l]}),Q(n,a=>{mt.configure(this,a,a.options),mt.addBox(this,a)})}_updateMetasets(){let t=this._metasets,r=this.data.datasets.length,n=t.length;if(t.sort((s,o)=>s.index-o.index),n>r){for(let s=r;s<n;++s)this._destroyDatasetMeta(s);t.splice(r,n-r)}this._sortedMetasets=t.slice(0).sort(ea("order","index"))}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:r}}=this;t.length>r.length&&delete this._stacks,t.forEach((n,s)=>{r.filter(o=>o===n._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){let t=[],r=this.data.datasets,n,s;for(this._removeUnreferencedMetasets(),n=0,s=r.length;n<s;n++){let o=r[n],a=this.getDatasetMeta(n),l=o.type||this.config.type;if(a.type&&a.type!==l&&(this._destroyDatasetMeta(n),a=this.getDatasetMeta(n)),a.type=l,a.indexAxis=o.indexAxis||es(l,this.options),a.order=o.order||0,a.index=n,a.label=""+o.label,a.visible=this.isDatasetVisible(n),a.controller)a.controller.updateIndex(n),a.controller.linkScales();else{let c=Wt.getController(l),{datasetElementType:u,dataElementType:f}=it.datasets[l];Object.assign(c,{dataElementType:Wt.getElement(f),datasetElementType:u&&Wt.getElement(u)}),a.controller=new c(this,n),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){Q(this.data.datasets,(t,r)=>{this.getDatasetMeta(r).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let r=this.config;r.update();let n=this._options=r.createResolver(r.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;let o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let u=0,f=this.data.datasets.length;u<f;u++){let{controller:d}=this.getDatasetMeta(u),h=!s&&o.indexOf(d)===-1;d.buildOrUpdateElements(h),a=Math.max(+d.getMaxOverflow(),a)}a=this._minPadding=n.layout.autoPadding?a:0,this._updateLayout(a),s||Q(o,u=>{u.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(ea("z","_idx"));let{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Q(this.scales,t=>{mt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,r=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!un(r,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,r=this._getUniformDataChanges()||[];for(let{method:n,start:s,count:o}of r){let a=n==="_removeElements"?-o:o;Gf(t,s,a)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let r=this.data.datasets.length,n=o=>new Set(t.filter(a=>a[0]===o).map((a,l)=>l+","+a.splice(1).join(","))),s=n(0);for(let o=1;o<r;o++)if(!un(s,n(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;mt.update(this,this.width,this.height,t);let r=this.chartArea,n=r.width<=0||r.height<=0;this._layers=[],Q(this.boxes,s=>{n&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let r=0,n=this.data.datasets.length;r<n;++r)this.getDatasetMeta(r).controller.configure();for(let r=0,n=this.data.datasets.length;r<n;++r)this._updateDataset(r,Ut(t)?t({datasetIndex:r}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,r){let n=this.getDatasetMeta(t),s={meta:n,index:t,mode:r,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(n.controller._update(r),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&($t.has(this)?this.attached&&!$t.running(this)&&$t.start(this):(this.draw(),ia({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){let{width:n,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(n,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;let r=this._layers;for(t=0;t<r.length&&r[t].z<=0;++t)r[t].draw(this.chartArea);for(this._drawDatasets();t<r.length;++t)r[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){let r=this._sortedMetasets,n=[],s,o;for(s=0,o=r.length;s<o;++s){let a=r[s];(!t||a.visible)&&n.push(a)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;let t=this.getSortedVisibleDatasetMetas();for(let r=t.length-1;r>=0;--r)this._drawDataset(t[r]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let r=this.ctx,n={meta:t,index:t.index,cancelable:!0},s=Fn(this,t);this.notifyPlugins("beforeDatasetDraw",n)!==!1&&(s&&ai(r,s),t.controller.draw(),s&&li(r),n.cancelable=!1,this.notifyPlugins("afterDatasetDraw",n))}isPointInArea(t){return Rt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,r,n,s){let o=Zu.modes[r];return typeof o=="function"?o(this,t,n,s):[]}getDatasetMeta(t){let r=this.data.datasets[t],n=this._metasets,s=n.filter(o=>o&&o._dataset===r).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:r&&r.order||0,index:t,_dataset:r,_parsed:[],_sorted:!1},n.push(s)),s}getContext(){return this.$context||(this.$context=qt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let r=this.data.datasets[t];if(!r)return!1;let n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!r.hidden}setDatasetVisibility(t,r){let n=this.getDatasetMeta(t);n.hidden=!r}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,r,n){let s=n?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,s);Re(r)?(o.data[r].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),a.update(o,{visible:n}),this.update(l=>l.datasetIndex===t?s:void 0))}hide(t,r){this._updateVisibility(t,r,!1)}show(t,r){this._updateVisibility(t,r,!0)}_destroyDatasetMeta(t){let r=this._metasets[t];r&&r.controller&&r.controller._destroy(),delete this._metasets[t]}_stop(){let t,r;for(this.stop(),$t.remove(this),t=0,r=this.data.datasets.length;t<r;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:r}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Mn(t,r),this.platform.releaseContext(r),this.canvas=null,this.ctx=null),delete ar[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let t=this._listeners,r=this.platform,n=(o,a)=>{r.addEventListener(this,o,a),t[o]=a},s=(o,a,l)=>{o.offsetX=a,o.offsetY=l,this._eventHandler(o)};Q(this.options.events,o=>n(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,r=this.platform,n=(c,u)=>{r.addEventListener(this,c,u),t[c]=u},s=(c,u)=>{t[c]&&(r.removeEventListener(this,c,u),delete t[c])},o=(c,u)=>{this.canvas&&this.resize(c,u)},a,l=()=>{s("attach",l),this.attached=!0,this.resize(),n("resize",o),n("detach",a)};a=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),n("attach",l)},r.isAttached(this.canvas)?l():a()}unbindEvents(){Q(this._listeners,(t,r)=>{this.platform.removeEventListener(this,r,t)}),this._listeners={},Q(this._responsiveListeners,(t,r)=>{this.platform.removeEventListener(this,r,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,r,n){let s=n?"set":"remove",o,a,l,c;for(r==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),l=0,c=t.length;l<c;++l){a=t[l];let u=a&&this.getDatasetMeta(a.datasetIndex).controller;u&&u[s+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){let r=this._active||[],n=t.map(({datasetIndex:o,index:a})=>{let l=this.getDatasetMeta(o);if(!l)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:l.data[a],index:a}});!si(n,r)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,r))}notifyPlugins(t,r,n){return this._plugins.notify(this,t,r,n)}isPluginEnabled(t){return this._plugins._cache.filter(r=>r.plugin.id===t).length===1}_updateHoverStyles(t,r,n){let s=this.options.hover,o=(c,u)=>c.filter(f=>!u.some(d=>f.datasetIndex===d.datasetIndex&&f.index===d.index)),a=o(r,t),l=n?t:o(t,r);a.length&&this.updateHoverStyle(a,s.mode,!1),l.length&&s.mode&&this.updateHoverStyle(l,s.mode,!0)}_eventHandler(t,r){let n={event:t,replay:r,cancelable:!0,inChartArea:this.isPointInArea(t)},s=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",n,s)===!1)return;let o=this._handleEvent(t,r,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,s),(o||n.changed)&&this.render(),this}_handleEvent(t,r,n){let{_active:s=[],options:o}=this,a=r,l=this._getActiveElements(t,s,n,a),c=no(t),u=Kf(t,this._lastEvent,n,c);n&&(this._lastEvent=null,Z(o.onHover,[t,l,this],this),c&&Z(o.onClick,[t,l,this],this));let f=!si(l,s);return(f||r)&&(this._active=l,this._updateHoverStyles(l,s,r)),this._lastEvent=u,f}_getActiveElements(t,r,n,s){if(t.type==="mouseout")return[];if(!n)return r;let o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}}return i})();function na(){return Q(Zf.instances,i=>i._plugins.invalidate())}function Jf(i,e,t){let{startAngle:r,x:n,y:s,outerRadius:o,innerRadius:a,options:l}=e,{borderWidth:c,borderJoinStyle:u}=l,f=Math.min(c/o,ft(r-t));if(i.beginPath(),i.arc(n,s,o-c/2,r+f/2,t-f/2),a>0){let d=Math.min(c/a,ft(r-t));i.arc(n,s,a+c/2,t-d/2,r+d/2,!0)}else{let d=Math.min(c/2,o*ft(r-t));if(u==="round")i.arc(n,s,d,t-$/2,r+$/2,!0);else if(u==="bevel"){let h=2*d*d,m=-h*Math.cos(t+$/2)+n,p=-h*Math.sin(t+$/2)+s,g=h*Math.cos(r+$/2)+n,b=h*Math.sin(r+$/2)+s;i.lineTo(m,p),i.lineTo(g,b)}}i.closePath(),i.moveTo(0,0),i.rect(0,0,i.canvas.width,i.canvas.height),i.clip("evenodd")}function td(i,e,t){let{startAngle:r,pixelMargin:n,x:s,y:o,outerRadius:a,innerRadius:l}=e,c=n/a;i.beginPath(),i.arc(s,o,a,r-c,t+c),l>n?(c=n/l,i.arc(s,o,l,t+c,r-c,!0)):i.arc(s,o,n,t+st,r-st),i.closePath(),i.clip()}function ed(i){return Qi(i,["outerStart","outerEnd","innerStart","innerEnd"])}function id(i,e,t,r){let n=ed(i.options.borderRadius),s=(t-e)/2,o=Math.min(s,r*e/2),a=l=>{let c=(t-Math.min(s,l))*r/2;return lt(l,0,Math.min(s,c))};return{outerStart:a(n.outerStart),outerEnd:a(n.outerEnd),innerStart:lt(n.innerStart,0,o),innerEnd:lt(n.innerEnd,0,o)}}function Be(i,e,t,r){return{x:t+i*Math.cos(e),y:r+i*Math.sin(e)}}function fr(i,e,t,r,n,s){let{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=e,f=Math.max(e.outerRadius+r+t-c,0),d=u>0?u+r+t+c:0,h=0,m=n-l;if(r){let N=u>0?u-r:0,Y=f>0?f-r:0,G=(N+Y)/2,yt=G!==0?m*G/(G+r):m;h=(m-yt)/2}let p=Math.max(.001,m*f-t/$)/f,g=(m-p)/2,b=l+g+h,x=n-g-h,{outerStart:w,outerEnd:k,innerStart:v,innerEnd:_}=id(e,d,f,x-b),P=f-w,C=f-k,O=b+w/P,R=x-k/C,z=d+v,H=d+_,rt=b+v/z,ut=x-_/H;if(i.beginPath(),s){let N=(O+R)/2;if(i.arc(o,a,f,O,N),i.arc(o,a,f,N,R),k>0){let at=Be(C,R,o,a);i.arc(at.x,at.y,k,R,x+st)}let Y=Be(H,x,o,a);if(i.lineTo(Y.x,Y.y),_>0){let at=Be(H,ut,o,a);i.arc(at.x,at.y,_,x+st,ut+Math.PI)}let G=(x-_/d+(b+v/d))/2;if(i.arc(o,a,d,x-_/d,G,!0),i.arc(o,a,d,G,b+v/d,!0),v>0){let at=Be(z,rt,o,a);i.arc(at.x,at.y,v,rt+Math.PI,b-st)}let yt=Be(P,b,o,a);if(i.lineTo(yt.x,yt.y),w>0){let at=Be(P,O,o,a);i.arc(at.x,at.y,w,b-st,O)}}else{i.moveTo(o,a);let N=Math.cos(O)*f+o,Y=Math.sin(O)*f+a;i.lineTo(N,Y);let G=Math.cos(R)*f+o,yt=Math.sin(R)*f+a;i.lineTo(G,yt)}i.closePath()}function rd(i,e,t,r,n){let{fullCircles:s,startAngle:o,circumference:a}=e,l=e.endAngle;if(s){fr(i,e,t,r,l,n);for(let c=0;c<s;++c)i.fill();isNaN(a)||(l=o+(a%et||et))}return fr(i,e,t,r,l,n),i.fill(),l}function nd(i,e,t,r,n){let{fullCircles:s,startAngle:o,circumference:a,options:l}=e,{borderWidth:c,borderJoinStyle:u,borderDash:f,borderDashOffset:d,borderRadius:h}=l,m=l.borderAlign==="inner";if(!c)return;i.setLineDash(f||[]),i.lineDashOffset=d,m?(i.lineWidth=c*2,i.lineJoin=u||"round"):(i.lineWidth=c,i.lineJoin=u||"bevel");let p=e.endAngle;if(s){fr(i,e,t,r,p,n);for(let g=0;g<s;++g)i.stroke();isNaN(a)||(p=o+(a%et||et))}m&&td(i,e,p),l.selfJoin&&p-o>=$&&h===0&&u!=="miter"&&Jf(i,e,p),s||(fr(i,e,t,r,p,n),i.stroke())}var ns=class extends It{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:e=>e!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,t,r){let n=this.getProps(["x","y"],r),{angle:s,distance:o}=mn(n,{x:e,y:t}),{startAngle:a,endAngle:l,innerRadius:c,outerRadius:u,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],r),d=(this.options.spacing+this.options.borderWidth)/2,h=W(f,l-a),m=ze(s,a,l)&&a!==l,p=h>=et||m,g=zt(o,c+d,u+d);return p&&g}getCenterPoint(e){let{x:t,y:r,startAngle:n,endAngle:s,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:l,spacing:c}=this.options,u=(n+s)/2,f=(o+a+c+l)/2;return{x:t+Math.cos(u)*f,y:r+Math.sin(u)*f}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){let{options:t,circumference:r}=this,n=(t.offset||0)/4,s=(t.spacing||0)/2,o=t.circular;if(this.pixelMargin=t.borderAlign==="inner"?.33:0,this.fullCircles=r>et?Math.floor(r/et):0,r===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let a=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(a)*n,Math.sin(a)*n);let l=1-Math.sin(Math.min($,r||0)),c=n*l;e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,rd(e,this,c,s,o),nd(e,this,c,s,o),e.restore()}};function Ya(i,e,t=e){i.lineCap=W(t.borderCapStyle,e.borderCapStyle),i.setLineDash(W(t.borderDash,e.borderDash)),i.lineDashOffset=W(t.borderDashOffset,e.borderDashOffset),i.lineJoin=W(t.borderJoinStyle,e.borderJoinStyle),i.lineWidth=W(t.borderWidth,e.borderWidth),i.strokeStyle=W(t.borderColor,e.borderColor)}function sd(i,e,t){i.lineTo(t.x,t.y)}function od(i){return i.stepped?bo:i.tension||i.cubicInterpolationMode==="monotone"?xo:sd}function Ua(i,e,t={}){let r=i.length,{start:n=0,end:s=r-1}=t,{start:o,end:a}=e,l=Math.max(n,o),c=Math.min(s,a),u=n<o&&s<o||n>a&&s>a;return{count:r,start:l,loop:e.loop,ilen:c<l&&!u?r+c-l:c-l}}function ad(i,e,t,r){let{points:n,options:s}=e,{count:o,start:a,loop:l,ilen:c}=Ua(n,t,r),u=od(s),{move:f=!0,reverse:d}=r||{},h,m,p;for(h=0;h<=c;++h)m=n[(a+(d?c-h:h))%o],!m.skip&&(f?(i.moveTo(m.x,m.y),f=!1):u(i,p,m,d,s.stepped),p=m);return l&&(m=n[(a+(d?c:0))%o],u(i,p,m,d,s.stepped)),!!l}function ld(i,e,t,r){let n=e.points,{count:s,start:o,ilen:a}=Ua(n,t,r),{move:l=!0,reverse:c}=r||{},u=0,f=0,d,h,m,p,g,b,x=k=>(o+(c?a-k:k))%s,w=()=>{p!==g&&(i.lineTo(u,g),i.lineTo(u,p),i.lineTo(u,b))};for(l&&(h=n[x(0)],i.moveTo(h.x,h.y)),d=0;d<=a;++d){if(h=n[x(d)],h.skip)continue;let k=h.x,v=h.y,_=k|0;_===m?(v<p?p=v:v>g&&(g=v),u=(f*u+k)/++f):(w(),i.lineTo(k,v),m=_,f=0,p=g=v),b=v}w()}function ss(i){let e=i.options,t=e.borderDash&&e.borderDash.length;return!i._decimated&&!i._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?ld:ad}function cd(i){return i.stepped?Co:i.tension||i.cubicInterpolationMode==="monotone"?Po:ie}function ud(i,e,t,r){let n=e._path;n||(n=e._path=new Path2D,e.path(n,t,r)&&n.closePath()),Ya(i,e.options),i.stroke(n)}function fd(i,e,t,r){let{segments:n,options:s}=e,o=ss(e);for(let a of n)Ya(i,s,a.style),i.beginPath(),o(i,e,a,{start:t,end:t+r-1})&&i.closePath(),i.stroke()}var dd=typeof Path2D=="function";function hd(i,e,t,r){dd&&!e.options.segment?ud(i,e,t,r):fd(i,e,t,r)}var mr=(()=>{class i 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,r){let n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){let s=n.spanGaps?this._loop:this._fullLoop;ko(this._points,n,t,s,r),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=So(this,this.options.segment))}first(){let t=this.segments,r=this.points;return t.length&&r[t[0].start]}last(){let t=this.segments,r=this.points,n=t.length;return n&&r[t[n-1].end]}interpolate(t,r){let n=this.options,s=t[r],o=this.points,a=Rn(this,{property:r,start:s,end:s});if(!a.length)return;let l=[],c=cd(n),u,f;for(u=0,f=a.length;u<f;++u){let{start:d,end:h}=a[u],m=o[d],p=o[h];if(m===p){l.push(m);continue}let g=Math.abs((s-m[r])/(p[r]-m[r])),b=c(m,p,g,n.stepped);b[r]=t[r],l.push(b)}return l.length===1?l[0]:l}pathSegment(t,r,n){return ss(this)(t,this,r,n)}path(t,r,n){let s=this.segments,o=ss(this),a=this._loop;r=r||0,n=n||this.points.length-r;for(let l of s)a&=o(t,this,l,{start:r,end:r+n-1});return!!a}draw(t,r,n,s){let o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),hd(t,this,n,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}return i})();function sa(i,e,t,r){let n=i.options,{[t]:s}=i.getProps([t],r);return Math.abs(e-s)<n.radius+n.hitRadius}var md=(()=>{class i 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,r,n){let s=this.options,{x:o,y:a}=this.getProps(["x","y"],n);return Math.pow(t-o,2)+Math.pow(r-a,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,r){return sa(this,t,"x",r)}inYRange(t,r){return sa(this,t,"y",r)}getCenterPoint(t){let{x:r,y:n}=this.getProps(["x","y"],t);return{x:r,y:n}}size(t){t=t||this.options||{};let r=t.radius||0;r=Math.max(r,r&&t.hoverRadius||0);let n=r&&t.borderWidth||0;return(r+n)*2}draw(t,r){let n=this.options;this.skip||n.radius<.1||!Rt(this,r,this.size(n)/2)||(t.strokeStyle=n.borderColor,t.lineWidth=n.borderWidth,t.fillStyle=n.backgroundColor,Xi(t,n,this.x,this.y))}getRange(){let t=this.options||{};return t.radius+t.hitRadius}}return i})();function Va(i,e){let{x:t,y:r,base:n,width:s,height:o}=i.getProps(["x","y","base","width","height"],e),a,l,c,u,f;return i.horizontal?(f=o/2,a=Math.min(t,n),l=Math.max(t,n),c=r-f,u=r+f):(f=s/2,a=t-f,l=t+f,c=Math.min(r,n),u=Math.max(r,n)),{left:a,top:c,right:l,bottom:u}}function le(i,e,t,r){return i?0:lt(e,t,r)}function pd(i,e,t){let r=i.options.borderWidth,n=i.borderSkipped,s=Dn(r);return{t:le(n.top,s.top,0,t),r:le(n.right,s.right,0,e),b:le(n.bottom,s.bottom,0,t),l:le(n.left,s.left,0,e)}}function gd(i,e,t){let{enableBorderRadius:r}=i.getProps(["enableBorderRadius"]),n=i.options.borderRadius,s=oe(n),o=Math.min(e,t),a=i.borderSkipped,l=r||V(n);return{topLeft:le(!l||a.top||a.left,s.topLeft,0,o),topRight:le(!l||a.top||a.right,s.topRight,0,o),bottomLeft:le(!l||a.bottom||a.left,s.bottomLeft,0,o),bottomRight:le(!l||a.bottom||a.right,s.bottomRight,0,o)}}function bd(i){let e=Va(i),t=e.right-e.left,r=e.bottom-e.top,n=pd(i,t/2,r/2),s=gd(i,t/2,r/2);return{outer:{x:e.left,y:e.top,w:t,h:r,radius:s},inner:{x:e.left+n.l,y:e.top+n.t,w:t-n.l-n.r,h:r-n.t-n.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,s.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(n.b,n.r))}}}}function Vn(i,e,t,r){let n=e===null,s=t===null,a=i&&!(n&&s)&&Va(i,r);return a&&(n||zt(e,a.left,a.right))&&(s||zt(t,a.top,a.bottom))}function xd(i){return i.topLeft||i.topRight||i.bottomLeft||i.bottomRight}function vd(i,e){i.rect(e.x,e.y,e.w,e.h)}function jn(i,e,t={}){let r=i.x!==t.x?-e:0,n=i.y!==t.y?-e:0,s=(i.x+i.w!==t.x+t.w?e:0)-r,o=(i.y+i.h!==t.y+t.h?e:0)-n;return{x:i.x+r,y:i.y+n,w:i.w+s,h:i.h+o,radius:i.radius}}var os=class extends It{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){let{inflateAmount:t,options:{borderColor:r,backgroundColor:n}}=this,{inner:s,outer:o}=bd(this),a=xd(o.radius)?We:vd;e.save(),(o.w!==s.w||o.h!==s.h)&&(e.beginPath(),a(e,jn(o,t,s)),e.clip(),a(e,jn(s,-t,o)),e.fillStyle=r,e.fill("evenodd")),e.beginPath(),a(e,jn(s,t)),e.fillStyle=n,e.fill(),e.restore()}inRange(e,t,r){return Vn(this,e,t,r)}inXRange(e,t){return Vn(this,e,null,t)}inYRange(e,t){return Vn(this,null,e,t)}getCenterPoint(e){let{x:t,y:r,base:n,horizontal:s}=this.getProps(["x","y","base","horizontal"],e);return{x:s?(t+n)/2:t,y:s?r:(r+n)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}},yd=Object.freeze({__proto__:null,ArcElement:ns,BarElement:os,LineElement:mr,PointElement:md}),as=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],oa=as.map(i=>i.replace("rgb(","rgba(").replace(")",", 0.5)"));function ja(i){return as[i%as.length]}function qa(i){return oa[i%oa.length]}function _d(i,e){return i.borderColor=ja(e),i.backgroundColor=qa(e),++e}function wd(i,e){return i.backgroundColor=i.data.map(()=>ja(e++)),e}function Md(i,e){return i.backgroundColor=i.data.map(()=>qa(e++)),e}function kd(i){let e=0;return(t,r)=>{let n=i.getDatasetMeta(r).controller;n instanceof ps?e=wd(t,e):n instanceof La?e=Md(t,e):n&&(e=_d(t,e))}}function aa(i){let e;for(e in i)if(i[e].borderColor||i[e].backgroundColor)return!0;return!1}function Dd(i){return i&&(i.borderColor||i.backgroundColor)}function Td(){return it.borderColor!=="rgba(0,0,0,0.1)"||it.backgroundColor!=="rgba(0,0,0,0.1)"}var Cd={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(i,e,t){if(!t.enabled)return;let{data:{datasets:r},options:n}=i.config,{elements:s}=n,o=aa(r)||Dd(n)||s&&aa(s)||Td();if(!t.forceOverride&&o)return;let a=kd(i);r.forEach(a)}};function Pd(i,e,t,r,n){let s=n.samples||r;if(s>=t)return i.slice(e,e+t);let o=[],a=(t-2)/(s-2),l=0,c=e+t-1,u=e,f,d,h,m,p;for(o[l++]=i[u],f=0;f<s-2;f++){let g=0,b=0,x,w=Math.floor((f+1)*a)+1+e,k=Math.min(Math.floor((f+2)*a)+1,t)+e,v=k-w;for(x=w;x<k;x++)g+=i[x].x,b+=i[x].y;g/=v,b/=v;let _=Math.floor(f*a)+1+e,P=Math.min(Math.floor((f+1)*a)+1,t)+e,{x:C,y:O}=i[u];for(h=m=-1,x=_;x<P;x++)m=.5*Math.abs((C-g)*(i[x].y-O)-(C-i[x].x)*(b-O)),m>h&&(h=m,d=i[x],p=x);o[l++]=d,u=p}return o[l++]=i[c],o}function Od(i,e,t,r){let n=0,s=0,o,a,l,c,u,f,d,h,m,p,g=[],b=e+t-1,x=i[e].x,k=i[b].x-x;for(o=e;o<e+t;++o){a=i[o],l=(a.x-x)/k*r,c=a.y;let v=l|0;if(v===u)c<m?(m=c,f=o):c>p&&(p=c,d=o),n=(s*n+a.x)/++s;else{let _=o-1;if(!U(f)&&!U(d)){let P=Math.min(f,d),C=Math.max(f,d);P!==h&&P!==_&&g.push(Ai(Oe({},i[P]),{x:n})),C!==h&&C!==_&&g.push(Ai(Oe({},i[C]),{x:n}))}o>0&&_!==h&&g.push(i[_]),g.push(a),u=v,s=0,m=p=c,f=d=h=o}}return g}function $a(i){if(i._decimated){let e=i._data;delete i._decimated,delete i._data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function la(i){i.data.datasets.forEach(e=>{$a(e)})}function Sd(i,e){let t=e.length,r=0,n,{iScale:s}=i,{min:o,max:a,minDefined:l,maxDefined:c}=s.getUserBounds();return l&&(r=lt(Et(e,s.axis,o).lo,0,t-1)),c?n=lt(Et(e,s.axis,a).hi+1,r,t)-r:n=t-r,{start:r,count:n}}var Ad={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(i,e,t)=>{if(!t.enabled){la(i);return}let r=i.width;i.data.datasets.forEach((n,s)=>{let{_data:o,indexAxis:a}=n,l=i.getDatasetMeta(s),c=o||n.data;if(He([a,i.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;let u=i.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||i.options.parsing)return;let{start:f,count:d}=Sd(l,c),h=t.threshold||4*r;if(d<=h){$a(n);return}U(o)&&(n._data=c,delete n.data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(p){this._data=p}}));let m;switch(t.algorithm){case"lttb":m=Pd(c,f,d,r,t);break;case"min-max":m=Od(c,f,d,r);break;default:throw new Error(`Unsupported decimation algorithm '${t.algorithm}'`)}n._decimated=m})},destroy(i){la(i)}};function Id(i,e,t){let r=i.segments,n=i.points,s=e.points,o=[];for(let a of r){let{start:l,end:c}=a;c=pr(l,c,n);let u=ls(t,n[l],n[c],a.loop);if(!e.segments){o.push({source:a,target:u,start:n[l],end:n[c]});continue}let f=Rn(e,u);for(let d of f){let h=ls(t,s[d.start],s[d.end],d.loop),m=En(a,n,h);for(let p of m)o.push({source:p,target:d,start:{[t]:ca(u,h,"start",Math.max)},end:{[t]:ca(u,h,"end",Math.min)}})}}return o}function ls(i,e,t,r){if(r)return;let n=e[i],s=t[i];return i==="angle"&&(n=ft(n),s=ft(s)),{property:i,start:n,end:s}}function Ld(i,e){let{x:t=null,y:r=null}=i||{},n=e.points,s=[];return e.segments.forEach(({start:o,end:a})=>{a=pr(o,a,n);let l=n[o],c=n[a];r!==null?(s.push({x:l.x,y:r}),s.push({x:c.x,y:r})):t!==null&&(s.push({x:t,y:l.y}),s.push({x:t,y:c.y}))}),s}function pr(i,e,t){for(;e>i;e--){let r=t[e];if(!isNaN(r.x)&&!isNaN(r.y))break}return e}function ca(i,e,t,r){return i&&e?r(i[t],e[t]):i?i[t]:e?e[t]:0}function Xa(i,e){let t=[],r=!1;return tt(i)?(r=!0,t=i):t=Ld(i,e),t.length?new mr({points:t,options:{tension:0},_loop:r,_fullLoop:r}):null}function ua(i){return i&&i.fill!==!1}function Ed(i,e,t){let n=i[e].fill,s=[e],o;if(!t)return n;for(;n!==!1&&s.indexOf(n)===-1;){if(!nt(n))return n;if(o=i[n],!o)return!1;if(o.visible)return n;s.push(n),n=o.fill}return!1}function Rd(i,e,t){let r=Wd(i);if(V(r))return isNaN(r.value)?!1:r;let n=parseFloat(r);return nt(n)&&Math.floor(n)===n?Fd(r[0],e,n,t):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function Fd(i,e,t,r){return(i==="-"||i==="+")&&(t=e+t),t===e||t<0||t>=r?!1:t}function zd(i,e){let t=null;return i==="start"?t=e.bottom:i==="end"?t=e.top:V(i)?t=e.getPixelForValue(i.value):e.getBasePixel&&(t=e.getBasePixel()),t}function Nd(i,e,t){let r;return i==="start"?r=t:i==="end"?r=e.options.reverse?e.min:e.max:V(i)?r=i.value:r=e.getBaseValue(),r}function Wd(i){let e=i.options,t=e.fill,r=W(t&&t.target,t);return r===void 0&&(r=!!e.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function Hd(i){let{scale:e,index:t,line:r}=i,n=[],s=r.segments,o=r.points,a=Bd(e,t);a.push(Xa({x:null,y:e.bottom},r));for(let l=0;l<s.length;l++){let c=s[l];for(let u=c.start;u<=c.end;u++)Yd(n,o[u],a)}return new mr({points:n,options:{}})}function Bd(i,e){let t=[],r=i.getMatchingVisibleMetas("line");for(let n=0;n<r.length;n++){let s=r[n];if(s.index===e)break;s.hidden||t.unshift(s.dataset)}return t}function Yd(i,e,t){let r=[];for(let n=0;n<t.length;n++){let s=t[n],{first:o,last:a,point:l}=Ud(s,e,"x");if(!(!l||o&&a)){if(o)r.unshift(l);else if(i.push(l),!a)break}}i.push(...r)}function Ud(i,e,t){let r=i.interpolate(e,t);if(!r)return{};let n=r[t],s=i.segments,o=i.points,a=!1,l=!1;for(let c=0;c<s.length;c++){let u=s[c],f=o[u.start][t],d=o[u.end][t];if(zt(n,f,d)){a=n===f,l=n===d;break}}return{first:a,last:l,point:r}}var dr=class{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,r){let{x:n,y:s,radius:o}=this;return t=t||{start:0,end:et},e.arc(n,s,o,t.end,t.start,!0),!r.bounds}interpolate(e){let{x:t,y:r,radius:n}=this,s=e.angle;return{x:t+Math.cos(s)*n,y:r+Math.sin(s)*n,angle:s}}};function Vd(i){let{chart:e,fill:t,line:r}=i;if(nt(t))return jd(e,t);if(t==="stack")return Hd(i);if(t==="shape")return!0;let n=qd(i);return n instanceof dr?n:Xa(n,r)}function jd(i,e){let t=i.getDatasetMeta(e);return t&&i.isDatasetVisible(e)?t.dataset:null}function qd(i){return(i.scale||{}).getPointPositionForValue?Xd(i):$d(i)}function $d(i){let{scale:e={},fill:t}=i,r=zd(t,e);if(nt(r)){let n=e.isHorizontal();return{x:n?r:null,y:n?null:r}}return null}function Xd(i){let{scale:e,fill:t}=i,r=e.options,n=e.getLabels().length,s=r.reverse?e.max:e.min,o=Nd(t,e,s),a=[];if(r.grid.circular){let l=e.getPointPositionForValue(0,s);return new dr({x:l.x,y:l.y,radius:e.getDistanceFromCenterForValue(o)})}for(let l=0;l<n;++l)a.push(e.getPointPositionForValue(l,o));return a}function qn(i,e,t){let r=Vd(e),{chart:n,index:s,line:o,scale:a,axis:l}=e,c=o.options,u=c.fill,f=c.backgroundColor,{above:d=f,below:h=f}=u||{},m=n.getDatasetMeta(s),p=Fn(n,m);r&&o.points.length&&(ai(i,t),Qd(i,{line:o,target:r,above:d,below:h,area:t,scale:a,axis:l,clip:p}),li(i))}function Qd(i,e){let{line:t,target:r,above:n,below:s,area:o,scale:a,clip:l}=e,c=t._loop?"angle":e.axis;i.save();let u=s;s!==n&&(c==="x"?(fa(i,r,o.top),$n(i,{line:t,target:r,color:n,scale:a,property:c,clip:l}),i.restore(),i.save(),fa(i,r,o.bottom)):c==="y"&&(da(i,r,o.left),$n(i,{line:t,target:r,color:s,scale:a,property:c,clip:l}),i.restore(),i.save(),da(i,r,o.right),u=n)),$n(i,{line:t,target:r,color:u,scale:a,property:c,clip:l}),i.restore()}function fa(i,e,t){let{segments:r,points:n}=e,s=!0,o=!1;i.beginPath();for(let a of r){let{start:l,end:c}=a,u=n[l],f=n[pr(l,c,n)];s?(i.moveTo(u.x,u.y),s=!1):(i.lineTo(u.x,t),i.lineTo(u.x,u.y)),o=!!e.pathSegment(i,a,{move:o}),o?i.closePath():i.lineTo(f.x,t)}i.lineTo(e.first().x,t),i.closePath(),i.clip()}function da(i,e,t){let{segments:r,points:n}=e,s=!0,o=!1;i.beginPath();for(let a of r){let{start:l,end:c}=a,u=n[l],f=n[pr(l,c,n)];s?(i.moveTo(u.x,u.y),s=!1):(i.lineTo(t,u.y),i.lineTo(u.x,u.y)),o=!!e.pathSegment(i,a,{move:o}),o?i.closePath():i.lineTo(t,f.y)}i.lineTo(t,e.first().y),i.closePath(),i.clip()}function $n(i,e){let{line:t,target:r,property:n,color:s,scale:o,clip:a}=e,l=Id(t,r,n);for(let{source:c,target:u,start:f,end:d}of l){let{style:{backgroundColor:h=s}={}}=c,m=r!==!0;i.save(),i.fillStyle=h,Gd(i,o,a,m&&ls(n,f,d)),i.beginPath();let p=!!t.pathSegment(i,c),g;if(m){p?i.closePath():ha(i,r,d,n);let b=!!r.pathSegment(i,u,{move:p,reverse:!0});g=p&&b,g||ha(i,r,f,n)}i.closePath(),i.fill(g?"evenodd":"nonzero"),i.restore()}}function Gd(i,e,t,r){let n=e.chart.chartArea,{property:s,start:o,end:a}=r||{};if(s==="x"||s==="y"){let l,c,u,f;s==="x"?(l=o,c=n.top,u=a,f=n.bottom):(l=n.left,c=o,u=n.right,f=a),i.beginPath(),t&&(l=Math.max(l,t.left),u=Math.min(u,t.right),c=Math.max(c,t.top),f=Math.min(f,t.bottom)),i.rect(l,c,u-l,f-c),i.clip()}}function ha(i,e,t,r){let n=e.interpolate(t,r);n&&i.lineTo(n.x,n.y)}var Kd={id:"filler",afterDatasetsUpdate(i,e,t){let r=(i.data.datasets||[]).length,n=[],s,o,a,l;for(o=0;o<r;++o)s=i.getDatasetMeta(o),a=s.dataset,l=null,a&&a.options&&a instanceof mr&&(l={visible:i.isDatasetVisible(o),index:o,fill:Rd(a,o,r),chart:i,axis:s.controller.options.indexAxis,scale:s.vScale,line:a}),s.$filler=l,n.push(l);for(o=0;o<r;++o)l=n[o],!(!l||l.fill===!1)&&(l.fill=Ed(n,o,t.propagate))},beforeDraw(i,e,t){let r=t.drawTime==="beforeDraw",n=i.getSortedVisibleDatasetMetas(),s=i.chartArea;for(let o=n.length-1;o>=0;--o){let a=n[o].$filler;a&&(a.line.updateControlPoints(s,a.axis),r&&a.fill&&qn(i.ctx,a,s))}},beforeDatasetsDraw(i,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;let r=i.getSortedVisibleDatasetMetas();for(let n=r.length-1;n>=0;--n){let s=r[n].$filler;ua(s)&&qn(i.ctx,s,i.chartArea)}},beforeDatasetDraw(i,e,t){let r=e.meta.$filler;!ua(r)||t.drawTime!=="beforeDatasetDraw"||qn(i.ctx,r,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},ma=(i,e)=>{let{boxHeight:t=e,boxWidth:r=e}=i;return i.usePointStyle&&(t=Math.min(t,e),r=i.pointStyleWidth||Math.min(r,e)),{boxWidth:r,boxHeight:t,itemHeight:Math.max(e,t)}},Zd=(i,e)=>i!==null&&e!==null&&i.datasetIndex===e.datasetIndex&&i.index===e.index,hr=class extends It{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t,r){this.maxWidth=e,this.maxHeight=t,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let e=this.options.labels||{},t=Z(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter(r=>e.filter(r,this.chart.data))),e.sort&&(t=t.sort((r,n)=>e.sort(r,n,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){let{options:e,ctx:t}=this;if(!e.display){this.width=this.height=0;return}let r=e.labels,n=ot(r.font),s=n.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=ma(r,s),c,u;t.font=n.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,s,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,n,a,l)+10),this.width=Math.min(c,e.maxWidth||this.maxWidth),this.height=Math.min(u,e.maxHeight||this.maxHeight)}_fitRows(e,t,r,n){let{ctx:s,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=n+a,f=e;s.textAlign="left",s.textBaseline="middle";let d=-1,h=-u;return this.legendItems.forEach((m,p)=>{let g=r+t/2+s.measureText(m.text).width;(p===0||c[c.length-1]+g+2*a>o)&&(f+=u,c[c.length-(p>0?0:1)]=0,h+=u,d++),l[p]={left:0,top:h,row:d,width:g,height:n},c[c.length-1]+=g+a}),f}_fitCols(e,t,r,n){let{ctx:s,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-e,f=a,d=0,h=0,m=0,p=0;return this.legendItems.forEach((g,b)=>{let{itemWidth:x,itemHeight:w}=Jd(r,t,s,g,n);b>0&&h+w+2*a>u&&(f+=d+a,c.push({width:d,height:h}),m+=d+a,p++,d=h=0),l[b]={left:m,top:h,col:p,width:x,height:w},d=Math.max(d,x),h+=w+a}),f+=d,c.push({width:d,height:h}),f}adjustHitBoxes(){if(!this.options.display)return;let e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:r,labels:{padding:n},rtl:s}}=this,o=be(s,this.left,this.width);if(this.isHorizontal()){let a=0,l=dt(r,this.left+n,this.right-this.lineWidths[a]);for(let c of t)a!==c.row&&(a=c.row,l=dt(r,this.left+n,this.right-this.lineWidths[a])),c.top+=this.top+e+n,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+n}else{let a=0,l=dt(r,this.top+e+n,this.bottom-this.columnSizes[a].height);for(let c of t)c.col!==a&&(a=c.col,l=dt(r,this.top+e+n,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+n,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){let e=this.ctx;ai(e,this),this._draw(),li(e)}}_draw(){let{options:e,columnSizes:t,lineWidths:r,ctx:n}=this,{align:s,labels:o}=e,a=it.color,l=be(e.rtl,this.left,this.width),c=ot(o.font),{padding:u}=o,f=c.size,d=f/2,h;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;let{boxWidth:m,boxHeight:p,itemHeight:g}=ma(o,f),b=function(_,P,C){if(isNaN(m)||m<=0||isNaN(p)||p<0)return;n.save();let O=W(C.lineWidth,1);if(n.fillStyle=W(C.fillStyle,a),n.lineCap=W(C.lineCap,"butt"),n.lineDashOffset=W(C.lineDashOffset,0),n.lineJoin=W(C.lineJoin,"miter"),n.lineWidth=O,n.strokeStyle=W(C.strokeStyle,a),n.setLineDash(W(C.lineDash,[])),o.usePointStyle){let R={radius:p*Math.SQRT2/2,pointStyle:C.pointStyle,rotation:C.rotation,borderWidth:O},z=l.xPlus(_,m/2),H=P+d;kn(n,R,z,H,o.pointStyleWidth&&m)}else{let R=P+Math.max((f-p)/2,0),z=l.leftForLtr(_,m),H=oe(C.borderRadius);n.beginPath(),Object.values(H).some(rt=>rt!==0)?We(n,{x:z,y:R,w:m,h:p,radius:H}):n.rect(z,R,m,p),n.fill(),O!==0&&n.stroke()}n.restore()},x=function(_,P,C){se(n,C.text,_,P+g/2,c,{strikethrough:C.hidden,textAlign:l.textAlign(C.textAlign)})},w=this.isHorizontal(),k=this._computeTitleHeight();w?h={x:dt(s,this.left+u,this.right-r[0]),y:this.top+u+k,line:0}:h={x:this.left+u,y:dt(s,this.top+k+u,this.bottom-t[0].height),line:0},In(this.ctx,e.textDirection);let v=g+u;this.legendItems.forEach((_,P)=>{n.strokeStyle=_.fontColor,n.fillStyle=_.fontColor;let C=n.measureText(_.text).width,O=l.textAlign(_.textAlign||(_.textAlign=o.textAlign)),R=m+d+C,z=h.x,H=h.y;l.setWidth(this.width),w?P>0&&z+R+u>this.right&&(H=h.y+=v,h.line++,z=h.x=dt(s,this.left+u,this.right-r[h.line])):P>0&&H+v>this.bottom&&(z=h.x=z+t[h.line].width+u,h.line++,H=h.y=dt(s,this.top+k+u,this.bottom-t[h.line].height));let rt=l.x(z);if(b(rt,H,_),z=mo(O,z+m+d,w?z+R:this.right,e.rtl),x(l.x(z),H,_),w)h.x+=R+u;else if(typeof _.text!="string"){let ut=c.lineHeight;h.y+=Qa(_,ut)+u}else h.y+=v}),Ln(this.ctx,e.textDirection)}drawTitle(){let e=this.options,t=e.title,r=ot(t.font),n=ht(t.padding);if(!t.display)return;let s=be(e.rtl,this.left,this.width),o=this.ctx,a=t.position,l=r.size/2,c=n.top+l,u,f=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),u=this.top+c,f=dt(e.align,f,this.right-d);else{let m=this.columnSizes.reduce((p,g)=>Math.max(p,g.height),0);u=c+dt(e.align,this.top,this.bottom-m-e.labels.padding-this._computeTitleHeight())}let h=dt(a,f,f+d);o.textAlign=s.textAlign(qi(a)),o.textBaseline="middle",o.strokeStyle=t.color,o.fillStyle=t.color,o.font=r.string,se(o,t.text,h,u,r)}_computeTitleHeight(){let e=this.options.title,t=ot(e.font),r=ht(e.padding);return e.display?t.lineHeight+r.height:0}_getLegendItemAt(e,t){let r,n,s;if(zt(e,this.left,this.right)&&zt(t,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(n=s[r],zt(e,n.left,n.left+n.width)&&zt(t,n.top,n.top+n.height))return this.legendItems[r]}return null}handleEvent(e){let t=this.options;if(!ih(e.type,t))return;let r=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){let n=this._hoveredItem,s=Zd(n,r);n&&!s&&Z(t.onLeave,[e,n,this],this),this._hoveredItem=r,r&&!s&&Z(t.onHover,[e,r,this],this)}else r&&Z(t.onClick,[e,r,this],this)}};function Jd(i,e,t,r,n){let s=th(r,i,e,t),o=eh(n,r,e.lineHeight);return{itemWidth:s,itemHeight:o}}function th(i,e,t,r){let n=i.text;return n&&typeof n!="string"&&(n=n.reduce((s,o)=>s.length>o.length?s:o)),e+t.size/2+r.measureText(n).width}function eh(i,e,t){let r=i;return typeof e.text!="string"&&(r=Qa(e,t)),r}function Qa(i,e){let t=i.text?i.text.length:0;return e*t}function ih(i,e){return!!((i==="mousemove"||i==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(i==="click"||i==="mouseup"))}var rh={id:"legend",_element:hr,start(i,e,t){let r=i.legend=new hr({ctx:i.ctx,options:t,chart:i});mt.configure(i,r,t),mt.addBox(i,r)},stop(i){mt.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,e,t){let r=i.legend;mt.configure(i,r,t),r.options=t},afterUpdate(i){let e=i.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(i,e){e.replay||i.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,e,t){let r=e.datasetIndex,n=t.chart;n.isDatasetVisible(r)?(n.hide(r),e.hidden=!0):(n.show(r),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){let e=i.data.datasets,{labels:{usePointStyle:t,pointStyle:r,textAlign:n,color:s,useBorderRadius:o,borderRadius:a}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{let c=l.controller.getStyle(t?0:void 0),u=ht(c.borderWidth);return{text:e[l.index].label,fillStyle:c.backgroundColor,fontColor:s,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:n||c.textAlign,borderRadius:o&&(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)}}},bi=class extends It{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t){let r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=t;let n=tt(r.text)?r.text.length:1;this._padding=ht(r.padding);let s=n*ot(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){let e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){let{top:t,left:r,bottom:n,right:s,options:o}=this,a=o.align,l=0,c,u,f;return this.isHorizontal()?(u=dt(a,r,s),f=t+e,c=s-r):(o.position==="left"?(u=r+e,f=dt(a,n,t),l=$*-.5):(u=s-e,f=dt(a,t,n),l=$*.5),c=n-t),{titleX:u,titleY:f,maxWidth:c,rotation:l}}draw(){let e=this.ctx,t=this.options;if(!t.display)return;let r=ot(t.font),s=r.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(s);se(e,t.text,0,0,r,{color:t.color,maxWidth:l,rotation:c,textAlign:qi(t.align),textBaseline:"middle",translation:[o,a]})}};function nh(i,e){let t=new bi({ctx:i.ctx,options:e,chart:i});mt.configure(i,t,e),mt.addBox(i,t),i.titleBlock=t}var sh={id:"title",_element:bi,start(i,e,t){nh(i,t)},stop(i){let e=i.titleBlock;mt.removeBox(i,e),delete i.titleBlock},beforeUpdate(i,e,t){let r=i.titleBlock;mt.configure(i,r,t),r.options=t},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}},rr=new WeakMap,oh={id:"subtitle",start(i,e,t){let r=new bi({ctx:i.ctx,options:t,chart:i});mt.configure(i,r,t),mt.addBox(i,r),rr.set(i,r)},stop(i){mt.removeBox(i,rr.get(i)),rr.delete(i)},beforeUpdate(i,e,t){let r=rr.get(i);mt.configure(i,r,t),r.options=t},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},pi={average(i){if(!i.length)return!1;let e,t,r=new Set,n=0,s=0;for(e=0,t=i.length;e<t;++e){let a=i[e].element;if(a&&a.hasValue()){let l=a.tooltipPosition();r.add(l.x),n+=l.y,++s}}return s===0||r.size===0?!1:{x:[...r].reduce((a,l)=>a+l)/r.size,y:n/s}},nearest(i,e){if(!i.length)return!1;let t=e.x,r=e.y,n=Number.POSITIVE_INFINITY,s,o,a;for(s=0,o=i.length;s<o;++s){let l=i[s].element;if(l&&l.hasValue()){let c=l.getCenterPoint(),u=Bi(e,c);u<n&&(n=u,a=l)}}if(a){let l=a.tooltipPosition();t=l.x,r=l.y}return{x:t,y:r}}};function Nt(i,e){return e&&(tt(e)?Array.prototype.push.apply(i,e):i.push(e)),i}function Xt(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
|
|
2
2
|
`)>-1?i.split(`
|
|
3
|
-
`):i}function ah(i,e){let{element:t,datasetIndex:r,index:n}=e,s=i.getDatasetMeta(r).controller,{label:o,value:a}=s.getLabelAndValue(n);return{chart:i,label:o,parsed:s.getParsed(n),raw:i.data.datasets[r].data[n],formattedValue:a,dataset:s.getDataset(),dataIndex:n,datasetIndex:r,element:t}}function pa(i,e){let t=i.chart.ctx,{body:r,footer:n,title:s}=i,{boxWidth:o,boxHeight:a}=e,l=ot(e.bodyFont),c=ot(e.titleFont),u=ot(e.footerFont),f=s.length,d=n.length,h=r.length,m=ht(e.padding),p=m.height,g=0,b=r.reduce((T,v)=>T+v.before.length+v.lines.length+v.after.length,0);if(b+=i.beforeBody.length+i.afterBody.length,f&&(p+=f*c.lineHeight+(f-1)*e.titleSpacing+e.titleMarginBottom),b){let T=e.displayColors?Math.max(a,l.lineHeight):l.lineHeight;p+=h*T+(b-h)*l.lineHeight+(b-1)*e.bodySpacing}d&&(p+=e.footerMarginTop+d*u.lineHeight+(d-1)*e.footerSpacing);let x=0,w=function(T){g=Math.max(g,t.measureText(T).width+x)};return t.save(),t.font=c.string,Q(i.title,w),t.font=l.string,Q(i.beforeBody.concat(i.afterBody),w),x=e.displayColors?o+2+e.boxPadding:0,Q(r,T=>{Q(T.before,w),Q(T.lines,w),Q(T.after,w)}),x=0,t.font=u.string,Q(i.footer,w),t.restore(),g+=m.width,{width:g,height:p}}function lh(i,e){let{y:t,height:r}=e;return t<r/2?"top":t>i.height-r/2?"bottom":"center"}function ch(i,e,t,r){let{x:n,width:s}=r,o=t.caretSize+t.caretPadding;if(i==="left"&&n+s+o>e.width||i==="right"&&n-s-o<0)return!0}function uh(i,e,t,r){let{x:n,width:s}=t,{width:o,chartArea:{left:a,right:l}}=i,c="center";return r==="center"?c=n<=(a+l)/2?"left":"right":n<=s/2?c="left":n>=o-s/2&&(c="right"),ch(c,i,e,t)&&(c="center"),c}function ga(i,e,t){let r=t.yAlign||e.yAlign||lh(i,t);return{xAlign:t.xAlign||e.xAlign||uh(i,e,t,r),yAlign:r}}function fh(i,e){let{x:t,width:r}=i;return e==="right"?t-=r:e==="center"&&(t-=r/2),t}function dh(i,e,t){let{y:r,height:n}=i;return e==="top"?r+=t:e==="bottom"?r-=n+t:r-=n/2,r}function ba(i,e,t,r){let{caretSize:n,caretPadding:s,cornerRadius:o}=i,{xAlign:a,yAlign:l}=t,c=n+s,{topLeft:u,topRight:f,bottomLeft:d,bottomRight:h}=oe(o),m=fh(e,a),p=dh(e,l,c);return l==="center"?a==="left"?m+=c:a==="right"&&(m-=c):a==="left"?m-=Math.max(u,d)+n:a==="right"&&(m+=Math.max(f,h)+n),{x:lt(m,0,r.width-e.width),y:lt(p,0,r.height-e.height)}}function nr(i,e,t){let r=ht(t.padding);return e==="center"?i.x+i.width/2:e==="right"?i.x+i.width-r.right:i.x+r.left}function xa(i){return Nt([],Xt(i))}function hh(i,e,t){return qt(i,{tooltip:e,tooltipItems:t,type:"tooltip"})}function va(i,e){let t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?i.override(t):i}var Ga={beforeTitle:Ft,title(i){if(i.length>0){let e=i[0],t=e.chart.data.labels,r=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(r>0&&e.dataIndex<r)return t[e.dataIndex]}return""},afterTitle:Ft,beforeBody:Ft,beforeLabel:Ft,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let e=i.dataset.label||"";e&&(e+=": ");let t=i.formattedValue;return U(t)||(e+=t),e},labelColor(i){let t=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(i){let t=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:Ft,afterBody:Ft,beforeFooter:Ft,footer:Ft,afterFooter:Ft};function xt(i,e,t,r){let n=i[e].call(t,r);return typeof n>"u"?Ga[e].call(t,r):n}var ya=(()=>{class i extends It{static positioners=pi;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let t=this._cachedAnimations;if(t)return t;let r=this.chart,n=this.options.setContext(this.getContext()),s=n.enabled&&r.options.animation&&n.animations,o=new lr(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=hh(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,r){let{callbacks:n}=r,s=xt(n,"beforeTitle",this,t),o=xt(n,"title",this,t),a=xt(n,"afterTitle",this,t),l=[];return l=Nt(l,Xt(s)),l=Nt(l,Xt(o)),l=Nt(l,Xt(a)),l}getBeforeBody(t,r){return xa(xt(r.callbacks,"beforeBody",this,t))}getBody(t,r){let{callbacks:n}=r,s=[];return Q(t,o=>{let a={before:[],lines:[],after:[]},l=va(n,o);Nt(a.before,Xt(xt(l,"beforeLabel",this,o))),Nt(a.lines,xt(l,"label",this,o)),Nt(a.after,Xt(xt(l,"afterLabel",this,o))),s.push(a)}),s}getAfterBody(t,r){return xa(xt(r.callbacks,"afterBody",this,t))}getFooter(t,r){let{callbacks:n}=r,s=xt(n,"beforeFooter",this,t),o=xt(n,"footer",this,t),a=xt(n,"afterFooter",this,t),l=[];return l=Nt(l,Xt(s)),l=Nt(l,Xt(o)),l=Nt(l,Xt(a)),l}_createItems(t){let r=this._active,n=this.chart.data,s=[],o=[],a=[],l=[],c,u;for(c=0,u=r.length;c<u;++c)l.push(ah(this.chart,r[c]));return t.filter&&(l=l.filter((f,d,h)=>t.filter(f,d,h,n))),t.itemSort&&(l=l.sort((f,d)=>t.itemSort(f,d,n))),Q(l,f=>{let d=va(t.callbacks,f);s.push(xt(d,"labelColor",this,f)),o.push(xt(d,"labelPointStyle",this,f)),a.push(xt(d,"labelTextColor",this,f))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=l,l}update(t,r){let n=this.options.setContext(this.getContext()),s=this._active,o,a=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{let l=pi[n.position].call(this,s,this._eventPosition);a=this._createItems(n),this.title=this.getTitle(a,n),this.beforeBody=this.getBeforeBody(a,n),this.body=this.getBody(a,n),this.afterBody=this.getAfterBody(a,n),this.footer=this.getFooter(a,n);let c=this._size=pa(this,n),u=Object.assign({},l,c),f=ga(this.chart,n,u),d=ba(n,u,f,this.chart);this.xAlign=f.xAlign,this.yAlign=f.yAlign,o={opacity:1,x:d.x,y:d.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:r})}drawCaret(t,r,n,s){let o=this.getCaretPosition(t,n,s);r.lineTo(o.x1,o.y1),r.lineTo(o.x2,o.y2),r.lineTo(o.x3,o.y3)}getCaretPosition(t,r,n){let{xAlign:s,yAlign:o}=this,{caretSize:a,cornerRadius:l}=n,{topLeft:c,topRight:u,bottomLeft:f,bottomRight:d}=oe(l),{x:h,y:m}=t,{width:p,height:g}=r,b,x,w,T,v,_;return o==="center"?(v=m+g/2,s==="left"?(b=h,x=b-a,T=v+a,_=v-a):(b=h+p,x=b+a,T=v-a,_=v+a),w=b):(s==="left"?x=h+Math.max(c,f)+a:s==="right"?x=h+p-Math.max(u,d)-a:x=this.caretX,o==="top"?(T=m,v=T-a,b=x-a,w=x+a):(T=m+g,v=T+a,b=x+a,w=x-a),_=T),{x1:b,x2:x,x3:w,y1:T,y2:v,y3:_}}drawTitle(t,r,n){let s=this.title,o=s.length,a,l,c;if(o){let u=be(n.rtl,this.x,this.width);for(t.x=nr(this,n.titleAlign,n),r.textAlign=u.textAlign(n.titleAlign),r.textBaseline="middle",a=ot(n.titleFont),l=n.titleSpacing,r.fillStyle=n.titleColor,r.font=a.string,c=0;c<o;++c)r.fillText(s[c],u.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+l,c+1===o&&(t.y+=n.titleMarginBottom-l)}}_drawColorBox(t,r,n,s,o){let a=this.labelColors[n],l=this.labelPointStyles[n],{boxHeight:c,boxWidth:u}=o,f=ot(o.bodyFont),d=nr(this,"left",o),h=s.x(d),m=c<f.lineHeight?(f.lineHeight-c)/2:0,p=r.y+m;if(o.usePointStyle){let g={radius:Math.min(u,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},b=s.leftForLtr(h,u)+u/2,x=p+c/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Xi(t,g,b,x),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Xi(t,g,b,x)}else{t.lineWidth=V(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;let g=s.leftForLtr(h,u),b=s.leftForLtr(s.xPlus(h,1),u-2),x=oe(a.borderRadius);Object.values(x).some(w=>w!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,We(t,{x:g,y:p,w:u,h:c,radius:x}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),We(t,{x:b,y:p+1,w:u-2,h:c-2,radius:x}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(g,p,u,c),t.strokeRect(g,p,u,c),t.fillStyle=a.backgroundColor,t.fillRect(b,p+1,u-2,c-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,r,n){let{body:s}=this,{bodySpacing:o,bodyAlign:a,displayColors:l,boxHeight:c,boxWidth:u,boxPadding:f}=n,d=ot(n.bodyFont),h=d.lineHeight,m=0,p=be(n.rtl,this.x,this.width),g=function(O){r.fillText(O,p.x(t.x+m),t.y+h/2),t.y+=h+o},b=p.textAlign(a),x,w,T,v,_,P,C;for(r.textAlign=a,r.textBaseline="middle",r.font=d.string,t.x=nr(this,b,n),r.fillStyle=n.bodyColor,Q(this.beforeBody,g),m=l&&b!=="right"?a==="center"?u/2+f:u+2+f:0,v=0,P=s.length;v<P;++v){for(x=s[v],w=this.labelTextColors[v],r.fillStyle=w,Q(x.before,g),T=x.lines,l&&T.length&&(this._drawColorBox(r,t,v,p,n),h=Math.max(d.lineHeight,c)),_=0,C=T.length;_<C;++_)g(T[_]),h=d.lineHeight;Q(x.after,g)}m=0,h=d.lineHeight,Q(this.afterBody,g),t.y-=o}drawFooter(t,r,n){let s=this.footer,o=s.length,a,l;if(o){let c=be(n.rtl,this.x,this.width);for(t.x=nr(this,n.footerAlign,n),t.y+=n.footerMarginTop,r.textAlign=c.textAlign(n.footerAlign),r.textBaseline="middle",a=ot(n.footerFont),r.fillStyle=n.footerColor,r.font=a.string,l=0;l<o;++l)r.fillText(s[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+n.footerSpacing}}drawBackground(t,r,n,s){let{xAlign:o,yAlign:a}=this,{x:l,y:c}=t,{width:u,height:f}=n,{topLeft:d,topRight:h,bottomLeft:m,bottomRight:p}=oe(s.cornerRadius);r.fillStyle=s.backgroundColor,r.strokeStyle=s.borderColor,r.lineWidth=s.borderWidth,r.beginPath(),r.moveTo(l+d,c),a==="top"&&this.drawCaret(t,r,n,s),r.lineTo(l+u-h,c),r.quadraticCurveTo(l+u,c,l+u,c+h),a==="center"&&o==="right"&&this.drawCaret(t,r,n,s),r.lineTo(l+u,c+f-p),r.quadraticCurveTo(l+u,c+f,l+u-p,c+f),a==="bottom"&&this.drawCaret(t,r,n,s),r.lineTo(l+m,c+f),r.quadraticCurveTo(l,c+f,l,c+f-m),a==="center"&&o==="left"&&this.drawCaret(t,r,n,s),r.lineTo(l,c+d),r.quadraticCurveTo(l,c,l+d,c),r.closePath(),r.fill(),s.borderWidth>0&&r.stroke()}_updateAnimationTarget(t){let r=this.chart,n=this.$animations,s=n&&n.x,o=n&&n.y;if(s||o){let a=pi[t.position].call(this,this._active,this._eventPosition);if(!a)return;let l=this._size=pa(this,t),c=Object.assign({},a,this._size),u=ga(r,t,c),f=ba(t,c,u,r);(s._to!==f.x||o._to!==f.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=l.width,this.height=l.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,f))}}_willRender(){return!!this.opacity}draw(t){let r=this.options.setContext(this.getContext()),n=this.opacity;if(!n)return;this._updateAnimationTarget(r);let s={width:this.width,height:this.height},o={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;let a=ht(r.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;r.enabled&&l&&(t.save(),t.globalAlpha=n,this.drawBackground(o,t,s,r),In(t,r.textDirection),o.y+=a.top,this.drawTitle(o,t,r),this.drawBody(o,t,r),this.drawFooter(o,t,r),Ln(t,r.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,r){let n=this._active,s=t.map(({datasetIndex:l,index:c})=>{let u=this.chart.getDatasetMeta(l);if(!u)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:u.data[c],index:c}}),o=!si(n,s),a=this._positionChanged(s,r);(o||a)&&(this._active=s,this._eventPosition=r,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,r,n=!0){if(r&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let s=this.options,o=this._active||[],a=this._getActiveElements(t,o,r,n),l=this._positionChanged(a,t),c=r||!si(a,o)||l;return c&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,r))),c}_getActiveElements(t,r,n,s){let o=this.options;if(t.type==="mouseout")return[];if(!s)return r.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);let a=this.chart.getElementsAtEventForMode(t,o.mode,o,n);return o.reverse&&a.reverse(),a}_positionChanged(t,r){let{caretX:n,caretY:s,options:o}=this,a=pi[o.position].call(this,t,r);return a!==!1&&(n!==a.x||s!==a.y)}}return i})(),mh={id:"tooltip",_element:ya,positioners:pi,afterInit(i,e,t){t&&(i.tooltip=new ya({chart:i,options:t}))},beforeUpdate(i,e,t){i.tooltip&&i.tooltip.initialize(t)},reset(i,e,t){i.tooltip&&i.tooltip.initialize(t)},afterDraw(i){let e=i.tooltip;if(e&&e._willRender()){let t={tooltip:e};if(i.notifyPlugins("beforeTooltipDraw",Ai(Oe({},t),{cancelable:!0}))===!1)return;e.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",t)}},afterEvent(i,e){if(i.tooltip){let t=e.replay;i.tooltip.handleEvent(e.event,t,e.inChartArea)&&(e.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,e)=>e.bodyFont.size,boxWidth:(i,e)=>e.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:Ga},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"]},ph=Object.freeze({__proto__:null,Colors:Cd,Decimation:Ad,Filler:Kd,Legend:rh,SubTitle:oh,Title:sh,Tooltip:mh}),gh=(i,e,t,r)=>(typeof e=="string"?(t=i.push(e)-1,r.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function bh(i,e,t,r){let n=i.indexOf(e);if(n===-1)return gh(i,e,t,r);let s=i.lastIndexOf(e);return n!==s?t:n}var xh=(i,e)=>i===null?null:lt(Math.round(i),0,e);function _a(i){let e=this.getLabels();return i>=0&&i<e.length?e[i]:i}var vh=(()=>{class i extends ye{static id="category";static defaults={ticks:{callback:_a}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){let r=this._addedLabels;if(r.length){let n=this.getLabels();for(let{index:s,label:o}of r)n[s]===o&&n.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,r){if(U(t))return null;let n=this.getLabels();return r=isFinite(r)&&n[r]===t?r:bh(n,t,W(r,t),this._addedLabels),xh(r,n.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:r}=this.getUserBounds(),{min:n,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(n=0),r||(s=this.getLabels().length-1)),this.min=n,this.max=s}buildTicks(){let t=this.min,r=this.max,n=this.options.offset,s=[],o=this.getLabels();o=t===0&&r===o.length-1?o:o.slice(t,r+1),this._valueRange=Math.max(o.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let a=t;a<=r;a++)s.push({value:a});return s}getLabelForValue(t){return _a.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){let r=this.ticks;return t<0||t>r.length-1?null:this.getPixelForValue(r[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}return i})();function yh(i,e){let t=[],{bounds:n,step:s,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:f,includeBounds:d}=i,h=s||1,m=u-1,{min:p,max:g}=e,b=!U(o),x=!U(a),w=!U(c),T=(g-p)/(f+1),v=fn((g-p)/m/h)*h,_,P,C,O;if(v<1e-14&&!b&&!x)return[{value:p},{value:g}];O=Math.ceil(g/v)-Math.floor(p/v),O>m&&(v=fn(O*v/m/h)*h),U(l)||(_=Math.pow(10,l),v=Math.ceil(v*_)/_),n==="ticks"?(P=Math.floor(p/v)*v,C=Math.ceil(g/v)*v):(P=p,C=g),b&&x&&s&&oo((a-o)/s,v/1e3)?(O=Math.round(Math.min((a-o)/v,u)),v=(a-o)/O,P=o,C=a):w?(P=b?o:P,C=x?a:C,O=c-1,v=(C-P)/O):(O=(C-P)/v,Fe(O,Math.round(O),v/1e3)?O=Math.round(O):O=Math.ceil(O));let R=Math.max(hn(v),hn(P));_=Math.pow(10,U(l)?R:l),P=Math.round(P*_)/_,C=Math.round(C*_)/_;let z=0;for(b&&(d&&P!==o?(t.push({value:o}),P<o&&z++,Fe(Math.round((P+z*v)*_)/_,o,wa(o,T,i))&&z++):P<o&&z++);z<O;++z){let H=Math.round((P+z*v)*_)/_;if(x&&H>a)break;t.push({value:H})}return x&&d&&C!==a?t.length&&Fe(t[t.length-1].value,a,wa(a,T,i))?t[t.length-1].value=a:t.push({value:a}):(!x||C===a)&&t.push({value:C}),t}function wa(i,e,{horizontal:t,minRotation:r}){let n=Dt(r),s=(t?Math.sin(n):Math.cos(n))||.001,o=.75*e*(""+i).length;return Math.min(e/s,o)}var Ue=class extends ye{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return U(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){let{beginAtZero:e}=this.options,{minDefined:t,maxDefined:r}=this.getUserBounds(),{min:n,max:s}=this,o=l=>n=t?n:l,a=l=>s=r?s:l;if(e){let l=At(n),c=At(s);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(n===s){let l=s===0?1:Math.abs(s*.05);a(s+l),e||o(n-l)}this.min=n,this.max=s}getTickLimit(){let e=this.options.ticks,{maxTicksLimit:t,stepSize:r}=e,n;return r?(n=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),t=t||11),t&&(n=Math.min(t,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let e=this.options,t=e.ticks,r=this.getTickLimit();r=Math.max(2,r);let n={maxTicks:r,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},s=this._range||this,o=yh(n,s);return e.bounds==="ticks"&&dn(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){let e=this.ticks,t=this.min,r=this.max;if(super.configure(),this.options.offset&&e.length){let n=(r-t)/Math.max(e.length-1,1)/2;t-=n,r+=n}this._startValue=t,this._endValue=r,this._valueRange=r-t}getLabelForValue(e){return Ne(e,this.chart.options.locale,this.options.ticks.format)}},cs=class extends Ue{static id="linear";static defaults={ticks:{callback:oi.formatters.numeric}};determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=nt(e)?e:0,this.max=nt(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){let e=this.isHorizontal(),t=e?this.width:this.height,r=Dt(this.options.ticks.minRotation),n=(e?Math.sin(r):Math.cos(r))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,s.lineHeight/n))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}},xi=i=>Math.floor(Vt(i)),ve=(i,e)=>Math.pow(10,xi(i)+e);function Ma(i){return i/Math.pow(10,xi(i))===1}function Ta(i,e,t){let r=Math.pow(10,t),n=Math.floor(i/r);return Math.ceil(e/r)-n}function _h(i,e){let t=e-i,r=xi(t);for(;Ta(i,e,r)>10;)r++;for(;Ta(i,e,r)<10;)r--;return Math.min(r,xi(i))}function wh(i,{min:e,max:t}){e=bt(i.min,e);let r=[],n=xi(e),s=_h(e,t),o=s<0?Math.pow(10,Math.abs(s)):1,a=Math.pow(10,s),l=n>s?Math.pow(10,n):0,c=Math.round((e-l)*o)/o,u=Math.floor((e-l)/a/10)*a*10,f=Math.floor((c-u)/Math.pow(10,s)),d=bt(i.min,Math.round((l+u+f*Math.pow(10,s))*o)/o);for(;d<t;)r.push({value:d,major:Ma(d),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(s++,f=2,o=s>=0?1:o),d=Math.round((l+u+f*Math.pow(10,s))*o)/o;let h=bt(i.max,d);return r.push({value:h,major:Ma(h),significand:f}),r}var us=class extends ye{static id="logarithmic";static defaults={ticks:{callback:oi.formatters.logarithmic,major:{enabled:!0}}};constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){let r=Ue.prototype.parse.apply(this,[e,t]);if(r===0){this._zero=!0;return}return nt(r)&&r>0?r:null}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=nt(e)?Math.max(0,e):null,this.max=nt(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!nt(this._userMin)&&(this.min=e===ve(this.min,0)?ve(this.min,-1):ve(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:e,maxDefined:t}=this.getUserBounds(),r=this.min,n=this.max,s=a=>r=e?r:a,o=a=>n=t?n:a;r===n&&(r<=0?(s(1),o(10)):(s(ve(r,-1)),o(ve(n,1)))),r<=0&&s(ve(n,-1)),n<=0&&o(ve(r,1)),this.min=r,this.max=n}buildTicks(){let e=this.options,t={min:this._userMin,max:this._userMax},r=wh(t,this);return e.bounds==="ticks"&&dn(r,this,"value"),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(e){return e===void 0?"0":Ne(e,this.chart.options.locale,this.options.ticks.format)}configure(){let e=this.min;super.configure(),this._startValue=Vt(e),this._valueRange=Vt(this.max)-Vt(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Vt(e)-this._startValue)/this._valueRange)}getValueForPixel(e){let t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}};function fs(i){let e=i.ticks;if(e.display&&i.display){let t=ht(e.backdropPadding);return W(e.font&&e.font.size,it.font.size)+t.height}return 0}function Mh(i,e,t){return t=tt(t)?t:[t],{w:go(i,e.string,t),h:t.length*e.lineHeight}}function ka(i,e,t,r,n){return i===r||i===n?{start:e-t/2,end:e+t/2}:i<r||i>n?{start:e-t,end:e}:{start:e,end:e+t}}function Th(i){let e={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},t=Object.assign({},e),r=[],n=[],s=i._pointLabels.length,o=i.options.pointLabels,a=o.centerPointLabels?$/s:0;for(let l=0;l<s;l++){let c=o.setContext(i.getPointLabelContext(l));n[l]=c.padding;let u=i.getPointPosition(l,i.drawingArea+n[l],a),f=ot(c.font),d=Mh(i.ctx,f,i._pointLabels[l]);r[l]=d;let h=ft(i.getIndexAngle(l)+a),m=Math.round(Vi(h)),p=ka(m,u.x,d.w,0,180),g=ka(m,u.y,d.h,90,270);kh(t,e,h,p,g)}i.setCenterPoint(e.l-t.l,t.r-e.r,e.t-t.t,t.b-e.b),i._pointLabelItems=Ph(i,r,n)}function kh(i,e,t,r,n){let s=Math.abs(Math.sin(t)),o=Math.abs(Math.cos(t)),a=0,l=0;r.start<e.l?(a=(e.l-r.start)/s,i.l=Math.min(i.l,e.l-a)):r.end>e.r&&(a=(r.end-e.r)/s,i.r=Math.max(i.r,e.r+a)),n.start<e.t?(l=(e.t-n.start)/o,i.t=Math.min(i.t,e.t-l)):n.end>e.b&&(l=(n.end-e.b)/o,i.b=Math.max(i.b,e.b+l))}function Dh(i,e,t){let r=i.drawingArea,{extra:n,additionalAngle:s,padding:o,size:a}=t,l=i.getPointPosition(e,r+n+o,s),c=Math.round(Vi(ft(l.angle+st))),u=Ah(l.y,a.h,c),f=Oh(c),d=Sh(l.x,a.w,f);return{visible:!0,x:l.x,y:u,textAlign:f,left:d,top:u,right:d+a.w,bottom:u+a.h}}function Ch(i,e){if(!e)return!0;let{left:t,top:r,right:n,bottom:s}=i;return!(Rt({x:t,y:r},e)||Rt({x:t,y:s},e)||Rt({x:n,y:r},e)||Rt({x:n,y:s},e))}function Ph(i,e,t){let r=[],n=i._pointLabels.length,s=i.options,{centerPointLabels:o,display:a}=s.pointLabels,l={extra:fs(s)/2,additionalAngle:o?$/n:0},c;for(let u=0;u<n;u++){l.padding=t[u],l.size=e[u];let f=Dh(i,u,l);r.push(f),a==="auto"&&(f.visible=Ch(f,c),f.visible&&(c=f))}return r}function Oh(i){return i===0||i===180?"center":i<180?"left":"right"}function Sh(i,e,t){return t==="right"?i-=e:t==="center"&&(i-=e/2),i}function Ah(i,e,t){return t===90||t===270?i-=e/2:(t>270||t<90)&&(i-=e),i}function Ih(i,e,t){let{left:r,top:n,right:s,bottom:o}=t,{backdropColor:a}=e;if(!U(a)){let l=oe(e.borderRadius),c=ht(e.backdropPadding);i.fillStyle=a;let u=r-c.left,f=n-c.top,d=s-r+c.width,h=o-n+c.height;Object.values(l).some(m=>m!==0)?(i.beginPath(),We(i,{x:u,y:f,w:d,h,radius:l}),i.fill()):i.fillRect(u,f,d,h)}}function Lh(i,e){let{ctx:t,options:{pointLabels:r}}=i;for(let n=e-1;n>=0;n--){let s=i._pointLabelItems[n];if(!s.visible)continue;let o=r.setContext(i.getPointLabelContext(n));Ih(t,o,s);let a=ot(o.font),{x:l,y:c,textAlign:u}=s;se(t,i._pointLabels[n],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function Ka(i,e,t,r){let{ctx:n}=i;if(t)n.arc(i.xCenter,i.yCenter,e,0,et);else{let s=i.getPointPosition(0,e);n.moveTo(s.x,s.y);for(let o=1;o<r;o++)s=i.getPointPosition(o,e),n.lineTo(s.x,s.y)}}function Eh(i,e,t,r,n){let s=i.ctx,o=e.circular,{color:a,lineWidth:l}=e;!o&&!r||!a||!l||t<0||(s.save(),s.strokeStyle=a,s.lineWidth=l,s.setLineDash(n.dash||[]),s.lineDashOffset=n.dashOffset,s.beginPath(),Ka(i,t,o,r),s.closePath(),s.stroke(),s.restore())}function Rh(i,e,t){return qt(i,{label:t,index:e,type:"pointLabel"})}var ds=class extends Ue{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:oi.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let e=this._padding=ht(fs(this.options)/2),t=this.width=this.maxWidth-e.width,r=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+r/2+e.top),this.drawingArea=Math.floor(Math.min(t,r)/2)}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!1);this.min=nt(e)&&!isNaN(e)?e:0,this.max=nt(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/fs(this.options))}generateTickLabels(e){Ue.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((t,r)=>{let n=Z(this.options.pointLabels.callback,[t,r],this);return n||n===0?n:""}).filter((t,r)=>this.chart.getDataVisibility(r))}fit(){let e=this.options;e.display&&e.pointLabels.display?Th(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,r,n){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((r-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,r,n))}getIndexAngle(e){let t=et/(this._pointLabels.length||1),r=this.options.startAngle||0;return ft(e*t+Dt(r))}getDistanceFromCenterForValue(e){if(U(e))return NaN;let t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(U(e))return NaN;let t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){let t=this._pointLabels||[];if(e>=0&&e<t.length){let r=t[e];return Rh(this.getContext(),e,r)}}getPointPosition(e,t,r=0){let n=this.getIndexAngle(e)-st+r;return{x:Math.cos(n)*t+this.xCenter,y:Math.sin(n)*t+this.yCenter,angle:n}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){let{left:t,top:r,right:n,bottom:s}=this._pointLabelItems[e];return{left:t,top:r,right:n,bottom:s}}drawBackground(){let{backgroundColor:e,grid:{circular:t}}=this.options;if(e){let r=this.ctx;r.save(),r.beginPath(),Ka(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),r.closePath(),r.fillStyle=e,r.fill(),r.restore()}}drawGrid(){let e=this.ctx,t=this.options,{angleLines:r,grid:n,border:s}=t,o=this._pointLabels.length,a,l,c;if(t.pointLabels.display&&Lh(this,o),n.display&&this.ticks.forEach((u,f)=>{if(f!==0||f===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);let d=this.getContext(f),h=n.setContext(d),m=s.setContext(d);Eh(this,h,l,o,m)}}),r.display){for(e.save(),a=o-1;a>=0;a--){let u=r.setContext(this.getPointLabelContext(a)),{color:f,lineWidth:d}=u;!d||!f||(e.lineWidth=d,e.strokeStyle=f,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(t.reverse?this.min:this.max),c=this.getPointPosition(a,l),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(c.x,c.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){let e=this.ctx,t=this.options,r=t.ticks;if(!r.display)return;let n=this.getIndexAngle(0),s,o;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(n),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!t.reverse)return;let c=r.setContext(this.getContext(l)),u=ot(c.font);if(s=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){e.font=u.string,o=e.measureText(a.label).width,e.fillStyle=c.backdropColor;let f=ht(c.backdropPadding);e.fillRect(-o/2-f.left,-s-u.size/2-f.top,o+f.width,u.size+f.height)}se(e,a.label,0,-s,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),e.restore()}drawTitle(){}},gr={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}},vt=Object.keys(gr);function Da(i,e){return i-e}function Ca(i,e){if(U(e))return null;let t=i._adapter,{parser:r,round:n,isoWeekday:s}=i._parseOpts,o=e;return typeof r=="function"&&(o=r(o)),nt(o)||(o=typeof r=="string"?t.parse(o,r):t.parse(o)),o===null?null:(n&&(o=n==="week"&&(ge(s)||s===!0)?t.startOf(o,"isoWeek",s):t.startOf(o,n)),+o)}function Pa(i,e,t,r){let n=vt.length;for(let s=vt.indexOf(i);s<n-1;++s){let o=gr[vt[s]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((t-e)/(a*o.size))<=r)return vt[s]}return vt[n-1]}function Fh(i,e,t,r,n){for(let s=vt.length-1;s>=vt.indexOf(t);s--){let o=vt[s];if(gr[o].common&&i._adapter.diff(n,r,o)>=e-1)return o}return vt[t?vt.indexOf(t):0]}function zh(i){for(let e=vt.indexOf(i)+1,t=vt.length;e<t;++e)if(gr[vt[e]].common)return vt[e]}function Oa(i,e,t){if(!t)i[e]=!0;else if(t.length){let{lo:r,hi:n}=ji(t,e),s=t[r]>=e?t[r]:t[n];i[s]=!0}}function Nh(i,e,t,r){let n=i._adapter,s=+n.startOf(e[0].value,r),o=e[e.length-1].value,a,l;for(a=s;a<=o;a=+n.add(a,1,r))l=t[a],l>=0&&(e[l].major=!0);return e}function Sa(i,e,t){let r=[],n={},s=e.length,o,a;for(o=0;o<s;++o)a=e[o],n[a]=o,r.push({value:a,major:!1});return s===0||!t?r:Nh(i,r,n,t)}var hs=(()=>{class i extends ye{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,r={}){let n=t.time||(t.time={}),s=this._adapter=new gs._date(t.adapters.date);s.init(r),Ee(n.displayFormats,s.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=r.normalized}parse(t,r){return t===void 0?null:Ca(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,r=this._adapter,n=t.time.unit||"day",{min:s,max:o,minDefined:a,maxDefined:l}=this.getUserBounds();function c(u){!a&&!isNaN(u.min)&&(s=Math.min(s,u.min)),!l&&!isNaN(u.max)&&(o=Math.max(o,u.max))}(!a||!l)&&(c(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&c(this.getMinMax(!1))),s=nt(s)&&!isNaN(s)?s:+r.startOf(Date.now(),n),o=nt(o)&&!isNaN(o)?o:+r.endOf(Date.now(),n)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){let t=this.getLabelTimestamps(),r=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(r=t[0],n=t[t.length-1]),{min:r,max:n}}buildTicks(){let t=this.options,r=t.time,n=t.ticks,s=n.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);let o=this.min,a=this.max,l=co(s,o,a);return this._unit=r.unit||(n.autoSkip?Pa(r.minUnit,this.min,this.max,this._getLabelCapacity(o)):Fh(this,l.length,r.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit==="year"?void 0:zh(this._unit),this.initOffsets(s),t.reverse&&l.reverse(),Sa(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let r=0,n=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?r=1-s:r=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?n=o:n=(o-this.getDecimalForValue(t[t.length-2]))/2);let a=t.length<3?.5:.25;r=lt(r,0,a),n=lt(n,0,a),this._offsets={start:r,end:n,factor:1/(r+1+n)}}_generate(){let t=this._adapter,r=this.min,n=this.max,s=this.options,o=s.time,a=o.unit||Pa(o.minUnit,r,n,this._getLabelCapacity(r)),l=W(s.ticks.stepSize,1),c=a==="week"?o.isoWeekday:!1,u=ge(c)||c===!0,f={},d=r,h,m;if(u&&(d=+t.startOf(d,"isoWeek",c)),d=+t.startOf(d,u?"day":a),t.diff(n,r,a)>1e5*l)throw new Error(r+" and "+n+" are too far apart with stepSize of "+l+" "+a);let p=s.ticks.source==="data"&&this.getDataTimestamps();for(h=d,m=0;h<n;h=+t.add(h,l,a),m++)Oa(f,h,p);return(h===n||s.bounds==="ticks"||m===1)&&Oa(f,h,p),Object.keys(f).sort(Da).map(g=>+g)}getLabelForValue(t){let r=this._adapter,n=this.options.time;return n.tooltipFormat?r.format(t,n.tooltipFormat):r.format(t,n.displayFormats.datetime)}format(t,r){let s=this.options.time.displayFormats,o=this._unit,a=r||s[o];return this._adapter.format(t,a)}_tickFormatFunction(t,r,n,s){let o=this.options,a=o.ticks.callback;if(a)return Z(a,[t,r,n],this);let l=o.time.displayFormats,c=this._unit,u=this._majorUnit,f=c&&l[c],d=u&&l[u],h=n[r],m=u&&d&&h&&h.major;return this._adapter.format(t,s||(m?d:f))}generateTickLabels(t){let r,n,s;for(r=0,n=t.length;r<n;++r)s=t[r],s.label=this._tickFormatFunction(s.value,r,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){let r=this._offsets,n=this.getDecimalForValue(t);return this.getPixelForDecimal((r.start+n)*r.factor)}getValueForPixel(t){let r=this._offsets,n=this.getDecimalForPixel(t)/r.factor-r.end;return this.min+n*(this.max-this.min)}_getLabelSize(t){let r=this.options.ticks,n=this.ctx.measureText(t).width,s=Dt(this.isHorizontal()?r.maxRotation:r.minRotation),o=Math.cos(s),a=Math.sin(s),l=this._resolveTickFontOptions(0).size;return{w:n*o+l*a,h:n*a+l*o}}_getLabelCapacity(t){let r=this.options.time,n=r.displayFormats,s=n[r.unit]||n.millisecond,o=this._tickFormatFunction(t,0,Sa(this,[t],this._majorUnit),s),a=this._getLabelSize(o),l=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return l>0?l:1}getDataTimestamps(){let t=this._cache.data||[],r,n;if(t.length)return t;let s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(r=0,n=s.length;r<n;++r)t=t.concat(s[r].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){let t=this._cache.labels||[],r,n;if(t.length)return t;let s=this.getLabels();for(r=0,n=s.length;r<n;++r)t.push(Ca(this,s[r]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return gn(t.sort(Da))}}return i})();function sr(i,e,t){let r=0,n=i.length-1,s,o,a,l;t?(e>=i[r].pos&&e<=i[n].pos&&({lo:r,hi:n}=Et(i,"pos",e)),{pos:s,time:a}=i[r],{pos:o,time:l}=i[n]):(e>=i[r].time&&e<=i[n].time&&({lo:r,hi:n}=Et(i,"time",e)),{time:s,pos:a}=i[r],{time:o,pos:l}=i[n]);let c=o-s;return c?a+(l-a)*(e-s)/c:a}var ms=class extends hs{static id="timeseries";static defaults=hs.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=sr(t,this.min),this._tableRange=sr(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){let{min:t,max:r}=this,n=[],s=[],o,a,l,c,u;for(o=0,a=e.length;o<a;++o)c=e[o],c>=t&&c<=r&&n.push(c);if(n.length<2)return[{time:t,pos:0},{time:r,pos:1}];for(o=0,a=n.length;o<a;++o)u=n[o+1],l=n[o-1],c=n[o],Math.round((u+l)/2)!==c&&s.push({time:c,pos:o/(a-1)});return s}_generate(){let e=this.min,t=this.max,r=super.getDataTimestamps();return(!r.includes(e)||!r.length)&&r.splice(0,0,e),(!r.includes(t)||r.length===1)&&r.push(t),r.sort((n,s)=>n-s)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;let t=this.getDataTimestamps(),r=this.getLabelTimestamps();return t.length&&r.length?e=this.normalize(t.concat(r)):e=t.length?t:r,e=this._cache.all=e,e}getDecimalForValue(e){return(sr(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){let t=this._offsets,r=this.getDecimalForPixel(e)/t.factor-t.end;return sr(this._table,r*this._tableRange+this._minPos,!0)}},Wh=Object.freeze({__proto__:null,CategoryScale:vh,LinearScale:cs,LogarithmicScale:us,RadialLinearScale:ds,TimeScale:hs,TimeSeriesScale:ms}),Fp=[$u,yd,ph,Wh];function gt(i){"@babel/helpers - typeof";return gt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gt(i)}function F(i){if(i===null||i===!0||i===!1)return NaN;var e=Number(i);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function y(i,e){if(e.length<i)throw new TypeError(i+" argument"+(i>1?"s":"")+" required, but only "+e.length+" present")}function D(i){y(1,arguments);var e=Object.prototype.toString.call(i);return i instanceof Date||gt(i)==="object"&&e==="[object Date]"?new Date(i.getTime()):typeof i=="number"||e==="[object Number]"?new Date(i):((typeof i=="string"||e==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Ve(i,e){y(2,arguments);var t=D(i),r=F(e);return isNaN(r)?new Date(NaN):(r&&t.setDate(t.getDate()+r),t)}function ue(i,e){y(2,arguments);var t=D(i),r=F(e);if(isNaN(r))return new Date(NaN);if(!r)return t;var n=t.getDate(),s=new Date(t.getTime());s.setMonth(t.getMonth()+r+1,0);var o=s.getDate();return n>=o?s:(t.setFullYear(s.getFullYear(),s.getMonth(),n),t)}function Ct(i,e){y(2,arguments);var t=D(i).getTime(),r=F(e);return new Date(t+r)}var Hh=36e5;function br(i,e){y(2,arguments);var t=F(e);return Ct(i,t*Hh)}var Bh={};function pt(){return Bh}function yi(i,e){var t,r,n,s,o,a,l,c;y(1,arguments);var u=pt(),f=F((t=(r=(n=(s=e?.weekStartsOn)!==null&&s!==void 0?s:e==null||(o=e.locale)===null||o===void 0||(a=o.options)===null||a===void 0?void 0:a.weekStartsOn)!==null&&n!==void 0?n:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&t!==void 0?t:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=D(i),h=d.getDay(),m=(h<f?7:0)+h-f;return d.setDate(d.getDate()-m),d.setHours(0,0,0,0),d}function fe(i){var e=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds()));return e.setUTCFullYear(i.getFullYear()),i.getTime()-e.getTime()}function _e(i){y(1,arguments);var e=D(i);return e.setHours(0,0,0,0),e}var Yh=864e5;function bs(i,e){y(2,arguments);var t=_e(i),r=_e(e),n=t.getTime()-fe(t),s=r.getTime()-fe(r);return Math.round((n-s)/Yh)}var Uh=6e4;function xr(i,e){y(2,arguments);var t=F(e);return Ct(i,t*Uh)}function vr(i,e){y(2,arguments);var t=F(e),r=t*3;return ue(i,r)}function yr(i,e){y(2,arguments);var t=F(e);return Ct(i,t*1e3)}function _r(i,e){y(2,arguments);var t=F(e),r=t*7;return Ve(i,r)}function wr(i,e){y(2,arguments);var t=F(e);return ue(i,t*12)}function de(i,e){y(2,arguments);var t=D(i),r=D(e),n=t.getTime()-r.getTime();return n<0?-1:n>0?1:n}var Vh=365.2425,jh=Math.pow(10,8)*24*60*60*1e3,we=6e4,Me=36e5,Za=1e3,Vg=-jh;var qh=3600;var Ja=qh*24,jg=Ja*7,$h=Ja*Vh,Xh=$h/12,qg=Xh*3;function xs(i){return y(1,arguments),i instanceof Date||gt(i)==="object"&&Object.prototype.toString.call(i)==="[object Date]"}function je(i){if(y(1,arguments),!xs(i)&&typeof i!="number")return!1;var e=D(i);return!isNaN(Number(e))}function vs(i,e){y(2,arguments);var t=D(i),r=D(e),n=t.getFullYear()-r.getFullYear(),s=t.getMonth()-r.getMonth();return n*12+s}function ys(i,e){y(2,arguments);var t=D(i),r=D(e);return t.getFullYear()-r.getFullYear()}function tl(i,e){var t=i.getFullYear()-e.getFullYear()||i.getMonth()-e.getMonth()||i.getDate()-e.getDate()||i.getHours()-e.getHours()||i.getMinutes()-e.getMinutes()||i.getSeconds()-e.getSeconds()||i.getMilliseconds()-e.getMilliseconds();return t<0?-1:t>0?1:t}function qe(i,e){y(2,arguments);var t=D(i),r=D(e),n=tl(t,r),s=Math.abs(bs(t,r));t.setDate(t.getDate()-n*s);var o=+(tl(t,r)===-n),a=n*(s-o);return a===0?0:a}function Ht(i,e){return y(2,arguments),D(i).getTime()-D(e).getTime()}var el={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},Qh="trunc";function Bt(i){return i?el[i]:el[Qh]}function Mr(i,e,t){y(2,arguments);var r=Ht(i,e)/Me;return Bt(t?.roundingMethod)(r)}function Tr(i,e,t){y(2,arguments);var r=Ht(i,e)/we;return Bt(t?.roundingMethod)(r)}function $e(i){y(1,arguments);var e=D(i);return e.setHours(23,59,59,999),e}function Xe(i){y(1,arguments);var e=D(i),t=e.getMonth();return e.setFullYear(e.getFullYear(),t+1,0),e.setHours(23,59,59,999),e}function _s(i){y(1,arguments);var e=D(i);return $e(e).getTime()===Xe(e).getTime()}function Qe(i,e){y(2,arguments);var t=D(i),r=D(e),n=de(t,r),s=Math.abs(vs(t,r)),o;if(s<1)o=0;else{t.getMonth()===1&&t.getDate()>27&&t.setDate(30),t.setMonth(t.getMonth()-n*s);var a=de(t,r)===-n;_s(D(i))&&s===1&&de(i,r)===1&&(a=!1),o=n*(s-Number(a))}return o===0?0:o}function kr(i,e,t){y(2,arguments);var r=Qe(i,e)/3;return Bt(t?.roundingMethod)(r)}function Dr(i,e,t){y(2,arguments);var r=Ht(i,e)/1e3;return Bt(t?.roundingMethod)(r)}function Cr(i,e,t){y(2,arguments);var r=qe(i,e)/7;return Bt(t?.roundingMethod)(r)}function Pr(i,e){y(2,arguments);var t=D(i),r=D(e),n=de(t,r),s=Math.abs(ys(t,r));t.setFullYear(1584),r.setFullYear(1584);var o=de(t,r)===-n,a=n*(s-Number(o));return a===0?0:a}function Or(i){y(1,arguments);var e=D(i);return e.setSeconds(0,0),e}function Sr(i){y(1,arguments);var e=D(i),t=e.getMonth(),r=t-t%3;return e.setMonth(r,1),e.setHours(0,0,0,0),e}function Ar(i){y(1,arguments);var e=D(i);return e.setDate(1),e.setHours(0,0,0,0),e}function Ir(i){y(1,arguments);var e=D(i),t=e.getFullYear();return e.setFullYear(t+1,0,0),e.setHours(23,59,59,999),e}function Lr(i){y(1,arguments);var e=D(i),t=new Date(0);return t.setFullYear(e.getFullYear(),0,1),t.setHours(0,0,0,0),t}function Er(i){y(1,arguments);var e=D(i);return e.setMinutes(59,59,999),e}function Rr(i,e){var t,r,n,s,o,a,l,c;y(1,arguments);var u=pt(),f=F((t=(r=(n=(s=e?.weekStartsOn)!==null&&s!==void 0?s:e==null||(o=e.locale)===null||o===void 0||(a=o.options)===null||a===void 0?void 0:a.weekStartsOn)!==null&&n!==void 0?n:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&t!==void 0?t:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=D(i),h=d.getDay(),m=(h<f?-7:0)+6-(h-f);return d.setDate(d.getDate()+m),d.setHours(23,59,59,999),d}function Fr(i){y(1,arguments);var e=D(i);return e.setSeconds(59,999),e}function zr(i){y(1,arguments);var e=D(i),t=e.getMonth(),r=t-t%3+3;return e.setMonth(r,0),e.setHours(23,59,59,999),e}function Nr(i){y(1,arguments);var e=D(i);return e.setMilliseconds(999),e}function _i(i,e){y(2,arguments);var t=F(e);return Ct(i,-t)}var Gh=864e5;function ws(i){y(1,arguments);var e=D(i),t=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var r=e.getTime(),n=t-r;return Math.floor(n/Gh)+1}function Pt(i){y(1,arguments);var e=1,t=D(i),r=t.getUTCDay(),n=(r<e?7:0)+r-e;return t.setUTCDate(t.getUTCDate()-n),t.setUTCHours(0,0,0,0),t}function wi(i){y(1,arguments);var e=D(i),t=e.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(t+1,0,4),r.setUTCHours(0,0,0,0);var n=Pt(r),s=new Date(0);s.setUTCFullYear(t,0,4),s.setUTCHours(0,0,0,0);var o=Pt(s);return e.getTime()>=n.getTime()?t+1:e.getTime()>=o.getTime()?t:t-1}function Ms(i){y(1,arguments);var e=wi(i),t=new Date(0);t.setUTCFullYear(e,0,4),t.setUTCHours(0,0,0,0);var r=Pt(t);return r}var Kh=6048e5;function Mi(i){y(1,arguments);var e=D(i),t=Pt(e).getTime()-Ms(e).getTime();return Math.round(t/Kh)+1}function _t(i,e){var t,r,n,s,o,a,l,c;y(1,arguments);var u=pt(),f=F((t=(r=(n=(s=e?.weekStartsOn)!==null&&s!==void 0?s:e==null||(o=e.locale)===null||o===void 0||(a=o.options)===null||a===void 0?void 0:a.weekStartsOn)!==null&&n!==void 0?n:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&t!==void 0?t:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=D(i),h=d.getUTCDay(),m=(h<f?7:0)+h-f;return d.setUTCDate(d.getUTCDate()-m),d.setUTCHours(0,0,0,0),d}function Te(i,e){var t,r,n,s,o,a,l,c;y(1,arguments);var u=D(i),f=u.getUTCFullYear(),d=pt(),h=F((t=(r=(n=(s=e?.firstWeekContainsDate)!==null&&s!==void 0?s:e==null||(o=e.locale)===null||o===void 0||(a=o.options)===null||a===void 0?void 0:a.firstWeekContainsDate)!==null&&n!==void 0?n:d.firstWeekContainsDate)!==null&&r!==void 0?r:(l=d.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&t!==void 0?t:1);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var m=new Date(0);m.setUTCFullYear(f+1,0,h),m.setUTCHours(0,0,0,0);var p=_t(m,e),g=new Date(0);g.setUTCFullYear(f,0,h),g.setUTCHours(0,0,0,0);var b=_t(g,e);return u.getTime()>=p.getTime()?f+1:u.getTime()>=b.getTime()?f:f-1}function Ts(i,e){var t,r,n,s,o,a,l,c;y(1,arguments);var u=pt(),f=F((t=(r=(n=(s=e?.firstWeekContainsDate)!==null&&s!==void 0?s:e==null||(o=e.locale)===null||o===void 0||(a=o.options)===null||a===void 0?void 0:a.firstWeekContainsDate)!==null&&n!==void 0?n:u.firstWeekContainsDate)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&t!==void 0?t:1),d=Te(i,e),h=new Date(0);h.setUTCFullYear(d,0,f),h.setUTCHours(0,0,0,0);var m=_t(h,e);return m}var Zh=6048e5;function Ti(i,e){y(1,arguments);var t=D(i),r=_t(t,e).getTime()-Ts(t,e).getTime();return Math.round(r/Zh)+1}function X(i,e){for(var t=i<0?"-":"",r=Math.abs(i).toString();r.length<e;)r="0"+r;return t+r}var Jh={y:function(e,t){var r=e.getUTCFullYear(),n=r>0?r:1-r;return X(t==="yy"?n%100:n,t.length)},M:function(e,t){var r=e.getUTCMonth();return t==="M"?String(r+1):X(r+1,2)},d:function(e,t){return X(e.getUTCDate(),t.length)},a:function(e,t){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(e,t){return X(e.getUTCHours()%12||12,t.length)},H:function(e,t){return X(e.getUTCHours(),t.length)},m:function(e,t){return X(e.getUTCMinutes(),t.length)},s:function(e,t){return X(e.getUTCSeconds(),t.length)},S:function(e,t){var r=t.length,n=e.getUTCMilliseconds(),s=Math.floor(n*Math.pow(10,r-3));return X(s,t.length)}},Qt=Jh;var Ge={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},tm={G:function(e,t,r){var n=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){var n=e.getUTCFullYear(),s=n>0?n:1-n;return r.ordinalNumber(s,{unit:"year"})}return Qt.y(e,t)},Y:function(e,t,r,n){var s=Te(e,n),o=s>0?s:1-s;if(t==="YY"){var a=o%100;return X(a,2)}return t==="Yo"?r.ordinalNumber(o,{unit:"year"}):X(o,t.length)},R:function(e,t){var r=wi(e);return X(r,t.length)},u:function(e,t){var r=e.getUTCFullYear();return X(r,t.length)},Q:function(e,t,r){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return X(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return X(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){var n=e.getUTCMonth();switch(t){case"M":case"MM":return Qt.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){var n=e.getUTCMonth();switch(t){case"L":return String(n+1);case"LL":return X(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){var s=Ti(e,n);return t==="wo"?r.ordinalNumber(s,{unit:"week"}):X(s,t.length)},I:function(e,t,r){var n=Mi(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):X(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getUTCDate(),{unit:"date"}):Qt.d(e,t)},D:function(e,t,r){var n=ws(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):X(n,t.length)},E:function(e,t,r){var n=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){var s=e.getUTCDay(),o=(s-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return X(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(s,{width:"short",context:"formatting"});case"eeee":default:return r.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){var s=e.getUTCDay(),o=(s-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return X(o,t.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(s,{width:"narrow",context:"standalone"});case"cccccc":return r.day(s,{width:"short",context:"standalone"});case"cccc":default:return r.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,r){var n=e.getUTCDay(),s=n===0?7:n;switch(t){case"i":return String(s);case"ii":return X(s,t.length);case"io":return r.ordinalNumber(s,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){var n=e.getUTCHours(),s=n/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,r){var n=e.getUTCHours(),s;switch(n===12?s=Ge.noon:n===0?s=Ge.midnight:s=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,r){var n=e.getUTCHours(),s;switch(n>=17?s=Ge.evening:n>=12?s=Ge.afternoon:n>=4?s=Ge.morning:s=Ge.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){var n=e.getUTCHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return Qt.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getUTCHours(),{unit:"hour"}):Qt.H(e,t)},K:function(e,t,r){var n=e.getUTCHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):X(n,t.length)},k:function(e,t,r){var n=e.getUTCHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):X(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):Qt.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):Qt.s(e,t)},S:function(e,t){return Qt.S(e,t)},X:function(e,t,r,n){var s=n._originalDate||e,o=s.getTimezoneOffset();if(o===0)return"Z";switch(t){case"X":return rl(o);case"XXXX":case"XX":return ke(o);case"XXXXX":case"XXX":default:return ke(o,":")}},x:function(e,t,r,n){var s=n._originalDate||e,o=s.getTimezoneOffset();switch(t){case"x":return rl(o);case"xxxx":case"xx":return ke(o);case"xxxxx":case"xxx":default:return ke(o,":")}},O:function(e,t,r,n){var s=n._originalDate||e,o=s.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+il(o,":");case"OOOO":default:return"GMT"+ke(o,":")}},z:function(e,t,r,n){var s=n._originalDate||e,o=s.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+il(o,":");case"zzzz":default:return"GMT"+ke(o,":")}},t:function(e,t,r,n){var s=n._originalDate||e,o=Math.floor(s.getTime()/1e3);return X(o,t.length)},T:function(e,t,r,n){var s=n._originalDate||e,o=s.getTime();return X(o,t.length)}};function il(i,e){var t=i>0?"-":"+",r=Math.abs(i),n=Math.floor(r/60),s=r%60;if(s===0)return t+String(n);var o=e||"";return t+String(n)+o+X(s,2)}function rl(i,e){if(i%60===0){var t=i>0?"-":"+";return t+X(Math.abs(i)/60,2)}return ke(i,e)}function ke(i,e){var t=e||"",r=i>0?"-":"+",n=Math.abs(i),s=X(Math.floor(n/60),2),o=X(n%60,2);return r+s+t+o}var nl=tm;var sl=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},ol=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},em=function(e,t){var r=e.match(/(P+)(p+)?/)||[],n=r[1],s=r[2];if(!s)return sl(e,t);var o;switch(n){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",sl(n,t)).replace("{{time}}",ol(s,t))},im={p:ol,P:em},ki=im;var rm=["D","DD"],nm=["YY","YYYY"];function Wr(i){return rm.indexOf(i)!==-1}function Hr(i){return nm.indexOf(i)!==-1}function Ke(i,e,t){if(i==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(i==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(i==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(i==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var sm={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},om=function(e,t,r){var n,s=sm[e];return typeof s=="string"?n=s:t===1?n=s.one:n=s.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n},al=om;function Di(i){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.width?String(e.width):i.defaultWidth,r=i.formats[t]||i.formats[i.defaultWidth];return r}}var am={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},lm={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},cm={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},um={date:Di({formats:am,defaultWidth:"full"}),time:Di({formats:lm,defaultWidth:"full"}),dateTime:Di({formats:cm,defaultWidth:"full"})},ll=um;var fm={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},dm=function(e,t,r,n){return fm[e]},cl=dm;function De(i){return function(e,t){var r=t!=null&&t.context?String(t.context):"standalone",n;if(r==="formatting"&&i.formattingValues){var s=i.defaultFormattingWidth||i.defaultWidth,o=t!=null&&t.width?String(t.width):s;n=i.formattingValues[o]||i.formattingValues[s]}else{var a=i.defaultWidth,l=t!=null&&t.width?String(t.width):i.defaultWidth;n=i.values[l]||i.values[a]}var c=i.argumentCallback?i.argumentCallback(e):e;return n[c]}}var hm={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},mm={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},pm={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},gm={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},bm={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},xm={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},vm=function(e,t){var r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},ym={ordinalNumber:vm,era:De({values:hm,defaultWidth:"wide"}),quarter:De({values:mm,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:De({values:pm,defaultWidth:"wide"}),day:De({values:gm,defaultWidth:"wide"}),dayPeriod:De({values:bm,defaultWidth:"wide",formattingValues:xm,defaultFormattingWidth:"wide"})},ul=ym;function Ce(i){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.width,n=r&&i.matchPatterns[r]||i.matchPatterns[i.defaultMatchWidth],s=e.match(n);if(!s)return null;var o=s[0],a=r&&i.parsePatterns[r]||i.parsePatterns[i.defaultParseWidth],l=Array.isArray(a)?wm(a,function(f){return f.test(o)}):_m(a,function(f){return f.test(o)}),c;c=i.valueCallback?i.valueCallback(l):l,c=t.valueCallback?t.valueCallback(c):c;var u=e.slice(o.length);return{value:c,rest:u}}}function _m(i,e){for(var t in i)if(i.hasOwnProperty(t)&&e(i[t]))return t}function wm(i,e){for(var t=0;t<i.length;t++)if(e(i[t]))return t}function ks(i){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.match(i.matchPattern);if(!r)return null;var n=r[0],s=e.match(i.parsePattern);if(!s)return null;var o=i.valueCallback?i.valueCallback(s[0]):s[0];o=t.valueCallback?t.valueCallback(o):o;var a=e.slice(n.length);return{value:o,rest:a}}}var Mm=/^(\d+)(th|st|nd|rd)?/i,Tm=/\d+/i,km={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Dm={any:[/^b/i,/^(a|c)/i]},Cm={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Pm={any:[/1/i,/2/i,/3/i,/4/i]},Om={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Sm={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Am={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Im={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Lm={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Em={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Rm={ordinalNumber:ks({matchPattern:Mm,parsePattern:Tm,valueCallback:function(e){return parseInt(e,10)}}),era:Ce({matchPatterns:km,defaultMatchWidth:"wide",parsePatterns:Dm,defaultParseWidth:"any"}),quarter:Ce({matchPatterns:Cm,defaultMatchWidth:"wide",parsePatterns:Pm,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:Ce({matchPatterns:Om,defaultMatchWidth:"wide",parsePatterns:Sm,defaultParseWidth:"any"}),day:Ce({matchPatterns:Am,defaultMatchWidth:"wide",parsePatterns:Im,defaultParseWidth:"any"}),dayPeriod:Ce({matchPatterns:Lm,defaultMatchWidth:"any",parsePatterns:Em,defaultParseWidth:"any"})},fl=Rm;var Fm={code:"en-US",formatDistance:al,formatLong:ll,formatRelative:cl,localize:ul,match:fl,options:{weekStartsOn:0,firstWeekContainsDate:1}},dl=Fm;var Br=dl;var zm=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Nm=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Wm=/^'([^]*?)'?$/,Hm=/''/g,Bm=/[a-zA-Z]/;function Yr(i,e,t){var r,n,s,o,a,l,c,u,f,d,h,m,p,g,b,x,w,T;y(2,arguments);var v=String(e),_=pt(),P=(r=(n=t?.locale)!==null&&n!==void 0?n:_.locale)!==null&&r!==void 0?r:Br,C=F((s=(o=(a=(l=t?.firstWeekContainsDate)!==null&&l!==void 0?l:t==null||(c=t.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&a!==void 0?a:_.firstWeekContainsDate)!==null&&o!==void 0?o:(f=_.locale)===null||f===void 0||(d=f.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&s!==void 0?s:1);if(!(C>=1&&C<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var O=F((h=(m=(p=(g=t?.weekStartsOn)!==null&&g!==void 0?g:t==null||(b=t.locale)===null||b===void 0||(x=b.options)===null||x===void 0?void 0:x.weekStartsOn)!==null&&p!==void 0?p:_.weekStartsOn)!==null&&m!==void 0?m:(w=_.locale)===null||w===void 0||(T=w.options)===null||T===void 0?void 0:T.weekStartsOn)!==null&&h!==void 0?h:0);if(!(O>=0&&O<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!P.localize)throw new RangeError("locale must contain localize property");if(!P.formatLong)throw new RangeError("locale must contain formatLong property");var R=D(i);if(!je(R))throw new RangeError("Invalid time value");var z=fe(R),H=_i(R,z),rt={firstWeekContainsDate:C,weekStartsOn:O,locale:P,_originalDate:R},ut=v.match(Nm).map(function(N){var Y=N[0];if(Y==="p"||Y==="P"){var G=ki[Y];return G(N,P.formatLong)}return N}).join("").match(zm).map(function(N){if(N==="''")return"'";var Y=N[0];if(Y==="'")return Ym(N);var G=nl[Y];if(G)return!(t!=null&&t.useAdditionalWeekYearTokens)&&Hr(N)&&Ke(N,e,String(i)),!(t!=null&&t.useAdditionalDayOfYearTokens)&&Wr(N)&&Ke(N,e,String(i)),G(H,N,P.localize,rt);if(Y.match(Bm))throw new RangeError("Format string contains an unescaped latin alphabet character `"+Y+"`");return N}).join("");return ut}function Ym(i){var e=i.match(Wm);return e?e[1].replace(Hm,"'"):i}function Ds(i,e){if(i==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(i[t]=e[t]);return i}function Cs(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,r=Array(e);t<e;t++)r[t]=i[t];return r}function hl(i,e){if(i){if(typeof i=="string")return Cs(i,e);var t={}.toString.call(i).slice(8,-1);return t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set"?Array.from(i):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Cs(i,e):void 0}}function Ps(i,e){var t=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(!t){if(Array.isArray(i)||(t=hl(i))||e&&i&&typeof i.length=="number"){t&&(i=t);var r=0,n=function(){};return{s:n,n:function(){return r>=i.length?{done:!0}:{done:!1,value:i[r++]}},e:function(c){throw c},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
4
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,o=!0,a=!1;return{s:function(){t=t.call(i)},n:function(){var c=t.next();return o=c.done,c},e:function(c){a=!0,s=c},f:function(){try{o||t.return==null||t.return()}finally{if(a)throw s}}}}function k(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Ur(i,e){return Ur=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},Ur(i,e)}function I(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),e&&Ur(i,e)}function Ci(i){return Ci=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ci(i)}function Os(){try{var i=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Os=function(){return!!i})()}function ml(i,e){if(e&&(gt(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return k(i)}function L(i){var e=Os();return function(){var t,r=Ci(i);if(e){var n=Ci(this).constructor;t=Reflect.construct(r,arguments,n)}else t=r.apply(this,arguments);return ml(this,t)}}function S(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function pl(i,e){if(gt(i)!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(gt(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function Vr(i){var e=pl(i,"string");return gt(e)=="symbol"?e:e+""}function gl(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,Vr(r.key),r)}}function A(i,e,t){return e&&gl(i.prototype,e),t&&gl(i,t),Object.defineProperty(i,"prototype",{writable:!1}),i}function M(i,e,t){return(e=Vr(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var Um=10,bl=(function(){function i(){S(this,i),M(this,"priority",void 0),M(this,"subPriority",0)}return A(i,[{key:"validate",value:function(t,r){return!0}}]),i})(),xl=(function(i){I(t,i);var e=L(t);function t(r,n,s,o,a){var l;return S(this,t),l=e.call(this),l.value=r,l.validateValue=n,l.setValue=s,l.priority=o,a&&(l.subPriority=a),l}return A(t,[{key:"validate",value:function(n,s){return this.validateValue(n,this.value,s)}},{key:"set",value:function(n,s,o){return this.setValue(n,s,this.value,o)}}]),t})(bl),vl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(k(r),"priority",Um),M(k(r),"subPriority",-1),r}return A(t,[{key:"set",value:function(n,s){if(s.timestampIsSet)return n;var o=new Date(0);return o.setFullYear(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()),o.setHours(n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds(),n.getUTCMilliseconds()),o}}]),t})(bl);var E=(function(){function i(){S(this,i),M(this,"incompatibleTokens",void 0),M(this,"priority",void 0),M(this,"subPriority",void 0)}return A(i,[{key:"run",value:function(t,r,n,s){var o=this.parse(t,r,n,s);return o?{setter:new xl(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}},{key:"validate",value:function(t,r,n){return!0}}]),i})();var yl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(k(r),"priority",140),M(k(r),"incompatibleTokens",["R","u","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){switch(s){case"G":case"GG":case"GGG":return o.era(n,{width:"abbreviated"})||o.era(n,{width:"narrow"});case"GGGGG":return o.era(n,{width:"narrow"});case"GGGG":default:return o.era(n,{width:"wide"})||o.era(n,{width:"abbreviated"})||o.era(n,{width:"narrow"})}}},{key:"set",value:function(n,s,o){return s.era=o,n.setUTCFullYear(o,0,1),n.setUTCHours(0,0,0,0),n}}]),t})(E);var q={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Ot={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function K(i,e){return i&&{value:e(i.value),rest:i.rest}}function j(i,e){var t=e.match(i);return t?{value:parseInt(t[0],10),rest:e.slice(t[0].length)}:null}function St(i,e){var t=e.match(i);if(!t)return null;if(t[0]==="Z")return{value:0,rest:e.slice(1)};var r=t[1]==="+"?1:-1,n=t[2]?parseInt(t[2],10):0,s=t[3]?parseInt(t[3],10):0,o=t[5]?parseInt(t[5],10):0;return{value:r*(n*Me+s*we+o*Za),rest:e.slice(t[0].length)}}function jr(i){return j(q.anyDigitsSigned,i)}function B(i,e){switch(i){case 1:return j(q.singleDigit,e);case 2:return j(q.twoDigits,e);case 3:return j(q.threeDigits,e);case 4:return j(q.fourDigits,e);default:return j(new RegExp("^\\d{1,"+i+"}"),e)}}function Ze(i,e){switch(i){case 1:return j(q.singleDigitSigned,e);case 2:return j(q.twoDigitsSigned,e);case 3:return j(q.threeDigitsSigned,e);case 4:return j(q.fourDigitsSigned,e);default:return j(new RegExp("^-?\\d{1,"+i+"}"),e)}}function Je(i){switch(i){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function qr(i,e){var t=e>0,r=t?e:1-e,n;if(r<=50)n=i||100;else{var s=r+50,o=Math.floor(s/100)*100,a=i>=s%100;n=i+o-(a?100:0)}return t?n:1-n}function $r(i){return i%400===0||i%4===0&&i%100!==0}var _l=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(k(r),"priority",130),M(k(r),"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){var a=function(c){return{year:c,isTwoDigitYear:s==="yy"}};switch(s){case"y":return K(B(4,n),a);case"yo":return K(o.ordinalNumber(n,{unit:"year"}),a);default:return K(B(s.length,n),a)}}},{key:"validate",value:function(n,s){return s.isTwoDigitYear||s.year>0}},{key:"set",value:function(n,s,o){var a=n.getUTCFullYear();if(o.isTwoDigitYear){var l=qr(o.year,a);return n.setUTCFullYear(l,0,1),n.setUTCHours(0,0,0,0),n}var c=!("era"in s)||s.era===1?o.year:1-o.year;return n.setUTCFullYear(c,0,1),n.setUTCHours(0,0,0,0),n}}]),t})(E);var wl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(k(r),"priority",130),M(k(r),"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){var a=function(c){return{year:c,isTwoDigitYear:s==="YY"}};switch(s){case"Y":return K(B(4,n),a);case"Yo":return K(o.ordinalNumber(n,{unit:"year"}),a);default:return K(B(s.length,n),a)}}},{key:"validate",value:function(n,s){return s.isTwoDigitYear||s.year>0}},{key:"set",value:function(n,s,o,a){var l=Te(n,a);if(o.isTwoDigitYear){var c=qr(o.year,l);return n.setUTCFullYear(c,0,a.firstWeekContainsDate),n.setUTCHours(0,0,0,0),_t(n,a)}var u=!("era"in s)||s.era===1?o.year:1-o.year;return n.setUTCFullYear(u,0,a.firstWeekContainsDate),n.setUTCHours(0,0,0,0),_t(n,a)}}]),t})(E);var Ml=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(k(r),"priority",130),M(k(r),"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]),r}return A(t,[{key:"parse",value:function(n,s){return s==="R"?Ze(4,n):Ze(s.length,n)}},{key:"set",value:function(n,s,o){var a=new Date(0);return a.setUTCFullYear(o,0,4),a.setUTCHours(0,0,0,0),Pt(a)}}]),t})(E);var Tl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(k(r),"priority",130),M(k(r),"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"]),r}return A(t,[{key:"parse",value:function(n,s){return s==="u"?Ze(4,n):Ze(s.length,n)}},{key:"set",value:function(n,s,o){return n.setUTCFullYear(o,0,1),n.setUTCHours(0,0,0,0),n}}]),t})(E);var kl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(k(r),"priority",120),M(k(r),"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){switch(s){case"Q":case"QQ":return B(s.length,n);case"Qo":return o.ordinalNumber(n,{unit:"quarter"});case"QQQ":return o.quarter(n,{width:"abbreviated",context:"formatting"})||o.quarter(n,{width:"narrow",context:"formatting"});case"QQQQQ":return o.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(n,{width:"wide",context:"formatting"})||o.quarter(n,{width:"abbreviated",context:"formatting"})||o.quarter(n,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(n,s){return s>=1&&s<=4}},{key:"set",value:function(n,s,o){return n.setUTCMonth((o-1)*3,1),n.setUTCHours(0,0,0,0),n}}]),t})(E);var Dl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(k(r),"priority",120),M(k(r),"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){switch(s){case"q":case"qq":return B(s.length,n);case"qo":return o.ordinalNumber(n,{unit:"quarter"});case"qqq":return o.quarter(n,{width:"abbreviated",context:"standalone"})||o.quarter(n,{width:"narrow",context:"standalone"});case"qqqqq":return o.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(n,{width:"wide",context:"standalone"})||o.quarter(n,{width:"abbreviated",context:"standalone"})||o.quarter(n,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(n,s){return s>=1&&s<=4}},{key:"set",value:function(n,s,o){return n.setUTCMonth((o-1)*3,1),n.setUTCHours(0,0,0,0),n}}]),t})(E);var Cl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(k(r),"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]),M(k(r),"priority",110),r}return A(t,[{key:"parse",value:function(n,s,o){var a=function(c){return c-1};switch(s){case"M":return K(j(q.month,n),a);case"MM":return K(B(2,n),a);case"Mo":return K(o.ordinalNumber(n,{unit:"month"}),a);case"MMM":return o.month(n,{width:"abbreviated",context:"formatting"})||o.month(n,{width:"narrow",context:"formatting"});case"MMMMM":return o.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(n,{width:"wide",context:"formatting"})||o.month(n,{width:"abbreviated",context:"formatting"})||o.month(n,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(n,s){return s>=0&&s<=11}},{key:"set",value:function(n,s,o){return n.setUTCMonth(o,1),n.setUTCHours(0,0,0,0),n}}]),t})(E);var Pl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(k(r),"priority",110),M(k(r),"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){var a=function(c){return c-1};switch(s){case"L":return K(j(q.month,n),a);case"LL":return K(B(2,n),a);case"Lo":return K(o.ordinalNumber(n,{unit:"month"}),a);case"LLL":return o.month(n,{width:"abbreviated",context:"standalone"})||o.month(n,{width:"narrow",context:"standalone"});case"LLLLL":return o.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(n,{width:"wide",context:"standalone"})||o.month(n,{width:"abbreviated",context:"standalone"})||o.month(n,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(n,s){return s>=0&&s<=11}},{key:"set",value:function(n,s,o){return n.setUTCMonth(o,1),n.setUTCHours(0,0,0,0),n}}]),t})(E);function Ss(i,e,t){y(2,arguments);var r=D(i),n=F(e),s=Ti(r,t)-n;return r.setUTCDate(r.getUTCDate()-s*7),r}var Ol=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(k(r),"priority",100),M(k(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){switch(s){case"w":return j(q.week,n);case"wo":return o.ordinalNumber(n,{unit:"week"});default:return B(s.length,n)}}},{key:"validate",value:function(n,s){return s>=1&&s<=53}},{key:"set",value:function(n,s,o,a){return _t(Ss(n,o,a),a)}}]),t})(E);function As(i,e){y(2,arguments);var t=D(i),r=F(e),n=Mi(t)-r;return t.setUTCDate(t.getUTCDate()-n*7),t}var Sl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(k(r),"priority",100),M(k(r),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){switch(s){case"I":return j(q.week,n);case"Io":return o.ordinalNumber(n,{unit:"week"});default:return B(s.length,n)}}},{key:"validate",value:function(n,s){return s>=1&&s<=53}},{key:"set",value:function(n,s,o){return Pt(As(n,o))}}]),t})(E);var Vm=[31,28,31,30,31,30,31,31,30,31,30,31],jm=[31,29,31,30,31,30,31,31,30,31,30,31],Al=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(k(r),"priority",90),M(k(r),"subPriority",1),M(k(r),"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){switch(s){case"d":return j(q.date,n);case"do":return o.ordinalNumber(n,{unit:"date"});default:return B(s.length,n)}}},{key:"validate",value:function(n,s){var o=n.getUTCFullYear(),a=$r(o),l=n.getUTCMonth();return a?s>=1&&s<=jm[l]:s>=1&&s<=Vm[l]}},{key:"set",value:function(n,s,o){return n.setUTCDate(o),n.setUTCHours(0,0,0,0),n}}]),t})(E);var Il=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(k(r),"priority",90),M(k(r),"subpriority",1),M(k(r),"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){switch(s){case"D":case"DD":return j(q.dayOfYear,n);case"Do":return o.ordinalNumber(n,{unit:"date"});default:return B(s.length,n)}}},{key:"validate",value:function(n,s){var o=n.getUTCFullYear(),a=$r(o);return a?s>=1&&s<=366:s>=1&&s<=365}},{key:"set",value:function(n,s,o){return n.setUTCMonth(0,o),n.setUTCHours(0,0,0,0),n}}]),t})(E);function Pe(i,e,t){var r,n,s,o,a,l,c,u;y(2,arguments);var f=pt(),d=F((r=(n=(s=(o=t?.weekStartsOn)!==null&&o!==void 0?o:t==null||(a=t.locale)===null||a===void 0||(l=a.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&s!==void 0?s:f.weekStartsOn)!==null&&n!==void 0?n:(c=f.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&r!==void 0?r:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=D(i),m=F(e),p=h.getUTCDay(),g=m%7,b=(g+7)%7,x=(b<d?7:0)+m-p;return h.setUTCDate(h.getUTCDate()+x),h}var Ll=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(k(r),"priority",90),M(k(r),"incompatibleTokens",["D","i","e","c","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){switch(s){case"E":case"EE":case"EEE":return o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"EEEEE":return o.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"EEEE":default:return o.day(n,{width:"wide",context:"formatting"})||o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(n,s){return s>=0&&s<=6}},{key:"set",value:function(n,s,o,a){return n=Pe(n,o,a),n.setUTCHours(0,0,0,0),n}}]),t})(E);var El=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(k(r),"priority",90),M(k(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o,a){var l=function(u){var f=Math.floor((u-1)/7)*7;return(u+a.weekStartsOn+6)%7+f};switch(s){case"e":case"ee":return K(B(s.length,n),l);case"eo":return K(o.ordinalNumber(n,{unit:"day"}),l);case"eee":return o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"eeeee":return o.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"eeee":default:return o.day(n,{width:"wide",context:"formatting"})||o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(n,s){return s>=0&&s<=6}},{key:"set",value:function(n,s,o,a){return n=Pe(n,o,a),n.setUTCHours(0,0,0,0),n}}]),t})(E);var Rl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(k(r),"priority",90),M(k(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o,a){var l=function(u){var f=Math.floor((u-1)/7)*7;return(u+a.weekStartsOn+6)%7+f};switch(s){case"c":case"cc":return K(B(s.length,n),l);case"co":return K(o.ordinalNumber(n,{unit:"day"}),l);case"ccc":return o.day(n,{width:"abbreviated",context:"standalone"})||o.day(n,{width:"short",context:"standalone"})||o.day(n,{width:"narrow",context:"standalone"});case"ccccc":return o.day(n,{width:"narrow",context:"standalone"});case"cccccc":return o.day(n,{width:"short",context:"standalone"})||o.day(n,{width:"narrow",context:"standalone"});case"cccc":default:return o.day(n,{width:"wide",context:"standalone"})||o.day(n,{width:"abbreviated",context:"standalone"})||o.day(n,{width:"short",context:"standalone"})||o.day(n,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(n,s){return s>=0&&s<=6}},{key:"set",value:function(n,s,o,a){return n=Pe(n,o,a),n.setUTCHours(0,0,0,0),n}}]),t})(E);function Is(i,e){y(2,arguments);var t=F(e);t%7===0&&(t=t-7);var r=1,n=D(i),s=n.getUTCDay(),o=t%7,a=(o+7)%7,l=(a<r?7:0)+t-s;return n.setUTCDate(n.getUTCDate()+l),n}var Fl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(k(r),"priority",90),M(k(r),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){var a=function(c){return c===0?7:c};switch(s){case"i":case"ii":return B(s.length,n);case"io":return o.ordinalNumber(n,{unit:"day"});case"iii":return K(o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"}),a);case"iiiii":return K(o.day(n,{width:"narrow",context:"formatting"}),a);case"iiiiii":return K(o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"}),a);case"iiii":default:return K(o.day(n,{width:"wide",context:"formatting"})||o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"}),a)}}},{key:"validate",value:function(n,s){return s>=1&&s<=7}},{key:"set",value:function(n,s,o){return n=Is(n,o),n.setUTCHours(0,0,0,0),n}}]),t})(E);var zl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(k(r),"priority",80),M(k(r),"incompatibleTokens",["b","B","H","k","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){switch(s){case"a":case"aa":case"aaa":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaaa":return o.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(n,{width:"wide",context:"formatting"})||o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(n,s,o){return n.setUTCHours(Je(o),0,0,0),n}}]),t})(E);var Nl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(k(r),"priority",80),M(k(r),"incompatibleTokens",["a","B","H","k","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){switch(s){case"b":case"bb":case"bbb":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbbb":return o.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(n,{width:"wide",context:"formatting"})||o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(n,s,o){return n.setUTCHours(Je(o),0,0,0),n}}]),t})(E);var Wl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(k(r),"priority",80),M(k(r),"incompatibleTokens",["a","b","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){switch(s){case"B":case"BB":case"BBB":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBBB":return o.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(n,{width:"wide",context:"formatting"})||o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(n,s,o){return n.setUTCHours(Je(o),0,0,0),n}}]),t})(E);var Hl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(k(r),"priority",70),M(k(r),"incompatibleTokens",["H","K","k","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){switch(s){case"h":return j(q.hour12h,n);case"ho":return o.ordinalNumber(n,{unit:"hour"});default:return B(s.length,n)}}},{key:"validate",value:function(n,s){return s>=1&&s<=12}},{key:"set",value:function(n,s,o){var a=n.getUTCHours()>=12;return a&&o<12?n.setUTCHours(o+12,0,0,0):!a&&o===12?n.setUTCHours(0,0,0,0):n.setUTCHours(o,0,0,0),n}}]),t})(E);var Bl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(k(r),"priority",70),M(k(r),"incompatibleTokens",["a","b","h","K","k","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){switch(s){case"H":return j(q.hour23h,n);case"Ho":return o.ordinalNumber(n,{unit:"hour"});default:return B(s.length,n)}}},{key:"validate",value:function(n,s){return s>=0&&s<=23}},{key:"set",value:function(n,s,o){return n.setUTCHours(o,0,0,0),n}}]),t})(E);var Yl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(k(r),"priority",70),M(k(r),"incompatibleTokens",["h","H","k","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){switch(s){case"K":return j(q.hour11h,n);case"Ko":return o.ordinalNumber(n,{unit:"hour"});default:return B(s.length,n)}}},{key:"validate",value:function(n,s){return s>=0&&s<=11}},{key:"set",value:function(n,s,o){var a=n.getUTCHours()>=12;return a&&o<12?n.setUTCHours(o+12,0,0,0):n.setUTCHours(o,0,0,0),n}}]),t})(E);var Ul=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(k(r),"priority",70),M(k(r),"incompatibleTokens",["a","b","h","H","K","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){switch(s){case"k":return j(q.hour24h,n);case"ko":return o.ordinalNumber(n,{unit:"hour"});default:return B(s.length,n)}}},{key:"validate",value:function(n,s){return s>=1&&s<=24}},{key:"set",value:function(n,s,o){var a=o<=24?o%24:o;return n.setUTCHours(a,0,0,0),n}}]),t})(E);var Vl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(k(r),"priority",60),M(k(r),"incompatibleTokens",["t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){switch(s){case"m":return j(q.minute,n);case"mo":return o.ordinalNumber(n,{unit:"minute"});default:return B(s.length,n)}}},{key:"validate",value:function(n,s){return s>=0&&s<=59}},{key:"set",value:function(n,s,o){return n.setUTCMinutes(o,0,0),n}}]),t})(E);var jl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(k(r),"priority",50),M(k(r),"incompatibleTokens",["t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){switch(s){case"s":return j(q.second,n);case"so":return o.ordinalNumber(n,{unit:"second"});default:return B(s.length,n)}}},{key:"validate",value:function(n,s){return s>=0&&s<=59}},{key:"set",value:function(n,s,o){return n.setUTCSeconds(o,0),n}}]),t})(E);var ql=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(k(r),"priority",30),M(k(r),"incompatibleTokens",["t","T"]),r}return A(t,[{key:"parse",value:function(n,s){var o=function(l){return Math.floor(l*Math.pow(10,-s.length+3))};return K(B(s.length,n),o)}},{key:"set",value:function(n,s,o){return n.setUTCMilliseconds(o),n}}]),t})(E);var $l=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(k(r),"priority",10),M(k(r),"incompatibleTokens",["t","T","x"]),r}return A(t,[{key:"parse",value:function(n,s){switch(s){case"X":return St(Ot.basicOptionalMinutes,n);case"XX":return St(Ot.basic,n);case"XXXX":return St(Ot.basicOptionalSeconds,n);case"XXXXX":return St(Ot.extendedOptionalSeconds,n);case"XXX":default:return St(Ot.extended,n)}}},{key:"set",value:function(n,s,o){return s.timestampIsSet?n:new Date(n.getTime()-o)}}]),t})(E);var Xl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(k(r),"priority",10),M(k(r),"incompatibleTokens",["t","T","X"]),r}return A(t,[{key:"parse",value:function(n,s){switch(s){case"x":return St(Ot.basicOptionalMinutes,n);case"xx":return St(Ot.basic,n);case"xxxx":return St(Ot.basicOptionalSeconds,n);case"xxxxx":return St(Ot.extendedOptionalSeconds,n);case"xxx":default:return St(Ot.extended,n)}}},{key:"set",value:function(n,s,o){return s.timestampIsSet?n:new Date(n.getTime()-o)}}]),t})(E);var Ql=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(k(r),"priority",40),M(k(r),"incompatibleTokens","*"),r}return A(t,[{key:"parse",value:function(n){return jr(n)}},{key:"set",value:function(n,s,o){return[new Date(o*1e3),{timestampIsSet:!0}]}}]),t})(E);var Gl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(k(r),"priority",20),M(k(r),"incompatibleTokens","*"),r}return A(t,[{key:"parse",value:function(n){return jr(n)}},{key:"set",value:function(n,s,o){return[new Date(o),{timestampIsSet:!0}]}}]),t})(E);var Kl={G:new yl,y:new _l,Y:new wl,R:new Ml,u:new Tl,Q:new kl,q:new Dl,M:new Cl,L:new Pl,w:new Ol,I:new Sl,d:new Al,D:new Il,E:new Ll,e:new El,c:new Rl,i:new Fl,a:new zl,b:new Nl,B:new Wl,h:new Hl,H:new Bl,K:new Yl,k:new Ul,m:new Vl,s:new jl,S:new ql,X:new $l,x:new Xl,t:new Ql,T:new Gl};var qm=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,$m=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Xm=/^'([^]*?)'?$/,Qm=/''/g,Gm=/\S/,Km=/[a-zA-Z]/;function Xr(i,e,t,r){var n,s,o,a,l,c,u,f,d,h,m,p,g,b,x,w,T,v;y(3,arguments);var _=String(i),P=String(e),C=pt(),O=(n=(s=r?.locale)!==null&&s!==void 0?s:C.locale)!==null&&n!==void 0?n:Br;if(!O.match)throw new RangeError("locale must contain match property");var R=F((o=(a=(l=(c=r?.firstWeekContainsDate)!==null&&c!==void 0?c:r==null||(u=r.locale)===null||u===void 0||(f=u.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&l!==void 0?l:C.firstWeekContainsDate)!==null&&a!==void 0?a:(d=C.locale)===null||d===void 0||(h=d.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&o!==void 0?o:1);if(!(R>=1&&R<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var z=F((m=(p=(g=(b=r?.weekStartsOn)!==null&&b!==void 0?b:r==null||(x=r.locale)===null||x===void 0||(w=x.options)===null||w===void 0?void 0:w.weekStartsOn)!==null&&g!==void 0?g:C.weekStartsOn)!==null&&p!==void 0?p:(T=C.locale)===null||T===void 0||(v=T.options)===null||v===void 0?void 0:v.weekStartsOn)!==null&&m!==void 0?m:0);if(!(z>=0&&z<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(P==="")return _===""?D(t):new Date(NaN);var H={firstWeekContainsDate:R,weekStartsOn:z,locale:O},rt=[new vl],ut=P.match($m).map(function(ct){var J=ct[0];if(J in ki){var Tt=ki[J];return Tt(ct,O.formatLong)}return ct}).join("").match(qm),N=[],Y=Ps(ut),G;try{var yt=function(){var J=G.value;!(r!=null&&r.useAdditionalWeekYearTokens)&&Hr(J)&&Ke(J,P,i),!(r!=null&&r.useAdditionalDayOfYearTokens)&&Wr(J)&&Ke(J,P,i);var Tt=J[0],Si=Kl[Tt];if(Si){var Es=Si.incompatibleTokens;if(Array.isArray(Es)){var Rs=N.find(function(Fs){return Es.includes(Fs.token)||Fs.token===Tt});if(Rs)throw new RangeError("The format string mustn't contain `".concat(Rs.fullToken,"` and `").concat(J,"` at the same time"))}else if(Si.incompatibleTokens==="*"&&N.length>0)throw new RangeError("The format string mustn't contain `".concat(J,"` and any other token at the same time"));N.push({token:Tt,fullToken:J});var Jr=Si.run(_,J,O.match,H);if(!Jr)return{v:new Date(NaN)};rt.push(Jr.setter),_=Jr.rest}else{if(Tt.match(Km))throw new RangeError("Format string contains an unescaped latin alphabet character `"+Tt+"`");if(J==="''"?J="'":Tt==="'"&&(J=Zm(J)),_.indexOf(J)===0)_=_.slice(J.length);else return{v:new Date(NaN)}}};for(Y.s();!(G=Y.n()).done;){var at=yt();if(gt(at)==="object")return at.v}}catch(ct){Y.e(ct)}finally{Y.f()}if(_.length>0&&Gm.test(_))return new Date(NaN);var Gt=rt.map(function(ct){return ct.priority}).sort(function(ct,J){return J-ct}).filter(function(ct,J,Tt){return Tt.indexOf(ct)===J}).map(function(ct){return rt.filter(function(J){return J.priority===ct}).sort(function(J,Tt){return Tt.subPriority-J.subPriority})}).map(function(ct){return ct[0]}),Kt=D(t);if(isNaN(Kt.getTime()))return new Date(NaN);var wt=_i(Kt,fe(Kt)),Zt={},Mt=Ps(Gt),Jt;try{for(Mt.s();!(Jt=Mt.n()).done;){var Lt=Jt.value;if(!Lt.validate(wt,H))return new Date(NaN);var Oi=Lt.set(wt,Zt,H);Array.isArray(Oi)?(wt=Oi[0],Ds(Zt,Oi[1])):wt=Oi}}catch(ct){Mt.e(ct)}finally{Mt.f()}return wt}function Zm(i){return i.match(Xm)[1].replace(Qm,"'")}function Qr(i){y(1,arguments);var e=D(i);return e.setMinutes(0,0,0),e}function Gr(i){y(1,arguments);var e=D(i);return e.setMilliseconds(0),e}function Zr(i,e){var t;y(1,arguments);var r=F((t=e?.additionalDigits)!==null&&t!==void 0?t:2);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof i=="string"||Object.prototype.toString.call(i)==="[object String]"))return new Date(NaN);var n=ip(i),s;if(n.date){var o=rp(n.date,r);s=np(o.restDateString,o.year)}if(!s||isNaN(s.getTime()))return new Date(NaN);var a=s.getTime(),l=0,c;if(n.time&&(l=sp(n.time),isNaN(l)))return new Date(NaN);if(n.timezone){if(c=op(n.timezone),isNaN(c))return new Date(NaN)}else{var u=new Date(a+l),f=new Date(0);return f.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),f.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),f}return new Date(a+l+c)}var Kr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Jm=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,tp=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,ep=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ip(i){var e={},t=i.split(Kr.dateTimeDelimiter),r;if(t.length>2)return e;if(/:/.test(t[0])?r=t[0]:(e.date=t[0],r=t[1],Kr.timeZoneDelimiter.test(e.date)&&(e.date=i.split(Kr.timeZoneDelimiter)[0],r=i.substr(e.date.length,i.length))),r){var n=Kr.timezone.exec(r);n?(e.time=r.replace(n[1],""),e.timezone=n[1]):e.time=r}return e}function rp(i,e){var t=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=i.match(t);if(!r)return{year:NaN,restDateString:""};var n=r[1]?parseInt(r[1]):null,s=r[2]?parseInt(r[2]):null;return{year:s===null?n:s*100,restDateString:i.slice((r[1]||r[2]).length)}}function np(i,e){if(e===null)return new Date(NaN);var t=i.match(Jm);if(!t)return new Date(NaN);var r=!!t[4],n=Pi(t[1]),s=Pi(t[2])-1,o=Pi(t[3]),a=Pi(t[4]),l=Pi(t[5])-1;if(r)return fp(e,a,l)?ap(e,a,l):new Date(NaN);var c=new Date(0);return!cp(e,s,o)||!up(e,n)?new Date(NaN):(c.setUTCFullYear(e,s,Math.max(n,o)),c)}function Pi(i){return i?parseInt(i):1}function sp(i){var e=i.match(tp);if(!e)return NaN;var t=Ls(e[1]),r=Ls(e[2]),n=Ls(e[3]);return dp(t,r,n)?t*Me+r*we+n*1e3:NaN}function Ls(i){return i&&parseFloat(i.replace(",","."))||0}function op(i){if(i==="Z")return 0;var e=i.match(ep);if(!e)return 0;var t=e[1]==="+"?-1:1,r=parseInt(e[2]),n=e[3]&&parseInt(e[3])||0;return hp(r,n)?t*(r*Me+n*we):NaN}function ap(i,e,t){var r=new Date(0);r.setUTCFullYear(i,0,4);var n=r.getUTCDay()||7,s=(e-1)*7+t+1-n;return r.setUTCDate(r.getUTCDate()+s),r}var lp=[31,null,31,30,31,30,31,31,30,31,30,31];function Zl(i){return i%400===0||i%4===0&&i%100!==0}function cp(i,e,t){return e>=0&&e<=11&&t>=1&&t<=(lp[e]||(Zl(i)?29:28))}function up(i,e){return e>=1&&e<=(Zl(i)?366:365)}function fp(i,e,t){return e>=1&&e<=53&&t>=0&&t<=6}function dp(i,e,t){return i===24?e===0&&t===0:t>=0&&t<60&&e>=0&&e<60&&i>=0&&i<25}function hp(i,e){return e>=0&&e<=59}var mp={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};gs._date.override({_id:"date-fns",formats:function(){return mp},parse:function(i,e){if(i===null||typeof i>"u")return null;let t=typeof i;return t==="number"||i instanceof Date?i=D(i):t==="string"&&(typeof e=="string"?i=Xr(i,e,new Date,this.options):i=Zr(i,this.options)),je(i)?i.getTime():null},format:function(i,e){return Yr(i,e,this.options)},add:function(i,e,t){switch(t){case"millisecond":return Ct(i,e);case"second":return yr(i,e);case"minute":return xr(i,e);case"hour":return br(i,e);case"day":return Ve(i,e);case"week":return _r(i,e);case"month":return ue(i,e);case"quarter":return vr(i,e);case"year":return wr(i,e);default:return i}},diff:function(i,e,t){switch(t){case"millisecond":return Ht(i,e);case"second":return Dr(i,e);case"minute":return Tr(i,e);case"hour":return Mr(i,e);case"day":return qe(i,e);case"week":return Cr(i,e);case"month":return Qe(i,e);case"quarter":return kr(i,e);case"year":return Pr(i,e);default:return 0}},startOf:function(i,e,t){switch(e){case"second":return Gr(i);case"minute":return Or(i);case"hour":return Qr(i);case"day":return _e(i);case"week":return yi(i);case"isoWeek":return yi(i,{weekStartsOn:+t});case"month":return Ar(i);case"quarter":return Sr(i);case"year":return Lr(i);default:return i}},endOf:function(i,e){switch(e){case"second":return Nr(i);case"minute":return Fr(i);case"hour":return Er(i);case"day":return $e(i);case"week":return Rr(i);case"month":return Xe(i);case"quarter":return zr(i);case"year":return Ir(i);default:return i}}});export{Op as a,tt as b,V as c,nt as d,W as e,Z as f,Re as g,Ut as h,$ as i,et as j,Dc as k,st as l,he as m,qs as n,ge as o,Dt as p,Vi as q,mn as r,Bi as s,it as t,ai as u,li as v,We as w,oe as x,ht as y,ot as z,lr as A,ps as B,Uu as C,It as D,Zf as E,mr as F,md as G,Kd as H,sh as I,oh as J,vh as K,cs as L,hs as M,Fp as N};
|
|
3
|
+
`):i}function ah(i,e){let{element:t,datasetIndex:r,index:n}=e,s=i.getDatasetMeta(r).controller,{label:o,value:a}=s.getLabelAndValue(n);return{chart:i,label:o,parsed:s.getParsed(n),raw:i.data.datasets[r].data[n],formattedValue:a,dataset:s.getDataset(),dataIndex:n,datasetIndex:r,element:t}}function pa(i,e){let t=i.chart.ctx,{body:r,footer:n,title:s}=i,{boxWidth:o,boxHeight:a}=e,l=ot(e.bodyFont),c=ot(e.titleFont),u=ot(e.footerFont),f=s.length,d=n.length,h=r.length,m=ht(e.padding),p=m.height,g=0,b=r.reduce((k,v)=>k+v.before.length+v.lines.length+v.after.length,0);if(b+=i.beforeBody.length+i.afterBody.length,f&&(p+=f*c.lineHeight+(f-1)*e.titleSpacing+e.titleMarginBottom),b){let k=e.displayColors?Math.max(a,l.lineHeight):l.lineHeight;p+=h*k+(b-h)*l.lineHeight+(b-1)*e.bodySpacing}d&&(p+=e.footerMarginTop+d*u.lineHeight+(d-1)*e.footerSpacing);let x=0,w=function(k){g=Math.max(g,t.measureText(k).width+x)};return t.save(),t.font=c.string,Q(i.title,w),t.font=l.string,Q(i.beforeBody.concat(i.afterBody),w),x=e.displayColors?o+2+e.boxPadding:0,Q(r,k=>{Q(k.before,w),Q(k.lines,w),Q(k.after,w)}),x=0,t.font=u.string,Q(i.footer,w),t.restore(),g+=m.width,{width:g,height:p}}function lh(i,e){let{y:t,height:r}=e;return t<r/2?"top":t>i.height-r/2?"bottom":"center"}function ch(i,e,t,r){let{x:n,width:s}=r,o=t.caretSize+t.caretPadding;if(i==="left"&&n+s+o>e.width||i==="right"&&n-s-o<0)return!0}function uh(i,e,t,r){let{x:n,width:s}=t,{width:o,chartArea:{left:a,right:l}}=i,c="center";return r==="center"?c=n<=(a+l)/2?"left":"right":n<=s/2?c="left":n>=o-s/2&&(c="right"),ch(c,i,e,t)&&(c="center"),c}function ga(i,e,t){let r=t.yAlign||e.yAlign||lh(i,t);return{xAlign:t.xAlign||e.xAlign||uh(i,e,t,r),yAlign:r}}function fh(i,e){let{x:t,width:r}=i;return e==="right"?t-=r:e==="center"&&(t-=r/2),t}function dh(i,e,t){let{y:r,height:n}=i;return e==="top"?r+=t:e==="bottom"?r-=n+t:r-=n/2,r}function ba(i,e,t,r){let{caretSize:n,caretPadding:s,cornerRadius:o}=i,{xAlign:a,yAlign:l}=t,c=n+s,{topLeft:u,topRight:f,bottomLeft:d,bottomRight:h}=oe(o),m=fh(e,a),p=dh(e,l,c);return l==="center"?a==="left"?m+=c:a==="right"&&(m-=c):a==="left"?m-=Math.max(u,d)+n:a==="right"&&(m+=Math.max(f,h)+n),{x:lt(m,0,r.width-e.width),y:lt(p,0,r.height-e.height)}}function nr(i,e,t){let r=ht(t.padding);return e==="center"?i.x+i.width/2:e==="right"?i.x+i.width-r.right:i.x+r.left}function xa(i){return Nt([],Xt(i))}function hh(i,e,t){return qt(i,{tooltip:e,tooltipItems:t,type:"tooltip"})}function va(i,e){let t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?i.override(t):i}var Ga={beforeTitle:Ft,title(i){if(i.length>0){let e=i[0],t=e.chart.data.labels,r=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(r>0&&e.dataIndex<r)return t[e.dataIndex]}return""},afterTitle:Ft,beforeBody:Ft,beforeLabel:Ft,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let e=i.dataset.label||"";e&&(e+=": ");let t=i.formattedValue;return U(t)||(e+=t),e},labelColor(i){let t=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(i){let t=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:Ft,afterBody:Ft,beforeFooter:Ft,footer:Ft,afterFooter:Ft};function xt(i,e,t,r){let n=i[e].call(t,r);return typeof n>"u"?Ga[e].call(t,r):n}var ya=(()=>{class i extends It{static positioners=pi;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let t=this._cachedAnimations;if(t)return t;let r=this.chart,n=this.options.setContext(this.getContext()),s=n.enabled&&r.options.animation&&n.animations,o=new lr(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=hh(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,r){let{callbacks:n}=r,s=xt(n,"beforeTitle",this,t),o=xt(n,"title",this,t),a=xt(n,"afterTitle",this,t),l=[];return l=Nt(l,Xt(s)),l=Nt(l,Xt(o)),l=Nt(l,Xt(a)),l}getBeforeBody(t,r){return xa(xt(r.callbacks,"beforeBody",this,t))}getBody(t,r){let{callbacks:n}=r,s=[];return Q(t,o=>{let a={before:[],lines:[],after:[]},l=va(n,o);Nt(a.before,Xt(xt(l,"beforeLabel",this,o))),Nt(a.lines,xt(l,"label",this,o)),Nt(a.after,Xt(xt(l,"afterLabel",this,o))),s.push(a)}),s}getAfterBody(t,r){return xa(xt(r.callbacks,"afterBody",this,t))}getFooter(t,r){let{callbacks:n}=r,s=xt(n,"beforeFooter",this,t),o=xt(n,"footer",this,t),a=xt(n,"afterFooter",this,t),l=[];return l=Nt(l,Xt(s)),l=Nt(l,Xt(o)),l=Nt(l,Xt(a)),l}_createItems(t){let r=this._active,n=this.chart.data,s=[],o=[],a=[],l=[],c,u;for(c=0,u=r.length;c<u;++c)l.push(ah(this.chart,r[c]));return t.filter&&(l=l.filter((f,d,h)=>t.filter(f,d,h,n))),t.itemSort&&(l=l.sort((f,d)=>t.itemSort(f,d,n))),Q(l,f=>{let d=va(t.callbacks,f);s.push(xt(d,"labelColor",this,f)),o.push(xt(d,"labelPointStyle",this,f)),a.push(xt(d,"labelTextColor",this,f))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=l,l}update(t,r){let n=this.options.setContext(this.getContext()),s=this._active,o,a=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{let l=pi[n.position].call(this,s,this._eventPosition);a=this._createItems(n),this.title=this.getTitle(a,n),this.beforeBody=this.getBeforeBody(a,n),this.body=this.getBody(a,n),this.afterBody=this.getAfterBody(a,n),this.footer=this.getFooter(a,n);let c=this._size=pa(this,n),u=Object.assign({},l,c),f=ga(this.chart,n,u),d=ba(n,u,f,this.chart);this.xAlign=f.xAlign,this.yAlign=f.yAlign,o={opacity:1,x:d.x,y:d.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:r})}drawCaret(t,r,n,s){let o=this.getCaretPosition(t,n,s);r.lineTo(o.x1,o.y1),r.lineTo(o.x2,o.y2),r.lineTo(o.x3,o.y3)}getCaretPosition(t,r,n){let{xAlign:s,yAlign:o}=this,{caretSize:a,cornerRadius:l}=n,{topLeft:c,topRight:u,bottomLeft:f,bottomRight:d}=oe(l),{x:h,y:m}=t,{width:p,height:g}=r,b,x,w,k,v,_;return o==="center"?(v=m+g/2,s==="left"?(b=h,x=b-a,k=v+a,_=v-a):(b=h+p,x=b+a,k=v-a,_=v+a),w=b):(s==="left"?x=h+Math.max(c,f)+a:s==="right"?x=h+p-Math.max(u,d)-a:x=this.caretX,o==="top"?(k=m,v=k-a,b=x-a,w=x+a):(k=m+g,v=k+a,b=x+a,w=x-a),_=k),{x1:b,x2:x,x3:w,y1:k,y2:v,y3:_}}drawTitle(t,r,n){let s=this.title,o=s.length,a,l,c;if(o){let u=be(n.rtl,this.x,this.width);for(t.x=nr(this,n.titleAlign,n),r.textAlign=u.textAlign(n.titleAlign),r.textBaseline="middle",a=ot(n.titleFont),l=n.titleSpacing,r.fillStyle=n.titleColor,r.font=a.string,c=0;c<o;++c)r.fillText(s[c],u.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+l,c+1===o&&(t.y+=n.titleMarginBottom-l)}}_drawColorBox(t,r,n,s,o){let a=this.labelColors[n],l=this.labelPointStyles[n],{boxHeight:c,boxWidth:u}=o,f=ot(o.bodyFont),d=nr(this,"left",o),h=s.x(d),m=c<f.lineHeight?(f.lineHeight-c)/2:0,p=r.y+m;if(o.usePointStyle){let g={radius:Math.min(u,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},b=s.leftForLtr(h,u)+u/2,x=p+c/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Xi(t,g,b,x),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Xi(t,g,b,x)}else{t.lineWidth=V(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;let g=s.leftForLtr(h,u),b=s.leftForLtr(s.xPlus(h,1),u-2),x=oe(a.borderRadius);Object.values(x).some(w=>w!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,We(t,{x:g,y:p,w:u,h:c,radius:x}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),We(t,{x:b,y:p+1,w:u-2,h:c-2,radius:x}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(g,p,u,c),t.strokeRect(g,p,u,c),t.fillStyle=a.backgroundColor,t.fillRect(b,p+1,u-2,c-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,r,n){let{body:s}=this,{bodySpacing:o,bodyAlign:a,displayColors:l,boxHeight:c,boxWidth:u,boxPadding:f}=n,d=ot(n.bodyFont),h=d.lineHeight,m=0,p=be(n.rtl,this.x,this.width),g=function(O){r.fillText(O,p.x(t.x+m),t.y+h/2),t.y+=h+o},b=p.textAlign(a),x,w,k,v,_,P,C;for(r.textAlign=a,r.textBaseline="middle",r.font=d.string,t.x=nr(this,b,n),r.fillStyle=n.bodyColor,Q(this.beforeBody,g),m=l&&b!=="right"?a==="center"?u/2+f:u+2+f:0,v=0,P=s.length;v<P;++v){for(x=s[v],w=this.labelTextColors[v],r.fillStyle=w,Q(x.before,g),k=x.lines,l&&k.length&&(this._drawColorBox(r,t,v,p,n),h=Math.max(d.lineHeight,c)),_=0,C=k.length;_<C;++_)g(k[_]),h=d.lineHeight;Q(x.after,g)}m=0,h=d.lineHeight,Q(this.afterBody,g),t.y-=o}drawFooter(t,r,n){let s=this.footer,o=s.length,a,l;if(o){let c=be(n.rtl,this.x,this.width);for(t.x=nr(this,n.footerAlign,n),t.y+=n.footerMarginTop,r.textAlign=c.textAlign(n.footerAlign),r.textBaseline="middle",a=ot(n.footerFont),r.fillStyle=n.footerColor,r.font=a.string,l=0;l<o;++l)r.fillText(s[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+n.footerSpacing}}drawBackground(t,r,n,s){let{xAlign:o,yAlign:a}=this,{x:l,y:c}=t,{width:u,height:f}=n,{topLeft:d,topRight:h,bottomLeft:m,bottomRight:p}=oe(s.cornerRadius);r.fillStyle=s.backgroundColor,r.strokeStyle=s.borderColor,r.lineWidth=s.borderWidth,r.beginPath(),r.moveTo(l+d,c),a==="top"&&this.drawCaret(t,r,n,s),r.lineTo(l+u-h,c),r.quadraticCurveTo(l+u,c,l+u,c+h),a==="center"&&o==="right"&&this.drawCaret(t,r,n,s),r.lineTo(l+u,c+f-p),r.quadraticCurveTo(l+u,c+f,l+u-p,c+f),a==="bottom"&&this.drawCaret(t,r,n,s),r.lineTo(l+m,c+f),r.quadraticCurveTo(l,c+f,l,c+f-m),a==="center"&&o==="left"&&this.drawCaret(t,r,n,s),r.lineTo(l,c+d),r.quadraticCurveTo(l,c,l+d,c),r.closePath(),r.fill(),s.borderWidth>0&&r.stroke()}_updateAnimationTarget(t){let r=this.chart,n=this.$animations,s=n&&n.x,o=n&&n.y;if(s||o){let a=pi[t.position].call(this,this._active,this._eventPosition);if(!a)return;let l=this._size=pa(this,t),c=Object.assign({},a,this._size),u=ga(r,t,c),f=ba(t,c,u,r);(s._to!==f.x||o._to!==f.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=l.width,this.height=l.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,f))}}_willRender(){return!!this.opacity}draw(t){let r=this.options.setContext(this.getContext()),n=this.opacity;if(!n)return;this._updateAnimationTarget(r);let s={width:this.width,height:this.height},o={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;let a=ht(r.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;r.enabled&&l&&(t.save(),t.globalAlpha=n,this.drawBackground(o,t,s,r),In(t,r.textDirection),o.y+=a.top,this.drawTitle(o,t,r),this.drawBody(o,t,r),this.drawFooter(o,t,r),Ln(t,r.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,r){let n=this._active,s=t.map(({datasetIndex:l,index:c})=>{let u=this.chart.getDatasetMeta(l);if(!u)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:u.data[c],index:c}}),o=!si(n,s),a=this._positionChanged(s,r);(o||a)&&(this._active=s,this._eventPosition=r,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,r,n=!0){if(r&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let s=this.options,o=this._active||[],a=this._getActiveElements(t,o,r,n),l=this._positionChanged(a,t),c=r||!si(a,o)||l;return c&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,r))),c}_getActiveElements(t,r,n,s){let o=this.options;if(t.type==="mouseout")return[];if(!s)return r.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);let a=this.chart.getElementsAtEventForMode(t,o.mode,o,n);return o.reverse&&a.reverse(),a}_positionChanged(t,r){let{caretX:n,caretY:s,options:o}=this,a=pi[o.position].call(this,t,r);return a!==!1&&(n!==a.x||s!==a.y)}}return i})(),mh={id:"tooltip",_element:ya,positioners:pi,afterInit(i,e,t){t&&(i.tooltip=new ya({chart:i,options:t}))},beforeUpdate(i,e,t){i.tooltip&&i.tooltip.initialize(t)},reset(i,e,t){i.tooltip&&i.tooltip.initialize(t)},afterDraw(i){let e=i.tooltip;if(e&&e._willRender()){let t={tooltip:e};if(i.notifyPlugins("beforeTooltipDraw",Ai(Oe({},t),{cancelable:!0}))===!1)return;e.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",t)}},afterEvent(i,e){if(i.tooltip){let t=e.replay;i.tooltip.handleEvent(e.event,t,e.inChartArea)&&(e.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,e)=>e.bodyFont.size,boxWidth:(i,e)=>e.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:Ga},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"]},ph=Object.freeze({__proto__:null,Colors:Cd,Decimation:Ad,Filler:Kd,Legend:rh,SubTitle:oh,Title:sh,Tooltip:mh}),gh=(i,e,t,r)=>(typeof e=="string"?(t=i.push(e)-1,r.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function bh(i,e,t,r){let n=i.indexOf(e);if(n===-1)return gh(i,e,t,r);let s=i.lastIndexOf(e);return n!==s?t:n}var xh=(i,e)=>i===null?null:lt(Math.round(i),0,e);function _a(i){let e=this.getLabels();return i>=0&&i<e.length?e[i]:i}var vh=(()=>{class i extends ye{static id="category";static defaults={ticks:{callback:_a}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){let r=this._addedLabels;if(r.length){let n=this.getLabels();for(let{index:s,label:o}of r)n[s]===o&&n.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,r){if(U(t))return null;let n=this.getLabels();return r=isFinite(r)&&n[r]===t?r:bh(n,t,W(r,t),this._addedLabels),xh(r,n.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:r}=this.getUserBounds(),{min:n,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(n=0),r||(s=this.getLabels().length-1)),this.min=n,this.max=s}buildTicks(){let t=this.min,r=this.max,n=this.options.offset,s=[],o=this.getLabels();o=t===0&&r===o.length-1?o:o.slice(t,r+1),this._valueRange=Math.max(o.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let a=t;a<=r;a++)s.push({value:a});return s}getLabelForValue(t){return _a.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){let r=this.ticks;return t<0||t>r.length-1?null:this.getPixelForValue(r[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}return i})();function yh(i,e){let t=[],{bounds:n,step:s,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:f,includeBounds:d}=i,h=s||1,m=u-1,{min:p,max:g}=e,b=!U(o),x=!U(a),w=!U(c),k=(g-p)/(f+1),v=fn((g-p)/m/h)*h,_,P,C,O;if(v<1e-14&&!b&&!x)return[{value:p},{value:g}];O=Math.ceil(g/v)-Math.floor(p/v),O>m&&(v=fn(O*v/m/h)*h),U(l)||(_=Math.pow(10,l),v=Math.ceil(v*_)/_),n==="ticks"?(P=Math.floor(p/v)*v,C=Math.ceil(g/v)*v):(P=p,C=g),b&&x&&s&&oo((a-o)/s,v/1e3)?(O=Math.round(Math.min((a-o)/v,u)),v=(a-o)/O,P=o,C=a):w?(P=b?o:P,C=x?a:C,O=c-1,v=(C-P)/O):(O=(C-P)/v,Fe(O,Math.round(O),v/1e3)?O=Math.round(O):O=Math.ceil(O));let R=Math.max(hn(v),hn(P));_=Math.pow(10,U(l)?R:l),P=Math.round(P*_)/_,C=Math.round(C*_)/_;let z=0;for(b&&(d&&P!==o?(t.push({value:o}),P<o&&z++,Fe(Math.round((P+z*v)*_)/_,o,wa(o,k,i))&&z++):P<o&&z++);z<O;++z){let H=Math.round((P+z*v)*_)/_;if(x&&H>a)break;t.push({value:H})}return x&&d&&C!==a?t.length&&Fe(t[t.length-1].value,a,wa(a,k,i))?t[t.length-1].value=a:t.push({value:a}):(!x||C===a)&&t.push({value:C}),t}function wa(i,e,{horizontal:t,minRotation:r}){let n=Tt(r),s=(t?Math.sin(n):Math.cos(n))||.001,o=.75*e*(""+i).length;return Math.min(e/s,o)}var Ue=class extends ye{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return U(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){let{beginAtZero:e}=this.options,{minDefined:t,maxDefined:r}=this.getUserBounds(),{min:n,max:s}=this,o=l=>n=t?n:l,a=l=>s=r?s:l;if(e){let l=At(n),c=At(s);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(n===s){let l=s===0?1:Math.abs(s*.05);a(s+l),e||o(n-l)}this.min=n,this.max=s}getTickLimit(){let e=this.options.ticks,{maxTicksLimit:t,stepSize:r}=e,n;return r?(n=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),t=t||11),t&&(n=Math.min(t,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let e=this.options,t=e.ticks,r=this.getTickLimit();r=Math.max(2,r);let n={maxTicks:r,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},s=this._range||this,o=yh(n,s);return e.bounds==="ticks"&&dn(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){let e=this.ticks,t=this.min,r=this.max;if(super.configure(),this.options.offset&&e.length){let n=(r-t)/Math.max(e.length-1,1)/2;t-=n,r+=n}this._startValue=t,this._endValue=r,this._valueRange=r-t}getLabelForValue(e){return Ne(e,this.chart.options.locale,this.options.ticks.format)}},cs=class extends Ue{static id="linear";static defaults={ticks:{callback:oi.formatters.numeric}};determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=nt(e)?e:0,this.max=nt(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){let e=this.isHorizontal(),t=e?this.width:this.height,r=Tt(this.options.ticks.minRotation),n=(e?Math.sin(r):Math.cos(r))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,s.lineHeight/n))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}},xi=i=>Math.floor(Vt(i)),ve=(i,e)=>Math.pow(10,xi(i)+e);function Ma(i){return i/Math.pow(10,xi(i))===1}function ka(i,e,t){let r=Math.pow(10,t),n=Math.floor(i/r);return Math.ceil(e/r)-n}function _h(i,e){let t=e-i,r=xi(t);for(;ka(i,e,r)>10;)r++;for(;ka(i,e,r)<10;)r--;return Math.min(r,xi(i))}function wh(i,{min:e,max:t}){e=bt(i.min,e);let r=[],n=xi(e),s=_h(e,t),o=s<0?Math.pow(10,Math.abs(s)):1,a=Math.pow(10,s),l=n>s?Math.pow(10,n):0,c=Math.round((e-l)*o)/o,u=Math.floor((e-l)/a/10)*a*10,f=Math.floor((c-u)/Math.pow(10,s)),d=bt(i.min,Math.round((l+u+f*Math.pow(10,s))*o)/o);for(;d<t;)r.push({value:d,major:Ma(d),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(s++,f=2,o=s>=0?1:o),d=Math.round((l+u+f*Math.pow(10,s))*o)/o;let h=bt(i.max,d);return r.push({value:h,major:Ma(h),significand:f}),r}var us=class extends ye{static id="logarithmic";static defaults={ticks:{callback:oi.formatters.logarithmic,major:{enabled:!0}}};constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){let r=Ue.prototype.parse.apply(this,[e,t]);if(r===0){this._zero=!0;return}return nt(r)&&r>0?r:null}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=nt(e)?Math.max(0,e):null,this.max=nt(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!nt(this._userMin)&&(this.min=e===ve(this.min,0)?ve(this.min,-1):ve(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:e,maxDefined:t}=this.getUserBounds(),r=this.min,n=this.max,s=a=>r=e?r:a,o=a=>n=t?n:a;r===n&&(r<=0?(s(1),o(10)):(s(ve(r,-1)),o(ve(n,1)))),r<=0&&s(ve(n,-1)),n<=0&&o(ve(r,1)),this.min=r,this.max=n}buildTicks(){let e=this.options,t={min:this._userMin,max:this._userMax},r=wh(t,this);return e.bounds==="ticks"&&dn(r,this,"value"),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(e){return e===void 0?"0":Ne(e,this.chart.options.locale,this.options.ticks.format)}configure(){let e=this.min;super.configure(),this._startValue=Vt(e),this._valueRange=Vt(this.max)-Vt(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Vt(e)-this._startValue)/this._valueRange)}getValueForPixel(e){let t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}};function fs(i){let e=i.ticks;if(e.display&&i.display){let t=ht(e.backdropPadding);return W(e.font&&e.font.size,it.font.size)+t.height}return 0}function Mh(i,e,t){return t=tt(t)?t:[t],{w:go(i,e.string,t),h:t.length*e.lineHeight}}function Da(i,e,t,r,n){return i===r||i===n?{start:e-t/2,end:e+t/2}:i<r||i>n?{start:e-t,end:e}:{start:e,end:e+t}}function kh(i){let e={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},t=Object.assign({},e),r=[],n=[],s=i._pointLabels.length,o=i.options.pointLabels,a=o.centerPointLabels?$/s:0;for(let l=0;l<s;l++){let c=o.setContext(i.getPointLabelContext(l));n[l]=c.padding;let u=i.getPointPosition(l,i.drawingArea+n[l],a),f=ot(c.font),d=Mh(i.ctx,f,i._pointLabels[l]);r[l]=d;let h=ft(i.getIndexAngle(l)+a),m=Math.round(Vi(h)),p=Da(m,u.x,d.w,0,180),g=Da(m,u.y,d.h,90,270);Dh(t,e,h,p,g)}i.setCenterPoint(e.l-t.l,t.r-e.r,e.t-t.t,t.b-e.b),i._pointLabelItems=Ph(i,r,n)}function Dh(i,e,t,r,n){let s=Math.abs(Math.sin(t)),o=Math.abs(Math.cos(t)),a=0,l=0;r.start<e.l?(a=(e.l-r.start)/s,i.l=Math.min(i.l,e.l-a)):r.end>e.r&&(a=(r.end-e.r)/s,i.r=Math.max(i.r,e.r+a)),n.start<e.t?(l=(e.t-n.start)/o,i.t=Math.min(i.t,e.t-l)):n.end>e.b&&(l=(n.end-e.b)/o,i.b=Math.max(i.b,e.b+l))}function Th(i,e,t){let r=i.drawingArea,{extra:n,additionalAngle:s,padding:o,size:a}=t,l=i.getPointPosition(e,r+n+o,s),c=Math.round(Vi(ft(l.angle+st))),u=Ah(l.y,a.h,c),f=Oh(c),d=Sh(l.x,a.w,f);return{visible:!0,x:l.x,y:u,textAlign:f,left:d,top:u,right:d+a.w,bottom:u+a.h}}function Ch(i,e){if(!e)return!0;let{left:t,top:r,right:n,bottom:s}=i;return!(Rt({x:t,y:r},e)||Rt({x:t,y:s},e)||Rt({x:n,y:r},e)||Rt({x:n,y:s},e))}function Ph(i,e,t){let r=[],n=i._pointLabels.length,s=i.options,{centerPointLabels:o,display:a}=s.pointLabels,l={extra:fs(s)/2,additionalAngle:o?$/n:0},c;for(let u=0;u<n;u++){l.padding=t[u],l.size=e[u];let f=Th(i,u,l);r.push(f),a==="auto"&&(f.visible=Ch(f,c),f.visible&&(c=f))}return r}function Oh(i){return i===0||i===180?"center":i<180?"left":"right"}function Sh(i,e,t){return t==="right"?i-=e:t==="center"&&(i-=e/2),i}function Ah(i,e,t){return t===90||t===270?i-=e/2:(t>270||t<90)&&(i-=e),i}function Ih(i,e,t){let{left:r,top:n,right:s,bottom:o}=t,{backdropColor:a}=e;if(!U(a)){let l=oe(e.borderRadius),c=ht(e.backdropPadding);i.fillStyle=a;let u=r-c.left,f=n-c.top,d=s-r+c.width,h=o-n+c.height;Object.values(l).some(m=>m!==0)?(i.beginPath(),We(i,{x:u,y:f,w:d,h,radius:l}),i.fill()):i.fillRect(u,f,d,h)}}function Lh(i,e){let{ctx:t,options:{pointLabels:r}}=i;for(let n=e-1;n>=0;n--){let s=i._pointLabelItems[n];if(!s.visible)continue;let o=r.setContext(i.getPointLabelContext(n));Ih(t,o,s);let a=ot(o.font),{x:l,y:c,textAlign:u}=s;se(t,i._pointLabels[n],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function Ka(i,e,t,r){let{ctx:n}=i;if(t)n.arc(i.xCenter,i.yCenter,e,0,et);else{let s=i.getPointPosition(0,e);n.moveTo(s.x,s.y);for(let o=1;o<r;o++)s=i.getPointPosition(o,e),n.lineTo(s.x,s.y)}}function Eh(i,e,t,r,n){let s=i.ctx,o=e.circular,{color:a,lineWidth:l}=e;!o&&!r||!a||!l||t<0||(s.save(),s.strokeStyle=a,s.lineWidth=l,s.setLineDash(n.dash||[]),s.lineDashOffset=n.dashOffset,s.beginPath(),Ka(i,t,o,r),s.closePath(),s.stroke(),s.restore())}function Rh(i,e,t){return qt(i,{label:t,index:e,type:"pointLabel"})}var ds=class extends Ue{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:oi.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let e=this._padding=ht(fs(this.options)/2),t=this.width=this.maxWidth-e.width,r=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+r/2+e.top),this.drawingArea=Math.floor(Math.min(t,r)/2)}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!1);this.min=nt(e)&&!isNaN(e)?e:0,this.max=nt(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/fs(this.options))}generateTickLabels(e){Ue.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((t,r)=>{let n=Z(this.options.pointLabels.callback,[t,r],this);return n||n===0?n:""}).filter((t,r)=>this.chart.getDataVisibility(r))}fit(){let e=this.options;e.display&&e.pointLabels.display?kh(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,r,n){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((r-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,r,n))}getIndexAngle(e){let t=et/(this._pointLabels.length||1),r=this.options.startAngle||0;return ft(e*t+Tt(r))}getDistanceFromCenterForValue(e){if(U(e))return NaN;let t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(U(e))return NaN;let t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){let t=this._pointLabels||[];if(e>=0&&e<t.length){let r=t[e];return Rh(this.getContext(),e,r)}}getPointPosition(e,t,r=0){let n=this.getIndexAngle(e)-st+r;return{x:Math.cos(n)*t+this.xCenter,y:Math.sin(n)*t+this.yCenter,angle:n}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){let{left:t,top:r,right:n,bottom:s}=this._pointLabelItems[e];return{left:t,top:r,right:n,bottom:s}}drawBackground(){let{backgroundColor:e,grid:{circular:t}}=this.options;if(e){let r=this.ctx;r.save(),r.beginPath(),Ka(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),r.closePath(),r.fillStyle=e,r.fill(),r.restore()}}drawGrid(){let e=this.ctx,t=this.options,{angleLines:r,grid:n,border:s}=t,o=this._pointLabels.length,a,l,c;if(t.pointLabels.display&&Lh(this,o),n.display&&this.ticks.forEach((u,f)=>{if(f!==0||f===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);let d=this.getContext(f),h=n.setContext(d),m=s.setContext(d);Eh(this,h,l,o,m)}}),r.display){for(e.save(),a=o-1;a>=0;a--){let u=r.setContext(this.getPointLabelContext(a)),{color:f,lineWidth:d}=u;!d||!f||(e.lineWidth=d,e.strokeStyle=f,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(t.reverse?this.min:this.max),c=this.getPointPosition(a,l),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(c.x,c.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){let e=this.ctx,t=this.options,r=t.ticks;if(!r.display)return;let n=this.getIndexAngle(0),s,o;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(n),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!t.reverse)return;let c=r.setContext(this.getContext(l)),u=ot(c.font);if(s=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){e.font=u.string,o=e.measureText(a.label).width,e.fillStyle=c.backdropColor;let f=ht(c.backdropPadding);e.fillRect(-o/2-f.left,-s-u.size/2-f.top,o+f.width,u.size+f.height)}se(e,a.label,0,-s,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),e.restore()}drawTitle(){}},gr={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}},vt=Object.keys(gr);function Ta(i,e){return i-e}function Ca(i,e){if(U(e))return null;let t=i._adapter,{parser:r,round:n,isoWeekday:s}=i._parseOpts,o=e;return typeof r=="function"&&(o=r(o)),nt(o)||(o=typeof r=="string"?t.parse(o,r):t.parse(o)),o===null?null:(n&&(o=n==="week"&&(ge(s)||s===!0)?t.startOf(o,"isoWeek",s):t.startOf(o,n)),+o)}function Pa(i,e,t,r){let n=vt.length;for(let s=vt.indexOf(i);s<n-1;++s){let o=gr[vt[s]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((t-e)/(a*o.size))<=r)return vt[s]}return vt[n-1]}function Fh(i,e,t,r,n){for(let s=vt.length-1;s>=vt.indexOf(t);s--){let o=vt[s];if(gr[o].common&&i._adapter.diff(n,r,o)>=e-1)return o}return vt[t?vt.indexOf(t):0]}function zh(i){for(let e=vt.indexOf(i)+1,t=vt.length;e<t;++e)if(gr[vt[e]].common)return vt[e]}function Oa(i,e,t){if(!t)i[e]=!0;else if(t.length){let{lo:r,hi:n}=ji(t,e),s=t[r]>=e?t[r]:t[n];i[s]=!0}}function Nh(i,e,t,r){let n=i._adapter,s=+n.startOf(e[0].value,r),o=e[e.length-1].value,a,l;for(a=s;a<=o;a=+n.add(a,1,r))l=t[a],l>=0&&(e[l].major=!0);return e}function Sa(i,e,t){let r=[],n={},s=e.length,o,a;for(o=0;o<s;++o)a=e[o],n[a]=o,r.push({value:a,major:!1});return s===0||!t?r:Nh(i,r,n,t)}var hs=(()=>{class i extends ye{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,r={}){let n=t.time||(t.time={}),s=this._adapter=new gs._date(t.adapters.date);s.init(r),Ee(n.displayFormats,s.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=r.normalized}parse(t,r){return t===void 0?null:Ca(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,r=this._adapter,n=t.time.unit||"day",{min:s,max:o,minDefined:a,maxDefined:l}=this.getUserBounds();function c(u){!a&&!isNaN(u.min)&&(s=Math.min(s,u.min)),!l&&!isNaN(u.max)&&(o=Math.max(o,u.max))}(!a||!l)&&(c(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&c(this.getMinMax(!1))),s=nt(s)&&!isNaN(s)?s:+r.startOf(Date.now(),n),o=nt(o)&&!isNaN(o)?o:+r.endOf(Date.now(),n)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){let t=this.getLabelTimestamps(),r=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(r=t[0],n=t[t.length-1]),{min:r,max:n}}buildTicks(){let t=this.options,r=t.time,n=t.ticks,s=n.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);let o=this.min,a=this.max,l=co(s,o,a);return this._unit=r.unit||(n.autoSkip?Pa(r.minUnit,this.min,this.max,this._getLabelCapacity(o)):Fh(this,l.length,r.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit==="year"?void 0:zh(this._unit),this.initOffsets(s),t.reverse&&l.reverse(),Sa(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let r=0,n=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?r=1-s:r=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?n=o:n=(o-this.getDecimalForValue(t[t.length-2]))/2);let a=t.length<3?.5:.25;r=lt(r,0,a),n=lt(n,0,a),this._offsets={start:r,end:n,factor:1/(r+1+n)}}_generate(){let t=this._adapter,r=this.min,n=this.max,s=this.options,o=s.time,a=o.unit||Pa(o.minUnit,r,n,this._getLabelCapacity(r)),l=W(s.ticks.stepSize,1),c=a==="week"?o.isoWeekday:!1,u=ge(c)||c===!0,f={},d=r,h,m;if(u&&(d=+t.startOf(d,"isoWeek",c)),d=+t.startOf(d,u?"day":a),t.diff(n,r,a)>1e5*l)throw new Error(r+" and "+n+" are too far apart with stepSize of "+l+" "+a);let p=s.ticks.source==="data"&&this.getDataTimestamps();for(h=d,m=0;h<n;h=+t.add(h,l,a),m++)Oa(f,h,p);return(h===n||s.bounds==="ticks"||m===1)&&Oa(f,h,p),Object.keys(f).sort(Ta).map(g=>+g)}getLabelForValue(t){let r=this._adapter,n=this.options.time;return n.tooltipFormat?r.format(t,n.tooltipFormat):r.format(t,n.displayFormats.datetime)}format(t,r){let s=this.options.time.displayFormats,o=this._unit,a=r||s[o];return this._adapter.format(t,a)}_tickFormatFunction(t,r,n,s){let o=this.options,a=o.ticks.callback;if(a)return Z(a,[t,r,n],this);let l=o.time.displayFormats,c=this._unit,u=this._majorUnit,f=c&&l[c],d=u&&l[u],h=n[r],m=u&&d&&h&&h.major;return this._adapter.format(t,s||(m?d:f))}generateTickLabels(t){let r,n,s;for(r=0,n=t.length;r<n;++r)s=t[r],s.label=this._tickFormatFunction(s.value,r,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){let r=this._offsets,n=this.getDecimalForValue(t);return this.getPixelForDecimal((r.start+n)*r.factor)}getValueForPixel(t){let r=this._offsets,n=this.getDecimalForPixel(t)/r.factor-r.end;return this.min+n*(this.max-this.min)}_getLabelSize(t){let r=this.options.ticks,n=this.ctx.measureText(t).width,s=Tt(this.isHorizontal()?r.maxRotation:r.minRotation),o=Math.cos(s),a=Math.sin(s),l=this._resolveTickFontOptions(0).size;return{w:n*o+l*a,h:n*a+l*o}}_getLabelCapacity(t){let r=this.options.time,n=r.displayFormats,s=n[r.unit]||n.millisecond,o=this._tickFormatFunction(t,0,Sa(this,[t],this._majorUnit),s),a=this._getLabelSize(o),l=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return l>0?l:1}getDataTimestamps(){let t=this._cache.data||[],r,n;if(t.length)return t;let s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(r=0,n=s.length;r<n;++r)t=t.concat(s[r].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){let t=this._cache.labels||[],r,n;if(t.length)return t;let s=this.getLabels();for(r=0,n=s.length;r<n;++r)t.push(Ca(this,s[r]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return gn(t.sort(Ta))}}return i})();function sr(i,e,t){let r=0,n=i.length-1,s,o,a,l;t?(e>=i[r].pos&&e<=i[n].pos&&({lo:r,hi:n}=Et(i,"pos",e)),{pos:s,time:a}=i[r],{pos:o,time:l}=i[n]):(e>=i[r].time&&e<=i[n].time&&({lo:r,hi:n}=Et(i,"time",e)),{time:s,pos:a}=i[r],{time:o,pos:l}=i[n]);let c=o-s;return c?a+(l-a)*(e-s)/c:a}var ms=class extends hs{static id="timeseries";static defaults=hs.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=sr(t,this.min),this._tableRange=sr(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){let{min:t,max:r}=this,n=[],s=[],o,a,l,c,u;for(o=0,a=e.length;o<a;++o)c=e[o],c>=t&&c<=r&&n.push(c);if(n.length<2)return[{time:t,pos:0},{time:r,pos:1}];for(o=0,a=n.length;o<a;++o)u=n[o+1],l=n[o-1],c=n[o],Math.round((u+l)/2)!==c&&s.push({time:c,pos:o/(a-1)});return s}_generate(){let e=this.min,t=this.max,r=super.getDataTimestamps();return(!r.includes(e)||!r.length)&&r.splice(0,0,e),(!r.includes(t)||r.length===1)&&r.push(t),r.sort((n,s)=>n-s)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;let t=this.getDataTimestamps(),r=this.getLabelTimestamps();return t.length&&r.length?e=this.normalize(t.concat(r)):e=t.length?t:r,e=this._cache.all=e,e}getDecimalForValue(e){return(sr(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){let t=this._offsets,r=this.getDecimalForPixel(e)/t.factor-t.end;return sr(this._table,r*this._tableRange+this._minPos,!0)}},Wh=Object.freeze({__proto__:null,CategoryScale:vh,LinearScale:cs,LogarithmicScale:us,RadialLinearScale:ds,TimeScale:hs,TimeSeriesScale:ms}),Mp=[$u,yd,ph,Wh];function gt(i){"@babel/helpers - typeof";return gt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gt(i)}function F(i){if(i===null||i===!0||i===!1)return NaN;var e=Number(i);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function y(i,e){if(e.length<i)throw new TypeError(i+" argument"+(i>1?"s":"")+" required, but only "+e.length+" present")}function T(i){y(1,arguments);var e=Object.prototype.toString.call(i);return i instanceof Date||gt(i)==="object"&&e==="[object Date]"?new Date(i.getTime()):typeof i=="number"||e==="[object Number]"?new Date(i):((typeof i=="string"||e==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Ve(i,e){y(2,arguments);var t=T(i),r=F(e);return isNaN(r)?new Date(NaN):(r&&t.setDate(t.getDate()+r),t)}function ue(i,e){y(2,arguments);var t=T(i),r=F(e);if(isNaN(r))return new Date(NaN);if(!r)return t;var n=t.getDate(),s=new Date(t.getTime());s.setMonth(t.getMonth()+r+1,0);var o=s.getDate();return n>=o?s:(t.setFullYear(s.getFullYear(),s.getMonth(),n),t)}function Ct(i,e){y(2,arguments);var t=T(i).getTime(),r=F(e);return new Date(t+r)}var Hh=36e5;function br(i,e){y(2,arguments);var t=F(e);return Ct(i,t*Hh)}var Bh={};function pt(){return Bh}function yi(i,e){var t,r,n,s,o,a,l,c;y(1,arguments);var u=pt(),f=F((t=(r=(n=(s=e?.weekStartsOn)!==null&&s!==void 0?s:e==null||(o=e.locale)===null||o===void 0||(a=o.options)===null||a===void 0?void 0:a.weekStartsOn)!==null&&n!==void 0?n:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&t!==void 0?t:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=T(i),h=d.getDay(),m=(h<f?7:0)+h-f;return d.setDate(d.getDate()-m),d.setHours(0,0,0,0),d}function fe(i){var e=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds()));return e.setUTCFullYear(i.getFullYear()),i.getTime()-e.getTime()}function _e(i){y(1,arguments);var e=T(i);return e.setHours(0,0,0,0),e}var Yh=864e5;function bs(i,e){y(2,arguments);var t=_e(i),r=_e(e),n=t.getTime()-fe(t),s=r.getTime()-fe(r);return Math.round((n-s)/Yh)}var Uh=6e4;function xr(i,e){y(2,arguments);var t=F(e);return Ct(i,t*Uh)}function vr(i,e){y(2,arguments);var t=F(e),r=t*3;return ue(i,r)}function yr(i,e){y(2,arguments);var t=F(e);return Ct(i,t*1e3)}function _r(i,e){y(2,arguments);var t=F(e),r=t*7;return Ve(i,r)}function wr(i,e){y(2,arguments);var t=F(e);return ue(i,t*12)}function de(i,e){y(2,arguments);var t=T(i),r=T(e),n=t.getTime()-r.getTime();return n<0?-1:n>0?1:n}var Vh=365.2425,jh=Math.pow(10,8)*24*60*60*1e3,we=6e4,Me=36e5,Za=1e3,Ag=-jh;var qh=3600;var Ja=qh*24,Ig=Ja*7,$h=Ja*Vh,Xh=$h/12,Lg=Xh*3;function xs(i){return y(1,arguments),i instanceof Date||gt(i)==="object"&&Object.prototype.toString.call(i)==="[object Date]"}function je(i){if(y(1,arguments),!xs(i)&&typeof i!="number")return!1;var e=T(i);return!isNaN(Number(e))}function vs(i,e){y(2,arguments);var t=T(i),r=T(e),n=t.getFullYear()-r.getFullYear(),s=t.getMonth()-r.getMonth();return n*12+s}function ys(i,e){y(2,arguments);var t=T(i),r=T(e);return t.getFullYear()-r.getFullYear()}function tl(i,e){var t=i.getFullYear()-e.getFullYear()||i.getMonth()-e.getMonth()||i.getDate()-e.getDate()||i.getHours()-e.getHours()||i.getMinutes()-e.getMinutes()||i.getSeconds()-e.getSeconds()||i.getMilliseconds()-e.getMilliseconds();return t<0?-1:t>0?1:t}function qe(i,e){y(2,arguments);var t=T(i),r=T(e),n=tl(t,r),s=Math.abs(bs(t,r));t.setDate(t.getDate()-n*s);var o=+(tl(t,r)===-n),a=n*(s-o);return a===0?0:a}function Ht(i,e){return y(2,arguments),T(i).getTime()-T(e).getTime()}var el={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},Qh="trunc";function Bt(i){return i?el[i]:el[Qh]}function Mr(i,e,t){y(2,arguments);var r=Ht(i,e)/Me;return Bt(t?.roundingMethod)(r)}function kr(i,e,t){y(2,arguments);var r=Ht(i,e)/we;return Bt(t?.roundingMethod)(r)}function $e(i){y(1,arguments);var e=T(i);return e.setHours(23,59,59,999),e}function Xe(i){y(1,arguments);var e=T(i),t=e.getMonth();return e.setFullYear(e.getFullYear(),t+1,0),e.setHours(23,59,59,999),e}function _s(i){y(1,arguments);var e=T(i);return $e(e).getTime()===Xe(e).getTime()}function Qe(i,e){y(2,arguments);var t=T(i),r=T(e),n=de(t,r),s=Math.abs(vs(t,r)),o;if(s<1)o=0;else{t.getMonth()===1&&t.getDate()>27&&t.setDate(30),t.setMonth(t.getMonth()-n*s);var a=de(t,r)===-n;_s(T(i))&&s===1&&de(i,r)===1&&(a=!1),o=n*(s-Number(a))}return o===0?0:o}function Dr(i,e,t){y(2,arguments);var r=Qe(i,e)/3;return Bt(t?.roundingMethod)(r)}function Tr(i,e,t){y(2,arguments);var r=Ht(i,e)/1e3;return Bt(t?.roundingMethod)(r)}function Cr(i,e,t){y(2,arguments);var r=qe(i,e)/7;return Bt(t?.roundingMethod)(r)}function Pr(i,e){y(2,arguments);var t=T(i),r=T(e),n=de(t,r),s=Math.abs(ys(t,r));t.setFullYear(1584),r.setFullYear(1584);var o=de(t,r)===-n,a=n*(s-Number(o));return a===0?0:a}function Or(i){y(1,arguments);var e=T(i);return e.setSeconds(0,0),e}function Sr(i){y(1,arguments);var e=T(i),t=e.getMonth(),r=t-t%3;return e.setMonth(r,1),e.setHours(0,0,0,0),e}function Ar(i){y(1,arguments);var e=T(i);return e.setDate(1),e.setHours(0,0,0,0),e}function Ir(i){y(1,arguments);var e=T(i),t=e.getFullYear();return e.setFullYear(t+1,0,0),e.setHours(23,59,59,999),e}function Lr(i){y(1,arguments);var e=T(i),t=new Date(0);return t.setFullYear(e.getFullYear(),0,1),t.setHours(0,0,0,0),t}function Er(i){y(1,arguments);var e=T(i);return e.setMinutes(59,59,999),e}function Rr(i,e){var t,r,n,s,o,a,l,c;y(1,arguments);var u=pt(),f=F((t=(r=(n=(s=e?.weekStartsOn)!==null&&s!==void 0?s:e==null||(o=e.locale)===null||o===void 0||(a=o.options)===null||a===void 0?void 0:a.weekStartsOn)!==null&&n!==void 0?n:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&t!==void 0?t:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=T(i),h=d.getDay(),m=(h<f?-7:0)+6-(h-f);return d.setDate(d.getDate()+m),d.setHours(23,59,59,999),d}function Fr(i){y(1,arguments);var e=T(i);return e.setSeconds(59,999),e}function zr(i){y(1,arguments);var e=T(i),t=e.getMonth(),r=t-t%3+3;return e.setMonth(r,0),e.setHours(23,59,59,999),e}function Nr(i){y(1,arguments);var e=T(i);return e.setMilliseconds(999),e}function _i(i,e){y(2,arguments);var t=F(e);return Ct(i,-t)}var Gh=864e5;function ws(i){y(1,arguments);var e=T(i),t=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var r=e.getTime(),n=t-r;return Math.floor(n/Gh)+1}function Pt(i){y(1,arguments);var e=1,t=T(i),r=t.getUTCDay(),n=(r<e?7:0)+r-e;return t.setUTCDate(t.getUTCDate()-n),t.setUTCHours(0,0,0,0),t}function wi(i){y(1,arguments);var e=T(i),t=e.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(t+1,0,4),r.setUTCHours(0,0,0,0);var n=Pt(r),s=new Date(0);s.setUTCFullYear(t,0,4),s.setUTCHours(0,0,0,0);var o=Pt(s);return e.getTime()>=n.getTime()?t+1:e.getTime()>=o.getTime()?t:t-1}function Ms(i){y(1,arguments);var e=wi(i),t=new Date(0);t.setUTCFullYear(e,0,4),t.setUTCHours(0,0,0,0);var r=Pt(t);return r}var Kh=6048e5;function Mi(i){y(1,arguments);var e=T(i),t=Pt(e).getTime()-Ms(e).getTime();return Math.round(t/Kh)+1}function _t(i,e){var t,r,n,s,o,a,l,c;y(1,arguments);var u=pt(),f=F((t=(r=(n=(s=e?.weekStartsOn)!==null&&s!==void 0?s:e==null||(o=e.locale)===null||o===void 0||(a=o.options)===null||a===void 0?void 0:a.weekStartsOn)!==null&&n!==void 0?n:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&t!==void 0?t:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=T(i),h=d.getUTCDay(),m=(h<f?7:0)+h-f;return d.setUTCDate(d.getUTCDate()-m),d.setUTCHours(0,0,0,0),d}function ke(i,e){var t,r,n,s,o,a,l,c;y(1,arguments);var u=T(i),f=u.getUTCFullYear(),d=pt(),h=F((t=(r=(n=(s=e?.firstWeekContainsDate)!==null&&s!==void 0?s:e==null||(o=e.locale)===null||o===void 0||(a=o.options)===null||a===void 0?void 0:a.firstWeekContainsDate)!==null&&n!==void 0?n:d.firstWeekContainsDate)!==null&&r!==void 0?r:(l=d.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&t!==void 0?t:1);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var m=new Date(0);m.setUTCFullYear(f+1,0,h),m.setUTCHours(0,0,0,0);var p=_t(m,e),g=new Date(0);g.setUTCFullYear(f,0,h),g.setUTCHours(0,0,0,0);var b=_t(g,e);return u.getTime()>=p.getTime()?f+1:u.getTime()>=b.getTime()?f:f-1}function ks(i,e){var t,r,n,s,o,a,l,c;y(1,arguments);var u=pt(),f=F((t=(r=(n=(s=e?.firstWeekContainsDate)!==null&&s!==void 0?s:e==null||(o=e.locale)===null||o===void 0||(a=o.options)===null||a===void 0?void 0:a.firstWeekContainsDate)!==null&&n!==void 0?n:u.firstWeekContainsDate)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&t!==void 0?t:1),d=ke(i,e),h=new Date(0);h.setUTCFullYear(d,0,f),h.setUTCHours(0,0,0,0);var m=_t(h,e);return m}var Zh=6048e5;function ki(i,e){y(1,arguments);var t=T(i),r=_t(t,e).getTime()-ks(t,e).getTime();return Math.round(r/Zh)+1}function X(i,e){for(var t=i<0?"-":"",r=Math.abs(i).toString();r.length<e;)r="0"+r;return t+r}var Jh={y:function(e,t){var r=e.getUTCFullYear(),n=r>0?r:1-r;return X(t==="yy"?n%100:n,t.length)},M:function(e,t){var r=e.getUTCMonth();return t==="M"?String(r+1):X(r+1,2)},d:function(e,t){return X(e.getUTCDate(),t.length)},a:function(e,t){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(e,t){return X(e.getUTCHours()%12||12,t.length)},H:function(e,t){return X(e.getUTCHours(),t.length)},m:function(e,t){return X(e.getUTCMinutes(),t.length)},s:function(e,t){return X(e.getUTCSeconds(),t.length)},S:function(e,t){var r=t.length,n=e.getUTCMilliseconds(),s=Math.floor(n*Math.pow(10,r-3));return X(s,t.length)}},Qt=Jh;var Ge={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},tm={G:function(e,t,r){var n=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){var n=e.getUTCFullYear(),s=n>0?n:1-n;return r.ordinalNumber(s,{unit:"year"})}return Qt.y(e,t)},Y:function(e,t,r,n){var s=ke(e,n),o=s>0?s:1-s;if(t==="YY"){var a=o%100;return X(a,2)}return t==="Yo"?r.ordinalNumber(o,{unit:"year"}):X(o,t.length)},R:function(e,t){var r=wi(e);return X(r,t.length)},u:function(e,t){var r=e.getUTCFullYear();return X(r,t.length)},Q:function(e,t,r){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return X(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return X(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){var n=e.getUTCMonth();switch(t){case"M":case"MM":return Qt.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){var n=e.getUTCMonth();switch(t){case"L":return String(n+1);case"LL":return X(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){var s=ki(e,n);return t==="wo"?r.ordinalNumber(s,{unit:"week"}):X(s,t.length)},I:function(e,t,r){var n=Mi(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):X(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getUTCDate(),{unit:"date"}):Qt.d(e,t)},D:function(e,t,r){var n=ws(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):X(n,t.length)},E:function(e,t,r){var n=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){var s=e.getUTCDay(),o=(s-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return X(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(s,{width:"short",context:"formatting"});case"eeee":default:return r.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){var s=e.getUTCDay(),o=(s-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return X(o,t.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(s,{width:"narrow",context:"standalone"});case"cccccc":return r.day(s,{width:"short",context:"standalone"});case"cccc":default:return r.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,r){var n=e.getUTCDay(),s=n===0?7:n;switch(t){case"i":return String(s);case"ii":return X(s,t.length);case"io":return r.ordinalNumber(s,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){var n=e.getUTCHours(),s=n/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,r){var n=e.getUTCHours(),s;switch(n===12?s=Ge.noon:n===0?s=Ge.midnight:s=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,r){var n=e.getUTCHours(),s;switch(n>=17?s=Ge.evening:n>=12?s=Ge.afternoon:n>=4?s=Ge.morning:s=Ge.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){var n=e.getUTCHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return Qt.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getUTCHours(),{unit:"hour"}):Qt.H(e,t)},K:function(e,t,r){var n=e.getUTCHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):X(n,t.length)},k:function(e,t,r){var n=e.getUTCHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):X(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):Qt.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):Qt.s(e,t)},S:function(e,t){return Qt.S(e,t)},X:function(e,t,r,n){var s=n._originalDate||e,o=s.getTimezoneOffset();if(o===0)return"Z";switch(t){case"X":return rl(o);case"XXXX":case"XX":return De(o);case"XXXXX":case"XXX":default:return De(o,":")}},x:function(e,t,r,n){var s=n._originalDate||e,o=s.getTimezoneOffset();switch(t){case"x":return rl(o);case"xxxx":case"xx":return De(o);case"xxxxx":case"xxx":default:return De(o,":")}},O:function(e,t,r,n){var s=n._originalDate||e,o=s.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+il(o,":");case"OOOO":default:return"GMT"+De(o,":")}},z:function(e,t,r,n){var s=n._originalDate||e,o=s.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+il(o,":");case"zzzz":default:return"GMT"+De(o,":")}},t:function(e,t,r,n){var s=n._originalDate||e,o=Math.floor(s.getTime()/1e3);return X(o,t.length)},T:function(e,t,r,n){var s=n._originalDate||e,o=s.getTime();return X(o,t.length)}};function il(i,e){var t=i>0?"-":"+",r=Math.abs(i),n=Math.floor(r/60),s=r%60;if(s===0)return t+String(n);var o=e||"";return t+String(n)+o+X(s,2)}function rl(i,e){if(i%60===0){var t=i>0?"-":"+";return t+X(Math.abs(i)/60,2)}return De(i,e)}function De(i,e){var t=e||"",r=i>0?"-":"+",n=Math.abs(i),s=X(Math.floor(n/60),2),o=X(n%60,2);return r+s+t+o}var nl=tm;var sl=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},ol=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},em=function(e,t){var r=e.match(/(P+)(p+)?/)||[],n=r[1],s=r[2];if(!s)return sl(e,t);var o;switch(n){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",sl(n,t)).replace("{{time}}",ol(s,t))},im={p:ol,P:em},Di=im;var rm=["D","DD"],nm=["YY","YYYY"];function Wr(i){return rm.indexOf(i)!==-1}function Hr(i){return nm.indexOf(i)!==-1}function Ke(i,e,t){if(i==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(i==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(i==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(i==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var sm={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},om=function(e,t,r){var n,s=sm[e];return typeof s=="string"?n=s:t===1?n=s.one:n=s.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n},al=om;function Ti(i){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.width?String(e.width):i.defaultWidth,r=i.formats[t]||i.formats[i.defaultWidth];return r}}var am={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},lm={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},cm={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},um={date:Ti({formats:am,defaultWidth:"full"}),time:Ti({formats:lm,defaultWidth:"full"}),dateTime:Ti({formats:cm,defaultWidth:"full"})},ll=um;var fm={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},dm=function(e,t,r,n){return fm[e]},cl=dm;function Te(i){return function(e,t){var r=t!=null&&t.context?String(t.context):"standalone",n;if(r==="formatting"&&i.formattingValues){var s=i.defaultFormattingWidth||i.defaultWidth,o=t!=null&&t.width?String(t.width):s;n=i.formattingValues[o]||i.formattingValues[s]}else{var a=i.defaultWidth,l=t!=null&&t.width?String(t.width):i.defaultWidth;n=i.values[l]||i.values[a]}var c=i.argumentCallback?i.argumentCallback(e):e;return n[c]}}var hm={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},mm={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},pm={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},gm={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},bm={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},xm={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},vm=function(e,t){var r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},ym={ordinalNumber:vm,era:Te({values:hm,defaultWidth:"wide"}),quarter:Te({values:mm,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:Te({values:pm,defaultWidth:"wide"}),day:Te({values:gm,defaultWidth:"wide"}),dayPeriod:Te({values:bm,defaultWidth:"wide",formattingValues:xm,defaultFormattingWidth:"wide"})},ul=ym;function Ce(i){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.width,n=r&&i.matchPatterns[r]||i.matchPatterns[i.defaultMatchWidth],s=e.match(n);if(!s)return null;var o=s[0],a=r&&i.parsePatterns[r]||i.parsePatterns[i.defaultParseWidth],l=Array.isArray(a)?wm(a,function(f){return f.test(o)}):_m(a,function(f){return f.test(o)}),c;c=i.valueCallback?i.valueCallback(l):l,c=t.valueCallback?t.valueCallback(c):c;var u=e.slice(o.length);return{value:c,rest:u}}}function _m(i,e){for(var t in i)if(i.hasOwnProperty(t)&&e(i[t]))return t}function wm(i,e){for(var t=0;t<i.length;t++)if(e(i[t]))return t}function Ds(i){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.match(i.matchPattern);if(!r)return null;var n=r[0],s=e.match(i.parsePattern);if(!s)return null;var o=i.valueCallback?i.valueCallback(s[0]):s[0];o=t.valueCallback?t.valueCallback(o):o;var a=e.slice(n.length);return{value:o,rest:a}}}var Mm=/^(\d+)(th|st|nd|rd)?/i,km=/\d+/i,Dm={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Tm={any:[/^b/i,/^(a|c)/i]},Cm={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Pm={any:[/1/i,/2/i,/3/i,/4/i]},Om={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Sm={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Am={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Im={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Lm={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Em={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Rm={ordinalNumber:Ds({matchPattern:Mm,parsePattern:km,valueCallback:function(e){return parseInt(e,10)}}),era:Ce({matchPatterns:Dm,defaultMatchWidth:"wide",parsePatterns:Tm,defaultParseWidth:"any"}),quarter:Ce({matchPatterns:Cm,defaultMatchWidth:"wide",parsePatterns:Pm,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:Ce({matchPatterns:Om,defaultMatchWidth:"wide",parsePatterns:Sm,defaultParseWidth:"any"}),day:Ce({matchPatterns:Am,defaultMatchWidth:"wide",parsePatterns:Im,defaultParseWidth:"any"}),dayPeriod:Ce({matchPatterns:Lm,defaultMatchWidth:"any",parsePatterns:Em,defaultParseWidth:"any"})},fl=Rm;var Fm={code:"en-US",formatDistance:al,formatLong:ll,formatRelative:cl,localize:ul,match:fl,options:{weekStartsOn:0,firstWeekContainsDate:1}},dl=Fm;var Br=dl;var zm=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Nm=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Wm=/^'([^]*?)'?$/,Hm=/''/g,Bm=/[a-zA-Z]/;function Yr(i,e,t){var r,n,s,o,a,l,c,u,f,d,h,m,p,g,b,x,w,k;y(2,arguments);var v=String(e),_=pt(),P=(r=(n=t?.locale)!==null&&n!==void 0?n:_.locale)!==null&&r!==void 0?r:Br,C=F((s=(o=(a=(l=t?.firstWeekContainsDate)!==null&&l!==void 0?l:t==null||(c=t.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&a!==void 0?a:_.firstWeekContainsDate)!==null&&o!==void 0?o:(f=_.locale)===null||f===void 0||(d=f.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&s!==void 0?s:1);if(!(C>=1&&C<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var O=F((h=(m=(p=(g=t?.weekStartsOn)!==null&&g!==void 0?g:t==null||(b=t.locale)===null||b===void 0||(x=b.options)===null||x===void 0?void 0:x.weekStartsOn)!==null&&p!==void 0?p:_.weekStartsOn)!==null&&m!==void 0?m:(w=_.locale)===null||w===void 0||(k=w.options)===null||k===void 0?void 0:k.weekStartsOn)!==null&&h!==void 0?h:0);if(!(O>=0&&O<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!P.localize)throw new RangeError("locale must contain localize property");if(!P.formatLong)throw new RangeError("locale must contain formatLong property");var R=T(i);if(!je(R))throw new RangeError("Invalid time value");var z=fe(R),H=_i(R,z),rt={firstWeekContainsDate:C,weekStartsOn:O,locale:P,_originalDate:R},ut=v.match(Nm).map(function(N){var Y=N[0];if(Y==="p"||Y==="P"){var G=Di[Y];return G(N,P.formatLong)}return N}).join("").match(zm).map(function(N){if(N==="''")return"'";var Y=N[0];if(Y==="'")return Ym(N);var G=nl[Y];if(G)return!(t!=null&&t.useAdditionalWeekYearTokens)&&Hr(N)&&Ke(N,e,String(i)),!(t!=null&&t.useAdditionalDayOfYearTokens)&&Wr(N)&&Ke(N,e,String(i)),G(H,N,P.localize,rt);if(Y.match(Bm))throw new RangeError("Format string contains an unescaped latin alphabet character `"+Y+"`");return N}).join("");return ut}function Ym(i){var e=i.match(Wm);return e?e[1].replace(Hm,"'"):i}function Ts(i,e){if(i==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(i[t]=e[t]);return i}function Cs(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,r=Array(e);t<e;t++)r[t]=i[t];return r}function hl(i,e){if(i){if(typeof i=="string")return Cs(i,e);var t={}.toString.call(i).slice(8,-1);return t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set"?Array.from(i):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Cs(i,e):void 0}}function Ps(i,e){var t=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(!t){if(Array.isArray(i)||(t=hl(i))||e&&i&&typeof i.length=="number"){t&&(i=t);var r=0,n=function(){};return{s:n,n:function(){return r>=i.length?{done:!0}:{done:!1,value:i[r++]}},e:function(c){throw c},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
4
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,o=!0,a=!1;return{s:function(){t=t.call(i)},n:function(){var c=t.next();return o=c.done,c},e:function(c){a=!0,s=c},f:function(){try{o||t.return==null||t.return()}finally{if(a)throw s}}}}function D(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Ur(i,e){return Ur=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},Ur(i,e)}function I(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),e&&Ur(i,e)}function Ci(i){return Ci=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ci(i)}function Os(){try{var i=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Os=function(){return!!i})()}function ml(i,e){if(e&&(gt(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return D(i)}function L(i){var e=Os();return function(){var t,r=Ci(i);if(e){var n=Ci(this).constructor;t=Reflect.construct(r,arguments,n)}else t=r.apply(this,arguments);return ml(this,t)}}function S(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function pl(i,e){if(gt(i)!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(gt(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function Vr(i){var e=pl(i,"string");return gt(e)=="symbol"?e:e+""}function gl(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,Vr(r.key),r)}}function A(i,e,t){return e&&gl(i.prototype,e),t&&gl(i,t),Object.defineProperty(i,"prototype",{writable:!1}),i}function M(i,e,t){return(e=Vr(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var Um=10,bl=(function(){function i(){S(this,i),M(this,"priority",void 0),M(this,"subPriority",0)}return A(i,[{key:"validate",value:function(t,r){return!0}}]),i})(),xl=(function(i){I(t,i);var e=L(t);function t(r,n,s,o,a){var l;return S(this,t),l=e.call(this),l.value=r,l.validateValue=n,l.setValue=s,l.priority=o,a&&(l.subPriority=a),l}return A(t,[{key:"validate",value:function(n,s){return this.validateValue(n,this.value,s)}},{key:"set",value:function(n,s,o){return this.setValue(n,s,this.value,o)}}]),t})(bl),vl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(D(r),"priority",Um),M(D(r),"subPriority",-1),r}return A(t,[{key:"set",value:function(n,s){if(s.timestampIsSet)return n;var o=new Date(0);return o.setFullYear(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()),o.setHours(n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds(),n.getUTCMilliseconds()),o}}]),t})(bl);var E=(function(){function i(){S(this,i),M(this,"incompatibleTokens",void 0),M(this,"priority",void 0),M(this,"subPriority",void 0)}return A(i,[{key:"run",value:function(t,r,n,s){var o=this.parse(t,r,n,s);return o?{setter:new xl(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}},{key:"validate",value:function(t,r,n){return!0}}]),i})();var yl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(D(r),"priority",140),M(D(r),"incompatibleTokens",["R","u","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){switch(s){case"G":case"GG":case"GGG":return o.era(n,{width:"abbreviated"})||o.era(n,{width:"narrow"});case"GGGGG":return o.era(n,{width:"narrow"});case"GGGG":default:return o.era(n,{width:"wide"})||o.era(n,{width:"abbreviated"})||o.era(n,{width:"narrow"})}}},{key:"set",value:function(n,s,o){return s.era=o,n.setUTCFullYear(o,0,1),n.setUTCHours(0,0,0,0),n}}]),t})(E);var q={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Ot={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function K(i,e){return i&&{value:e(i.value),rest:i.rest}}function j(i,e){var t=e.match(i);return t?{value:parseInt(t[0],10),rest:e.slice(t[0].length)}:null}function St(i,e){var t=e.match(i);if(!t)return null;if(t[0]==="Z")return{value:0,rest:e.slice(1)};var r=t[1]==="+"?1:-1,n=t[2]?parseInt(t[2],10):0,s=t[3]?parseInt(t[3],10):0,o=t[5]?parseInt(t[5],10):0;return{value:r*(n*Me+s*we+o*Za),rest:e.slice(t[0].length)}}function jr(i){return j(q.anyDigitsSigned,i)}function B(i,e){switch(i){case 1:return j(q.singleDigit,e);case 2:return j(q.twoDigits,e);case 3:return j(q.threeDigits,e);case 4:return j(q.fourDigits,e);default:return j(new RegExp("^\\d{1,"+i+"}"),e)}}function Ze(i,e){switch(i){case 1:return j(q.singleDigitSigned,e);case 2:return j(q.twoDigitsSigned,e);case 3:return j(q.threeDigitsSigned,e);case 4:return j(q.fourDigitsSigned,e);default:return j(new RegExp("^-?\\d{1,"+i+"}"),e)}}function Je(i){switch(i){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function qr(i,e){var t=e>0,r=t?e:1-e,n;if(r<=50)n=i||100;else{var s=r+50,o=Math.floor(s/100)*100,a=i>=s%100;n=i+o-(a?100:0)}return t?n:1-n}function $r(i){return i%400===0||i%4===0&&i%100!==0}var _l=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(D(r),"priority",130),M(D(r),"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){var a=function(c){return{year:c,isTwoDigitYear:s==="yy"}};switch(s){case"y":return K(B(4,n),a);case"yo":return K(o.ordinalNumber(n,{unit:"year"}),a);default:return K(B(s.length,n),a)}}},{key:"validate",value:function(n,s){return s.isTwoDigitYear||s.year>0}},{key:"set",value:function(n,s,o){var a=n.getUTCFullYear();if(o.isTwoDigitYear){var l=qr(o.year,a);return n.setUTCFullYear(l,0,1),n.setUTCHours(0,0,0,0),n}var c=!("era"in s)||s.era===1?o.year:1-o.year;return n.setUTCFullYear(c,0,1),n.setUTCHours(0,0,0,0),n}}]),t})(E);var wl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(D(r),"priority",130),M(D(r),"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){var a=function(c){return{year:c,isTwoDigitYear:s==="YY"}};switch(s){case"Y":return K(B(4,n),a);case"Yo":return K(o.ordinalNumber(n,{unit:"year"}),a);default:return K(B(s.length,n),a)}}},{key:"validate",value:function(n,s){return s.isTwoDigitYear||s.year>0}},{key:"set",value:function(n,s,o,a){var l=ke(n,a);if(o.isTwoDigitYear){var c=qr(o.year,l);return n.setUTCFullYear(c,0,a.firstWeekContainsDate),n.setUTCHours(0,0,0,0),_t(n,a)}var u=!("era"in s)||s.era===1?o.year:1-o.year;return n.setUTCFullYear(u,0,a.firstWeekContainsDate),n.setUTCHours(0,0,0,0),_t(n,a)}}]),t})(E);var Ml=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(D(r),"priority",130),M(D(r),"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]),r}return A(t,[{key:"parse",value:function(n,s){return s==="R"?Ze(4,n):Ze(s.length,n)}},{key:"set",value:function(n,s,o){var a=new Date(0);return a.setUTCFullYear(o,0,4),a.setUTCHours(0,0,0,0),Pt(a)}}]),t})(E);var kl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(D(r),"priority",130),M(D(r),"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"]),r}return A(t,[{key:"parse",value:function(n,s){return s==="u"?Ze(4,n):Ze(s.length,n)}},{key:"set",value:function(n,s,o){return n.setUTCFullYear(o,0,1),n.setUTCHours(0,0,0,0),n}}]),t})(E);var Dl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(D(r),"priority",120),M(D(r),"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){switch(s){case"Q":case"QQ":return B(s.length,n);case"Qo":return o.ordinalNumber(n,{unit:"quarter"});case"QQQ":return o.quarter(n,{width:"abbreviated",context:"formatting"})||o.quarter(n,{width:"narrow",context:"formatting"});case"QQQQQ":return o.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(n,{width:"wide",context:"formatting"})||o.quarter(n,{width:"abbreviated",context:"formatting"})||o.quarter(n,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(n,s){return s>=1&&s<=4}},{key:"set",value:function(n,s,o){return n.setUTCMonth((o-1)*3,1),n.setUTCHours(0,0,0,0),n}}]),t})(E);var Tl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(D(r),"priority",120),M(D(r),"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){switch(s){case"q":case"qq":return B(s.length,n);case"qo":return o.ordinalNumber(n,{unit:"quarter"});case"qqq":return o.quarter(n,{width:"abbreviated",context:"standalone"})||o.quarter(n,{width:"narrow",context:"standalone"});case"qqqqq":return o.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(n,{width:"wide",context:"standalone"})||o.quarter(n,{width:"abbreviated",context:"standalone"})||o.quarter(n,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(n,s){return s>=1&&s<=4}},{key:"set",value:function(n,s,o){return n.setUTCMonth((o-1)*3,1),n.setUTCHours(0,0,0,0),n}}]),t})(E);var Cl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(D(r),"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]),M(D(r),"priority",110),r}return A(t,[{key:"parse",value:function(n,s,o){var a=function(c){return c-1};switch(s){case"M":return K(j(q.month,n),a);case"MM":return K(B(2,n),a);case"Mo":return K(o.ordinalNumber(n,{unit:"month"}),a);case"MMM":return o.month(n,{width:"abbreviated",context:"formatting"})||o.month(n,{width:"narrow",context:"formatting"});case"MMMMM":return o.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(n,{width:"wide",context:"formatting"})||o.month(n,{width:"abbreviated",context:"formatting"})||o.month(n,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(n,s){return s>=0&&s<=11}},{key:"set",value:function(n,s,o){return n.setUTCMonth(o,1),n.setUTCHours(0,0,0,0),n}}]),t})(E);var Pl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(D(r),"priority",110),M(D(r),"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){var a=function(c){return c-1};switch(s){case"L":return K(j(q.month,n),a);case"LL":return K(B(2,n),a);case"Lo":return K(o.ordinalNumber(n,{unit:"month"}),a);case"LLL":return o.month(n,{width:"abbreviated",context:"standalone"})||o.month(n,{width:"narrow",context:"standalone"});case"LLLLL":return o.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(n,{width:"wide",context:"standalone"})||o.month(n,{width:"abbreviated",context:"standalone"})||o.month(n,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(n,s){return s>=0&&s<=11}},{key:"set",value:function(n,s,o){return n.setUTCMonth(o,1),n.setUTCHours(0,0,0,0),n}}]),t})(E);function Ss(i,e,t){y(2,arguments);var r=T(i),n=F(e),s=ki(r,t)-n;return r.setUTCDate(r.getUTCDate()-s*7),r}var Ol=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(D(r),"priority",100),M(D(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){switch(s){case"w":return j(q.week,n);case"wo":return o.ordinalNumber(n,{unit:"week"});default:return B(s.length,n)}}},{key:"validate",value:function(n,s){return s>=1&&s<=53}},{key:"set",value:function(n,s,o,a){return _t(Ss(n,o,a),a)}}]),t})(E);function As(i,e){y(2,arguments);var t=T(i),r=F(e),n=Mi(t)-r;return t.setUTCDate(t.getUTCDate()-n*7),t}var Sl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(D(r),"priority",100),M(D(r),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){switch(s){case"I":return j(q.week,n);case"Io":return o.ordinalNumber(n,{unit:"week"});default:return B(s.length,n)}}},{key:"validate",value:function(n,s){return s>=1&&s<=53}},{key:"set",value:function(n,s,o){return Pt(As(n,o))}}]),t})(E);var Vm=[31,28,31,30,31,30,31,31,30,31,30,31],jm=[31,29,31,30,31,30,31,31,30,31,30,31],Al=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(D(r),"priority",90),M(D(r),"subPriority",1),M(D(r),"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){switch(s){case"d":return j(q.date,n);case"do":return o.ordinalNumber(n,{unit:"date"});default:return B(s.length,n)}}},{key:"validate",value:function(n,s){var o=n.getUTCFullYear(),a=$r(o),l=n.getUTCMonth();return a?s>=1&&s<=jm[l]:s>=1&&s<=Vm[l]}},{key:"set",value:function(n,s,o){return n.setUTCDate(o),n.setUTCHours(0,0,0,0),n}}]),t})(E);var Il=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(D(r),"priority",90),M(D(r),"subpriority",1),M(D(r),"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){switch(s){case"D":case"DD":return j(q.dayOfYear,n);case"Do":return o.ordinalNumber(n,{unit:"date"});default:return B(s.length,n)}}},{key:"validate",value:function(n,s){var o=n.getUTCFullYear(),a=$r(o);return a?s>=1&&s<=366:s>=1&&s<=365}},{key:"set",value:function(n,s,o){return n.setUTCMonth(0,o),n.setUTCHours(0,0,0,0),n}}]),t})(E);function Pe(i,e,t){var r,n,s,o,a,l,c,u;y(2,arguments);var f=pt(),d=F((r=(n=(s=(o=t?.weekStartsOn)!==null&&o!==void 0?o:t==null||(a=t.locale)===null||a===void 0||(l=a.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&s!==void 0?s:f.weekStartsOn)!==null&&n!==void 0?n:(c=f.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&r!==void 0?r:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=T(i),m=F(e),p=h.getUTCDay(),g=m%7,b=(g+7)%7,x=(b<d?7:0)+m-p;return h.setUTCDate(h.getUTCDate()+x),h}var Ll=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(D(r),"priority",90),M(D(r),"incompatibleTokens",["D","i","e","c","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){switch(s){case"E":case"EE":case"EEE":return o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"EEEEE":return o.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"EEEE":default:return o.day(n,{width:"wide",context:"formatting"})||o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(n,s){return s>=0&&s<=6}},{key:"set",value:function(n,s,o,a){return n=Pe(n,o,a),n.setUTCHours(0,0,0,0),n}}]),t})(E);var El=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(D(r),"priority",90),M(D(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o,a){var l=function(u){var f=Math.floor((u-1)/7)*7;return(u+a.weekStartsOn+6)%7+f};switch(s){case"e":case"ee":return K(B(s.length,n),l);case"eo":return K(o.ordinalNumber(n,{unit:"day"}),l);case"eee":return o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"eeeee":return o.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"eeee":default:return o.day(n,{width:"wide",context:"formatting"})||o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(n,s){return s>=0&&s<=6}},{key:"set",value:function(n,s,o,a){return n=Pe(n,o,a),n.setUTCHours(0,0,0,0),n}}]),t})(E);var Rl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(D(r),"priority",90),M(D(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o,a){var l=function(u){var f=Math.floor((u-1)/7)*7;return(u+a.weekStartsOn+6)%7+f};switch(s){case"c":case"cc":return K(B(s.length,n),l);case"co":return K(o.ordinalNumber(n,{unit:"day"}),l);case"ccc":return o.day(n,{width:"abbreviated",context:"standalone"})||o.day(n,{width:"short",context:"standalone"})||o.day(n,{width:"narrow",context:"standalone"});case"ccccc":return o.day(n,{width:"narrow",context:"standalone"});case"cccccc":return o.day(n,{width:"short",context:"standalone"})||o.day(n,{width:"narrow",context:"standalone"});case"cccc":default:return o.day(n,{width:"wide",context:"standalone"})||o.day(n,{width:"abbreviated",context:"standalone"})||o.day(n,{width:"short",context:"standalone"})||o.day(n,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(n,s){return s>=0&&s<=6}},{key:"set",value:function(n,s,o,a){return n=Pe(n,o,a),n.setUTCHours(0,0,0,0),n}}]),t})(E);function Is(i,e){y(2,arguments);var t=F(e);t%7===0&&(t=t-7);var r=1,n=T(i),s=n.getUTCDay(),o=t%7,a=(o+7)%7,l=(a<r?7:0)+t-s;return n.setUTCDate(n.getUTCDate()+l),n}var Fl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(D(r),"priority",90),M(D(r),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){var a=function(c){return c===0?7:c};switch(s){case"i":case"ii":return B(s.length,n);case"io":return o.ordinalNumber(n,{unit:"day"});case"iii":return K(o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"}),a);case"iiiii":return K(o.day(n,{width:"narrow",context:"formatting"}),a);case"iiiiii":return K(o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"}),a);case"iiii":default:return K(o.day(n,{width:"wide",context:"formatting"})||o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"}),a)}}},{key:"validate",value:function(n,s){return s>=1&&s<=7}},{key:"set",value:function(n,s,o){return n=Is(n,o),n.setUTCHours(0,0,0,0),n}}]),t})(E);var zl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(D(r),"priority",80),M(D(r),"incompatibleTokens",["b","B","H","k","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){switch(s){case"a":case"aa":case"aaa":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaaa":return o.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(n,{width:"wide",context:"formatting"})||o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(n,s,o){return n.setUTCHours(Je(o),0,0,0),n}}]),t})(E);var Nl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(D(r),"priority",80),M(D(r),"incompatibleTokens",["a","B","H","k","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){switch(s){case"b":case"bb":case"bbb":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbbb":return o.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(n,{width:"wide",context:"formatting"})||o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(n,s,o){return n.setUTCHours(Je(o),0,0,0),n}}]),t})(E);var Wl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(D(r),"priority",80),M(D(r),"incompatibleTokens",["a","b","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){switch(s){case"B":case"BB":case"BBB":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBBB":return o.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(n,{width:"wide",context:"formatting"})||o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(n,s,o){return n.setUTCHours(Je(o),0,0,0),n}}]),t})(E);var Hl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(D(r),"priority",70),M(D(r),"incompatibleTokens",["H","K","k","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){switch(s){case"h":return j(q.hour12h,n);case"ho":return o.ordinalNumber(n,{unit:"hour"});default:return B(s.length,n)}}},{key:"validate",value:function(n,s){return s>=1&&s<=12}},{key:"set",value:function(n,s,o){var a=n.getUTCHours()>=12;return a&&o<12?n.setUTCHours(o+12,0,0,0):!a&&o===12?n.setUTCHours(0,0,0,0):n.setUTCHours(o,0,0,0),n}}]),t})(E);var Bl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(D(r),"priority",70),M(D(r),"incompatibleTokens",["a","b","h","K","k","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){switch(s){case"H":return j(q.hour23h,n);case"Ho":return o.ordinalNumber(n,{unit:"hour"});default:return B(s.length,n)}}},{key:"validate",value:function(n,s){return s>=0&&s<=23}},{key:"set",value:function(n,s,o){return n.setUTCHours(o,0,0,0),n}}]),t})(E);var Yl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(D(r),"priority",70),M(D(r),"incompatibleTokens",["h","H","k","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){switch(s){case"K":return j(q.hour11h,n);case"Ko":return o.ordinalNumber(n,{unit:"hour"});default:return B(s.length,n)}}},{key:"validate",value:function(n,s){return s>=0&&s<=11}},{key:"set",value:function(n,s,o){var a=n.getUTCHours()>=12;return a&&o<12?n.setUTCHours(o+12,0,0,0):n.setUTCHours(o,0,0,0),n}}]),t})(E);var Ul=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(D(r),"priority",70),M(D(r),"incompatibleTokens",["a","b","h","H","K","t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){switch(s){case"k":return j(q.hour24h,n);case"ko":return o.ordinalNumber(n,{unit:"hour"});default:return B(s.length,n)}}},{key:"validate",value:function(n,s){return s>=1&&s<=24}},{key:"set",value:function(n,s,o){var a=o<=24?o%24:o;return n.setUTCHours(a,0,0,0),n}}]),t})(E);var Vl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(D(r),"priority",60),M(D(r),"incompatibleTokens",["t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){switch(s){case"m":return j(q.minute,n);case"mo":return o.ordinalNumber(n,{unit:"minute"});default:return B(s.length,n)}}},{key:"validate",value:function(n,s){return s>=0&&s<=59}},{key:"set",value:function(n,s,o){return n.setUTCMinutes(o,0,0),n}}]),t})(E);var jl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(D(r),"priority",50),M(D(r),"incompatibleTokens",["t","T"]),r}return A(t,[{key:"parse",value:function(n,s,o){switch(s){case"s":return j(q.second,n);case"so":return o.ordinalNumber(n,{unit:"second"});default:return B(s.length,n)}}},{key:"validate",value:function(n,s){return s>=0&&s<=59}},{key:"set",value:function(n,s,o){return n.setUTCSeconds(o,0),n}}]),t})(E);var ql=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(D(r),"priority",30),M(D(r),"incompatibleTokens",["t","T"]),r}return A(t,[{key:"parse",value:function(n,s){var o=function(l){return Math.floor(l*Math.pow(10,-s.length+3))};return K(B(s.length,n),o)}},{key:"set",value:function(n,s,o){return n.setUTCMilliseconds(o),n}}]),t})(E);var $l=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(D(r),"priority",10),M(D(r),"incompatibleTokens",["t","T","x"]),r}return A(t,[{key:"parse",value:function(n,s){switch(s){case"X":return St(Ot.basicOptionalMinutes,n);case"XX":return St(Ot.basic,n);case"XXXX":return St(Ot.basicOptionalSeconds,n);case"XXXXX":return St(Ot.extendedOptionalSeconds,n);case"XXX":default:return St(Ot.extended,n)}}},{key:"set",value:function(n,s,o){return s.timestampIsSet?n:new Date(n.getTime()-o)}}]),t})(E);var Xl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(D(r),"priority",10),M(D(r),"incompatibleTokens",["t","T","X"]),r}return A(t,[{key:"parse",value:function(n,s){switch(s){case"x":return St(Ot.basicOptionalMinutes,n);case"xx":return St(Ot.basic,n);case"xxxx":return St(Ot.basicOptionalSeconds,n);case"xxxxx":return St(Ot.extendedOptionalSeconds,n);case"xxx":default:return St(Ot.extended,n)}}},{key:"set",value:function(n,s,o){return s.timestampIsSet?n:new Date(n.getTime()-o)}}]),t})(E);var Ql=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(D(r),"priority",40),M(D(r),"incompatibleTokens","*"),r}return A(t,[{key:"parse",value:function(n){return jr(n)}},{key:"set",value:function(n,s,o){return[new Date(o*1e3),{timestampIsSet:!0}]}}]),t})(E);var Gl=(function(i){I(t,i);var e=L(t);function t(){var r;S(this,t);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return r=e.call.apply(e,[this].concat(s)),M(D(r),"priority",20),M(D(r),"incompatibleTokens","*"),r}return A(t,[{key:"parse",value:function(n){return jr(n)}},{key:"set",value:function(n,s,o){return[new Date(o),{timestampIsSet:!0}]}}]),t})(E);var Kl={G:new yl,y:new _l,Y:new wl,R:new Ml,u:new kl,Q:new Dl,q:new Tl,M:new Cl,L:new Pl,w:new Ol,I:new Sl,d:new Al,D:new Il,E:new Ll,e:new El,c:new Rl,i:new Fl,a:new zl,b:new Nl,B:new Wl,h:new Hl,H:new Bl,K:new Yl,k:new Ul,m:new Vl,s:new jl,S:new ql,X:new $l,x:new Xl,t:new Ql,T:new Gl};var qm=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,$m=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Xm=/^'([^]*?)'?$/,Qm=/''/g,Gm=/\S/,Km=/[a-zA-Z]/;function Xr(i,e,t,r){var n,s,o,a,l,c,u,f,d,h,m,p,g,b,x,w,k,v;y(3,arguments);var _=String(i),P=String(e),C=pt(),O=(n=(s=r?.locale)!==null&&s!==void 0?s:C.locale)!==null&&n!==void 0?n:Br;if(!O.match)throw new RangeError("locale must contain match property");var R=F((o=(a=(l=(c=r?.firstWeekContainsDate)!==null&&c!==void 0?c:r==null||(u=r.locale)===null||u===void 0||(f=u.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&l!==void 0?l:C.firstWeekContainsDate)!==null&&a!==void 0?a:(d=C.locale)===null||d===void 0||(h=d.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&o!==void 0?o:1);if(!(R>=1&&R<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var z=F((m=(p=(g=(b=r?.weekStartsOn)!==null&&b!==void 0?b:r==null||(x=r.locale)===null||x===void 0||(w=x.options)===null||w===void 0?void 0:w.weekStartsOn)!==null&&g!==void 0?g:C.weekStartsOn)!==null&&p!==void 0?p:(k=C.locale)===null||k===void 0||(v=k.options)===null||v===void 0?void 0:v.weekStartsOn)!==null&&m!==void 0?m:0);if(!(z>=0&&z<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(P==="")return _===""?T(t):new Date(NaN);var H={firstWeekContainsDate:R,weekStartsOn:z,locale:O},rt=[new vl],ut=P.match($m).map(function(ct){var J=ct[0];if(J in Di){var kt=Di[J];return kt(ct,O.formatLong)}return ct}).join("").match(qm),N=[],Y=Ps(ut),G;try{var yt=function(){var J=G.value;!(r!=null&&r.useAdditionalWeekYearTokens)&&Hr(J)&&Ke(J,P,i),!(r!=null&&r.useAdditionalDayOfYearTokens)&&Wr(J)&&Ke(J,P,i);var kt=J[0],Si=Kl[kt];if(Si){var Es=Si.incompatibleTokens;if(Array.isArray(Es)){var Rs=N.find(function(Fs){return Es.includes(Fs.token)||Fs.token===kt});if(Rs)throw new RangeError("The format string mustn't contain `".concat(Rs.fullToken,"` and `").concat(J,"` at the same time"))}else if(Si.incompatibleTokens==="*"&&N.length>0)throw new RangeError("The format string mustn't contain `".concat(J,"` and any other token at the same time"));N.push({token:kt,fullToken:J});var Jr=Si.run(_,J,O.match,H);if(!Jr)return{v:new Date(NaN)};rt.push(Jr.setter),_=Jr.rest}else{if(kt.match(Km))throw new RangeError("Format string contains an unescaped latin alphabet character `"+kt+"`");if(J==="''"?J="'":kt==="'"&&(J=Zm(J)),_.indexOf(J)===0)_=_.slice(J.length);else return{v:new Date(NaN)}}};for(Y.s();!(G=Y.n()).done;){var at=yt();if(gt(at)==="object")return at.v}}catch(ct){Y.e(ct)}finally{Y.f()}if(_.length>0&&Gm.test(_))return new Date(NaN);var Gt=rt.map(function(ct){return ct.priority}).sort(function(ct,J){return J-ct}).filter(function(ct,J,kt){return kt.indexOf(ct)===J}).map(function(ct){return rt.filter(function(J){return J.priority===ct}).sort(function(J,kt){return kt.subPriority-J.subPriority})}).map(function(ct){return ct[0]}),Kt=T(t);if(isNaN(Kt.getTime()))return new Date(NaN);var wt=_i(Kt,fe(Kt)),Zt={},Mt=Ps(Gt),Jt;try{for(Mt.s();!(Jt=Mt.n()).done;){var Lt=Jt.value;if(!Lt.validate(wt,H))return new Date(NaN);var Oi=Lt.set(wt,Zt,H);Array.isArray(Oi)?(wt=Oi[0],Ts(Zt,Oi[1])):wt=Oi}}catch(ct){Mt.e(ct)}finally{Mt.f()}return wt}function Zm(i){return i.match(Xm)[1].replace(Qm,"'")}function Qr(i){y(1,arguments);var e=T(i);return e.setMinutes(0,0,0),e}function Gr(i){y(1,arguments);var e=T(i);return e.setMilliseconds(0),e}function Zr(i,e){var t;y(1,arguments);var r=F((t=e?.additionalDigits)!==null&&t!==void 0?t:2);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof i=="string"||Object.prototype.toString.call(i)==="[object String]"))return new Date(NaN);var n=ip(i),s;if(n.date){var o=rp(n.date,r);s=np(o.restDateString,o.year)}if(!s||isNaN(s.getTime()))return new Date(NaN);var a=s.getTime(),l=0,c;if(n.time&&(l=sp(n.time),isNaN(l)))return new Date(NaN);if(n.timezone){if(c=op(n.timezone),isNaN(c))return new Date(NaN)}else{var u=new Date(a+l),f=new Date(0);return f.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),f.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),f}return new Date(a+l+c)}var Kr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Jm=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,tp=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,ep=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ip(i){var e={},t=i.split(Kr.dateTimeDelimiter),r;if(t.length>2)return e;if(/:/.test(t[0])?r=t[0]:(e.date=t[0],r=t[1],Kr.timeZoneDelimiter.test(e.date)&&(e.date=i.split(Kr.timeZoneDelimiter)[0],r=i.substr(e.date.length,i.length))),r){var n=Kr.timezone.exec(r);n?(e.time=r.replace(n[1],""),e.timezone=n[1]):e.time=r}return e}function rp(i,e){var t=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=i.match(t);if(!r)return{year:NaN,restDateString:""};var n=r[1]?parseInt(r[1]):null,s=r[2]?parseInt(r[2]):null;return{year:s===null?n:s*100,restDateString:i.slice((r[1]||r[2]).length)}}function np(i,e){if(e===null)return new Date(NaN);var t=i.match(Jm);if(!t)return new Date(NaN);var r=!!t[4],n=Pi(t[1]),s=Pi(t[2])-1,o=Pi(t[3]),a=Pi(t[4]),l=Pi(t[5])-1;if(r)return fp(e,a,l)?ap(e,a,l):new Date(NaN);var c=new Date(0);return!cp(e,s,o)||!up(e,n)?new Date(NaN):(c.setUTCFullYear(e,s,Math.max(n,o)),c)}function Pi(i){return i?parseInt(i):1}function sp(i){var e=i.match(tp);if(!e)return NaN;var t=Ls(e[1]),r=Ls(e[2]),n=Ls(e[3]);return dp(t,r,n)?t*Me+r*we+n*1e3:NaN}function Ls(i){return i&&parseFloat(i.replace(",","."))||0}function op(i){if(i==="Z")return 0;var e=i.match(ep);if(!e)return 0;var t=e[1]==="+"?-1:1,r=parseInt(e[2]),n=e[3]&&parseInt(e[3])||0;return hp(r,n)?t*(r*Me+n*we):NaN}function ap(i,e,t){var r=new Date(0);r.setUTCFullYear(i,0,4);var n=r.getUTCDay()||7,s=(e-1)*7+t+1-n;return r.setUTCDate(r.getUTCDate()+s),r}var lp=[31,null,31,30,31,30,31,31,30,31,30,31];function Zl(i){return i%400===0||i%4===0&&i%100!==0}function cp(i,e,t){return e>=0&&e<=11&&t>=1&&t<=(lp[e]||(Zl(i)?29:28))}function up(i,e){return e>=1&&e<=(Zl(i)?366:365)}function fp(i,e,t){return e>=1&&e<=53&&t>=0&&t<=6}function dp(i,e,t){return i===24?e===0&&t===0:t>=0&&t<60&&e>=0&&e<60&&i>=0&&i<25}function hp(i,e){return e>=0&&e<=59}var mp={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};gs._date.override({_id:"date-fns",formats:function(){return mp},parse:function(i,e){if(i===null||typeof i>"u")return null;let t=typeof i;return t==="number"||i instanceof Date?i=T(i):t==="string"&&(typeof e=="string"?i=Xr(i,e,new Date,this.options):i=Zr(i,this.options)),je(i)?i.getTime():null},format:function(i,e){return Yr(i,e,this.options)},add:function(i,e,t){switch(t){case"millisecond":return Ct(i,e);case"second":return yr(i,e);case"minute":return xr(i,e);case"hour":return br(i,e);case"day":return Ve(i,e);case"week":return _r(i,e);case"month":return ue(i,e);case"quarter":return vr(i,e);case"year":return wr(i,e);default:return i}},diff:function(i,e,t){switch(t){case"millisecond":return Ht(i,e);case"second":return Tr(i,e);case"minute":return kr(i,e);case"hour":return Mr(i,e);case"day":return qe(i,e);case"week":return Cr(i,e);case"month":return Qe(i,e);case"quarter":return Dr(i,e);case"year":return Pr(i,e);default:return 0}},startOf:function(i,e,t){switch(e){case"second":return Gr(i);case"minute":return Or(i);case"hour":return Qr(i);case"day":return _e(i);case"week":return yi(i);case"isoWeek":return yi(i,{weekStartsOn:+t});case"month":return Ar(i);case"quarter":return Sr(i);case"year":return Lr(i);default:return i}},endOf:function(i,e){switch(e){case"second":return Nr(i);case"minute":return Fr(i);case"hour":return Er(i);case"day":return $e(i);case"week":return Rr(i);case"month":return Xe(i);case"quarter":return zr(i);case"year":return Ir(i);default:return i}}});export{gp as a,tt as b,V as c,nt as d,W as e,Z as f,Re as g,Ut as h,$ as i,et as j,Tc as k,st as l,he as m,qs as n,ge as o,Tt as p,Vi as q,mn as r,Bi as s,it as t,ai as u,li as v,We as w,oe as x,ht as y,ot as z,lr as A,ps as B,Uu as C,It as D,Zf as E,mr as F,md as G,Kd as H,sh as I,oh as J,vh as K,cs as L,hs as M,Mp as N};
|