@kong-ui-public/analytics-chart 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,25 +8,25 @@
8
8
  * https://www.chartjs.org
9
9
  * (c) 2023 Chart.js Contributors
10
10
  * Released under the MIT License
11
- */function Ve(){}const $g=(()=>{let n=0;return()=>n++})();function at(n){return n===null||typeof n>"u"}function bt(n){if(Array.isArray&&Array.isArray(n))return!0;const t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function lt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function Nt(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function xe(n,t){return Nt(n)?n:t}function rt(n,t){return typeof n>"u"?t:n}const jg=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,dc=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function Mt(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function Dt(n,t,e,r){let i,a,s;if(bt(n))if(a=n.length,r)for(i=a-1;i>=0;i--)t.call(e,n[i],i);else for(i=0;i<a;i++)t.call(e,n[i],i);else if(lt(n))for(s=Object.keys(n),a=s.length,i=0;i<a;i++)t.call(e,n[s[i]],s[i])}function yi(n,t){let e,r,i,a;if(!n||!t||n.length!==t.length)return!1;for(e=0,r=n.length;e<r;++e)if(i=n[e],a=t[e],i.datasetIndex!==a.datasetIndex||i.index!==a.index)return!1;return!0}function vi(n){if(bt(n))return n.map(vi);if(lt(n)){const t=Object.create(null),e=Object.keys(n),r=e.length;let i=0;for(;i<r;++i)t[e[i]]=vi(n[e[i]]);return t}return n}function fc(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Vg(n,t,e,r){if(!fc(n))return;const i=t[n],a=e[n];lt(i)&&lt(a)?Mr(i,a,r):t[n]=vi(a)}function Mr(n,t,e){const r=bt(t)?t:[t],i=r.length;if(!lt(n))return n;e=e||{};const a=e.merger||Vg;let s;for(let o=0;o<i;++o){if(s=r[o],!lt(s))continue;const l=Object.keys(s);for(let c=0,u=l.length;c<u;++c)a(l[c],n,s,e)}return n}function Dr(n,t){return Mr(n,t,{merger:qg})}function qg(n,t,e){if(!fc(n))return;const r=t[n],i=e[n];lt(r)&&lt(i)?Dr(r,i):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=vi(i))}const hc={"":n=>n,x:n=>n.x,y:n=>n.y};function Xg(n){const t=n.split("."),e=[];let r="";for(const i of t)r+=i,r.endsWith("\\")?r=r.slice(0,-1)+".":(e.push(r),r="");return e}function Gg(n){const t=Xg(n);return e=>{for(const r of t){if(r==="")break;e=e&&e[r]}return e}}function un(n,t){return(hc[t]||(hc[t]=Gg(t)))(n)}function Ua(n){return n.charAt(0).toUpperCase()+n.slice(1)}const fe=n=>typeof n<"u",he=n=>typeof n=="function",gc=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function Kg(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const ft=Math.PI,Ot=2*ft,Qg=Ot+ft,xi=Number.POSITIVE_INFINITY,Wa=ft/180,At=ft/2,Me=ft/4,wi=ft*2/3,dn=Math.log10,Ne=Math.sign;function Cr(n,t,e){return Math.abs(n-t)<e}function pc(n){const t=Math.round(n);n=Cr(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(dn(n))),r=n/e;return(r<=1?1:r<=2?2:r<=5?5:10)*e}function Zg(n){const t=[],e=Math.sqrt(n);let r;for(r=1;r<e;r++)n%r===0&&(t.push(r),t.push(n/r));return e===(e|0)&&t.push(e),t.sort((i,a)=>i-a).pop(),t}function fn(n){return!isNaN(parseFloat(n))&&isFinite(n)}function Jg(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function mc(n,t,e){let r,i,a;for(r=0,i=n.length;r<i;r++)a=n[r][e],isNaN(a)||(t.min=Math.min(t.min,a),t.max=Math.max(t.max,a))}function Gt(n){return n*(ft/180)}function _i(n){return n*(180/ft)}function bc(n){if(!Nt(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function yc(n,t){const e=t.x-n.x,r=t.y-n.y,i=Math.sqrt(e*e+r*r);let a=Math.atan2(r,e);return a<-.5*ft&&(a+=Ot),{angle:a,distance:i}}function tr(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function tp(n,t){return(n-t+Qg)%Ot-ft}function we(n){return(n%Ot+Ot)%Ot}function kr(n,t,e,r){const i=we(n),a=we(t),s=we(e),o=we(a-i),l=we(s-i),c=we(i-a),u=we(i-s);return i===a||i===s||r&&a===s||o>l&&c<u}function Zt(n,t,e){return Math.max(t,Math.min(e,n))}function ep(n){return Zt(n,-32768,32767)}function qe(n,t,e,r=1e-6){return n>=Math.min(t,e)-r&&n<=Math.max(t,e)+r}function Ya(n,t,e){e=e||(s=>n[s]<t);let r=n.length-1,i=0,a;for(;r-i>1;)a=i+r>>1,e(a)?i=a:r=a;return{lo:i,hi:r}}const Xe=(n,t,e,r)=>Ya(n,e,r?i=>{const a=n[i][t];return a<e||a===e&&n[i+1][t]===e}:i=>n[i][t]<e),np=(n,t,e)=>Ya(n,e,r=>n[r][t]>=e);function rp(n,t,e){let r=0,i=n.length;for(;r<i&&n[r]<t;)r++;for(;i>r&&n[i-1]>e;)i--;return r>0||i<n.length?n.slice(r,i):n}const vc=["push","pop","shift","splice","unshift"];function ip(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),vc.forEach(e=>{const r="_onData"+Ua(e),i=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...a){const s=i.apply(this,a);return n._chartjs.listeners.forEach(o=>{typeof o[r]=="function"&&o[r](...a)}),s}})})}function xc(n,t){const e=n._chartjs;if(!e)return;const r=e.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(vc.forEach(a=>{delete n[a]}),delete n._chartjs)}function wc(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const _c=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function Tc(n,t){let e=[],r=!1;return function(...i){e=i,r||(r=!0,_c.call(window,()=>{r=!1,n.apply(t,e)}))}}function ap(n,t){let e;return function(...r){return t?(clearTimeout(e),e=setTimeout(n,t,r)):n.apply(this,r),t}}const Ha=n=>n==="start"?"left":n==="end"?"right":"center",ie=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,sp=(n,t,e,r)=>n===(r?"left":"right")?e:n==="center"?(t+e)/2:t;function Mc(n,t,e){const r=t.length;let i=0,a=r;if(n._sorted){const{iScale:s,_parsed:o}=n,l=s.axis,{min:c,max:u,minDefined:d,maxDefined:f}=s.getUserBounds();d&&(i=Zt(Math.min(Xe(o,l,c).lo,e?r:Xe(t,l,s.getPixelForValue(c)).lo),0,r-1)),f?a=Zt(Math.max(Xe(o,s.axis,u,!0).hi+1,e?0:Xe(t,l,s.getPixelForValue(u),!0).hi+1),i,r)-i:a=r-i}return{start:i,count:a}}function Dc(n){const{xScale:t,yScale:e,_scaleRanges:r}=n,i={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!r)return n._scaleRanges=i,!0;const a=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==e.min||r.ymax!==e.max;return Object.assign(r,i),a}const Ti=n=>n===0||n===1,Cc=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*Ot/e)),kc=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*Ot/e)+1,Sr={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*At)+1,easeOutSine:n=>Math.sin(n*At),easeInOutSine:n=>-.5*(Math.cos(ft*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>Ti(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>Ti(n)?n:Cc(n,.075,.3),easeOutElastic:n=>Ti(n)?n:kc(n,.075,.3),easeInOutElastic(n){return Ti(n)?n:n<.5?.5*Cc(n*2,.1125,.45):.5+.5*kc(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let t=1.70158;return(n/=.5)<1?.5*(n*n*(((t*=1.525)+1)*n-t)):.5*((n-=2)*n*(((t*=1.525)+1)*n+t)+2)},easeInBounce:n=>1-Sr.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?Sr.easeInBounce(n*2)*.5:Sr.easeOutBounce(n*2-1)*.5+.5};function za(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Sc(n){return za(n)?n:new Tr(n)}function $a(n){return za(n)?n:new Tr(n).saturate(.5).darken(.1).hexString()}const op=["x","y","borderWidth","radius","tension"],lp=["color","borderColor","backgroundColor"];function cp(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),n.set("animations",{colors:{type:"color",properties:lp},numbers:{type:"number",properties:op}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function up(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Oc=new Map;function dp(n,t){t=t||{};const e=n+JSON.stringify(t);let r=Oc.get(e);return r||(r=new Intl.NumberFormat(n,t),Oc.set(e,r)),r}function Or(n,t,e){return dp(t,e).format(n)}const Pc={values(n){return bt(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const r=this.chart.options.locale;let i,a=n;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(i="scientific"),a=fp(n,e)}const s=dn(Math.abs(a)),o=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),l={notation:i,minimumFractionDigits:o,maximumFractionDigits:o};return Object.assign(l,this.options.ticks.format),Or(n,r,l)},logarithmic(n,t,e){if(n===0)return"0";const r=e[t].significand||n/Math.pow(10,Math.floor(dn(n)));return[1,2,3,5,10,15].includes(r)||t>.8*e.length?Pc.numeric.call(this,n,t,e):""}};function fp(n,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&n!==Math.floor(n)&&(e=n-Math.floor(n)),e}var Mi={formatters:Pc};function hp(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Mi.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Pn=Object.create(null),ja=Object.create(null);function Pr(n,t){if(!t)return n;const e=t.split(".");for(let r=0,i=e.length;r<i;++r){const a=e[r];n=n[a]||(n[a]=Object.create(null))}return n}function Va(n,t,e){return typeof t=="string"?Mr(Pr(n,t),e):Mr(Pr(n,""),t)}class gp{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=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,i)=>$a(i.backgroundColor),this.hoverBorderColor=(r,i)=>$a(i.borderColor),this.hoverColor=(r,i)=>$a(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Va(this,t,e)}get(t){return Pr(this,t)}describe(t,e){return Va(ja,t,e)}override(t,e){return Va(Pn,t,e)}route(t,e,r,i){const a=Pr(this,t),s=Pr(this,r),o="_"+e;Object.defineProperties(a,{[o]:{value:a[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[o],c=s[i];return lt(l)?Object.assign({},c,l):rt(l,c)},set(l){this[o]=l}}})}apply(t){t.forEach(e=>e(this))}}var Ut=new gp({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[cp,up,hp]);function pp(n){return!n||at(n.size)||at(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Di(n,t,e,r,i){let a=t[i];return a||(a=t[i]=n.measureText(i).width,e.push(i)),a>r&&(r=a),r}function mp(n,t,e,r){r=r||{};let i=r.data=r.data||{},a=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},a=r.garbageCollect=[],r.font=t),n.save(),n.font=t;let s=0;const o=e.length;let l,c,u,d,f;for(l=0;l<o;l++)if(d=e[l],d!=null&&!bt(d))s=Di(n,i,a,s,d);else if(bt(d))for(c=0,u=d.length;c<u;c++)f=d[c],f!=null&&!bt(f)&&(s=Di(n,i,a,s,f));n.restore();const g=a.length/2;if(g>e.length){for(l=0;l<g;l++)delete i[a[l]];a.splice(0,g)}return s}function En(n,t,e){const r=n.currentDevicePixelRatio,i=e!==0?Math.max(e/2,.5):0;return Math.round((t-i)*r)/r+i}function Ec(n,t){t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore()}function qa(n,t,e,r){Ac(n,t,e,r,null)}function Ac(n,t,e,r,i){let a,s,o,l,c,u,d,f;const g=t.pointStyle,v=t.rotation,x=t.radius;let p=(v||0)*Wa;if(g&&typeof g=="object"&&(a=g.toString(),a==="[object HTMLImageElement]"||a==="[object HTMLCanvasElement]")){n.save(),n.translate(e,r),n.rotate(p),n.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),n.restore();return}if(!(isNaN(x)||x<=0)){switch(n.beginPath(),g){default:i?n.ellipse(e,r,i/2,x,0,0,Ot):n.arc(e,r,x,0,Ot),n.closePath();break;case"triangle":u=i?i/2:x,n.moveTo(e+Math.sin(p)*u,r-Math.cos(p)*x),p+=wi,n.lineTo(e+Math.sin(p)*u,r-Math.cos(p)*x),p+=wi,n.lineTo(e+Math.sin(p)*u,r-Math.cos(p)*x),n.closePath();break;case"rectRounded":c=x*.516,l=x-c,s=Math.cos(p+Me)*l,d=Math.cos(p+Me)*(i?i/2-c:l),o=Math.sin(p+Me)*l,f=Math.sin(p+Me)*(i?i/2-c:l),n.arc(e-d,r-o,c,p-ft,p-At),n.arc(e+f,r-s,c,p-At,p),n.arc(e+d,r+o,c,p,p+At),n.arc(e-f,r+s,c,p+At,p+ft),n.closePath();break;case"rect":if(!v){l=Math.SQRT1_2*x,u=i?i/2:l,n.rect(e-u,r-l,2*u,2*l);break}p+=Me;case"rectRot":d=Math.cos(p)*(i?i/2:x),s=Math.cos(p)*x,o=Math.sin(p)*x,f=Math.sin(p)*(i?i/2:x),n.moveTo(e-d,r-o),n.lineTo(e+f,r-s),n.lineTo(e+d,r+o),n.lineTo(e-f,r+s),n.closePath();break;case"crossRot":p+=Me;case"cross":d=Math.cos(p)*(i?i/2:x),s=Math.cos(p)*x,o=Math.sin(p)*x,f=Math.sin(p)*(i?i/2:x),n.moveTo(e-d,r-o),n.lineTo(e+d,r+o),n.moveTo(e+f,r-s),n.lineTo(e-f,r+s);break;case"star":d=Math.cos(p)*(i?i/2:x),s=Math.cos(p)*x,o=Math.sin(p)*x,f=Math.sin(p)*(i?i/2:x),n.moveTo(e-d,r-o),n.lineTo(e+d,r+o),n.moveTo(e+f,r-s),n.lineTo(e-f,r+s),p+=Me,d=Math.cos(p)*(i?i/2:x),s=Math.cos(p)*x,o=Math.sin(p)*x,f=Math.sin(p)*(i?i/2:x),n.moveTo(e-d,r-o),n.lineTo(e+d,r+o),n.moveTo(e+f,r-s),n.lineTo(e-f,r+s);break;case"line":s=i?i/2:Math.cos(p)*x,o=Math.sin(p)*x,n.moveTo(e-s,r-o),n.lineTo(e+s,r+o);break;case"dash":n.moveTo(e,r),n.lineTo(e+Math.cos(p)*(i?i/2:x),r+Math.sin(p)*x);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function Ge(n,t,e){return e=e||.5,!t||n&&n.x>t.left-e&&n.x<t.right+e&&n.y>t.top-e&&n.y<t.bottom+e}function Er(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function Ar(n){n.restore()}function bp(n,t,e,r,i){if(!t)return n.lineTo(e.x,e.y);if(i==="middle"){const a=(t.x+e.x)/2;n.lineTo(a,t.y),n.lineTo(a,e.y)}else i==="after"!=!!r?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function yp(n,t,e,r){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?e.cp2x:e.cp1x,r?e.cp2y:e.cp1y,e.x,e.y)}function vp(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),at(t.rotation)||n.rotate(t.rotation),t.color&&(n.fillStyle=t.color),t.textAlign&&(n.textAlign=t.textAlign),t.textBaseline&&(n.textBaseline=t.textBaseline)}function xp(n,t,e,r,i){if(i.strikethrough||i.underline){const a=n.measureText(r),s=t-a.actualBoundingBoxLeft,o=t+a.actualBoundingBoxRight,l=e-a.actualBoundingBoxAscent,c=e+a.actualBoundingBoxDescent,u=i.strikethrough?(l+c)/2:c;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=i.decorationWidth||2,n.moveTo(s,u),n.lineTo(o,u),n.stroke()}}function wp(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function An(n,t,e,r,i,a={}){const s=bt(t)?t:[t],o=a.strokeWidth>0&&a.strokeColor!=="";let l,c;for(n.save(),n.font=i.string,vp(n,a),l=0;l<s.length;++l)c=s[l],a.backdrop&&wp(n,a.backdrop),o&&(a.strokeColor&&(n.strokeStyle=a.strokeColor),at(a.strokeWidth)||(n.lineWidth=a.strokeWidth),n.strokeText(c,e,r,a.maxWidth)),n.fillText(c,e,r,a.maxWidth),xp(n,e,r,c,a),r+=Number(i.lineHeight);n.restore()}function er(n,t){const{x:e,y:r,w:i,h:a,radius:s}=t;n.arc(e+s.topLeft,r+s.topLeft,s.topLeft,1.5*ft,ft,!0),n.lineTo(e,r+a-s.bottomLeft),n.arc(e+s.bottomLeft,r+a-s.bottomLeft,s.bottomLeft,ft,At,!0),n.lineTo(e+i-s.bottomRight,r+a),n.arc(e+i-s.bottomRight,r+a-s.bottomRight,s.bottomRight,At,0,!0),n.lineTo(e+i,r+s.topRight),n.arc(e+i-s.topRight,r+s.topRight,s.topRight,0,-At,!0),n.lineTo(e+s.topLeft,r)}const _p=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Tp=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Mp(n,t){const e=(""+n).match(_p);if(!e||e[1]==="normal")return t*1.2;switch(n=+e[2],e[3]){case"px":return n;case"%":n/=100;break}return t*n}const Dp=n=>+n||0;function Xa(n,t){const e={},r=lt(t),i=r?Object.keys(t):t,a=lt(n)?r?s=>rt(n[s],n[t[s]]):s=>n[s]:()=>n;for(const s of i)e[s]=Dp(a(s));return e}function Rc(n){return Xa(n,{top:"y",right:"x",bottom:"y",left:"x"})}function hn(n){return Xa(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Kt(n){const t=Rc(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Rt(n,t){n=n||{},t=t||Ut.font;let e=rt(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let r=rt(n.style,t.style);r&&!(""+r).match(Tp)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:rt(n.family,t.family),lineHeight:Mp(rt(n.lineHeight,t.lineHeight),e),size:e,style:r,weight:rt(n.weight,t.weight),string:""};return i.string=pp(i),i}function Rr(n,t,e,r){let i=!0,a,s,o;for(a=0,s=n.length;a<s;++a)if(o=n[a],o!==void 0&&(t!==void 0&&typeof o=="function"&&(o=o(t),i=!1),e!==void 0&&bt(o)&&(o=o[e%o.length],i=!1),o!==void 0))return r&&!i&&(r.cacheable=!1),o}function Cp(n,t,e){const{min:r,max:i}=n,a=dc(t,(i-r)/2),s=(o,l)=>e&&o===0?0:o+l;return{min:s(r,-Math.abs(a)),max:s(i,a)}}function gn(n,t){return Object.assign(Object.create(n),t)}function Ga(n,t=[""],e,r,i=()=>n[0]){const a=e||n;typeof r>"u"&&(r=Bc("_fallback",n));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:a,_fallback:r,_getTarget:i,override:o=>Ga([o,...n],t,a,r)};return new Proxy(s,{deleteProperty(o,l){return delete o[l],delete o._keys,delete n[0][l],!0},get(o,l){return Ic(o,l,()=>Lp(l,t,n,o))},getOwnPropertyDescriptor(o,l){return Reflect.getOwnPropertyDescriptor(o._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,l){return Uc(o).includes(l)},ownKeys(o){return Uc(o)},set(o,l,c){const u=o._storage||(o._storage=i());return o[l]=u[l]=c,delete o._keys,!0}})}function nr(n,t,e,r){const i={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Lc(n,r),setContext:a=>nr(n,a,e,r),override:a=>nr(n.override(a),t,e,r)};return new Proxy(i,{deleteProperty(a,s){return delete a[s],delete n[s],!0},get(a,s,o){return Ic(a,s,()=>Sp(a,s,o))},getOwnPropertyDescriptor(a,s){return a._descriptors.allKeys?Reflect.has(n,s)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,s)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(a,s){return Reflect.has(n,s)},ownKeys(){return Reflect.ownKeys(n)},set(a,s,o){return n[s]=o,delete a[s],!0}})}function Lc(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=n;return{allKeys:i,scriptable:e,indexable:r,isScriptable:he(e)?e:()=>e,isIndexable:he(r)?r:()=>r}}const kp=(n,t)=>n?n+Ua(t):t,Ka=(n,t)=>lt(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Ic(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t))return n[t];const r=e();return n[t]=r,r}function Sp(n,t,e){const{_proxy:r,_context:i,_subProxy:a,_descriptors:s}=n;let o=r[t];return he(o)&&s.isScriptable(t)&&(o=Op(t,o,n,e)),bt(o)&&o.length&&(o=Pp(t,o,n,s.isIndexable)),Ka(t,o)&&(o=nr(o,i,a&&a[t],s)),o}function Op(n,t,e,r){const{_proxy:i,_context:a,_subProxy:s,_stack:o}=e;if(o.has(n))throw new Error("Recursion detected: "+Array.from(o).join("->")+"->"+n);o.add(n);let l=t(a,s||r);return o.delete(n),Ka(n,l)&&(l=Qa(i._scopes,i,n,l)),l}function Pp(n,t,e,r){const{_proxy:i,_context:a,_subProxy:s,_descriptors:o}=e;if(typeof a.index<"u"&&r(n))return t[a.index%t.length];if(lt(t[0])){const l=t,c=i._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=Qa(c,i,n,u);t.push(nr(d,a,s&&s[n],o))}}return t}function Nc(n,t,e){return he(n)?n(t,e):n}const Ep=(n,t)=>n===!0?t:typeof n=="string"?un(t,n):void 0;function Ap(n,t,e,r,i){for(const a of t){const s=Ep(e,a);if(s){n.add(s);const o=Nc(s._fallback,e,i);if(typeof o<"u"&&o!==e&&o!==r)return o}else if(s===!1&&typeof r<"u"&&e!==r)return null}return!1}function Qa(n,t,e,r){const i=t._rootScopes,a=Nc(t._fallback,e,r),s=[...n,...i],o=new Set;o.add(r);let l=Fc(o,s,e,a||e,r);return l===null||typeof a<"u"&&a!==e&&(l=Fc(o,s,a,l,r),l===null)?!1:Ga(Array.from(o),[""],i,a,()=>Rp(t,e,r))}function Fc(n,t,e,r,i){for(;e;)e=Ap(n,t,e,r,i);return e}function Rp(n,t,e){const r=n._getTarget();t in r||(r[t]={});const i=r[t];return bt(i)&&lt(e)?e:i||{}}function Lp(n,t,e,r){let i;for(const a of t)if(i=Bc(kp(a,n),e),typeof i<"u")return Ka(n,i)?Qa(e,r,n,i):i}function Bc(n,t){for(const e of t){if(!e)continue;const r=e[n];if(typeof r<"u")return r}}function Uc(n){let t=n._keys;return t||(t=n._keys=Ip(n._scopes)),t}function Ip(n){const t=new Set;for(const e of n)for(const r of Object.keys(e).filter(i=>!i.startsWith("_")))t.add(r);return Array.from(t)}function Wc(n,t,e,r){const{iScale:i}=n,{key:a="r"}=this._parsing,s=new Array(r);let o,l,c,u;for(o=0,l=r;o<l;++o)c=o+e,u=t[c],s[o]={r:i.parse(un(u,a),c)};return s}const Np=Number.EPSILON||1e-14,rr=(n,t)=>t<n.length&&!n[t].skip&&n[t],Yc=n=>n==="x"?"y":"x";function Fp(n,t,e,r){const i=n.skip?t:n,a=t,s=e.skip?t:e,o=tr(a,i),l=tr(s,a);let c=o/(o+l),u=l/(o+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=r*c,f=r*u;return{previous:{x:a.x-d*(s.x-i.x),y:a.y-d*(s.y-i.y)},next:{x:a.x+f*(s.x-i.x),y:a.y+f*(s.y-i.y)}}}function Bp(n,t,e){const r=n.length;let i,a,s,o,l,c=rr(n,0);for(let u=0;u<r-1;++u)if(l=c,c=rr(n,u+1),!(!l||!c)){if(Cr(t[u],0,Np)){e[u]=e[u+1]=0;continue}i=e[u]/t[u],a=e[u+1]/t[u],o=Math.pow(i,2)+Math.pow(a,2),!(o<=9)&&(s=3/Math.sqrt(o),e[u]=i*s*t[u],e[u+1]=a*s*t[u])}}function Up(n,t,e="x"){const r=Yc(e),i=n.length;let a,s,o,l=rr(n,0);for(let c=0;c<i;++c){if(s=o,o=l,l=rr(n,c+1),!o)continue;const u=o[e],d=o[r];s&&(a=(u-s[e])/3,o[`cp1${e}`]=u-a,o[`cp1${r}`]=d-a*t[c]),l&&(a=(l[e]-u)/3,o[`cp2${e}`]=u+a,o[`cp2${r}`]=d+a*t[c])}}function Wp(n,t="x"){const e=Yc(t),r=n.length,i=Array(r).fill(0),a=Array(r);let s,o,l,c=rr(n,0);for(s=0;s<r;++s)if(o=l,l=c,c=rr(n,s+1),!!l){if(c){const u=c[t]-l[t];i[s]=u!==0?(c[e]-l[e])/u:0}a[s]=o?c?Ne(i[s-1])!==Ne(i[s])?0:(i[s-1]+i[s])/2:i[s-1]:i[s]}Bp(n,i,a),Up(n,a,t)}function Ci(n,t,e){return Math.max(Math.min(n,e),t)}function Yp(n,t){let e,r,i,a,s,o=Ge(n[0],t);for(e=0,r=n.length;e<r;++e)s=a,a=o,o=e<r-1&&Ge(n[e+1],t),a&&(i=n[e],s&&(i.cp1x=Ci(i.cp1x,t.left,t.right),i.cp1y=Ci(i.cp1y,t.top,t.bottom)),o&&(i.cp2x=Ci(i.cp2x,t.left,t.right),i.cp2y=Ci(i.cp2y,t.top,t.bottom)))}function Hp(n,t,e,r,i){let a,s,o,l;if(t.spanGaps&&(n=n.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Wp(n,i);else{let c=r?n[n.length-1]:n[0];for(a=0,s=n.length;a<s;++a)o=n[a],l=Fp(c,o,n[Math.min(a+1,s-(r?0:1))%s],t.tension),o.cp1x=l.previous.x,o.cp1y=l.previous.y,o.cp2x=l.next.x,o.cp2y=l.next.y,c=o}t.capBezierPoints&&Yp(n,e)}function Za(){return typeof window<"u"&&typeof document<"u"}function Ja(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function ki(n,t,e){let r;return typeof n=="string"?(r=parseInt(n,10),n.indexOf("%")!==-1&&(r=r/100*t.parentNode[e])):r=n,r}const Si=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function zp(n,t){return Si(n).getPropertyValue(t)}const $p=["top","right","bottom","left"];function Rn(n,t,e){const r={};e=e?"-"+e:"";for(let i=0;i<4;i++){const a=$p[i];r[a]=parseFloat(n[t+"-"+a+e])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const jp=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function Vp(n,t){const e=n.touches,r=e&&e.length?e[0]:n,{offsetX:i,offsetY:a}=r;let s=!1,o,l;if(jp(i,a,n.target))o=i,l=a;else{const c=t.getBoundingClientRect();o=r.clientX-c.left,l=r.clientY-c.top,s=!0}return{x:o,y:l,box:s}}function pn(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:r}=t,i=Si(e),a=i.boxSizing==="border-box",s=Rn(i,"padding"),o=Rn(i,"border","width"),{x:l,y:c,box:u}=Vp(n,e),d=s.left+(u&&o.left),f=s.top+(u&&o.top);let{width:g,height:v}=t;return a&&(g-=s.width+o.width,v-=s.height+o.height),{x:Math.round((l-d)/g*e.width/r),y:Math.round((c-f)/v*e.height/r)}}function qp(n,t,e){let r,i;if(t===void 0||e===void 0){const a=Ja(n);if(!a)t=n.clientWidth,e=n.clientHeight;else{const s=a.getBoundingClientRect(),o=Si(a),l=Rn(o,"border","width"),c=Rn(o,"padding");t=s.width-c.width-l.width,e=s.height-c.height-l.height,r=ki(o.maxWidth,a,"clientWidth"),i=ki(o.maxHeight,a,"clientHeight")}}return{width:t,height:e,maxWidth:r||xi,maxHeight:i||xi}}const Oi=n=>Math.round(n*10)/10;function Xp(n,t,e,r){const i=Si(n),a=Rn(i,"margin"),s=ki(i.maxWidth,n,"clientWidth")||xi,o=ki(i.maxHeight,n,"clientHeight")||xi,l=qp(n,t,e);let{width:c,height:u}=l;if(i.boxSizing==="content-box"){const f=Rn(i,"border","width"),g=Rn(i,"padding");c-=g.width+f.width,u-=g.height+f.height}return c=Math.max(0,c-a.width),u=Math.max(0,r?c/r:u-a.height),c=Oi(Math.min(c,s,l.maxWidth)),u=Oi(Math.min(u,o,l.maxHeight)),c&&!u&&(u=Oi(c/2)),(t!==void 0||e!==void 0)&&r&&l.height&&u>l.height&&(u=l.height,c=Oi(Math.floor(u*r))),{width:c,height:u}}function Hc(n,t,e){const r=t||1,i=Math.floor(n.height*r),a=Math.floor(n.width*r);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const s=n.canvas;return s.style&&(e||!s.style.height&&!s.style.width)&&(s.style.height=`${n.height}px`,s.style.width=`${n.width}px`),n.currentDevicePixelRatio!==r||s.height!==i||s.width!==a?(n.currentDevicePixelRatio=r,s.height=i,s.width=a,n.ctx.setTransform(r,0,0,r,0,0),!0):!1}const Gp=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};Za()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n}();function zc(n,t){const e=zp(n,t),r=e&&e.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function Ln(n,t,e,r){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function Kp(n,t,e,r){return{x:n.x+e*(t.x-n.x),y:r==="middle"?e<.5?n.y:t.y:r==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function Qp(n,t,e,r){const i={x:n.cp2x,y:n.cp2y},a={x:t.cp1x,y:t.cp1y},s=Ln(n,i,e),o=Ln(i,a,e),l=Ln(a,t,e),c=Ln(s,o,e),u=Ln(o,l,e);return Ln(c,u,e)}const Zp=function(n,t){return{x(e){return n+n+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,r){return e-r},leftForLtr(e,r){return e-r}}},Jp=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function ir(n,t,e){return n?Zp(t,e):Jp()}function $c(n,t){let e,r;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,r=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=r)}function jc(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function Vc(n){return n==="angle"?{between:kr,compare:tp,normalize:we}:{between:qe,compare:(t,e)=>t-e,normalize:t=>t}}function qc({start:n,end:t,count:e,loop:r,style:i}){return{start:n%e,end:t%e,loop:r&&(t-n+1)%e===0,style:i}}function tm(n,t,e){const{property:r,start:i,end:a}=e,{between:s,normalize:o}=Vc(r),l=t.length;let{start:c,end:u,loop:d}=n,f,g;if(d){for(c+=l,u+=l,f=0,g=l;f<g&&s(o(t[c%l][r]),i,a);++f)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:n.style}}function Xc(n,t,e){if(!e)return[n];const{property:r,start:i,end:a}=e,s=t.length,{compare:o,between:l,normalize:c}=Vc(r),{start:u,end:d,loop:f,style:g}=tm(n,t,e),v=[];let x=!1,p=null,b,m,y;const w=()=>l(i,y,b)&&o(i,y)!==0,T=()=>o(a,b)===0||l(a,y,b),S=()=>x||w(),k=()=>!x||T();for(let M=u,D=u;M<=d;++M)m=t[M%s],!m.skip&&(b=c(m[r]),b!==y&&(x=l(b,i,a),p===null&&S()&&(p=o(b,i)===0?M:D),p!==null&&k()&&(v.push(qc({start:p,end:M,loop:f,count:s,style:g})),p=null),D=M,y=b));return p!==null&&v.push(qc({start:p,end:d,loop:f,count:s,style:g})),v}function Gc(n,t){const e=[],r=n.segments;for(let i=0;i<r.length;i++){const a=Xc(r[i],n.points,t);a.length&&e.push(...a)}return e}function em(n,t,e,r){let i=0,a=t-1;if(e&&!r)for(;i<t&&!n[i].skip;)i++;for(;i<t&&n[i].skip;)i++;for(i%=t,e&&(a+=i);a>i&&n[a%t].skip;)a--;return a%=t,{start:i,end:a}}function nm(n,t,e,r){const i=n.length,a=[];let s=t,o=n[t],l;for(l=t+1;l<=e;++l){const c=n[l%i];c.skip||c.stop?o.skip||(r=!1,a.push({start:t%i,end:(l-1)%i,loop:r}),t=s=c.stop?l:null):(s=l,o.skip&&(t=l)),o=c}return s!==null&&a.push({start:t%i,end:s%i,loop:r}),a}function rm(n,t){const e=n.points,r=n.options.spanGaps,i=e.length;if(!i)return[];const a=!!n._loop,{start:s,end:o}=em(e,i,a,r);if(r===!0)return Kc(n,[{start:s,end:o,loop:a}],e,t);const l=o<s?o+i:o,c=!!n._fullLoop&&s===0&&o===i-1;return Kc(n,nm(e,s,l,c),e,t)}function Kc(n,t,e,r){return!r||!r.setContext||!e?t:im(n,t,e,r)}function im(n,t,e,r){const i=n._chart.getContext(),a=Qc(n.options),{_datasetIndex:s,options:{spanGaps:o}}=n,l=e.length,c=[];let u=a,d=t[0].start,f=d;function g(v,x,p,b){const m=o?-1:1;if(v!==x){for(v+=l;e[v%l].skip;)v-=m;for(;e[x%l].skip;)x+=m;v%l!==x%l&&(c.push({start:v%l,end:x%l,loop:p,style:b}),u=b,d=x%l)}}for(const v of t){d=o?d:v.start;let x=e[d%l],p;for(f=d+1;f<=v.end;f++){const b=e[f%l];p=Qc(r.setContext(gn(i,{type:"segment",p0:x,p1:b,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:s}))),am(p,u)&&g(d,f-1,v.loop,u),x=b,u=p}d<f-1&&g(d,f-1,v.loop,u)}return c}function Qc(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function am(n,t){if(!t)return!1;const e=[],r=function(i,a){return za(a)?(e.includes(a)||e.push(a),e.indexOf(a)):a};return JSON.stringify(n,r)!==JSON.stringify(t,r)}/*!
11
+ */function Ve(){}const $g=(()=>{let n=0;return()=>n++})();function at(n){return n===null||typeof n>"u"}function bt(n){if(Array.isArray&&Array.isArray(n))return!0;const t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function ct(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function Nt(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function xe(n,t){return Nt(n)?n:t}function rt(n,t){return typeof n>"u"?t:n}const jg=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,dc=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function Mt(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function Dt(n,t,e,r){let i,a,s;if(bt(n))if(a=n.length,r)for(i=a-1;i>=0;i--)t.call(e,n[i],i);else for(i=0;i<a;i++)t.call(e,n[i],i);else if(ct(n))for(s=Object.keys(n),a=s.length,i=0;i<a;i++)t.call(e,n[s[i]],s[i])}function yi(n,t){let e,r,i,a;if(!n||!t||n.length!==t.length)return!1;for(e=0,r=n.length;e<r;++e)if(i=n[e],a=t[e],i.datasetIndex!==a.datasetIndex||i.index!==a.index)return!1;return!0}function vi(n){if(bt(n))return n.map(vi);if(ct(n)){const t=Object.create(null),e=Object.keys(n),r=e.length;let i=0;for(;i<r;++i)t[e[i]]=vi(n[e[i]]);return t}return n}function fc(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Vg(n,t,e,r){if(!fc(n))return;const i=t[n],a=e[n];ct(i)&&ct(a)?Mr(i,a,r):t[n]=vi(a)}function Mr(n,t,e){const r=bt(t)?t:[t],i=r.length;if(!ct(n))return n;e=e||{};const a=e.merger||Vg;let s;for(let o=0;o<i;++o){if(s=r[o],!ct(s))continue;const l=Object.keys(s);for(let c=0,u=l.length;c<u;++c)a(l[c],n,s,e)}return n}function Dr(n,t){return Mr(n,t,{merger:qg})}function qg(n,t,e){if(!fc(n))return;const r=t[n],i=e[n];ct(r)&&ct(i)?Dr(r,i):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=vi(i))}const hc={"":n=>n,x:n=>n.x,y:n=>n.y};function Xg(n){const t=n.split("."),e=[];let r="";for(const i of t)r+=i,r.endsWith("\\")?r=r.slice(0,-1)+".":(e.push(r),r="");return e}function Gg(n){const t=Xg(n);return e=>{for(const r of t){if(r==="")break;e=e&&e[r]}return e}}function un(n,t){return(hc[t]||(hc[t]=Gg(t)))(n)}function Ua(n){return n.charAt(0).toUpperCase()+n.slice(1)}const fe=n=>typeof n<"u",he=n=>typeof n=="function",gc=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function Kg(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const ft=Math.PI,Ot=2*ft,Qg=Ot+ft,xi=Number.POSITIVE_INFINITY,Wa=ft/180,At=ft/2,Me=ft/4,wi=ft*2/3,dn=Math.log10,Ne=Math.sign;function Cr(n,t,e){return Math.abs(n-t)<e}function pc(n){const t=Math.round(n);n=Cr(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(dn(n))),r=n/e;return(r<=1?1:r<=2?2:r<=5?5:10)*e}function Zg(n){const t=[],e=Math.sqrt(n);let r;for(r=1;r<e;r++)n%r===0&&(t.push(r),t.push(n/r));return e===(e|0)&&t.push(e),t.sort((i,a)=>i-a).pop(),t}function fn(n){return!isNaN(parseFloat(n))&&isFinite(n)}function Jg(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function mc(n,t,e){let r,i,a;for(r=0,i=n.length;r<i;r++)a=n[r][e],isNaN(a)||(t.min=Math.min(t.min,a),t.max=Math.max(t.max,a))}function Gt(n){return n*(ft/180)}function _i(n){return n*(180/ft)}function bc(n){if(!Nt(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function yc(n,t){const e=t.x-n.x,r=t.y-n.y,i=Math.sqrt(e*e+r*r);let a=Math.atan2(r,e);return a<-.5*ft&&(a+=Ot),{angle:a,distance:i}}function tr(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function tp(n,t){return(n-t+Qg)%Ot-ft}function we(n){return(n%Ot+Ot)%Ot}function kr(n,t,e,r){const i=we(n),a=we(t),s=we(e),o=we(a-i),l=we(s-i),c=we(i-a),u=we(i-s);return i===a||i===s||r&&a===s||o>l&&c<u}function Zt(n,t,e){return Math.max(t,Math.min(e,n))}function ep(n){return Zt(n,-32768,32767)}function qe(n,t,e,r=1e-6){return n>=Math.min(t,e)-r&&n<=Math.max(t,e)+r}function Ya(n,t,e){e=e||(s=>n[s]<t);let r=n.length-1,i=0,a;for(;r-i>1;)a=i+r>>1,e(a)?i=a:r=a;return{lo:i,hi:r}}const Xe=(n,t,e,r)=>Ya(n,e,r?i=>{const a=n[i][t];return a<e||a===e&&n[i+1][t]===e}:i=>n[i][t]<e),np=(n,t,e)=>Ya(n,e,r=>n[r][t]>=e);function rp(n,t,e){let r=0,i=n.length;for(;r<i&&n[r]<t;)r++;for(;i>r&&n[i-1]>e;)i--;return r>0||i<n.length?n.slice(r,i):n}const vc=["push","pop","shift","splice","unshift"];function ip(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),vc.forEach(e=>{const r="_onData"+Ua(e),i=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...a){const s=i.apply(this,a);return n._chartjs.listeners.forEach(o=>{typeof o[r]=="function"&&o[r](...a)}),s}})})}function xc(n,t){const e=n._chartjs;if(!e)return;const r=e.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(vc.forEach(a=>{delete n[a]}),delete n._chartjs)}function wc(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const _c=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function Tc(n,t){let e=[],r=!1;return function(...i){e=i,r||(r=!0,_c.call(window,()=>{r=!1,n.apply(t,e)}))}}function ap(n,t){let e;return function(...r){return t?(clearTimeout(e),e=setTimeout(n,t,r)):n.apply(this,r),t}}const Ha=n=>n==="start"?"left":n==="end"?"right":"center",ie=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,sp=(n,t,e,r)=>n===(r?"left":"right")?e:n==="center"?(t+e)/2:t;function Mc(n,t,e){const r=t.length;let i=0,a=r;if(n._sorted){const{iScale:s,_parsed:o}=n,l=s.axis,{min:c,max:u,minDefined:d,maxDefined:f}=s.getUserBounds();d&&(i=Zt(Math.min(Xe(o,l,c).lo,e?r:Xe(t,l,s.getPixelForValue(c)).lo),0,r-1)),f?a=Zt(Math.max(Xe(o,s.axis,u,!0).hi+1,e?0:Xe(t,l,s.getPixelForValue(u),!0).hi+1),i,r)-i:a=r-i}return{start:i,count:a}}function Dc(n){const{xScale:t,yScale:e,_scaleRanges:r}=n,i={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!r)return n._scaleRanges=i,!0;const a=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==e.min||r.ymax!==e.max;return Object.assign(r,i),a}const Ti=n=>n===0||n===1,Cc=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*Ot/e)),kc=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*Ot/e)+1,Sr={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*At)+1,easeOutSine:n=>Math.sin(n*At),easeInOutSine:n=>-.5*(Math.cos(ft*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>Ti(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>Ti(n)?n:Cc(n,.075,.3),easeOutElastic:n=>Ti(n)?n:kc(n,.075,.3),easeInOutElastic(n){return Ti(n)?n:n<.5?.5*Cc(n*2,.1125,.45):.5+.5*kc(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let t=1.70158;return(n/=.5)<1?.5*(n*n*(((t*=1.525)+1)*n-t)):.5*((n-=2)*n*(((t*=1.525)+1)*n+t)+2)},easeInBounce:n=>1-Sr.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?Sr.easeInBounce(n*2)*.5:Sr.easeOutBounce(n*2-1)*.5+.5};function za(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Sc(n){return za(n)?n:new Tr(n)}function $a(n){return za(n)?n:new Tr(n).saturate(.5).darken(.1).hexString()}const op=["x","y","borderWidth","radius","tension"],lp=["color","borderColor","backgroundColor"];function cp(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),n.set("animations",{colors:{type:"color",properties:lp},numbers:{type:"number",properties:op}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function up(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Oc=new Map;function dp(n,t){t=t||{};const e=n+JSON.stringify(t);let r=Oc.get(e);return r||(r=new Intl.NumberFormat(n,t),Oc.set(e,r)),r}function Or(n,t,e){return dp(t,e).format(n)}const Pc={values(n){return bt(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const r=this.chart.options.locale;let i,a=n;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(i="scientific"),a=fp(n,e)}const s=dn(Math.abs(a)),o=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),l={notation:i,minimumFractionDigits:o,maximumFractionDigits:o};return Object.assign(l,this.options.ticks.format),Or(n,r,l)},logarithmic(n,t,e){if(n===0)return"0";const r=e[t].significand||n/Math.pow(10,Math.floor(dn(n)));return[1,2,3,5,10,15].includes(r)||t>.8*e.length?Pc.numeric.call(this,n,t,e):""}};function fp(n,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&n!==Math.floor(n)&&(e=n-Math.floor(n)),e}var Mi={formatters:Pc};function hp(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Mi.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Pn=Object.create(null),ja=Object.create(null);function Pr(n,t){if(!t)return n;const e=t.split(".");for(let r=0,i=e.length;r<i;++r){const a=e[r];n=n[a]||(n[a]=Object.create(null))}return n}function Va(n,t,e){return typeof t=="string"?Mr(Pr(n,t),e):Mr(Pr(n,""),t)}class gp{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=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,i)=>$a(i.backgroundColor),this.hoverBorderColor=(r,i)=>$a(i.borderColor),this.hoverColor=(r,i)=>$a(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Va(this,t,e)}get(t){return Pr(this,t)}describe(t,e){return Va(ja,t,e)}override(t,e){return Va(Pn,t,e)}route(t,e,r,i){const a=Pr(this,t),s=Pr(this,r),o="_"+e;Object.defineProperties(a,{[o]:{value:a[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[o],c=s[i];return ct(l)?Object.assign({},c,l):rt(l,c)},set(l){this[o]=l}}})}apply(t){t.forEach(e=>e(this))}}var Ut=new gp({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[cp,up,hp]);function pp(n){return!n||at(n.size)||at(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Di(n,t,e,r,i){let a=t[i];return a||(a=t[i]=n.measureText(i).width,e.push(i)),a>r&&(r=a),r}function mp(n,t,e,r){r=r||{};let i=r.data=r.data||{},a=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},a=r.garbageCollect=[],r.font=t),n.save(),n.font=t;let s=0;const o=e.length;let l,c,u,d,f;for(l=0;l<o;l++)if(d=e[l],d!=null&&!bt(d))s=Di(n,i,a,s,d);else if(bt(d))for(c=0,u=d.length;c<u;c++)f=d[c],f!=null&&!bt(f)&&(s=Di(n,i,a,s,f));n.restore();const g=a.length/2;if(g>e.length){for(l=0;l<g;l++)delete i[a[l]];a.splice(0,g)}return s}function En(n,t,e){const r=n.currentDevicePixelRatio,i=e!==0?Math.max(e/2,.5):0;return Math.round((t-i)*r)/r+i}function Ec(n,t){t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore()}function qa(n,t,e,r){Ac(n,t,e,r,null)}function Ac(n,t,e,r,i){let a,s,o,l,c,u,d,f;const g=t.pointStyle,v=t.rotation,x=t.radius;let p=(v||0)*Wa;if(g&&typeof g=="object"&&(a=g.toString(),a==="[object HTMLImageElement]"||a==="[object HTMLCanvasElement]")){n.save(),n.translate(e,r),n.rotate(p),n.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),n.restore();return}if(!(isNaN(x)||x<=0)){switch(n.beginPath(),g){default:i?n.ellipse(e,r,i/2,x,0,0,Ot):n.arc(e,r,x,0,Ot),n.closePath();break;case"triangle":u=i?i/2:x,n.moveTo(e+Math.sin(p)*u,r-Math.cos(p)*x),p+=wi,n.lineTo(e+Math.sin(p)*u,r-Math.cos(p)*x),p+=wi,n.lineTo(e+Math.sin(p)*u,r-Math.cos(p)*x),n.closePath();break;case"rectRounded":c=x*.516,l=x-c,s=Math.cos(p+Me)*l,d=Math.cos(p+Me)*(i?i/2-c:l),o=Math.sin(p+Me)*l,f=Math.sin(p+Me)*(i?i/2-c:l),n.arc(e-d,r-o,c,p-ft,p-At),n.arc(e+f,r-s,c,p-At,p),n.arc(e+d,r+o,c,p,p+At),n.arc(e-f,r+s,c,p+At,p+ft),n.closePath();break;case"rect":if(!v){l=Math.SQRT1_2*x,u=i?i/2:l,n.rect(e-u,r-l,2*u,2*l);break}p+=Me;case"rectRot":d=Math.cos(p)*(i?i/2:x),s=Math.cos(p)*x,o=Math.sin(p)*x,f=Math.sin(p)*(i?i/2:x),n.moveTo(e-d,r-o),n.lineTo(e+f,r-s),n.lineTo(e+d,r+o),n.lineTo(e-f,r+s),n.closePath();break;case"crossRot":p+=Me;case"cross":d=Math.cos(p)*(i?i/2:x),s=Math.cos(p)*x,o=Math.sin(p)*x,f=Math.sin(p)*(i?i/2:x),n.moveTo(e-d,r-o),n.lineTo(e+d,r+o),n.moveTo(e+f,r-s),n.lineTo(e-f,r+s);break;case"star":d=Math.cos(p)*(i?i/2:x),s=Math.cos(p)*x,o=Math.sin(p)*x,f=Math.sin(p)*(i?i/2:x),n.moveTo(e-d,r-o),n.lineTo(e+d,r+o),n.moveTo(e+f,r-s),n.lineTo(e-f,r+s),p+=Me,d=Math.cos(p)*(i?i/2:x),s=Math.cos(p)*x,o=Math.sin(p)*x,f=Math.sin(p)*(i?i/2:x),n.moveTo(e-d,r-o),n.lineTo(e+d,r+o),n.moveTo(e+f,r-s),n.lineTo(e-f,r+s);break;case"line":s=i?i/2:Math.cos(p)*x,o=Math.sin(p)*x,n.moveTo(e-s,r-o),n.lineTo(e+s,r+o);break;case"dash":n.moveTo(e,r),n.lineTo(e+Math.cos(p)*(i?i/2:x),r+Math.sin(p)*x);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function Ge(n,t,e){return e=e||.5,!t||n&&n.x>t.left-e&&n.x<t.right+e&&n.y>t.top-e&&n.y<t.bottom+e}function Er(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function Ar(n){n.restore()}function bp(n,t,e,r,i){if(!t)return n.lineTo(e.x,e.y);if(i==="middle"){const a=(t.x+e.x)/2;n.lineTo(a,t.y),n.lineTo(a,e.y)}else i==="after"!=!!r?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function yp(n,t,e,r){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?e.cp2x:e.cp1x,r?e.cp2y:e.cp1y,e.x,e.y)}function vp(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),at(t.rotation)||n.rotate(t.rotation),t.color&&(n.fillStyle=t.color),t.textAlign&&(n.textAlign=t.textAlign),t.textBaseline&&(n.textBaseline=t.textBaseline)}function xp(n,t,e,r,i){if(i.strikethrough||i.underline){const a=n.measureText(r),s=t-a.actualBoundingBoxLeft,o=t+a.actualBoundingBoxRight,l=e-a.actualBoundingBoxAscent,c=e+a.actualBoundingBoxDescent,u=i.strikethrough?(l+c)/2:c;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=i.decorationWidth||2,n.moveTo(s,u),n.lineTo(o,u),n.stroke()}}function wp(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function An(n,t,e,r,i,a={}){const s=bt(t)?t:[t],o=a.strokeWidth>0&&a.strokeColor!=="";let l,c;for(n.save(),n.font=i.string,vp(n,a),l=0;l<s.length;++l)c=s[l],a.backdrop&&wp(n,a.backdrop),o&&(a.strokeColor&&(n.strokeStyle=a.strokeColor),at(a.strokeWidth)||(n.lineWidth=a.strokeWidth),n.strokeText(c,e,r,a.maxWidth)),n.fillText(c,e,r,a.maxWidth),xp(n,e,r,c,a),r+=Number(i.lineHeight);n.restore()}function er(n,t){const{x:e,y:r,w:i,h:a,radius:s}=t;n.arc(e+s.topLeft,r+s.topLeft,s.topLeft,1.5*ft,ft,!0),n.lineTo(e,r+a-s.bottomLeft),n.arc(e+s.bottomLeft,r+a-s.bottomLeft,s.bottomLeft,ft,At,!0),n.lineTo(e+i-s.bottomRight,r+a),n.arc(e+i-s.bottomRight,r+a-s.bottomRight,s.bottomRight,At,0,!0),n.lineTo(e+i,r+s.topRight),n.arc(e+i-s.topRight,r+s.topRight,s.topRight,0,-At,!0),n.lineTo(e+s.topLeft,r)}const _p=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Tp=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Mp(n,t){const e=(""+n).match(_p);if(!e||e[1]==="normal")return t*1.2;switch(n=+e[2],e[3]){case"px":return n;case"%":n/=100;break}return t*n}const Dp=n=>+n||0;function Xa(n,t){const e={},r=ct(t),i=r?Object.keys(t):t,a=ct(n)?r?s=>rt(n[s],n[t[s]]):s=>n[s]:()=>n;for(const s of i)e[s]=Dp(a(s));return e}function Rc(n){return Xa(n,{top:"y",right:"x",bottom:"y",left:"x"})}function hn(n){return Xa(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Kt(n){const t=Rc(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Rt(n,t){n=n||{},t=t||Ut.font;let e=rt(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let r=rt(n.style,t.style);r&&!(""+r).match(Tp)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:rt(n.family,t.family),lineHeight:Mp(rt(n.lineHeight,t.lineHeight),e),size:e,style:r,weight:rt(n.weight,t.weight),string:""};return i.string=pp(i),i}function Rr(n,t,e,r){let i=!0,a,s,o;for(a=0,s=n.length;a<s;++a)if(o=n[a],o!==void 0&&(t!==void 0&&typeof o=="function"&&(o=o(t),i=!1),e!==void 0&&bt(o)&&(o=o[e%o.length],i=!1),o!==void 0))return r&&!i&&(r.cacheable=!1),o}function Cp(n,t,e){const{min:r,max:i}=n,a=dc(t,(i-r)/2),s=(o,l)=>e&&o===0?0:o+l;return{min:s(r,-Math.abs(a)),max:s(i,a)}}function gn(n,t){return Object.assign(Object.create(n),t)}function Ga(n,t=[""],e,r,i=()=>n[0]){const a=e||n;typeof r>"u"&&(r=Bc("_fallback",n));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:a,_fallback:r,_getTarget:i,override:o=>Ga([o,...n],t,a,r)};return new Proxy(s,{deleteProperty(o,l){return delete o[l],delete o._keys,delete n[0][l],!0},get(o,l){return Ic(o,l,()=>Lp(l,t,n,o))},getOwnPropertyDescriptor(o,l){return Reflect.getOwnPropertyDescriptor(o._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,l){return Uc(o).includes(l)},ownKeys(o){return Uc(o)},set(o,l,c){const u=o._storage||(o._storage=i());return o[l]=u[l]=c,delete o._keys,!0}})}function nr(n,t,e,r){const i={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Lc(n,r),setContext:a=>nr(n,a,e,r),override:a=>nr(n.override(a),t,e,r)};return new Proxy(i,{deleteProperty(a,s){return delete a[s],delete n[s],!0},get(a,s,o){return Ic(a,s,()=>Sp(a,s,o))},getOwnPropertyDescriptor(a,s){return a._descriptors.allKeys?Reflect.has(n,s)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,s)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(a,s){return Reflect.has(n,s)},ownKeys(){return Reflect.ownKeys(n)},set(a,s,o){return n[s]=o,delete a[s],!0}})}function Lc(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=n;return{allKeys:i,scriptable:e,indexable:r,isScriptable:he(e)?e:()=>e,isIndexable:he(r)?r:()=>r}}const kp=(n,t)=>n?n+Ua(t):t,Ka=(n,t)=>ct(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Ic(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t))return n[t];const r=e();return n[t]=r,r}function Sp(n,t,e){const{_proxy:r,_context:i,_subProxy:a,_descriptors:s}=n;let o=r[t];return he(o)&&s.isScriptable(t)&&(o=Op(t,o,n,e)),bt(o)&&o.length&&(o=Pp(t,o,n,s.isIndexable)),Ka(t,o)&&(o=nr(o,i,a&&a[t],s)),o}function Op(n,t,e,r){const{_proxy:i,_context:a,_subProxy:s,_stack:o}=e;if(o.has(n))throw new Error("Recursion detected: "+Array.from(o).join("->")+"->"+n);o.add(n);let l=t(a,s||r);return o.delete(n),Ka(n,l)&&(l=Qa(i._scopes,i,n,l)),l}function Pp(n,t,e,r){const{_proxy:i,_context:a,_subProxy:s,_descriptors:o}=e;if(typeof a.index<"u"&&r(n))return t[a.index%t.length];if(ct(t[0])){const l=t,c=i._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=Qa(c,i,n,u);t.push(nr(d,a,s&&s[n],o))}}return t}function Nc(n,t,e){return he(n)?n(t,e):n}const Ep=(n,t)=>n===!0?t:typeof n=="string"?un(t,n):void 0;function Ap(n,t,e,r,i){for(const a of t){const s=Ep(e,a);if(s){n.add(s);const o=Nc(s._fallback,e,i);if(typeof o<"u"&&o!==e&&o!==r)return o}else if(s===!1&&typeof r<"u"&&e!==r)return null}return!1}function Qa(n,t,e,r){const i=t._rootScopes,a=Nc(t._fallback,e,r),s=[...n,...i],o=new Set;o.add(r);let l=Fc(o,s,e,a||e,r);return l===null||typeof a<"u"&&a!==e&&(l=Fc(o,s,a,l,r),l===null)?!1:Ga(Array.from(o),[""],i,a,()=>Rp(t,e,r))}function Fc(n,t,e,r,i){for(;e;)e=Ap(n,t,e,r,i);return e}function Rp(n,t,e){const r=n._getTarget();t in r||(r[t]={});const i=r[t];return bt(i)&&ct(e)?e:i||{}}function Lp(n,t,e,r){let i;for(const a of t)if(i=Bc(kp(a,n),e),typeof i<"u")return Ka(n,i)?Qa(e,r,n,i):i}function Bc(n,t){for(const e of t){if(!e)continue;const r=e[n];if(typeof r<"u")return r}}function Uc(n){let t=n._keys;return t||(t=n._keys=Ip(n._scopes)),t}function Ip(n){const t=new Set;for(const e of n)for(const r of Object.keys(e).filter(i=>!i.startsWith("_")))t.add(r);return Array.from(t)}function Wc(n,t,e,r){const{iScale:i}=n,{key:a="r"}=this._parsing,s=new Array(r);let o,l,c,u;for(o=0,l=r;o<l;++o)c=o+e,u=t[c],s[o]={r:i.parse(un(u,a),c)};return s}const Np=Number.EPSILON||1e-14,rr=(n,t)=>t<n.length&&!n[t].skip&&n[t],Yc=n=>n==="x"?"y":"x";function Fp(n,t,e,r){const i=n.skip?t:n,a=t,s=e.skip?t:e,o=tr(a,i),l=tr(s,a);let c=o/(o+l),u=l/(o+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=r*c,f=r*u;return{previous:{x:a.x-d*(s.x-i.x),y:a.y-d*(s.y-i.y)},next:{x:a.x+f*(s.x-i.x),y:a.y+f*(s.y-i.y)}}}function Bp(n,t,e){const r=n.length;let i,a,s,o,l,c=rr(n,0);for(let u=0;u<r-1;++u)if(l=c,c=rr(n,u+1),!(!l||!c)){if(Cr(t[u],0,Np)){e[u]=e[u+1]=0;continue}i=e[u]/t[u],a=e[u+1]/t[u],o=Math.pow(i,2)+Math.pow(a,2),!(o<=9)&&(s=3/Math.sqrt(o),e[u]=i*s*t[u],e[u+1]=a*s*t[u])}}function Up(n,t,e="x"){const r=Yc(e),i=n.length;let a,s,o,l=rr(n,0);for(let c=0;c<i;++c){if(s=o,o=l,l=rr(n,c+1),!o)continue;const u=o[e],d=o[r];s&&(a=(u-s[e])/3,o[`cp1${e}`]=u-a,o[`cp1${r}`]=d-a*t[c]),l&&(a=(l[e]-u)/3,o[`cp2${e}`]=u+a,o[`cp2${r}`]=d+a*t[c])}}function Wp(n,t="x"){const e=Yc(t),r=n.length,i=Array(r).fill(0),a=Array(r);let s,o,l,c=rr(n,0);for(s=0;s<r;++s)if(o=l,l=c,c=rr(n,s+1),!!l){if(c){const u=c[t]-l[t];i[s]=u!==0?(c[e]-l[e])/u:0}a[s]=o?c?Ne(i[s-1])!==Ne(i[s])?0:(i[s-1]+i[s])/2:i[s-1]:i[s]}Bp(n,i,a),Up(n,a,t)}function Ci(n,t,e){return Math.max(Math.min(n,e),t)}function Yp(n,t){let e,r,i,a,s,o=Ge(n[0],t);for(e=0,r=n.length;e<r;++e)s=a,a=o,o=e<r-1&&Ge(n[e+1],t),a&&(i=n[e],s&&(i.cp1x=Ci(i.cp1x,t.left,t.right),i.cp1y=Ci(i.cp1y,t.top,t.bottom)),o&&(i.cp2x=Ci(i.cp2x,t.left,t.right),i.cp2y=Ci(i.cp2y,t.top,t.bottom)))}function Hp(n,t,e,r,i){let a,s,o,l;if(t.spanGaps&&(n=n.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Wp(n,i);else{let c=r?n[n.length-1]:n[0];for(a=0,s=n.length;a<s;++a)o=n[a],l=Fp(c,o,n[Math.min(a+1,s-(r?0:1))%s],t.tension),o.cp1x=l.previous.x,o.cp1y=l.previous.y,o.cp2x=l.next.x,o.cp2y=l.next.y,c=o}t.capBezierPoints&&Yp(n,e)}function Za(){return typeof window<"u"&&typeof document<"u"}function Ja(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function ki(n,t,e){let r;return typeof n=="string"?(r=parseInt(n,10),n.indexOf("%")!==-1&&(r=r/100*t.parentNode[e])):r=n,r}const Si=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function zp(n,t){return Si(n).getPropertyValue(t)}const $p=["top","right","bottom","left"];function Rn(n,t,e){const r={};e=e?"-"+e:"";for(let i=0;i<4;i++){const a=$p[i];r[a]=parseFloat(n[t+"-"+a+e])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const jp=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function Vp(n,t){const e=n.touches,r=e&&e.length?e[0]:n,{offsetX:i,offsetY:a}=r;let s=!1,o,l;if(jp(i,a,n.target))o=i,l=a;else{const c=t.getBoundingClientRect();o=r.clientX-c.left,l=r.clientY-c.top,s=!0}return{x:o,y:l,box:s}}function pn(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:r}=t,i=Si(e),a=i.boxSizing==="border-box",s=Rn(i,"padding"),o=Rn(i,"border","width"),{x:l,y:c,box:u}=Vp(n,e),d=s.left+(u&&o.left),f=s.top+(u&&o.top);let{width:g,height:v}=t;return a&&(g-=s.width+o.width,v-=s.height+o.height),{x:Math.round((l-d)/g*e.width/r),y:Math.round((c-f)/v*e.height/r)}}function qp(n,t,e){let r,i;if(t===void 0||e===void 0){const a=Ja(n);if(!a)t=n.clientWidth,e=n.clientHeight;else{const s=a.getBoundingClientRect(),o=Si(a),l=Rn(o,"border","width"),c=Rn(o,"padding");t=s.width-c.width-l.width,e=s.height-c.height-l.height,r=ki(o.maxWidth,a,"clientWidth"),i=ki(o.maxHeight,a,"clientHeight")}}return{width:t,height:e,maxWidth:r||xi,maxHeight:i||xi}}const Oi=n=>Math.round(n*10)/10;function Xp(n,t,e,r){const i=Si(n),a=Rn(i,"margin"),s=ki(i.maxWidth,n,"clientWidth")||xi,o=ki(i.maxHeight,n,"clientHeight")||xi,l=qp(n,t,e);let{width:c,height:u}=l;if(i.boxSizing==="content-box"){const f=Rn(i,"border","width"),g=Rn(i,"padding");c-=g.width+f.width,u-=g.height+f.height}return c=Math.max(0,c-a.width),u=Math.max(0,r?c/r:u-a.height),c=Oi(Math.min(c,s,l.maxWidth)),u=Oi(Math.min(u,o,l.maxHeight)),c&&!u&&(u=Oi(c/2)),(t!==void 0||e!==void 0)&&r&&l.height&&u>l.height&&(u=l.height,c=Oi(Math.floor(u*r))),{width:c,height:u}}function Hc(n,t,e){const r=t||1,i=Math.floor(n.height*r),a=Math.floor(n.width*r);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const s=n.canvas;return s.style&&(e||!s.style.height&&!s.style.width)&&(s.style.height=`${n.height}px`,s.style.width=`${n.width}px`),n.currentDevicePixelRatio!==r||s.height!==i||s.width!==a?(n.currentDevicePixelRatio=r,s.height=i,s.width=a,n.ctx.setTransform(r,0,0,r,0,0),!0):!1}const Gp=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};Za()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n}();function zc(n,t){const e=zp(n,t),r=e&&e.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function Ln(n,t,e,r){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function Kp(n,t,e,r){return{x:n.x+e*(t.x-n.x),y:r==="middle"?e<.5?n.y:t.y:r==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function Qp(n,t,e,r){const i={x:n.cp2x,y:n.cp2y},a={x:t.cp1x,y:t.cp1y},s=Ln(n,i,e),o=Ln(i,a,e),l=Ln(a,t,e),c=Ln(s,o,e),u=Ln(o,l,e);return Ln(c,u,e)}const Zp=function(n,t){return{x(e){return n+n+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,r){return e-r},leftForLtr(e,r){return e-r}}},Jp=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function ir(n,t,e){return n?Zp(t,e):Jp()}function $c(n,t){let e,r;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,r=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=r)}function jc(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function Vc(n){return n==="angle"?{between:kr,compare:tp,normalize:we}:{between:qe,compare:(t,e)=>t-e,normalize:t=>t}}function qc({start:n,end:t,count:e,loop:r,style:i}){return{start:n%e,end:t%e,loop:r&&(t-n+1)%e===0,style:i}}function tm(n,t,e){const{property:r,start:i,end:a}=e,{between:s,normalize:o}=Vc(r),l=t.length;let{start:c,end:u,loop:d}=n,f,g;if(d){for(c+=l,u+=l,f=0,g=l;f<g&&s(o(t[c%l][r]),i,a);++f)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:n.style}}function Xc(n,t,e){if(!e)return[n];const{property:r,start:i,end:a}=e,s=t.length,{compare:o,between:l,normalize:c}=Vc(r),{start:u,end:d,loop:f,style:g}=tm(n,t,e),v=[];let x=!1,p=null,b,m,y;const w=()=>l(i,y,b)&&o(i,y)!==0,T=()=>o(a,b)===0||l(a,y,b),S=()=>x||w(),k=()=>!x||T();for(let M=u,D=u;M<=d;++M)m=t[M%s],!m.skip&&(b=c(m[r]),b!==y&&(x=l(b,i,a),p===null&&S()&&(p=o(b,i)===0?M:D),p!==null&&k()&&(v.push(qc({start:p,end:M,loop:f,count:s,style:g})),p=null),D=M,y=b));return p!==null&&v.push(qc({start:p,end:d,loop:f,count:s,style:g})),v}function Gc(n,t){const e=[],r=n.segments;for(let i=0;i<r.length;i++){const a=Xc(r[i],n.points,t);a.length&&e.push(...a)}return e}function em(n,t,e,r){let i=0,a=t-1;if(e&&!r)for(;i<t&&!n[i].skip;)i++;for(;i<t&&n[i].skip;)i++;for(i%=t,e&&(a+=i);a>i&&n[a%t].skip;)a--;return a%=t,{start:i,end:a}}function nm(n,t,e,r){const i=n.length,a=[];let s=t,o=n[t],l;for(l=t+1;l<=e;++l){const c=n[l%i];c.skip||c.stop?o.skip||(r=!1,a.push({start:t%i,end:(l-1)%i,loop:r}),t=s=c.stop?l:null):(s=l,o.skip&&(t=l)),o=c}return s!==null&&a.push({start:t%i,end:s%i,loop:r}),a}function rm(n,t){const e=n.points,r=n.options.spanGaps,i=e.length;if(!i)return[];const a=!!n._loop,{start:s,end:o}=em(e,i,a,r);if(r===!0)return Kc(n,[{start:s,end:o,loop:a}],e,t);const l=o<s?o+i:o,c=!!n._fullLoop&&s===0&&o===i-1;return Kc(n,nm(e,s,l,c),e,t)}function Kc(n,t,e,r){return!r||!r.setContext||!e?t:im(n,t,e,r)}function im(n,t,e,r){const i=n._chart.getContext(),a=Qc(n.options),{_datasetIndex:s,options:{spanGaps:o}}=n,l=e.length,c=[];let u=a,d=t[0].start,f=d;function g(v,x,p,b){const m=o?-1:1;if(v!==x){for(v+=l;e[v%l].skip;)v-=m;for(;e[x%l].skip;)x+=m;v%l!==x%l&&(c.push({start:v%l,end:x%l,loop:p,style:b}),u=b,d=x%l)}}for(const v of t){d=o?d:v.start;let x=e[d%l],p;for(f=d+1;f<=v.end;f++){const b=e[f%l];p=Qc(r.setContext(gn(i,{type:"segment",p0:x,p1:b,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:s}))),am(p,u)&&g(d,f-1,v.loop,u),x=b,u=p}d<f-1&&g(d,f-1,v.loop,u)}return c}function Qc(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function am(n,t){if(!t)return!1;const e=[],r=function(i,a){return za(a)?(e.includes(a)||e.push(a),e.indexOf(a)):a};return JSON.stringify(n,r)!==JSON.stringify(t,r)}/*!
12
12
  * Chart.js v4.4.1
13
13
  * https://www.chartjs.org
14
14
  * (c) 2023 Chart.js Contributors
15
15
  * Released under the MIT License
16
- */class sm{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,r,i){const a=e.listeners[i],s=e.duration;a.forEach(o=>o({chart:t,initial:e.initial,numSteps:s,currentStep:Math.min(r-e.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=_c.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const a=r.items;let s=a.length-1,o=!1,l;for(;s>=0;--s)l=a[s],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),o=!0):(a[s]=a[a.length-1],a.pop());o&&(i.draw(),this._notify(i,r,t,"progress")),a.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),e+=a.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let r=e.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,r)),r}listen(t,e,r){this._getAnims(t).listeners[e].push(r)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((r,i)=>Math.max(r,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const r=e.items;let i=r.length-1;for(;i>=0;--i)r[i].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Ke=new sm;const Zc="transparent",om={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const r=Sc(n||Zc),i=r.valid&&Sc(t||Zc);return i&&i.valid?i.mix(r,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class lm{constructor(t,e,r,i){const a=e[r];i=Rr([t.to,i,a,t.from]);const s=Rr([t.from,a,i]);this._active=!0,this._fn=t.fn||om[t.type||typeof s],this._easing=Sr[t.easing]||Sr.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=r,this._from=s,this._to=i,this._promises=void 0}active(){return this._active}update(t,e,r){if(this._active){this._notify(!1);const i=this._target[this._prop],a=r-this._start,s=this._duration-a;this._start=r,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=a,this._loop=!!t.loop,this._to=Rr([t.to,e,i,t.from]),this._from=Rr([t.from,i,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,r=this._duration,i=this._prop,a=this._from,s=this._loop,o=this._to;let l;if(this._active=a!==o&&(s||e<r),!this._active){this._target[i]=o,this._notify(!0);return}if(e<0){this._target[i]=a;return}l=e/r%2,l=s&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(a,o,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,r)=>{t.push({res:e,rej:r})})}_notify(t){const e=t?"res":"rej",r=this._promises||[];for(let i=0;i<r.length;i++)r[i][e]()}}class ts{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!lt(t))return;const e=Object.keys(Ut.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const a=t[i];if(!lt(a))return;const s={};for(const o of e)s[o]=a[o];(bt(a.properties)&&a.properties||[i]).forEach(o=>{(o===i||!r.has(o))&&r.set(o,s)})})}_animateOptions(t,e){const r=e.options,i=um(t,r);if(!i)return[];const a=this._createAnimations(i,r);return r.$shared&&cm(t.options.$animations,r).then(()=>{t.options=r},()=>{}),a}_createAnimations(t,e){const r=this._properties,i=[],a=t.$animations||(t.$animations={}),s=Object.keys(e),o=Date.now();let l;for(l=s.length-1;l>=0;--l){const c=s[l];if(c.charAt(0)==="$")continue;if(c==="options"){i.push(...this._animateOptions(t,e));continue}const u=e[c];let d=a[c];const f=r.get(c);if(d)if(f&&d.active()){d.update(f,u,o);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}a[c]=d=new lm(f,t,c,u),i.push(d)}return i}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const r=this._createAnimations(t,e);if(r.length)return Ke.add(this._chart,r),!0}}function cm(n,t){const e=[],r=Object.keys(t);for(let i=0;i<r.length;i++){const a=n[r[i]];a&&a.active()&&e.push(a.wait())}return Promise.all(e)}function um(n,t){if(!t)return;let e=n.options;if(!e){n.options=t;return}return e.$shared&&(n.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function Jc(n,t){const e=n&&n.options||{},r=e.reverse,i=e.min===void 0?t:0,a=e.max===void 0?t:0;return{start:r?a:i,end:r?i:a}}function dm(n,t,e){if(e===!1)return!1;const r=Jc(n,e),i=Jc(t,e);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function fm(n){let t,e,r,i;return lt(n)?(t=n.top,e=n.right,r=n.bottom,i=n.left):t=e=r=i=n,{top:t,right:e,bottom:r,left:i,disabled:n===!1}}function tu(n,t){const e=[],r=n._getSortedDatasetMetas(t);let i,a;for(i=0,a=r.length;i<a;++i)e.push(r[i].index);return e}function eu(n,t,e,r={}){const i=n.keys,a=r.mode==="single";let s,o,l,c;if(t!==null){for(s=0,o=i.length;s<o;++s){if(l=+i[s],l===e){if(r.all)continue;break}c=n.values[l],Nt(c)&&(a||t===0||Ne(t)===Ne(c))&&(t+=c)}return t}}function hm(n){const t=Object.keys(n),e=new Array(t.length);let r,i,a;for(r=0,i=t.length;r<i;++r)a=t[r],e[r]={x:a,y:n[a]};return e}function nu(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function gm(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function pm(n){const{min:t,max:e,minDefined:r,maxDefined:i}=n.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:i?e:Number.POSITIVE_INFINITY}}function mm(n,t,e){const r=n[t]||(n[t]={});return r[e]||(r[e]={})}function ru(n,t,e,r){for(const i of t.getMatchingVisibleMetas(r).reverse()){const a=n[i.index];if(e&&a>0||!e&&a<0)return i.index}return null}function iu(n,t){const{chart:e,_cachedMeta:r}=n,i=e._stacks||(e._stacks={}),{iScale:a,vScale:s,index:o}=r,l=a.axis,c=s.axis,u=gm(a,s,r),d=t.length;let f;for(let g=0;g<d;++g){const v=t[g],{[l]:x,[c]:p}=v,b=v._stacks||(v._stacks={});f=b[c]=mm(i,u,x),f[o]=p,f._top=ru(f,s,!0,r.type),f._bottom=ru(f,s,!1,r.type);const m=f._visualValues||(f._visualValues={});m[o]=p}}function es(n,t){const e=n.scales;return Object.keys(e).filter(r=>e[r].axis===t).shift()}function bm(n,t){return gn(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function ym(n,t,e){return gn(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Lr(n,t){const e=n.controller.index,r=n.vScale&&n.vScale.axis;if(r){t=t||n._parsed;for(const i of t){const a=i._stacks;if(!a||a[r]===void 0||a[r][e]===void 0)return;delete a[r][e],a[r]._visualValues!==void 0&&a[r]._visualValues[e]!==void 0&&delete a[r]._visualValues[e]}}}const ns=n=>n==="reset"||n==="none",au=(n,t)=>t?n:Object.assign({},n),vm=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:tu(e,!0),values:null};class Ee{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=nu(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&&Lr(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,r=this.getDataset(),i=(d,f,g,v)=>d==="x"?f:d==="r"?v:g,a=e.xAxisID=rt(r.xAxisID,es(t,"x")),s=e.yAxisID=rt(r.yAxisID,es(t,"y")),o=e.rAxisID=rt(r.rAxisID,es(t,"r")),l=e.indexAxis,c=e.iAxisID=i(l,a,s,o),u=e.vAxisID=i(l,s,a,o);e.xScale=this.getScaleForId(a),e.yScale=this.getScaleForId(s),e.rScale=this.getScaleForId(o),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&xc(this._data,this),t._stacked&&Lr(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),r=this._data;if(lt(e))this._data=hm(e);else if(r!==e){if(r){xc(r,this);const i=this._cachedMeta;Lr(i),i._parsed=[]}e&&Object.isExtensible(e)&&ip(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,r=this.getDataset();let i=!1;this._dataCheck();const a=e._stacked;e._stacked=nu(e.vScale,e),e.stack!==r.stack&&(i=!0,Lr(e),e.stack=r.stack),this._resyncElements(t),(i||a!==e._stacked)&&iu(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:r,_data:i}=this,{iScale:a,_stacked:s}=r,o=a.axis;let l=t===0&&e===i.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,d,f;if(this._parsing===!1)r._parsed=i,r._sorted=!0,f=i;else{bt(i[t])?f=this.parseArrayData(r,i,t,e):lt(i[t])?f=this.parseObjectData(r,i,t,e):f=this.parsePrimitiveData(r,i,t,e);const g=()=>d[o]===null||c&&d[o]<c[o];for(u=0;u<e;++u)r._parsed[u+t]=d=f[u],l&&(g()&&(l=!1),c=d);r._sorted=l}s&&iu(this,f)}parsePrimitiveData(t,e,r,i){const{iScale:a,vScale:s}=t,o=a.axis,l=s.axis,c=a.getLabels(),u=a===s,d=new Array(i);let f,g,v;for(f=0,g=i;f<g;++f)v=f+r,d[f]={[o]:u||a.parse(c[v],v),[l]:s.parse(e[v],v)};return d}parseArrayData(t,e,r,i){const{xScale:a,yScale:s}=t,o=new Array(i);let l,c,u,d;for(l=0,c=i;l<c;++l)u=l+r,d=e[u],o[l]={x:a.parse(d[0],u),y:s.parse(d[1],u)};return o}parseObjectData(t,e,r,i){const{xScale:a,yScale:s}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=new Array(i);let u,d,f,g;for(u=0,d=i;u<d;++u)f=u+r,g=e[f],c[u]={x:a.parse(un(g,o),f),y:s.parse(un(g,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,r){const i=this.chart,a=this._cachedMeta,s=e[t.axis],o={keys:tu(i,!0),values:e._stacks[t.axis]._visualValues};return eu(o,s,a.index,{mode:r})}updateRangeFromParsed(t,e,r,i){const a=r[e.axis];let s=a===null?NaN:a;const o=i&&r._stacks[e.axis];i&&o&&(i.values=o,s=eu(i,a,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,e){const r=this._cachedMeta,i=r._parsed,a=r._sorted&&t===r.iScale,s=i.length,o=this._getOtherScale(t),l=vm(e,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=pm(o);let f,g;function v(){g=i[f];const x=g[o.axis];return!Nt(g[t.axis])||u>x||d<x}for(f=0;f<s&&!(!v()&&(this.updateRangeFromParsed(c,t,g,l),a));++f);if(a){for(f=s-1;f>=0;--f)if(!v()){this.updateRangeFromParsed(c,t,g,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,r=[];let i,a,s;for(i=0,a=e.length;i<a;++i)s=e[i][t.axis],Nt(s)&&r.push(s);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,r=e.iScale,i=e.vScale,a=this.getParsed(t);return{label:r?""+r.getLabelForValue(a[r.axis]):"",value:i?""+i.getLabelForValue(a[i.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=fm(rt(this.options.clip,dm(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,r=this._cachedMeta,i=r.data||[],a=e.chartArea,s=[],o=this._drawStart||0,l=this._drawCount||i.length-o,c=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,a,o,l),u=o;u<o+l;++u){const d=i[u];d.hidden||(d.active&&c?s.push(d):d.draw(t,a))}for(u=0;u<s.length;++u)s[u].draw(t,a)}getStyle(t,e){const r=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,e,r){const i=this.getDataset();let a;if(t>=0&&t<this._cachedMeta.data.length){const s=this._cachedMeta.data[t];a=s.$context||(s.$context=ym(this.getContext(),t,s)),a.parsed=this.getParsed(t),a.raw=i.data[t],a.index=a.dataIndex=t}else a=this.$context||(this.$context=bm(this.chart.getContext(),this.index)),a.dataset=i,a.index=a.datasetIndex=this.index;return a.active=!!e,a.mode=r,a}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",r){const i=e==="active",a=this._cachedDataOpts,s=t+"-"+e,o=a[s],l=this.enableOptionSharing&&fe(r);if(o)return au(o,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=i?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),g=Object.keys(Ut.elements[t]),v=()=>this.getContext(r,i,e),x=c.resolveNamedOptions(f,g,v,d);return x.$shared&&(x.$shared=l,a[s]=Object.freeze(au(x,l))),x}_resolveAnimations(t,e,r){const i=this.chart,a=this._cachedDataOpts,s=`animation-${e}`,o=a[s];if(o)return o;let l;if(i.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,e),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(t,r,e))}const c=new ts(i,l&&l.animations);return l&&l._cacheable&&(a[s]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ns(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const r=this.resolveDataElementOptions(t,e),i=this._sharedOptions,a=this.getSharedOptions(r),s=this.includeOptions(e,a)||a!==i;return this.updateSharedOptions(a,e,r),{sharedOptions:a,includeOptions:s}}updateElement(t,e,r,i){ns(i)?Object.assign(t,r):this._resolveAnimations(e,i).update(t,r)}updateSharedOptions(t,e,r){t&&!ns(e)&&this._resolveAnimations(void 0,e).update(t,r)}_setStyle(t,e,r,i){t.active=i;const a=this.getStyle(e,i);this._resolveAnimations(e,r,i).update(t,{options:!i&&this.getSharedOptions(a)||a})}removeHoverStyle(t,e,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,e,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,r=this._cachedMeta.data;for(const[o,l,c]of this._syncList)this[o](l,c);this._syncList=[];const i=r.length,a=e.length,s=Math.min(a,i);s&&this.parse(0,s),a>i?this._insertElements(i,a-i,t):a<i&&this._removeElements(a,i-a)}_insertElements(t,e,r=!0){const i=this._cachedMeta,a=i.data,s=t+e;let o;const l=c=>{for(c.length+=e,o=c.length-1;o>=s;o--)c[o]=c[o-e]};for(l(a),o=t;o<s;++o)a[o]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,e),r&&this.updateElements(a,t,e,"reset")}updateElements(t,e,r,i){}_removeElements(t,e){const r=this._cachedMeta;if(this._parsing){const i=r._parsed.splice(t,e);r._stacked&&Lr(r,i)}r.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,r,i]=t;this[e](r,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}z(Ee,"defaults",{}),z(Ee,"datasetElementType",null),z(Ee,"dataElementType",null);function xm(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let r=[];for(let i=0,a=e.length;i<a;i++)r=r.concat(e[i].controller.getAllParsedValues(n));n._cache.$bar=wc(r.sort((i,a)=>i-a))}return n._cache.$bar}function wm(n){const t=n.iScale,e=xm(t,n.type);let r=t._length,i,a,s,o;const l=()=>{s===32767||s===-32768||(fe(o)&&(r=Math.min(r,Math.abs(s-o)||r)),o=s)};for(i=0,a=e.length;i<a;++i)s=t.getPixelForValue(e[i]),l();for(o=void 0,i=0,a=t.ticks.length;i<a;++i)s=t.getPixelForTick(i),l();return r}function _m(n,t,e,r){const i=e.barThickness;let a,s;return at(i)?(a=t.min*e.categoryPercentage,s=e.barPercentage):(a=i*r,s=1),{chunk:a/r,ratio:s,start:t.pixels[n]-a/2}}function Tm(n,t,e,r){const i=t.pixels,a=i[n];let s=n>0?i[n-1]:null,o=n<i.length-1?i[n+1]:null;const l=e.categoryPercentage;s===null&&(s=a-(o===null?t.end-t.start:o-a)),o===null&&(o=a+a-s);const c=a-(a-Math.min(s,o))/2*l;return{chunk:Math.abs(o-s)/2*l/r,ratio:e.barPercentage,start:c}}function Mm(n,t,e,r){const i=e.parse(n[0],r),a=e.parse(n[1],r),s=Math.min(i,a),o=Math.max(i,a);let l=s,c=o;Math.abs(s)>Math.abs(o)&&(l=o,c=s),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:i,end:a,min:s,max:o}}function su(n,t,e,r){return bt(n)?Mm(n,t,e,r):t[e.axis]=e.parse(n,r),t}function ou(n,t,e,r){const i=n.iScale,a=n.vScale,s=i.getLabels(),o=i===a,l=[];let c,u,d,f;for(c=e,u=e+r;c<u;++c)f=t[c],d={},d[i.axis]=o||i.parse(s[c],c),l.push(su(f,d,a,c));return l}function rs(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function Dm(n,t,e){return n!==0?Ne(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Cm(n){let t,e,r,i,a;return n.horizontal?(t=n.base>n.x,e="left",r="right"):(t=n.base<n.y,e="bottom",r="top"),t?(i="end",a="start"):(i="start",a="end"),{start:e,end:r,reverse:t,top:i,bottom:a}}function km(n,t,e,r){let i=t.borderSkipped;const a={};if(!i){n.borderSkipped=a;return}if(i===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:s,end:o,reverse:l,top:c,bottom:u}=Cm(n);i==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===r?i=c:(e._bottom||0)===r?i=u:(a[lu(u,s,o,l)]=!0,i=c)),a[lu(i,s,o,l)]=!0,n.borderSkipped=a}function lu(n,t,e,r){return r?(n=Sm(n,t,e),n=cu(n,e,t)):n=cu(n,t,e),n}function Sm(n,t,e){return n===t?e:n===e?t:n}function cu(n,t,e){return n==="start"?t:n==="end"?e:n}function Om(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class Ir extends Ee{parsePrimitiveData(t,e,r,i){return ou(t,e,r,i)}parseArrayData(t,e,r,i){return ou(t,e,r,i)}parseObjectData(t,e,r,i){const{iScale:a,vScale:s}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=a.axis==="x"?o:l,u=s.axis==="x"?o:l,d=[];let f,g,v,x;for(f=r,g=r+i;f<g;++f)x=e[f],v={},v[a.axis]=a.parse(un(x,c),f),d.push(su(un(x,u),v,s,f));return d}updateRangeFromParsed(t,e,r,i){super.updateRangeFromParsed(t,e,r,i);const a=r._custom;a&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,a.min),t.max=Math.max(t.max,a.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:r,vScale:i}=e,a=this.getParsed(t),s=a._custom,o=rs(s)?"["+s.start+", "+s.end+"]":""+i.getLabelForValue(a[i.axis]);return{label:""+r.getLabelForValue(a[r.axis]),value:o}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,r,i){const a=i==="reset",{index:s,_cachedMeta:{vScale:o}}=this,l=o.getBasePixel(),c=o.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:f}=this._getSharedOptions(e,i);for(let g=e;g<e+r;g++){const v=this.getParsed(g),x=a||at(v[o.axis])?{base:l,head:l}:this._calculateBarValuePixels(g),p=this._calculateBarIndexPixels(g,u),b=(v._stacks||{})[o.axis],m={horizontal:c,base:x.base,enableBorderRadius:!b||rs(v._custom)||s===b._top||s===b._bottom,x:c?x.head:p.center,y:c?p.center:x.head,height:c?p.size:Math.abs(x.size),width:c?Math.abs(x.size):p.size};f&&(m.options=d||this.resolveDataElementOptions(g,t[g].active?"active":i));const y=m.options||t[g].options;km(m,y,b,s),Om(m,y,u.ratio),this.updateElement(t[g],g,m,i)}}_getStacks(t,e){const{iScale:r}=this._cachedMeta,i=r.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),a=r.options.stacked,s=[],o=l=>{const c=l.controller.getParsed(e),u=c&&c[l.vScale.axis];if(at(u)||isNaN(u))return!0};for(const l of i)if(!(e!==void 0&&o(l))&&((a===!1||s.indexOf(l.stack)===-1||a===void 0&&l.stack===void 0)&&s.push(l.stack),l.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,r){const i=this._getStacks(t,r),a=e!==void 0?i.indexOf(e):-1;return a===-1?i.length-1:a}_getRuler(){const t=this.options,e=this._cachedMeta,r=e.iScale,i=[];let a,s;for(a=0,s=e.data.length;a<s;++a)i.push(r.getPixelForValue(this.getParsed(a)[r.axis],a));const o=t.barThickness;return{min:o||wm(e),pixels:i,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:r,index:i},options:{base:a,minBarLength:s}}=this,o=a||0,l=this.getParsed(t),c=l._custom,u=rs(c);let d=l[e.axis],f=0,g=r?this.applyStack(e,l,r):d,v,x;g!==d&&(f=g-d,g=d),u&&(d=c.barStart,g=c.barEnd-c.barStart,d!==0&&Ne(d)!==Ne(c.barEnd)&&(f=0),f+=d);const p=!at(a)&&!u?a:f;let b=e.getPixelForValue(p);if(this.chart.getDataVisibility(t)?v=e.getPixelForValue(f+g):v=b,x=v-b,Math.abs(x)<s){x=Dm(x,e,o)*s,d===o&&(b-=x/2);const m=e.getPixelForDecimal(0),y=e.getPixelForDecimal(1),w=Math.min(m,y),T=Math.max(m,y);b=Math.max(Math.min(b,T),w),v=b+x,r&&!u&&(l._stacks[e.axis]._visualValues[i]=e.getValueForPixel(v)-e.getValueForPixel(b))}if(b===e.getPixelForValue(o)){const m=Ne(x)*e.getLineWidthForValue(o)/2;b+=m,x-=m}return{size:x,base:b,head:v,center:v+x/2}}_calculateBarIndexPixels(t,e){const r=e.scale,i=this.options,a=i.skipNull,s=rt(i.maxBarThickness,1/0);let o,l;if(e.grouped){const c=a?this._getStackCount(t):e.stackCount,u=i.barThickness==="flex"?Tm(t,e,i,c):_m(t,e,i,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,a?t:void 0);o=u.start+u.chunk*d+u.chunk/2,l=Math.min(s,u.chunk*u.ratio)}else o=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(s,e.min*e.ratio);return{base:o-l/2,head:o+l/2,center:o,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,r=t.data,i=r.length;let a=0;for(;a<i;++a)this.getParsed(a)[e.axis]!==null&&r[a].draw(this._ctx)}}z(Ir,"id","bar"),z(Ir,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),z(Ir,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Pi extends Ee{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,r,i){const a=super.parsePrimitiveData(t,e,r,i);for(let s=0;s<a.length;s++)a[s]._custom=this.resolveDataElementOptions(s+r).radius;return a}parseArrayData(t,e,r,i){const a=super.parseArrayData(t,e,r,i);for(let s=0;s<a.length;s++){const o=e[r+s];a[s]._custom=rt(o[2],this.resolveDataElementOptions(s+r).radius)}return a}parseObjectData(t,e,r,i){const a=super.parseObjectData(t,e,r,i);for(let s=0;s<a.length;s++){const o=e[r+s];a[s]._custom=rt(o&&o.r&&+o.r,this.resolveDataElementOptions(s+r).radius)}return a}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let r=t.length-1;r>=0;--r)e=Math.max(e,t[r].size(this.resolveDataElementOptions(r))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,r=this.chart.data.labels||[],{xScale:i,yScale:a}=e,s=this.getParsed(t),o=i.getLabelForValue(s.x),l=a.getLabelForValue(s.y),c=s._custom;return{label:r[t]||"",value:"("+o+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,r,i){const a=i==="reset",{iScale:s,vScale:o}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,i),u=s.axis,d=o.axis;for(let f=e;f<e+r;f++){const g=t[f],v=!a&&this.getParsed(f),x={},p=x[u]=a?s.getPixelForDecimal(.5):s.getPixelForValue(v[u]),b=x[d]=a?o.getBasePixel():o.getPixelForValue(v[d]);x.skip=isNaN(p)||isNaN(b),c&&(x.options=l||this.resolveDataElementOptions(f,g.active?"active":i),a&&(x.options.radius=0)),this.updateElement(g,f,x,i)}}resolveDataElementOptions(t,e){const r=this.getParsed(t);let i=super.resolveDataElementOptions(t,e);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const a=i.radius;return e!=="active"&&(i.radius=0),i.radius+=rt(r&&r._custom,a),i}}z(Pi,"id","bubble"),z(Pi,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),z(Pi,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Pm(n,t,e){let r=1,i=1,a=0,s=0;if(t<Ot){const o=n,l=o+t,c=Math.cos(o),u=Math.sin(o),d=Math.cos(l),f=Math.sin(l),g=(y,w,T)=>kr(y,o,l,!0)?1:Math.max(w,w*e,T,T*e),v=(y,w,T)=>kr(y,o,l,!0)?-1:Math.min(w,w*e,T,T*e),x=g(0,c,d),p=g(At,u,f),b=v(ft,c,d),m=v(ft+At,u,f);r=(x-b)/2,i=(p-m)/2,a=-(x+b)/2,s=-(p+m)/2}return{ratioX:r,ratioY:i,offsetX:a,offsetY:s}}class mn extends Ee{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const r=this.getDataset().data,i=this._cachedMeta;if(this._parsing===!1)i._parsed=r;else{let a=l=>+r[l];if(lt(r[t])){const{key:l="value"}=this._parsing;a=c=>+un(r[c],l)}let s,o;for(s=t,o=t+e;s<o;++s)i._parsed[s]=a(s)}}_getRotation(){return Gt(this.options.rotation-90)}_getCircumference(){return Gt(this.options.circumference)}_getRotationExtents(){let t=Ot,e=-Ot;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const i=this.chart.getDatasetMeta(r).controller,a=i._getRotation(),s=i._getCircumference();t=Math.min(t,a),e=Math.max(e,a+s)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:r}=e,i=this._cachedMeta,a=i.data,s=this.getMaxBorderWidth()+this.getMaxOffset(a)+this.options.spacing,o=Math.max((Math.min(r.width,r.height)-s)/2,0),l=Math.min(jg(this.options.cutout,o),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:g,offsetX:v,offsetY:x}=Pm(d,u,l),p=(r.width-s)/f,b=(r.height-s)/g,m=Math.max(Math.min(p,b)/2,0),y=dc(this.options.radius,m),w=Math.max(y*l,0),T=(y-w)/this._getVisibleDatasetWeightTotal();this.offsetX=v*y,this.offsetY=x*y,i.total=this.calculateTotal(),this.outerRadius=y-T*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-T*c,0),this.updateElements(a,0,a.length,t)}_circumference(t,e){const r=this.options,i=this._cachedMeta,a=this._getCircumference();return e&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||i._parsed[t]===null||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*a/Ot)}updateElements(t,e,r,i){const a=i==="reset",s=this.chart,o=s.chartArea,c=s.options.animation,u=(o.left+o.right)/2,d=(o.top+o.bottom)/2,f=a&&c.animateScale,g=f?0:this.innerRadius,v=f?0:this.outerRadius,{sharedOptions:x,includeOptions:p}=this._getSharedOptions(e,i);let b=this._getRotation(),m;for(m=0;m<e;++m)b+=this._circumference(m,a);for(m=e;m<e+r;++m){const y=this._circumference(m,a),w=t[m],T={x:u+this.offsetX,y:d+this.offsetY,startAngle:b,endAngle:b+y,circumference:y,outerRadius:v,innerRadius:g};p&&(T.options=x||this.resolveDataElementOptions(m,w.active?"active":i)),b+=y,this.updateElement(w,m,T,i)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let r=0,i;for(i=0;i<e.length;i++){const a=t._parsed[i];a!==null&&!isNaN(a)&&this.chart.getDataVisibility(i)&&!e[i].hidden&&(r+=Math.abs(a))}return r}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?Ot*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,r=this.chart,i=r.data.labels||[],a=Or(e._parsed[t],r.options.locale);return{label:i[t]||"",value:a}}getMaxBorderWidth(t){let e=0;const r=this.chart;let i,a,s,o,l;if(!t){for(i=0,a=r.data.datasets.length;i<a;++i)if(r.isDatasetVisible(i)){s=r.getDatasetMeta(i),t=s.data,o=s.controller;break}}if(!t)return 0;for(i=0,a=t.length;i<a;++i)l=o.resolveDataElementOptions(i),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let r=0,i=t.length;r<i;++r){const a=this.resolveDataElementOptions(r);e=Math.max(e,a.offset||0,a.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(e+=this._getRingWeight(r));return e}_getRingWeight(t){return Math.max(rt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}z(mn,"id","doughnut"),z(mn,"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"}),z(mn,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),z(mn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:r,color:i}}=t.legend.options;return e.labels.map((a,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:a,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,e,r){r.chart.toggleDataVisibility(e.index),r.chart.update()}}}});class Nr extends Ee{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:r,data:i=[],_dataset:a}=e,s=this.chart._animationsDisabled;let{start:o,count:l}=Mc(e,i,s);this._drawStart=o,this._drawCount=l,Dc(e)&&(o=0,l=i.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!a._decimated,r.points=i;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:c},t),this.updateElements(i,o,l,t)}updateElements(t,e,r,i){const a=i==="reset",{iScale:s,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,i),f=s.axis,g=o.axis,{spanGaps:v,segment:x}=this.options,p=fn(v)?v:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||a||i==="none",m=e+r,y=t.length;let w=e>0&&this.getParsed(e-1);for(let T=0;T<y;++T){const S=t[T],k=b?S:{};if(T<e||T>=m){k.skip=!0;continue}const M=this.getParsed(T),D=at(M[g]),O=k[f]=s.getPixelForValue(M[f],T),P=k[g]=a||D?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,M,l):M[g],T);k.skip=isNaN(O)||isNaN(P)||D,k.stop=T>0&&Math.abs(M[f]-w[f])>p,x&&(k.parsed=M,k.raw=c.data[T]),d&&(k.options=u||this.resolveDataElementOptions(T,S.active?"active":i)),b||this.updateElement(S,T,k,i),w=M}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,r=e.options&&e.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const a=i[0].size(this.resolveDataElementOptions(0)),s=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,a,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}z(Nr,"id","line"),z(Nr,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),z(Nr,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Fr extends Ee{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,r=this.chart,i=r.data.labels||[],a=Or(e._parsed[t].r,r.options.locale);return{label:i[t]||"",value:a}}parseObjectData(t,e,r,i){return Wc.bind(this)(t,e,r,i)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((r,i)=>{const a=this.getParsed(i).r;!isNaN(a)&&this.chart.getDataVisibility(i)&&(a<e.min&&(e.min=a),a>e.max&&(e.max=a))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,r=t.options,i=Math.min(e.right-e.left,e.bottom-e.top),a=Math.max(i/2,0),s=Math.max(r.cutoutPercentage?a/100*r.cutoutPercentage:1,0),o=(a-s)/t.getVisibleDatasetCount();this.outerRadius=a-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,r,i){const a=i==="reset",s=this.chart,l=s.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,f=c.getIndexAngle(0)-.5*ft;let g=f,v;const x=360/this.countVisibleElements();for(v=0;v<e;++v)g+=this._computeAngle(v,i,x);for(v=e;v<e+r;v++){const p=t[v];let b=g,m=g+this._computeAngle(v,i,x),y=s.getDataVisibility(v)?c.getDistanceFromCenterForValue(this.getParsed(v).r):0;g=m,a&&(l.animateScale&&(y=0),l.animateRotate&&(b=m=f));const w={x:u,y:d,innerRadius:0,outerRadius:y,startAngle:b,endAngle:m,options:this.resolveDataElementOptions(v,p.active?"active":i)};this.updateElement(p,v,w,i)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((r,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++}),e}_computeAngle(t,e,r){return this.chart.getDataVisibility(t)?Gt(this.resolveDataElementOptions(t,e).angle||r):0}}z(Fr,"id","polarArea"),z(Fr,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),z(Fr,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:r,color:i}}=t.legend.options;return e.labels.map((a,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:a,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,e,r){r.chart.toggleDataVisibility(e.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class is extends mn{}z(is,"id","pie"),z(is,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Ei extends Ee{getLabelAndValue(t){const e=this._cachedMeta.vScale,r=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(r[e.axis])}}parseObjectData(t,e,r,i){return Wc.bind(this)(t,e,r,i)}update(t){const e=this._cachedMeta,r=e.dataset,i=e.data||[],a=e.iScale.getLabels();if(r.points=i,t!=="resize"){const s=this.resolveDatasetElementOptions(t);this.options.showLine||(s.borderWidth=0);const o={_loop:!0,_fullLoop:a.length===i.length,options:s};this.updateElement(r,void 0,o,t)}this.updateElements(i,0,i.length,t)}updateElements(t,e,r,i){const a=this._cachedMeta.rScale,s=i==="reset";for(let o=e;o<e+r;o++){const l=t[o],c=this.resolveDataElementOptions(o,l.active?"active":i),u=a.getPointPositionForValue(o,this.getParsed(o).r),d=s?a.xCenter:u.x,f=s?a.yCenter:u.y,g={x:d,y:f,angle:u.angle,skip:isNaN(d)||isNaN(f),options:c};this.updateElement(l,o,g,i)}}}z(Ei,"id","radar"),z(Ei,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),z(Ei,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Ai extends Ee{getLabelAndValue(t){const e=this._cachedMeta,r=this.chart.data.labels||[],{xScale:i,yScale:a}=e,s=this.getParsed(t),o=i.getLabelForValue(s.x),l=a.getLabelForValue(s.y);return{label:r[t]||"",value:"("+o+", "+l+")"}}update(t){const e=this._cachedMeta,{data:r=[]}=e,i=this.chart._animationsDisabled;let{start:a,count:s}=Mc(e,r,i);if(this._drawStart=a,this._drawCount=s,Dc(e)&&(a=0,s=r.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:o,_dataset:l}=e;o._chart=this.chart,o._datasetIndex=this.index,o._decimated=!!l._decimated,o.points=r;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(o,void 0,{animated:!i,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(r,a,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,r,i){const a=i==="reset",{iScale:s,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(e,i),d=this.getSharedOptions(u),f=this.includeOptions(i,d),g=s.axis,v=o.axis,{spanGaps:x,segment:p}=this.options,b=fn(x)?x:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||a||i==="none";let y=e>0&&this.getParsed(e-1);for(let w=e;w<e+r;++w){const T=t[w],S=this.getParsed(w),k=m?T:{},M=at(S[v]),D=k[g]=s.getPixelForValue(S[g],w),O=k[v]=a||M?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,S,l):S[v],w);k.skip=isNaN(D)||isNaN(O)||M,k.stop=w>0&&Math.abs(S[g]-y[g])>b,p&&(k.parsed=S,k.raw=c.data[w]),f&&(k.options=d||this.resolveDataElementOptions(w,T.active?"active":i)),m||this.updateElement(T,w,k,i),y=S}this.updateSharedOptions(d,i,u)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let o=0;for(let l=e.length-1;l>=0;--l)o=Math.max(o,e[l].size(this.resolveDataElementOptions(l))/2);return o>0&&o}const r=t.dataset,i=r.options&&r.options.borderWidth||0;if(!e.length)return i;const a=e[0].size(this.resolveDataElementOptions(0)),s=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(i,a,s)/2}}z(Ai,"id","scatter"),z(Ai,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),z(Ai,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Em=Object.freeze({__proto__:null,BarController:Ir,BubbleController:Pi,DoughnutController:mn,LineController:Nr,PieController:is,PolarAreaController:Fr,RadarController:Ei,ScatterController:Ai});function In(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class as{constructor(t){z(this,"options");this.options=t||{}}static override(t){Object.assign(as.prototype,t)}init(){}formats(){return In()}parse(){return In()}format(){return In()}add(){return In()}diff(){return In()}startOf(){return In()}endOf(){return In()}}var uu={_date:as};function Am(n,t,e,r){const{controller:i,data:a,_sorted:s}=n,o=i._cachedMeta.iScale;if(o&&t===o.axis&&t!=="r"&&s&&a.length){const l=o._reversePixels?np:Xe;if(r){if(i._sharedOptions){const c=a[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(a,t,e-u),f=l(a,t,e+u);return{lo:d.lo,hi:f.hi}}}}else return l(a,t,e)}return{lo:0,hi:a.length-1}}function Br(n,t,e,r,i){const a=n.getSortedVisibleDatasetMetas(),s=e[t];for(let o=0,l=a.length;o<l;++o){const{index:c,data:u}=a[o],{lo:d,hi:f}=Am(a[o],t,s,i);for(let g=d;g<=f;++g){const v=u[g];v.skip||r(v,c,g)}}}function Rm(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(r,i){const a=t?Math.abs(r.x-i.x):0,s=e?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(s,2))}}function ss(n,t,e,r,i){const a=[];return!i&&!n.isPointInArea(t)||Br(n,e,t,function(o,l,c){!i&&!Ge(o,n.chartArea,0)||o.inRange(t.x,t.y,r)&&a.push({element:o,datasetIndex:l,index:c})},!0),a}function Lm(n,t,e,r){let i=[];function a(s,o,l){const{startAngle:c,endAngle:u}=s.getProps(["startAngle","endAngle"],r),{angle:d}=yc(s,{x:t.x,y:t.y});kr(d,c,u)&&i.push({element:s,datasetIndex:o,index:l})}return Br(n,e,t,a),i}function Im(n,t,e,r,i,a){let s=[];const o=Rm(e);let l=Number.POSITIVE_INFINITY;function c(u,d,f){const g=u.inRange(t.x,t.y,i);if(r&&!g)return;const v=u.getCenterPoint(i);if(!(!!a||n.isPointInArea(v))&&!g)return;const p=o(t,v);p<l?(s=[{element:u,datasetIndex:d,index:f}],l=p):p===l&&s.push({element:u,datasetIndex:d,index:f})}return Br(n,e,t,c),s}function os(n,t,e,r,i,a){return!a&&!n.isPointInArea(t)?[]:e==="r"&&!r?Lm(n,t,e,i):Im(n,t,e,r,i,a)}function du(n,t,e,r,i){const a=[],s=e==="x"?"inXRange":"inYRange";let o=!1;return Br(n,e,t,(l,c,u)=>{l[s](t[e],i)&&(a.push({element:l,datasetIndex:c,index:u}),o=o||l.inRange(t.x,t.y,i))}),r&&!o?[]:a}var ls={evaluateInteractionItems:Br,modes:{index(n,t,e,r){const i=pn(t,n),a=e.axis||"x",s=e.includeInvisible||!1,o=e.intersect?ss(n,i,a,r,s):os(n,i,a,!1,r,s),l=[];return o.length?(n.getSortedVisibleDatasetMetas().forEach(c=>{const u=o[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(n,t,e,r){const i=pn(t,n),a=e.axis||"xy",s=e.includeInvisible||!1;let o=e.intersect?ss(n,i,a,r,s):os(n,i,a,!1,r,s);if(o.length>0){const l=o[0].datasetIndex,c=n.getDatasetMeta(l).data;o=[];for(let u=0;u<c.length;++u)o.push({element:c[u],datasetIndex:l,index:u})}return o},point(n,t,e,r){const i=pn(t,n),a=e.axis||"xy",s=e.includeInvisible||!1;return ss(n,i,a,r,s)},nearest(n,t,e,r){const i=pn(t,n),a=e.axis||"xy",s=e.includeInvisible||!1;return os(n,i,a,e.intersect,r,s)},x(n,t,e,r){const i=pn(t,n);return du(n,i,"x",e.intersect,r)},y(n,t,e,r){const i=pn(t,n);return du(n,i,"y",e.intersect,r)}}};const fu=["left","top","right","bottom"];function Ur(n,t){return n.filter(e=>e.pos===t)}function hu(n,t){return n.filter(e=>fu.indexOf(e.pos)===-1&&e.box.axis===t)}function Wr(n,t){return n.sort((e,r)=>{const i=t?r:e,a=t?e:r;return i.weight===a.weight?i.index-a.index:i.weight-a.weight})}function Nm(n){const t=[];let e,r,i,a,s,o;for(e=0,r=(n||[]).length;e<r;++e)i=n[e],{position:a,options:{stack:s,stackWeight:o=1}}=i,t.push({index:e,box:i,pos:a,horizontal:i.isHorizontal(),weight:i.weight,stack:s&&a+s,stackWeight:o});return t}function Fm(n){const t={};for(const e of n){const{stack:r,pos:i,stackWeight:a}=e;if(!r||!fu.includes(i))continue;const s=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=a}return t}function Bm(n,t){const e=Fm(n),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t;let a,s,o;for(a=0,s=n.length;a<s;++a){o=n[a];const{fullSize:l}=o.box,c=e[o.stack],u=c&&o.stackWeight/c.weight;o.horizontal?(o.width=u?u*r:l&&t.availableWidth,o.height=i):(o.width=r,o.height=u?u*i:l&&t.availableHeight)}return e}function Um(n){const t=Nm(n),e=Wr(t.filter(c=>c.box.fullSize),!0),r=Wr(Ur(t,"left"),!0),i=Wr(Ur(t,"right")),a=Wr(Ur(t,"top"),!0),s=Wr(Ur(t,"bottom")),o=hu(t,"x"),l=hu(t,"y");return{fullSize:e,leftAndTop:r.concat(a),rightAndBottom:i.concat(l).concat(s).concat(o),chartArea:Ur(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:a.concat(s).concat(o)}}function gu(n,t,e,r){return Math.max(n[e],t[e])+Math.max(n[r],t[r])}function pu(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function Wm(n,t,e,r){const{pos:i,box:a}=e,s=n.maxPadding;if(!lt(i)){e.size&&(n[i]-=e.size);const d=r[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?a.height:a.width),e.size=d.size/d.count,n[i]+=e.size}a.getPadding&&pu(s,a.getPadding());const o=Math.max(0,t.outerWidth-gu(s,n,"left","right")),l=Math.max(0,t.outerHeight-gu(s,n,"top","bottom")),c=o!==n.w,u=l!==n.h;return n.w=o,n.h=l,e.horizontal?{same:c,other:u}:{same:u,other:c}}function Ym(n){const t=n.maxPadding;function e(r){const i=Math.max(t[r]-n[r],0);return n[r]+=i,i}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function Hm(n,t){const e=t.maxPadding;function r(i){const a={left:0,top:0,right:0,bottom:0};return i.forEach(s=>{a[s]=Math.max(t[s],e[s])}),a}return r(n?["left","right"]:["top","bottom"])}function Yr(n,t,e,r){const i=[];let a,s,o,l,c,u;for(a=0,s=n.length,c=0;a<s;++a){o=n[a],l=o.box,l.update(o.width||t.w,o.height||t.h,Hm(o.horizontal,t));const{same:d,other:f}=Wm(t,e,o,r);c|=d&&i.length,u=u||f,l.fullSize||i.push(o)}return c&&Yr(i,t,e,r)||u}function Ri(n,t,e,r,i){n.top=e,n.left=t,n.right=t+r,n.bottom=e+i,n.width=r,n.height=i}function mu(n,t,e,r){const i=e.padding;let{x:a,y:s}=t;for(const o of n){const l=o.box,c=r[o.stack]||{count:1,placed:0,weight:1},u=o.stackWeight/c.weight||1;if(o.horizontal){const d=t.w*u,f=c.size||l.height;fe(c.start)&&(s=c.start),l.fullSize?Ri(l,i.left,s,e.outerWidth-i.right-i.left,f):Ri(l,t.left+c.placed,s,d,f),c.start=s,c.placed+=d,s=l.bottom}else{const d=t.h*u,f=c.size||l.width;fe(c.start)&&(a=c.start),l.fullSize?Ri(l,a,i.top,f,e.outerHeight-i.bottom-i.top):Ri(l,a,t.top+c.placed,f,d),c.start=a,c.placed+=d,a=l.right}}t.x=a,t.y=s}var ae={addBox(n,t){n.boxes||(n.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,r){if(!n)return;const i=Kt(n.options.layout.padding),a=Math.max(t-i.width,0),s=Math.max(e-i.height,0),o=Um(n.boxes),l=o.vertical,c=o.horizontal;Dt(n.boxes,x=>{typeof x.beforeLayout=="function"&&x.beforeLayout()});const u=l.reduce((x,p)=>p.box.options&&p.box.options.display===!1?x:x+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:i,availableWidth:a,availableHeight:s,vBoxMaxWidth:a/2/u,hBoxMaxHeight:s/2}),f=Object.assign({},i);pu(f,Kt(r));const g=Object.assign({maxPadding:f,w:a,h:s,x:i.left,y:i.top},i),v=Bm(l.concat(c),d);Yr(o.fullSize,g,d,v),Yr(l,g,d,v),Yr(c,g,d,v)&&Yr(l,g,d,v),Ym(g),mu(o.leftAndTop,g,d,v),g.x+=g.w,g.y+=g.h,mu(o.rightAndBottom,g,d,v),n.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},Dt(o.chartArea,x=>{const p=x.box;Object.assign(p,n.chartArea),p.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class bu{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,r){}removeEventListener(t,e,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,r,i){return e=Math.max(0,e||t.width),r=r||t.height,{width:e,height:Math.max(0,i?Math.floor(e/i):r)}}isAttached(t){return!0}updateConfig(t){}}class zm extends bu{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Li="$chartjs",$m={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},yu=n=>n===null||n==="";function jm(n,t){const e=n.style,r=n.getAttribute("height"),i=n.getAttribute("width");if(n[Li]={initial:{height:r,width:i,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",yu(i)){const a=zc(n,"width");a!==void 0&&(n.width=a)}if(yu(r))if(n.style.height==="")n.height=n.width/(t||2);else{const a=zc(n,"height");a!==void 0&&(n.height=a)}return n}const vu=Gp?{passive:!0}:!1;function Vm(n,t,e){n.addEventListener(t,e,vu)}function qm(n,t,e){n.canvas.removeEventListener(t,e,vu)}function Xm(n,t){const e=$m[n.type]||n.type,{x:r,y:i}=pn(n,t);return{type:e,chart:t,native:n,x:r!==void 0?r:null,y:i!==void 0?i:null}}function Ii(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function Gm(n,t,e){const r=n.canvas,i=new MutationObserver(a=>{let s=!1;for(const o of a)s=s||Ii(o.addedNodes,r),s=s&&!Ii(o.removedNodes,r);s&&e()});return i.observe(document,{childList:!0,subtree:!0}),i}function Km(n,t,e){const r=n.canvas,i=new MutationObserver(a=>{let s=!1;for(const o of a)s=s||Ii(o.removedNodes,r),s=s&&!Ii(o.addedNodes,r);s&&e()});return i.observe(document,{childList:!0,subtree:!0}),i}const Hr=new Map;let xu=0;function wu(){const n=window.devicePixelRatio;n!==xu&&(xu=n,Hr.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function Qm(n,t){Hr.size||window.addEventListener("resize",wu),Hr.set(n,t)}function Zm(n){Hr.delete(n),Hr.size||window.removeEventListener("resize",wu)}function Jm(n,t,e){const r=n.canvas,i=r&&Ja(r);if(!i)return;const a=Tc((o,l)=>{const c=i.clientWidth;e(o,l),c<i.clientWidth&&e()},window),s=new ResizeObserver(o=>{const l=o[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||a(c,u)});return s.observe(i),Qm(n,a),s}function cs(n,t,e){e&&e.disconnect(),t==="resize"&&Zm(n)}function t0(n,t,e){const r=n.canvas,i=Tc(a=>{n.ctx!==null&&e(Xm(a,n))},n);return Vm(r,t,i),i}class e0 extends bu{acquireContext(t,e){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(jm(t,e),r):null}releaseContext(t){const e=t.canvas;if(!e[Li])return!1;const r=e[Li].initial;["height","width"].forEach(a=>{const s=r[a];at(s)?e.removeAttribute(a):e.setAttribute(a,s)});const i=r.style||{};return Object.keys(i).forEach(a=>{e.style[a]=i[a]}),e.width=e.width,delete e[Li],!0}addEventListener(t,e,r){this.removeEventListener(t,e);const i=t.$proxies||(t.$proxies={}),s={attach:Gm,detach:Km,resize:Jm}[e]||t0;i[e]=s(t,e,r)}removeEventListener(t,e){const r=t.$proxies||(t.$proxies={}),i=r[e];if(!i)return;({attach:cs,detach:cs,resize:cs}[e]||qm)(t,e,i),r[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,r,i){return Xp(t,e,r,i)}isAttached(t){const e=Ja(t);return!!(e&&e.isConnected)}}function n0(n){return!Za()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?zm:e0}class ee{constructor(){z(this,"x");z(this,"y");z(this,"active",!1);z(this,"options");z(this,"$animations")}tooltipPosition(t){const{x:e,y:r}=this.getProps(["x","y"],t);return{x:e,y:r}}hasValue(){return fn(this.x)&&fn(this.y)}getProps(t,e){const r=this.$animations;if(!e||!r)return this;const i={};return t.forEach(a=>{i[a]=r[a]&&r[a].active()?r[a]._to:this[a]}),i}}z(ee,"defaults",{}),z(ee,"defaultRoutes");function r0(n,t){const e=n.options.ticks,r=i0(n),i=Math.min(e.maxTicksLimit||r,r),a=e.major.enabled?s0(t):[],s=a.length,o=a[0],l=a[s-1],c=[];if(s>i)return o0(t,c,a,s/i),c;const u=a0(a,t,i);if(s>0){let d,f;const g=s>1?Math.round((l-o)/(s-1)):null;for(Ni(t,c,u,at(g)?0:o-g,o),d=0,f=s-1;d<f;d++)Ni(t,c,u,a[d],a[d+1]);return Ni(t,c,u,l,at(g)?t.length:l+g),c}return Ni(t,c,u),c}function i0(n){const t=n.options.offset,e=n._tickSize(),r=n._length/e+(t?0:1),i=n._maxLength/e;return Math.floor(Math.min(r,i))}function a0(n,t,e){const r=l0(n),i=t.length/e;if(!r)return Math.max(i,1);const a=Zg(r);for(let s=0,o=a.length-1;s<o;s++){const l=a[s];if(l>i)return l}return Math.max(i,1)}function s0(n){const t=[];let e,r;for(e=0,r=n.length;e<r;e++)n[e].major&&t.push(e);return t}function o0(n,t,e,r){let i=0,a=e[0],s;for(r=Math.ceil(r),s=0;s<n.length;s++)s===a&&(t.push(n[s]),i++,a=e[i*r])}function Ni(n,t,e,r,i){const a=rt(r,0),s=Math.min(rt(i,n.length),n.length);let o=0,l,c,u;for(e=Math.ceil(e),i&&(l=i-r,e=l/Math.floor(l/e)),u=a;u<0;)o++,u=Math.round(a+o*e);for(c=Math.max(a,0);c<s;c++)c===u&&(t.push(n[c]),o++,u=Math.round(a+o*e))}function l0(n){const t=n.length;let e,r;if(t<2)return!1;for(r=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==r)return!1;return r}const c0=n=>n==="left"?"right":n==="right"?"left":n,_u=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,Tu=(n,t)=>Math.min(t||n,n);function Mu(n,t){const e=[],r=n.length/t,i=n.length;let a=0;for(;a<i;a+=r)e.push(n[Math.floor(a)]);return e}function u0(n,t,e){const r=n.ticks.length,i=Math.min(t,r-1),a=n._startPixel,s=n._endPixel,o=1e-6;let l=n.getPixelForTick(i),c;if(!(e&&(r===1?c=Math.max(l-a,s-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(i-1))/2,l+=i<t?c:-c,l<a-o||l>s+o)))return l}function d0(n,t){Dt(n,e=>{const r=e.gc,i=r.length/2;let a;if(i>t){for(a=0;a<i;++a)delete e.data[r[a]];r.splice(0,i)}})}function zr(n){return n.drawTicks?n.tickLength:0}function Du(n,t){if(!n.display)return 0;const e=Rt(n.font,t),r=Kt(n.padding);return(bt(n.text)?n.text.length:1)*e.lineHeight+r.height}function f0(n,t){return gn(n,{scale:t,type:"scale"})}function h0(n,t,e){return gn(n,{tick:e,index:t,type:"tick"})}function g0(n,t,e){let r=Ha(n);return(e&&t!=="right"||!e&&t==="right")&&(r=c0(r)),r}function p0(n,t,e,r){const{top:i,left:a,bottom:s,right:o,chart:l}=n,{chartArea:c,scales:u}=l;let d=0,f,g,v;const x=s-i,p=o-a;if(n.isHorizontal()){if(g=ie(r,a,o),lt(e)){const b=Object.keys(e)[0],m=e[b];v=u[b].getPixelForValue(m)+x-t}else e==="center"?v=(c.bottom+c.top)/2+x-t:v=_u(n,e,t);f=o-a}else{if(lt(e)){const b=Object.keys(e)[0],m=e[b];g=u[b].getPixelForValue(m)-p+t}else e==="center"?g=(c.left+c.right)/2-p+t:g=_u(n,e,t);v=ie(r,s,i),d=e==="left"?-At:At}return{titleX:g,titleY:v,maxWidth:f,rotation:d}}class Nn extends ee{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:r,_suggestedMax:i}=this;return t=xe(t,Number.POSITIVE_INFINITY),e=xe(e,Number.NEGATIVE_INFINITY),r=xe(r,Number.POSITIVE_INFINITY),i=xe(i,Number.NEGATIVE_INFINITY),{min:xe(t,r),max:xe(e,i),minDefined:Nt(t),maxDefined:Nt(e)}}getMinMax(t){let{min:e,max:r,minDefined:i,maxDefined:a}=this.getUserBounds(),s;if(i&&a)return{min:e,max:r};const o=this.getMatchingVisibleMetas();for(let l=0,c=o.length;l<c;++l)s=o[l].controller.getMinMax(this,t),i||(e=Math.min(e,s.min)),a||(r=Math.max(r,s.max));return e=a&&e>r?r:e,r=i&&e>r?e:r,{min:xe(e,xe(r,e)),max:xe(r,xe(e,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Mt(this.options.beforeUpdate,[this])}update(t,e,r){const{beginAtZero:i,grace:a,ticks:s}=this.options,o=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,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=Cp(this,a,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=o<this.ticks.length;this._convertTicksToLabels(l?Mu(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=r0(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,r;this.isHorizontal()?(e=this.left,r=this.right):(e=this.top,r=this.bottom,t=!t),this._startPixel=e,this._endPixel=r,this._reversePixels=t,this._length=r-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Mt(this.options.afterUpdate,[this])}beforeSetDimensions(){Mt(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(){Mt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Mt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Mt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let r,i,a;for(r=0,i=t.length;r<i;r++)a=t[r],a.label=Mt(e.callback,[a.value,r,t],this)}afterTickToLabelConversion(){Mt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Mt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,r=Tu(this.ticks.length,t.ticks.maxTicksLimit),i=e.minRotation||0,a=e.maxRotation;let s=i,o,l,c;if(!this._isVisible()||!e.display||i>=a||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,g=Zt(this.chart.width-d,0,this.maxWidth);o=t.offset?this.maxWidth/r:g/(r-1),d+6>o&&(o=g/(r-(t.offset?.5:1)),l=this.maxHeight-zr(t.grid)-e.padding-Du(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),s=_i(Math.min(Math.asin(Zt((u.highest.height+6)/o,-1,1)),Math.asin(Zt(l/c,-1,1))-Math.asin(Zt(f/c,-1,1)))),s=Math.max(i,Math.min(a,s))),this.labelRotation=s}afterCalculateLabelRotation(){Mt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Mt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:r,title:i,grid:a}}=this,s=this._isVisible(),o=this.isHorizontal();if(s){const l=Du(i,e.options.font);if(o?(t.width=this.maxWidth,t.height=zr(a)+l):(t.height=this.maxHeight,t.width=zr(a)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),g=r.padding*2,v=Gt(this.labelRotation),x=Math.cos(v),p=Math.sin(v);if(o){const b=r.mirror?0:p*d.width+x*f.height;t.height=Math.min(this.maxHeight,t.height+b+g)}else{const b=r.mirror?0:x*d.width+p*f.height;t.width=Math.min(this.maxWidth,t.width+b+g)}this._calculatePadding(c,u,p,x)}}this._handleMargins(),o?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,r,i){const{ticks:{align:a,padding:s},position:o}=this.options,l=this.labelRotation!==0,c=o!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,g=0;l?c?(f=i*t.width,g=r*e.height):(f=r*t.height,g=i*e.width):a==="start"?g=e.width:a==="end"?f=t.width:a!=="inner"&&(f=t.width/2,g=e.width/2),this.paddingLeft=Math.max((f-u+s)*this.width/(this.width-u),0),this.paddingRight=Math.max((g-d+s)*this.width/(this.width-d),0)}else{let u=e.height/2,d=t.height/2;a==="start"?(u=0,d=t.height):a==="end"&&(u=e.height,d=0),this.paddingTop=u+s,this.paddingBottom=d+s}}_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(){Mt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,r;for(e=0,r=t.length;e<r;e++)at(t[e].label)&&(t.splice(e,1),r--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let r=this.ticks;e<r.length&&(r=Mu(r,e)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,r){const{ctx:i,_longestTextCache:a}=this,s=[],o=[],l=Math.floor(e/Tu(e,r));let c=0,u=0,d,f,g,v,x,p,b,m,y,w,T;for(d=0;d<e;d+=l){if(v=t[d].label,x=this._resolveTickFontOptions(d),i.font=p=x.string,b=a[p]=a[p]||{data:{},gc:[]},m=x.lineHeight,y=w=0,!at(v)&&!bt(v))y=Di(i,b.data,b.gc,y,v),w=m;else if(bt(v))for(f=0,g=v.length;f<g;++f)T=v[f],!at(T)&&!bt(T)&&(y=Di(i,b.data,b.gc,y,T),w+=m);s.push(y),o.push(w),c=Math.max(y,c),u=Math.max(w,u)}d0(a,e);const S=s.indexOf(c),k=o.indexOf(u),M=D=>({width:s[D]||0,height:o[D]||0});return{first:M(0),last:M(e-1),widest:M(S),highest:M(k),widths:s,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return ep(this._alignToPixels?En(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const r=e[t];return r.$context||(r.$context=h0(this.getContext(),t,r))}return this.$context||(this.$context=f0(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Gt(this.labelRotation),r=Math.abs(Math.cos(e)),i=Math.abs(Math.sin(e)),a=this._getLabelSizes(),s=t.autoSkipPadding||0,o=a?a.widest.width+s:0,l=a?a.highest.height+s:0;return this.isHorizontal()?l*r>o*i?o/r:l/i:l*i<o*r?l/r:o/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,r=this.chart,i=this.options,{grid:a,position:s,border:o}=i,l=a.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=zr(a),g=[],v=o.setContext(this.getContext()),x=v.display?v.width:0,p=x/2,b=function(H){return En(r,H,x)};let m,y,w,T,S,k,M,D,O,P,A,F;if(s==="top")m=b(this.bottom),k=this.bottom-f,D=m-p,P=b(t.top)+p,F=t.bottom;else if(s==="bottom")m=b(this.top),P=t.top,F=b(t.bottom)-p,k=m+p,D=this.top+f;else if(s==="left")m=b(this.right),S=this.right-f,M=m-p,O=b(t.left)+p,A=t.right;else if(s==="right")m=b(this.left),O=t.left,A=b(t.right)-p,S=m+p,M=this.left+f;else if(e==="x"){if(s==="center")m=b((t.top+t.bottom)/2+.5);else if(lt(s)){const H=Object.keys(s)[0],I=s[H];m=b(this.chart.scales[H].getPixelForValue(I))}P=t.top,F=t.bottom,k=m+p,D=k+f}else if(e==="y"){if(s==="center")m=b((t.left+t.right)/2);else if(lt(s)){const H=Object.keys(s)[0],I=s[H];m=b(this.chart.scales[H].getPixelForValue(I))}S=m-p,M=S-f,O=t.left,A=t.right}const q=rt(i.ticks.maxTicksLimit,d),$=Math.max(1,Math.ceil(d/q));for(y=0;y<d;y+=$){const H=this.getContext(y),I=a.setContext(H),it=o.setContext(H),U=I.lineWidth,yt=I.color,dt=it.dash||[],Y=it.dashOffset,L=I.tickWidth,B=I.tickColor,j=I.tickBorderDash||[],Z=I.tickBorderDashOffset;w=u0(this,y,l),w!==void 0&&(T=En(r,w,U),c?S=M=O=A=T:k=D=P=F=T,g.push({tx1:S,ty1:k,tx2:M,ty2:D,x1:O,y1:P,x2:A,y2:F,width:U,color:yt,borderDash:dt,borderDashOffset:Y,tickWidth:L,tickColor:B,tickBorderDash:j,tickBorderDashOffset:Z}))}return this._ticksLength=d,this._borderValue=m,g}_computeLabelItems(t){const e=this.axis,r=this.options,{position:i,ticks:a}=r,s=this.isHorizontal(),o=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=a,f=zr(r.grid),g=f+u,v=d?-u:g,x=-Gt(this.labelRotation),p=[];let b,m,y,w,T,S,k,M,D,O,P,A,F="middle";if(i==="top")S=this.bottom-v,k=this._getXAxisLabelAlignment();else if(i==="bottom")S=this.top+v,k=this._getXAxisLabelAlignment();else if(i==="left"){const $=this._getYAxisLabelAlignment(f);k=$.textAlign,T=$.x}else if(i==="right"){const $=this._getYAxisLabelAlignment(f);k=$.textAlign,T=$.x}else if(e==="x"){if(i==="center")S=(t.top+t.bottom)/2+g;else if(lt(i)){const $=Object.keys(i)[0],H=i[$];S=this.chart.scales[$].getPixelForValue(H)+g}k=this._getXAxisLabelAlignment()}else if(e==="y"){if(i==="center")T=(t.left+t.right)/2-g;else if(lt(i)){const $=Object.keys(i)[0],H=i[$];T=this.chart.scales[$].getPixelForValue(H)}k=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?F="top":l==="end"&&(F="bottom"));const q=this._getLabelSizes();for(b=0,m=o.length;b<m;++b){y=o[b],w=y.label;const $=a.setContext(this.getContext(b));M=this.getPixelForTick(b)+a.labelOffset,D=this._resolveTickFontOptions(b),O=D.lineHeight,P=bt(w)?w.length:1;const H=P/2,I=$.color,it=$.textStrokeColor,U=$.textStrokeWidth;let yt=k;s?(T=M,k==="inner"&&(b===m-1?yt=this.options.reverse?"left":"right":b===0?yt=this.options.reverse?"right":"left":yt="center"),i==="top"?c==="near"||x!==0?A=-P*O+O/2:c==="center"?A=-q.highest.height/2-H*O+O:A=-q.highest.height+O/2:c==="near"||x!==0?A=O/2:c==="center"?A=q.highest.height/2-H*O:A=q.highest.height-P*O,d&&(A*=-1),x!==0&&!$.showLabelBackdrop&&(T+=O/2*Math.sin(x))):(S=M,A=(1-P)*O/2);let dt;if($.showLabelBackdrop){const Y=Kt($.backdropPadding),L=q.heights[b],B=q.widths[b];let j=A-Y.top,Z=0-Y.left;switch(F){case"middle":j-=L/2;break;case"bottom":j-=L;break}switch(k){case"center":Z-=B/2;break;case"right":Z-=B;break;case"inner":b===m-1?Z-=B:b>0&&(Z-=B/2);break}dt={left:Z,top:j,width:B+Y.width,height:L+Y.height,color:$.backdropColor}}p.push({label:w,font:D,textOffset:A,options:{rotation:x,color:I,strokeColor:it,strokeWidth:U,textAlign:yt,textBaseline:F,translation:[T,S],backdrop:dt}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Gt(this.labelRotation))return t==="top"?"left":"right";let i="center";return e.align==="start"?i="left":e.align==="end"?i="right":e.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:r,mirror:i,padding:a}}=this.options,s=this._getLabelSizes(),o=t+a,l=s.widest.width;let c,u;return e==="left"?i?(u=this.right+a,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-o,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):e==="right"?i?(u=this.left+a,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+o,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;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:r,top:i,width:a,height:s}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(r,i,a,s),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex(a=>a.value===t);return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const e=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let a,s;const o=(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(e.display)for(a=0,s=i.length;a<s;++a){const l=i[a];e.drawOnChartArea&&o({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&o({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:r,grid:i}}=this,a=r.setContext(this.getContext()),s=r.display?a.width:0;if(!s)return;const o=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,f;this.isHorizontal()?(c=En(t,this.left,s)-s/2,u=En(t,this.right,o)+o/2,d=f=l):(d=En(t,this.top,s)-s/2,f=En(t,this.bottom,o)+o/2,c=u=l),e.save(),e.lineWidth=a.width,e.strokeStyle=a.color,e.beginPath(),e.moveTo(c,d),e.lineTo(u,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&Er(r,i);const a=this.getLabelItems(t);for(const s of a){const o=s.options,l=s.font,c=s.label,u=s.textOffset;An(r,c,0,u,l,o)}i&&Ar(r)}drawTitle(){const{ctx:t,options:{position:e,title:r,reverse:i}}=this;if(!r.display)return;const a=Rt(r.font),s=Kt(r.padding),o=r.align;let l=a.lineHeight/2;e==="bottom"||e==="center"||lt(e)?(l+=s.bottom,bt(r.text)&&(l+=a.lineHeight*(r.text.length-1))):l+=s.top;const{titleX:c,titleY:u,maxWidth:d,rotation:f}=p0(this,l,e,o);An(t,r.text,0,0,a,{color:r.color,maxWidth:d,rotation:f,textAlign:g0(o,e,i),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,r=rt(t.grid&&t.grid.z,-1),i=rt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Nn.prototype.draw?[{z:e,draw:a=>{this.draw(a)}}]:[{z:r,draw:a=>{this.drawBackground(),this.drawGrid(a),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:e,draw:a=>{this.drawLabels(a)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let a,s;for(a=0,s=e.length;a<s;++a){const o=e[a];o[r]===this.id&&(!t||o.type===t)&&i.push(o)}return i}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return Rt(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Fi{constructor(t,e,r){this.type=t,this.scope=e,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let r;y0(e)&&(r=this.register(e));const i=this.items,a=t.id,s=this.scope+"."+a;if(!a)throw new Error("class does not have id: "+t);return a in i||(i[a]=t,m0(t,s,r),this.override&&Ut.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const e=this.items,r=t.id,i=this.scope;r in e&&delete e[r],i&&r in Ut[i]&&(delete Ut[i][r],this.override&&delete Pn[r])}}function m0(n,t,e){const r=Mr(Object.create(null),[e?Ut.get(e):{},Ut.get(t),n.defaults]);Ut.set(t,r),n.defaultRoutes&&b0(t,n.defaultRoutes),n.descriptors&&Ut.describe(t,n.descriptors)}function b0(n,t){Object.keys(t).forEach(e=>{const r=e.split("."),i=r.pop(),a=[n].concat(r).join("."),s=t[e].split("."),o=s.pop(),l=s.join(".");Ut.route(a,i,l,o)})}function y0(n){return"id"in n&&"defaults"in n}class v0{constructor(){this.controllers=new Fi(Ee,"datasets",!0),this.elements=new Fi(ee,"elements"),this.plugins=new Fi(Object,"plugins"),this.scales=new Fi(Nn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,r){[...e].forEach(i=>{const a=r||this._getRegistryForType(i);r||a.isForType(i)||a===this.plugins&&i.id?this._exec(t,a,i):Dt(i,s=>{const o=r||this._getRegistryForType(s);this._exec(t,o,s)})})}_exec(t,e,r){const i=Ua(t);Mt(r["before"+i],[],r),e[t](r),Mt(r["after"+i],[],r)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const r=this._typedRegistries[e];if(r.isForType(t))return r}return this.plugins}_get(t,e,r){const i=e.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return i}}var Fe=new v0;class x0{constructor(){this._init=[]}notify(t,e,r,i){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const a=i?this._descriptors(t).filter(i):this._descriptors(t),s=this._notify(a,t,e,r);return e==="afterDestroy"&&(this._notify(a,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,e,r,i){i=i||{};for(const a of t){const s=a.plugin,o=s[r],l=[e,i,a.options];if(Mt(o,l,s)===!1&&i.cancelable)return!1}return!0}invalidate(){at(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const r=t&&t.config,i=rt(r.options&&r.options.plugins,{}),a=w0(r);return i===!1&&!e?[]:T0(t,a,i,e)}_notifyStateChanges(t){const e=this._oldCache||[],r=this._cache,i=(a,s)=>a.filter(o=>!s.some(l=>o.plugin.id===l.plugin.id));this._notify(i(e,r),t,"stop"),this._notify(i(r,e),t,"start")}}function w0(n){const t={},e=[],r=Object.keys(Fe.plugins.items);for(let a=0;a<r.length;a++)e.push(Fe.getPlugin(r[a]));const i=n.plugins||[];for(let a=0;a<i.length;a++){const s=i[a];e.indexOf(s)===-1&&(e.push(s),t[s.id]=!0)}return{plugins:e,localIds:t}}function _0(n,t){return!t&&n===!1?null:n===!0?{}:n}function T0(n,{plugins:t,localIds:e},r,i){const a=[],s=n.getContext();for(const o of t){const l=o.id,c=_0(r[l],i);c!==null&&a.push({plugin:o,options:M0(n.config,{plugin:o,local:e[l]},c,s)})}return a}function M0(n,{plugin:t,local:e},r,i){const a=n.pluginScopeKeys(t),s=n.getOptionScopes(r,a);return e&&t.defaults&&s.push(t.defaults),n.createResolver(s,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function us(n,t){const e=Ut.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function D0(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function C0(n,t){return n===t?"_index_":"_value_"}function Cu(n){if(n==="x"||n==="y"||n==="r")return n}function k0(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function ds(n,...t){if(Cu(n))return n;for(const e of t){const r=e.axis||k0(e.position)||n.length>1&&Cu(n[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function ku(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function S0(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(r=>r.xAxisID===n||r.yAxisID===n);if(e.length)return ku(n,"x",e[0])||ku(n,"y",e[0])}return{}}function O0(n,t){const e=Pn[n.type]||{scales:{}},r=t.scales||{},i=us(n.type,t),a=Object.create(null);return Object.keys(r).forEach(s=>{const o=r[s];if(!lt(o))return console.error(`Invalid scale configuration for scale: ${s}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const l=ds(s,o,S0(s,n),Ut.scales[o.type]),c=C0(l,i),u=e.scales||{};a[s]=Dr(Object.create(null),[{axis:l},o,u[l],u[c]])}),n.data.datasets.forEach(s=>{const o=s.type||n.type,l=s.indexAxis||us(o,t),u=(Pn[o]||{}).scales||{};Object.keys(u).forEach(d=>{const f=D0(d,l),g=s[f+"AxisID"]||f;a[g]=a[g]||Object.create(null),Dr(a[g],[{axis:f},r[g],u[d]])})}),Object.keys(a).forEach(s=>{const o=a[s];Dr(o,[Ut.scales[o.type],Ut.scale])}),a}function Su(n){const t=n.options||(n.options={});t.plugins=rt(t.plugins,{}),t.scales=O0(n,t)}function Ou(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function P0(n){return n=n||{},n.data=Ou(n.data),Su(n),n}const Pu=new Map,Eu=new Set;function Bi(n,t){let e=Pu.get(n);return e||(e=t(),Pu.set(n,e),Eu.add(e)),e}const $r=(n,t,e)=>{const r=un(t,e);r!==void 0&&n.add(r)};class E0{constructor(t){this._config=P0(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Ou(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Su(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Bi(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Bi(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Bi(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,r=this.type;return Bi(`${r}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const r=this._scopeCache;let i=r.get(t);return(!i||e)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,e,r){const{options:i,type:a}=this,s=this._cachedScopes(t,r),o=s.get(e);if(o)return o;const l=new Set;e.forEach(u=>{t&&(l.add(t),u.forEach(d=>$r(l,t,d))),u.forEach(d=>$r(l,i,d)),u.forEach(d=>$r(l,Pn[a]||{},d)),u.forEach(d=>$r(l,Ut,d)),u.forEach(d=>$r(l,ja,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Eu.has(e)&&s.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Pn[e]||{},Ut.datasets[e]||{},{type:e},Ut,ja]}resolveNamedOptions(t,e,r,i=[""]){const a={$shared:!0},{resolver:s,subPrefixes:o}=Au(this._resolverCache,t,i);let l=s;if(R0(s,e)){a.$shared=!1,r=he(r)?r():r;const c=this.createResolver(t,r,o);l=nr(s,r,c)}for(const c of e)a[c]=l[c];return a}createResolver(t,e,r=[""],i){const{resolver:a}=Au(this._resolverCache,t,r);return lt(e)?nr(a,e,void 0,i):a}}function Au(n,t,e){let r=n.get(t);r||(r=new Map,n.set(t,r));const i=e.join();let a=r.get(i);return a||(a={resolver:Ga(t,e),subPrefixes:e.filter(o=>!o.toLowerCase().includes("hover"))},r.set(i,a)),a}const A0=n=>lt(n)&&Object.getOwnPropertyNames(n).some(t=>he(n[t]));function R0(n,t){const{isScriptable:e,isIndexable:r}=Lc(n);for(const i of t){const a=e(i),s=r(i),o=(s||a)&&n[i];if(a&&(he(o)||A0(o))||s&&bt(o))return!0}return!1}var L0="4.4.1";const I0=["top","bottom","left","right","chartArea"];function Ru(n,t){return n==="top"||n==="bottom"||I0.indexOf(n)===-1&&t==="x"}function Lu(n,t){return function(e,r){return e[n]===r[n]?e[t]-r[t]:e[n]-r[n]}}function Iu(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),Mt(e&&e.onComplete,[n],t)}function N0(n){const t=n.chart,e=t.options.animation;Mt(e&&e.onProgress,[n],t)}function Nu(n){return Za()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Ui={},Fu=n=>{const t=Nu(n);return Object.values(Ui).filter(e=>e.canvas===t).pop()};function F0(n,t,e){const r=Object.keys(n);for(const i of r){const a=+i;if(a>=t){const s=n[i];delete n[i],(e>0||a>t)&&(n[a+e]=s)}}}function B0(n,t,e,r){return!e||n.type==="mouseout"?null:r?t:n}function Wi(n,t,e){return n.options.clip?n[e]:t[e]}function U0(n,t){const{xScale:e,yScale:r}=n;return e&&r?{left:Wi(e,t,"left"),right:Wi(e,t,"right"),top:Wi(r,t,"top"),bottom:Wi(r,t,"bottom")}:t}let De=(Cn=class{static register(...t){Fe.add(...t),Bu()}static unregister(...t){Fe.remove(...t),Bu()}constructor(t,e){const r=this.config=new E0(e),i=Nu(t),a=Fu(i);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas with ID '"+a.canvas.id+"' can be reused.");const s=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||n0(i)),this.platform.updateConfig(r);const o=this.platform.acquireContext(i,s.aspectRatio),l=o&&o.canvas,c=l&&l.height,u=l&&l.width;if(this.id=$g(),this.ctx=o,this.canvas=l,this.width=u,this.height=c,this._options=s,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 x0,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=ap(d=>this.update(d),s.resizeDelay||0),this._dataChanges=[],Ui[this.id]=this,!o||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Ke.listen(this,"complete",Iu),Ke.listen(this,"progress",N0),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:r,height:i,_aspectRatio:a}=this;return at(t)?e&&a?a:i?r/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Fe}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Hc(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Ec(this.canvas,this.ctx),this}stop(){return Ke.stop(this),this}resize(t,e){Ke.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const r=this.options,i=this.canvas,a=r.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(i,t,e,a),o=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,Hc(this,o,!0)&&(this.notifyPlugins("resize",{size:s}),Mt(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};Dt(e,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,e=t.scales,r=this.scales,i=Object.keys(r).reduce((s,o)=>(s[o]=!1,s),{});let a=[];e&&(a=a.concat(Object.keys(e).map(s=>{const o=e[s],l=ds(s,o),c=l==="r",u=l==="x";return{options:o,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Dt(a,s=>{const o=s.options,l=o.id,c=ds(l,o),u=rt(o.type,s.dtype);(o.position===void 0||Ru(o.position,c)!==Ru(s.dposition))&&(o.position=s.dposition),i[l]=!0;let d=null;if(l in r&&r[l].type===u)d=r[l];else{const f=Fe.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(o,t)}),Dt(i,(s,o)=>{s||delete r[o]}),Dt(r,s=>{ae.configure(this,s,s.options),ae.addBox(this,s)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,r=t.length;if(t.sort((i,a)=>i.index-a.index),r>e){for(let i=e;i<r;++i)this._destroyDatasetMeta(i);t.splice(e,r-e)}this._sortedMetasets=t.slice(0).sort(Lu("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((r,i)=>{e.filter(a=>a===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=e.length;r<i;r++){const a=e[r];let s=this.getDatasetMeta(r);const o=a.type||this.config.type;if(s.type&&s.type!==o&&(this._destroyDatasetMeta(r),s=this.getDatasetMeta(r)),s.type=o,s.indexAxis=a.indexAxis||us(o,this.options),s.order=a.order||0,s.index=r,s.label=""+a.label,s.visible=this.isDatasetVisible(r),s.controller)s.controller.updateIndex(r),s.controller.linkScales();else{const l=Fe.getController(o),{datasetElementType:c,dataElementType:u}=Ut.datasets[o];Object.assign(l,{dataElementType:Fe.getElement(u),datasetElementType:c&&Fe.getElement(c)}),s.controller=new l(this,r),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){Dt(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const r=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),f=!i&&a.indexOf(d)===-1;d.buildOrUpdateElements(f),s=Math.max(+d.getMaxOverflow(),s)}s=this._minPadding=r.layout.autoPadding?s:0,this._updateLayout(s),i||Dt(a,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Lu("z","_idx"));const{_active:o,_lastEvent:l}=this;l?this._eventHandler(l,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){Dt(this.scales,t=>{ae.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!gc(e,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:a}of e){const s=r==="_removeElements"?-a:a;F0(t,i,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,r=a=>new Set(t.filter(s=>s[0]===a).map((s,o)=>o+","+s.splice(1).join(","))),i=r(0);for(let a=1;a<e;a++)if(!gc(i,r(a)))return;return Array.from(i).map(a=>a.split(",")).map(a=>({method:a[1],start:+a[2],count:+a[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;ae.update(this,this.width,this.height,t);const e=this.chartArea,r=e.width<=0||e.height<=0;this._layers=[],Dt(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,a)=>{i._idx=a}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,r=this.data.datasets.length;e<r;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,r=this.data.datasets.length;e<r;++e)this._updateDataset(e,he(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const r=this.getDatasetMeta(t),i={meta:r,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(r.controller._update(e),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Ke.has(this)?this.attached&&!Ke.running(this)&&Ke.start(this):(this.draw(),Iu({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resize(r,i),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,r=[];let i,a;for(i=0,a=e.length;i<a;++i){const s=e[i];(!t||s.visible)&&r.push(s)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,r=t._clip,i=!r.disabled,a=U0(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(i&&Er(e,{left:r.left===!1?0:a.left-r.left,right:r.right===!1?this.width:a.right+r.right,top:r.top===!1?0:a.top-r.top,bottom:r.bottom===!1?this.height:a.bottom+r.bottom}),t.controller.draw(),i&&Ar(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return Ge(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,r,i){const a=ls.modes[e];return typeof a=="function"?a(this,t,r,i):[]}getDatasetMeta(t){const e=this.data.datasets[t],r=this._metasets;let i=r.filter(a=>a&&a._dataset===e).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},r.push(i)),i}getContext(){return this.$context||(this.$context=gn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!e.hidden}setDatasetVisibility(t,e){const r=this.getDatasetMeta(t);r.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,r){const i=r?"show":"hide",a=this.getDatasetMeta(t),s=a.controller._resolveAnimations(void 0,i);fe(e)?(a.data[e].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),s.update(a,{visible:r}),this.update(o=>o.datasetIndex===t?i:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Ke.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Ec(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Ui[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,r=(a,s)=>{e.addEventListener(this,a,s),t[a]=s},i=(a,s,o)=>{a.offsetX=s,a.offsetY=o,this._eventHandler(a)};Dt(this.options.events,a=>r(a,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,r=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},i=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},a=(l,c)=>{this.canvas&&this.resize(l,c)};let s;const o=()=>{i("attach",o),this.attached=!0,this.resize(),r("resize",a),r("detach",s)};s=()=>{this.attached=!1,i("resize",a),this._stop(),this._resize(0,0),r("attach",o)},e.isAttached(this.canvas)?o():s()}unbindEvents(){Dt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Dt(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,r){const i=r?"set":"remove";let a,s,o,l;for(e==="dataset"&&(a=this.getDatasetMeta(t[0].datasetIndex),a.controller["_"+i+"DatasetHoverStyle"]()),o=0,l=t.length;o<l;++o){s=t[o];const c=s&&this.getDatasetMeta(s.datasetIndex).controller;c&&c[i+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],r=t.map(({datasetIndex:a,index:s})=>{const o=this.getDatasetMeta(a);if(!o)throw new Error("No dataset found at index "+a);return{datasetIndex:a,element:o.data[s],index:s}});!yi(r,e)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,e))}notifyPlugins(t,e,r){return this._plugins.notify(this,t,e,r)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,r){const i=this.options.hover,a=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),s=a(e,t),o=r?t:a(t,e);s.length&&this.updateHoverStyle(s,i.mode,!1),o.length&&i.mode&&this.updateHoverStyle(o,i.mode,!0)}_eventHandler(t,e){const r={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},i=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const a=this._handleEvent(t,e,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(a||r.changed)&&this.render(),this}_handleEvent(t,e,r){const{_active:i=[],options:a}=this,s=e,o=this._getActiveElements(t,i,r,s),l=Kg(t),c=B0(t,this._lastEvent,r,l);r&&(this._lastEvent=null,Mt(a.onHover,[t,o,this],this),l&&Mt(a.onClick,[t,o,this],this));const u=!yi(o,i);return(u||e)&&(this._active=o,this._updateHoverStyles(o,i,e)),this._lastEvent=c,u}_getActiveElements(t,e,r,i){if(t.type==="mouseout")return[];if(!r)return e;const a=this.options.hover;return this.getElementsAtEventForMode(t,a.mode,a,i)}},z(Cn,"defaults",Ut),z(Cn,"instances",Ui),z(Cn,"overrides",Pn),z(Cn,"registry",Fe),z(Cn,"version",L0),z(Cn,"getChart",Fu),Cn);function Bu(){return Dt(De.instances,n=>n._plugins.invalidate())}function W0(n,t,e){const{startAngle:r,pixelMargin:i,x:a,y:s,outerRadius:o,innerRadius:l}=t;let c=i/o;n.beginPath(),n.arc(a,s,o,r-c,e+c),l>i?(c=i/l,n.arc(a,s,l,e+c,r-c,!0)):n.arc(a,s,i,e+At,r-At),n.closePath(),n.clip()}function Y0(n){return Xa(n,["outerStart","outerEnd","innerStart","innerEnd"])}function H0(n,t,e,r){const i=Y0(n.options.borderRadius),a=(e-t)/2,s=Math.min(a,r*t/2),o=l=>{const c=(e-Math.min(a,l))*r/2;return Zt(l,0,Math.min(a,c))};return{outerStart:o(i.outerStart),outerEnd:o(i.outerEnd),innerStart:Zt(i.innerStart,0,s),innerEnd:Zt(i.innerEnd,0,s)}}function ar(n,t,e,r){return{x:e+n*Math.cos(t),y:r+n*Math.sin(t)}}function Yi(n,t,e,r,i,a){const{x:s,y:o,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+r+e-c,0),f=u>0?u+r+e+c:0;let g=0;const v=i-l;if(r){const $=u>0?u-r:0,H=d>0?d-r:0,I=($+H)/2,it=I!==0?v*I/(I+r):v;g=(v-it)/2}const x=Math.max(.001,v*d-e/ft)/d,p=(v-x)/2,b=l+p+g,m=i-p-g,{outerStart:y,outerEnd:w,innerStart:T,innerEnd:S}=H0(t,f,d,m-b),k=d-y,M=d-w,D=b+y/k,O=m-w/M,P=f+T,A=f+S,F=b+T/P,q=m-S/A;if(n.beginPath(),a){const $=(D+O)/2;if(n.arc(s,o,d,D,$),n.arc(s,o,d,$,O),w>0){const U=ar(M,O,s,o);n.arc(U.x,U.y,w,O,m+At)}const H=ar(A,m,s,o);if(n.lineTo(H.x,H.y),S>0){const U=ar(A,q,s,o);n.arc(U.x,U.y,S,m+At,q+Math.PI)}const I=(m-S/f+(b+T/f))/2;if(n.arc(s,o,f,m-S/f,I,!0),n.arc(s,o,f,I,b+T/f,!0),T>0){const U=ar(P,F,s,o);n.arc(U.x,U.y,T,F+Math.PI,b-At)}const it=ar(k,b,s,o);if(n.lineTo(it.x,it.y),y>0){const U=ar(k,D,s,o);n.arc(U.x,U.y,y,b-At,D)}}else{n.moveTo(s,o);const $=Math.cos(D)*d+s,H=Math.sin(D)*d+o;n.lineTo($,H);const I=Math.cos(O)*d+s,it=Math.sin(O)*d+o;n.lineTo(I,it)}n.closePath()}function z0(n,t,e,r,i){const{fullCircles:a,startAngle:s,circumference:o}=t;let l=t.endAngle;if(a){Yi(n,t,e,r,l,i);for(let c=0;c<a;++c)n.fill();isNaN(o)||(l=s+(o%Ot||Ot))}return Yi(n,t,e,r,l,i),n.fill(),l}function $0(n,t,e,r,i){const{fullCircles:a,startAngle:s,circumference:o,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:f}=l,g=l.borderAlign==="inner";if(!c)return;n.setLineDash(d||[]),n.lineDashOffset=f,g?(n.lineWidth=c*2,n.lineJoin=u||"round"):(n.lineWidth=c,n.lineJoin=u||"bevel");let v=t.endAngle;if(a){Yi(n,t,e,r,v,i);for(let x=0;x<a;++x)n.stroke();isNaN(o)||(v=s+(o%Ot||Ot))}g&&W0(n,t,v),a||(Yi(n,t,e,r,v,i),n.stroke())}class jr extends ee{constructor(e){super();z(this,"circumference");z(this,"endAngle");z(this,"fullCircles");z(this,"innerRadius");z(this,"outerRadius");z(this,"pixelMargin");z(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,r,i){const a=this.getProps(["x","y"],i),{angle:s,distance:o}=yc(a,{x:e,y:r}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),g=(this.options.spacing+this.options.borderWidth)/2,x=rt(f,c-l)>=Ot||kr(s,l,c),p=qe(o,u+g,d+g);return x&&p}getCenterPoint(e){const{x:r,y:i,startAngle:a,endAngle:s,innerRadius:o,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:u}=this.options,d=(a+s)/2,f=(o+l+u+c)/2;return{x:r+Math.cos(d)*f,y:i+Math.sin(d)*f}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:r,circumference:i}=this,a=(r.offset||0)/4,s=(r.spacing||0)/2,o=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=i>Ot?Math.floor(i/Ot):0,i===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*a,Math.sin(l)*a);const c=1-Math.sin(Math.min(ft,i||0)),u=a*c;e.fillStyle=r.backgroundColor,e.strokeStyle=r.borderColor,z0(e,this,u,s,o),$0(e,this,u,s,o),e.restore()}}z(jr,"id","arc"),z(jr,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),z(jr,"defaultRoutes",{backgroundColor:"backgroundColor"}),z(jr,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Uu(n,t,e=t){n.lineCap=rt(e.borderCapStyle,t.borderCapStyle),n.setLineDash(rt(e.borderDash,t.borderDash)),n.lineDashOffset=rt(e.borderDashOffset,t.borderDashOffset),n.lineJoin=rt(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=rt(e.borderWidth,t.borderWidth),n.strokeStyle=rt(e.borderColor,t.borderColor)}function j0(n,t,e){n.lineTo(e.x,e.y)}function V0(n){return n.stepped?bp:n.tension||n.cubicInterpolationMode==="monotone"?yp:j0}function Wu(n,t,e={}){const r=n.length,{start:i=0,end:a=r-1}=e,{start:s,end:o}=t,l=Math.max(i,s),c=Math.min(a,o),u=i<s&&a<s||i>o&&a>o;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function q0(n,t,e,r){const{points:i,options:a}=t,{count:s,start:o,loop:l,ilen:c}=Wu(i,e,r),u=V0(a);let{move:d=!0,reverse:f}=r||{},g,v,x;for(g=0;g<=c;++g)v=i[(o+(f?c-g:g))%s],!v.skip&&(d?(n.moveTo(v.x,v.y),d=!1):u(n,x,v,f,a.stepped),x=v);return l&&(v=i[(o+(f?c:0))%s],u(n,x,v,f,a.stepped)),!!l}function X0(n,t,e,r){const i=t.points,{count:a,start:s,ilen:o}=Wu(i,e,r),{move:l=!0,reverse:c}=r||{};let u=0,d=0,f,g,v,x,p,b;const m=w=>(s+(c?o-w:w))%a,y=()=>{x!==p&&(n.lineTo(u,p),n.lineTo(u,x),n.lineTo(u,b))};for(l&&(g=i[m(0)],n.moveTo(g.x,g.y)),f=0;f<=o;++f){if(g=i[m(f)],g.skip)continue;const w=g.x,T=g.y,S=w|0;S===v?(T<x?x=T:T>p&&(p=T),u=(d*u+w)/++d):(y(),n.lineTo(w,T),v=S,d=0,x=p=T),b=T}y()}function fs(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?X0:q0}function G0(n){return n.stepped?Kp:n.tension||n.cubicInterpolationMode==="monotone"?Qp:Ln}function K0(n,t,e,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,e,r)&&i.closePath()),Uu(n,t.options),n.stroke(i)}function Q0(n,t,e,r){const{segments:i,options:a}=t,s=fs(t);for(const o of i)Uu(n,a,o.style),n.beginPath(),s(n,t,o,{start:e,end:e+r-1})&&n.closePath(),n.stroke()}const Z0=typeof Path2D=="function";function J0(n,t,e,r){Z0&&!t.options.segment?K0(n,t,e,r):Q0(n,t,e,r)}class bn extends ee{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const i=r.spanGaps?this._loop:this._fullLoop;Hp(this._points,r,t,i,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=rm(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,r=t.length;return r&&e[t[r-1].end]}interpolate(t,e){const r=this.options,i=t[e],a=this.points,s=Gc(this,{property:e,start:i,end:i});if(!s.length)return;const o=[],l=G0(r);let c,u;for(c=0,u=s.length;c<u;++c){const{start:d,end:f}=s[c],g=a[d],v=a[f];if(g===v){o.push(g);continue}const x=Math.abs((i-g[e])/(v[e]-g[e])),p=l(g,v,x,r.stepped);p[e]=t[e],o.push(p)}return o.length===1?o[0]:o}pathSegment(t,e,r){return fs(this)(t,this,e,r)}path(t,e,r){const i=this.segments,a=fs(this);let s=this._loop;e=e||0,r=r||this.points.length-e;for(const o of i)s&=a(t,this,o,{start:e,end:e+r-1});return!!s}draw(t,e,r,i){const a=this.options||{};(this.points||[]).length&&a.borderWidth&&(t.save(),J0(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}z(bn,"id","line"),z(bn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),z(bn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),z(bn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Yu(n,t,e,r){const i=n.options,{[e]:a}=n.getProps([e],r);return Math.abs(t-a)<i.radius+i.hitRadius}class Hi extends ee{constructor(e){super();z(this,"parsed");z(this,"skip");z(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,r,i){const a=this.options,{x:s,y:o}=this.getProps(["x","y"],i);return Math.pow(e-s,2)+Math.pow(r-o,2)<Math.pow(a.hitRadius+a.radius,2)}inXRange(e,r){return Yu(this,e,"x",r)}inYRange(e,r){return Yu(this,e,"y",r)}getCenterPoint(e){const{x:r,y:i}=this.getProps(["x","y"],e);return{x:r,y:i}}size(e){e=e||this.options||{};let r=e.radius||0;r=Math.max(r,r&&e.hoverRadius||0);const i=r&&e.borderWidth||0;return(r+i)*2}draw(e,r){const i=this.options;this.skip||i.radius<.1||!Ge(this,r,this.size(i)/2)||(e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.fillStyle=i.backgroundColor,qa(e,i,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}z(Hi,"id","point"),z(Hi,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),z(Hi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Hu(n,t){const{x:e,y:r,base:i,width:a,height:s}=n.getProps(["x","y","base","width","height"],t);let o,l,c,u,d;return n.horizontal?(d=s/2,o=Math.min(e,i),l=Math.max(e,i),c=r-d,u=r+d):(d=a/2,o=e-d,l=e+d,c=Math.min(r,i),u=Math.max(r,i)),{left:o,top:c,right:l,bottom:u}}function yn(n,t,e,r){return n?0:Zt(t,e,r)}function tb(n,t,e){const r=n.options.borderWidth,i=n.borderSkipped,a=Rc(r);return{t:yn(i.top,a.top,0,e),r:yn(i.right,a.right,0,t),b:yn(i.bottom,a.bottom,0,e),l:yn(i.left,a.left,0,t)}}function eb(n,t,e){const{enableBorderRadius:r}=n.getProps(["enableBorderRadius"]),i=n.options.borderRadius,a=hn(i),s=Math.min(t,e),o=n.borderSkipped,l=r||lt(i);return{topLeft:yn(!l||o.top||o.left,a.topLeft,0,s),topRight:yn(!l||o.top||o.right,a.topRight,0,s),bottomLeft:yn(!l||o.bottom||o.left,a.bottomLeft,0,s),bottomRight:yn(!l||o.bottom||o.right,a.bottomRight,0,s)}}function nb(n){const t=Hu(n),e=t.right-t.left,r=t.bottom-t.top,i=tb(n,e/2,r/2),a=eb(n,e/2,r/2);return{outer:{x:t.left,y:t.top,w:e,h:r,radius:a},inner:{x:t.left+i.l,y:t.top+i.t,w:e-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,a.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,a.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,a.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,a.bottomRight-Math.max(i.b,i.r))}}}}function hs(n,t,e,r){const i=t===null,a=e===null,o=n&&!(i&&a)&&Hu(n,r);return o&&(i||qe(t,o.left,o.right))&&(a||qe(e,o.top,o.bottom))}function rb(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function ib(n,t){n.rect(t.x,t.y,t.w,t.h)}function gs(n,t,e={}){const r=n.x!==e.x?-t:0,i=n.y!==e.y?-t:0,a=(n.x+n.w!==e.x+e.w?t:0)-r,s=(n.y+n.h!==e.y+e.h?t:0)-i;return{x:n.x+r,y:n.y+i,w:n.w+a,h:n.h+s,radius:n.radius}}class zi extends ee{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:r,backgroundColor:i}}=this,{inner:a,outer:s}=nb(this),o=rb(s.radius)?er:ib;t.save(),(s.w!==a.w||s.h!==a.h)&&(t.beginPath(),o(t,gs(s,e,a)),t.clip(),o(t,gs(a,-e,s)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),o(t,gs(a,e)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,e,r){return hs(this,t,e,r)}inXRange(t,e){return hs(this,t,null,e)}inYRange(t,e){return hs(this,null,t,e)}getCenterPoint(t){const{x:e,y:r,base:i,horizontal:a}=this.getProps(["x","y","base","horizontal"],t);return{x:a?(e+i)/2:e,y:a?r:(r+i)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}z(zi,"id","bar"),z(zi,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),z(zi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var ab=Object.freeze({__proto__:null,ArcElement:jr,BarElement:zi,LineElement:bn,PointElement:Hi});const ps=["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)"],zu=ps.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function $u(n){return ps[n%ps.length]}function ju(n){return zu[n%zu.length]}function sb(n,t){return n.borderColor=$u(t),n.backgroundColor=ju(t),++t}function ob(n,t){return n.backgroundColor=n.data.map(()=>$u(t++)),t}function lb(n,t){return n.backgroundColor=n.data.map(()=>ju(t++)),t}function cb(n){let t=0;return(e,r)=>{const i=n.getDatasetMeta(r).controller;i instanceof mn?t=ob(e,t):i instanceof Fr?t=lb(e,t):i&&(t=sb(e,t))}}function Vu(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function ub(n){return n&&(n.borderColor||n.backgroundColor)}var db={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:r},options:i}=n.config,{elements:a}=i;if(!e.forceOverride&&(Vu(r)||ub(i)||a&&Vu(a)))return;const s=cb(n);r.forEach(s)}};function fb(n,t,e,r,i){const a=i.samples||r;if(a>=e)return n.slice(t,t+e);const s=[],o=(e-2)/(a-2);let l=0;const c=t+e-1;let u=t,d,f,g,v,x;for(s[l++]=n[u],d=0;d<a-2;d++){let p=0,b=0,m;const y=Math.floor((d+1)*o)+1+t,w=Math.min(Math.floor((d+2)*o)+1,e)+t,T=w-y;for(m=y;m<w;m++)p+=n[m].x,b+=n[m].y;p/=T,b/=T;const S=Math.floor(d*o)+1+t,k=Math.min(Math.floor((d+1)*o)+1,e)+t,{x:M,y:D}=n[u];for(g=v=-1,m=S;m<k;m++)v=.5*Math.abs((M-p)*(n[m].y-D)-(M-n[m].x)*(b-D)),v>g&&(g=v,f=n[m],x=m);s[l++]=f,u=x}return s[l++]=n[c],s}function hb(n,t,e,r){let i=0,a=0,s,o,l,c,u,d,f,g,v,x;const p=[],b=t+e-1,m=n[t].x,w=n[b].x-m;for(s=t;s<t+e;++s){o=n[s],l=(o.x-m)/w*r,c=o.y;const T=l|0;if(T===u)c<v?(v=c,d=s):c>x&&(x=c,f=s),i=(a*i+o.x)/++a;else{const S=s-1;if(!at(d)&&!at(f)){const k=Math.min(d,f),M=Math.max(d,f);k!==g&&k!==S&&p.push({...n[k],x:i}),M!==g&&M!==S&&p.push({...n[M],x:i})}s>0&&S!==g&&p.push(n[S]),p.push(o),u=T,a=0,v=x=c,d=f=g=s}}return p}function qu(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Xu(n){n.data.datasets.forEach(t=>{qu(t)})}function gb(n,t){const e=t.length;let r=0,i;const{iScale:a}=n,{min:s,max:o,minDefined:l,maxDefined:c}=a.getUserBounds();return l&&(r=Zt(Xe(t,a.axis,s).lo,0,e-1)),c?i=Zt(Xe(t,a.axis,o).hi+1,r,e)-r:i=e-r,{start:r,count:i}}var pb={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){Xu(n);return}const r=n.width;n.data.datasets.forEach((i,a)=>{const{_data:s,indexAxis:o}=i,l=n.getDatasetMeta(a),c=s||i.data;if(Rr([o,n.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=n.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||n.options.parsing)return;let{start:d,count:f}=gb(l,c);const g=e.threshold||4*r;if(f<=g){qu(i);return}at(s)&&(i._data=c,delete i.data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(x){this._data=x}}));let v;switch(e.algorithm){case"lttb":v=fb(c,d,f,r,e);break;case"min-max":v=hb(c,d,f,r);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}i._decimated=v})},destroy(n){Xu(n)}};function mb(n,t,e){const r=n.segments,i=n.points,a=t.points,s=[];for(const o of r){let{start:l,end:c}=o;c=bs(l,c,i);const u=ms(e,i[l],i[c],o.loop);if(!t.segments){s.push({source:o,target:u,start:i[l],end:i[c]});continue}const d=Gc(t,u);for(const f of d){const g=ms(e,a[f.start],a[f.end],f.loop),v=Xc(o,i,g);for(const x of v)s.push({source:x,target:f,start:{[e]:Gu(u,g,"start",Math.max)},end:{[e]:Gu(u,g,"end",Math.min)}})}}return s}function ms(n,t,e,r){if(r)return;let i=t[n],a=e[n];return n==="angle"&&(i=we(i),a=we(a)),{property:n,start:i,end:a}}function bb(n,t){const{x:e=null,y:r=null}=n||{},i=t.points,a=[];return t.segments.forEach(({start:s,end:o})=>{o=bs(s,o,i);const l=i[s],c=i[o];r!==null?(a.push({x:l.x,y:r}),a.push({x:c.x,y:r})):e!==null&&(a.push({x:e,y:l.y}),a.push({x:e,y:c.y}))}),a}function bs(n,t,e){for(;t>n;t--){const r=e[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function Gu(n,t,e,r){return n&&t?r(n[e],t[e]):n?n[e]:t?t[e]:0}function Ku(n,t){let e=[],r=!1;return bt(n)?(r=!0,e=n):e=bb(n,t),e.length?new bn({points:e,options:{tension:0},_loop:r,_fullLoop:r}):null}function Qu(n){return n&&n.fill!==!1}function yb(n,t,e){let i=n[t].fill;const a=[t];let s;if(!e)return i;for(;i!==!1&&a.indexOf(i)===-1;){if(!Nt(i))return i;if(s=n[i],!s)return!1;if(s.visible)return i;a.push(i),i=s.fill}return!1}function vb(n,t,e){const r=Tb(n);if(lt(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return Nt(i)&&Math.floor(i)===i?xb(r[0],t,i,e):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function xb(n,t,e,r){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=r?!1:e}function wb(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:lt(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function _b(n,t,e){let r;return n==="start"?r=e:n==="end"?r=t.options.reverse?t.min:t.max:lt(n)?r=n.value:r=t.getBaseValue(),r}function Tb(n){const t=n.options,e=t.fill;let r=rt(e&&e.target,e);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function Mb(n){const{scale:t,index:e,line:r}=n,i=[],a=r.segments,s=r.points,o=Db(t,e);o.push(Ku({x:null,y:t.bottom},r));for(let l=0;l<a.length;l++){const c=a[l];for(let u=c.start;u<=c.end;u++)Cb(i,s[u],o)}return new bn({points:i,options:{}})}function Db(n,t){const e=[],r=n.getMatchingVisibleMetas("line");for(let i=0;i<r.length;i++){const a=r[i];if(a.index===t)break;a.hidden||e.unshift(a.dataset)}return e}function Cb(n,t,e){const r=[];for(let i=0;i<e.length;i++){const a=e[i],{first:s,last:o,point:l}=kb(a,t,"x");if(!(!l||s&&o)){if(s)r.unshift(l);else if(n.push(l),!o)break}}n.push(...r)}function kb(n,t,e){const r=n.interpolate(t,e);if(!r)return{};const i=r[e],a=n.segments,s=n.points;let o=!1,l=!1;for(let c=0;c<a.length;c++){const u=a[c],d=s[u.start][e],f=s[u.end][e];if(qe(i,d,f)){o=i===d,l=i===f;break}}return{first:o,last:l,point:r}}class Zu{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,r){const{x:i,y:a,radius:s}=this;return e=e||{start:0,end:Ot},t.arc(i,a,s,e.end,e.start,!0),!r.bounds}interpolate(t){const{x:e,y:r,radius:i}=this,a=t.angle;return{x:e+Math.cos(a)*i,y:r+Math.sin(a)*i,angle:a}}}function Sb(n){const{chart:t,fill:e,line:r}=n;if(Nt(e))return Ob(t,e);if(e==="stack")return Mb(n);if(e==="shape")return!0;const i=Pb(n);return i instanceof Zu?i:Ku(i,r)}function Ob(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function Pb(n){return(n.scale||{}).getPointPositionForValue?Ab(n):Eb(n)}function Eb(n){const{scale:t={},fill:e}=n,r=wb(e,t);if(Nt(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function Ab(n){const{scale:t,fill:e}=n,r=t.options,i=t.getLabels().length,a=r.reverse?t.max:t.min,s=_b(e,t,a),o=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,a);return new Zu({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(s)})}for(let l=0;l<i;++l)o.push(t.getPointPositionForValue(l,s));return o}function ys(n,t,e){const r=Sb(t),{line:i,scale:a,axis:s}=t,o=i.options,l=o.fill,c=o.backgroundColor,{above:u=c,below:d=c}=l||{};r&&i.points.length&&(Er(n,e),Rb(n,{line:i,target:r,above:u,below:d,area:e,scale:a,axis:s}),Ar(n))}function Rb(n,t){const{line:e,target:r,above:i,below:a,area:s,scale:o}=t,l=e._loop?"angle":t.axis;n.save(),l==="x"&&a!==i&&(Ju(n,r,s.top),td(n,{line:e,target:r,color:i,scale:o,property:l}),n.restore(),n.save(),Ju(n,r,s.bottom)),td(n,{line:e,target:r,color:a,scale:o,property:l}),n.restore()}function Ju(n,t,e){const{segments:r,points:i}=t;let a=!0,s=!1;n.beginPath();for(const o of r){const{start:l,end:c}=o,u=i[l],d=i[bs(l,c,i)];a?(n.moveTo(u.x,u.y),a=!1):(n.lineTo(u.x,e),n.lineTo(u.x,u.y)),s=!!t.pathSegment(n,o,{move:s}),s?n.closePath():n.lineTo(d.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function td(n,t){const{line:e,target:r,property:i,color:a,scale:s}=t,o=mb(e,r,i);for(const{source:l,target:c,start:u,end:d}of o){const{style:{backgroundColor:f=a}={}}=l,g=r!==!0;n.save(),n.fillStyle=f,Lb(n,s,g&&ms(i,u,d)),n.beginPath();const v=!!e.pathSegment(n,l);let x;if(g){v?n.closePath():ed(n,r,d,i);const p=!!r.pathSegment(n,c,{move:v,reverse:!0});x=v&&p,x||ed(n,r,u,i)}n.closePath(),n.fill(x?"evenodd":"nonzero"),n.restore()}}function Lb(n,t,e){const{top:r,bottom:i}=t.chart.chartArea,{property:a,start:s,end:o}=e||{};a==="x"&&(n.beginPath(),n.rect(s,r,o-s,i-r),n.clip())}function ed(n,t,e,r){const i=t.interpolate(e,r);i&&n.lineTo(i.x,i.y)}var Ib={id:"filler",afterDatasetsUpdate(n,t,e){const r=(n.data.datasets||[]).length,i=[];let a,s,o,l;for(s=0;s<r;++s)a=n.getDatasetMeta(s),o=a.dataset,l=null,o&&o.options&&o instanceof bn&&(l={visible:n.isDatasetVisible(s),index:s,fill:vb(o,s,r),chart:n,axis:a.controller.options.indexAxis,scale:a.vScale,line:o}),a.$filler=l,i.push(l);for(s=0;s<r;++s)l=i[s],!(!l||l.fill===!1)&&(l.fill=yb(i,s,e.propagate))},beforeDraw(n,t,e){const r=e.drawTime==="beforeDraw",i=n.getSortedVisibleDatasetMetas(),a=n.chartArea;for(let s=i.length-1;s>=0;--s){const o=i[s].$filler;o&&(o.line.updateControlPoints(a,o.axis),r&&o.fill&&ys(n.ctx,o,a))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const r=n.getSortedVisibleDatasetMetas();for(let i=r.length-1;i>=0;--i){const a=r[i].$filler;Qu(a)&&ys(n.ctx,a,n.chartArea)}},beforeDatasetDraw(n,t,e){const r=t.meta.$filler;!Qu(r)||e.drawTime!=="beforeDatasetDraw"||ys(n.ctx,r,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const nd=(n,t)=>{let{boxHeight:e=t,boxWidth:r=t}=n;return n.usePointStyle&&(e=Math.min(e,t),r=n.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:e,itemHeight:Math.max(t,e)}},Nb=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class rd extends ee{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,r){this.maxWidth=t,this.maxHeight=e,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(){const t=this.options.labels||{};let e=Mt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(r=>t.filter(r,this.chart.data))),t.sort&&(e=e.sort((r,i)=>t.sort(r,i,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,i=Rt(r.font),a=i.size,s=this._computeTitleHeight(),{boxWidth:o,itemHeight:l}=nd(r,a);let c,u;e.font=i.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(s,a,o,l)+10):(u=this.maxHeight,c=this._fitCols(s,i,o,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,e,r,i){const{ctx:a,maxWidth:s,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=i+o;let d=t;a.textAlign="left",a.textBaseline="middle";let f=-1,g=-u;return this.legendItems.forEach((v,x)=>{const p=r+e/2+a.measureText(v.text).width;(x===0||c[c.length-1]+p+2*o>s)&&(d+=u,c[c.length-(x>0?0:1)]=0,g+=u,f++),l[x]={left:0,top:g,row:f,width:p,height:i},c[c.length-1]+=p+o}),d}_fitCols(t,e,r,i){const{ctx:a,maxHeight:s,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=s-t;let d=o,f=0,g=0,v=0,x=0;return this.legendItems.forEach((p,b)=>{const{itemWidth:m,itemHeight:y}=Fb(r,e,a,p,i);b>0&&g+y+2*o>u&&(d+=f+o,c.push({width:f,height:g}),v+=f+o,x++,f=g=0),l[b]={left:v,top:g,col:x,width:m,height:y},f=Math.max(f,m),g+=y+o}),d+=f,c.push({width:f,height:g}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:r,labels:{padding:i},rtl:a}}=this,s=ir(a,this.left,this.width);if(this.isHorizontal()){let o=0,l=ie(r,this.left+i,this.right-this.lineWidths[o]);for(const c of e)o!==c.row&&(o=c.row,l=ie(r,this.left+i,this.right-this.lineWidths[o])),c.top+=this.top+t+i,c.left=s.leftForLtr(s.x(l),c.width),l+=c.width+i}else{let o=0,l=ie(r,this.top+t+i,this.bottom-this.columnSizes[o].height);for(const c of e)c.col!==o&&(o=c.col,l=ie(r,this.top+t+i,this.bottom-this.columnSizes[o].height)),c.top=l,c.left+=this.left+i,c.left=s.leftForLtr(s.x(c.left),c.width),l+=c.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Er(t,this),this._draw(),Ar(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:r,ctx:i}=this,{align:a,labels:s}=t,o=Ut.color,l=ir(t.rtl,this.left,this.width),c=Rt(s.font),{padding:u}=s,d=c.size,f=d/2;let g;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;const{boxWidth:v,boxHeight:x,itemHeight:p}=nd(s,d),b=function(S,k,M){if(isNaN(v)||v<=0||isNaN(x)||x<0)return;i.save();const D=rt(M.lineWidth,1);if(i.fillStyle=rt(M.fillStyle,o),i.lineCap=rt(M.lineCap,"butt"),i.lineDashOffset=rt(M.lineDashOffset,0),i.lineJoin=rt(M.lineJoin,"miter"),i.lineWidth=D,i.strokeStyle=rt(M.strokeStyle,o),i.setLineDash(rt(M.lineDash,[])),s.usePointStyle){const O={radius:x*Math.SQRT2/2,pointStyle:M.pointStyle,rotation:M.rotation,borderWidth:D},P=l.xPlus(S,v/2),A=k+f;Ac(i,O,P,A,s.pointStyleWidth&&v)}else{const O=k+Math.max((d-x)/2,0),P=l.leftForLtr(S,v),A=hn(M.borderRadius);i.beginPath(),Object.values(A).some(F=>F!==0)?er(i,{x:P,y:O,w:v,h:x,radius:A}):i.rect(P,O,v,x),i.fill(),D!==0&&i.stroke()}i.restore()},m=function(S,k,M){An(i,M.text,S,k+p/2,c,{strikethrough:M.hidden,textAlign:l.textAlign(M.textAlign)})},y=this.isHorizontal(),w=this._computeTitleHeight();y?g={x:ie(a,this.left+u,this.right-r[0]),y:this.top+u+w,line:0}:g={x:this.left+u,y:ie(a,this.top+w+u,this.bottom-e[0].height),line:0},$c(this.ctx,t.textDirection);const T=p+u;this.legendItems.forEach((S,k)=>{i.strokeStyle=S.fontColor,i.fillStyle=S.fontColor;const M=i.measureText(S.text).width,D=l.textAlign(S.textAlign||(S.textAlign=s.textAlign)),O=v+f+M;let P=g.x,A=g.y;l.setWidth(this.width),y?k>0&&P+O+u>this.right&&(A=g.y+=T,g.line++,P=g.x=ie(a,this.left+u,this.right-r[g.line])):k>0&&A+T>this.bottom&&(P=g.x=P+e[g.line].width+u,g.line++,A=g.y=ie(a,this.top+w+u,this.bottom-e[g.line].height));const F=l.x(P);if(b(F,A,S),P=sp(D,P+v+f,y?P+O:this.right,t.rtl),m(l.x(P),A,S),y)g.x+=O+u;else if(typeof S.text!="string"){const q=c.lineHeight;g.y+=id(S,q)+u}else g.y+=T}),jc(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,r=Rt(e.font),i=Kt(e.padding);if(!e.display)return;const a=ir(t.rtl,this.left,this.width),s=this.ctx,o=e.position,l=r.size/2,c=i.top+l;let u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=ie(t.align,d,this.right-f);else{const v=this.columnSizes.reduce((x,p)=>Math.max(x,p.height),0);u=c+ie(t.align,this.top,this.bottom-v-t.labels.padding-this._computeTitleHeight())}const g=ie(o,d,d+f);s.textAlign=a.textAlign(Ha(o)),s.textBaseline="middle",s.strokeStyle=e.color,s.fillStyle=e.color,s.font=r.string,An(s,e.text,g,u,r)}_computeTitleHeight(){const t=this.options.title,e=Rt(t.font),r=Kt(t.padding);return t.display?e.lineHeight+r.height:0}_getLegendItemAt(t,e){let r,i,a;if(qe(t,this.left,this.right)&&qe(e,this.top,this.bottom)){for(a=this.legendHitBoxes,r=0;r<a.length;++r)if(i=a[r],qe(t,i.left,i.left+i.width)&&qe(e,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const e=this.options;if(!Wb(t.type,e))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,a=Nb(i,r);i&&!a&&Mt(e.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!a&&Mt(e.onHover,[t,r,this],this)}else r&&Mt(e.onClick,[t,r,this],this)}}function Fb(n,t,e,r,i){const a=Bb(r,n,t,e),s=Ub(i,r,t.lineHeight);return{itemWidth:a,itemHeight:s}}function Bb(n,t,e,r){let i=n.text;return i&&typeof i!="string"&&(i=i.reduce((a,s)=>a.length>s.length?a:s)),t+e.size/2+r.measureText(i).width}function Ub(n,t,e){let r=n;return typeof t.text!="string"&&(r=id(t,e)),r}function id(n,t){const e=n.text?n.text.length:0;return t*e}function Wb(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var Yb={id:"legend",_element:rd,start(n,t,e){const r=n.legend=new rd({ctx:n.ctx,options:e,chart:n});ae.configure(n,r,e),ae.addBox(n,r)},stop(n){ae.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const r=n.legend;ae.configure(n,r,e),r.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const r=t.datasetIndex,i=e.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:r,textAlign:i,color:a,useBorderRadius:s,borderRadius:o}}=n.legend.options;return n._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),u=Kt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:a,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:i||c.textAlign,borderRadius:s&&(o||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class vs extends ee{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const 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=t,this.height=this.bottom=e;const i=bt(r.text)?r.text.length:1;this._padding=Kt(r.padding);const a=i*Rt(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=a:this.width=a}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:r,bottom:i,right:a,options:s}=this,o=s.align;let l=0,c,u,d;return this.isHorizontal()?(u=ie(o,r,a),d=e+t,c=a-r):(s.position==="left"?(u=r+t,d=ie(o,i,e),l=ft*-.5):(u=a-t,d=ie(o,e,i),l=ft*.5),c=i-e),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const r=Rt(e.font),a=r.lineHeight/2+this._padding.top,{titleX:s,titleY:o,maxWidth:l,rotation:c}=this._drawArgs(a);An(t,e.text,0,0,r,{color:e.color,maxWidth:l,rotation:c,textAlign:Ha(e.align),textBaseline:"middle",translation:[s,o]})}}function Hb(n,t){const e=new vs({ctx:n.ctx,options:t,chart:n});ae.configure(n,e,t),ae.addBox(n,e),n.titleBlock=e}var zb={id:"title",_element:vs,start(n,t,e){Hb(n,e)},stop(n){const t=n.titleBlock;ae.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const r=n.titleBlock;ae.configure(n,r,e),r.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const $i=new WeakMap;var $b={id:"subtitle",start(n,t,e){const r=new vs({ctx:n.ctx,options:e,chart:n});ae.configure(n,r,e),ae.addBox(n,r),$i.set(n,r)},stop(n){ae.removeBox(n,$i.get(n)),$i.delete(n)},beforeUpdate(n,t,e){const r=$i.get(n);ae.configure(n,r,e),r.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Vr={average(n){if(!n.length)return!1;let t,e,r=0,i=0,a=0;for(t=0,e=n.length;t<e;++t){const s=n[t].element;if(s&&s.hasValue()){const o=s.tooltipPosition();r+=o.x,i+=o.y,++a}}return{x:r/a,y:i/a}},nearest(n,t){if(!n.length)return!1;let e=t.x,r=t.y,i=Number.POSITIVE_INFINITY,a,s,o;for(a=0,s=n.length;a<s;++a){const l=n[a].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=tr(t,c);u<i&&(i=u,o=l)}}if(o){const l=o.tooltipPosition();e=l.x,r=l.y}return{x:e,y:r}}};function Be(n,t){return t&&(bt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function Qe(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
16
+ */class sm{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,r,i){const a=e.listeners[i],s=e.duration;a.forEach(o=>o({chart:t,initial:e.initial,numSteps:s,currentStep:Math.min(r-e.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=_c.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const a=r.items;let s=a.length-1,o=!1,l;for(;s>=0;--s)l=a[s],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),o=!0):(a[s]=a[a.length-1],a.pop());o&&(i.draw(),this._notify(i,r,t,"progress")),a.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),e+=a.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let r=e.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,r)),r}listen(t,e,r){this._getAnims(t).listeners[e].push(r)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((r,i)=>Math.max(r,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const r=e.items;let i=r.length-1;for(;i>=0;--i)r[i].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Ke=new sm;const Zc="transparent",om={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const r=Sc(n||Zc),i=r.valid&&Sc(t||Zc);return i&&i.valid?i.mix(r,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class lm{constructor(t,e,r,i){const a=e[r];i=Rr([t.to,i,a,t.from]);const s=Rr([t.from,a,i]);this._active=!0,this._fn=t.fn||om[t.type||typeof s],this._easing=Sr[t.easing]||Sr.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=r,this._from=s,this._to=i,this._promises=void 0}active(){return this._active}update(t,e,r){if(this._active){this._notify(!1);const i=this._target[this._prop],a=r-this._start,s=this._duration-a;this._start=r,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=a,this._loop=!!t.loop,this._to=Rr([t.to,e,i,t.from]),this._from=Rr([t.from,i,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,r=this._duration,i=this._prop,a=this._from,s=this._loop,o=this._to;let l;if(this._active=a!==o&&(s||e<r),!this._active){this._target[i]=o,this._notify(!0);return}if(e<0){this._target[i]=a;return}l=e/r%2,l=s&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(a,o,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,r)=>{t.push({res:e,rej:r})})}_notify(t){const e=t?"res":"rej",r=this._promises||[];for(let i=0;i<r.length;i++)r[i][e]()}}class ts{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!ct(t))return;const e=Object.keys(Ut.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const a=t[i];if(!ct(a))return;const s={};for(const o of e)s[o]=a[o];(bt(a.properties)&&a.properties||[i]).forEach(o=>{(o===i||!r.has(o))&&r.set(o,s)})})}_animateOptions(t,e){const r=e.options,i=um(t,r);if(!i)return[];const a=this._createAnimations(i,r);return r.$shared&&cm(t.options.$animations,r).then(()=>{t.options=r},()=>{}),a}_createAnimations(t,e){const r=this._properties,i=[],a=t.$animations||(t.$animations={}),s=Object.keys(e),o=Date.now();let l;for(l=s.length-1;l>=0;--l){const c=s[l];if(c.charAt(0)==="$")continue;if(c==="options"){i.push(...this._animateOptions(t,e));continue}const u=e[c];let d=a[c];const f=r.get(c);if(d)if(f&&d.active()){d.update(f,u,o);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}a[c]=d=new lm(f,t,c,u),i.push(d)}return i}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const r=this._createAnimations(t,e);if(r.length)return Ke.add(this._chart,r),!0}}function cm(n,t){const e=[],r=Object.keys(t);for(let i=0;i<r.length;i++){const a=n[r[i]];a&&a.active()&&e.push(a.wait())}return Promise.all(e)}function um(n,t){if(!t)return;let e=n.options;if(!e){n.options=t;return}return e.$shared&&(n.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function Jc(n,t){const e=n&&n.options||{},r=e.reverse,i=e.min===void 0?t:0,a=e.max===void 0?t:0;return{start:r?a:i,end:r?i:a}}function dm(n,t,e){if(e===!1)return!1;const r=Jc(n,e),i=Jc(t,e);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function fm(n){let t,e,r,i;return ct(n)?(t=n.top,e=n.right,r=n.bottom,i=n.left):t=e=r=i=n,{top:t,right:e,bottom:r,left:i,disabled:n===!1}}function tu(n,t){const e=[],r=n._getSortedDatasetMetas(t);let i,a;for(i=0,a=r.length;i<a;++i)e.push(r[i].index);return e}function eu(n,t,e,r={}){const i=n.keys,a=r.mode==="single";let s,o,l,c;if(t!==null){for(s=0,o=i.length;s<o;++s){if(l=+i[s],l===e){if(r.all)continue;break}c=n.values[l],Nt(c)&&(a||t===0||Ne(t)===Ne(c))&&(t+=c)}return t}}function hm(n){const t=Object.keys(n),e=new Array(t.length);let r,i,a;for(r=0,i=t.length;r<i;++r)a=t[r],e[r]={x:a,y:n[a]};return e}function nu(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function gm(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function pm(n){const{min:t,max:e,minDefined:r,maxDefined:i}=n.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:i?e:Number.POSITIVE_INFINITY}}function mm(n,t,e){const r=n[t]||(n[t]={});return r[e]||(r[e]={})}function ru(n,t,e,r){for(const i of t.getMatchingVisibleMetas(r).reverse()){const a=n[i.index];if(e&&a>0||!e&&a<0)return i.index}return null}function iu(n,t){const{chart:e,_cachedMeta:r}=n,i=e._stacks||(e._stacks={}),{iScale:a,vScale:s,index:o}=r,l=a.axis,c=s.axis,u=gm(a,s,r),d=t.length;let f;for(let g=0;g<d;++g){const v=t[g],{[l]:x,[c]:p}=v,b=v._stacks||(v._stacks={});f=b[c]=mm(i,u,x),f[o]=p,f._top=ru(f,s,!0,r.type),f._bottom=ru(f,s,!1,r.type);const m=f._visualValues||(f._visualValues={});m[o]=p}}function es(n,t){const e=n.scales;return Object.keys(e).filter(r=>e[r].axis===t).shift()}function bm(n,t){return gn(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function ym(n,t,e){return gn(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Lr(n,t){const e=n.controller.index,r=n.vScale&&n.vScale.axis;if(r){t=t||n._parsed;for(const i of t){const a=i._stacks;if(!a||a[r]===void 0||a[r][e]===void 0)return;delete a[r][e],a[r]._visualValues!==void 0&&a[r]._visualValues[e]!==void 0&&delete a[r]._visualValues[e]}}}const ns=n=>n==="reset"||n==="none",au=(n,t)=>t?n:Object.assign({},n),vm=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:tu(e,!0),values:null};class Ee{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=nu(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&&Lr(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,r=this.getDataset(),i=(d,f,g,v)=>d==="x"?f:d==="r"?v:g,a=e.xAxisID=rt(r.xAxisID,es(t,"x")),s=e.yAxisID=rt(r.yAxisID,es(t,"y")),o=e.rAxisID=rt(r.rAxisID,es(t,"r")),l=e.indexAxis,c=e.iAxisID=i(l,a,s,o),u=e.vAxisID=i(l,s,a,o);e.xScale=this.getScaleForId(a),e.yScale=this.getScaleForId(s),e.rScale=this.getScaleForId(o),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&xc(this._data,this),t._stacked&&Lr(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),r=this._data;if(ct(e))this._data=hm(e);else if(r!==e){if(r){xc(r,this);const i=this._cachedMeta;Lr(i),i._parsed=[]}e&&Object.isExtensible(e)&&ip(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,r=this.getDataset();let i=!1;this._dataCheck();const a=e._stacked;e._stacked=nu(e.vScale,e),e.stack!==r.stack&&(i=!0,Lr(e),e.stack=r.stack),this._resyncElements(t),(i||a!==e._stacked)&&iu(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:r,_data:i}=this,{iScale:a,_stacked:s}=r,o=a.axis;let l=t===0&&e===i.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,d,f;if(this._parsing===!1)r._parsed=i,r._sorted=!0,f=i;else{bt(i[t])?f=this.parseArrayData(r,i,t,e):ct(i[t])?f=this.parseObjectData(r,i,t,e):f=this.parsePrimitiveData(r,i,t,e);const g=()=>d[o]===null||c&&d[o]<c[o];for(u=0;u<e;++u)r._parsed[u+t]=d=f[u],l&&(g()&&(l=!1),c=d);r._sorted=l}s&&iu(this,f)}parsePrimitiveData(t,e,r,i){const{iScale:a,vScale:s}=t,o=a.axis,l=s.axis,c=a.getLabels(),u=a===s,d=new Array(i);let f,g,v;for(f=0,g=i;f<g;++f)v=f+r,d[f]={[o]:u||a.parse(c[v],v),[l]:s.parse(e[v],v)};return d}parseArrayData(t,e,r,i){const{xScale:a,yScale:s}=t,o=new Array(i);let l,c,u,d;for(l=0,c=i;l<c;++l)u=l+r,d=e[u],o[l]={x:a.parse(d[0],u),y:s.parse(d[1],u)};return o}parseObjectData(t,e,r,i){const{xScale:a,yScale:s}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=new Array(i);let u,d,f,g;for(u=0,d=i;u<d;++u)f=u+r,g=e[f],c[u]={x:a.parse(un(g,o),f),y:s.parse(un(g,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,r){const i=this.chart,a=this._cachedMeta,s=e[t.axis],o={keys:tu(i,!0),values:e._stacks[t.axis]._visualValues};return eu(o,s,a.index,{mode:r})}updateRangeFromParsed(t,e,r,i){const a=r[e.axis];let s=a===null?NaN:a;const o=i&&r._stacks[e.axis];i&&o&&(i.values=o,s=eu(i,a,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,e){const r=this._cachedMeta,i=r._parsed,a=r._sorted&&t===r.iScale,s=i.length,o=this._getOtherScale(t),l=vm(e,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=pm(o);let f,g;function v(){g=i[f];const x=g[o.axis];return!Nt(g[t.axis])||u>x||d<x}for(f=0;f<s&&!(!v()&&(this.updateRangeFromParsed(c,t,g,l),a));++f);if(a){for(f=s-1;f>=0;--f)if(!v()){this.updateRangeFromParsed(c,t,g,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,r=[];let i,a,s;for(i=0,a=e.length;i<a;++i)s=e[i][t.axis],Nt(s)&&r.push(s);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,r=e.iScale,i=e.vScale,a=this.getParsed(t);return{label:r?""+r.getLabelForValue(a[r.axis]):"",value:i?""+i.getLabelForValue(a[i.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=fm(rt(this.options.clip,dm(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,r=this._cachedMeta,i=r.data||[],a=e.chartArea,s=[],o=this._drawStart||0,l=this._drawCount||i.length-o,c=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,a,o,l),u=o;u<o+l;++u){const d=i[u];d.hidden||(d.active&&c?s.push(d):d.draw(t,a))}for(u=0;u<s.length;++u)s[u].draw(t,a)}getStyle(t,e){const r=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,e,r){const i=this.getDataset();let a;if(t>=0&&t<this._cachedMeta.data.length){const s=this._cachedMeta.data[t];a=s.$context||(s.$context=ym(this.getContext(),t,s)),a.parsed=this.getParsed(t),a.raw=i.data[t],a.index=a.dataIndex=t}else a=this.$context||(this.$context=bm(this.chart.getContext(),this.index)),a.dataset=i,a.index=a.datasetIndex=this.index;return a.active=!!e,a.mode=r,a}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",r){const i=e==="active",a=this._cachedDataOpts,s=t+"-"+e,o=a[s],l=this.enableOptionSharing&&fe(r);if(o)return au(o,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=i?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),g=Object.keys(Ut.elements[t]),v=()=>this.getContext(r,i,e),x=c.resolveNamedOptions(f,g,v,d);return x.$shared&&(x.$shared=l,a[s]=Object.freeze(au(x,l))),x}_resolveAnimations(t,e,r){const i=this.chart,a=this._cachedDataOpts,s=`animation-${e}`,o=a[s];if(o)return o;let l;if(i.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,e),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(t,r,e))}const c=new ts(i,l&&l.animations);return l&&l._cacheable&&(a[s]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ns(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const r=this.resolveDataElementOptions(t,e),i=this._sharedOptions,a=this.getSharedOptions(r),s=this.includeOptions(e,a)||a!==i;return this.updateSharedOptions(a,e,r),{sharedOptions:a,includeOptions:s}}updateElement(t,e,r,i){ns(i)?Object.assign(t,r):this._resolveAnimations(e,i).update(t,r)}updateSharedOptions(t,e,r){t&&!ns(e)&&this._resolveAnimations(void 0,e).update(t,r)}_setStyle(t,e,r,i){t.active=i;const a=this.getStyle(e,i);this._resolveAnimations(e,r,i).update(t,{options:!i&&this.getSharedOptions(a)||a})}removeHoverStyle(t,e,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,e,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,r=this._cachedMeta.data;for(const[o,l,c]of this._syncList)this[o](l,c);this._syncList=[];const i=r.length,a=e.length,s=Math.min(a,i);s&&this.parse(0,s),a>i?this._insertElements(i,a-i,t):a<i&&this._removeElements(a,i-a)}_insertElements(t,e,r=!0){const i=this._cachedMeta,a=i.data,s=t+e;let o;const l=c=>{for(c.length+=e,o=c.length-1;o>=s;o--)c[o]=c[o-e]};for(l(a),o=t;o<s;++o)a[o]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,e),r&&this.updateElements(a,t,e,"reset")}updateElements(t,e,r,i){}_removeElements(t,e){const r=this._cachedMeta;if(this._parsing){const i=r._parsed.splice(t,e);r._stacked&&Lr(r,i)}r.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,r,i]=t;this[e](r,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}z(Ee,"defaults",{}),z(Ee,"datasetElementType",null),z(Ee,"dataElementType",null);function xm(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let r=[];for(let i=0,a=e.length;i<a;i++)r=r.concat(e[i].controller.getAllParsedValues(n));n._cache.$bar=wc(r.sort((i,a)=>i-a))}return n._cache.$bar}function wm(n){const t=n.iScale,e=xm(t,n.type);let r=t._length,i,a,s,o;const l=()=>{s===32767||s===-32768||(fe(o)&&(r=Math.min(r,Math.abs(s-o)||r)),o=s)};for(i=0,a=e.length;i<a;++i)s=t.getPixelForValue(e[i]),l();for(o=void 0,i=0,a=t.ticks.length;i<a;++i)s=t.getPixelForTick(i),l();return r}function _m(n,t,e,r){const i=e.barThickness;let a,s;return at(i)?(a=t.min*e.categoryPercentage,s=e.barPercentage):(a=i*r,s=1),{chunk:a/r,ratio:s,start:t.pixels[n]-a/2}}function Tm(n,t,e,r){const i=t.pixels,a=i[n];let s=n>0?i[n-1]:null,o=n<i.length-1?i[n+1]:null;const l=e.categoryPercentage;s===null&&(s=a-(o===null?t.end-t.start:o-a)),o===null&&(o=a+a-s);const c=a-(a-Math.min(s,o))/2*l;return{chunk:Math.abs(o-s)/2*l/r,ratio:e.barPercentage,start:c}}function Mm(n,t,e,r){const i=e.parse(n[0],r),a=e.parse(n[1],r),s=Math.min(i,a),o=Math.max(i,a);let l=s,c=o;Math.abs(s)>Math.abs(o)&&(l=o,c=s),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:i,end:a,min:s,max:o}}function su(n,t,e,r){return bt(n)?Mm(n,t,e,r):t[e.axis]=e.parse(n,r),t}function ou(n,t,e,r){const i=n.iScale,a=n.vScale,s=i.getLabels(),o=i===a,l=[];let c,u,d,f;for(c=e,u=e+r;c<u;++c)f=t[c],d={},d[i.axis]=o||i.parse(s[c],c),l.push(su(f,d,a,c));return l}function rs(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function Dm(n,t,e){return n!==0?Ne(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Cm(n){let t,e,r,i,a;return n.horizontal?(t=n.base>n.x,e="left",r="right"):(t=n.base<n.y,e="bottom",r="top"),t?(i="end",a="start"):(i="start",a="end"),{start:e,end:r,reverse:t,top:i,bottom:a}}function km(n,t,e,r){let i=t.borderSkipped;const a={};if(!i){n.borderSkipped=a;return}if(i===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:s,end:o,reverse:l,top:c,bottom:u}=Cm(n);i==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===r?i=c:(e._bottom||0)===r?i=u:(a[lu(u,s,o,l)]=!0,i=c)),a[lu(i,s,o,l)]=!0,n.borderSkipped=a}function lu(n,t,e,r){return r?(n=Sm(n,t,e),n=cu(n,e,t)):n=cu(n,t,e),n}function Sm(n,t,e){return n===t?e:n===e?t:n}function cu(n,t,e){return n==="start"?t:n==="end"?e:n}function Om(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class Ir extends Ee{parsePrimitiveData(t,e,r,i){return ou(t,e,r,i)}parseArrayData(t,e,r,i){return ou(t,e,r,i)}parseObjectData(t,e,r,i){const{iScale:a,vScale:s}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=a.axis==="x"?o:l,u=s.axis==="x"?o:l,d=[];let f,g,v,x;for(f=r,g=r+i;f<g;++f)x=e[f],v={},v[a.axis]=a.parse(un(x,c),f),d.push(su(un(x,u),v,s,f));return d}updateRangeFromParsed(t,e,r,i){super.updateRangeFromParsed(t,e,r,i);const a=r._custom;a&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,a.min),t.max=Math.max(t.max,a.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:r,vScale:i}=e,a=this.getParsed(t),s=a._custom,o=rs(s)?"["+s.start+", "+s.end+"]":""+i.getLabelForValue(a[i.axis]);return{label:""+r.getLabelForValue(a[r.axis]),value:o}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,r,i){const a=i==="reset",{index:s,_cachedMeta:{vScale:o}}=this,l=o.getBasePixel(),c=o.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:f}=this._getSharedOptions(e,i);for(let g=e;g<e+r;g++){const v=this.getParsed(g),x=a||at(v[o.axis])?{base:l,head:l}:this._calculateBarValuePixels(g),p=this._calculateBarIndexPixels(g,u),b=(v._stacks||{})[o.axis],m={horizontal:c,base:x.base,enableBorderRadius:!b||rs(v._custom)||s===b._top||s===b._bottom,x:c?x.head:p.center,y:c?p.center:x.head,height:c?p.size:Math.abs(x.size),width:c?Math.abs(x.size):p.size};f&&(m.options=d||this.resolveDataElementOptions(g,t[g].active?"active":i));const y=m.options||t[g].options;km(m,y,b,s),Om(m,y,u.ratio),this.updateElement(t[g],g,m,i)}}_getStacks(t,e){const{iScale:r}=this._cachedMeta,i=r.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),a=r.options.stacked,s=[],o=l=>{const c=l.controller.getParsed(e),u=c&&c[l.vScale.axis];if(at(u)||isNaN(u))return!0};for(const l of i)if(!(e!==void 0&&o(l))&&((a===!1||s.indexOf(l.stack)===-1||a===void 0&&l.stack===void 0)&&s.push(l.stack),l.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,r){const i=this._getStacks(t,r),a=e!==void 0?i.indexOf(e):-1;return a===-1?i.length-1:a}_getRuler(){const t=this.options,e=this._cachedMeta,r=e.iScale,i=[];let a,s;for(a=0,s=e.data.length;a<s;++a)i.push(r.getPixelForValue(this.getParsed(a)[r.axis],a));const o=t.barThickness;return{min:o||wm(e),pixels:i,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:r,index:i},options:{base:a,minBarLength:s}}=this,o=a||0,l=this.getParsed(t),c=l._custom,u=rs(c);let d=l[e.axis],f=0,g=r?this.applyStack(e,l,r):d,v,x;g!==d&&(f=g-d,g=d),u&&(d=c.barStart,g=c.barEnd-c.barStart,d!==0&&Ne(d)!==Ne(c.barEnd)&&(f=0),f+=d);const p=!at(a)&&!u?a:f;let b=e.getPixelForValue(p);if(this.chart.getDataVisibility(t)?v=e.getPixelForValue(f+g):v=b,x=v-b,Math.abs(x)<s){x=Dm(x,e,o)*s,d===o&&(b-=x/2);const m=e.getPixelForDecimal(0),y=e.getPixelForDecimal(1),w=Math.min(m,y),T=Math.max(m,y);b=Math.max(Math.min(b,T),w),v=b+x,r&&!u&&(l._stacks[e.axis]._visualValues[i]=e.getValueForPixel(v)-e.getValueForPixel(b))}if(b===e.getPixelForValue(o)){const m=Ne(x)*e.getLineWidthForValue(o)/2;b+=m,x-=m}return{size:x,base:b,head:v,center:v+x/2}}_calculateBarIndexPixels(t,e){const r=e.scale,i=this.options,a=i.skipNull,s=rt(i.maxBarThickness,1/0);let o,l;if(e.grouped){const c=a?this._getStackCount(t):e.stackCount,u=i.barThickness==="flex"?Tm(t,e,i,c):_m(t,e,i,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,a?t:void 0);o=u.start+u.chunk*d+u.chunk/2,l=Math.min(s,u.chunk*u.ratio)}else o=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(s,e.min*e.ratio);return{base:o-l/2,head:o+l/2,center:o,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,r=t.data,i=r.length;let a=0;for(;a<i;++a)this.getParsed(a)[e.axis]!==null&&r[a].draw(this._ctx)}}z(Ir,"id","bar"),z(Ir,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),z(Ir,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Pi extends Ee{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,r,i){const a=super.parsePrimitiveData(t,e,r,i);for(let s=0;s<a.length;s++)a[s]._custom=this.resolveDataElementOptions(s+r).radius;return a}parseArrayData(t,e,r,i){const a=super.parseArrayData(t,e,r,i);for(let s=0;s<a.length;s++){const o=e[r+s];a[s]._custom=rt(o[2],this.resolveDataElementOptions(s+r).radius)}return a}parseObjectData(t,e,r,i){const a=super.parseObjectData(t,e,r,i);for(let s=0;s<a.length;s++){const o=e[r+s];a[s]._custom=rt(o&&o.r&&+o.r,this.resolveDataElementOptions(s+r).radius)}return a}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let r=t.length-1;r>=0;--r)e=Math.max(e,t[r].size(this.resolveDataElementOptions(r))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,r=this.chart.data.labels||[],{xScale:i,yScale:a}=e,s=this.getParsed(t),o=i.getLabelForValue(s.x),l=a.getLabelForValue(s.y),c=s._custom;return{label:r[t]||"",value:"("+o+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,r,i){const a=i==="reset",{iScale:s,vScale:o}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,i),u=s.axis,d=o.axis;for(let f=e;f<e+r;f++){const g=t[f],v=!a&&this.getParsed(f),x={},p=x[u]=a?s.getPixelForDecimal(.5):s.getPixelForValue(v[u]),b=x[d]=a?o.getBasePixel():o.getPixelForValue(v[d]);x.skip=isNaN(p)||isNaN(b),c&&(x.options=l||this.resolveDataElementOptions(f,g.active?"active":i),a&&(x.options.radius=0)),this.updateElement(g,f,x,i)}}resolveDataElementOptions(t,e){const r=this.getParsed(t);let i=super.resolveDataElementOptions(t,e);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const a=i.radius;return e!=="active"&&(i.radius=0),i.radius+=rt(r&&r._custom,a),i}}z(Pi,"id","bubble"),z(Pi,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),z(Pi,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Pm(n,t,e){let r=1,i=1,a=0,s=0;if(t<Ot){const o=n,l=o+t,c=Math.cos(o),u=Math.sin(o),d=Math.cos(l),f=Math.sin(l),g=(y,w,T)=>kr(y,o,l,!0)?1:Math.max(w,w*e,T,T*e),v=(y,w,T)=>kr(y,o,l,!0)?-1:Math.min(w,w*e,T,T*e),x=g(0,c,d),p=g(At,u,f),b=v(ft,c,d),m=v(ft+At,u,f);r=(x-b)/2,i=(p-m)/2,a=-(x+b)/2,s=-(p+m)/2}return{ratioX:r,ratioY:i,offsetX:a,offsetY:s}}class mn extends Ee{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const r=this.getDataset().data,i=this._cachedMeta;if(this._parsing===!1)i._parsed=r;else{let a=l=>+r[l];if(ct(r[t])){const{key:l="value"}=this._parsing;a=c=>+un(r[c],l)}let s,o;for(s=t,o=t+e;s<o;++s)i._parsed[s]=a(s)}}_getRotation(){return Gt(this.options.rotation-90)}_getCircumference(){return Gt(this.options.circumference)}_getRotationExtents(){let t=Ot,e=-Ot;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const i=this.chart.getDatasetMeta(r).controller,a=i._getRotation(),s=i._getCircumference();t=Math.min(t,a),e=Math.max(e,a+s)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:r}=e,i=this._cachedMeta,a=i.data,s=this.getMaxBorderWidth()+this.getMaxOffset(a)+this.options.spacing,o=Math.max((Math.min(r.width,r.height)-s)/2,0),l=Math.min(jg(this.options.cutout,o),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:g,offsetX:v,offsetY:x}=Pm(d,u,l),p=(r.width-s)/f,b=(r.height-s)/g,m=Math.max(Math.min(p,b)/2,0),y=dc(this.options.radius,m),w=Math.max(y*l,0),T=(y-w)/this._getVisibleDatasetWeightTotal();this.offsetX=v*y,this.offsetY=x*y,i.total=this.calculateTotal(),this.outerRadius=y-T*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-T*c,0),this.updateElements(a,0,a.length,t)}_circumference(t,e){const r=this.options,i=this._cachedMeta,a=this._getCircumference();return e&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||i._parsed[t]===null||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*a/Ot)}updateElements(t,e,r,i){const a=i==="reset",s=this.chart,o=s.chartArea,c=s.options.animation,u=(o.left+o.right)/2,d=(o.top+o.bottom)/2,f=a&&c.animateScale,g=f?0:this.innerRadius,v=f?0:this.outerRadius,{sharedOptions:x,includeOptions:p}=this._getSharedOptions(e,i);let b=this._getRotation(),m;for(m=0;m<e;++m)b+=this._circumference(m,a);for(m=e;m<e+r;++m){const y=this._circumference(m,a),w=t[m],T={x:u+this.offsetX,y:d+this.offsetY,startAngle:b,endAngle:b+y,circumference:y,outerRadius:v,innerRadius:g};p&&(T.options=x||this.resolveDataElementOptions(m,w.active?"active":i)),b+=y,this.updateElement(w,m,T,i)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let r=0,i;for(i=0;i<e.length;i++){const a=t._parsed[i];a!==null&&!isNaN(a)&&this.chart.getDataVisibility(i)&&!e[i].hidden&&(r+=Math.abs(a))}return r}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?Ot*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,r=this.chart,i=r.data.labels||[],a=Or(e._parsed[t],r.options.locale);return{label:i[t]||"",value:a}}getMaxBorderWidth(t){let e=0;const r=this.chart;let i,a,s,o,l;if(!t){for(i=0,a=r.data.datasets.length;i<a;++i)if(r.isDatasetVisible(i)){s=r.getDatasetMeta(i),t=s.data,o=s.controller;break}}if(!t)return 0;for(i=0,a=t.length;i<a;++i)l=o.resolveDataElementOptions(i),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let r=0,i=t.length;r<i;++r){const a=this.resolveDataElementOptions(r);e=Math.max(e,a.offset||0,a.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(e+=this._getRingWeight(r));return e}_getRingWeight(t){return Math.max(rt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}z(mn,"id","doughnut"),z(mn,"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"}),z(mn,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),z(mn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:r,color:i}}=t.legend.options;return e.labels.map((a,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:a,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,e,r){r.chart.toggleDataVisibility(e.index),r.chart.update()}}}});class Nr extends Ee{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:r,data:i=[],_dataset:a}=e,s=this.chart._animationsDisabled;let{start:o,count:l}=Mc(e,i,s);this._drawStart=o,this._drawCount=l,Dc(e)&&(o=0,l=i.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!a._decimated,r.points=i;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:c},t),this.updateElements(i,o,l,t)}updateElements(t,e,r,i){const a=i==="reset",{iScale:s,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,i),f=s.axis,g=o.axis,{spanGaps:v,segment:x}=this.options,p=fn(v)?v:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||a||i==="none",m=e+r,y=t.length;let w=e>0&&this.getParsed(e-1);for(let T=0;T<y;++T){const S=t[T],k=b?S:{};if(T<e||T>=m){k.skip=!0;continue}const M=this.getParsed(T),D=at(M[g]),O=k[f]=s.getPixelForValue(M[f],T),P=k[g]=a||D?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,M,l):M[g],T);k.skip=isNaN(O)||isNaN(P)||D,k.stop=T>0&&Math.abs(M[f]-w[f])>p,x&&(k.parsed=M,k.raw=c.data[T]),d&&(k.options=u||this.resolveDataElementOptions(T,S.active?"active":i)),b||this.updateElement(S,T,k,i),w=M}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,r=e.options&&e.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const a=i[0].size(this.resolveDataElementOptions(0)),s=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,a,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}z(Nr,"id","line"),z(Nr,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),z(Nr,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Fr extends Ee{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,r=this.chart,i=r.data.labels||[],a=Or(e._parsed[t].r,r.options.locale);return{label:i[t]||"",value:a}}parseObjectData(t,e,r,i){return Wc.bind(this)(t,e,r,i)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((r,i)=>{const a=this.getParsed(i).r;!isNaN(a)&&this.chart.getDataVisibility(i)&&(a<e.min&&(e.min=a),a>e.max&&(e.max=a))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,r=t.options,i=Math.min(e.right-e.left,e.bottom-e.top),a=Math.max(i/2,0),s=Math.max(r.cutoutPercentage?a/100*r.cutoutPercentage:1,0),o=(a-s)/t.getVisibleDatasetCount();this.outerRadius=a-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,r,i){const a=i==="reset",s=this.chart,l=s.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,f=c.getIndexAngle(0)-.5*ft;let g=f,v;const x=360/this.countVisibleElements();for(v=0;v<e;++v)g+=this._computeAngle(v,i,x);for(v=e;v<e+r;v++){const p=t[v];let b=g,m=g+this._computeAngle(v,i,x),y=s.getDataVisibility(v)?c.getDistanceFromCenterForValue(this.getParsed(v).r):0;g=m,a&&(l.animateScale&&(y=0),l.animateRotate&&(b=m=f));const w={x:u,y:d,innerRadius:0,outerRadius:y,startAngle:b,endAngle:m,options:this.resolveDataElementOptions(v,p.active?"active":i)};this.updateElement(p,v,w,i)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((r,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++}),e}_computeAngle(t,e,r){return this.chart.getDataVisibility(t)?Gt(this.resolveDataElementOptions(t,e).angle||r):0}}z(Fr,"id","polarArea"),z(Fr,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),z(Fr,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:r,color:i}}=t.legend.options;return e.labels.map((a,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:a,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,e,r){r.chart.toggleDataVisibility(e.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class is extends mn{}z(is,"id","pie"),z(is,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Ei extends Ee{getLabelAndValue(t){const e=this._cachedMeta.vScale,r=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(r[e.axis])}}parseObjectData(t,e,r,i){return Wc.bind(this)(t,e,r,i)}update(t){const e=this._cachedMeta,r=e.dataset,i=e.data||[],a=e.iScale.getLabels();if(r.points=i,t!=="resize"){const s=this.resolveDatasetElementOptions(t);this.options.showLine||(s.borderWidth=0);const o={_loop:!0,_fullLoop:a.length===i.length,options:s};this.updateElement(r,void 0,o,t)}this.updateElements(i,0,i.length,t)}updateElements(t,e,r,i){const a=this._cachedMeta.rScale,s=i==="reset";for(let o=e;o<e+r;o++){const l=t[o],c=this.resolveDataElementOptions(o,l.active?"active":i),u=a.getPointPositionForValue(o,this.getParsed(o).r),d=s?a.xCenter:u.x,f=s?a.yCenter:u.y,g={x:d,y:f,angle:u.angle,skip:isNaN(d)||isNaN(f),options:c};this.updateElement(l,o,g,i)}}}z(Ei,"id","radar"),z(Ei,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),z(Ei,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Ai extends Ee{getLabelAndValue(t){const e=this._cachedMeta,r=this.chart.data.labels||[],{xScale:i,yScale:a}=e,s=this.getParsed(t),o=i.getLabelForValue(s.x),l=a.getLabelForValue(s.y);return{label:r[t]||"",value:"("+o+", "+l+")"}}update(t){const e=this._cachedMeta,{data:r=[]}=e,i=this.chart._animationsDisabled;let{start:a,count:s}=Mc(e,r,i);if(this._drawStart=a,this._drawCount=s,Dc(e)&&(a=0,s=r.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:o,_dataset:l}=e;o._chart=this.chart,o._datasetIndex=this.index,o._decimated=!!l._decimated,o.points=r;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(o,void 0,{animated:!i,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(r,a,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,r,i){const a=i==="reset",{iScale:s,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(e,i),d=this.getSharedOptions(u),f=this.includeOptions(i,d),g=s.axis,v=o.axis,{spanGaps:x,segment:p}=this.options,b=fn(x)?x:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||a||i==="none";let y=e>0&&this.getParsed(e-1);for(let w=e;w<e+r;++w){const T=t[w],S=this.getParsed(w),k=m?T:{},M=at(S[v]),D=k[g]=s.getPixelForValue(S[g],w),O=k[v]=a||M?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,S,l):S[v],w);k.skip=isNaN(D)||isNaN(O)||M,k.stop=w>0&&Math.abs(S[g]-y[g])>b,p&&(k.parsed=S,k.raw=c.data[w]),f&&(k.options=d||this.resolveDataElementOptions(w,T.active?"active":i)),m||this.updateElement(T,w,k,i),y=S}this.updateSharedOptions(d,i,u)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let o=0;for(let l=e.length-1;l>=0;--l)o=Math.max(o,e[l].size(this.resolveDataElementOptions(l))/2);return o>0&&o}const r=t.dataset,i=r.options&&r.options.borderWidth||0;if(!e.length)return i;const a=e[0].size(this.resolveDataElementOptions(0)),s=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(i,a,s)/2}}z(Ai,"id","scatter"),z(Ai,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),z(Ai,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Em=Object.freeze({__proto__:null,BarController:Ir,BubbleController:Pi,DoughnutController:mn,LineController:Nr,PieController:is,PolarAreaController:Fr,RadarController:Ei,ScatterController:Ai});function In(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class as{constructor(t){z(this,"options");this.options=t||{}}static override(t){Object.assign(as.prototype,t)}init(){}formats(){return In()}parse(){return In()}format(){return In()}add(){return In()}diff(){return In()}startOf(){return In()}endOf(){return In()}}var uu={_date:as};function Am(n,t,e,r){const{controller:i,data:a,_sorted:s}=n,o=i._cachedMeta.iScale;if(o&&t===o.axis&&t!=="r"&&s&&a.length){const l=o._reversePixels?np:Xe;if(r){if(i._sharedOptions){const c=a[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(a,t,e-u),f=l(a,t,e+u);return{lo:d.lo,hi:f.hi}}}}else return l(a,t,e)}return{lo:0,hi:a.length-1}}function Br(n,t,e,r,i){const a=n.getSortedVisibleDatasetMetas(),s=e[t];for(let o=0,l=a.length;o<l;++o){const{index:c,data:u}=a[o],{lo:d,hi:f}=Am(a[o],t,s,i);for(let g=d;g<=f;++g){const v=u[g];v.skip||r(v,c,g)}}}function Rm(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(r,i){const a=t?Math.abs(r.x-i.x):0,s=e?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(s,2))}}function ss(n,t,e,r,i){const a=[];return!i&&!n.isPointInArea(t)||Br(n,e,t,function(o,l,c){!i&&!Ge(o,n.chartArea,0)||o.inRange(t.x,t.y,r)&&a.push({element:o,datasetIndex:l,index:c})},!0),a}function Lm(n,t,e,r){let i=[];function a(s,o,l){const{startAngle:c,endAngle:u}=s.getProps(["startAngle","endAngle"],r),{angle:d}=yc(s,{x:t.x,y:t.y});kr(d,c,u)&&i.push({element:s,datasetIndex:o,index:l})}return Br(n,e,t,a),i}function Im(n,t,e,r,i,a){let s=[];const o=Rm(e);let l=Number.POSITIVE_INFINITY;function c(u,d,f){const g=u.inRange(t.x,t.y,i);if(r&&!g)return;const v=u.getCenterPoint(i);if(!(!!a||n.isPointInArea(v))&&!g)return;const p=o(t,v);p<l?(s=[{element:u,datasetIndex:d,index:f}],l=p):p===l&&s.push({element:u,datasetIndex:d,index:f})}return Br(n,e,t,c),s}function os(n,t,e,r,i,a){return!a&&!n.isPointInArea(t)?[]:e==="r"&&!r?Lm(n,t,e,i):Im(n,t,e,r,i,a)}function du(n,t,e,r,i){const a=[],s=e==="x"?"inXRange":"inYRange";let o=!1;return Br(n,e,t,(l,c,u)=>{l[s](t[e],i)&&(a.push({element:l,datasetIndex:c,index:u}),o=o||l.inRange(t.x,t.y,i))}),r&&!o?[]:a}var ls={evaluateInteractionItems:Br,modes:{index(n,t,e,r){const i=pn(t,n),a=e.axis||"x",s=e.includeInvisible||!1,o=e.intersect?ss(n,i,a,r,s):os(n,i,a,!1,r,s),l=[];return o.length?(n.getSortedVisibleDatasetMetas().forEach(c=>{const u=o[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(n,t,e,r){const i=pn(t,n),a=e.axis||"xy",s=e.includeInvisible||!1;let o=e.intersect?ss(n,i,a,r,s):os(n,i,a,!1,r,s);if(o.length>0){const l=o[0].datasetIndex,c=n.getDatasetMeta(l).data;o=[];for(let u=0;u<c.length;++u)o.push({element:c[u],datasetIndex:l,index:u})}return o},point(n,t,e,r){const i=pn(t,n),a=e.axis||"xy",s=e.includeInvisible||!1;return ss(n,i,a,r,s)},nearest(n,t,e,r){const i=pn(t,n),a=e.axis||"xy",s=e.includeInvisible||!1;return os(n,i,a,e.intersect,r,s)},x(n,t,e,r){const i=pn(t,n);return du(n,i,"x",e.intersect,r)},y(n,t,e,r){const i=pn(t,n);return du(n,i,"y",e.intersect,r)}}};const fu=["left","top","right","bottom"];function Ur(n,t){return n.filter(e=>e.pos===t)}function hu(n,t){return n.filter(e=>fu.indexOf(e.pos)===-1&&e.box.axis===t)}function Wr(n,t){return n.sort((e,r)=>{const i=t?r:e,a=t?e:r;return i.weight===a.weight?i.index-a.index:i.weight-a.weight})}function Nm(n){const t=[];let e,r,i,a,s,o;for(e=0,r=(n||[]).length;e<r;++e)i=n[e],{position:a,options:{stack:s,stackWeight:o=1}}=i,t.push({index:e,box:i,pos:a,horizontal:i.isHorizontal(),weight:i.weight,stack:s&&a+s,stackWeight:o});return t}function Fm(n){const t={};for(const e of n){const{stack:r,pos:i,stackWeight:a}=e;if(!r||!fu.includes(i))continue;const s=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=a}return t}function Bm(n,t){const e=Fm(n),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t;let a,s,o;for(a=0,s=n.length;a<s;++a){o=n[a];const{fullSize:l}=o.box,c=e[o.stack],u=c&&o.stackWeight/c.weight;o.horizontal?(o.width=u?u*r:l&&t.availableWidth,o.height=i):(o.width=r,o.height=u?u*i:l&&t.availableHeight)}return e}function Um(n){const t=Nm(n),e=Wr(t.filter(c=>c.box.fullSize),!0),r=Wr(Ur(t,"left"),!0),i=Wr(Ur(t,"right")),a=Wr(Ur(t,"top"),!0),s=Wr(Ur(t,"bottom")),o=hu(t,"x"),l=hu(t,"y");return{fullSize:e,leftAndTop:r.concat(a),rightAndBottom:i.concat(l).concat(s).concat(o),chartArea:Ur(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:a.concat(s).concat(o)}}function gu(n,t,e,r){return Math.max(n[e],t[e])+Math.max(n[r],t[r])}function pu(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function Wm(n,t,e,r){const{pos:i,box:a}=e,s=n.maxPadding;if(!ct(i)){e.size&&(n[i]-=e.size);const d=r[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?a.height:a.width),e.size=d.size/d.count,n[i]+=e.size}a.getPadding&&pu(s,a.getPadding());const o=Math.max(0,t.outerWidth-gu(s,n,"left","right")),l=Math.max(0,t.outerHeight-gu(s,n,"top","bottom")),c=o!==n.w,u=l!==n.h;return n.w=o,n.h=l,e.horizontal?{same:c,other:u}:{same:u,other:c}}function Ym(n){const t=n.maxPadding;function e(r){const i=Math.max(t[r]-n[r],0);return n[r]+=i,i}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function Hm(n,t){const e=t.maxPadding;function r(i){const a={left:0,top:0,right:0,bottom:0};return i.forEach(s=>{a[s]=Math.max(t[s],e[s])}),a}return r(n?["left","right"]:["top","bottom"])}function Yr(n,t,e,r){const i=[];let a,s,o,l,c,u;for(a=0,s=n.length,c=0;a<s;++a){o=n[a],l=o.box,l.update(o.width||t.w,o.height||t.h,Hm(o.horizontal,t));const{same:d,other:f}=Wm(t,e,o,r);c|=d&&i.length,u=u||f,l.fullSize||i.push(o)}return c&&Yr(i,t,e,r)||u}function Ri(n,t,e,r,i){n.top=e,n.left=t,n.right=t+r,n.bottom=e+i,n.width=r,n.height=i}function mu(n,t,e,r){const i=e.padding;let{x:a,y:s}=t;for(const o of n){const l=o.box,c=r[o.stack]||{count:1,placed:0,weight:1},u=o.stackWeight/c.weight||1;if(o.horizontal){const d=t.w*u,f=c.size||l.height;fe(c.start)&&(s=c.start),l.fullSize?Ri(l,i.left,s,e.outerWidth-i.right-i.left,f):Ri(l,t.left+c.placed,s,d,f),c.start=s,c.placed+=d,s=l.bottom}else{const d=t.h*u,f=c.size||l.width;fe(c.start)&&(a=c.start),l.fullSize?Ri(l,a,i.top,f,e.outerHeight-i.bottom-i.top):Ri(l,a,t.top+c.placed,f,d),c.start=a,c.placed+=d,a=l.right}}t.x=a,t.y=s}var ae={addBox(n,t){n.boxes||(n.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,r){if(!n)return;const i=Kt(n.options.layout.padding),a=Math.max(t-i.width,0),s=Math.max(e-i.height,0),o=Um(n.boxes),l=o.vertical,c=o.horizontal;Dt(n.boxes,x=>{typeof x.beforeLayout=="function"&&x.beforeLayout()});const u=l.reduce((x,p)=>p.box.options&&p.box.options.display===!1?x:x+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:i,availableWidth:a,availableHeight:s,vBoxMaxWidth:a/2/u,hBoxMaxHeight:s/2}),f=Object.assign({},i);pu(f,Kt(r));const g=Object.assign({maxPadding:f,w:a,h:s,x:i.left,y:i.top},i),v=Bm(l.concat(c),d);Yr(o.fullSize,g,d,v),Yr(l,g,d,v),Yr(c,g,d,v)&&Yr(l,g,d,v),Ym(g),mu(o.leftAndTop,g,d,v),g.x+=g.w,g.y+=g.h,mu(o.rightAndBottom,g,d,v),n.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},Dt(o.chartArea,x=>{const p=x.box;Object.assign(p,n.chartArea),p.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class bu{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,r){}removeEventListener(t,e,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,r,i){return e=Math.max(0,e||t.width),r=r||t.height,{width:e,height:Math.max(0,i?Math.floor(e/i):r)}}isAttached(t){return!0}updateConfig(t){}}class zm extends bu{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Li="$chartjs",$m={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},yu=n=>n===null||n==="";function jm(n,t){const e=n.style,r=n.getAttribute("height"),i=n.getAttribute("width");if(n[Li]={initial:{height:r,width:i,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",yu(i)){const a=zc(n,"width");a!==void 0&&(n.width=a)}if(yu(r))if(n.style.height==="")n.height=n.width/(t||2);else{const a=zc(n,"height");a!==void 0&&(n.height=a)}return n}const vu=Gp?{passive:!0}:!1;function Vm(n,t,e){n.addEventListener(t,e,vu)}function qm(n,t,e){n.canvas.removeEventListener(t,e,vu)}function Xm(n,t){const e=$m[n.type]||n.type,{x:r,y:i}=pn(n,t);return{type:e,chart:t,native:n,x:r!==void 0?r:null,y:i!==void 0?i:null}}function Ii(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function Gm(n,t,e){const r=n.canvas,i=new MutationObserver(a=>{let s=!1;for(const o of a)s=s||Ii(o.addedNodes,r),s=s&&!Ii(o.removedNodes,r);s&&e()});return i.observe(document,{childList:!0,subtree:!0}),i}function Km(n,t,e){const r=n.canvas,i=new MutationObserver(a=>{let s=!1;for(const o of a)s=s||Ii(o.removedNodes,r),s=s&&!Ii(o.addedNodes,r);s&&e()});return i.observe(document,{childList:!0,subtree:!0}),i}const Hr=new Map;let xu=0;function wu(){const n=window.devicePixelRatio;n!==xu&&(xu=n,Hr.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function Qm(n,t){Hr.size||window.addEventListener("resize",wu),Hr.set(n,t)}function Zm(n){Hr.delete(n),Hr.size||window.removeEventListener("resize",wu)}function Jm(n,t,e){const r=n.canvas,i=r&&Ja(r);if(!i)return;const a=Tc((o,l)=>{const c=i.clientWidth;e(o,l),c<i.clientWidth&&e()},window),s=new ResizeObserver(o=>{const l=o[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||a(c,u)});return s.observe(i),Qm(n,a),s}function cs(n,t,e){e&&e.disconnect(),t==="resize"&&Zm(n)}function t0(n,t,e){const r=n.canvas,i=Tc(a=>{n.ctx!==null&&e(Xm(a,n))},n);return Vm(r,t,i),i}class e0 extends bu{acquireContext(t,e){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(jm(t,e),r):null}releaseContext(t){const e=t.canvas;if(!e[Li])return!1;const r=e[Li].initial;["height","width"].forEach(a=>{const s=r[a];at(s)?e.removeAttribute(a):e.setAttribute(a,s)});const i=r.style||{};return Object.keys(i).forEach(a=>{e.style[a]=i[a]}),e.width=e.width,delete e[Li],!0}addEventListener(t,e,r){this.removeEventListener(t,e);const i=t.$proxies||(t.$proxies={}),s={attach:Gm,detach:Km,resize:Jm}[e]||t0;i[e]=s(t,e,r)}removeEventListener(t,e){const r=t.$proxies||(t.$proxies={}),i=r[e];if(!i)return;({attach:cs,detach:cs,resize:cs}[e]||qm)(t,e,i),r[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,r,i){return Xp(t,e,r,i)}isAttached(t){const e=Ja(t);return!!(e&&e.isConnected)}}function n0(n){return!Za()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?zm:e0}class ee{constructor(){z(this,"x");z(this,"y");z(this,"active",!1);z(this,"options");z(this,"$animations")}tooltipPosition(t){const{x:e,y:r}=this.getProps(["x","y"],t);return{x:e,y:r}}hasValue(){return fn(this.x)&&fn(this.y)}getProps(t,e){const r=this.$animations;if(!e||!r)return this;const i={};return t.forEach(a=>{i[a]=r[a]&&r[a].active()?r[a]._to:this[a]}),i}}z(ee,"defaults",{}),z(ee,"defaultRoutes");function r0(n,t){const e=n.options.ticks,r=i0(n),i=Math.min(e.maxTicksLimit||r,r),a=e.major.enabled?s0(t):[],s=a.length,o=a[0],l=a[s-1],c=[];if(s>i)return o0(t,c,a,s/i),c;const u=a0(a,t,i);if(s>0){let d,f;const g=s>1?Math.round((l-o)/(s-1)):null;for(Ni(t,c,u,at(g)?0:o-g,o),d=0,f=s-1;d<f;d++)Ni(t,c,u,a[d],a[d+1]);return Ni(t,c,u,l,at(g)?t.length:l+g),c}return Ni(t,c,u),c}function i0(n){const t=n.options.offset,e=n._tickSize(),r=n._length/e+(t?0:1),i=n._maxLength/e;return Math.floor(Math.min(r,i))}function a0(n,t,e){const r=l0(n),i=t.length/e;if(!r)return Math.max(i,1);const a=Zg(r);for(let s=0,o=a.length-1;s<o;s++){const l=a[s];if(l>i)return l}return Math.max(i,1)}function s0(n){const t=[];let e,r;for(e=0,r=n.length;e<r;e++)n[e].major&&t.push(e);return t}function o0(n,t,e,r){let i=0,a=e[0],s;for(r=Math.ceil(r),s=0;s<n.length;s++)s===a&&(t.push(n[s]),i++,a=e[i*r])}function Ni(n,t,e,r,i){const a=rt(r,0),s=Math.min(rt(i,n.length),n.length);let o=0,l,c,u;for(e=Math.ceil(e),i&&(l=i-r,e=l/Math.floor(l/e)),u=a;u<0;)o++,u=Math.round(a+o*e);for(c=Math.max(a,0);c<s;c++)c===u&&(t.push(n[c]),o++,u=Math.round(a+o*e))}function l0(n){const t=n.length;let e,r;if(t<2)return!1;for(r=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==r)return!1;return r}const c0=n=>n==="left"?"right":n==="right"?"left":n,_u=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,Tu=(n,t)=>Math.min(t||n,n);function Mu(n,t){const e=[],r=n.length/t,i=n.length;let a=0;for(;a<i;a+=r)e.push(n[Math.floor(a)]);return e}function u0(n,t,e){const r=n.ticks.length,i=Math.min(t,r-1),a=n._startPixel,s=n._endPixel,o=1e-6;let l=n.getPixelForTick(i),c;if(!(e&&(r===1?c=Math.max(l-a,s-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(i-1))/2,l+=i<t?c:-c,l<a-o||l>s+o)))return l}function d0(n,t){Dt(n,e=>{const r=e.gc,i=r.length/2;let a;if(i>t){for(a=0;a<i;++a)delete e.data[r[a]];r.splice(0,i)}})}function zr(n){return n.drawTicks?n.tickLength:0}function Du(n,t){if(!n.display)return 0;const e=Rt(n.font,t),r=Kt(n.padding);return(bt(n.text)?n.text.length:1)*e.lineHeight+r.height}function f0(n,t){return gn(n,{scale:t,type:"scale"})}function h0(n,t,e){return gn(n,{tick:e,index:t,type:"tick"})}function g0(n,t,e){let r=Ha(n);return(e&&t!=="right"||!e&&t==="right")&&(r=c0(r)),r}function p0(n,t,e,r){const{top:i,left:a,bottom:s,right:o,chart:l}=n,{chartArea:c,scales:u}=l;let d=0,f,g,v;const x=s-i,p=o-a;if(n.isHorizontal()){if(g=ie(r,a,o),ct(e)){const b=Object.keys(e)[0],m=e[b];v=u[b].getPixelForValue(m)+x-t}else e==="center"?v=(c.bottom+c.top)/2+x-t:v=_u(n,e,t);f=o-a}else{if(ct(e)){const b=Object.keys(e)[0],m=e[b];g=u[b].getPixelForValue(m)-p+t}else e==="center"?g=(c.left+c.right)/2-p+t:g=_u(n,e,t);v=ie(r,s,i),d=e==="left"?-At:At}return{titleX:g,titleY:v,maxWidth:f,rotation:d}}class Nn extends ee{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:r,_suggestedMax:i}=this;return t=xe(t,Number.POSITIVE_INFINITY),e=xe(e,Number.NEGATIVE_INFINITY),r=xe(r,Number.POSITIVE_INFINITY),i=xe(i,Number.NEGATIVE_INFINITY),{min:xe(t,r),max:xe(e,i),minDefined:Nt(t),maxDefined:Nt(e)}}getMinMax(t){let{min:e,max:r,minDefined:i,maxDefined:a}=this.getUserBounds(),s;if(i&&a)return{min:e,max:r};const o=this.getMatchingVisibleMetas();for(let l=0,c=o.length;l<c;++l)s=o[l].controller.getMinMax(this,t),i||(e=Math.min(e,s.min)),a||(r=Math.max(r,s.max));return e=a&&e>r?r:e,r=i&&e>r?e:r,{min:xe(e,xe(r,e)),max:xe(r,xe(e,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Mt(this.options.beforeUpdate,[this])}update(t,e,r){const{beginAtZero:i,grace:a,ticks:s}=this.options,o=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,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=Cp(this,a,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=o<this.ticks.length;this._convertTicksToLabels(l?Mu(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=r0(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,r;this.isHorizontal()?(e=this.left,r=this.right):(e=this.top,r=this.bottom,t=!t),this._startPixel=e,this._endPixel=r,this._reversePixels=t,this._length=r-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Mt(this.options.afterUpdate,[this])}beforeSetDimensions(){Mt(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(){Mt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Mt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Mt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let r,i,a;for(r=0,i=t.length;r<i;r++)a=t[r],a.label=Mt(e.callback,[a.value,r,t],this)}afterTickToLabelConversion(){Mt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Mt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,r=Tu(this.ticks.length,t.ticks.maxTicksLimit),i=e.minRotation||0,a=e.maxRotation;let s=i,o,l,c;if(!this._isVisible()||!e.display||i>=a||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,g=Zt(this.chart.width-d,0,this.maxWidth);o=t.offset?this.maxWidth/r:g/(r-1),d+6>o&&(o=g/(r-(t.offset?.5:1)),l=this.maxHeight-zr(t.grid)-e.padding-Du(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),s=_i(Math.min(Math.asin(Zt((u.highest.height+6)/o,-1,1)),Math.asin(Zt(l/c,-1,1))-Math.asin(Zt(f/c,-1,1)))),s=Math.max(i,Math.min(a,s))),this.labelRotation=s}afterCalculateLabelRotation(){Mt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Mt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:r,title:i,grid:a}}=this,s=this._isVisible(),o=this.isHorizontal();if(s){const l=Du(i,e.options.font);if(o?(t.width=this.maxWidth,t.height=zr(a)+l):(t.height=this.maxHeight,t.width=zr(a)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),g=r.padding*2,v=Gt(this.labelRotation),x=Math.cos(v),p=Math.sin(v);if(o){const b=r.mirror?0:p*d.width+x*f.height;t.height=Math.min(this.maxHeight,t.height+b+g)}else{const b=r.mirror?0:x*d.width+p*f.height;t.width=Math.min(this.maxWidth,t.width+b+g)}this._calculatePadding(c,u,p,x)}}this._handleMargins(),o?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,r,i){const{ticks:{align:a,padding:s},position:o}=this.options,l=this.labelRotation!==0,c=o!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,g=0;l?c?(f=i*t.width,g=r*e.height):(f=r*t.height,g=i*e.width):a==="start"?g=e.width:a==="end"?f=t.width:a!=="inner"&&(f=t.width/2,g=e.width/2),this.paddingLeft=Math.max((f-u+s)*this.width/(this.width-u),0),this.paddingRight=Math.max((g-d+s)*this.width/(this.width-d),0)}else{let u=e.height/2,d=t.height/2;a==="start"?(u=0,d=t.height):a==="end"&&(u=e.height,d=0),this.paddingTop=u+s,this.paddingBottom=d+s}}_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(){Mt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,r;for(e=0,r=t.length;e<r;e++)at(t[e].label)&&(t.splice(e,1),r--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let r=this.ticks;e<r.length&&(r=Mu(r,e)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,r){const{ctx:i,_longestTextCache:a}=this,s=[],o=[],l=Math.floor(e/Tu(e,r));let c=0,u=0,d,f,g,v,x,p,b,m,y,w,T;for(d=0;d<e;d+=l){if(v=t[d].label,x=this._resolveTickFontOptions(d),i.font=p=x.string,b=a[p]=a[p]||{data:{},gc:[]},m=x.lineHeight,y=w=0,!at(v)&&!bt(v))y=Di(i,b.data,b.gc,y,v),w=m;else if(bt(v))for(f=0,g=v.length;f<g;++f)T=v[f],!at(T)&&!bt(T)&&(y=Di(i,b.data,b.gc,y,T),w+=m);s.push(y),o.push(w),c=Math.max(y,c),u=Math.max(w,u)}d0(a,e);const S=s.indexOf(c),k=o.indexOf(u),M=D=>({width:s[D]||0,height:o[D]||0});return{first:M(0),last:M(e-1),widest:M(S),highest:M(k),widths:s,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return ep(this._alignToPixels?En(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const r=e[t];return r.$context||(r.$context=h0(this.getContext(),t,r))}return this.$context||(this.$context=f0(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Gt(this.labelRotation),r=Math.abs(Math.cos(e)),i=Math.abs(Math.sin(e)),a=this._getLabelSizes(),s=t.autoSkipPadding||0,o=a?a.widest.width+s:0,l=a?a.highest.height+s:0;return this.isHorizontal()?l*r>o*i?o/r:l/i:l*i<o*r?l/r:o/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,r=this.chart,i=this.options,{grid:a,position:s,border:o}=i,l=a.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=zr(a),g=[],v=o.setContext(this.getContext()),x=v.display?v.width:0,p=x/2,b=function(H){return En(r,H,x)};let m,y,w,T,S,k,M,D,O,P,A,F;if(s==="top")m=b(this.bottom),k=this.bottom-f,D=m-p,P=b(t.top)+p,F=t.bottom;else if(s==="bottom")m=b(this.top),P=t.top,F=b(t.bottom)-p,k=m+p,D=this.top+f;else if(s==="left")m=b(this.right),S=this.right-f,M=m-p,O=b(t.left)+p,A=t.right;else if(s==="right")m=b(this.left),O=t.left,A=b(t.right)-p,S=m+p,M=this.left+f;else if(e==="x"){if(s==="center")m=b((t.top+t.bottom)/2+.5);else if(ct(s)){const H=Object.keys(s)[0],I=s[H];m=b(this.chart.scales[H].getPixelForValue(I))}P=t.top,F=t.bottom,k=m+p,D=k+f}else if(e==="y"){if(s==="center")m=b((t.left+t.right)/2);else if(ct(s)){const H=Object.keys(s)[0],I=s[H];m=b(this.chart.scales[H].getPixelForValue(I))}S=m-p,M=S-f,O=t.left,A=t.right}const q=rt(i.ticks.maxTicksLimit,d),$=Math.max(1,Math.ceil(d/q));for(y=0;y<d;y+=$){const H=this.getContext(y),I=a.setContext(H),it=o.setContext(H),U=I.lineWidth,yt=I.color,dt=it.dash||[],Y=it.dashOffset,L=I.tickWidth,B=I.tickColor,j=I.tickBorderDash||[],Z=I.tickBorderDashOffset;w=u0(this,y,l),w!==void 0&&(T=En(r,w,U),c?S=M=O=A=T:k=D=P=F=T,g.push({tx1:S,ty1:k,tx2:M,ty2:D,x1:O,y1:P,x2:A,y2:F,width:U,color:yt,borderDash:dt,borderDashOffset:Y,tickWidth:L,tickColor:B,tickBorderDash:j,tickBorderDashOffset:Z}))}return this._ticksLength=d,this._borderValue=m,g}_computeLabelItems(t){const e=this.axis,r=this.options,{position:i,ticks:a}=r,s=this.isHorizontal(),o=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=a,f=zr(r.grid),g=f+u,v=d?-u:g,x=-Gt(this.labelRotation),p=[];let b,m,y,w,T,S,k,M,D,O,P,A,F="middle";if(i==="top")S=this.bottom-v,k=this._getXAxisLabelAlignment();else if(i==="bottom")S=this.top+v,k=this._getXAxisLabelAlignment();else if(i==="left"){const $=this._getYAxisLabelAlignment(f);k=$.textAlign,T=$.x}else if(i==="right"){const $=this._getYAxisLabelAlignment(f);k=$.textAlign,T=$.x}else if(e==="x"){if(i==="center")S=(t.top+t.bottom)/2+g;else if(ct(i)){const $=Object.keys(i)[0],H=i[$];S=this.chart.scales[$].getPixelForValue(H)+g}k=this._getXAxisLabelAlignment()}else if(e==="y"){if(i==="center")T=(t.left+t.right)/2-g;else if(ct(i)){const $=Object.keys(i)[0],H=i[$];T=this.chart.scales[$].getPixelForValue(H)}k=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?F="top":l==="end"&&(F="bottom"));const q=this._getLabelSizes();for(b=0,m=o.length;b<m;++b){y=o[b],w=y.label;const $=a.setContext(this.getContext(b));M=this.getPixelForTick(b)+a.labelOffset,D=this._resolveTickFontOptions(b),O=D.lineHeight,P=bt(w)?w.length:1;const H=P/2,I=$.color,it=$.textStrokeColor,U=$.textStrokeWidth;let yt=k;s?(T=M,k==="inner"&&(b===m-1?yt=this.options.reverse?"left":"right":b===0?yt=this.options.reverse?"right":"left":yt="center"),i==="top"?c==="near"||x!==0?A=-P*O+O/2:c==="center"?A=-q.highest.height/2-H*O+O:A=-q.highest.height+O/2:c==="near"||x!==0?A=O/2:c==="center"?A=q.highest.height/2-H*O:A=q.highest.height-P*O,d&&(A*=-1),x!==0&&!$.showLabelBackdrop&&(T+=O/2*Math.sin(x))):(S=M,A=(1-P)*O/2);let dt;if($.showLabelBackdrop){const Y=Kt($.backdropPadding),L=q.heights[b],B=q.widths[b];let j=A-Y.top,Z=0-Y.left;switch(F){case"middle":j-=L/2;break;case"bottom":j-=L;break}switch(k){case"center":Z-=B/2;break;case"right":Z-=B;break;case"inner":b===m-1?Z-=B:b>0&&(Z-=B/2);break}dt={left:Z,top:j,width:B+Y.width,height:L+Y.height,color:$.backdropColor}}p.push({label:w,font:D,textOffset:A,options:{rotation:x,color:I,strokeColor:it,strokeWidth:U,textAlign:yt,textBaseline:F,translation:[T,S],backdrop:dt}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Gt(this.labelRotation))return t==="top"?"left":"right";let i="center";return e.align==="start"?i="left":e.align==="end"?i="right":e.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:r,mirror:i,padding:a}}=this.options,s=this._getLabelSizes(),o=t+a,l=s.widest.width;let c,u;return e==="left"?i?(u=this.right+a,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-o,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):e==="right"?i?(u=this.left+a,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+o,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;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:r,top:i,width:a,height:s}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(r,i,a,s),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex(a=>a.value===t);return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const e=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let a,s;const o=(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(e.display)for(a=0,s=i.length;a<s;++a){const l=i[a];e.drawOnChartArea&&o({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&o({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:r,grid:i}}=this,a=r.setContext(this.getContext()),s=r.display?a.width:0;if(!s)return;const o=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,f;this.isHorizontal()?(c=En(t,this.left,s)-s/2,u=En(t,this.right,o)+o/2,d=f=l):(d=En(t,this.top,s)-s/2,f=En(t,this.bottom,o)+o/2,c=u=l),e.save(),e.lineWidth=a.width,e.strokeStyle=a.color,e.beginPath(),e.moveTo(c,d),e.lineTo(u,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&Er(r,i);const a=this.getLabelItems(t);for(const s of a){const o=s.options,l=s.font,c=s.label,u=s.textOffset;An(r,c,0,u,l,o)}i&&Ar(r)}drawTitle(){const{ctx:t,options:{position:e,title:r,reverse:i}}=this;if(!r.display)return;const a=Rt(r.font),s=Kt(r.padding),o=r.align;let l=a.lineHeight/2;e==="bottom"||e==="center"||ct(e)?(l+=s.bottom,bt(r.text)&&(l+=a.lineHeight*(r.text.length-1))):l+=s.top;const{titleX:c,titleY:u,maxWidth:d,rotation:f}=p0(this,l,e,o);An(t,r.text,0,0,a,{color:r.color,maxWidth:d,rotation:f,textAlign:g0(o,e,i),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,r=rt(t.grid&&t.grid.z,-1),i=rt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Nn.prototype.draw?[{z:e,draw:a=>{this.draw(a)}}]:[{z:r,draw:a=>{this.drawBackground(),this.drawGrid(a),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:e,draw:a=>{this.drawLabels(a)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let a,s;for(a=0,s=e.length;a<s;++a){const o=e[a];o[r]===this.id&&(!t||o.type===t)&&i.push(o)}return i}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return Rt(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Fi{constructor(t,e,r){this.type=t,this.scope=e,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let r;y0(e)&&(r=this.register(e));const i=this.items,a=t.id,s=this.scope+"."+a;if(!a)throw new Error("class does not have id: "+t);return a in i||(i[a]=t,m0(t,s,r),this.override&&Ut.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const e=this.items,r=t.id,i=this.scope;r in e&&delete e[r],i&&r in Ut[i]&&(delete Ut[i][r],this.override&&delete Pn[r])}}function m0(n,t,e){const r=Mr(Object.create(null),[e?Ut.get(e):{},Ut.get(t),n.defaults]);Ut.set(t,r),n.defaultRoutes&&b0(t,n.defaultRoutes),n.descriptors&&Ut.describe(t,n.descriptors)}function b0(n,t){Object.keys(t).forEach(e=>{const r=e.split("."),i=r.pop(),a=[n].concat(r).join("."),s=t[e].split("."),o=s.pop(),l=s.join(".");Ut.route(a,i,l,o)})}function y0(n){return"id"in n&&"defaults"in n}class v0{constructor(){this.controllers=new Fi(Ee,"datasets",!0),this.elements=new Fi(ee,"elements"),this.plugins=new Fi(Object,"plugins"),this.scales=new Fi(Nn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,r){[...e].forEach(i=>{const a=r||this._getRegistryForType(i);r||a.isForType(i)||a===this.plugins&&i.id?this._exec(t,a,i):Dt(i,s=>{const o=r||this._getRegistryForType(s);this._exec(t,o,s)})})}_exec(t,e,r){const i=Ua(t);Mt(r["before"+i],[],r),e[t](r),Mt(r["after"+i],[],r)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const r=this._typedRegistries[e];if(r.isForType(t))return r}return this.plugins}_get(t,e,r){const i=e.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return i}}var Fe=new v0;class x0{constructor(){this._init=[]}notify(t,e,r,i){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const a=i?this._descriptors(t).filter(i):this._descriptors(t),s=this._notify(a,t,e,r);return e==="afterDestroy"&&(this._notify(a,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,e,r,i){i=i||{};for(const a of t){const s=a.plugin,o=s[r],l=[e,i,a.options];if(Mt(o,l,s)===!1&&i.cancelable)return!1}return!0}invalidate(){at(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const r=t&&t.config,i=rt(r.options&&r.options.plugins,{}),a=w0(r);return i===!1&&!e?[]:T0(t,a,i,e)}_notifyStateChanges(t){const e=this._oldCache||[],r=this._cache,i=(a,s)=>a.filter(o=>!s.some(l=>o.plugin.id===l.plugin.id));this._notify(i(e,r),t,"stop"),this._notify(i(r,e),t,"start")}}function w0(n){const t={},e=[],r=Object.keys(Fe.plugins.items);for(let a=0;a<r.length;a++)e.push(Fe.getPlugin(r[a]));const i=n.plugins||[];for(let a=0;a<i.length;a++){const s=i[a];e.indexOf(s)===-1&&(e.push(s),t[s.id]=!0)}return{plugins:e,localIds:t}}function _0(n,t){return!t&&n===!1?null:n===!0?{}:n}function T0(n,{plugins:t,localIds:e},r,i){const a=[],s=n.getContext();for(const o of t){const l=o.id,c=_0(r[l],i);c!==null&&a.push({plugin:o,options:M0(n.config,{plugin:o,local:e[l]},c,s)})}return a}function M0(n,{plugin:t,local:e},r,i){const a=n.pluginScopeKeys(t),s=n.getOptionScopes(r,a);return e&&t.defaults&&s.push(t.defaults),n.createResolver(s,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function us(n,t){const e=Ut.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function D0(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function C0(n,t){return n===t?"_index_":"_value_"}function Cu(n){if(n==="x"||n==="y"||n==="r")return n}function k0(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function ds(n,...t){if(Cu(n))return n;for(const e of t){const r=e.axis||k0(e.position)||n.length>1&&Cu(n[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function ku(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function S0(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(r=>r.xAxisID===n||r.yAxisID===n);if(e.length)return ku(n,"x",e[0])||ku(n,"y",e[0])}return{}}function O0(n,t){const e=Pn[n.type]||{scales:{}},r=t.scales||{},i=us(n.type,t),a=Object.create(null);return Object.keys(r).forEach(s=>{const o=r[s];if(!ct(o))return console.error(`Invalid scale configuration for scale: ${s}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const l=ds(s,o,S0(s,n),Ut.scales[o.type]),c=C0(l,i),u=e.scales||{};a[s]=Dr(Object.create(null),[{axis:l},o,u[l],u[c]])}),n.data.datasets.forEach(s=>{const o=s.type||n.type,l=s.indexAxis||us(o,t),u=(Pn[o]||{}).scales||{};Object.keys(u).forEach(d=>{const f=D0(d,l),g=s[f+"AxisID"]||f;a[g]=a[g]||Object.create(null),Dr(a[g],[{axis:f},r[g],u[d]])})}),Object.keys(a).forEach(s=>{const o=a[s];Dr(o,[Ut.scales[o.type],Ut.scale])}),a}function Su(n){const t=n.options||(n.options={});t.plugins=rt(t.plugins,{}),t.scales=O0(n,t)}function Ou(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function P0(n){return n=n||{},n.data=Ou(n.data),Su(n),n}const Pu=new Map,Eu=new Set;function Bi(n,t){let e=Pu.get(n);return e||(e=t(),Pu.set(n,e),Eu.add(e)),e}const $r=(n,t,e)=>{const r=un(t,e);r!==void 0&&n.add(r)};class E0{constructor(t){this._config=P0(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Ou(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Su(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Bi(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Bi(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Bi(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,r=this.type;return Bi(`${r}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const r=this._scopeCache;let i=r.get(t);return(!i||e)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,e,r){const{options:i,type:a}=this,s=this._cachedScopes(t,r),o=s.get(e);if(o)return o;const l=new Set;e.forEach(u=>{t&&(l.add(t),u.forEach(d=>$r(l,t,d))),u.forEach(d=>$r(l,i,d)),u.forEach(d=>$r(l,Pn[a]||{},d)),u.forEach(d=>$r(l,Ut,d)),u.forEach(d=>$r(l,ja,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Eu.has(e)&&s.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Pn[e]||{},Ut.datasets[e]||{},{type:e},Ut,ja]}resolveNamedOptions(t,e,r,i=[""]){const a={$shared:!0},{resolver:s,subPrefixes:o}=Au(this._resolverCache,t,i);let l=s;if(R0(s,e)){a.$shared=!1,r=he(r)?r():r;const c=this.createResolver(t,r,o);l=nr(s,r,c)}for(const c of e)a[c]=l[c];return a}createResolver(t,e,r=[""],i){const{resolver:a}=Au(this._resolverCache,t,r);return ct(e)?nr(a,e,void 0,i):a}}function Au(n,t,e){let r=n.get(t);r||(r=new Map,n.set(t,r));const i=e.join();let a=r.get(i);return a||(a={resolver:Ga(t,e),subPrefixes:e.filter(o=>!o.toLowerCase().includes("hover"))},r.set(i,a)),a}const A0=n=>ct(n)&&Object.getOwnPropertyNames(n).some(t=>he(n[t]));function R0(n,t){const{isScriptable:e,isIndexable:r}=Lc(n);for(const i of t){const a=e(i),s=r(i),o=(s||a)&&n[i];if(a&&(he(o)||A0(o))||s&&bt(o))return!0}return!1}var L0="4.4.1";const I0=["top","bottom","left","right","chartArea"];function Ru(n,t){return n==="top"||n==="bottom"||I0.indexOf(n)===-1&&t==="x"}function Lu(n,t){return function(e,r){return e[n]===r[n]?e[t]-r[t]:e[n]-r[n]}}function Iu(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),Mt(e&&e.onComplete,[n],t)}function N0(n){const t=n.chart,e=t.options.animation;Mt(e&&e.onProgress,[n],t)}function Nu(n){return Za()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Ui={},Fu=n=>{const t=Nu(n);return Object.values(Ui).filter(e=>e.canvas===t).pop()};function F0(n,t,e){const r=Object.keys(n);for(const i of r){const a=+i;if(a>=t){const s=n[i];delete n[i],(e>0||a>t)&&(n[a+e]=s)}}}function B0(n,t,e,r){return!e||n.type==="mouseout"?null:r?t:n}function Wi(n,t,e){return n.options.clip?n[e]:t[e]}function U0(n,t){const{xScale:e,yScale:r}=n;return e&&r?{left:Wi(e,t,"left"),right:Wi(e,t,"right"),top:Wi(r,t,"top"),bottom:Wi(r,t,"bottom")}:t}let De=(Cn=class{static register(...t){Fe.add(...t),Bu()}static unregister(...t){Fe.remove(...t),Bu()}constructor(t,e){const r=this.config=new E0(e),i=Nu(t),a=Fu(i);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas with ID '"+a.canvas.id+"' can be reused.");const s=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||n0(i)),this.platform.updateConfig(r);const o=this.platform.acquireContext(i,s.aspectRatio),l=o&&o.canvas,c=l&&l.height,u=l&&l.width;if(this.id=$g(),this.ctx=o,this.canvas=l,this.width=u,this.height=c,this._options=s,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 x0,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=ap(d=>this.update(d),s.resizeDelay||0),this._dataChanges=[],Ui[this.id]=this,!o||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Ke.listen(this,"complete",Iu),Ke.listen(this,"progress",N0),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:r,height:i,_aspectRatio:a}=this;return at(t)?e&&a?a:i?r/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Fe}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Hc(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Ec(this.canvas,this.ctx),this}stop(){return Ke.stop(this),this}resize(t,e){Ke.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const r=this.options,i=this.canvas,a=r.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(i,t,e,a),o=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,Hc(this,o,!0)&&(this.notifyPlugins("resize",{size:s}),Mt(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};Dt(e,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,e=t.scales,r=this.scales,i=Object.keys(r).reduce((s,o)=>(s[o]=!1,s),{});let a=[];e&&(a=a.concat(Object.keys(e).map(s=>{const o=e[s],l=ds(s,o),c=l==="r",u=l==="x";return{options:o,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Dt(a,s=>{const o=s.options,l=o.id,c=ds(l,o),u=rt(o.type,s.dtype);(o.position===void 0||Ru(o.position,c)!==Ru(s.dposition))&&(o.position=s.dposition),i[l]=!0;let d=null;if(l in r&&r[l].type===u)d=r[l];else{const f=Fe.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(o,t)}),Dt(i,(s,o)=>{s||delete r[o]}),Dt(r,s=>{ae.configure(this,s,s.options),ae.addBox(this,s)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,r=t.length;if(t.sort((i,a)=>i.index-a.index),r>e){for(let i=e;i<r;++i)this._destroyDatasetMeta(i);t.splice(e,r-e)}this._sortedMetasets=t.slice(0).sort(Lu("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((r,i)=>{e.filter(a=>a===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=e.length;r<i;r++){const a=e[r];let s=this.getDatasetMeta(r);const o=a.type||this.config.type;if(s.type&&s.type!==o&&(this._destroyDatasetMeta(r),s=this.getDatasetMeta(r)),s.type=o,s.indexAxis=a.indexAxis||us(o,this.options),s.order=a.order||0,s.index=r,s.label=""+a.label,s.visible=this.isDatasetVisible(r),s.controller)s.controller.updateIndex(r),s.controller.linkScales();else{const l=Fe.getController(o),{datasetElementType:c,dataElementType:u}=Ut.datasets[o];Object.assign(l,{dataElementType:Fe.getElement(u),datasetElementType:c&&Fe.getElement(c)}),s.controller=new l(this,r),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){Dt(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const r=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),f=!i&&a.indexOf(d)===-1;d.buildOrUpdateElements(f),s=Math.max(+d.getMaxOverflow(),s)}s=this._minPadding=r.layout.autoPadding?s:0,this._updateLayout(s),i||Dt(a,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Lu("z","_idx"));const{_active:o,_lastEvent:l}=this;l?this._eventHandler(l,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){Dt(this.scales,t=>{ae.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!gc(e,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:a}of e){const s=r==="_removeElements"?-a:a;F0(t,i,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,r=a=>new Set(t.filter(s=>s[0]===a).map((s,o)=>o+","+s.splice(1).join(","))),i=r(0);for(let a=1;a<e;a++)if(!gc(i,r(a)))return;return Array.from(i).map(a=>a.split(",")).map(a=>({method:a[1],start:+a[2],count:+a[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;ae.update(this,this.width,this.height,t);const e=this.chartArea,r=e.width<=0||e.height<=0;this._layers=[],Dt(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,a)=>{i._idx=a}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,r=this.data.datasets.length;e<r;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,r=this.data.datasets.length;e<r;++e)this._updateDataset(e,he(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const r=this.getDatasetMeta(t),i={meta:r,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(r.controller._update(e),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Ke.has(this)?this.attached&&!Ke.running(this)&&Ke.start(this):(this.draw(),Iu({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resize(r,i),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,r=[];let i,a;for(i=0,a=e.length;i<a;++i){const s=e[i];(!t||s.visible)&&r.push(s)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,r=t._clip,i=!r.disabled,a=U0(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(i&&Er(e,{left:r.left===!1?0:a.left-r.left,right:r.right===!1?this.width:a.right+r.right,top:r.top===!1?0:a.top-r.top,bottom:r.bottom===!1?this.height:a.bottom+r.bottom}),t.controller.draw(),i&&Ar(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return Ge(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,r,i){const a=ls.modes[e];return typeof a=="function"?a(this,t,r,i):[]}getDatasetMeta(t){const e=this.data.datasets[t],r=this._metasets;let i=r.filter(a=>a&&a._dataset===e).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},r.push(i)),i}getContext(){return this.$context||(this.$context=gn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!e.hidden}setDatasetVisibility(t,e){const r=this.getDatasetMeta(t);r.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,r){const i=r?"show":"hide",a=this.getDatasetMeta(t),s=a.controller._resolveAnimations(void 0,i);fe(e)?(a.data[e].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),s.update(a,{visible:r}),this.update(o=>o.datasetIndex===t?i:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Ke.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Ec(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Ui[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,r=(a,s)=>{e.addEventListener(this,a,s),t[a]=s},i=(a,s,o)=>{a.offsetX=s,a.offsetY=o,this._eventHandler(a)};Dt(this.options.events,a=>r(a,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,r=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},i=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},a=(l,c)=>{this.canvas&&this.resize(l,c)};let s;const o=()=>{i("attach",o),this.attached=!0,this.resize(),r("resize",a),r("detach",s)};s=()=>{this.attached=!1,i("resize",a),this._stop(),this._resize(0,0),r("attach",o)},e.isAttached(this.canvas)?o():s()}unbindEvents(){Dt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Dt(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,r){const i=r?"set":"remove";let a,s,o,l;for(e==="dataset"&&(a=this.getDatasetMeta(t[0].datasetIndex),a.controller["_"+i+"DatasetHoverStyle"]()),o=0,l=t.length;o<l;++o){s=t[o];const c=s&&this.getDatasetMeta(s.datasetIndex).controller;c&&c[i+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],r=t.map(({datasetIndex:a,index:s})=>{const o=this.getDatasetMeta(a);if(!o)throw new Error("No dataset found at index "+a);return{datasetIndex:a,element:o.data[s],index:s}});!yi(r,e)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,e))}notifyPlugins(t,e,r){return this._plugins.notify(this,t,e,r)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,r){const i=this.options.hover,a=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),s=a(e,t),o=r?t:a(t,e);s.length&&this.updateHoverStyle(s,i.mode,!1),o.length&&i.mode&&this.updateHoverStyle(o,i.mode,!0)}_eventHandler(t,e){const r={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},i=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const a=this._handleEvent(t,e,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(a||r.changed)&&this.render(),this}_handleEvent(t,e,r){const{_active:i=[],options:a}=this,s=e,o=this._getActiveElements(t,i,r,s),l=Kg(t),c=B0(t,this._lastEvent,r,l);r&&(this._lastEvent=null,Mt(a.onHover,[t,o,this],this),l&&Mt(a.onClick,[t,o,this],this));const u=!yi(o,i);return(u||e)&&(this._active=o,this._updateHoverStyles(o,i,e)),this._lastEvent=c,u}_getActiveElements(t,e,r,i){if(t.type==="mouseout")return[];if(!r)return e;const a=this.options.hover;return this.getElementsAtEventForMode(t,a.mode,a,i)}},z(Cn,"defaults",Ut),z(Cn,"instances",Ui),z(Cn,"overrides",Pn),z(Cn,"registry",Fe),z(Cn,"version",L0),z(Cn,"getChart",Fu),Cn);function Bu(){return Dt(De.instances,n=>n._plugins.invalidate())}function W0(n,t,e){const{startAngle:r,pixelMargin:i,x:a,y:s,outerRadius:o,innerRadius:l}=t;let c=i/o;n.beginPath(),n.arc(a,s,o,r-c,e+c),l>i?(c=i/l,n.arc(a,s,l,e+c,r-c,!0)):n.arc(a,s,i,e+At,r-At),n.closePath(),n.clip()}function Y0(n){return Xa(n,["outerStart","outerEnd","innerStart","innerEnd"])}function H0(n,t,e,r){const i=Y0(n.options.borderRadius),a=(e-t)/2,s=Math.min(a,r*t/2),o=l=>{const c=(e-Math.min(a,l))*r/2;return Zt(l,0,Math.min(a,c))};return{outerStart:o(i.outerStart),outerEnd:o(i.outerEnd),innerStart:Zt(i.innerStart,0,s),innerEnd:Zt(i.innerEnd,0,s)}}function ar(n,t,e,r){return{x:e+n*Math.cos(t),y:r+n*Math.sin(t)}}function Yi(n,t,e,r,i,a){const{x:s,y:o,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+r+e-c,0),f=u>0?u+r+e+c:0;let g=0;const v=i-l;if(r){const $=u>0?u-r:0,H=d>0?d-r:0,I=($+H)/2,it=I!==0?v*I/(I+r):v;g=(v-it)/2}const x=Math.max(.001,v*d-e/ft)/d,p=(v-x)/2,b=l+p+g,m=i-p-g,{outerStart:y,outerEnd:w,innerStart:T,innerEnd:S}=H0(t,f,d,m-b),k=d-y,M=d-w,D=b+y/k,O=m-w/M,P=f+T,A=f+S,F=b+T/P,q=m-S/A;if(n.beginPath(),a){const $=(D+O)/2;if(n.arc(s,o,d,D,$),n.arc(s,o,d,$,O),w>0){const U=ar(M,O,s,o);n.arc(U.x,U.y,w,O,m+At)}const H=ar(A,m,s,o);if(n.lineTo(H.x,H.y),S>0){const U=ar(A,q,s,o);n.arc(U.x,U.y,S,m+At,q+Math.PI)}const I=(m-S/f+(b+T/f))/2;if(n.arc(s,o,f,m-S/f,I,!0),n.arc(s,o,f,I,b+T/f,!0),T>0){const U=ar(P,F,s,o);n.arc(U.x,U.y,T,F+Math.PI,b-At)}const it=ar(k,b,s,o);if(n.lineTo(it.x,it.y),y>0){const U=ar(k,D,s,o);n.arc(U.x,U.y,y,b-At,D)}}else{n.moveTo(s,o);const $=Math.cos(D)*d+s,H=Math.sin(D)*d+o;n.lineTo($,H);const I=Math.cos(O)*d+s,it=Math.sin(O)*d+o;n.lineTo(I,it)}n.closePath()}function z0(n,t,e,r,i){const{fullCircles:a,startAngle:s,circumference:o}=t;let l=t.endAngle;if(a){Yi(n,t,e,r,l,i);for(let c=0;c<a;++c)n.fill();isNaN(o)||(l=s+(o%Ot||Ot))}return Yi(n,t,e,r,l,i),n.fill(),l}function $0(n,t,e,r,i){const{fullCircles:a,startAngle:s,circumference:o,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:f}=l,g=l.borderAlign==="inner";if(!c)return;n.setLineDash(d||[]),n.lineDashOffset=f,g?(n.lineWidth=c*2,n.lineJoin=u||"round"):(n.lineWidth=c,n.lineJoin=u||"bevel");let v=t.endAngle;if(a){Yi(n,t,e,r,v,i);for(let x=0;x<a;++x)n.stroke();isNaN(o)||(v=s+(o%Ot||Ot))}g&&W0(n,t,v),a||(Yi(n,t,e,r,v,i),n.stroke())}class jr extends ee{constructor(e){super();z(this,"circumference");z(this,"endAngle");z(this,"fullCircles");z(this,"innerRadius");z(this,"outerRadius");z(this,"pixelMargin");z(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,r,i){const a=this.getProps(["x","y"],i),{angle:s,distance:o}=yc(a,{x:e,y:r}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),g=(this.options.spacing+this.options.borderWidth)/2,x=rt(f,c-l)>=Ot||kr(s,l,c),p=qe(o,u+g,d+g);return x&&p}getCenterPoint(e){const{x:r,y:i,startAngle:a,endAngle:s,innerRadius:o,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:u}=this.options,d=(a+s)/2,f=(o+l+u+c)/2;return{x:r+Math.cos(d)*f,y:i+Math.sin(d)*f}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:r,circumference:i}=this,a=(r.offset||0)/4,s=(r.spacing||0)/2,o=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=i>Ot?Math.floor(i/Ot):0,i===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*a,Math.sin(l)*a);const c=1-Math.sin(Math.min(ft,i||0)),u=a*c;e.fillStyle=r.backgroundColor,e.strokeStyle=r.borderColor,z0(e,this,u,s,o),$0(e,this,u,s,o),e.restore()}}z(jr,"id","arc"),z(jr,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),z(jr,"defaultRoutes",{backgroundColor:"backgroundColor"}),z(jr,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Uu(n,t,e=t){n.lineCap=rt(e.borderCapStyle,t.borderCapStyle),n.setLineDash(rt(e.borderDash,t.borderDash)),n.lineDashOffset=rt(e.borderDashOffset,t.borderDashOffset),n.lineJoin=rt(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=rt(e.borderWidth,t.borderWidth),n.strokeStyle=rt(e.borderColor,t.borderColor)}function j0(n,t,e){n.lineTo(e.x,e.y)}function V0(n){return n.stepped?bp:n.tension||n.cubicInterpolationMode==="monotone"?yp:j0}function Wu(n,t,e={}){const r=n.length,{start:i=0,end:a=r-1}=e,{start:s,end:o}=t,l=Math.max(i,s),c=Math.min(a,o),u=i<s&&a<s||i>o&&a>o;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function q0(n,t,e,r){const{points:i,options:a}=t,{count:s,start:o,loop:l,ilen:c}=Wu(i,e,r),u=V0(a);let{move:d=!0,reverse:f}=r||{},g,v,x;for(g=0;g<=c;++g)v=i[(o+(f?c-g:g))%s],!v.skip&&(d?(n.moveTo(v.x,v.y),d=!1):u(n,x,v,f,a.stepped),x=v);return l&&(v=i[(o+(f?c:0))%s],u(n,x,v,f,a.stepped)),!!l}function X0(n,t,e,r){const i=t.points,{count:a,start:s,ilen:o}=Wu(i,e,r),{move:l=!0,reverse:c}=r||{};let u=0,d=0,f,g,v,x,p,b;const m=w=>(s+(c?o-w:w))%a,y=()=>{x!==p&&(n.lineTo(u,p),n.lineTo(u,x),n.lineTo(u,b))};for(l&&(g=i[m(0)],n.moveTo(g.x,g.y)),f=0;f<=o;++f){if(g=i[m(f)],g.skip)continue;const w=g.x,T=g.y,S=w|0;S===v?(T<x?x=T:T>p&&(p=T),u=(d*u+w)/++d):(y(),n.lineTo(w,T),v=S,d=0,x=p=T),b=T}y()}function fs(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?X0:q0}function G0(n){return n.stepped?Kp:n.tension||n.cubicInterpolationMode==="monotone"?Qp:Ln}function K0(n,t,e,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,e,r)&&i.closePath()),Uu(n,t.options),n.stroke(i)}function Q0(n,t,e,r){const{segments:i,options:a}=t,s=fs(t);for(const o of i)Uu(n,a,o.style),n.beginPath(),s(n,t,o,{start:e,end:e+r-1})&&n.closePath(),n.stroke()}const Z0=typeof Path2D=="function";function J0(n,t,e,r){Z0&&!t.options.segment?K0(n,t,e,r):Q0(n,t,e,r)}class bn extends ee{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const i=r.spanGaps?this._loop:this._fullLoop;Hp(this._points,r,t,i,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=rm(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,r=t.length;return r&&e[t[r-1].end]}interpolate(t,e){const r=this.options,i=t[e],a=this.points,s=Gc(this,{property:e,start:i,end:i});if(!s.length)return;const o=[],l=G0(r);let c,u;for(c=0,u=s.length;c<u;++c){const{start:d,end:f}=s[c],g=a[d],v=a[f];if(g===v){o.push(g);continue}const x=Math.abs((i-g[e])/(v[e]-g[e])),p=l(g,v,x,r.stepped);p[e]=t[e],o.push(p)}return o.length===1?o[0]:o}pathSegment(t,e,r){return fs(this)(t,this,e,r)}path(t,e,r){const i=this.segments,a=fs(this);let s=this._loop;e=e||0,r=r||this.points.length-e;for(const o of i)s&=a(t,this,o,{start:e,end:e+r-1});return!!s}draw(t,e,r,i){const a=this.options||{};(this.points||[]).length&&a.borderWidth&&(t.save(),J0(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}z(bn,"id","line"),z(bn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),z(bn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),z(bn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Yu(n,t,e,r){const i=n.options,{[e]:a}=n.getProps([e],r);return Math.abs(t-a)<i.radius+i.hitRadius}class Hi extends ee{constructor(e){super();z(this,"parsed");z(this,"skip");z(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,r,i){const a=this.options,{x:s,y:o}=this.getProps(["x","y"],i);return Math.pow(e-s,2)+Math.pow(r-o,2)<Math.pow(a.hitRadius+a.radius,2)}inXRange(e,r){return Yu(this,e,"x",r)}inYRange(e,r){return Yu(this,e,"y",r)}getCenterPoint(e){const{x:r,y:i}=this.getProps(["x","y"],e);return{x:r,y:i}}size(e){e=e||this.options||{};let r=e.radius||0;r=Math.max(r,r&&e.hoverRadius||0);const i=r&&e.borderWidth||0;return(r+i)*2}draw(e,r){const i=this.options;this.skip||i.radius<.1||!Ge(this,r,this.size(i)/2)||(e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.fillStyle=i.backgroundColor,qa(e,i,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}z(Hi,"id","point"),z(Hi,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),z(Hi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Hu(n,t){const{x:e,y:r,base:i,width:a,height:s}=n.getProps(["x","y","base","width","height"],t);let o,l,c,u,d;return n.horizontal?(d=s/2,o=Math.min(e,i),l=Math.max(e,i),c=r-d,u=r+d):(d=a/2,o=e-d,l=e+d,c=Math.min(r,i),u=Math.max(r,i)),{left:o,top:c,right:l,bottom:u}}function yn(n,t,e,r){return n?0:Zt(t,e,r)}function tb(n,t,e){const r=n.options.borderWidth,i=n.borderSkipped,a=Rc(r);return{t:yn(i.top,a.top,0,e),r:yn(i.right,a.right,0,t),b:yn(i.bottom,a.bottom,0,e),l:yn(i.left,a.left,0,t)}}function eb(n,t,e){const{enableBorderRadius:r}=n.getProps(["enableBorderRadius"]),i=n.options.borderRadius,a=hn(i),s=Math.min(t,e),o=n.borderSkipped,l=r||ct(i);return{topLeft:yn(!l||o.top||o.left,a.topLeft,0,s),topRight:yn(!l||o.top||o.right,a.topRight,0,s),bottomLeft:yn(!l||o.bottom||o.left,a.bottomLeft,0,s),bottomRight:yn(!l||o.bottom||o.right,a.bottomRight,0,s)}}function nb(n){const t=Hu(n),e=t.right-t.left,r=t.bottom-t.top,i=tb(n,e/2,r/2),a=eb(n,e/2,r/2);return{outer:{x:t.left,y:t.top,w:e,h:r,radius:a},inner:{x:t.left+i.l,y:t.top+i.t,w:e-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,a.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,a.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,a.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,a.bottomRight-Math.max(i.b,i.r))}}}}function hs(n,t,e,r){const i=t===null,a=e===null,o=n&&!(i&&a)&&Hu(n,r);return o&&(i||qe(t,o.left,o.right))&&(a||qe(e,o.top,o.bottom))}function rb(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function ib(n,t){n.rect(t.x,t.y,t.w,t.h)}function gs(n,t,e={}){const r=n.x!==e.x?-t:0,i=n.y!==e.y?-t:0,a=(n.x+n.w!==e.x+e.w?t:0)-r,s=(n.y+n.h!==e.y+e.h?t:0)-i;return{x:n.x+r,y:n.y+i,w:n.w+a,h:n.h+s,radius:n.radius}}class zi extends ee{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:r,backgroundColor:i}}=this,{inner:a,outer:s}=nb(this),o=rb(s.radius)?er:ib;t.save(),(s.w!==a.w||s.h!==a.h)&&(t.beginPath(),o(t,gs(s,e,a)),t.clip(),o(t,gs(a,-e,s)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),o(t,gs(a,e)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,e,r){return hs(this,t,e,r)}inXRange(t,e){return hs(this,t,null,e)}inYRange(t,e){return hs(this,null,t,e)}getCenterPoint(t){const{x:e,y:r,base:i,horizontal:a}=this.getProps(["x","y","base","horizontal"],t);return{x:a?(e+i)/2:e,y:a?r:(r+i)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}z(zi,"id","bar"),z(zi,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),z(zi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var ab=Object.freeze({__proto__:null,ArcElement:jr,BarElement:zi,LineElement:bn,PointElement:Hi});const ps=["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)"],zu=ps.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function $u(n){return ps[n%ps.length]}function ju(n){return zu[n%zu.length]}function sb(n,t){return n.borderColor=$u(t),n.backgroundColor=ju(t),++t}function ob(n,t){return n.backgroundColor=n.data.map(()=>$u(t++)),t}function lb(n,t){return n.backgroundColor=n.data.map(()=>ju(t++)),t}function cb(n){let t=0;return(e,r)=>{const i=n.getDatasetMeta(r).controller;i instanceof mn?t=ob(e,t):i instanceof Fr?t=lb(e,t):i&&(t=sb(e,t))}}function Vu(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function ub(n){return n&&(n.borderColor||n.backgroundColor)}var db={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:r},options:i}=n.config,{elements:a}=i;if(!e.forceOverride&&(Vu(r)||ub(i)||a&&Vu(a)))return;const s=cb(n);r.forEach(s)}};function fb(n,t,e,r,i){const a=i.samples||r;if(a>=e)return n.slice(t,t+e);const s=[],o=(e-2)/(a-2);let l=0;const c=t+e-1;let u=t,d,f,g,v,x;for(s[l++]=n[u],d=0;d<a-2;d++){let p=0,b=0,m;const y=Math.floor((d+1)*o)+1+t,w=Math.min(Math.floor((d+2)*o)+1,e)+t,T=w-y;for(m=y;m<w;m++)p+=n[m].x,b+=n[m].y;p/=T,b/=T;const S=Math.floor(d*o)+1+t,k=Math.min(Math.floor((d+1)*o)+1,e)+t,{x:M,y:D}=n[u];for(g=v=-1,m=S;m<k;m++)v=.5*Math.abs((M-p)*(n[m].y-D)-(M-n[m].x)*(b-D)),v>g&&(g=v,f=n[m],x=m);s[l++]=f,u=x}return s[l++]=n[c],s}function hb(n,t,e,r){let i=0,a=0,s,o,l,c,u,d,f,g,v,x;const p=[],b=t+e-1,m=n[t].x,w=n[b].x-m;for(s=t;s<t+e;++s){o=n[s],l=(o.x-m)/w*r,c=o.y;const T=l|0;if(T===u)c<v?(v=c,d=s):c>x&&(x=c,f=s),i=(a*i+o.x)/++a;else{const S=s-1;if(!at(d)&&!at(f)){const k=Math.min(d,f),M=Math.max(d,f);k!==g&&k!==S&&p.push({...n[k],x:i}),M!==g&&M!==S&&p.push({...n[M],x:i})}s>0&&S!==g&&p.push(n[S]),p.push(o),u=T,a=0,v=x=c,d=f=g=s}}return p}function qu(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Xu(n){n.data.datasets.forEach(t=>{qu(t)})}function gb(n,t){const e=t.length;let r=0,i;const{iScale:a}=n,{min:s,max:o,minDefined:l,maxDefined:c}=a.getUserBounds();return l&&(r=Zt(Xe(t,a.axis,s).lo,0,e-1)),c?i=Zt(Xe(t,a.axis,o).hi+1,r,e)-r:i=e-r,{start:r,count:i}}var pb={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){Xu(n);return}const r=n.width;n.data.datasets.forEach((i,a)=>{const{_data:s,indexAxis:o}=i,l=n.getDatasetMeta(a),c=s||i.data;if(Rr([o,n.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=n.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||n.options.parsing)return;let{start:d,count:f}=gb(l,c);const g=e.threshold||4*r;if(f<=g){qu(i);return}at(s)&&(i._data=c,delete i.data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(x){this._data=x}}));let v;switch(e.algorithm){case"lttb":v=fb(c,d,f,r,e);break;case"min-max":v=hb(c,d,f,r);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}i._decimated=v})},destroy(n){Xu(n)}};function mb(n,t,e){const r=n.segments,i=n.points,a=t.points,s=[];for(const o of r){let{start:l,end:c}=o;c=bs(l,c,i);const u=ms(e,i[l],i[c],o.loop);if(!t.segments){s.push({source:o,target:u,start:i[l],end:i[c]});continue}const d=Gc(t,u);for(const f of d){const g=ms(e,a[f.start],a[f.end],f.loop),v=Xc(o,i,g);for(const x of v)s.push({source:x,target:f,start:{[e]:Gu(u,g,"start",Math.max)},end:{[e]:Gu(u,g,"end",Math.min)}})}}return s}function ms(n,t,e,r){if(r)return;let i=t[n],a=e[n];return n==="angle"&&(i=we(i),a=we(a)),{property:n,start:i,end:a}}function bb(n,t){const{x:e=null,y:r=null}=n||{},i=t.points,a=[];return t.segments.forEach(({start:s,end:o})=>{o=bs(s,o,i);const l=i[s],c=i[o];r!==null?(a.push({x:l.x,y:r}),a.push({x:c.x,y:r})):e!==null&&(a.push({x:e,y:l.y}),a.push({x:e,y:c.y}))}),a}function bs(n,t,e){for(;t>n;t--){const r=e[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function Gu(n,t,e,r){return n&&t?r(n[e],t[e]):n?n[e]:t?t[e]:0}function Ku(n,t){let e=[],r=!1;return bt(n)?(r=!0,e=n):e=bb(n,t),e.length?new bn({points:e,options:{tension:0},_loop:r,_fullLoop:r}):null}function Qu(n){return n&&n.fill!==!1}function yb(n,t,e){let i=n[t].fill;const a=[t];let s;if(!e)return i;for(;i!==!1&&a.indexOf(i)===-1;){if(!Nt(i))return i;if(s=n[i],!s)return!1;if(s.visible)return i;a.push(i),i=s.fill}return!1}function vb(n,t,e){const r=Tb(n);if(ct(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return Nt(i)&&Math.floor(i)===i?xb(r[0],t,i,e):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function xb(n,t,e,r){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=r?!1:e}function wb(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:ct(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function _b(n,t,e){let r;return n==="start"?r=e:n==="end"?r=t.options.reverse?t.min:t.max:ct(n)?r=n.value:r=t.getBaseValue(),r}function Tb(n){const t=n.options,e=t.fill;let r=rt(e&&e.target,e);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function Mb(n){const{scale:t,index:e,line:r}=n,i=[],a=r.segments,s=r.points,o=Db(t,e);o.push(Ku({x:null,y:t.bottom},r));for(let l=0;l<a.length;l++){const c=a[l];for(let u=c.start;u<=c.end;u++)Cb(i,s[u],o)}return new bn({points:i,options:{}})}function Db(n,t){const e=[],r=n.getMatchingVisibleMetas("line");for(let i=0;i<r.length;i++){const a=r[i];if(a.index===t)break;a.hidden||e.unshift(a.dataset)}return e}function Cb(n,t,e){const r=[];for(let i=0;i<e.length;i++){const a=e[i],{first:s,last:o,point:l}=kb(a,t,"x");if(!(!l||s&&o)){if(s)r.unshift(l);else if(n.push(l),!o)break}}n.push(...r)}function kb(n,t,e){const r=n.interpolate(t,e);if(!r)return{};const i=r[e],a=n.segments,s=n.points;let o=!1,l=!1;for(let c=0;c<a.length;c++){const u=a[c],d=s[u.start][e],f=s[u.end][e];if(qe(i,d,f)){o=i===d,l=i===f;break}}return{first:o,last:l,point:r}}class Zu{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,r){const{x:i,y:a,radius:s}=this;return e=e||{start:0,end:Ot},t.arc(i,a,s,e.end,e.start,!0),!r.bounds}interpolate(t){const{x:e,y:r,radius:i}=this,a=t.angle;return{x:e+Math.cos(a)*i,y:r+Math.sin(a)*i,angle:a}}}function Sb(n){const{chart:t,fill:e,line:r}=n;if(Nt(e))return Ob(t,e);if(e==="stack")return Mb(n);if(e==="shape")return!0;const i=Pb(n);return i instanceof Zu?i:Ku(i,r)}function Ob(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function Pb(n){return(n.scale||{}).getPointPositionForValue?Ab(n):Eb(n)}function Eb(n){const{scale:t={},fill:e}=n,r=wb(e,t);if(Nt(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function Ab(n){const{scale:t,fill:e}=n,r=t.options,i=t.getLabels().length,a=r.reverse?t.max:t.min,s=_b(e,t,a),o=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,a);return new Zu({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(s)})}for(let l=0;l<i;++l)o.push(t.getPointPositionForValue(l,s));return o}function ys(n,t,e){const r=Sb(t),{line:i,scale:a,axis:s}=t,o=i.options,l=o.fill,c=o.backgroundColor,{above:u=c,below:d=c}=l||{};r&&i.points.length&&(Er(n,e),Rb(n,{line:i,target:r,above:u,below:d,area:e,scale:a,axis:s}),Ar(n))}function Rb(n,t){const{line:e,target:r,above:i,below:a,area:s,scale:o}=t,l=e._loop?"angle":t.axis;n.save(),l==="x"&&a!==i&&(Ju(n,r,s.top),td(n,{line:e,target:r,color:i,scale:o,property:l}),n.restore(),n.save(),Ju(n,r,s.bottom)),td(n,{line:e,target:r,color:a,scale:o,property:l}),n.restore()}function Ju(n,t,e){const{segments:r,points:i}=t;let a=!0,s=!1;n.beginPath();for(const o of r){const{start:l,end:c}=o,u=i[l],d=i[bs(l,c,i)];a?(n.moveTo(u.x,u.y),a=!1):(n.lineTo(u.x,e),n.lineTo(u.x,u.y)),s=!!t.pathSegment(n,o,{move:s}),s?n.closePath():n.lineTo(d.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function td(n,t){const{line:e,target:r,property:i,color:a,scale:s}=t,o=mb(e,r,i);for(const{source:l,target:c,start:u,end:d}of o){const{style:{backgroundColor:f=a}={}}=l,g=r!==!0;n.save(),n.fillStyle=f,Lb(n,s,g&&ms(i,u,d)),n.beginPath();const v=!!e.pathSegment(n,l);let x;if(g){v?n.closePath():ed(n,r,d,i);const p=!!r.pathSegment(n,c,{move:v,reverse:!0});x=v&&p,x||ed(n,r,u,i)}n.closePath(),n.fill(x?"evenodd":"nonzero"),n.restore()}}function Lb(n,t,e){const{top:r,bottom:i}=t.chart.chartArea,{property:a,start:s,end:o}=e||{};a==="x"&&(n.beginPath(),n.rect(s,r,o-s,i-r),n.clip())}function ed(n,t,e,r){const i=t.interpolate(e,r);i&&n.lineTo(i.x,i.y)}var Ib={id:"filler",afterDatasetsUpdate(n,t,e){const r=(n.data.datasets||[]).length,i=[];let a,s,o,l;for(s=0;s<r;++s)a=n.getDatasetMeta(s),o=a.dataset,l=null,o&&o.options&&o instanceof bn&&(l={visible:n.isDatasetVisible(s),index:s,fill:vb(o,s,r),chart:n,axis:a.controller.options.indexAxis,scale:a.vScale,line:o}),a.$filler=l,i.push(l);for(s=0;s<r;++s)l=i[s],!(!l||l.fill===!1)&&(l.fill=yb(i,s,e.propagate))},beforeDraw(n,t,e){const r=e.drawTime==="beforeDraw",i=n.getSortedVisibleDatasetMetas(),a=n.chartArea;for(let s=i.length-1;s>=0;--s){const o=i[s].$filler;o&&(o.line.updateControlPoints(a,o.axis),r&&o.fill&&ys(n.ctx,o,a))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const r=n.getSortedVisibleDatasetMetas();for(let i=r.length-1;i>=0;--i){const a=r[i].$filler;Qu(a)&&ys(n.ctx,a,n.chartArea)}},beforeDatasetDraw(n,t,e){const r=t.meta.$filler;!Qu(r)||e.drawTime!=="beforeDatasetDraw"||ys(n.ctx,r,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const nd=(n,t)=>{let{boxHeight:e=t,boxWidth:r=t}=n;return n.usePointStyle&&(e=Math.min(e,t),r=n.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:e,itemHeight:Math.max(t,e)}},Nb=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class rd extends ee{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,r){this.maxWidth=t,this.maxHeight=e,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(){const t=this.options.labels||{};let e=Mt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(r=>t.filter(r,this.chart.data))),t.sort&&(e=e.sort((r,i)=>t.sort(r,i,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,i=Rt(r.font),a=i.size,s=this._computeTitleHeight(),{boxWidth:o,itemHeight:l}=nd(r,a);let c,u;e.font=i.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(s,a,o,l)+10):(u=this.maxHeight,c=this._fitCols(s,i,o,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,e,r,i){const{ctx:a,maxWidth:s,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=i+o;let d=t;a.textAlign="left",a.textBaseline="middle";let f=-1,g=-u;return this.legendItems.forEach((v,x)=>{const p=r+e/2+a.measureText(v.text).width;(x===0||c[c.length-1]+p+2*o>s)&&(d+=u,c[c.length-(x>0?0:1)]=0,g+=u,f++),l[x]={left:0,top:g,row:f,width:p,height:i},c[c.length-1]+=p+o}),d}_fitCols(t,e,r,i){const{ctx:a,maxHeight:s,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=s-t;let d=o,f=0,g=0,v=0,x=0;return this.legendItems.forEach((p,b)=>{const{itemWidth:m,itemHeight:y}=Fb(r,e,a,p,i);b>0&&g+y+2*o>u&&(d+=f+o,c.push({width:f,height:g}),v+=f+o,x++,f=g=0),l[b]={left:v,top:g,col:x,width:m,height:y},f=Math.max(f,m),g+=y+o}),d+=f,c.push({width:f,height:g}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:r,labels:{padding:i},rtl:a}}=this,s=ir(a,this.left,this.width);if(this.isHorizontal()){let o=0,l=ie(r,this.left+i,this.right-this.lineWidths[o]);for(const c of e)o!==c.row&&(o=c.row,l=ie(r,this.left+i,this.right-this.lineWidths[o])),c.top+=this.top+t+i,c.left=s.leftForLtr(s.x(l),c.width),l+=c.width+i}else{let o=0,l=ie(r,this.top+t+i,this.bottom-this.columnSizes[o].height);for(const c of e)c.col!==o&&(o=c.col,l=ie(r,this.top+t+i,this.bottom-this.columnSizes[o].height)),c.top=l,c.left+=this.left+i,c.left=s.leftForLtr(s.x(c.left),c.width),l+=c.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Er(t,this),this._draw(),Ar(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:r,ctx:i}=this,{align:a,labels:s}=t,o=Ut.color,l=ir(t.rtl,this.left,this.width),c=Rt(s.font),{padding:u}=s,d=c.size,f=d/2;let g;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;const{boxWidth:v,boxHeight:x,itemHeight:p}=nd(s,d),b=function(S,k,M){if(isNaN(v)||v<=0||isNaN(x)||x<0)return;i.save();const D=rt(M.lineWidth,1);if(i.fillStyle=rt(M.fillStyle,o),i.lineCap=rt(M.lineCap,"butt"),i.lineDashOffset=rt(M.lineDashOffset,0),i.lineJoin=rt(M.lineJoin,"miter"),i.lineWidth=D,i.strokeStyle=rt(M.strokeStyle,o),i.setLineDash(rt(M.lineDash,[])),s.usePointStyle){const O={radius:x*Math.SQRT2/2,pointStyle:M.pointStyle,rotation:M.rotation,borderWidth:D},P=l.xPlus(S,v/2),A=k+f;Ac(i,O,P,A,s.pointStyleWidth&&v)}else{const O=k+Math.max((d-x)/2,0),P=l.leftForLtr(S,v),A=hn(M.borderRadius);i.beginPath(),Object.values(A).some(F=>F!==0)?er(i,{x:P,y:O,w:v,h:x,radius:A}):i.rect(P,O,v,x),i.fill(),D!==0&&i.stroke()}i.restore()},m=function(S,k,M){An(i,M.text,S,k+p/2,c,{strikethrough:M.hidden,textAlign:l.textAlign(M.textAlign)})},y=this.isHorizontal(),w=this._computeTitleHeight();y?g={x:ie(a,this.left+u,this.right-r[0]),y:this.top+u+w,line:0}:g={x:this.left+u,y:ie(a,this.top+w+u,this.bottom-e[0].height),line:0},$c(this.ctx,t.textDirection);const T=p+u;this.legendItems.forEach((S,k)=>{i.strokeStyle=S.fontColor,i.fillStyle=S.fontColor;const M=i.measureText(S.text).width,D=l.textAlign(S.textAlign||(S.textAlign=s.textAlign)),O=v+f+M;let P=g.x,A=g.y;l.setWidth(this.width),y?k>0&&P+O+u>this.right&&(A=g.y+=T,g.line++,P=g.x=ie(a,this.left+u,this.right-r[g.line])):k>0&&A+T>this.bottom&&(P=g.x=P+e[g.line].width+u,g.line++,A=g.y=ie(a,this.top+w+u,this.bottom-e[g.line].height));const F=l.x(P);if(b(F,A,S),P=sp(D,P+v+f,y?P+O:this.right,t.rtl),m(l.x(P),A,S),y)g.x+=O+u;else if(typeof S.text!="string"){const q=c.lineHeight;g.y+=id(S,q)+u}else g.y+=T}),jc(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,r=Rt(e.font),i=Kt(e.padding);if(!e.display)return;const a=ir(t.rtl,this.left,this.width),s=this.ctx,o=e.position,l=r.size/2,c=i.top+l;let u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=ie(t.align,d,this.right-f);else{const v=this.columnSizes.reduce((x,p)=>Math.max(x,p.height),0);u=c+ie(t.align,this.top,this.bottom-v-t.labels.padding-this._computeTitleHeight())}const g=ie(o,d,d+f);s.textAlign=a.textAlign(Ha(o)),s.textBaseline="middle",s.strokeStyle=e.color,s.fillStyle=e.color,s.font=r.string,An(s,e.text,g,u,r)}_computeTitleHeight(){const t=this.options.title,e=Rt(t.font),r=Kt(t.padding);return t.display?e.lineHeight+r.height:0}_getLegendItemAt(t,e){let r,i,a;if(qe(t,this.left,this.right)&&qe(e,this.top,this.bottom)){for(a=this.legendHitBoxes,r=0;r<a.length;++r)if(i=a[r],qe(t,i.left,i.left+i.width)&&qe(e,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const e=this.options;if(!Wb(t.type,e))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,a=Nb(i,r);i&&!a&&Mt(e.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!a&&Mt(e.onHover,[t,r,this],this)}else r&&Mt(e.onClick,[t,r,this],this)}}function Fb(n,t,e,r,i){const a=Bb(r,n,t,e),s=Ub(i,r,t.lineHeight);return{itemWidth:a,itemHeight:s}}function Bb(n,t,e,r){let i=n.text;return i&&typeof i!="string"&&(i=i.reduce((a,s)=>a.length>s.length?a:s)),t+e.size/2+r.measureText(i).width}function Ub(n,t,e){let r=n;return typeof t.text!="string"&&(r=id(t,e)),r}function id(n,t){const e=n.text?n.text.length:0;return t*e}function Wb(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var Yb={id:"legend",_element:rd,start(n,t,e){const r=n.legend=new rd({ctx:n.ctx,options:e,chart:n});ae.configure(n,r,e),ae.addBox(n,r)},stop(n){ae.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const r=n.legend;ae.configure(n,r,e),r.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const r=t.datasetIndex,i=e.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:r,textAlign:i,color:a,useBorderRadius:s,borderRadius:o}}=n.legend.options;return n._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),u=Kt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:a,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:i||c.textAlign,borderRadius:s&&(o||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class vs extends ee{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const 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=t,this.height=this.bottom=e;const i=bt(r.text)?r.text.length:1;this._padding=Kt(r.padding);const a=i*Rt(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=a:this.width=a}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:r,bottom:i,right:a,options:s}=this,o=s.align;let l=0,c,u,d;return this.isHorizontal()?(u=ie(o,r,a),d=e+t,c=a-r):(s.position==="left"?(u=r+t,d=ie(o,i,e),l=ft*-.5):(u=a-t,d=ie(o,e,i),l=ft*.5),c=i-e),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const r=Rt(e.font),a=r.lineHeight/2+this._padding.top,{titleX:s,titleY:o,maxWidth:l,rotation:c}=this._drawArgs(a);An(t,e.text,0,0,r,{color:e.color,maxWidth:l,rotation:c,textAlign:Ha(e.align),textBaseline:"middle",translation:[s,o]})}}function Hb(n,t){const e=new vs({ctx:n.ctx,options:t,chart:n});ae.configure(n,e,t),ae.addBox(n,e),n.titleBlock=e}var zb={id:"title",_element:vs,start(n,t,e){Hb(n,e)},stop(n){const t=n.titleBlock;ae.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const r=n.titleBlock;ae.configure(n,r,e),r.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const $i=new WeakMap;var $b={id:"subtitle",start(n,t,e){const r=new vs({ctx:n.ctx,options:e,chart:n});ae.configure(n,r,e),ae.addBox(n,r),$i.set(n,r)},stop(n){ae.removeBox(n,$i.get(n)),$i.delete(n)},beforeUpdate(n,t,e){const r=$i.get(n);ae.configure(n,r,e),r.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Vr={average(n){if(!n.length)return!1;let t,e,r=0,i=0,a=0;for(t=0,e=n.length;t<e;++t){const s=n[t].element;if(s&&s.hasValue()){const o=s.tooltipPosition();r+=o.x,i+=o.y,++a}}return{x:r/a,y:i/a}},nearest(n,t){if(!n.length)return!1;let e=t.x,r=t.y,i=Number.POSITIVE_INFINITY,a,s,o;for(a=0,s=n.length;a<s;++a){const l=n[a].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=tr(t,c);u<i&&(i=u,o=l)}}if(o){const l=o.tooltipPosition();e=l.x,r=l.y}return{x:e,y:r}}};function Be(n,t){return t&&(bt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function Qe(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
17
17
  `)>-1?n.split(`
18
- `):n}function jb(n,t){const{element:e,datasetIndex:r,index:i}=t,a=n.getDatasetMeta(r).controller,{label:s,value:o}=a.getLabelAndValue(i);return{chart:n,label:s,parsed:a.getParsed(i),raw:n.data.datasets[r].data[i],formattedValue:o,dataset:a.getDataset(),dataIndex:i,datasetIndex:r,element:e}}function ad(n,t){const e=n.chart.ctx,{body:r,footer:i,title:a}=n,{boxWidth:s,boxHeight:o}=t,l=Rt(t.bodyFont),c=Rt(t.titleFont),u=Rt(t.footerFont),d=a.length,f=i.length,g=r.length,v=Kt(t.padding);let x=v.height,p=0,b=r.reduce((w,T)=>w+T.before.length+T.lines.length+T.after.length,0);if(b+=n.beforeBody.length+n.afterBody.length,d&&(x+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const w=t.displayColors?Math.max(o,l.lineHeight):l.lineHeight;x+=g*w+(b-g)*l.lineHeight+(b-1)*t.bodySpacing}f&&(x+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let m=0;const y=function(w){p=Math.max(p,e.measureText(w).width+m)};return e.save(),e.font=c.string,Dt(n.title,y),e.font=l.string,Dt(n.beforeBody.concat(n.afterBody),y),m=t.displayColors?s+2+t.boxPadding:0,Dt(r,w=>{Dt(w.before,y),Dt(w.lines,y),Dt(w.after,y)}),m=0,e.font=u.string,Dt(n.footer,y),e.restore(),p+=v.width,{width:p,height:x}}function Vb(n,t){const{y:e,height:r}=t;return e<r/2?"top":e>n.height-r/2?"bottom":"center"}function qb(n,t,e,r){const{x:i,width:a}=r,s=e.caretSize+e.caretPadding;if(n==="left"&&i+a+s>t.width||n==="right"&&i-a-s<0)return!0}function Xb(n,t,e,r){const{x:i,width:a}=e,{width:s,chartArea:{left:o,right:l}}=n;let c="center";return r==="center"?c=i<=(o+l)/2?"left":"right":i<=a/2?c="left":i>=s-a/2&&(c="right"),qb(c,n,t,e)&&(c="center"),c}function sd(n,t,e){const r=e.yAlign||t.yAlign||Vb(n,e);return{xAlign:e.xAlign||t.xAlign||Xb(n,t,e,r),yAlign:r}}function Gb(n,t){let{x:e,width:r}=n;return t==="right"?e-=r:t==="center"&&(e-=r/2),e}function Kb(n,t,e){let{y:r,height:i}=n;return t==="top"?r+=e:t==="bottom"?r-=i+e:r-=i/2,r}function od(n,t,e,r){const{caretSize:i,caretPadding:a,cornerRadius:s}=n,{xAlign:o,yAlign:l}=e,c=i+a,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:g}=hn(s);let v=Gb(t,o);const x=Kb(t,l,c);return l==="center"?o==="left"?v+=c:o==="right"&&(v-=c):o==="left"?v-=Math.max(u,f)+i:o==="right"&&(v+=Math.max(d,g)+i),{x:Zt(v,0,r.width-t.width),y:Zt(x,0,r.height-t.height)}}function ji(n,t,e){const r=Kt(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-r.right:n.x+r.left}function ld(n){return Be([],Qe(n))}function Qb(n,t,e){return gn(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function cd(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const ud={beforeTitle:Ve,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,r=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return e[t.dataIndex]}return""},afterTitle:Ve,beforeBody:Ve,beforeLabel:Ve,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return at(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Ve,afterBody:Ve,beforeFooter:Ve,footer:Ve,afterFooter:Ve};function ge(n,t,e,r){const i=n[t].call(e,r);return typeof i>"u"?ud[t].call(e,r):i}class xs extends ee{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&e.options.animation&&r.animations,a=new ts(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){return this.$context||(this.$context=Qb(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:r}=e,i=ge(r,"beforeTitle",this,t),a=ge(r,"title",this,t),s=ge(r,"afterTitle",this,t);let o=[];return o=Be(o,Qe(i)),o=Be(o,Qe(a)),o=Be(o,Qe(s)),o}getBeforeBody(t,e){return ld(ge(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:r}=e,i=[];return Dt(t,a=>{const s={before:[],lines:[],after:[]},o=cd(r,a);Be(s.before,Qe(ge(o,"beforeLabel",this,a))),Be(s.lines,ge(o,"label",this,a)),Be(s.after,Qe(ge(o,"afterLabel",this,a))),i.push(s)}),i}getAfterBody(t,e){return ld(ge(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:r}=e,i=ge(r,"beforeFooter",this,t),a=ge(r,"footer",this,t),s=ge(r,"afterFooter",this,t);let o=[];return o=Be(o,Qe(i)),o=Be(o,Qe(a)),o=Be(o,Qe(s)),o}_createItems(t){const e=this._active,r=this.chart.data,i=[],a=[],s=[];let o=[],l,c;for(l=0,c=e.length;l<c;++l)o.push(jb(this.chart,e[l]));return t.filter&&(o=o.filter((u,d,f)=>t.filter(u,d,f,r))),t.itemSort&&(o=o.sort((u,d)=>t.itemSort(u,d,r))),Dt(o,u=>{const d=cd(t.callbacks,u);i.push(ge(d,"labelColor",this,u)),a.push(ge(d,"labelPointStyle",this,u)),s.push(ge(d,"labelTextColor",this,u))}),this.labelColors=i,this.labelPointStyles=a,this.labelTextColors=s,this.dataPoints=o,o}update(t,e){const r=this.options.setContext(this.getContext()),i=this._active;let a,s=[];if(!i.length)this.opacity!==0&&(a={opacity:0});else{const o=Vr[r.position].call(this,i,this._eventPosition);s=this._createItems(r),this.title=this.getTitle(s,r),this.beforeBody=this.getBeforeBody(s,r),this.body=this.getBody(s,r),this.afterBody=this.getAfterBody(s,r),this.footer=this.getFooter(s,r);const l=this._size=ad(this,r),c=Object.assign({},o,l),u=sd(this.chart,r,c),d=od(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,a={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:o.x,caretY:o.y}}this._tooltipItems=s,this.$context=void 0,a&&this._resolveAnimations().update(this,a),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,r,i){const a=this.getCaretPosition(t,r,i);e.lineTo(a.x1,a.y1),e.lineTo(a.x2,a.y2),e.lineTo(a.x3,a.y3)}getCaretPosition(t,e,r){const{xAlign:i,yAlign:a}=this,{caretSize:s,cornerRadius:o}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=hn(o),{x:f,y:g}=t,{width:v,height:x}=e;let p,b,m,y,w,T;return a==="center"?(w=g+x/2,i==="left"?(p=f,b=p-s,y=w+s,T=w-s):(p=f+v,b=p+s,y=w-s,T=w+s),m=p):(i==="left"?b=f+Math.max(l,u)+s:i==="right"?b=f+v-Math.max(c,d)-s:b=this.caretX,a==="top"?(y=g,w=y-s,p=b-s,m=b+s):(y=g+x,w=y+s,p=b+s,m=b-s),T=y),{x1:p,x2:b,x3:m,y1:y,y2:w,y3:T}}drawTitle(t,e,r){const i=this.title,a=i.length;let s,o,l;if(a){const c=ir(r.rtl,this.x,this.width);for(t.x=ji(this,r.titleAlign,r),e.textAlign=c.textAlign(r.titleAlign),e.textBaseline="middle",s=Rt(r.titleFont),o=r.titleSpacing,e.fillStyle=r.titleColor,e.font=s.string,l=0;l<a;++l)e.fillText(i[l],c.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+o,l+1===a&&(t.y+=r.titleMarginBottom-o)}}_drawColorBox(t,e,r,i,a){const s=this.labelColors[r],o=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=a,u=Rt(a.bodyFont),d=ji(this,"left",a),f=i.x(d),g=l<u.lineHeight?(u.lineHeight-l)/2:0,v=e.y+g;if(a.usePointStyle){const x={radius:Math.min(c,l)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},p=i.leftForLtr(f,c)+c/2,b=v+l/2;t.strokeStyle=a.multiKeyBackground,t.fillStyle=a.multiKeyBackground,qa(t,x,p,b),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,qa(t,x,p,b)}else{t.lineWidth=lt(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,t.strokeStyle=s.borderColor,t.setLineDash(s.borderDash||[]),t.lineDashOffset=s.borderDashOffset||0;const x=i.leftForLtr(f,c),p=i.leftForLtr(i.xPlus(f,1),c-2),b=hn(s.borderRadius);Object.values(b).some(m=>m!==0)?(t.beginPath(),t.fillStyle=a.multiKeyBackground,er(t,{x,y:v,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),er(t,{x:p,y:v+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(x,v,c,l),t.strokeRect(x,v,c,l),t.fillStyle=s.backgroundColor,t.fillRect(p,v+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,e,r){const{body:i}=this,{bodySpacing:a,bodyAlign:s,displayColors:o,boxHeight:l,boxWidth:c,boxPadding:u}=r,d=Rt(r.bodyFont);let f=d.lineHeight,g=0;const v=ir(r.rtl,this.x,this.width),x=function(M){e.fillText(M,v.x(t.x+g),t.y+f/2),t.y+=f+a},p=v.textAlign(s);let b,m,y,w,T,S,k;for(e.textAlign=s,e.textBaseline="middle",e.font=d.string,t.x=ji(this,p,r),e.fillStyle=r.bodyColor,Dt(this.beforeBody,x),g=o&&p!=="right"?s==="center"?c/2+u:c+2+u:0,w=0,S=i.length;w<S;++w){for(b=i[w],m=this.labelTextColors[w],e.fillStyle=m,Dt(b.before,x),y=b.lines,o&&y.length&&(this._drawColorBox(e,t,w,v,r),f=Math.max(d.lineHeight,l)),T=0,k=y.length;T<k;++T)x(y[T]),f=d.lineHeight;Dt(b.after,x)}g=0,f=d.lineHeight,Dt(this.afterBody,x),t.y-=a}drawFooter(t,e,r){const i=this.footer,a=i.length;let s,o;if(a){const l=ir(r.rtl,this.x,this.width);for(t.x=ji(this,r.footerAlign,r),t.y+=r.footerMarginTop,e.textAlign=l.textAlign(r.footerAlign),e.textBaseline="middle",s=Rt(r.footerFont),e.fillStyle=r.footerColor,e.font=s.string,o=0;o<a;++o)e.fillText(i[o],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+r.footerSpacing}}drawBackground(t,e,r,i){const{xAlign:a,yAlign:s}=this,{x:o,y:l}=t,{width:c,height:u}=r,{topLeft:d,topRight:f,bottomLeft:g,bottomRight:v}=hn(i.cornerRadius);e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.beginPath(),e.moveTo(o+d,l),s==="top"&&this.drawCaret(t,e,r,i),e.lineTo(o+c-f,l),e.quadraticCurveTo(o+c,l,o+c,l+f),s==="center"&&a==="right"&&this.drawCaret(t,e,r,i),e.lineTo(o+c,l+u-v),e.quadraticCurveTo(o+c,l+u,o+c-v,l+u),s==="bottom"&&this.drawCaret(t,e,r,i),e.lineTo(o+g,l+u),e.quadraticCurveTo(o,l+u,o,l+u-g),s==="center"&&a==="left"&&this.drawCaret(t,e,r,i),e.lineTo(o,l+d),e.quadraticCurveTo(o,l,o+d,l),e.closePath(),e.fill(),i.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,r=this.$animations,i=r&&r.x,a=r&&r.y;if(i||a){const s=Vr[t.position].call(this,this._active,this._eventPosition);if(!s)return;const o=this._size=ad(this,t),l=Object.assign({},s,this._size),c=sd(e,t,l),u=od(t,l,c,e);(i._to!==u.x||a._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=o.width,this.height=o.height,this.caretX=s.x,this.caretY=s.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(e);const i={width:this.width,height:this.height},a={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const s=Kt(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=r,this.drawBackground(a,t,i,e),$c(t,e.textDirection),a.y+=s.top,this.drawTitle(a,t,e),this.drawBody(a,t,e),this.drawFooter(a,t,e),jc(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const r=this._active,i=t.map(({datasetIndex:o,index:l})=>{const c=this.chart.getDatasetMeta(o);if(!c)throw new Error("Cannot find a dataset at index "+o);return{datasetIndex:o,element:c.data[l],index:l}}),a=!yi(r,i),s=this._positionChanged(i,e);(a||s)&&(this._active=i,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,r=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,a=this._active||[],s=this._getActiveElements(t,a,e,r),o=this._positionChanged(s,t),l=e||!yi(s,a)||o;return l&&(this._active=s,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,r,i){const a=this.options;if(t.type==="mouseout")return[];if(!i)return e.filter(o=>this.chart.data.datasets[o.datasetIndex]&&this.chart.getDatasetMeta(o.datasetIndex).controller.getParsed(o.index)!==void 0);const s=this.chart.getElementsAtEventForMode(t,a.mode,a,r);return a.reverse&&s.reverse(),s}_positionChanged(t,e){const{caretX:r,caretY:i,options:a}=this,s=Vr[a.position].call(this,t,e);return s!==!1&&(r!==s.x||i!==s.y)}}z(xs,"positioners",Vr);var Vi={id:"tooltip",_element:xs,positioners:Vr,afterInit(n,t,e){e&&(n.tooltip=new xs({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:ud},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Zb=Object.freeze({__proto__:null,Colors:db,Decimation:pb,Filler:Ib,Legend:Yb,SubTitle:$b,Title:zb,Tooltip:Vi});const Jb=(n,t,e,r)=>(typeof t=="string"?(e=n.push(t)-1,r.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function ty(n,t,e,r){const i=n.indexOf(t);if(i===-1)return Jb(n,t,e,r);const a=n.lastIndexOf(t);return i!==a?e:i}const ey=(n,t)=>n===null?null:Zt(Math.round(n),0,t);function dd(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class ws extends Nn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const r=this.getLabels();for(const{index:i,label:a}of e)r[i]===a&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(at(t))return null;const r=this.getLabels();return e=isFinite(e)&&r[e]===t?e:ty(r,t,rt(e,t),this._addedLabels),ey(e,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),e||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,e=this.max,r=this.options.offset,i=[];let a=this.getLabels();a=t===0&&e===a.length-1?a:a.slice(t,e+1),this._valueRange=Math.max(a.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let s=t;s<=e;s++)i.push({value:s});return i}getLabelForValue(t){return dd.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}z(ws,"id","category"),z(ws,"defaults",{ticks:{callback:dd}});function ny(n,t){const e=[],{bounds:i,step:a,min:s,max:o,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=n,g=a||1,v=u-1,{min:x,max:p}=t,b=!at(s),m=!at(o),y=!at(c),w=(p-x)/(d+1);let T=pc((p-x)/v/g)*g,S,k,M,D;if(T<1e-14&&!b&&!m)return[{value:x},{value:p}];D=Math.ceil(p/T)-Math.floor(x/T),D>v&&(T=pc(D*T/v/g)*g),at(l)||(S=Math.pow(10,l),T=Math.ceil(T*S)/S),i==="ticks"?(k=Math.floor(x/T)*T,M=Math.ceil(p/T)*T):(k=x,M=p),b&&m&&a&&Jg((o-s)/a,T/1e3)?(D=Math.round(Math.min((o-s)/T,u)),T=(o-s)/D,k=s,M=o):y?(k=b?s:k,M=m?o:M,D=c-1,T=(M-k)/D):(D=(M-k)/T,Cr(D,Math.round(D),T/1e3)?D=Math.round(D):D=Math.ceil(D));const O=Math.max(bc(T),bc(k));S=Math.pow(10,at(l)?O:l),k=Math.round(k*S)/S,M=Math.round(M*S)/S;let P=0;for(b&&(f&&k!==s?(e.push({value:s}),k<s&&P++,Cr(Math.round((k+P*T)*S)/S,s,fd(s,w,n))&&P++):k<s&&P++);P<D;++P){const A=Math.round((k+P*T)*S)/S;if(m&&A>o)break;e.push({value:A})}return m&&f&&M!==o?e.length&&Cr(e[e.length-1].value,o,fd(o,w,n))?e[e.length-1].value=o:e.push({value:o}):(!m||M===o)&&e.push({value:M}),e}function fd(n,t,{horizontal:e,minRotation:r}){const i=Gt(r),a=(e?Math.sin(i):Math.cos(i))||.001,s=.75*t*(""+n).length;return Math.min(t/a,s)}class qi extends Nn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return at(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:r}=this.getUserBounds();let{min:i,max:a}=this;const s=l=>i=e?i:l,o=l=>a=r?a:l;if(t){const l=Ne(i),c=Ne(a);l<0&&c<0?o(0):l>0&&c>0&&s(0)}if(i===a){let l=a===0?1:Math.abs(a*.05);o(a+l),t||s(i-l)}this.min=i,this.max=a}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),e=e||11),e&&(i=Math.min(e,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},a=this._range||this,s=ny(i,a);return t.bounds==="ticks"&&mc(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let e=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-e)/Math.max(t.length-1,1)/2;e-=i,r+=i}this._startValue=e,this._endValue=r,this._valueRange=r-e}getLabelForValue(t){return Or(t,this.chart.options.locale,this.options.ticks.format)}}class _s extends qi{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Nt(t)?t:0,this.max=Nt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,r=Gt(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,a=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,a.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}z(_s,"id","linear"),z(_s,"defaults",{ticks:{callback:Mi.formatters.numeric}});const qr=n=>Math.floor(dn(n)),Fn=(n,t)=>Math.pow(10,qr(n)+t);function hd(n){return n/Math.pow(10,qr(n))===1}function gd(n,t,e){const r=Math.pow(10,e),i=Math.floor(n/r);return Math.ceil(t/r)-i}function ry(n,t){const e=t-n;let r=qr(e);for(;gd(n,t,r)>10;)r++;for(;gd(n,t,r)<10;)r--;return Math.min(r,qr(n))}function iy(n,{min:t,max:e}){t=xe(n.min,t);const r=[],i=qr(t);let a=ry(t,e),s=a<0?Math.pow(10,Math.abs(a)):1;const o=Math.pow(10,a),l=i>a?Math.pow(10,i):0,c=Math.round((t-l)*s)/s,u=Math.floor((t-l)/o/10)*o*10;let d=Math.floor((c-u)/Math.pow(10,a)),f=xe(n.min,Math.round((l+u+d*Math.pow(10,a))*s)/s);for(;f<e;)r.push({value:f,major:hd(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(a++,d=2,s=a>=0?1:s),f=Math.round((l+u+d*Math.pow(10,a))*s)/s;const g=xe(n.max,f);return r.push({value:g,major:hd(g),significand:d}),r}class Ts extends Nn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const r=qi.prototype.parse.apply(this,[t,e]);if(r===0){this._zero=!0;return}return Nt(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Nt(t)?Math.max(0,t):null,this.max=Nt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Nt(this._userMin)&&(this.min=t===Fn(this.min,0)?Fn(this.min,-1):Fn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let r=this.min,i=this.max;const a=o=>r=t?r:o,s=o=>i=e?i:o;r===i&&(r<=0?(a(1),s(10)):(a(Fn(r,-1)),s(Fn(i,1)))),r<=0&&a(Fn(i,-1)),i<=0&&s(Fn(r,1)),this.min=r,this.max=i}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},r=iy(e,this);return t.bounds==="ticks"&&mc(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":Or(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=dn(t),this._valueRange=dn(this.max)-dn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(dn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}z(Ts,"id","logarithmic"),z(Ts,"defaults",{ticks:{callback:Mi.formatters.logarithmic,major:{enabled:!0}}});function Ms(n){const t=n.ticks;if(t.display&&n.display){const e=Kt(t.backdropPadding);return rt(t.font&&t.font.size,Ut.font.size)+e.height}return 0}function ay(n,t,e){return e=bt(e)?e:[e],{w:mp(n,t.string,e),h:e.length*t.lineHeight}}function pd(n,t,e,r,i){return n===r||n===i?{start:t-e/2,end:t+e/2}:n<r||n>i?{start:t-e,end:t}:{start:t,end:t+e}}function sy(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),r=[],i=[],a=n._pointLabels.length,s=n.options.pointLabels,o=s.centerPointLabels?ft/a:0;for(let l=0;l<a;l++){const c=s.setContext(n.getPointLabelContext(l));i[l]=c.padding;const u=n.getPointPosition(l,n.drawingArea+i[l],o),d=Rt(c.font),f=ay(n.ctx,d,n._pointLabels[l]);r[l]=f;const g=we(n.getIndexAngle(l)+o),v=Math.round(_i(g)),x=pd(v,u.x,f.w,0,180),p=pd(v,u.y,f.h,90,270);oy(e,t,g,x,p)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=uy(n,r,i)}function oy(n,t,e,r,i){const a=Math.abs(Math.sin(e)),s=Math.abs(Math.cos(e));let o=0,l=0;r.start<t.l?(o=(t.l-r.start)/a,n.l=Math.min(n.l,t.l-o)):r.end>t.r&&(o=(r.end-t.r)/a,n.r=Math.max(n.r,t.r+o)),i.start<t.t?(l=(t.t-i.start)/s,n.t=Math.min(n.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/s,n.b=Math.max(n.b,t.b+l))}function ly(n,t,e){const r=n.drawingArea,{extra:i,additionalAngle:a,padding:s,size:o}=e,l=n.getPointPosition(t,r+i+s,a),c=Math.round(_i(we(l.angle+At))),u=hy(l.y,o.h,c),d=dy(c),f=fy(l.x,o.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:f,top:u,right:f+o.w,bottom:u+o.h}}function cy(n,t){if(!t)return!0;const{left:e,top:r,right:i,bottom:a}=n;return!(Ge({x:e,y:r},t)||Ge({x:e,y:a},t)||Ge({x:i,y:r},t)||Ge({x:i,y:a},t))}function uy(n,t,e){const r=[],i=n._pointLabels.length,a=n.options,{centerPointLabels:s,display:o}=a.pointLabels,l={extra:Ms(a)/2,additionalAngle:s?ft/i:0};let c;for(let u=0;u<i;u++){l.padding=e[u],l.size=t[u];const d=ly(n,u,l);r.push(d),o==="auto"&&(d.visible=cy(d,c),d.visible&&(c=d))}return r}function dy(n){return n===0||n===180?"center":n<180?"left":"right"}function fy(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function hy(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function gy(n,t,e){const{left:r,top:i,right:a,bottom:s}=e,{backdropColor:o}=t;if(!at(o)){const l=hn(t.borderRadius),c=Kt(t.backdropPadding);n.fillStyle=o;const u=r-c.left,d=i-c.top,f=a-r+c.width,g=s-i+c.height;Object.values(l).some(v=>v!==0)?(n.beginPath(),er(n,{x:u,y:d,w:f,h:g,radius:l}),n.fill()):n.fillRect(u,d,f,g)}}function py(n,t){const{ctx:e,options:{pointLabels:r}}=n;for(let i=t-1;i>=0;i--){const a=n._pointLabelItems[i];if(!a.visible)continue;const s=r.setContext(n.getPointLabelContext(i));gy(e,s,a);const o=Rt(s.font),{x:l,y:c,textAlign:u}=a;An(e,n._pointLabels[i],l,c+o.lineHeight/2,o,{color:s.color,textAlign:u,textBaseline:"middle"})}}function md(n,t,e,r){const{ctx:i}=n;if(e)i.arc(n.xCenter,n.yCenter,t,0,Ot);else{let a=n.getPointPosition(0,t);i.moveTo(a.x,a.y);for(let s=1;s<r;s++)a=n.getPointPosition(s,t),i.lineTo(a.x,a.y)}}function my(n,t,e,r,i){const a=n.ctx,s=t.circular,{color:o,lineWidth:l}=t;!s&&!r||!o||!l||e<0||(a.save(),a.strokeStyle=o,a.lineWidth=l,a.setLineDash(i.dash),a.lineDashOffset=i.dashOffset,a.beginPath(),md(n,e,s,r),a.closePath(),a.stroke(),a.restore())}function by(n,t,e){return gn(n,{label:e,index:t,type:"pointLabel"})}class Xr extends qi{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=Kt(Ms(this.options)/2),e=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(e,r)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=Nt(t)&&!isNaN(t)?t:0,this.max=Nt(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Ms(this.options))}generateTickLabels(t){qi.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,r)=>{const i=Mt(this.options.pointLabels.callback,[e,r],this);return i||i===0?i:""}).filter((e,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?sy(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,r,i){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((r-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,r,i))}getIndexAngle(t){const e=Ot/(this._pointLabels.length||1),r=this.options.startAngle||0;return we(t*e+Gt(r))}getDistanceFromCenterForValue(t){if(at(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(at(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const r=e[t];return by(this.getContext(),t,r)}}getPointPosition(t,e,r=0){const i=this.getIndexAngle(t)-At+r;return{x:Math.cos(i)*e+this.xCenter,y:Math.sin(i)*e+this.yCenter,angle:i}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:r,right:i,bottom:a}=this._pointLabelItems[t];return{left:e,top:r,right:i,bottom:a}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),md(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:r,grid:i,border:a}=e,s=this._pointLabels.length;let o,l,c;if(e.pointLabels.display&&py(this,s),i.display&&this.ticks.forEach((u,d)=>{if(d!==0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(d),g=i.setContext(f),v=a.setContext(f);my(this,g,l,s,v)}}),r.display){for(t.save(),o=s-1;o>=0;o--){const u=r.setContext(this.getPointLabelContext(o)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),c=this.getPointPosition(o,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,r=e.ticks;if(!r.display)return;const i=this.getIndexAngle(0);let a,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((o,l)=>{if(l===0&&!e.reverse)return;const c=r.setContext(this.getContext(l)),u=Rt(c.font);if(a=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,s=t.measureText(o.label).width,t.fillStyle=c.backdropColor;const d=Kt(c.backdropPadding);t.fillRect(-s/2-d.left,-a-u.size/2-d.top,s+d.width,u.size+d.height)}An(t,o.label,0,-a,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}z(Xr,"id","radialLinear"),z(Xr,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Mi.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),z(Xr,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),z(Xr,"descriptors",{angleLines:{_fallback:"grid"}});const Xi={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}},pe=Object.keys(Xi);function bd(n,t){return n-t}function yd(n,t){if(at(t))return null;const e=n._adapter,{parser:r,round:i,isoWeekday:a}=n._parseOpts;let s=t;return typeof r=="function"&&(s=r(s)),Nt(s)||(s=typeof r=="string"?e.parse(s,r):e.parse(s)),s===null?null:(i&&(s=i==="week"&&(fn(a)||a===!0)?e.startOf(s,"isoWeek",a):e.startOf(s,i)),+s)}function vd(n,t,e,r){const i=pe.length;for(let a=pe.indexOf(n);a<i-1;++a){const s=Xi[pe[a]],o=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((e-t)/(o*s.size))<=r)return pe[a]}return pe[i-1]}function yy(n,t,e,r,i){for(let a=pe.length-1;a>=pe.indexOf(e);a--){const s=pe[a];if(Xi[s].common&&n._adapter.diff(i,r,s)>=t-1)return s}return pe[e?pe.indexOf(e):0]}function vy(n){for(let t=pe.indexOf(n)+1,e=pe.length;t<e;++t)if(Xi[pe[t]].common)return pe[t]}function xd(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:r,hi:i}=Ya(e,t),a=e[r]>=t?e[r]:e[i];n[a]=!0}}function xy(n,t,e,r){const i=n._adapter,a=+i.startOf(t[0].value,r),s=t[t.length-1].value;let o,l;for(o=a;o<=s;o=+i.add(o,1,r))l=e[o],l>=0&&(t[l].major=!0);return t}function wd(n,t,e){const r=[],i={},a=t.length;let s,o;for(s=0;s<a;++s)o=t[s],i[o]=s,r.push({value:o,major:!1});return a===0||!e?r:xy(n,r,i,e)}class Gr extends Nn{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const r=t.time||(t.time={}),i=this._adapter=new uu._date(t.adapters.date);i.init(e),Dr(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:yd(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,r=t.time.unit||"day";let{min:i,max:a,minDefined:s,maxDefined:o}=this.getUserBounds();function l(c){!s&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!o&&!isNaN(c.max)&&(a=Math.max(a,c.max))}(!s||!o)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=Nt(i)&&!isNaN(i)?i:+e.startOf(Date.now(),r),a=Nt(a)&&!isNaN(a)?a:+e.endOf(Date.now(),r)+1,this.min=Math.min(i,a-1),this.max=Math.max(i+1,a)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],r=t[t.length-1]),{min:e,max:r}}buildTicks(){const t=this.options,e=t.time,r=t.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const a=this.min,s=this.max,o=rp(i,a,s);return this._unit=e.unit||(r.autoSkip?vd(e.minUnit,this.min,this.max,this._getLabelCapacity(a)):yy(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:vy(this._unit),this.initOffsets(i),t.reverse&&o.reverse(),wd(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,r=0,i,a;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?e=1-i:e=(this.getDecimalForValue(t[1])-i)/2,a=this.getDecimalForValue(t[t.length-1]),t.length===1?r=a:r=(a-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;e=Zt(e,0,s),r=Zt(r,0,s),this._offsets={start:e,end:r,factor:1/(e+1+r)}}_generate(){const t=this._adapter,e=this.min,r=this.max,i=this.options,a=i.time,s=a.unit||vd(a.minUnit,e,r,this._getLabelCapacity(e)),o=rt(i.ticks.stepSize,1),l=s==="week"?a.isoWeekday:!1,c=fn(l)||l===!0,u={};let d=e,f,g;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":s),t.diff(r,e,s)>1e5*o)throw new Error(e+" and "+r+" are too far apart with stepSize of "+o+" "+s);const v=i.ticks.source==="data"&&this.getDataTimestamps();for(f=d,g=0;f<r;f=+t.add(f,o,s),g++)xd(u,f,v);return(f===r||i.bounds==="ticks"||g===1)&&xd(u,f,v),Object.keys(u).sort(bd).map(x=>+x)}getLabelForValue(t){const e=this._adapter,r=this.options.time;return r.tooltipFormat?e.format(t,r.tooltipFormat):e.format(t,r.displayFormats.datetime)}format(t,e){const i=this.options.time.displayFormats,a=this._unit,s=e||i[a];return this._adapter.format(t,s)}_tickFormatFunction(t,e,r,i){const a=this.options,s=a.ticks.callback;if(s)return Mt(s,[t,e,r],this);const o=a.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&o[l],d=c&&o[c],f=r[e],g=c&&d&&f&&f.major;return this._adapter.format(t,i||(g?d:u))}generateTickLabels(t){let e,r,i;for(e=0,r=t.length;e<r;++e)i=t[e],i.label=this._tickFormatFunction(i.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+r)*e.factor)}getValueForPixel(t){const e=this._offsets,r=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,r=this.ctx.measureText(t).width,i=Gt(this.isHorizontal()?e.maxRotation:e.minRotation),a=Math.cos(i),s=Math.sin(i),o=this._resolveTickFontOptions(0).size;return{w:r*a+o*s,h:r*s+o*a}}_getLabelCapacity(t){const e=this.options.time,r=e.displayFormats,i=r[e.unit]||r.millisecond,a=this._tickFormatFunction(t,0,wd(this,[t],this._majorUnit),i),s=this._getLabelSize(a),o=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return o>0?o:1}getDataTimestamps(){let t=this._cache.data||[],e,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(e=0,r=i.length;e<r;++e)t=t.concat(i[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,r;if(t.length)return t;const i=this.getLabels();for(e=0,r=i.length;e<r;++e)t.push(yd(this,i[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return wc(t.sort(bd))}}z(Gr,"id","time"),z(Gr,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Gi(n,t,e){let r=0,i=n.length-1,a,s,o,l;e?(t>=n[r].pos&&t<=n[i].pos&&({lo:r,hi:i}=Xe(n,"pos",t)),{pos:a,time:o}=n[r],{pos:s,time:l}=n[i]):(t>=n[r].time&&t<=n[i].time&&({lo:r,hi:i}=Xe(n,"time",t)),{time:a,pos:o}=n[r],{time:s,pos:l}=n[i]);const c=s-a;return c?o+(l-o)*(t-a)/c:o}class Ds extends Gr{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Gi(e,this.min),this._tableRange=Gi(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:r}=this,i=[],a=[];let s,o,l,c,u;for(s=0,o=t.length;s<o;++s)c=t[s],c>=e&&c<=r&&i.push(c);if(i.length<2)return[{time:e,pos:0},{time:r,pos:1}];for(s=0,o=i.length;s<o;++s)u=i[s+1],l=i[s-1],c=i[s],Math.round((u+l)/2)!==c&&a.push({time:c,pos:s/(o-1)});return a}_generate(){const t=this.min,e=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(e)||r.length===1)&&r.push(e),r.sort((i,a)=>i-a)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),r=this.getLabelTimestamps();return e.length&&r.length?t=this.normalize(e.concat(r)):t=e.length?e:r,t=this._cache.all=t,t}getDecimalForValue(t){return(Gi(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,r=this.getDecimalForPixel(t)/e.factor-e.end;return Gi(this._table,r*this._tableRange+this._minPos,!0)}}z(Ds,"id","timeseries"),z(Ds,"defaults",Gr.defaults);var wy=Object.freeze({__proto__:null,CategoryScale:ws,LinearScale:_s,LogarithmicScale:Ts,RadialLinearScale:Xr,TimeScale:Gr,TimeSeriesScale:Ds});const _y=[Em,ab,Zb,wy],Ty=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],My=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Dy=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Cy=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],_d=(n,t,e)=>{let r=n;return typeof t=="string"||Array.isArray(t)?r=n.toLocaleString(t,e):(t===!0||e!==void 0)&&(r=n.toLocaleString(void 0,e)),r};function Cs(n,t){if(!Number.isFinite(n))throw new TypeError(`Expected a finite number, got ${typeof n}: ${n}`);t={bits:!1,binary:!1,space:!0,...t};const e=t.bits?t.binary?Cy:Dy:t.binary?My:Ty,r=t.space?" ":"";if(t.signed&&n===0)return` 0${r}${e[0]}`;const i=n<0,a=i?"-":t.signed?"+":"";i&&(n=-n);let s;if(t.minimumFractionDigits!==void 0&&(s={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(s={maximumFractionDigits:t.maximumFractionDigits,...s}),n<1){const u=_d(n,t.locale,s);return a+u+r+e[0]}const o=Math.min(Math.floor(t.binary?Math.log(n)/Math.log(1024):Math.log10(n)/3),e.length-1);n/=(t.binary?1024:1e3)**o,s||(n=n.toPrecision(3));const l=_d(Number(n),t.locale,s),c=e[o];return a+l+r+c}function Ze(n){"@babel/helpers - typeof";return Ze=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ze(n)}function Lt(n){if(n===null||n===!0||n===!1)return NaN;var t=Number(n);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function J(n,t){if(t.length<n)throw new TypeError(n+" argument"+(n>1?"s":"")+" required, but only "+t.length+" present")}function nt(n){J(1,arguments);var t=Object.prototype.toString.call(n);return n instanceof Date||Ze(n)==="object"&&t==="[object Date]"?new Date(n.getTime()):typeof n=="number"||t==="[object Number]"?new Date(n):((typeof n=="string"||t==="[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 Td(n,t){J(2,arguments);var e=nt(n),r=Lt(t);return isNaN(r)?new Date(NaN):(r&&e.setDate(e.getDate()+r),e)}function ks(n,t){J(2,arguments);var e=nt(n),r=Lt(t);if(isNaN(r))return new Date(NaN);if(!r)return e;var i=e.getDate(),a=new Date(e.getTime());a.setMonth(e.getMonth()+r+1,0);var s=a.getDate();return i>=s?a:(e.setFullYear(a.getFullYear(),a.getMonth(),i),e)}function Kr(n,t){J(2,arguments);var e=nt(n).getTime(),r=Lt(t);return new Date(e+r)}var ky=36e5;function Sy(n,t){J(2,arguments);var e=Lt(t);return Kr(n,e*ky)}var Oy={};function vn(){return Oy}function Md(n,t){var e,r,i,a,s,o,l,c;J(1,arguments);var u=vn(),d=Lt((e=(r=(i=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&i!==void 0?i: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&&e!==void 0?e:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=nt(n),g=f.getDay(),v=(g<d?7:0)+g-d;return f.setDate(f.getDate()-v),f.setHours(0,0,0,0),f}function Ki(n){var t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),n.getTime()-t.getTime()}function Ss(n){J(1,arguments);var t=nt(n);return t.setHours(0,0,0,0),t}var Py=864e5;function Ey(n,t){J(2,arguments);var e=Ss(n),r=Ss(t),i=e.getTime()-Ki(e),a=r.getTime()-Ki(r);return Math.round((i-a)/Py)}var Ay=6e4;function Ry(n,t){J(2,arguments);var e=Lt(t);return Kr(n,e*Ay)}function Ly(n,t){J(2,arguments);var e=Lt(t),r=e*3;return ks(n,r)}function Iy(n,t){J(2,arguments);var e=Lt(t);return Kr(n,e*1e3)}function Ny(n,t){J(2,arguments);var e=Lt(t),r=e*7;return Td(n,r)}function Fy(n,t){J(2,arguments);var e=Lt(t);return ks(n,e*12)}function Qr(n,t){J(2,arguments);var e=nt(n),r=nt(t),i=e.getTime()-r.getTime();return i<0?-1:i>0?1:i}var Qi=6e4,Zr=36e5,By=1e3;function Uy(n){return J(1,arguments),n instanceof Date||Ze(n)==="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Os(n){if(J(1,arguments),!Uy(n)&&typeof n!="number")return!1;var t=nt(n);return!isNaN(Number(t))}function Wy(n,t){J(2,arguments);var e=nt(n),r=nt(t),i=e.getFullYear()-r.getFullYear(),a=e.getMonth()-r.getMonth();return i*12+a}function Yy(n,t){J(2,arguments);var e=nt(n),r=nt(t);return e.getFullYear()-r.getFullYear()}function Dd(n,t){var e=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function Cd(n,t){J(2,arguments);var e=nt(n),r=nt(t),i=Dd(e,r),a=Math.abs(Ey(e,r));e.setDate(e.getDate()-i*a);var s=+(Dd(e,r)===-i),o=i*(a-s);return o===0?0:o}function Zi(n,t){return J(2,arguments),nt(n).getTime()-nt(t).getTime()}var kd={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},Hy="trunc";function Jr(n){return n?kd[n]:kd[Hy]}function zy(n,t,e){J(2,arguments);var r=Zi(n,t)/Zr;return Jr(e==null?void 0:e.roundingMethod)(r)}function $y(n,t,e){J(2,arguments);var r=Zi(n,t)/Qi;return Jr(e==null?void 0:e.roundingMethod)(r)}function Sd(n){J(1,arguments);var t=nt(n);return t.setHours(23,59,59,999),t}function Od(n){J(1,arguments);var t=nt(n),e=t.getMonth();return t.setFullYear(t.getFullYear(),e+1,0),t.setHours(23,59,59,999),t}function jy(n){J(1,arguments);var t=nt(n);return Sd(t).getTime()===Od(t).getTime()}function Pd(n,t){J(2,arguments);var e=nt(n),r=nt(t),i=Qr(e,r),a=Math.abs(Wy(e,r)),s;if(a<1)s=0;else{e.getMonth()===1&&e.getDate()>27&&e.setDate(30),e.setMonth(e.getMonth()-i*a);var o=Qr(e,r)===-i;jy(nt(n))&&a===1&&Qr(n,r)===1&&(o=!1),s=i*(a-Number(o))}return s===0?0:s}function Vy(n,t,e){J(2,arguments);var r=Pd(n,t)/3;return Jr(e==null?void 0:e.roundingMethod)(r)}function qy(n,t,e){J(2,arguments);var r=Zi(n,t)/1e3;return Jr(e==null?void 0:e.roundingMethod)(r)}function Xy(n,t,e){J(2,arguments);var r=Cd(n,t)/7;return Jr(e==null?void 0:e.roundingMethod)(r)}function Gy(n,t){J(2,arguments);var e=nt(n),r=nt(t),i=Qr(e,r),a=Math.abs(Yy(e,r));e.setFullYear(1584),r.setFullYear(1584);var s=Qr(e,r)===-i,o=i*(a-Number(s));return o===0?0:o}function Ky(n){J(1,arguments);var t=nt(n);return t.setSeconds(0,0),t}function Qy(n){J(1,arguments);var t=nt(n),e=t.getMonth(),r=e-e%3;return t.setMonth(r,1),t.setHours(0,0,0,0),t}function Zy(n){J(1,arguments);var t=nt(n);return t.setDate(1),t.setHours(0,0,0,0),t}function Jy(n){J(1,arguments);var t=nt(n),e=t.getFullYear();return t.setFullYear(e+1,0,0),t.setHours(23,59,59,999),t}function tv(n){J(1,arguments);var t=nt(n),e=new Date(0);return e.setFullYear(t.getFullYear(),0,1),e.setHours(0,0,0,0),e}function ev(n){J(1,arguments);var t=nt(n);return t.setMinutes(59,59,999),t}function nv(n,t){var e,r,i,a,s,o,l,c;J(1,arguments);var u=vn(),d=Lt((e=(r=(i=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&i!==void 0?i: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&&e!==void 0?e:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=nt(n),g=f.getDay(),v=(g<d?-7:0)+6-(g-d);return f.setDate(f.getDate()+v),f.setHours(23,59,59,999),f}function rv(n){J(1,arguments);var t=nt(n);return t.setSeconds(59,999),t}function iv(n){J(1,arguments);var t=nt(n),e=t.getMonth(),r=e-e%3+3;return t.setMonth(r,0),t.setHours(23,59,59,999),t}function av(n){J(1,arguments);var t=nt(n);return t.setMilliseconds(999),t}function Ed(n,t){J(2,arguments);var e=Lt(t);return Kr(n,-e)}var sv=864e5;function ov(n){J(1,arguments);var t=nt(n),e=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),i=e-r;return Math.floor(i/sv)+1}function sr(n){J(1,arguments);var t=1,e=nt(n),r=e.getUTCDay(),i=(r<t?7:0)+r-t;return e.setUTCDate(e.getUTCDate()-i),e.setUTCHours(0,0,0,0),e}function Ad(n){J(1,arguments);var t=nt(n),e=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(e+1,0,4),r.setUTCHours(0,0,0,0);var i=sr(r),a=new Date(0);a.setUTCFullYear(e,0,4),a.setUTCHours(0,0,0,0);var s=sr(a);return t.getTime()>=i.getTime()?e+1:t.getTime()>=s.getTime()?e:e-1}function lv(n){J(1,arguments);var t=Ad(n),e=new Date(0);e.setUTCFullYear(t,0,4),e.setUTCHours(0,0,0,0);var r=sr(e);return r}var cv=6048e5;function Rd(n){J(1,arguments);var t=nt(n),e=sr(t).getTime()-lv(t).getTime();return Math.round(e/cv)+1}function Bn(n,t){var e,r,i,a,s,o,l,c;J(1,arguments);var u=vn(),d=Lt((e=(r=(i=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&i!==void 0?i: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&&e!==void 0?e:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=nt(n),g=f.getUTCDay(),v=(g<d?7:0)+g-d;return f.setUTCDate(f.getUTCDate()-v),f.setUTCHours(0,0,0,0),f}function Ps(n,t){var e,r,i,a,s,o,l,c;J(1,arguments);var u=nt(n),d=u.getUTCFullYear(),f=vn(),g=Lt((e=(r=(i=(a=t==null?void 0:t.firstWeekContainsDate)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&i!==void 0?i:f.firstWeekContainsDate)!==null&&r!==void 0?r:(l=f.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&e!==void 0?e:1);if(!(g>=1&&g<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var v=new Date(0);v.setUTCFullYear(d+1,0,g),v.setUTCHours(0,0,0,0);var x=Bn(v,t),p=new Date(0);p.setUTCFullYear(d,0,g),p.setUTCHours(0,0,0,0);var b=Bn(p,t);return u.getTime()>=x.getTime()?d+1:u.getTime()>=b.getTime()?d:d-1}function uv(n,t){var e,r,i,a,s,o,l,c;J(1,arguments);var u=vn(),d=Lt((e=(r=(i=(a=t==null?void 0:t.firstWeekContainsDate)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&i!==void 0?i: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&&e!==void 0?e:1),f=Ps(n,t),g=new Date(0);g.setUTCFullYear(f,0,d),g.setUTCHours(0,0,0,0);var v=Bn(g,t);return v}var dv=6048e5;function Ld(n,t){J(1,arguments);var e=nt(n),r=Bn(e,t).getTime()-uv(e,t).getTime();return Math.round(r/dv)+1}function Ct(n,t){for(var e=n<0?"-":"",r=Math.abs(n).toString();r.length<t;)r="0"+r;return e+r}var fv={y:function(t,e){var r=t.getUTCFullYear(),i=r>0?r:1-r;return Ct(e==="yy"?i%100:i,e.length)},M:function(t,e){var r=t.getUTCMonth();return e==="M"?String(r+1):Ct(r+1,2)},d:function(t,e){return Ct(t.getUTCDate(),e.length)},a:function(t,e){var r=t.getUTCHours()/12>=1?"pm":"am";switch(e){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(t,e){return Ct(t.getUTCHours()%12||12,e.length)},H:function(t,e){return Ct(t.getUTCHours(),e.length)},m:function(t,e){return Ct(t.getUTCMinutes(),e.length)},s:function(t,e){return Ct(t.getUTCSeconds(),e.length)},S:function(t,e){var r=e.length,i=t.getUTCMilliseconds(),a=Math.floor(i*Math.pow(10,r-3));return Ct(a,e.length)}};const xn=fv;var or={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},hv={G:function(t,e,r){var i=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return r.era(i,{width:"abbreviated"});case"GGGGG":return r.era(i,{width:"narrow"});case"GGGG":default:return r.era(i,{width:"wide"})}},y:function(t,e,r){if(e==="yo"){var i=t.getUTCFullYear(),a=i>0?i:1-i;return r.ordinalNumber(a,{unit:"year"})}return xn.y(t,e)},Y:function(t,e,r,i){var a=Ps(t,i),s=a>0?a:1-a;if(e==="YY"){var o=s%100;return Ct(o,2)}return e==="Yo"?r.ordinalNumber(s,{unit:"year"}):Ct(s,e.length)},R:function(t,e){var r=Ad(t);return Ct(r,e.length)},u:function(t,e){var r=t.getUTCFullYear();return Ct(r,e.length)},Q:function(t,e,r){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return Ct(i,2);case"Qo":return r.ordinalNumber(i,{unit:"quarter"});case"QQQ":return r.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(i,{width:"wide",context:"formatting"})}},q:function(t,e,r){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return Ct(i,2);case"qo":return r.ordinalNumber(i,{unit:"quarter"});case"qqq":return r.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(i,{width:"wide",context:"standalone"})}},M:function(t,e,r){var i=t.getUTCMonth();switch(e){case"M":case"MM":return xn.M(t,e);case"Mo":return r.ordinalNumber(i+1,{unit:"month"});case"MMM":return r.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(i,{width:"wide",context:"formatting"})}},L:function(t,e,r){var i=t.getUTCMonth();switch(e){case"L":return String(i+1);case"LL":return Ct(i+1,2);case"Lo":return r.ordinalNumber(i+1,{unit:"month"});case"LLL":return r.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(i,{width:"wide",context:"standalone"})}},w:function(t,e,r,i){var a=Ld(t,i);return e==="wo"?r.ordinalNumber(a,{unit:"week"}):Ct(a,e.length)},I:function(t,e,r){var i=Rd(t);return e==="Io"?r.ordinalNumber(i,{unit:"week"}):Ct(i,e.length)},d:function(t,e,r){return e==="do"?r.ordinalNumber(t.getUTCDate(),{unit:"date"}):xn.d(t,e)},D:function(t,e,r){var i=ov(t);return e==="Do"?r.ordinalNumber(i,{unit:"dayOfYear"}):Ct(i,e.length)},E:function(t,e,r){var i=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return r.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(i,{width:"short",context:"formatting"});case"EEEE":default:return r.day(i,{width:"wide",context:"formatting"})}},e:function(t,e,r,i){var a=t.getUTCDay(),s=(a-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return Ct(s,2);case"eo":return r.ordinalNumber(s,{unit:"day"});case"eee":return r.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(a,{width:"short",context:"formatting"});case"eeee":default:return r.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,r,i){var a=t.getUTCDay(),s=(a-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return Ct(s,e.length);case"co":return r.ordinalNumber(s,{unit:"day"});case"ccc":return r.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(a,{width:"narrow",context:"standalone"});case"cccccc":return r.day(a,{width:"short",context:"standalone"});case"cccc":default:return r.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,r){var i=t.getUTCDay(),a=i===0?7:i;switch(e){case"i":return String(a);case"ii":return Ct(a,e.length);case"io":return r.ordinalNumber(a,{unit:"day"});case"iii":return r.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(i,{width:"short",context:"formatting"});case"iiii":default:return r.day(i,{width:"wide",context:"formatting"})}},a:function(t,e,r){var i=t.getUTCHours(),a=i/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,r){var i=t.getUTCHours(),a;switch(i===12?a=or.noon:i===0?a=or.midnight:a=i/12>=1?"pm":"am",e){case"b":case"bb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,r){var i=t.getUTCHours(),a;switch(i>=17?a=or.evening:i>=12?a=or.afternoon:i>=4?a=or.morning:a=or.night,e){case"B":case"BB":case"BBB":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,r){if(e==="ho"){var i=t.getUTCHours()%12;return i===0&&(i=12),r.ordinalNumber(i,{unit:"hour"})}return xn.h(t,e)},H:function(t,e,r){return e==="Ho"?r.ordinalNumber(t.getUTCHours(),{unit:"hour"}):xn.H(t,e)},K:function(t,e,r){var i=t.getUTCHours()%12;return e==="Ko"?r.ordinalNumber(i,{unit:"hour"}):Ct(i,e.length)},k:function(t,e,r){var i=t.getUTCHours();return i===0&&(i=24),e==="ko"?r.ordinalNumber(i,{unit:"hour"}):Ct(i,e.length)},m:function(t,e,r){return e==="mo"?r.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):xn.m(t,e)},s:function(t,e,r){return e==="so"?r.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):xn.s(t,e)},S:function(t,e){return xn.S(t,e)},X:function(t,e,r,i){var a=i._originalDate||t,s=a.getTimezoneOffset();if(s===0)return"Z";switch(e){case"X":return Nd(s);case"XXXX":case"XX":return Un(s);case"XXXXX":case"XXX":default:return Un(s,":")}},x:function(t,e,r,i){var a=i._originalDate||t,s=a.getTimezoneOffset();switch(e){case"x":return Nd(s);case"xxxx":case"xx":return Un(s);case"xxxxx":case"xxx":default:return Un(s,":")}},O:function(t,e,r,i){var a=i._originalDate||t,s=a.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Id(s,":");case"OOOO":default:return"GMT"+Un(s,":")}},z:function(t,e,r,i){var a=i._originalDate||t,s=a.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Id(s,":");case"zzzz":default:return"GMT"+Un(s,":")}},t:function(t,e,r,i){var a=i._originalDate||t,s=Math.floor(a.getTime()/1e3);return Ct(s,e.length)},T:function(t,e,r,i){var a=i._originalDate||t,s=a.getTime();return Ct(s,e.length)}};function Id(n,t){var e=n>0?"-":"+",r=Math.abs(n),i=Math.floor(r/60),a=r%60;if(a===0)return e+String(i);var s=t||"";return e+String(i)+s+Ct(a,2)}function Nd(n,t){if(n%60===0){var e=n>0?"-":"+";return e+Ct(Math.abs(n)/60,2)}return Un(n,t)}function Un(n,t){var e=t||"",r=n>0?"-":"+",i=Math.abs(n),a=Ct(Math.floor(i/60),2),s=Ct(i%60,2);return r+a+e+s}const gv=hv;var Fd=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},Bd=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},pv=function(t,e){var r=t.match(/(P+)(p+)?/)||[],i=r[1],a=r[2];if(!a)return Fd(t,e);var s;switch(i){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",Fd(i,e)).replace("{{time}}",Bd(a,e))},mv={p:Bd,P:pv};const Es=mv;var bv=["D","DD"],yv=["YY","YYYY"];function Ud(n){return bv.indexOf(n)!==-1}function Wd(n){return yv.indexOf(n)!==-1}function Ji(n,t,e){if(n==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var vv={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"}},xv=function(t,e,r){var i,a=vv[t];return typeof a=="string"?i=a:e===1?i=a.one:i=a.other.replace("{{count}}",e.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+i:i+" ago":i};const wv=xv;function As(n){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.width?String(t.width):n.defaultWidth,r=n.formats[e]||n.formats[n.defaultWidth];return r}}var _v={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Tv={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Mv={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Dv={date:As({formats:_v,defaultWidth:"full"}),time:As({formats:Tv,defaultWidth:"full"}),dateTime:As({formats:Mv,defaultWidth:"full"})};const Cv=Dv;var kv={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Sv=function(t,e,r,i){return kv[t]};const Ov=Sv;function ti(n){return function(t,e){var r=e!=null&&e.context?String(e.context):"standalone",i;if(r==="formatting"&&n.formattingValues){var a=n.defaultFormattingWidth||n.defaultWidth,s=e!=null&&e.width?String(e.width):a;i=n.formattingValues[s]||n.formattingValues[a]}else{var o=n.defaultWidth,l=e!=null&&e.width?String(e.width):n.defaultWidth;i=n.values[l]||n.values[o]}var c=n.argumentCallback?n.argumentCallback(t):t;return i[c]}}var Pv={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ev={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Av={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"]},Rv={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"]},Lv={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"}},Iv={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"}},Nv=function(t,e){var r=Number(t),i=r%100;if(i>20||i<10)switch(i%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},Fv={ordinalNumber:Nv,era:ti({values:Pv,defaultWidth:"wide"}),quarter:ti({values:Ev,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:ti({values:Av,defaultWidth:"wide"}),day:ti({values:Rv,defaultWidth:"wide"}),dayPeriod:ti({values:Lv,defaultWidth:"wide",formattingValues:Iv,defaultFormattingWidth:"wide"})};const Bv=Fv;function ei(n){return function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.width,i=r&&n.matchPatterns[r]||n.matchPatterns[n.defaultMatchWidth],a=t.match(i);if(!a)return null;var s=a[0],o=r&&n.parsePatterns[r]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(o)?Wv(o,function(d){return d.test(s)}):Uv(o,function(d){return d.test(s)}),c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;var u=t.slice(s.length);return{value:c,rest:u}}}function Uv(n,t){for(var e in n)if(n.hasOwnProperty(e)&&t(n[e]))return e}function Wv(n,t){for(var e=0;e<n.length;e++)if(t(n[e]))return e}function Yv(n){return function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.match(n.matchPattern);if(!r)return null;var i=r[0],a=t.match(n.parsePattern);if(!a)return null;var s=n.valueCallback?n.valueCallback(a[0]):a[0];s=e.valueCallback?e.valueCallback(s):s;var o=t.slice(i.length);return{value:s,rest:o}}}var Hv=/^(\d+)(th|st|nd|rd)?/i,zv=/\d+/i,$v={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},jv={any:[/^b/i,/^(a|c)/i]},Vv={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},qv={any:[/1/i,/2/i,/3/i,/4/i]},Xv={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},Gv={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]},Kv={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},Qv={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]},Zv={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},Jv={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}},tx={ordinalNumber:Yv({matchPattern:Hv,parsePattern:zv,valueCallback:function(t){return parseInt(t,10)}}),era:ei({matchPatterns:$v,defaultMatchWidth:"wide",parsePatterns:jv,defaultParseWidth:"any"}),quarter:ei({matchPatterns:Vv,defaultMatchWidth:"wide",parsePatterns:qv,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:ei({matchPatterns:Xv,defaultMatchWidth:"wide",parsePatterns:Gv,defaultParseWidth:"any"}),day:ei({matchPatterns:Kv,defaultMatchWidth:"wide",parsePatterns:Qv,defaultParseWidth:"any"}),dayPeriod:ei({matchPatterns:Zv,defaultMatchWidth:"any",parsePatterns:Jv,defaultParseWidth:"any"})},ex={code:"en-US",formatDistance:wv,formatLong:Cv,formatRelative:Ov,localize:Bv,match:tx,options:{weekStartsOn:0,firstWeekContainsDate:1}};const Yd=ex;var nx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,rx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ix=/^'([^]*?)'?$/,ax=/''/g,sx=/[a-zA-Z]/;function ox(n,t,e){var r,i,a,s,o,l,c,u,d,f,g,v,x,p,b,m,y,w;J(2,arguments);var T=String(t),S=vn(),k=(r=(i=e==null?void 0:e.locale)!==null&&i!==void 0?i:S.locale)!==null&&r!==void 0?r:Yd,M=Lt((a=(s=(o=(l=e==null?void 0:e.firstWeekContainsDate)!==null&&l!==void 0?l:e==null||(c=e.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&o!==void 0?o:S.firstWeekContainsDate)!==null&&s!==void 0?s:(d=S.locale)===null||d===void 0||(f=d.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&a!==void 0?a:1);if(!(M>=1&&M<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var D=Lt((g=(v=(x=(p=e==null?void 0:e.weekStartsOn)!==null&&p!==void 0?p:e==null||(b=e.locale)===null||b===void 0||(m=b.options)===null||m===void 0?void 0:m.weekStartsOn)!==null&&x!==void 0?x:S.weekStartsOn)!==null&&v!==void 0?v:(y=S.locale)===null||y===void 0||(w=y.options)===null||w===void 0?void 0:w.weekStartsOn)!==null&&g!==void 0?g:0);if(!(D>=0&&D<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!k.localize)throw new RangeError("locale must contain localize property");if(!k.formatLong)throw new RangeError("locale must contain formatLong property");var O=nt(n);if(!Os(O))throw new RangeError("Invalid time value");var P=Ki(O),A=Ed(O,P),F={firstWeekContainsDate:M,weekStartsOn:D,locale:k,_originalDate:O},q=T.match(rx).map(function($){var H=$[0];if(H==="p"||H==="P"){var I=Es[H];return I($,k.formatLong)}return $}).join("").match(nx).map(function($){if($==="''")return"'";var H=$[0];if(H==="'")return lx($);var I=gv[H];if(I)return!(e!=null&&e.useAdditionalWeekYearTokens)&&Wd($)&&Ji($,t,String(n)),!(e!=null&&e.useAdditionalDayOfYearTokens)&&Ud($)&&Ji($,t,String(n)),I(A,$,k.localize,F);if(H.match(sx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+H+"`");return $}).join("");return q}function lx(n){var t=n.match(ix);return t?t[1].replace(ax,"'"):n}function cx(n,t){if(n==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n}function Hd(n,t){(t==null||t>n.length)&&(t=n.length);for(var e=0,r=new Array(t);e<t;e++)r[e]=n[e];return r}function ux(n,t){if(n){if(typeof n=="string")return Hd(n,t);var e=Object.prototype.toString.call(n).slice(8,-1);if(e==="Object"&&n.constructor&&(e=n.constructor.name),e==="Map"||e==="Set")return Array.from(n);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Hd(n,t)}}function zd(n,t){var e=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!e){if(Array.isArray(n)||(e=ux(n))||t&&n&&typeof n.length=="number"){e&&(n=e);var r=0,i=function(){};return{s:i,n:function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
19
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,s=!1,o;return{s:function(){e=e.call(n)},n:function(){var c=e.next();return a=c.done,c},e:function(c){s=!0,o=c},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(s)throw o}}}}function G(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function Rs(n,t){return Rs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Rs(n,t)}function pt(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),t&&Rs(n,t)}function ta(n){return ta=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ta(n)}function dx(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function fx(n,t){if(t&&(Ze(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return G(n)}function mt(n){var t=dx();return function(){var r=ta(n),i;if(t){var a=ta(this).constructor;i=Reflect.construct(r,arguments,a)}else i=r.apply(this,arguments);return fx(this,i)}}function ht(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function hx(n,t){if(Ze(n)!=="object"||n===null)return n;var e=n[Symbol.toPrimitive];if(e!==void 0){var r=e.call(n,t||"default");if(Ze(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}function $d(n){var t=hx(n,"string");return Ze(t)==="symbol"?t:String(t)}function jd(n,t){for(var e=0;e<t.length;e++){var r=t[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,$d(r.key),r)}}function gt(n,t,e){return t&&jd(n.prototype,t),e&&jd(n,e),Object.defineProperty(n,"prototype",{writable:!1}),n}function V(n,t,e){return t=$d(t),t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}var gx=10,Vd=function(){function n(){ht(this,n),V(this,"priority",void 0),V(this,"subPriority",0)}return gt(n,[{key:"validate",value:function(e,r){return!0}}]),n}(),px=function(n){pt(e,n);var t=mt(e);function e(r,i,a,s,o){var l;return ht(this,e),l=t.call(this),l.value=r,l.validateValue=i,l.setValue=a,l.priority=s,o&&(l.subPriority=o),l}return gt(e,[{key:"validate",value:function(i,a){return this.validateValue(i,this.value,a)}},{key:"set",value:function(i,a,s){return this.setValue(i,a,this.value,s)}}]),e}(Vd),mx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",gx),V(G(r),"subPriority",-1),r}return gt(e,[{key:"set",value:function(i,a){if(a.timestampIsSet)return i;var s=new Date(0);return s.setFullYear(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()),s.setHours(i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds()),s}}]),e}(Vd),wt=function(){function n(){ht(this,n),V(this,"incompatibleTokens",void 0),V(this,"priority",void 0),V(this,"subPriority",void 0)}return gt(n,[{key:"run",value:function(e,r,i,a){var s=this.parse(e,r,i,a);return s?{setter:new px(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}},{key:"validate",value:function(e,r,i){return!0}}]),n}(),bx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",140),V(G(r),"incompatibleTokens",["R","u","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){switch(a){case"G":case"GG":case"GGG":return s.era(i,{width:"abbreviated"})||s.era(i,{width:"narrow"});case"GGGGG":return s.era(i,{width:"narrow"});case"GGGG":default:return s.era(i,{width:"wide"})||s.era(i,{width:"abbreviated"})||s.era(i,{width:"narrow"})}}},{key:"set",value:function(i,a,s){return a.era=s,i.setUTCFullYear(s,0,1),i.setUTCHours(0,0,0,0),i}}]),e}(wt),qt={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}/},Ue={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 Xt(n,t){return n&&{value:t(n.value),rest:n.rest}}function Wt(n,t){var e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function We(n,t){var e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};var r=e[1]==="+"?1:-1,i=e[2]?parseInt(e[2],10):0,a=e[3]?parseInt(e[3],10):0,s=e[5]?parseInt(e[5],10):0;return{value:r*(i*Zr+a*Qi+s*By),rest:t.slice(e[0].length)}}function qd(n){return Wt(qt.anyDigitsSigned,n)}function Vt(n,t){switch(n){case 1:return Wt(qt.singleDigit,t);case 2:return Wt(qt.twoDigits,t);case 3:return Wt(qt.threeDigits,t);case 4:return Wt(qt.fourDigits,t);default:return Wt(new RegExp("^\\d{1,"+n+"}"),t)}}function ea(n,t){switch(n){case 1:return Wt(qt.singleDigitSigned,t);case 2:return Wt(qt.twoDigitsSigned,t);case 3:return Wt(qt.threeDigitsSigned,t);case 4:return Wt(qt.fourDigitsSigned,t);default:return Wt(new RegExp("^-?\\d{1,"+n+"}"),t)}}function Ls(n){switch(n){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 Xd(n,t){var e=t>0,r=e?t:1-t,i;if(r<=50)i=n||100;else{var a=r+50,s=Math.floor(a/100)*100,o=n>=a%100;i=n+s-(o?100:0)}return e?i:1-i}function Gd(n){return n%400===0||n%4===0&&n%100!==0}var yx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",130),V(G(r),"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){var o=function(c){return{year:c,isTwoDigitYear:a==="yy"}};switch(a){case"y":return Xt(Vt(4,i),o);case"yo":return Xt(s.ordinalNumber(i,{unit:"year"}),o);default:return Xt(Vt(a.length,i),o)}}},{key:"validate",value:function(i,a){return a.isTwoDigitYear||a.year>0}},{key:"set",value:function(i,a,s){var o=i.getUTCFullYear();if(s.isTwoDigitYear){var l=Xd(s.year,o);return i.setUTCFullYear(l,0,1),i.setUTCHours(0,0,0,0),i}var c=!("era"in a)||a.era===1?s.year:1-s.year;return i.setUTCFullYear(c,0,1),i.setUTCHours(0,0,0,0),i}}]),e}(wt),vx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",130),V(G(r),"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){var o=function(c){return{year:c,isTwoDigitYear:a==="YY"}};switch(a){case"Y":return Xt(Vt(4,i),o);case"Yo":return Xt(s.ordinalNumber(i,{unit:"year"}),o);default:return Xt(Vt(a.length,i),o)}}},{key:"validate",value:function(i,a){return a.isTwoDigitYear||a.year>0}},{key:"set",value:function(i,a,s,o){var l=Ps(i,o);if(s.isTwoDigitYear){var c=Xd(s.year,l);return i.setUTCFullYear(c,0,o.firstWeekContainsDate),i.setUTCHours(0,0,0,0),Bn(i,o)}var u=!("era"in a)||a.era===1?s.year:1-s.year;return i.setUTCFullYear(u,0,o.firstWeekContainsDate),i.setUTCHours(0,0,0,0),Bn(i,o)}}]),e}(wt),xx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",130),V(G(r),"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a){return ea(a==="R"?4:a.length,i)}},{key:"set",value:function(i,a,s){var o=new Date(0);return o.setUTCFullYear(s,0,4),o.setUTCHours(0,0,0,0),sr(o)}}]),e}(wt),wx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",130),V(G(r),"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a){return ea(a==="u"?4:a.length,i)}},{key:"set",value:function(i,a,s){return i.setUTCFullYear(s,0,1),i.setUTCHours(0,0,0,0),i}}]),e}(wt),_x=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",120),V(G(r),"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){switch(a){case"Q":case"QQ":return Vt(a.length,i);case"Qo":return s.ordinalNumber(i,{unit:"quarter"});case"QQQ":return s.quarter(i,{width:"abbreviated",context:"formatting"})||s.quarter(i,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(i,{width:"wide",context:"formatting"})||s.quarter(i,{width:"abbreviated",context:"formatting"})||s.quarter(i,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(i,a){return a>=1&&a<=4}},{key:"set",value:function(i,a,s){return i.setUTCMonth((s-1)*3,1),i.setUTCHours(0,0,0,0),i}}]),e}(wt),Tx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",120),V(G(r),"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){switch(a){case"q":case"qq":return Vt(a.length,i);case"qo":return s.ordinalNumber(i,{unit:"quarter"});case"qqq":return s.quarter(i,{width:"abbreviated",context:"standalone"})||s.quarter(i,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(i,{width:"wide",context:"standalone"})||s.quarter(i,{width:"abbreviated",context:"standalone"})||s.quarter(i,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(i,a){return a>=1&&a<=4}},{key:"set",value:function(i,a,s){return i.setUTCMonth((s-1)*3,1),i.setUTCHours(0,0,0,0),i}}]),e}(wt),Mx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]),V(G(r),"priority",110),r}return gt(e,[{key:"parse",value:function(i,a,s){var o=function(c){return c-1};switch(a){case"M":return Xt(Wt(qt.month,i),o);case"MM":return Xt(Vt(2,i),o);case"Mo":return Xt(s.ordinalNumber(i,{unit:"month"}),o);case"MMM":return s.month(i,{width:"abbreviated",context:"formatting"})||s.month(i,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(i,{width:"wide",context:"formatting"})||s.month(i,{width:"abbreviated",context:"formatting"})||s.month(i,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(i,a){return a>=0&&a<=11}},{key:"set",value:function(i,a,s){return i.setUTCMonth(s,1),i.setUTCHours(0,0,0,0),i}}]),e}(wt),Dx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",110),V(G(r),"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){var o=function(c){return c-1};switch(a){case"L":return Xt(Wt(qt.month,i),o);case"LL":return Xt(Vt(2,i),o);case"Lo":return Xt(s.ordinalNumber(i,{unit:"month"}),o);case"LLL":return s.month(i,{width:"abbreviated",context:"standalone"})||s.month(i,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(i,{width:"wide",context:"standalone"})||s.month(i,{width:"abbreviated",context:"standalone"})||s.month(i,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(i,a){return a>=0&&a<=11}},{key:"set",value:function(i,a,s){return i.setUTCMonth(s,1),i.setUTCHours(0,0,0,0),i}}]),e}(wt);function Cx(n,t,e){J(2,arguments);var r=nt(n),i=Lt(t),a=Ld(r,e)-i;return r.setUTCDate(r.getUTCDate()-a*7),r}var kx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",100),V(G(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){switch(a){case"w":return Wt(qt.week,i);case"wo":return s.ordinalNumber(i,{unit:"week"});default:return Vt(a.length,i)}}},{key:"validate",value:function(i,a){return a>=1&&a<=53}},{key:"set",value:function(i,a,s,o){return Bn(Cx(i,s,o),o)}}]),e}(wt);function Sx(n,t){J(2,arguments);var e=nt(n),r=Lt(t),i=Rd(e)-r;return e.setUTCDate(e.getUTCDate()-i*7),e}var Ox=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",100),V(G(r),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){switch(a){case"I":return Wt(qt.week,i);case"Io":return s.ordinalNumber(i,{unit:"week"});default:return Vt(a.length,i)}}},{key:"validate",value:function(i,a){return a>=1&&a<=53}},{key:"set",value:function(i,a,s){return sr(Sx(i,s))}}]),e}(wt),Px=[31,28,31,30,31,30,31,31,30,31,30,31],Ex=[31,29,31,30,31,30,31,31,30,31,30,31],Ax=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",90),V(G(r),"subPriority",1),V(G(r),"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){switch(a){case"d":return Wt(qt.date,i);case"do":return s.ordinalNumber(i,{unit:"date"});default:return Vt(a.length,i)}}},{key:"validate",value:function(i,a){var s=i.getUTCFullYear(),o=Gd(s),l=i.getUTCMonth();return o?a>=1&&a<=Ex[l]:a>=1&&a<=Px[l]}},{key:"set",value:function(i,a,s){return i.setUTCDate(s),i.setUTCHours(0,0,0,0),i}}]),e}(wt),Rx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",90),V(G(r),"subpriority",1),V(G(r),"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){switch(a){case"D":case"DD":return Wt(qt.dayOfYear,i);case"Do":return s.ordinalNumber(i,{unit:"date"});default:return Vt(a.length,i)}}},{key:"validate",value:function(i,a){var s=i.getUTCFullYear(),o=Gd(s);return o?a>=1&&a<=366:a>=1&&a<=365}},{key:"set",value:function(i,a,s){return i.setUTCMonth(0,s),i.setUTCHours(0,0,0,0),i}}]),e}(wt);function Is(n,t,e){var r,i,a,s,o,l,c,u;J(2,arguments);var d=vn(),f=Lt((r=(i=(a=(s=e==null?void 0:e.weekStartsOn)!==null&&s!==void 0?s:e==null||(o=e.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&a!==void 0?a:d.weekStartsOn)!==null&&i!==void 0?i:(c=d.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&r!==void 0?r:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var g=nt(n),v=Lt(t),x=g.getUTCDay(),p=v%7,b=(p+7)%7,m=(b<f?7:0)+v-x;return g.setUTCDate(g.getUTCDate()+m),g}var Lx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",90),V(G(r),"incompatibleTokens",["D","i","e","c","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){switch(a){case"E":case"EE":case"EEE":return s.day(i,{width:"abbreviated",context:"formatting"})||s.day(i,{width:"short",context:"formatting"})||s.day(i,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(i,{width:"short",context:"formatting"})||s.day(i,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(i,{width:"wide",context:"formatting"})||s.day(i,{width:"abbreviated",context:"formatting"})||s.day(i,{width:"short",context:"formatting"})||s.day(i,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(i,a){return a>=0&&a<=6}},{key:"set",value:function(i,a,s,o){return i=Is(i,s,o),i.setUTCHours(0,0,0,0),i}}]),e}(wt),Ix=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",90),V(G(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s,o){var l=function(u){var d=Math.floor((u-1)/7)*7;return(u+o.weekStartsOn+6)%7+d};switch(a){case"e":case"ee":return Xt(Vt(a.length,i),l);case"eo":return Xt(s.ordinalNumber(i,{unit:"day"}),l);case"eee":return s.day(i,{width:"abbreviated",context:"formatting"})||s.day(i,{width:"short",context:"formatting"})||s.day(i,{width:"narrow",context:"formatting"});case"eeeee":return s.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(i,{width:"short",context:"formatting"})||s.day(i,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(i,{width:"wide",context:"formatting"})||s.day(i,{width:"abbreviated",context:"formatting"})||s.day(i,{width:"short",context:"formatting"})||s.day(i,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(i,a){return a>=0&&a<=6}},{key:"set",value:function(i,a,s,o){return i=Is(i,s,o),i.setUTCHours(0,0,0,0),i}}]),e}(wt),Nx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",90),V(G(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s,o){var l=function(u){var d=Math.floor((u-1)/7)*7;return(u+o.weekStartsOn+6)%7+d};switch(a){case"c":case"cc":return Xt(Vt(a.length,i),l);case"co":return Xt(s.ordinalNumber(i,{unit:"day"}),l);case"ccc":return s.day(i,{width:"abbreviated",context:"standalone"})||s.day(i,{width:"short",context:"standalone"})||s.day(i,{width:"narrow",context:"standalone"});case"ccccc":return s.day(i,{width:"narrow",context:"standalone"});case"cccccc":return s.day(i,{width:"short",context:"standalone"})||s.day(i,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(i,{width:"wide",context:"standalone"})||s.day(i,{width:"abbreviated",context:"standalone"})||s.day(i,{width:"short",context:"standalone"})||s.day(i,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(i,a){return a>=0&&a<=6}},{key:"set",value:function(i,a,s,o){return i=Is(i,s,o),i.setUTCHours(0,0,0,0),i}}]),e}(wt);function Fx(n,t){J(2,arguments);var e=Lt(t);e%7===0&&(e=e-7);var r=1,i=nt(n),a=i.getUTCDay(),s=e%7,o=(s+7)%7,l=(o<r?7:0)+e-a;return i.setUTCDate(i.getUTCDate()+l),i}var Bx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",90),V(G(r),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){var o=function(c){return c===0?7:c};switch(a){case"i":case"ii":return Vt(a.length,i);case"io":return s.ordinalNumber(i,{unit:"day"});case"iii":return Xt(s.day(i,{width:"abbreviated",context:"formatting"})||s.day(i,{width:"short",context:"formatting"})||s.day(i,{width:"narrow",context:"formatting"}),o);case"iiiii":return Xt(s.day(i,{width:"narrow",context:"formatting"}),o);case"iiiiii":return Xt(s.day(i,{width:"short",context:"formatting"})||s.day(i,{width:"narrow",context:"formatting"}),o);case"iiii":default:return Xt(s.day(i,{width:"wide",context:"formatting"})||s.day(i,{width:"abbreviated",context:"formatting"})||s.day(i,{width:"short",context:"formatting"})||s.day(i,{width:"narrow",context:"formatting"}),o)}}},{key:"validate",value:function(i,a){return a>=1&&a<=7}},{key:"set",value:function(i,a,s){return i=Fx(i,s),i.setUTCHours(0,0,0,0),i}}]),e}(wt),Ux=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",80),V(G(r),"incompatibleTokens",["b","B","H","k","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){switch(a){case"a":case"aa":case"aaa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"})||s.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(i,{width:"wide",context:"formatting"})||s.dayPeriod(i,{width:"abbreviated",context:"formatting"})||s.dayPeriod(i,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(i,a,s){return i.setUTCHours(Ls(s),0,0,0),i}}]),e}(wt),Wx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",80),V(G(r),"incompatibleTokens",["a","B","H","k","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){switch(a){case"b":case"bb":case"bbb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"})||s.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(i,{width:"wide",context:"formatting"})||s.dayPeriod(i,{width:"abbreviated",context:"formatting"})||s.dayPeriod(i,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(i,a,s){return i.setUTCHours(Ls(s),0,0,0),i}}]),e}(wt),Yx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",80),V(G(r),"incompatibleTokens",["a","b","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){switch(a){case"B":case"BB":case"BBB":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"})||s.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(i,{width:"wide",context:"formatting"})||s.dayPeriod(i,{width:"abbreviated",context:"formatting"})||s.dayPeriod(i,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(i,a,s){return i.setUTCHours(Ls(s),0,0,0),i}}]),e}(wt),Hx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",70),V(G(r),"incompatibleTokens",["H","K","k","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){switch(a){case"h":return Wt(qt.hour12h,i);case"ho":return s.ordinalNumber(i,{unit:"hour"});default:return Vt(a.length,i)}}},{key:"validate",value:function(i,a){return a>=1&&a<=12}},{key:"set",value:function(i,a,s){var o=i.getUTCHours()>=12;return o&&s<12?i.setUTCHours(s+12,0,0,0):!o&&s===12?i.setUTCHours(0,0,0,0):i.setUTCHours(s,0,0,0),i}}]),e}(wt),zx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",70),V(G(r),"incompatibleTokens",["a","b","h","K","k","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){switch(a){case"H":return Wt(qt.hour23h,i);case"Ho":return s.ordinalNumber(i,{unit:"hour"});default:return Vt(a.length,i)}}},{key:"validate",value:function(i,a){return a>=0&&a<=23}},{key:"set",value:function(i,a,s){return i.setUTCHours(s,0,0,0),i}}]),e}(wt),$x=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",70),V(G(r),"incompatibleTokens",["h","H","k","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){switch(a){case"K":return Wt(qt.hour11h,i);case"Ko":return s.ordinalNumber(i,{unit:"hour"});default:return Vt(a.length,i)}}},{key:"validate",value:function(i,a){return a>=0&&a<=11}},{key:"set",value:function(i,a,s){var o=i.getUTCHours()>=12;return o&&s<12?i.setUTCHours(s+12,0,0,0):i.setUTCHours(s,0,0,0),i}}]),e}(wt),jx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",70),V(G(r),"incompatibleTokens",["a","b","h","H","K","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){switch(a){case"k":return Wt(qt.hour24h,i);case"ko":return s.ordinalNumber(i,{unit:"hour"});default:return Vt(a.length,i)}}},{key:"validate",value:function(i,a){return a>=1&&a<=24}},{key:"set",value:function(i,a,s){var o=s<=24?s%24:s;return i.setUTCHours(o,0,0,0),i}}]),e}(wt),Vx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",60),V(G(r),"incompatibleTokens",["t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){switch(a){case"m":return Wt(qt.minute,i);case"mo":return s.ordinalNumber(i,{unit:"minute"});default:return Vt(a.length,i)}}},{key:"validate",value:function(i,a){return a>=0&&a<=59}},{key:"set",value:function(i,a,s){return i.setUTCMinutes(s,0,0),i}}]),e}(wt),qx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",50),V(G(r),"incompatibleTokens",["t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){switch(a){case"s":return Wt(qt.second,i);case"so":return s.ordinalNumber(i,{unit:"second"});default:return Vt(a.length,i)}}},{key:"validate",value:function(i,a){return a>=0&&a<=59}},{key:"set",value:function(i,a,s){return i.setUTCSeconds(s,0),i}}]),e}(wt),Xx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",30),V(G(r),"incompatibleTokens",["t","T"]),r}return gt(e,[{key:"parse",value:function(i,a){var s=function(l){return Math.floor(l*Math.pow(10,-a.length+3))};return Xt(Vt(a.length,i),s)}},{key:"set",value:function(i,a,s){return i.setUTCMilliseconds(s),i}}]),e}(wt),Gx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",10),V(G(r),"incompatibleTokens",["t","T","x"]),r}return gt(e,[{key:"parse",value:function(i,a){switch(a){case"X":return We(Ue.basicOptionalMinutes,i);case"XX":return We(Ue.basic,i);case"XXXX":return We(Ue.basicOptionalSeconds,i);case"XXXXX":return We(Ue.extendedOptionalSeconds,i);case"XXX":default:return We(Ue.extended,i)}}},{key:"set",value:function(i,a,s){return a.timestampIsSet?i:new Date(i.getTime()-s)}}]),e}(wt),Kx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",10),V(G(r),"incompatibleTokens",["t","T","X"]),r}return gt(e,[{key:"parse",value:function(i,a){switch(a){case"x":return We(Ue.basicOptionalMinutes,i);case"xx":return We(Ue.basic,i);case"xxxx":return We(Ue.basicOptionalSeconds,i);case"xxxxx":return We(Ue.extendedOptionalSeconds,i);case"xxx":default:return We(Ue.extended,i)}}},{key:"set",value:function(i,a,s){return a.timestampIsSet?i:new Date(i.getTime()-s)}}]),e}(wt),Qx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",40),V(G(r),"incompatibleTokens","*"),r}return gt(e,[{key:"parse",value:function(i){return qd(i)}},{key:"set",value:function(i,a,s){return[new Date(s*1e3),{timestampIsSet:!0}]}}]),e}(wt),Zx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",20),V(G(r),"incompatibleTokens","*"),r}return gt(e,[{key:"parse",value:function(i){return qd(i)}},{key:"set",value:function(i,a,s){return[new Date(s),{timestampIsSet:!0}]}}]),e}(wt),Jx={G:new bx,y:new yx,Y:new vx,R:new xx,u:new wx,Q:new _x,q:new Tx,M:new Mx,L:new Dx,w:new kx,I:new Ox,d:new Ax,D:new Rx,E:new Lx,e:new Ix,c:new Nx,i:new Bx,a:new Ux,b:new Wx,B:new Yx,h:new Hx,H:new zx,K:new $x,k:new jx,m:new Vx,s:new qx,S:new Xx,X:new Gx,x:new Kx,t:new Qx,T:new Zx},tw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ew=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,nw=/^'([^]*?)'?$/,rw=/''/g,iw=/\S/,aw=/[a-zA-Z]/;function sw(n,t,e,r){var i,a,s,o,l,c,u,d,f,g,v,x,p,b,m,y,w,T;J(3,arguments);var S=String(n),k=String(t),M=vn(),D=(i=(a=r==null?void 0:r.locale)!==null&&a!==void 0?a:M.locale)!==null&&i!==void 0?i:Yd;if(!D.match)throw new RangeError("locale must contain match property");var O=Lt((s=(o=(l=(c=r==null?void 0:r.firstWeekContainsDate)!==null&&c!==void 0?c:r==null||(u=r.locale)===null||u===void 0||(d=u.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&l!==void 0?l:M.firstWeekContainsDate)!==null&&o!==void 0?o:(f=M.locale)===null||f===void 0||(g=f.options)===null||g===void 0?void 0:g.firstWeekContainsDate)!==null&&s!==void 0?s:1);if(!(O>=1&&O<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var P=Lt((v=(x=(p=(b=r==null?void 0:r.weekStartsOn)!==null&&b!==void 0?b:r==null||(m=r.locale)===null||m===void 0||(y=m.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&p!==void 0?p:M.weekStartsOn)!==null&&x!==void 0?x:(w=M.locale)===null||w===void 0||(T=w.options)===null||T===void 0?void 0:T.weekStartsOn)!==null&&v!==void 0?v:0);if(!(P>=0&&P<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(k==="")return S===""?nt(e):new Date(NaN);var A={firstWeekContainsDate:O,weekStartsOn:P,locale:D},F=[new mx],q=k.match(ew).map(function(N){var R=N[0];if(R in Es){var Q=Es[R];return Q(N,D.formatLong)}return N}).join("").match(tw),$=[],H=zd(q),I;try{var it=function(){var R=I.value;!(r!=null&&r.useAdditionalWeekYearTokens)&&Wd(R)&&Ji(R,k,n),!(r!=null&&r.useAdditionalDayOfYearTokens)&&Ud(R)&&Ji(R,k,n);var Q=R[0],X=Jx[Q];if(X){var vt=X.incompatibleTokens;if(Array.isArray(vt)){var ut=$.find(function(_t){return vt.includes(_t.token)||_t.token===Q});if(ut)throw new RangeError("The format string mustn't contain `".concat(ut.fullToken,"` and `").concat(R,"` at the same time"))}else if(X.incompatibleTokens==="*"&&$.length>0)throw new RangeError("The format string mustn't contain `".concat(R,"` and any other token at the same time"));$.push({token:Q,fullToken:R});var Pt=X.run(S,R,D.match,A);if(!Pt)return{v:new Date(NaN)};F.push(Pt.setter),S=Pt.rest}else{if(Q.match(aw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+Q+"`");if(R==="''"?R="'":Q==="'"&&(R=ow(R)),S.indexOf(R)===0)S=S.slice(R.length);else return{v:new Date(NaN)}}};for(H.s();!(I=H.n()).done;){var U=it();if(Ze(U)==="object")return U.v}}catch(N){H.e(N)}finally{H.f()}if(S.length>0&&iw.test(S))return new Date(NaN);var yt=F.map(function(N){return N.priority}).sort(function(N,R){return R-N}).filter(function(N,R,Q){return Q.indexOf(N)===R}).map(function(N){return F.filter(function(R){return R.priority===N}).sort(function(R,Q){return Q.subPriority-R.subPriority})}).map(function(N){return N[0]}),dt=nt(e);if(isNaN(dt.getTime()))return new Date(NaN);var Y=Ed(dt,Ki(dt)),L={},B=zd(yt),j;try{for(B.s();!(j=B.n()).done;){var Z=j.value;if(!Z.validate(Y,A))return new Date(NaN);var K=Z.set(Y,L,A);Array.isArray(K)?(Y=K[0],cx(L,K[1])):Y=K}}catch(N){B.e(N)}finally{B.f()}return Y}function ow(n){return n.match(nw)[1].replace(rw,"'")}function lw(n){J(1,arguments);var t=nt(n);return t.setMinutes(0,0,0),t}function cw(n){J(1,arguments);var t=nt(n);return t.setMilliseconds(0),t}function uw(n){J(1,arguments);var t=n/Zr;return Math.floor(t)}function Kd(n,t){var e;J(1,arguments);var r=Lt((e=t==null?void 0:t.additionalDigits)!==null&&e!==void 0?e:2);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof n=="string"||Object.prototype.toString.call(n)==="[object String]"))return new Date(NaN);var i=gw(n),a;if(i.date){var s=pw(i.date,r);a=mw(s.restDateString,s.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);var o=a.getTime(),l=0,c;if(i.time&&(l=bw(i.time),isNaN(l)))return new Date(NaN);if(i.timezone){if(c=yw(i.timezone),isNaN(c))return new Date(NaN)}else{var u=new Date(o+l),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return new Date(o+l+c)}var na={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},dw=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,fw=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,hw=/^([+-])(\d{2})(?::?(\d{2}))?$/;function gw(n){var t={},e=n.split(na.dateTimeDelimiter),r;if(e.length>2)return t;if(/:/.test(e[0])?r=e[0]:(t.date=e[0],r=e[1],na.timeZoneDelimiter.test(t.date)&&(t.date=n.split(na.timeZoneDelimiter)[0],r=n.substr(t.date.length,n.length))),r){var i=na.timezone.exec(r);i?(t.time=r.replace(i[1],""),t.timezone=i[1]):t.time=r}return t}function pw(n,t){var e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=n.match(e);if(!r)return{year:NaN,restDateString:""};var i=r[1]?parseInt(r[1]):null,a=r[2]?parseInt(r[2]):null;return{year:a===null?i:a*100,restDateString:n.slice((r[1]||r[2]).length)}}function mw(n,t){if(t===null)return new Date(NaN);var e=n.match(dw);if(!e)return new Date(NaN);var r=!!e[4],i=ni(e[1]),a=ni(e[2])-1,s=ni(e[3]),o=ni(e[4]),l=ni(e[5])-1;if(r)return Tw(t,o,l)?vw(t,o,l):new Date(NaN);var c=new Date(0);return!ww(t,a,s)||!_w(t,i)?new Date(NaN):(c.setUTCFullYear(t,a,Math.max(i,s)),c)}function ni(n){return n?parseInt(n):1}function bw(n){var t=n.match(fw);if(!t)return NaN;var e=Ns(t[1]),r=Ns(t[2]),i=Ns(t[3]);return Mw(e,r,i)?e*Zr+r*Qi+i*1e3:NaN}function Ns(n){return n&&parseFloat(n.replace(",","."))||0}function yw(n){if(n==="Z")return 0;var t=n.match(hw);if(!t)return 0;var e=t[1]==="+"?-1:1,r=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;return Dw(r,i)?e*(r*Zr+i*Qi):NaN}function vw(n,t,e){var r=new Date(0);r.setUTCFullYear(n,0,4);var i=r.getUTCDay()||7,a=(t-1)*7+e+1-i;return r.setUTCDate(r.getUTCDate()+a),r}var xw=[31,null,31,30,31,30,31,31,30,31,30,31];function Qd(n){return n%400===0||n%4===0&&n%100!==0}function ww(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(xw[t]||(Qd(n)?29:28))}function _w(n,t){return t>=1&&t<=(Qd(n)?366:365)}function Tw(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function Mw(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function Dw(n,t){return t>=0&&t<=59}var ne=(n=>(n.DOUGHNUT="Doughnut",n.HORIZONTAL_BAR="HorizontalBar",n.VERTICAL_BAR="VerticalBar",n.TIMESERIES_LINE="Line",n.TIMESERIES_BAR="TimeSeriesBar",n))(ne||{}),ra=(n=>(n.GAUGE="Gauge",n.TOPN="TopN",n))(ra||{}),Yt=(n=>(n.Hidden="hidden",n.Right="right",n.Bottom="bottom",n))(Yt||{}),lr=(n=>(n.Hidden="hidden",n.SingleMetric="single",n.Full="full",n))(lr||{});const Fs=(n,t)=>{var i,a;const{tooltip:e}=t;if(e.opacity===0&&!n.locked){n.showTooltip=!1;return}const r=n.chartTooltipSortFn||((s,o)=>o.rawValue-s.rawValue);if(e.body&&!n.locked){const s=e.labelColors,o=((a=(i=t.chart.config)==null?void 0:i.options)==null?void 0:a.indexAxis)==="y"?"x":"y",l=[ne.HORIZONTAL_BAR,ne.VERTICAL_BAR].includes(n.chartType),c=[ra.GAUGE,ne.DOUGHNUT].includes(n.chartType);n.tooltipContext=l?e.dataPoints.length>1?e.dataPoints[0].label:"":e.dataPoints[0].parsed.x,n.tooltipSeries=e.dataPoints.map((u,d)=>{const f=c?u.parsed:u.parsed[o];let g;if(n.units==="bytes")g=isNaN(f)?f:Cs(f);else{const x=n.translateUnit(n.units,f);g=`${f%1===0?aa.format(f):aa.format(Number(f.toFixed(wf)))} ${x}`}const v=l&&u.dataset.label!==u.label?u.dataset.label:c?u.dataset.labels[u.dataIndex]:u.dataset.label;return{backgroundColor:s[d].backgroundColor,borderColor:s[d].borderColor,label:v,value:g,rawValue:f}}).sort(r),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},Cw=n=>n&&n.datasets&&n.datasets.length,kw=n=>Cw(n)&&n.datasets.some(t=>t.data.length),Sw=n=>kw(n)&&n.datasets.some(t=>t.data.length>1),Ow=n=>Sw(n)&&n.datasets.some(t=>t.data[0]&&Os(t.data[0].x)),Pw=n=>Ow(n)&&n.datasets.some(t=>t.data[0]&&t.data[0].x.toString().length>=13),Bs=(n,t,e)=>{const i=Math.min(t/1150,1),a=.15,s=1.15;return n.x<e?n.x+t*a*(1-i):n.x-t*s*(1-i)},Ew=(n,t,e)=>n.y<e?n.y+t*.15:n.y-t*.5;function Zd(n,t){let e;return(...r)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...r)},t)}}var me=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Wn(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Us={exports:{}},Jd={exports:{}};(function(n){function t(e){return e&&e.__esModule?e:{default:e}}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(Jd);var Ht=Jd.exports,Ws={exports:{}},Ys={exports:{}},tf={exports:{}};(function(n){function t(e){"@babel/helpers - typeof";return n.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},n.exports.__esModule=!0,n.exports.default=n.exports,t(e)}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(tf);var ef=tf.exports,Hs={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r,i){if(i.length<r)throw new TypeError(r+" argument"+(r>1?"s":"")+" required, but only "+i.length+" present")}n.exports=t.default})(Hs,Hs.exports);var se=Hs.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var r=e(ef),i=e(se);function a(s){return(0,i.default)(1,arguments),s instanceof Date||(0,r.default)(s)==="object"&&Object.prototype.toString.call(s)==="[object Date]"}n.exports=t.default})(Ys,Ys.exports);var Aw=Ys.exports,zs={exports:{}};(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var r=e(ef),i=e(se);function a(s){(0,i.default)(1,arguments);var o=Object.prototype.toString.call(s);return s instanceof Date||(0,r.default)(s)==="object"&&o==="[object Date]"?new Date(s.getTime()):typeof s=="number"||o==="[object Number]"?new Date(s):((typeof s=="string"||o==="[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))}n.exports=t.default})(zs,zs.exports);var Ye=zs.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e(Aw),i=e(Ye),a=e(se);function s(o){if((0,a.default)(1,arguments),!(0,r.default)(o)&&typeof o!="number")return!1;var l=(0,i.default)(o);return!isNaN(Number(l))}n.exports=t.default})(Ws,Ws.exports);var Rw=Ws.exports,$s={exports:{}},js={exports:{}},Vs={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r){if(r===null||r===!0||r===!1)return NaN;var i=Number(r);return isNaN(i)?i:i<0?Math.ceil(i):Math.floor(i)}n.exports=t.default})(Vs,Vs.exports);var Yn=Vs.exports;const Lw=Wn(Yn);(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e(Yn),i=e(Ye),a=e(se);function s(o,l){(0,a.default)(2,arguments);var c=(0,i.default)(o).getTime(),u=(0,r.default)(l);return new Date(c+u)}n.exports=t.default})(js,js.exports);var Iw=js.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e(Iw),i=e(se),a=e(Yn);function s(o,l){(0,i.default)(2,arguments);var c=(0,a.default)(l);return(0,r.default)(o,-c)}n.exports=t.default})($s,$s.exports);var Nw=$s.exports,qs={exports:{}},Xs={exports:{}};(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e(Ye),i=e(se),a=864e5;function s(o){(0,i.default)(1,arguments);var l=(0,r.default)(o),c=l.getTime();l.setUTCMonth(0,1),l.setUTCHours(0,0,0,0);var u=l.getTime(),d=c-u;return Math.floor(d/a)+1}n.exports=t.default})(Xs,Xs.exports);var Fw=Xs.exports,Gs={exports:{}},Ks={exports:{}};(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var r=e(Ye),i=e(se);function a(s){(0,i.default)(1,arguments);var o=1,l=(0,r.default)(s),c=l.getUTCDay(),u=(c<o?7:0)+c-o;return l.setUTCDate(l.getUTCDate()-u),l.setUTCHours(0,0,0,0),l}n.exports=t.default})(Ks,Ks.exports);var Qs=Ks.exports,Zs={exports:{}},Js={exports:{}};(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e(Ye),i=e(se),a=e(Qs);function s(o){(0,i.default)(1,arguments);var l=(0,r.default)(o),c=l.getUTCFullYear(),u=new Date(0);u.setUTCFullYear(c+1,0,4),u.setUTCHours(0,0,0,0);var d=(0,a.default)(u),f=new Date(0);f.setUTCFullYear(c,0,4),f.setUTCHours(0,0,0,0);var g=(0,a.default)(f);return l.getTime()>=d.getTime()?c+1:l.getTime()>=g.getTime()?c:c-1}n.exports=t.default})(Js,Js.exports);var nf=Js.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e(nf),i=e(Qs),a=e(se);function s(o){(0,a.default)(1,arguments);var l=(0,r.default)(o),c=new Date(0);c.setUTCFullYear(l,0,4),c.setUTCHours(0,0,0,0);var u=(0,i.default)(c);return u}n.exports=t.default})(Zs,Zs.exports);var Bw=Zs.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var r=e(Ye),i=e(Qs),a=e(Bw),s=e(se),o=6048e5;function l(c){(0,s.default)(1,arguments);var u=(0,r.default)(c),d=(0,i.default)(u).getTime()-(0,a.default)(u).getTime();return Math.round(d/o)+1}n.exports=t.default})(Gs,Gs.exports);var Uw=Gs.exports,to={exports:{}},eo={exports:{}},Hn={};Object.defineProperty(Hn,"__esModule",{value:!0}),Hn.getDefaultOptions=Ww,Hn.setDefaultOptions=Yw;var rf={};function Ww(){return rf}function Yw(n){rf=n}(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var r=e(Ye),i=e(se),a=e(Yn),s=Hn;function o(l,c){var u,d,f,g,v,x,p,b;(0,i.default)(1,arguments);var m=(0,s.getDefaultOptions)(),y=(0,a.default)((u=(d=(f=(g=c==null?void 0:c.weekStartsOn)!==null&&g!==void 0?g:c==null||(v=c.locale)===null||v===void 0||(x=v.options)===null||x===void 0?void 0:x.weekStartsOn)!==null&&f!==void 0?f:m.weekStartsOn)!==null&&d!==void 0?d:(p=m.locale)===null||p===void 0||(b=p.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&u!==void 0?u:0);if(!(y>=0&&y<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var w=(0,r.default)(l),T=w.getUTCDay(),S=(T<y?7:0)+T-y;return w.setUTCDate(w.getUTCDate()-S),w.setUTCHours(0,0,0,0),w}n.exports=t.default})(eo,eo.exports);var no=eo.exports,ro={exports:{}},io={exports:{}};(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var r=e(Ye),i=e(se),a=e(no),s=e(Yn),o=Hn;function l(c,u){var d,f,g,v,x,p,b,m;(0,i.default)(1,arguments);var y=(0,r.default)(c),w=y.getUTCFullYear(),T=(0,o.getDefaultOptions)(),S=(0,s.default)((d=(f=(g=(v=u==null?void 0:u.firstWeekContainsDate)!==null&&v!==void 0?v:u==null||(x=u.locale)===null||x===void 0||(p=x.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&g!==void 0?g:T.firstWeekContainsDate)!==null&&f!==void 0?f:(b=T.locale)===null||b===void 0||(m=b.options)===null||m===void 0?void 0:m.firstWeekContainsDate)!==null&&d!==void 0?d:1);if(!(S>=1&&S<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var k=new Date(0);k.setUTCFullYear(w+1,0,S),k.setUTCHours(0,0,0,0);var M=(0,a.default)(k,u),D=new Date(0);D.setUTCFullYear(w,0,S),D.setUTCHours(0,0,0,0);var O=(0,a.default)(D,u);return y.getTime()>=M.getTime()?w+1:y.getTime()>=O.getTime()?w:w-1}n.exports=t.default})(io,io.exports);var af=io.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var r=e(af),i=e(se),a=e(no),s=e(Yn),o=Hn;function l(c,u){var d,f,g,v,x,p,b,m;(0,i.default)(1,arguments);var y=(0,o.getDefaultOptions)(),w=(0,s.default)((d=(f=(g=(v=u==null?void 0:u.firstWeekContainsDate)!==null&&v!==void 0?v:u==null||(x=u.locale)===null||x===void 0||(p=x.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&g!==void 0?g:y.firstWeekContainsDate)!==null&&f!==void 0?f:(b=y.locale)===null||b===void 0||(m=b.options)===null||m===void 0?void 0:m.firstWeekContainsDate)!==null&&d!==void 0?d:1),T=(0,r.default)(c,u),S=new Date(0);S.setUTCFullYear(T,0,w),S.setUTCHours(0,0,0,0);var k=(0,a.default)(S,u);return k}n.exports=t.default})(ro,ro.exports);var Hw=ro.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var r=e(Ye),i=e(no),a=e(Hw),s=e(se),o=6048e5;function l(c,u){(0,s.default)(1,arguments);var d=(0,r.default)(c),f=(0,i.default)(d,u).getTime()-(0,a.default)(d,u).getTime();return Math.round(f/o)+1}n.exports=t.default})(to,to.exports);var zw=to.exports,ao={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r,i){for(var a=r<0?"-":"",s=Math.abs(r).toString();s.length<i;)s="0"+s;return a+s}n.exports=t.default})(ao,ao.exports);var sf=ao.exports,so={exports:{}};(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(sf),i={y:function(o,l){var c=o.getUTCFullYear(),u=c>0?c:1-c;return(0,r.default)(l==="yy"?u%100:u,l.length)},M:function(o,l){var c=o.getUTCMonth();return l==="M"?String(c+1):(0,r.default)(c+1,2)},d:function(o,l){return(0,r.default)(o.getUTCDate(),l.length)},a:function(o,l){var c=o.getUTCHours()/12>=1?"pm":"am";switch(l){case"a":case"aa":return c.toUpperCase();case"aaa":return c;case"aaaaa":return c[0];case"aaaa":default:return c==="am"?"a.m.":"p.m."}},h:function(o,l){return(0,r.default)(o.getUTCHours()%12||12,l.length)},H:function(o,l){return(0,r.default)(o.getUTCHours(),l.length)},m:function(o,l){return(0,r.default)(o.getUTCMinutes(),l.length)},s:function(o,l){return(0,r.default)(o.getUTCSeconds(),l.length)},S:function(o,l){var c=l.length,u=o.getUTCMilliseconds(),d=Math.floor(u*Math.pow(10,c-3));return(0,r.default)(d,l.length)}},a=i;t.default=a,n.exports=t.default})(so,so.exports);var $w=so.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(Fw),i=e(Uw),a=e(nf),s=e(zw),o=e(af),l=e(sf),c=e($w),u={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},d={G:function(b,m,y){var w=b.getUTCFullYear()>0?1:0;switch(m){case"G":case"GG":case"GGG":return y.era(w,{width:"abbreviated"});case"GGGGG":return y.era(w,{width:"narrow"});case"GGGG":default:return y.era(w,{width:"wide"})}},y:function(b,m,y){if(m==="yo"){var w=b.getUTCFullYear(),T=w>0?w:1-w;return y.ordinalNumber(T,{unit:"year"})}return c.default.y(b,m)},Y:function(b,m,y,w){var T=(0,o.default)(b,w),S=T>0?T:1-T;if(m==="YY"){var k=S%100;return(0,l.default)(k,2)}return m==="Yo"?y.ordinalNumber(S,{unit:"year"}):(0,l.default)(S,m.length)},R:function(b,m){var y=(0,a.default)(b);return(0,l.default)(y,m.length)},u:function(b,m){var y=b.getUTCFullYear();return(0,l.default)(y,m.length)},Q:function(b,m,y){var w=Math.ceil((b.getUTCMonth()+1)/3);switch(m){case"Q":return String(w);case"QQ":return(0,l.default)(w,2);case"Qo":return y.ordinalNumber(w,{unit:"quarter"});case"QQQ":return y.quarter(w,{width:"abbreviated",context:"formatting"});case"QQQQQ":return y.quarter(w,{width:"narrow",context:"formatting"});case"QQQQ":default:return y.quarter(w,{width:"wide",context:"formatting"})}},q:function(b,m,y){var w=Math.ceil((b.getUTCMonth()+1)/3);switch(m){case"q":return String(w);case"qq":return(0,l.default)(w,2);case"qo":return y.ordinalNumber(w,{unit:"quarter"});case"qqq":return y.quarter(w,{width:"abbreviated",context:"standalone"});case"qqqqq":return y.quarter(w,{width:"narrow",context:"standalone"});case"qqqq":default:return y.quarter(w,{width:"wide",context:"standalone"})}},M:function(b,m,y){var w=b.getUTCMonth();switch(m){case"M":case"MM":return c.default.M(b,m);case"Mo":return y.ordinalNumber(w+1,{unit:"month"});case"MMM":return y.month(w,{width:"abbreviated",context:"formatting"});case"MMMMM":return y.month(w,{width:"narrow",context:"formatting"});case"MMMM":default:return y.month(w,{width:"wide",context:"formatting"})}},L:function(b,m,y){var w=b.getUTCMonth();switch(m){case"L":return String(w+1);case"LL":return(0,l.default)(w+1,2);case"Lo":return y.ordinalNumber(w+1,{unit:"month"});case"LLL":return y.month(w,{width:"abbreviated",context:"standalone"});case"LLLLL":return y.month(w,{width:"narrow",context:"standalone"});case"LLLL":default:return y.month(w,{width:"wide",context:"standalone"})}},w:function(b,m,y,w){var T=(0,s.default)(b,w);return m==="wo"?y.ordinalNumber(T,{unit:"week"}):(0,l.default)(T,m.length)},I:function(b,m,y){var w=(0,i.default)(b);return m==="Io"?y.ordinalNumber(w,{unit:"week"}):(0,l.default)(w,m.length)},d:function(b,m,y){return m==="do"?y.ordinalNumber(b.getUTCDate(),{unit:"date"}):c.default.d(b,m)},D:function(b,m,y){var w=(0,r.default)(b);return m==="Do"?y.ordinalNumber(w,{unit:"dayOfYear"}):(0,l.default)(w,m.length)},E:function(b,m,y){var w=b.getUTCDay();switch(m){case"E":case"EE":case"EEE":return y.day(w,{width:"abbreviated",context:"formatting"});case"EEEEE":return y.day(w,{width:"narrow",context:"formatting"});case"EEEEEE":return y.day(w,{width:"short",context:"formatting"});case"EEEE":default:return y.day(w,{width:"wide",context:"formatting"})}},e:function(b,m,y,w){var T=b.getUTCDay(),S=(T-w.weekStartsOn+8)%7||7;switch(m){case"e":return String(S);case"ee":return(0,l.default)(S,2);case"eo":return y.ordinalNumber(S,{unit:"day"});case"eee":return y.day(T,{width:"abbreviated",context:"formatting"});case"eeeee":return y.day(T,{width:"narrow",context:"formatting"});case"eeeeee":return y.day(T,{width:"short",context:"formatting"});case"eeee":default:return y.day(T,{width:"wide",context:"formatting"})}},c:function(b,m,y,w){var T=b.getUTCDay(),S=(T-w.weekStartsOn+8)%7||7;switch(m){case"c":return String(S);case"cc":return(0,l.default)(S,m.length);case"co":return y.ordinalNumber(S,{unit:"day"});case"ccc":return y.day(T,{width:"abbreviated",context:"standalone"});case"ccccc":return y.day(T,{width:"narrow",context:"standalone"});case"cccccc":return y.day(T,{width:"short",context:"standalone"});case"cccc":default:return y.day(T,{width:"wide",context:"standalone"})}},i:function(b,m,y){var w=b.getUTCDay(),T=w===0?7:w;switch(m){case"i":return String(T);case"ii":return(0,l.default)(T,m.length);case"io":return y.ordinalNumber(T,{unit:"day"});case"iii":return y.day(w,{width:"abbreviated",context:"formatting"});case"iiiii":return y.day(w,{width:"narrow",context:"formatting"});case"iiiiii":return y.day(w,{width:"short",context:"formatting"});case"iiii":default:return y.day(w,{width:"wide",context:"formatting"})}},a:function(b,m,y){var w=b.getUTCHours(),T=w/12>=1?"pm":"am";switch(m){case"a":case"aa":return y.dayPeriod(T,{width:"abbreviated",context:"formatting"});case"aaa":return y.dayPeriod(T,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return y.dayPeriod(T,{width:"narrow",context:"formatting"});case"aaaa":default:return y.dayPeriod(T,{width:"wide",context:"formatting"})}},b:function(b,m,y){var w=b.getUTCHours(),T;switch(w===12?T=u.noon:w===0?T=u.midnight:T=w/12>=1?"pm":"am",m){case"b":case"bb":return y.dayPeriod(T,{width:"abbreviated",context:"formatting"});case"bbb":return y.dayPeriod(T,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return y.dayPeriod(T,{width:"narrow",context:"formatting"});case"bbbb":default:return y.dayPeriod(T,{width:"wide",context:"formatting"})}},B:function(b,m,y){var w=b.getUTCHours(),T;switch(w>=17?T=u.evening:w>=12?T=u.afternoon:w>=4?T=u.morning:T=u.night,m){case"B":case"BB":case"BBB":return y.dayPeriod(T,{width:"abbreviated",context:"formatting"});case"BBBBB":return y.dayPeriod(T,{width:"narrow",context:"formatting"});case"BBBB":default:return y.dayPeriod(T,{width:"wide",context:"formatting"})}},h:function(b,m,y){if(m==="ho"){var w=b.getUTCHours()%12;return w===0&&(w=12),y.ordinalNumber(w,{unit:"hour"})}return c.default.h(b,m)},H:function(b,m,y){return m==="Ho"?y.ordinalNumber(b.getUTCHours(),{unit:"hour"}):c.default.H(b,m)},K:function(b,m,y){var w=b.getUTCHours()%12;return m==="Ko"?y.ordinalNumber(w,{unit:"hour"}):(0,l.default)(w,m.length)},k:function(b,m,y){var w=b.getUTCHours();return w===0&&(w=24),m==="ko"?y.ordinalNumber(w,{unit:"hour"}):(0,l.default)(w,m.length)},m:function(b,m,y){return m==="mo"?y.ordinalNumber(b.getUTCMinutes(),{unit:"minute"}):c.default.m(b,m)},s:function(b,m,y){return m==="so"?y.ordinalNumber(b.getUTCSeconds(),{unit:"second"}):c.default.s(b,m)},S:function(b,m){return c.default.S(b,m)},X:function(b,m,y,w){var T=w._originalDate||b,S=T.getTimezoneOffset();if(S===0)return"Z";switch(m){case"X":return g(S);case"XXXX":case"XX":return v(S);case"XXXXX":case"XXX":default:return v(S,":")}},x:function(b,m,y,w){var T=w._originalDate||b,S=T.getTimezoneOffset();switch(m){case"x":return g(S);case"xxxx":case"xx":return v(S);case"xxxxx":case"xxx":default:return v(S,":")}},O:function(b,m,y,w){var T=w._originalDate||b,S=T.getTimezoneOffset();switch(m){case"O":case"OO":case"OOO":return"GMT"+f(S,":");case"OOOO":default:return"GMT"+v(S,":")}},z:function(b,m,y,w){var T=w._originalDate||b,S=T.getTimezoneOffset();switch(m){case"z":case"zz":case"zzz":return"GMT"+f(S,":");case"zzzz":default:return"GMT"+v(S,":")}},t:function(b,m,y,w){var T=w._originalDate||b,S=Math.floor(T.getTime()/1e3);return(0,l.default)(S,m.length)},T:function(b,m,y,w){var T=w._originalDate||b,S=T.getTime();return(0,l.default)(S,m.length)}};function f(p,b){var m=p>0?"-":"+",y=Math.abs(p),w=Math.floor(y/60),T=y%60;if(T===0)return m+String(w);var S=b||"";return m+String(w)+S+(0,l.default)(T,2)}function g(p,b){if(p%60===0){var m=p>0?"-":"+";return m+(0,l.default)(Math.abs(p)/60,2)}return v(p,b)}function v(p,b){var m=b||"",y=p>0?"-":"+",w=Math.abs(p),T=(0,l.default)(Math.floor(w/60),2),S=(0,l.default)(w%60,2);return y+T+m+S}var x=d;t.default=x,n.exports=t.default})(qs,qs.exports);var jw=qs.exports,oo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(l,c){switch(l){case"P":return c.date({width:"short"});case"PP":return c.date({width:"medium"});case"PPP":return c.date({width:"long"});case"PPPP":default:return c.date({width:"full"})}},r=function(l,c){switch(l){case"p":return c.time({width:"short"});case"pp":return c.time({width:"medium"});case"ppp":return c.time({width:"long"});case"pppp":default:return c.time({width:"full"})}},i=function(l,c){var u=l.match(/(P+)(p+)?/)||[],d=u[1],f=u[2];if(!f)return e(l,c);var g;switch(d){case"P":g=c.dateTime({width:"short"});break;case"PP":g=c.dateTime({width:"medium"});break;case"PPP":g=c.dateTime({width:"long"});break;case"PPPP":default:g=c.dateTime({width:"full"});break}return g.replace("{{date}}",e(d,c)).replace("{{time}}",r(f,c))},a={p:r,P:i},s=a;t.default=s,n.exports=t.default})(oo,oo.exports);var Vw=oo.exports,lo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r){var i=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return i.setUTCFullYear(r.getFullYear()),r.getTime()-i.getTime()}n.exports=t.default})(lo,lo.exports);var of=lo.exports;const lf=Wn(of);var ri={};Object.defineProperty(ri,"__esModule",{value:!0}),ri.isProtectedDayOfYearToken=Gw,ri.isProtectedWeekYearToken=Kw,ri.throwProtectedError=Qw;var qw=["D","DD"],Xw=["YY","YYYY"];function Gw(n){return qw.indexOf(n)!==-1}function Kw(n){return Xw.indexOf(n)!==-1}function Qw(n,t,e){if(n==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var co={exports:{}},uo={exports:{}},fo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e={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"}},r=function(s,o,l){var c,u=e[s];return typeof u=="string"?c=u:o===1?c=u.one:c=u.other.replace("{{count}}",o.toString()),l!=null&&l.addSuffix?l.comparison&&l.comparison>0?"in "+c:c+" ago":c},i=r;t.default=i,n.exports=t.default})(fo,fo.exports);var Zw=fo.exports,ho={exports:{}},go={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r){return function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=i.width?String(i.width):r.defaultWidth,s=r.formats[a]||r.formats[r.defaultWidth];return s}}n.exports=t.default})(go,go.exports);var Jw=go.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(Jw),i={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},a={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},s={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},o={date:(0,r.default)({formats:i,defaultWidth:"full"}),time:(0,r.default)({formats:a,defaultWidth:"full"}),dateTime:(0,r.default)({formats:s,defaultWidth:"full"})},l=o;t.default=l,n.exports=t.default})(ho,ho.exports);var t_=ho.exports,po={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},r=function(s,o,l,c){return e[s]},i=r;t.default=i,n.exports=t.default})(po,po.exports);var e_=po.exports,mo={exports:{}},bo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r){return function(i,a){var s=a!=null&&a.context?String(a.context):"standalone",o;if(s==="formatting"&&r.formattingValues){var l=r.defaultFormattingWidth||r.defaultWidth,c=a!=null&&a.width?String(a.width):l;o=r.formattingValues[c]||r.formattingValues[l]}else{var u=r.defaultWidth,d=a!=null&&a.width?String(a.width):r.defaultWidth;o=r.values[d]||r.values[u]}var f=r.argumentCallback?r.argumentCallback(i):i;return o[f]}}n.exports=t.default})(bo,bo.exports);var n_=bo.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(n_),i={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},a={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},s={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"]},o={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"]},l={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"}},c={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"}},u=function(v,x){var p=Number(v),b=p%100;if(b>20||b<10)switch(b%10){case 1:return p+"st";case 2:return p+"nd";case 3:return p+"rd"}return p+"th"},d={ordinalNumber:u,era:(0,r.default)({values:i,defaultWidth:"wide"}),quarter:(0,r.default)({values:a,defaultWidth:"wide",argumentCallback:function(v){return v-1}}),month:(0,r.default)({values:s,defaultWidth:"wide"}),day:(0,r.default)({values:o,defaultWidth:"wide"}),dayPeriod:(0,r.default)({values:l,defaultWidth:"wide",formattingValues:c,defaultFormattingWidth:"wide"})},f=d;t.default=f,n.exports=t.default})(mo,mo.exports);var r_=mo.exports,yo={exports:{}},vo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(a){return function(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=o.width,c=l&&a.matchPatterns[l]||a.matchPatterns[a.defaultMatchWidth],u=s.match(c);if(!u)return null;var d=u[0],f=l&&a.parsePatterns[l]||a.parsePatterns[a.defaultParseWidth],g=Array.isArray(f)?i(f,function(p){return p.test(d)}):r(f,function(p){return p.test(d)}),v;v=a.valueCallback?a.valueCallback(g):g,v=o.valueCallback?o.valueCallback(v):v;var x=s.slice(d.length);return{value:v,rest:x}}}function r(a,s){for(var o in a)if(a.hasOwnProperty(o)&&s(a[o]))return o}function i(a,s){for(var o=0;o<a.length;o++)if(s(a[o]))return o}n.exports=t.default})(vo,vo.exports);var i_=vo.exports,xo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r){return function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=i.match(r.matchPattern);if(!s)return null;var o=s[0],l=i.match(r.parsePattern);if(!l)return null;var c=r.valueCallback?r.valueCallback(l[0]):l[0];c=a.valueCallback?a.valueCallback(c):c;var u=i.slice(o.length);return{value:c,rest:u}}}n.exports=t.default})(xo,xo.exports);var a_=xo.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(i_),i=e(a_),a=/^(\d+)(th|st|nd|rd)?/i,s=/\d+/i,o={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},l={any:[/^b/i,/^(a|c)/i]},c={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},u={any:[/1/i,/2/i,/3/i,/4/i]},d={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},f={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]},g={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},v={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]},x={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},p={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}},b={ordinalNumber:(0,i.default)({matchPattern:a,parsePattern:s,valueCallback:function(w){return parseInt(w,10)}}),era:(0,r.default)({matchPatterns:o,defaultMatchWidth:"wide",parsePatterns:l,defaultParseWidth:"any"}),quarter:(0,r.default)({matchPatterns:c,defaultMatchWidth:"wide",parsePatterns:u,defaultParseWidth:"any",valueCallback:function(w){return w+1}}),month:(0,r.default)({matchPatterns:d,defaultMatchWidth:"wide",parsePatterns:f,defaultParseWidth:"any"}),day:(0,r.default)({matchPatterns:g,defaultMatchWidth:"wide",parsePatterns:v,defaultParseWidth:"any"}),dayPeriod:(0,r.default)({matchPatterns:x,defaultMatchWidth:"any",parsePatterns:p,defaultParseWidth:"any"})},m=b;t.default=m,n.exports=t.default})(yo,yo.exports);var s_=yo.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(Zw),i=e(t_),a=e(e_),s=e(r_),o=e(s_),l={code:"en-US",formatDistance:r.default,formatLong:i.default,formatRelative:a.default,localize:s.default,match:o.default,options:{weekStartsOn:0,firstWeekContainsDate:1}},c=l;t.default=c,n.exports=t.default})(uo,uo.exports);var o_=uo.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(o_),i=r.default;t.default=i,n.exports=t.default})(co,co.exports);var l_=co.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=y;var r=e(Rw),i=e(Nw),a=e(Ye),s=e(jw),o=e(Vw),l=e(of),c=ri,u=e(Yn),d=e(se),f=Hn,g=e(l_),v=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,x=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,p=/^'([^]*?)'?$/,b=/''/g,m=/[a-zA-Z]/;function y(T,S,k){var M,D,O,P,A,F,q,$,H,I,it,U,yt,dt,Y,L,B,j;(0,d.default)(2,arguments);var Z=String(S),K=(0,f.getDefaultOptions)(),N=(M=(D=k==null?void 0:k.locale)!==null&&D!==void 0?D:K.locale)!==null&&M!==void 0?M:g.default,R=(0,u.default)((O=(P=(A=(F=k==null?void 0:k.firstWeekContainsDate)!==null&&F!==void 0?F:k==null||(q=k.locale)===null||q===void 0||($=q.options)===null||$===void 0?void 0:$.firstWeekContainsDate)!==null&&A!==void 0?A:K.firstWeekContainsDate)!==null&&P!==void 0?P:(H=K.locale)===null||H===void 0||(I=H.options)===null||I===void 0?void 0:I.firstWeekContainsDate)!==null&&O!==void 0?O:1);if(!(R>=1&&R<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var Q=(0,u.default)((it=(U=(yt=(dt=k==null?void 0:k.weekStartsOn)!==null&&dt!==void 0?dt:k==null||(Y=k.locale)===null||Y===void 0||(L=Y.options)===null||L===void 0?void 0:L.weekStartsOn)!==null&&yt!==void 0?yt:K.weekStartsOn)!==null&&U!==void 0?U:(B=K.locale)===null||B===void 0||(j=B.options)===null||j===void 0?void 0:j.weekStartsOn)!==null&&it!==void 0?it:0);if(!(Q>=0&&Q<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!N.localize)throw new RangeError("locale must contain localize property");if(!N.formatLong)throw new RangeError("locale must contain formatLong property");var X=(0,a.default)(T);if(!(0,r.default)(X))throw new RangeError("Invalid time value");var vt=(0,l.default)(X),ut=(0,i.default)(X,vt),Pt={firstWeekContainsDate:R,weekStartsOn:Q,locale:N,_originalDate:X},_t=Z.match(x).map(function(et){var xt=et[0];if(xt==="p"||xt==="P"){var Ft=o.default[xt];return Ft(et,N.formatLong)}return et}).join("").match(v).map(function(et){if(et==="''")return"'";var xt=et[0];if(xt==="'")return w(et);var Ft=s.default[xt];if(Ft)return!(k!=null&&k.useAdditionalWeekYearTokens)&&(0,c.isProtectedWeekYearToken)(et)&&(0,c.throwProtectedError)(et,S,String(T)),!(k!=null&&k.useAdditionalDayOfYearTokens)&&(0,c.isProtectedDayOfYearToken)(et)&&(0,c.throwProtectedError)(et,S,String(T)),Ft(ut,et,N.localize,Pt);if(xt.match(m))throw new RangeError("Format string contains an unescaped latin alphabet character `"+xt+"`");return et}).join("");return _t}function w(T){var S=T.match(p);return S?S[1].replace(b,"'"):T}n.exports=t.default})(Us,Us.exports);var c_=Us.exports;const u_=Wn(c_);function cf(n,t,e){var r=h_(n,e.timeZone,e.locale);return r.formatToParts?d_(r,t):f_(r,t)}function d_(n,t){for(var e=n.formatToParts(t),r=e.length-1;r>=0;--r)if(e[r].type==="timeZoneName")return e[r].value}function f_(n,t){var e=n.format(t).replace(/\u200E/g,""),r=/ [\w-+ ]+$/.exec(e);return r?r[0].substr(1):""}function h_(n,t,e){if(e&&!e.code)throw new Error("date-fns-tz error: Please set a language code on the locale object imported from date-fns, e.g. `locale.code = 'en-US'`");return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function g_(n,t){var e=y_(t);return e.formatToParts?m_(e,n):b_(e,n)}var p_={year:0,month:1,day:2,hour:3,minute:4,second:5};function m_(n,t){try{for(var e=n.formatToParts(t),r=[],i=0;i<e.length;i++){var a=p_[e[i].type];a>=0&&(r[a]=parseInt(e[i].value,10))}return r}catch(s){if(s instanceof RangeError)return[NaN];throw s}}function b_(n,t){var e=n.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[r[3],r[1],r[2],r[4],r[5],r[6]]}var wo={};function y_(n){if(!wo[n]){var t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:"America/New_York",year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),e=t==="06/25/2014, 00:00:00"||t==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";wo[n]=e?new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return wo[n]}function uf(n,t,e,r,i,a,s){var o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(r,i,a,s),o}var df=36e5,v_=6e4,_o={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-]\d{2}):?(\d{2})$/};function To(n,t,e){var r,i;if(!n||(r=_o.timezoneZ.exec(n),r))return 0;var a;if(r=_o.timezoneHH.exec(n),r)return a=parseInt(r[1],10),ff(a)?-(a*df):NaN;if(r=_o.timezoneHHMM.exec(n),r){a=parseInt(r[1],10);var s=parseInt(r[2],10);return ff(a,s)?(i=Math.abs(a)*df+s*v_,a>0?-i:i):NaN}if(__(n)){t=new Date(t||Date.now());var o=e?t:x_(t),l=Mo(o,n),c=e?l:w_(t,l,n);return-c}return NaN}function x_(n){return uf(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Mo(n,t){var e=g_(n,t),r=uf(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime(),i=n.getTime(),a=i%1e3;return i-=a>=0?a:1e3+a,r-i}function w_(n,t,e){var r=n.getTime(),i=r-t,a=Mo(new Date(i),e);if(t===a)return t;i-=a-t;var s=Mo(new Date(i),e);return a===s?a:Math.max(a,s)}function ff(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}var hf={};function __(n){if(hf[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),hf[n]=!0,!0}catch{return!1}}var T_=60*1e3,M_={X:function(n,t,e,r){var i=Do(r.timeZone,r._originalDate||n);if(i===0)return"Z";switch(t){case"X":return gf(i);case"XXXX":case"XX":return cr(i);case"XXXXX":case"XXX":default:return cr(i,":")}},x:function(n,t,e,r){var i=Do(r.timeZone,r._originalDate||n);switch(t){case"x":return gf(i);case"xxxx":case"xx":return cr(i);case"xxxxx":case"xxx":default:return cr(i,":")}},O:function(n,t,e,r){var i=Do(r.timeZone,r._originalDate||n);switch(t){case"O":case"OO":case"OOO":return"GMT"+D_(i,":");case"OOOO":default:return"GMT"+cr(i,":")}},z:function(n,t,e,r){var i=r._originalDate||n;switch(t){case"z":case"zz":case"zzz":return cf("short",i,r);case"zzzz":default:return cf("long",i,r)}}};function Do(n,t){var e=n?To(n,t,!0)/T_:t.getTimezoneOffset();if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function ia(n,t){for(var e=n<0?"-":"",r=Math.abs(n).toString();r.length<t;)r="0"+r;return e+r}function cr(n,t){var e=t||"",r=n>0?"-":"+",i=Math.abs(n),a=ia(Math.floor(i/60),2),s=ia(Math.floor(i%60),2);return r+a+e+s}function gf(n,t){if(n%60===0){var e=n>0?"-":"+";return e+ia(Math.abs(n)/60,2)}return cr(n,t)}function D_(n,t){var e=n>0?"-":"+",r=Math.abs(n),i=Math.floor(r/60),a=r%60;if(a===0)return e+String(i);var s=t||"";return e+String(i)+s+ia(a,2)}const C_=M_;var k_=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Co=36e5,pf=6e4,S_=2,oe={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:k_};function mf(n,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);var e=t||{},r=e.additionalDigits==null?S_:Lw(e.additionalDigits);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(!(typeof n=="string"||Object.prototype.toString.call(n)==="[object String]"))return new Date(NaN);var i=O_(n),a=P_(i.date,r),s=a.year,o=a.restDateString,l=E_(o,s);if(isNaN(l))return new Date(NaN);if(l){var c=l.getTime(),u=0,d;if(i.time&&(u=A_(i.time),isNaN(u)))return new Date(NaN);if(i.timeZone||e.timeZone){if(d=To(i.timeZone||e.timeZone,new Date(c+u)),isNaN(d))return new Date(NaN)}else d=lf(new Date(c+u)),d=lf(new Date(c+u+d));return new Date(c+u+d)}else return new Date(NaN)}function O_(n){var t={},e=oe.dateTimePattern.exec(n),r;if(e?(t.date=e[1],r=e[3]):(e=oe.datePattern.exec(n),e?(t.date=e[1],r=e[2]):(t.date=null,r=n)),r){var i=oe.timeZone.exec(r);i?(t.time=r.replace(i[1],""),t.timeZone=i[1].trim()):t.time=r}return t}function P_(n,t){var e=oe.YYY[t],r=oe.YYYYY[t],i;if(i=oe.YYYY.exec(n)||r.exec(n),i){var a=i[1];return{year:parseInt(a,10),restDateString:n.slice(a.length)}}if(i=oe.YY.exec(n)||e.exec(n),i){var s=i[1];return{year:parseInt(s,10)*100,restDateString:n.slice(s.length)}}return{year:null}}function E_(n,t){if(t===null)return null;var e,r,i,a;if(n.length===0)return r=new Date(0),r.setUTCFullYear(t),r;if(e=oe.MM.exec(n),e)return r=new Date(0),i=parseInt(e[1],10)-1,vf(t,i)?(r.setUTCFullYear(t,i),r):new Date(NaN);if(e=oe.DDD.exec(n),e){r=new Date(0);var s=parseInt(e[1],10);return I_(t,s)?(r.setUTCFullYear(t,0,s),r):new Date(NaN)}if(e=oe.MMDD.exec(n),e){r=new Date(0),i=parseInt(e[1],10)-1;var o=parseInt(e[2],10);return vf(t,i,o)?(r.setUTCFullYear(t,i,o),r):new Date(NaN)}if(e=oe.Www.exec(n),e)return a=parseInt(e[1],10)-1,xf(t,a)?bf(t,a):new Date(NaN);if(e=oe.WwwD.exec(n),e){a=parseInt(e[1],10)-1;var l=parseInt(e[2],10)-1;return xf(t,a,l)?bf(t,a,l):new Date(NaN)}return null}function A_(n){var t,e,r;if(t=oe.HH.exec(n),t)return e=parseFloat(t[1].replace(",",".")),ko(e)?e%24*Co:NaN;if(t=oe.HHMM.exec(n),t)return e=parseInt(t[1],10),r=parseFloat(t[2].replace(",",".")),ko(e,r)?e%24*Co+r*pf:NaN;if(t=oe.HHMMSS.exec(n),t){e=parseInt(t[1],10),r=parseInt(t[2],10);var i=parseFloat(t[3].replace(",","."));return ko(e,r,i)?e%24*Co+r*pf+i*1e3:NaN}return null}function bf(n,t,e){t=t||0,e=e||0;var r=new Date(0);r.setUTCFullYear(n,0,4);var i=r.getUTCDay()||7,a=t*7+e+1-i;return r.setUTCDate(r.getUTCDate()+a),r}var R_=[31,28,31,30,31,30,31,31,30,31,30,31],L_=[31,29,31,30,31,30,31,31,30,31,30,31];function yf(n){return n%400===0||n%4===0&&n%100!==0}function vf(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;var r=yf(n);if(r&&e>L_[t]||!r&&e>R_[t])return!1}return!0}function I_(n,t){if(t<1)return!1;var e=yf(n);return!(e&&t>366||!e&&t>365)}function xf(n,t,e){return!(t<0||t>52||e!=null&&(e<0||e>6))}function ko(n,t,e){return!(n!=null&&(n<0||n>=25)||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}var N_=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function So(n,t,e){var r=String(t),i=e||{},a=r.match(N_);if(a){var s=mf(n,i);r=a.reduce(function(o,l){if(l[0]==="'")return o;var c=o.indexOf(l),u=o[c-1]==="'",d=o.replace(l,"'"+C_[l[0]](s,l,null,i)+"'");return u?d.substring(0,c-1)+d.substring(c+1):d},r)}return u_(n,r,i)}var Oo={exports:{}},Po={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r,i){if(r==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a]);return r}n.exports=t.default})(Po,Po.exports);var F_=Po.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var r=e(F_);function i(a){return(0,r.default)({},a)}n.exports=t.default})(Oo,Oo.exports);var B_=Oo.exports;const U_=Wn(B_);function W_(n,t,e){var r=mf(n,e),i=To(t,r,!0),a=new Date(r.getTime()-i),s=new Date(0);return s.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),s.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),s}function Y_(n,t,e,r){var i=U_(r);return i.timeZone=t,So(W_(n,t),e,i)}const wf=2,_f=10,Tf=12,aa=new Intl.NumberFormat(((sg=document==null?void 0:document.documentElement)==null?void 0:sg.lang)||"en-US");function sa(n,t={}){if(!n)return n;const e=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let r="MMM dd, YYY hh:mm a";t.short&&(r="MMM dd, YYY"),t.includeTZ&&(r+=" (z)");const i=new Date(n);return Y_(i,e,r)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const oa=10,Mf={"1XXCount|1XX|1[0-9][0-9]":{solid:"#0072E5",light:"#4DA6FF",description:"Informational"},"SuccessfulRequests|2XXCount|2XX|2[0-9][0-9]|SUCCESS":{solid:"#0BB652",light:"#6FCC83",description:"Success"},"3XXCount|3XX|3[0-9][0-9]":{solid:"#FDC53B",light:"#FFD982",description:"Redirection"},"4XXCount|4XX|4[0-9][0-9]":{solid:"#FE9439",light:"#FFBA81",description:"Client Errors"},"5XXCount|5XX|5[0-9][0-9]":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},"errorCount|FailedRequests|FAILURE":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},nonStandard:{solid:"#6f7787",light:"#e7e7ec"},standard:{solid:"#1155cb",light:"#8ab3fa"},p99:{solid:"#1356cb",light:"#1356cb"},p95:{solid:"#1fbecd",light:"#1fbecd"},p50:{solid:"#1df97d",light:"#1df97d"},LatencyP99:{solid:"#1356cb",light:"#1356cb"},LatencyP95:{solid:"#1fbecd",light:"#1fbecd"},LatencyP50:{solid:"#1df97d",light:"#1df97d"}},Ce=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],ur=(n,t)=>(t||Ce)[n%Ce.length],ii=(n,t)=>{n[0]==="#"&&(n=n.slice(1));let e=parseInt(n.substring(0,2),16),r=parseInt(n.substring(2,4),16),i=parseInt(n.substring(4,6),16);e=e-t,r=r-t,i=i-t,e>255?e=255:e<0&&(e=0),r>255?r=255:r<0&&(r=0),i>255?i=255:i<0&&(i=0);const a=e.toString(16).length===1?"0"+e.toString(16):e.toString(16),s=r.toString(16).length===1?"0"+r.toString(16):r.toString(16),o=i.toString(16).length===1?"0"+i.toString(16):i.toString(16);return`#${a}${s}${o}`},Df="#6f7787",Cf={100:{background:"#f0f5fd",text:"#10599e"},200:{background:"#e5f7f4",text:"#1b6955"},300:{background:"#fff1d5",text:"#a06027"},400:{background:"#fee3b6",text:"#944d19"},500:{background:"#fedada",text:"#852021"}},H_=n=>{var e;const t=Math.floor(parseInt(n,10)/100)*100;return((e=Cf[t])==null?void 0:e.background)||"#fafafa"},z_={SUCCESS:"#6FCC83",FAILURE:"#FF8484"},$_={"4XX":"#FFBA81","5XX":"#FF8484"},j_={LatencyP99:"#1356cb",LatencyP95:"#1fbecd",LatencyP50:"#1df97d"},V_="#dad4c7",q_=n=>{const t=Object.entries(Mf).find(([e])=>new RegExp(e).test(n));return t&&t[1]||Mf.standard},X_={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},G_=2,K_=0,Eo=new Map,Ao=(n,t)=>t==="bytes"?Cs(n):t==="count/minute"?n.toFixed(2):aa.format(n),kf=n=>{const e=document.createElement("canvas").getContext("2d"),r=Rt({});return e.font=r.string,e.measureText(n).width},Q_=()=>{const n="label_height";if(!Eo.has(n)){const t=Rt({});Eo.set(n,t.lineHeight)}return Eo.get(n)},Z_=n=>n.datasets.reduce((t,e)=>t+e.data.reduce((r,i)=>isNaN(i)?r:r+i,0),0),Sf=(n,t)=>t.datasets.reduce((e,r,i)=>n.isDatasetVisible(i)?e+r.data.reduce((a,s)=>isNaN(s)?a:a+s,0):e,0),Of=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`;function J_(n){const t={enabled:!1,position:"barChartTooltipPosition",callbacks:{label:i=>({label:i.dataset.label,value:i.label})}};Vi.positioners.barChartTooltipPosition=function(i,a){if(!i.length)return!1;const s=this.chart.canvas.getBoundingClientRect(),o=n.tooltipState.width||this.width,l=s.width/2,c=Bs(a,o,l),u=a.y,d=a.x<l?"left":"center";return{x:c-n.tooltipState.offsetX,y:u-n.tooltipState.offsetY,xAlign:d}},ls.modes.customInteractionMode=function(i,a){const s=pn(a,i),o=[];return ls.evaluateInteractionItems(i,i.options.indexAxis||"x",s,(l,c,u)=>{i.options.indexAxis==="y"&&l.inYRange(s.y,!0)&&i.data.datasets[c].data[u]&&o.push({element:l,datasetIndex:c,index:u}),i.options.indexAxis==="x"&&l.inXRange(s.x,!0)&&i.data.datasets[c].data[u]&&o.push({element:l,datasetIndex:c,index:u})}),o};const e=n.numLabels.value>25?_f:Tf;return h.computed(()=>{var i,a,s,o,l,c,u,d;return{indexAxis:n.indexAxis,skipNull:!0,scales:{x:{border:{display:!1},stacked:n.stacked.value,grid:{display:!1,drawBorder:!1},ticks:{maxRotation:90,autoSkip:!1,font:e,callback:function(f,g){const v=this;if(v.chart.options.indexAxis===v.axis){f=v.getLabelForValue(g);const x=10;return f&&f.length>x?f.slice(0,x)+"...":f}return v.getLabelForValue(Number(f))}},title:{display:n.indexAxis==="y"?!at((i=n.metricAxesTitle)==null?void 0:i.value):!at((a=n.dimensionAxesTitle)==null?void 0:a.value),text:n.indexAxis==="y"?(s=n.metricAxesTitle)==null?void 0:s.value:(o=n.dimensionAxesTitle)==null?void 0:o.value,padding:{top:20},font:{weight:"bold"}}},y:{border:{display:!1},stacked:n.stacked.value,beginAtZero:!0,grid:{display:!1,drawBorder:!1},ticks:{font:e,callback:function(f,g){const v=this;return v.chart.options.indexAxis===v.axis?(f=v.getLabelForValue(g),f&&f.length>oa?f.slice(0,oa)+"...":f):v.getLabelForValue(Number(f))}},title:{display:n.indexAxis==="x"?!at((l=n.metricAxesTitle)==null?void 0:l.value):!at((c=n.dimensionAxesTitle)==null?void 0:c.value),text:n.indexAxis==="x"?(u=n.metricAxesTitle)==null?void 0:u.value:(d=n.dimensionAxesTitle)==null?void 0:d.value,padding:{bottom:20},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:f=>{Fs(n.tooltipState,f)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1}})}De.register(..._y);const t1=(n,t)=>{const e=t.datasets.map(i=>i.label),r=n.datasets.map(i=>i.label);return n.datasets.length===t.datasets.length&&e.every((i,a)=>i===r[a])};function e1(n,t,e,r,i){const a=h.shallowRef(null),s=(o,l)=>{if(t.value)return new De(t.value,{type:n,data:o,plugins:r,options:l})};return h.onMounted(()=>{a.value=s(e.value,i.value)}),h.onBeforeUnmount(()=>{at(a.value)||a.value.destroy()}),h.watch(e,(o,l)=>{if(t1(l,o)&&!at(a.value)){for(const[c,u]of o.datasets.entries())Object.assign(a.value.data.datasets[c],u);a.value.data.labels=o.labels,a.value.update()}else at(a.value)||a.value.destroy(),a.value=s(o,i.value)}),h.watch(t,()=>{at(a.value)||a.value.destroy(),a.value=s(e.value,i.value)}),h.watch(i,(o,l)=>{(o.indexAxis!==l.indexAxis||JSON.stringify(o.scales.x.title)!==JSON.stringify(l.scales.x.title)||JSON.stringify(o.scales.y.title)!==JSON.stringify(l.scales.y.title))&&(at(a.value)||a.value.destroy(),a.value=s(e.value,o))}),a}var Pf={exports:{}};(function(n){(function(){function t(c,u){if(u.separator===!1||c<1e3)return c.toString();var d=typeof u.separator=="string"?u.separator:",",f=[],g=Math.round(c).toString().split("");return g.reverse().forEach(function(v,x){x&&x%3===0&&f.push(d),f.push(v)}),f.reverse().join("")}function e(c,u,d){var f=c/u,g=d.round?"round":"floor";return d.decimal===!1?(c=Math[g](f),c.toString()):(d.precision?c=f:c=f<10?Math[g](f*10)/10:Math[g](f),c=c.toString(),typeof d.decimal=="string"&&(c=c.replace(".",d.decimal)),c)}var r=1e3,i=1e4,a=1e6,s=1e9,o=1e12;function l(c,u){var d;u=u||{};var f=c<0;f&&(c=Math.abs(c)),u.precision&&(c=parseFloat(c.toPrecision(u.precision)));var g=u.min10k?i:r;return c<g||u.precision&&u.precision>Math.log10(c)?d=t(e(c,1,u),u):c<a?d=e(c,r,u)+"k":c<s?d=e(c,a,u)+"m":c<o?d=t(e(c,s,u),u)+"b":d=t(e(c,o,u),u)+"t",f&&(d="-"+d),u.capital&&(d=d.toUpperCase()),u.prefix&&(d=u.prefix+d),u.suffix&&(d=d+u.suffix),d}l.addCommas=t,n.exports=l})()})(Pf);var n1=Pf.exports;const ai=Wn(n1);function r1(n,t,e){const{i18n:r}=kt.useI18n(),{translateUnit:i}=kt.useTranslatedUnits();return{legendValues:h.computed(()=>n.value.datasets.reduce((s,o)=>{const l=o.total?o.total:o.data.reduce((u,d)=>u+(typeof d=="number"?Number(d)||0:Number(d&&d.y)||0),0);let c;if(e.value==="bytes")c=isNaN(l)?"0":Cs(l);else{const u=i(e.value,l);c=r&&r.t("legend.datapointValueDisplay",{value:ai(l,{capital:!0}),unit:u})||`${ai(l,{capital:!0})} ${e.value}`}return{...s,[o.label]:{raw:l,formatted:c}}},{}))}}function i1(n){return h.computed(()=>{var i;if(!((i=n.value)!=null&&i.meta))return"";const e=n.value.meta.start_ms,r=n.value.meta.end_ms;return e&&r?`${sa(e)} - ${sa(r,{includeTZ:!0})}`:""})}function a1(n){const t={enabled:!1,position:"doughnutChartTooltipPosition",callbacks:{label:r=>({label:r.dataset.label,value:r.label})}};return Vi.positioners.doughnutChartTooltipPosition=function(r,i){if(!r.length)return!1;const a=this.chart.canvas.getBoundingClientRect(),s=n.tooltipState.width||this.width,o=a.width/2,l=Bs(i,s,o),c=i.y,u=i.x<o?"left":"center";return{x:l-n.tooltipState.offsetX,y:c,xAlign:u}},{options:h.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:r=>{Fs(n.tooltipState,r)}}}}))}}var s1=Object.defineProperty,o1=(n,t,e)=>t in n?s1(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,He=(n,t,e)=>(o1(n,typeof t!="symbol"?t+"":t,e),e),ct=(n=>(n.MINUTELY="Minutely",n.HOURLY="Hourly",n.DAILY="Daily",n.WEEKLY="Weekly",n))(ct||{}),zt=(n=>(n.FIFTEEN_MIN="15m",n.ONE_HOUR="1h",n.SIX_HOUR="6h",n.TWELVE_HOUR="12h",n.ONE_DAY="24h",n.SEVEN_DAY="7d",n.THIRTY_DAY="30d",n.CURRENT_WEEK="current_week",n.CURRENT_MONTH="current_month",n.CURRENT_QUARTER="current_quarter",n.PREVIOUS_WEEK="previous_week",n.PREVIOUS_MONTH="previous_month",n.PREVIOUS_QUARTER="previous_quarter",n))(zt||{});function Ro(n){"@babel/helpers - typeof";return Ro=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ro(n)}function la(n){if(n===null||n===!0||n===!1)return NaN;var t=Number(n);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function ze(n,t){if(t.length<n)throw new TypeError(n+" argument"+(n>1?"s":"")+" required, but only "+t.length+" present")}function dr(n){ze(1,arguments);var t=Object.prototype.toString.call(n);return n instanceof Date||Ro(n)==="object"&&t==="[object Date]"?new Date(n.getTime()):typeof n=="number"||t==="[object Number]"?new Date(n):((typeof n=="string"||t==="[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 Ef(n,t){ze(2,arguments);var e=dr(n),r=la(t);return isNaN(r)?new Date(NaN):(r&&e.setDate(e.getDate()+r),e)}function l1(n,t){ze(2,arguments);var e=dr(n),r=la(t);if(isNaN(r))return new Date(NaN);if(!r)return e;var i=e.getDate(),a=new Date(e.getTime());a.setMonth(e.getMonth()+r+1,0);var s=a.getDate();return i>=s?a:(e.setFullYear(a.getFullYear(),a.getMonth(),i),e)}var c1={};function u1(){return c1}function ca(n,t){var e,r,i,a,s,o,l,c;ze(1,arguments);var u=u1(),d=la((e=(r=(i=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&i!==void 0?i: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&&e!==void 0?e:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=dr(n),g=f.getDay(),v=(g<d?7:0)+g-d;return f.setDate(f.getDate()-v),f.setHours(0,0,0,0),f}function Af(n){ze(1,arguments);var t=dr(n);return t.setHours(0,0,0,0),t}var d1=60,f1=3600;function fr(n){ze(1,arguments);var t=dr(n);return t.setDate(1),t.setHours(0,0,0,0),t}function h1(n){ze(1,arguments);var t=dr(n),e=t.getFullYear(),r=t.getMonth(),i=new Date(0);return i.setFullYear(e,r+1,0),i.setHours(0,0,0,0),i.getDate()}function g1(n){return ze(1,arguments),Math.floor(n*f1)}function p1(n){ze(1,arguments);var t=n/d1;return Math.floor(t)}function Rf(n,t){ze(2,arguments);var e=la(t);return l1(n,-e)}function Lo(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Lf={exports:{}},If={exports:{}};(function(n){function t(e){return e&&e.__esModule?e:{default:e}}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(If);var $t=If.exports,Io={exports:{}},No={exports:{}},Nf={exports:{}};(function(n){function t(e){"@babel/helpers - typeof";return n.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},n.exports.__esModule=!0,n.exports.default=n.exports,t(e)}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(Nf);var Ff=Nf.exports,Fo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r,i){if(i.length<r)throw new TypeError(r+" argument"+(r>1?"s":"")+" required, but only "+i.length+" present")}n.exports=t.default})(Fo,Fo.exports);var le=Fo.exports;(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var r=e(Ff),i=e(le);function a(s){return(0,i.default)(1,arguments),s instanceof Date||(0,r.default)(s)==="object"&&Object.prototype.toString.call(s)==="[object Date]"}n.exports=t.default})(No,No.exports);var m1=No.exports,Bo={exports:{}};(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var r=e(Ff),i=e(le);function a(s){(0,i.default)(1,arguments);var o=Object.prototype.toString.call(s);return s instanceof Date||(0,r.default)(s)==="object"&&o==="[object Date]"?new Date(s.getTime()):typeof s=="number"||o==="[object Number]"?new Date(s):((typeof s=="string"||o==="[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))}n.exports=t.default})(Bo,Bo.exports);var $e=Bo.exports;(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e(m1),i=e($e),a=e(le);function s(o){if((0,a.default)(1,arguments),!(0,r.default)(o)&&typeof o!="number")return!1;var l=(0,i.default)(o);return!isNaN(Number(l))}n.exports=t.default})(Io,Io.exports);var b1=Io.exports,Uo={exports:{}},Wo={exports:{}},Yo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r){if(r===null||r===!0||r===!1)return NaN;var i=Number(r);return isNaN(i)?i:i<0?Math.ceil(i):Math.floor(i)}n.exports=t.default})(Yo,Yo.exports);var zn=Yo.exports;const y1=Lo(zn);(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e(zn),i=e($e),a=e(le);function s(o,l){(0,a.default)(2,arguments);var c=(0,i.default)(o).getTime(),u=(0,r.default)(l);return new Date(c+u)}n.exports=t.default})(Wo,Wo.exports);var v1=Wo.exports;(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e(v1),i=e(le),a=e(zn);function s(o,l){(0,i.default)(2,arguments);var c=(0,a.default)(l);return(0,r.default)(o,-c)}n.exports=t.default})(Uo,Uo.exports);var x1=Uo.exports,Ho={exports:{}},zo={exports:{}};(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e($e),i=e(le),a=864e5;function s(o){(0,i.default)(1,arguments);var l=(0,r.default)(o),c=l.getTime();l.setUTCMonth(0,1),l.setUTCHours(0,0,0,0);var u=l.getTime(),d=c-u;return Math.floor(d/a)+1}n.exports=t.default})(zo,zo.exports);var w1=zo.exports,$o={exports:{}},jo={exports:{}};(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var r=e($e),i=e(le);function a(s){(0,i.default)(1,arguments);var o=1,l=(0,r.default)(s),c=l.getUTCDay(),u=(c<o?7:0)+c-o;return l.setUTCDate(l.getUTCDate()-u),l.setUTCHours(0,0,0,0),l}n.exports=t.default})(jo,jo.exports);var Vo=jo.exports,qo={exports:{}},Xo={exports:{}};(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e($e),i=e(le),a=e(Vo);function s(o){(0,i.default)(1,arguments);var l=(0,r.default)(o),c=l.getUTCFullYear(),u=new Date(0);u.setUTCFullYear(c+1,0,4),u.setUTCHours(0,0,0,0);var d=(0,a.default)(u),f=new Date(0);f.setUTCFullYear(c,0,4),f.setUTCHours(0,0,0,0);var g=(0,a.default)(f);return l.getTime()>=d.getTime()?c+1:l.getTime()>=g.getTime()?c:c-1}n.exports=t.default})(Xo,Xo.exports);var Bf=Xo.exports;(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e(Bf),i=e(Vo),a=e(le);function s(o){(0,a.default)(1,arguments);var l=(0,r.default)(o),c=new Date(0);c.setUTCFullYear(l,0,4),c.setUTCHours(0,0,0,0);var u=(0,i.default)(c);return u}n.exports=t.default})(qo,qo.exports);var _1=qo.exports;(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var r=e($e),i=e(Vo),a=e(_1),s=e(le),o=6048e5;function l(c){(0,s.default)(1,arguments);var u=(0,r.default)(c),d=(0,i.default)(u).getTime()-(0,a.default)(u).getTime();return Math.round(d/o)+1}n.exports=t.default})($o,$o.exports);var T1=$o.exports,Go={exports:{}},Ko={exports:{}},$n={};Object.defineProperty($n,"__esModule",{value:!0}),$n.getDefaultOptions=M1,$n.setDefaultOptions=D1;var Uf={};function M1(){return Uf}function D1(n){Uf=n}(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var r=e($e),i=e(le),a=e(zn),s=$n;function o(l,c){var u,d,f,g,v,x,p,b;(0,i.default)(1,arguments);var m=(0,s.getDefaultOptions)(),y=(0,a.default)((u=(d=(f=(g=c==null?void 0:c.weekStartsOn)!==null&&g!==void 0?g:c==null||(v=c.locale)===null||v===void 0||(x=v.options)===null||x===void 0?void 0:x.weekStartsOn)!==null&&f!==void 0?f:m.weekStartsOn)!==null&&d!==void 0?d:(p=m.locale)===null||p===void 0||(b=p.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&u!==void 0?u:0);if(!(y>=0&&y<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var w=(0,r.default)(l),T=w.getUTCDay(),S=(T<y?7:0)+T-y;return w.setUTCDate(w.getUTCDate()-S),w.setUTCHours(0,0,0,0),w}n.exports=t.default})(Ko,Ko.exports);var Qo=Ko.exports,Zo={exports:{}},Jo={exports:{}};(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var r=e($e),i=e(le),a=e(Qo),s=e(zn),o=$n;function l(c,u){var d,f,g,v,x,p,b,m;(0,i.default)(1,arguments);var y=(0,r.default)(c),w=y.getUTCFullYear(),T=(0,o.getDefaultOptions)(),S=(0,s.default)((d=(f=(g=(v=u==null?void 0:u.firstWeekContainsDate)!==null&&v!==void 0?v:u==null||(x=u.locale)===null||x===void 0||(p=x.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&g!==void 0?g:T.firstWeekContainsDate)!==null&&f!==void 0?f:(b=T.locale)===null||b===void 0||(m=b.options)===null||m===void 0?void 0:m.firstWeekContainsDate)!==null&&d!==void 0?d:1);if(!(S>=1&&S<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var k=new Date(0);k.setUTCFullYear(w+1,0,S),k.setUTCHours(0,0,0,0);var M=(0,a.default)(k,u),D=new Date(0);D.setUTCFullYear(w,0,S),D.setUTCHours(0,0,0,0);var O=(0,a.default)(D,u);return y.getTime()>=M.getTime()?w+1:y.getTime()>=O.getTime()?w:w-1}n.exports=t.default})(Jo,Jo.exports);var Wf=Jo.exports;(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var r=e(Wf),i=e(le),a=e(Qo),s=e(zn),o=$n;function l(c,u){var d,f,g,v,x,p,b,m;(0,i.default)(1,arguments);var y=(0,o.getDefaultOptions)(),w=(0,s.default)((d=(f=(g=(v=u==null?void 0:u.firstWeekContainsDate)!==null&&v!==void 0?v:u==null||(x=u.locale)===null||x===void 0||(p=x.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&g!==void 0?g:y.firstWeekContainsDate)!==null&&f!==void 0?f:(b=y.locale)===null||b===void 0||(m=b.options)===null||m===void 0?void 0:m.firstWeekContainsDate)!==null&&d!==void 0?d:1),T=(0,r.default)(c,u),S=new Date(0);S.setUTCFullYear(T,0,w),S.setUTCHours(0,0,0,0);var k=(0,a.default)(S,u);return k}n.exports=t.default})(Zo,Zo.exports);var C1=Zo.exports;(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var r=e($e),i=e(Qo),a=e(C1),s=e(le),o=6048e5;function l(c,u){(0,s.default)(1,arguments);var d=(0,r.default)(c),f=(0,i.default)(d,u).getTime()-(0,a.default)(d,u).getTime();return Math.round(f/o)+1}n.exports=t.default})(Go,Go.exports);var k1=Go.exports,tl={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r,i){for(var a=r<0?"-":"",s=Math.abs(r).toString();s.length<i;)s="0"+s;return a+s}n.exports=t.default})(tl,tl.exports);var Yf=tl.exports,el={exports:{}};(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(Yf),i={y:function(s,o){var l=s.getUTCFullYear(),c=l>0?l:1-l;return(0,r.default)(o==="yy"?c%100:c,o.length)},M:function(s,o){var l=s.getUTCMonth();return o==="M"?String(l+1):(0,r.default)(l+1,2)},d:function(s,o){return(0,r.default)(s.getUTCDate(),o.length)},a:function(s,o){var l=s.getUTCHours()/12>=1?"pm":"am";switch(o){case"a":case"aa":return l.toUpperCase();case"aaa":return l;case"aaaaa":return l[0];case"aaaa":default:return l==="am"?"a.m.":"p.m."}},h:function(s,o){return(0,r.default)(s.getUTCHours()%12||12,o.length)},H:function(s,o){return(0,r.default)(s.getUTCHours(),o.length)},m:function(s,o){return(0,r.default)(s.getUTCMinutes(),o.length)},s:function(s,o){return(0,r.default)(s.getUTCSeconds(),o.length)},S:function(s,o){var l=o.length,c=s.getUTCMilliseconds(),u=Math.floor(c*Math.pow(10,l-3));return(0,r.default)(u,o.length)}},a=i;t.default=a,n.exports=t.default})(el,el.exports);var S1=el.exports;(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(w1),i=e(T1),a=e(Bf),s=e(k1),o=e(Wf),l=e(Yf),c=e(S1),u={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},d={G:function(p,b,m){var y=p.getUTCFullYear()>0?1:0;switch(b){case"G":case"GG":case"GGG":return m.era(y,{width:"abbreviated"});case"GGGGG":return m.era(y,{width:"narrow"});case"GGGG":default:return m.era(y,{width:"wide"})}},y:function(p,b,m){if(b==="yo"){var y=p.getUTCFullYear(),w=y>0?y:1-y;return m.ordinalNumber(w,{unit:"year"})}return c.default.y(p,b)},Y:function(p,b,m,y){var w=(0,o.default)(p,y),T=w>0?w:1-w;if(b==="YY"){var S=T%100;return(0,l.default)(S,2)}return b==="Yo"?m.ordinalNumber(T,{unit:"year"}):(0,l.default)(T,b.length)},R:function(p,b){var m=(0,a.default)(p);return(0,l.default)(m,b.length)},u:function(p,b){var m=p.getUTCFullYear();return(0,l.default)(m,b.length)},Q:function(p,b,m){var y=Math.ceil((p.getUTCMonth()+1)/3);switch(b){case"Q":return String(y);case"QQ":return(0,l.default)(y,2);case"Qo":return m.ordinalNumber(y,{unit:"quarter"});case"QQQ":return m.quarter(y,{width:"abbreviated",context:"formatting"});case"QQQQQ":return m.quarter(y,{width:"narrow",context:"formatting"});case"QQQQ":default:return m.quarter(y,{width:"wide",context:"formatting"})}},q:function(p,b,m){var y=Math.ceil((p.getUTCMonth()+1)/3);switch(b){case"q":return String(y);case"qq":return(0,l.default)(y,2);case"qo":return m.ordinalNumber(y,{unit:"quarter"});case"qqq":return m.quarter(y,{width:"abbreviated",context:"standalone"});case"qqqqq":return m.quarter(y,{width:"narrow",context:"standalone"});case"qqqq":default:return m.quarter(y,{width:"wide",context:"standalone"})}},M:function(p,b,m){var y=p.getUTCMonth();switch(b){case"M":case"MM":return c.default.M(p,b);case"Mo":return m.ordinalNumber(y+1,{unit:"month"});case"MMM":return m.month(y,{width:"abbreviated",context:"formatting"});case"MMMMM":return m.month(y,{width:"narrow",context:"formatting"});case"MMMM":default:return m.month(y,{width:"wide",context:"formatting"})}},L:function(p,b,m){var y=p.getUTCMonth();switch(b){case"L":return String(y+1);case"LL":return(0,l.default)(y+1,2);case"Lo":return m.ordinalNumber(y+1,{unit:"month"});case"LLL":return m.month(y,{width:"abbreviated",context:"standalone"});case"LLLLL":return m.month(y,{width:"narrow",context:"standalone"});case"LLLL":default:return m.month(y,{width:"wide",context:"standalone"})}},w:function(p,b,m,y){var w=(0,s.default)(p,y);return b==="wo"?m.ordinalNumber(w,{unit:"week"}):(0,l.default)(w,b.length)},I:function(p,b,m){var y=(0,i.default)(p);return b==="Io"?m.ordinalNumber(y,{unit:"week"}):(0,l.default)(y,b.length)},d:function(p,b,m){return b==="do"?m.ordinalNumber(p.getUTCDate(),{unit:"date"}):c.default.d(p,b)},D:function(p,b,m){var y=(0,r.default)(p);return b==="Do"?m.ordinalNumber(y,{unit:"dayOfYear"}):(0,l.default)(y,b.length)},E:function(p,b,m){var y=p.getUTCDay();switch(b){case"E":case"EE":case"EEE":return m.day(y,{width:"abbreviated",context:"formatting"});case"EEEEE":return m.day(y,{width:"narrow",context:"formatting"});case"EEEEEE":return m.day(y,{width:"short",context:"formatting"});case"EEEE":default:return m.day(y,{width:"wide",context:"formatting"})}},e:function(p,b,m,y){var w=p.getUTCDay(),T=(w-y.weekStartsOn+8)%7||7;switch(b){case"e":return String(T);case"ee":return(0,l.default)(T,2);case"eo":return m.ordinalNumber(T,{unit:"day"});case"eee":return m.day(w,{width:"abbreviated",context:"formatting"});case"eeeee":return m.day(w,{width:"narrow",context:"formatting"});case"eeeeee":return m.day(w,{width:"short",context:"formatting"});case"eeee":default:return m.day(w,{width:"wide",context:"formatting"})}},c:function(p,b,m,y){var w=p.getUTCDay(),T=(w-y.weekStartsOn+8)%7||7;switch(b){case"c":return String(T);case"cc":return(0,l.default)(T,b.length);case"co":return m.ordinalNumber(T,{unit:"day"});case"ccc":return m.day(w,{width:"abbreviated",context:"standalone"});case"ccccc":return m.day(w,{width:"narrow",context:"standalone"});case"cccccc":return m.day(w,{width:"short",context:"standalone"});case"cccc":default:return m.day(w,{width:"wide",context:"standalone"})}},i:function(p,b,m){var y=p.getUTCDay(),w=y===0?7:y;switch(b){case"i":return String(w);case"ii":return(0,l.default)(w,b.length);case"io":return m.ordinalNumber(w,{unit:"day"});case"iii":return m.day(y,{width:"abbreviated",context:"formatting"});case"iiiii":return m.day(y,{width:"narrow",context:"formatting"});case"iiiiii":return m.day(y,{width:"short",context:"formatting"});case"iiii":default:return m.day(y,{width:"wide",context:"formatting"})}},a:function(p,b,m){var y=p.getUTCHours(),w=y/12>=1?"pm":"am";switch(b){case"a":case"aa":return m.dayPeriod(w,{width:"abbreviated",context:"formatting"});case"aaa":return m.dayPeriod(w,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return m.dayPeriod(w,{width:"narrow",context:"formatting"});case"aaaa":default:return m.dayPeriod(w,{width:"wide",context:"formatting"})}},b:function(p,b,m){var y=p.getUTCHours(),w;switch(y===12?w=u.noon:y===0?w=u.midnight:w=y/12>=1?"pm":"am",b){case"b":case"bb":return m.dayPeriod(w,{width:"abbreviated",context:"formatting"});case"bbb":return m.dayPeriod(w,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return m.dayPeriod(w,{width:"narrow",context:"formatting"});case"bbbb":default:return m.dayPeriod(w,{width:"wide",context:"formatting"})}},B:function(p,b,m){var y=p.getUTCHours(),w;switch(y>=17?w=u.evening:y>=12?w=u.afternoon:y>=4?w=u.morning:w=u.night,b){case"B":case"BB":case"BBB":return m.dayPeriod(w,{width:"abbreviated",context:"formatting"});case"BBBBB":return m.dayPeriod(w,{width:"narrow",context:"formatting"});case"BBBB":default:return m.dayPeriod(w,{width:"wide",context:"formatting"})}},h:function(p,b,m){if(b==="ho"){var y=p.getUTCHours()%12;return y===0&&(y=12),m.ordinalNumber(y,{unit:"hour"})}return c.default.h(p,b)},H:function(p,b,m){return b==="Ho"?m.ordinalNumber(p.getUTCHours(),{unit:"hour"}):c.default.H(p,b)},K:function(p,b,m){var y=p.getUTCHours()%12;return b==="Ko"?m.ordinalNumber(y,{unit:"hour"}):(0,l.default)(y,b.length)},k:function(p,b,m){var y=p.getUTCHours();return y===0&&(y=24),b==="ko"?m.ordinalNumber(y,{unit:"hour"}):(0,l.default)(y,b.length)},m:function(p,b,m){return b==="mo"?m.ordinalNumber(p.getUTCMinutes(),{unit:"minute"}):c.default.m(p,b)},s:function(p,b,m){return b==="so"?m.ordinalNumber(p.getUTCSeconds(),{unit:"second"}):c.default.s(p,b)},S:function(p,b){return c.default.S(p,b)},X:function(p,b,m,y){var w=y._originalDate||p,T=w.getTimezoneOffset();if(T===0)return"Z";switch(b){case"X":return g(T);case"XXXX":case"XX":return v(T);case"XXXXX":case"XXX":default:return v(T,":")}},x:function(p,b,m,y){var w=y._originalDate||p,T=w.getTimezoneOffset();switch(b){case"x":return g(T);case"xxxx":case"xx":return v(T);case"xxxxx":case"xxx":default:return v(T,":")}},O:function(p,b,m,y){var w=y._originalDate||p,T=w.getTimezoneOffset();switch(b){case"O":case"OO":case"OOO":return"GMT"+f(T,":");case"OOOO":default:return"GMT"+v(T,":")}},z:function(p,b,m,y){var w=y._originalDate||p,T=w.getTimezoneOffset();switch(b){case"z":case"zz":case"zzz":return"GMT"+f(T,":");case"zzzz":default:return"GMT"+v(T,":")}},t:function(p,b,m,y){var w=y._originalDate||p,T=Math.floor(w.getTime()/1e3);return(0,l.default)(T,b.length)},T:function(p,b,m,y){var w=y._originalDate||p,T=w.getTime();return(0,l.default)(T,b.length)}};function f(p,b){var m=p>0?"-":"+",y=Math.abs(p),w=Math.floor(y/60),T=y%60;if(T===0)return m+String(w);var S=b||"";return m+String(w)+S+(0,l.default)(T,2)}function g(p,b){if(p%60===0){var m=p>0?"-":"+";return m+(0,l.default)(Math.abs(p)/60,2)}return v(p,b)}function v(p,b){var m=b||"",y=p>0?"-":"+",w=Math.abs(p),T=(0,l.default)(Math.floor(w/60),2),S=(0,l.default)(w%60,2);return y+T+m+S}var x=d;t.default=x,n.exports=t.default})(Ho,Ho.exports);var O1=Ho.exports,nl={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(o,l){switch(o){case"P":return l.date({width:"short"});case"PP":return l.date({width:"medium"});case"PPP":return l.date({width:"long"});case"PPPP":default:return l.date({width:"full"})}},r=function(o,l){switch(o){case"p":return l.time({width:"short"});case"pp":return l.time({width:"medium"});case"ppp":return l.time({width:"long"});case"pppp":default:return l.time({width:"full"})}},i=function(o,l){var c=o.match(/(P+)(p+)?/)||[],u=c[1],d=c[2];if(!d)return e(o,l);var f;switch(u){case"P":f=l.dateTime({width:"short"});break;case"PP":f=l.dateTime({width:"medium"});break;case"PPP":f=l.dateTime({width:"long"});break;case"PPPP":default:f=l.dateTime({width:"full"});break}return f.replace("{{date}}",e(u,l)).replace("{{time}}",r(d,l))},a={p:r,P:i},s=a;t.default=s,n.exports=t.default})(nl,nl.exports);var P1=nl.exports,rl={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r){var i=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return i.setUTCFullYear(r.getFullYear()),r.getTime()-i.getTime()}n.exports=t.default})(rl,rl.exports);var Hf=rl.exports;const zf=Lo(Hf);var si={};Object.defineProperty(si,"__esModule",{value:!0}),si.isProtectedDayOfYearToken=R1,si.isProtectedWeekYearToken=L1,si.throwProtectedError=I1;var E1=["D","DD"],A1=["YY","YYYY"];function R1(n){return E1.indexOf(n)!==-1}function L1(n){return A1.indexOf(n)!==-1}function I1(n,t,e){if(n==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var il={exports:{}},al={exports:{}},sl={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e={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"}},r=function(a,s,o){var l,c=e[a];return typeof c=="string"?l=c:s===1?l=c.one:l=c.other.replace("{{count}}",s.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"in "+l:l+" ago":l},i=r;t.default=i,n.exports=t.default})(sl,sl.exports);var N1=sl.exports,ol={exports:{}},ll={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r){return function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=i.width?String(i.width):r.defaultWidth,s=r.formats[a]||r.formats[r.defaultWidth];return s}}n.exports=t.default})(ll,ll.exports);var F1=ll.exports;(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(F1),i={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},a={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},s={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},o={date:(0,r.default)({formats:i,defaultWidth:"full"}),time:(0,r.default)({formats:a,defaultWidth:"full"}),dateTime:(0,r.default)({formats:s,defaultWidth:"full"})},l=o;t.default=l,n.exports=t.default})(ol,ol.exports);var B1=ol.exports,cl={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},r=function(a,s,o,l){return e[a]},i=r;t.default=i,n.exports=t.default})(cl,cl.exports);var U1=cl.exports,ul={exports:{}},dl={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r){return function(i,a){var s=a!=null&&a.context?String(a.context):"standalone",o;if(s==="formatting"&&r.formattingValues){var l=r.defaultFormattingWidth||r.defaultWidth,c=a!=null&&a.width?String(a.width):l;o=r.formattingValues[c]||r.formattingValues[l]}else{var u=r.defaultWidth,d=a!=null&&a.width?String(a.width):r.defaultWidth;o=r.values[d]||r.values[u]}var f=r.argumentCallback?r.argumentCallback(i):i;return o[f]}}n.exports=t.default})(dl,dl.exports);var W1=dl.exports;(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(W1),i={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},a={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},s={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"]},o={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"]},l={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"}},c={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"}},u=function(g,v){var x=Number(g),p=x%100;if(p>20||p<10)switch(p%10){case 1:return x+"st";case 2:return x+"nd";case 3:return x+"rd"}return x+"th"},d={ordinalNumber:u,era:(0,r.default)({values:i,defaultWidth:"wide"}),quarter:(0,r.default)({values:a,defaultWidth:"wide",argumentCallback:function(g){return g-1}}),month:(0,r.default)({values:s,defaultWidth:"wide"}),day:(0,r.default)({values:o,defaultWidth:"wide"}),dayPeriod:(0,r.default)({values:l,defaultWidth:"wide",formattingValues:c,defaultFormattingWidth:"wide"})},f=d;t.default=f,n.exports=t.default})(ul,ul.exports);var Y1=ul.exports,fl={exports:{}},hl={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(a){return function(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=o.width,c=l&&a.matchPatterns[l]||a.matchPatterns[a.defaultMatchWidth],u=s.match(c);if(!u)return null;var d=u[0],f=l&&a.parsePatterns[l]||a.parsePatterns[a.defaultParseWidth],g=Array.isArray(f)?i(f,function(p){return p.test(d)}):r(f,function(p){return p.test(d)}),v;v=a.valueCallback?a.valueCallback(g):g,v=o.valueCallback?o.valueCallback(v):v;var x=s.slice(d.length);return{value:v,rest:x}}}function r(a,s){for(var o in a)if(a.hasOwnProperty(o)&&s(a[o]))return o}function i(a,s){for(var o=0;o<a.length;o++)if(s(a[o]))return o}n.exports=t.default})(hl,hl.exports);var H1=hl.exports,gl={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r){return function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=i.match(r.matchPattern);if(!s)return null;var o=s[0],l=i.match(r.parsePattern);if(!l)return null;var c=r.valueCallback?r.valueCallback(l[0]):l[0];c=a.valueCallback?a.valueCallback(c):c;var u=i.slice(o.length);return{value:c,rest:u}}}n.exports=t.default})(gl,gl.exports);var z1=gl.exports;(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(H1),i=e(z1),a=/^(\d+)(th|st|nd|rd)?/i,s=/\d+/i,o={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},l={any:[/^b/i,/^(a|c)/i]},c={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},u={any:[/1/i,/2/i,/3/i,/4/i]},d={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},f={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]},g={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},v={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]},x={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},p={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}},b={ordinalNumber:(0,i.default)({matchPattern:a,parsePattern:s,valueCallback:function(y){return parseInt(y,10)}}),era:(0,r.default)({matchPatterns:o,defaultMatchWidth:"wide",parsePatterns:l,defaultParseWidth:"any"}),quarter:(0,r.default)({matchPatterns:c,defaultMatchWidth:"wide",parsePatterns:u,defaultParseWidth:"any",valueCallback:function(y){return y+1}}),month:(0,r.default)({matchPatterns:d,defaultMatchWidth:"wide",parsePatterns:f,defaultParseWidth:"any"}),day:(0,r.default)({matchPatterns:g,defaultMatchWidth:"wide",parsePatterns:v,defaultParseWidth:"any"}),dayPeriod:(0,r.default)({matchPatterns:x,defaultMatchWidth:"any",parsePatterns:p,defaultParseWidth:"any"})},m=b;t.default=m,n.exports=t.default})(fl,fl.exports);var $1=fl.exports;(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(N1),i=e(B1),a=e(U1),s=e(Y1),o=e($1),l={code:"en-US",formatDistance:r.default,formatLong:i.default,formatRelative:a.default,localize:s.default,match:o.default,options:{weekStartsOn:0,firstWeekContainsDate:1}},c=l;t.default=c,n.exports=t.default})(al,al.exports);var j1=al.exports;(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(j1),i=r.default;t.default=i,n.exports=t.default})(il,il.exports);var V1=il.exports;(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=y;var r=e(b1),i=e(x1),a=e($e),s=e(O1),o=e(P1),l=e(Hf),c=si,u=e(zn),d=e(le),f=$n,g=e(V1),v=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,x=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,p=/^'([^]*?)'?$/,b=/''/g,m=/[a-zA-Z]/;function y(T,S,k){var M,D,O,P,A,F,q,$,H,I,it,U,yt,dt,Y,L,B,j;(0,d.default)(2,arguments);var Z=String(S),K=(0,f.getDefaultOptions)(),N=(M=(D=k==null?void 0:k.locale)!==null&&D!==void 0?D:K.locale)!==null&&M!==void 0?M:g.default,R=(0,u.default)((O=(P=(A=(F=k==null?void 0:k.firstWeekContainsDate)!==null&&F!==void 0?F:k==null||(q=k.locale)===null||q===void 0||($=q.options)===null||$===void 0?void 0:$.firstWeekContainsDate)!==null&&A!==void 0?A:K.firstWeekContainsDate)!==null&&P!==void 0?P:(H=K.locale)===null||H===void 0||(I=H.options)===null||I===void 0?void 0:I.firstWeekContainsDate)!==null&&O!==void 0?O:1);if(!(R>=1&&R<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var Q=(0,u.default)((it=(U=(yt=(dt=k==null?void 0:k.weekStartsOn)!==null&&dt!==void 0?dt:k==null||(Y=k.locale)===null||Y===void 0||(L=Y.options)===null||L===void 0?void 0:L.weekStartsOn)!==null&&yt!==void 0?yt:K.weekStartsOn)!==null&&U!==void 0?U:(B=K.locale)===null||B===void 0||(j=B.options)===null||j===void 0?void 0:j.weekStartsOn)!==null&&it!==void 0?it:0);if(!(Q>=0&&Q<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!N.localize)throw new RangeError("locale must contain localize property");if(!N.formatLong)throw new RangeError("locale must contain formatLong property");var X=(0,a.default)(T);if(!(0,r.default)(X))throw new RangeError("Invalid time value");var vt=(0,l.default)(X),ut=(0,i.default)(X,vt),Pt={firstWeekContainsDate:R,weekStartsOn:Q,locale:N,_originalDate:X},_t=Z.match(x).map(function(et){var xt=et[0];if(xt==="p"||xt==="P"){var Ft=o.default[xt];return Ft(et,N.formatLong)}return et}).join("").match(v).map(function(et){if(et==="''")return"'";var xt=et[0];if(xt==="'")return w(et);var Ft=s.default[xt];if(Ft)return!(k!=null&&k.useAdditionalWeekYearTokens)&&(0,c.isProtectedWeekYearToken)(et)&&(0,c.throwProtectedError)(et,S,String(T)),!(k!=null&&k.useAdditionalDayOfYearTokens)&&(0,c.isProtectedDayOfYearToken)(et)&&(0,c.throwProtectedError)(et,S,String(T)),Ft(ut,et,N.localize,Pt);if(xt.match(m))throw new RangeError("Format string contains an unescaped latin alphabet character `"+xt+"`");return et}).join("");return _t}function w(T){var S=T.match(p);return S?S[1].replace(b,"'"):T}n.exports=t.default})(Lf,Lf.exports);function q1(n,t){var e=Q1(t);return e.formatToParts?G1(e,n):K1(e,n)}var X1={year:0,month:1,day:2,hour:3,minute:4,second:5};function G1(n,t){try{for(var e=n.formatToParts(t),r=[],i=0;i<e.length;i++){var a=X1[e[i].type];a>=0&&(r[a]=parseInt(e[i].value,10))}return r}catch(s){if(s instanceof RangeError)return[NaN];throw s}}function K1(n,t){var e=n.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[r[3],r[1],r[2],r[4],r[5],r[6]]}var pl={};function Q1(n){if(!pl[n]){var t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:"America/New_York",year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),e=t==="06/25/2014, 00:00:00"||t==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";pl[n]=e?new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return pl[n]}function ml(n,t,e,r,i,a,s){var o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(r,i,a,s),o}var $f=36e5,Z1=6e4,bl={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-]\d{2}):?(\d{2})$/};function ua(n,t,e){var r,i;if(!n||(r=bl.timezoneZ.exec(n),r))return 0;var a;if(r=bl.timezoneHH.exec(n),r)return a=parseInt(r[1],10),jf(a)?-(a*$f):NaN;if(r=bl.timezoneHHMM.exec(n),r){a=parseInt(r[1],10);var s=parseInt(r[2],10);return jf(a,s)?(i=Math.abs(a)*$f+s*Z1,a>0?-i:i):NaN}if(eT(n)){t=new Date(t||Date.now());var o=e?t:J1(t),l=yl(o,n),c=e?l:tT(t,l,n);return-c}return NaN}function J1(n){return ml(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function yl(n,t){var e=q1(n,t),r=ml(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime(),i=n.getTime(),a=i%1e3;return i-=a>=0?a:1e3+a,r-i}function tT(n,t,e){var r=n.getTime(),i=r-t,a=yl(new Date(i),e);if(t===a)return t;i-=a-t;var s=yl(new Date(i),e);return a===s?a:Math.max(a,s)}function jf(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}var Vf={};function eT(n){if(Vf[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Vf[n]=!0,!0}catch{return!1}}var nT=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/;const qf=nT;var vl=36e5,Xf=6e4,rT=2,ce={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:qf};function xl(n,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);var e=t||{},r=e.additionalDigits==null?rT:y1(e.additionalDigits);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(!(typeof n=="string"||Object.prototype.toString.call(n)==="[object String]"))return new Date(NaN);var i=iT(n),a=aT(i.date,r),s=a.year,o=a.restDateString,l=sT(o,s);if(isNaN(l))return new Date(NaN);if(l){var c=l.getTime(),u=0,d;if(i.time&&(u=oT(i.time),isNaN(u)))return new Date(NaN);if(i.timeZone||e.timeZone){if(d=ua(i.timeZone||e.timeZone,new Date(c+u)),isNaN(d))return new Date(NaN)}else d=zf(new Date(c+u)),d=zf(new Date(c+u+d));return new Date(c+u+d)}else return new Date(NaN)}function iT(n){var t={},e=ce.dateTimePattern.exec(n),r;if(e?(t.date=e[1],r=e[3]):(e=ce.datePattern.exec(n),e?(t.date=e[1],r=e[2]):(t.date=null,r=n)),r){var i=ce.timeZone.exec(r);i?(t.time=r.replace(i[1],""),t.timeZone=i[1].trim()):t.time=r}return t}function aT(n,t){var e=ce.YYY[t],r=ce.YYYYY[t],i;if(i=ce.YYYY.exec(n)||r.exec(n),i){var a=i[1];return{year:parseInt(a,10),restDateString:n.slice(a.length)}}if(i=ce.YY.exec(n)||e.exec(n),i){var s=i[1];return{year:parseInt(s,10)*100,restDateString:n.slice(s.length)}}return{year:null}}function sT(n,t){if(t===null)return null;var e,r,i,a;if(n.length===0)return r=new Date(0),r.setUTCFullYear(t),r;if(e=ce.MM.exec(n),e)return r=new Date(0),i=parseInt(e[1],10)-1,Qf(t,i)?(r.setUTCFullYear(t,i),r):new Date(NaN);if(e=ce.DDD.exec(n),e){r=new Date(0);var s=parseInt(e[1],10);return uT(t,s)?(r.setUTCFullYear(t,0,s),r):new Date(NaN)}if(e=ce.MMDD.exec(n),e){r=new Date(0),i=parseInt(e[1],10)-1;var o=parseInt(e[2],10);return Qf(t,i,o)?(r.setUTCFullYear(t,i,o),r):new Date(NaN)}if(e=ce.Www.exec(n),e)return a=parseInt(e[1],10)-1,Zf(t,a)?Gf(t,a):new Date(NaN);if(e=ce.WwwD.exec(n),e){a=parseInt(e[1],10)-1;var l=parseInt(e[2],10)-1;return Zf(t,a,l)?Gf(t,a,l):new Date(NaN)}return null}function oT(n){var t,e,r;if(t=ce.HH.exec(n),t)return e=parseFloat(t[1].replace(",",".")),wl(e)?e%24*vl:NaN;if(t=ce.HHMM.exec(n),t)return e=parseInt(t[1],10),r=parseFloat(t[2].replace(",",".")),wl(e,r)?e%24*vl+r*Xf:NaN;if(t=ce.HHMMSS.exec(n),t){e=parseInt(t[1],10),r=parseInt(t[2],10);var i=parseFloat(t[3].replace(",","."));return wl(e,r,i)?e%24*vl+r*Xf+i*1e3:NaN}return null}function Gf(n,t,e){t=t||0,e=e||0;var r=new Date(0);r.setUTCFullYear(n,0,4);var i=r.getUTCDay()||7,a=t*7+e+1-i;return r.setUTCDate(r.getUTCDate()+a),r}var lT=[31,28,31,30,31,30,31,31,30,31,30,31],cT=[31,29,31,30,31,30,31,31,30,31,30,31];function Kf(n){return n%400===0||n%4===0&&n%100!==0}function Qf(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;var r=Kf(n);if(r&&e>cT[t]||!r&&e>lT[t])return!1}return!0}function uT(n,t){if(t<1)return!1;var e=Kf(n);return!(e&&t>366||!e&&t>365)}function Zf(n,t,e){return!(t<0||t>52||e!=null&&(e<0||e>6))}function wl(n,t,e){return!(n!=null&&(n<0||n>=25)||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}var _l={exports:{}},Tl={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r,i){if(r==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a]);return r}n.exports=t.default})(Tl,Tl.exports);var dT=Tl.exports;(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var r=e(dT);function i(a){return(0,r.default)({},a)}n.exports=t.default})(_l,_l.exports);var fT=_l.exports;const hT=Lo(fT);function gT(n,t,e){var r=xl(n,e),i=ua(t,r,!0),a=new Date(r.getTime()-i),s=new Date(0);return s.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),s.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),s}function pT(n,t){return-ua(n,t)}function mT(n,t,e){if(typeof n=="string"&&!n.match(qf)){var r=hT(e);return r.timeZone=t,xl(n,r)}var i=xl(n,e),a=ml(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds()).getTime(),s=ua(t,new Date(a));return new Date(a+s)}const bT={[ct.MINUTELY]:60*1e3,[ct.HOURLY]:60*60*1e3,[ct.DAILY]:60*60*24*1e3,[ct.WEEKLY]:60*60*24*7*1e3};function Ml(n){return n&&Object.values(ct).find(t=>n<=bT[t])||null}const hr=(n,t)=>new Date(n.getTime()-pT(t,n));class Ae{constructor(t){He(this,"timeframeText"),He(this,"key"),He(this,"display"),He(this,"timeframeLength"),He(this,"allowedTiers"),He(this,"defaultResponseGranularity"),He(this,"dataGranularity"),He(this,"isRelative"),He(this,"_startCustom"),He(this,"_endCustom"),this.display=t.display,this.timeframeText=t.timeframeText,this.key=t.key,this.timeframeLength=t.timeframeLength,this.allowedTiers=t.allowedTiers,this.defaultResponseGranularity=t.defaultResponseGranularity,this.dataGranularity=t.dataGranularity,this.isRelative=t.isRelative,this._startCustom=t.startCustom,this._endCustom=t.endCustom}rawEnd(t){return this._endCustom||new Date}rawStart(t){return this._startCustom||new Date(this.rawEnd().getTime()-this.timeframeLengthMs())}timeframeLengthMs(){return this.timeframeLength()*1e3}maximumTimeframeLength(){return this.timeframeLength()}allowedGranularities(){const t=new Set,e=this.maximumTimeframeLength()/3600;return e<=6&&t.add(ct.MINUTELY),e>=2&&e<=7*24&&t.add(ct.HOURLY),e>=2*24&&t.add(ct.DAILY),e>=2*24*14&&t.add(ct.WEEKLY),t}tzAdjustedDate(t){if(!t)return new Date;const e=mT(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return gT(e,t)}}class yT extends Ae{rawStart(t){let e=ca(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=hr(e,t)),e}maximumTimeframeLength(){return 60*60*24*7}}class vT extends Ae{rawStart(t){let e=fr(this.tzAdjustedDate(t));return t&&(e=hr(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class xT extends Ae{rawEnd(t){let e=ca(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=hr(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let r=ca(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(r=hr(r,t)),r}}class wT extends Ae{rawEnd(t){let e=fr(this.tzAdjustedDate(t));return t&&(e=hr(e,t)),e}rawStart(t){let e=fr(Rf(this.tzAdjustedDate(t),1));return t&&(e=hr(e,t)),e}}zt.FIFTEEN_MIN,new Ae({key:zt.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:ct.MINUTELY,dataGranularity:ct.MINUTELY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),zt.ONE_HOUR,new Ae({key:zt.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:ct.MINUTELY,dataGranularity:ct.MINUTELY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),zt.SIX_HOUR,new Ae({key:zt.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:ct.HOURLY,dataGranularity:ct.HOURLY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),zt.TWELVE_HOUR,new Ae({key:zt.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:ct.HOURLY,dataGranularity:ct.HOURLY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),zt.ONE_DAY,new Ae({key:zt.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:ct.HOURLY,dataGranularity:ct.HOURLY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),zt.SEVEN_DAY,new Ae({key:zt.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:ct.DAILY,dataGranularity:ct.DAILY,isRelative:!0,allowedTiers:["trial","plus","enterprise"]}),zt.THIRTY_DAY,new Ae({key:zt.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:ct.DAILY,dataGranularity:ct.DAILY,isRelative:!0,allowedTiers:["trial","plus","enterprise"]}),zt.CURRENT_WEEK,new yT({key:zt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=ca(new Date,{weekStartsOn:1});return(Af(Ef(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:ct.DAILY,dataGranularity:ct.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]}),zt.CURRENT_MONTH,new vT({key:zt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=fr(new Date);return(Af(Ef(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:ct.DAILY,dataGranularity:ct.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]}),zt.PREVIOUS_WEEK,new xT({key:zt.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:ct.DAILY,dataGranularity:ct.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]}),zt.PREVIOUS_MONTH,new wT({key:zt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=fr(new Date),e=fr(Rf(new Date,1));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=_T(t,e)),60*60*24*h1(new Date().setMonth(new Date().getMonth()-1))+g1(n)},defaultResponseGranularity:ct.DAILY,dataGranularity:ct.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]});function _T(n,t){return p1(n.getTimezoneOffset()-t.getTimezoneOffset())}function TT(n){const t=h.computed(()=>{var l,c;return{type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:10,autoSkipPadding:100,source:"auto",maxRotation:0},title:{display:!at((l=n.dimensionAxesTitle)==null?void 0:l.value),text:(c=n.dimensionAxesTitle)==null?void 0:c.value,padding:{top:20},font:{weight:"bold"}}}}),e=h.computed(()=>{var l,c;return{title:{display:!at((l=n.metricAxesTitle)==null?void 0:l.value),text:(c=n.metricAxesTitle)==null?void 0:c.value,padding:{bottom:20},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0}}),r={enabled:!1,position:"lineChartTooltipPosition"};Vi.positioners.lineChartTooltipPosition=function(l,c){if(!l.length||n.tooltipState.locked)return!1;const u=this.chart.canvas.getBoundingClientRect(),d=n.tooltipState.width||this.width,f=n.tooltipState.height||this.height,g=u.width/2,v=u.height/2,x=Bs(c,d,g);let p=Ew(c,f,v);const b=c.y<v?"top":"bottom",m=c.x<g?"left":"center";return f>u.height&&(p=0),{x,y:p,xAlign:m,yAlign:b}};const i=h.computed(()=>{switch(n.granularity.value){case ct.MINUTELY:return"minute";case ct.HOURLY:return"hour";case ct.DAILY:return"day";default:return"day"}}),a=h.computed(()=>uw(Number(n.timeRangeMs.value))>=24?"yyyy-MM-dd h:mm":"h:mm"),s=h.computed(()=>[ct.DAILY,ct.WEEKLY].includes(n.granularity.value)?"yyyy-MM-dd":"yyyy-MM-dd h:mm");return{options:h.computed(()=>({hover:{mode:"index",intersect:!1},elements:{point:{radius:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:{border:{display:!1},...t.value,stacked:n.stacked.value,time:{tooltipFormat:"h:mm:ss a",unit:i.value,displayFormats:{minute:"h:mm:ss a",hour:a.value,day:s.value}}},y:{border:{display:!1},...e.value,stacked:n.stacked.value}},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...r,external:l=>{Fs(n.tooltipState,l)}}},interaction:{mode:"index",intersect:!1}}))}}function MT(n){const{isMultiMetric:t,hasDimensions:e,metricNames:r,barSegmentLabels:i,pivotRecords:a,rowLabels:s,colorPalette:o}=n,{i18n:l}=kt.useI18n();return t?r.map(c=>({label:l&&l.te(`chartLabels.${c}`)&&l.t(`chartLabels.${c}`)||c,backgroundColor:ur(r.indexOf(c),Ce),data:s.map((u,d)=>e?a[`${u.id},${c}`]||0:a[`${d},${c}`]||null)})):Array.from(i).flatMap((c,u)=>{if(!c)return[];const d={},f=Array.isArray(o)?ur(u,o):o[c.name]||ur(u);return d[c.name]=f,{label:l&&l.te(`chartLabels.${c.name}`)&&l.t(`chartLabels.${c.name}`)||c.name,backgroundColor:f,data:s.map(g=>a[`${g.id},${c.id}`]||null)}})}function DT(n,t){const{i18n:e}=kt.useI18n();return h.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const i=t.value.data,{display:a,metric_names:s}=t.value.meta,o=a&&Object.keys(a),l=s&&s.length>1,c=a&&o&&o.length>0;if(!i.length||!s)return{datasets:[],labels:[]};const u=c&&o||s,d=u[0],f=u.length>1?u[1]:u[0],g=Object.fromEntries(l?i.flatMap(y=>s.map((w,T)=>{const S=y.event[d],k=c?`${S},${w}`:`${T},${w}`,M=y.event[w];return[k,M]})):i.map(y=>{const w=c?`${y.event[d]},${y.event[f]}`:`${d},${f}`,T=y.event[s[0]];return[w,T]})),v=a[d],x=a[f],p=c&&v&&Object.entries(v).map(([y,w])=>({id:y,name:w.name}))||s.map(y=>({id:y,name:y})),b=c&&x&&Object.entries(x).map(([y,w])=>({id:y,name:w.name}))||s.map(y=>({id:y,name:y}));return!p||!b?{labels:[],datasets:[]}:{labels:c?Object.entries(a[d]).map(([,y])=>e&&e.te(`chartLabels.${y.name}`)&&e.t(`chartLabels.${y.name}`)||y.name):s.map(y=>e&&e.te(`chartLabels.${y}`)&&e.t(`chartLabels.${y}`)||y),datasets:MT({isMultiMetric:l,hasDimensions:c,metricNames:s,dimensionFieldNames:u,barSegmentLabels:b,pivotRecords:g,rowLabels:p,colorPalette:n.colorPalette||Ce})}}}catch(i){return console.error(i),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const CT=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((r,i)=>r+i*e),kT=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return Kd(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},ST=(n,t,e,r,i)=>{const s=Math.max(t-6e4,Math.max(...(i||[]).map(c=>new Date(c.timestamp).valueOf()))),o=Math.floor((n-r)/e)*e+r,l=Math.floor((s-r)/e)*e+r+e;return CT(o,l,e)};function OT(n,t){const{i18n:e}=kt.useI18n();return h.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const i=t.value.data,{display:a,metric_names:s,start_ms:o,end_ms:l}=t.value.meta;if(!s)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const c=a&&Object.keys(a)||s,u=c&&c[0],d=a[u],f=a&&d&&Object.keys(d).map(T=>({id:T,name:d[T].name}))||s.map(T=>({id:T,name:T})),g=t.value.meta.granularity_ms;if(typeof g!="number"||isNaN(g)||!isFinite(g)||g===0)return console.error("Invalid step value:",g),{datasets:[],labels:[]};if(!i.length)return{datasets:[],labels:[]};const v=kT(o),x=ST(o,l,g,v,i),p=new Set,b=i!=null&&i.length?i.reduce((T,S)=>{const k=new Date(S.timestamp).valueOf(),M=S.event;for(const D of s)p.add(D),k in T||(T[k]={}),D in T[k]||(T[k][D]={});for(const D of s)f.forEach(O=>{M[u]===O.id||D===O.id?(T[k][D]||(T[k][D]={}),T[k][D][O.name]=Math.round(Number(M[D])*1e3)/1e3):c.length||(T[k][D]||(T[k][D]={}),T[k][D][O.name]=Math.round(Number(M[O.id])*1e3)/1e3)});return T},{}):{},m=s.length===1?s.flatMap(T=>f.map(S=>[T,S.name])):f.map(T=>[T.name,T.name]),y={},w=[...m].map(([T,S],k)=>{const M=x.map(F=>F in b&&T in b[F]?{x:F,y:b[F][T][S]||0}:{x:F,y:0});let{colorPalette:D,fill:O}=n;at(D)&&(D=Ce);const P=Array.isArray(D)?ur(k,D):D[S]||ur(k),A=ii(P,50);return y[S]=P,{rawDimension:S,rawMetric:T,label:e&&e.te(`chartLabels.${S}`)&&e.t(`chartLabels.${S}`)||S,borderColor:A,backgroundColor:P,data:M,total:M.reduce((F,{y:q})=>F+Number(q),0),...X_,fill:O,borderWidth:O?K_:G_}});return w.sort((T,S)=>Number(T.total)<Number(S.total)?-1:1),{datasets:w,colorMap:y}}}catch(i){return console.error(i),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const PT=(n,t)=>{h.watch([n,t],(e,r,i)=>{const[a,s]=e;!s||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(s,a),i(()=>{var o;(o=window._AnalyticsChartDataInternal)==null||o.delete(s)}))},{immediate:!0})};function ET(){const{i18n:n}=kt.useI18n();return{translateUnit:(e,r)=>{const i=r===1,a=`chartUnits.${e}`;return n.te(a)?n.t(a,{plural:i?"":"s"}):e}}}const kt={useBarChartOptions:J_,useChartJSCommon:e1,useChartLegendValues:r1,useChartSelectedRange:i1,useExploreResultToDatasets:DT,useExploreResultToTimeDataset:OT,useDoughnutChartOptions:a1,useLinechartOptions:TT,useI18n:wg,useReportChartDataForSynthetics:PT,useTranslatedUnits:ET};/*!
18
+ `):n}function jb(n,t){const{element:e,datasetIndex:r,index:i}=t,a=n.getDatasetMeta(r).controller,{label:s,value:o}=a.getLabelAndValue(i);return{chart:n,label:s,parsed:a.getParsed(i),raw:n.data.datasets[r].data[i],formattedValue:o,dataset:a.getDataset(),dataIndex:i,datasetIndex:r,element:e}}function ad(n,t){const e=n.chart.ctx,{body:r,footer:i,title:a}=n,{boxWidth:s,boxHeight:o}=t,l=Rt(t.bodyFont),c=Rt(t.titleFont),u=Rt(t.footerFont),d=a.length,f=i.length,g=r.length,v=Kt(t.padding);let x=v.height,p=0,b=r.reduce((w,T)=>w+T.before.length+T.lines.length+T.after.length,0);if(b+=n.beforeBody.length+n.afterBody.length,d&&(x+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const w=t.displayColors?Math.max(o,l.lineHeight):l.lineHeight;x+=g*w+(b-g)*l.lineHeight+(b-1)*t.bodySpacing}f&&(x+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let m=0;const y=function(w){p=Math.max(p,e.measureText(w).width+m)};return e.save(),e.font=c.string,Dt(n.title,y),e.font=l.string,Dt(n.beforeBody.concat(n.afterBody),y),m=t.displayColors?s+2+t.boxPadding:0,Dt(r,w=>{Dt(w.before,y),Dt(w.lines,y),Dt(w.after,y)}),m=0,e.font=u.string,Dt(n.footer,y),e.restore(),p+=v.width,{width:p,height:x}}function Vb(n,t){const{y:e,height:r}=t;return e<r/2?"top":e>n.height-r/2?"bottom":"center"}function qb(n,t,e,r){const{x:i,width:a}=r,s=e.caretSize+e.caretPadding;if(n==="left"&&i+a+s>t.width||n==="right"&&i-a-s<0)return!0}function Xb(n,t,e,r){const{x:i,width:a}=e,{width:s,chartArea:{left:o,right:l}}=n;let c="center";return r==="center"?c=i<=(o+l)/2?"left":"right":i<=a/2?c="left":i>=s-a/2&&(c="right"),qb(c,n,t,e)&&(c="center"),c}function sd(n,t,e){const r=e.yAlign||t.yAlign||Vb(n,e);return{xAlign:e.xAlign||t.xAlign||Xb(n,t,e,r),yAlign:r}}function Gb(n,t){let{x:e,width:r}=n;return t==="right"?e-=r:t==="center"&&(e-=r/2),e}function Kb(n,t,e){let{y:r,height:i}=n;return t==="top"?r+=e:t==="bottom"?r-=i+e:r-=i/2,r}function od(n,t,e,r){const{caretSize:i,caretPadding:a,cornerRadius:s}=n,{xAlign:o,yAlign:l}=e,c=i+a,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:g}=hn(s);let v=Gb(t,o);const x=Kb(t,l,c);return l==="center"?o==="left"?v+=c:o==="right"&&(v-=c):o==="left"?v-=Math.max(u,f)+i:o==="right"&&(v+=Math.max(d,g)+i),{x:Zt(v,0,r.width-t.width),y:Zt(x,0,r.height-t.height)}}function ji(n,t,e){const r=Kt(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-r.right:n.x+r.left}function ld(n){return Be([],Qe(n))}function Qb(n,t,e){return gn(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function cd(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const ud={beforeTitle:Ve,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,r=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return e[t.dataIndex]}return""},afterTitle:Ve,beforeBody:Ve,beforeLabel:Ve,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return at(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Ve,afterBody:Ve,beforeFooter:Ve,footer:Ve,afterFooter:Ve};function ge(n,t,e,r){const i=n[t].call(e,r);return typeof i>"u"?ud[t].call(e,r):i}class xs extends ee{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&e.options.animation&&r.animations,a=new ts(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){return this.$context||(this.$context=Qb(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:r}=e,i=ge(r,"beforeTitle",this,t),a=ge(r,"title",this,t),s=ge(r,"afterTitle",this,t);let o=[];return o=Be(o,Qe(i)),o=Be(o,Qe(a)),o=Be(o,Qe(s)),o}getBeforeBody(t,e){return ld(ge(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:r}=e,i=[];return Dt(t,a=>{const s={before:[],lines:[],after:[]},o=cd(r,a);Be(s.before,Qe(ge(o,"beforeLabel",this,a))),Be(s.lines,ge(o,"label",this,a)),Be(s.after,Qe(ge(o,"afterLabel",this,a))),i.push(s)}),i}getAfterBody(t,e){return ld(ge(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:r}=e,i=ge(r,"beforeFooter",this,t),a=ge(r,"footer",this,t),s=ge(r,"afterFooter",this,t);let o=[];return o=Be(o,Qe(i)),o=Be(o,Qe(a)),o=Be(o,Qe(s)),o}_createItems(t){const e=this._active,r=this.chart.data,i=[],a=[],s=[];let o=[],l,c;for(l=0,c=e.length;l<c;++l)o.push(jb(this.chart,e[l]));return t.filter&&(o=o.filter((u,d,f)=>t.filter(u,d,f,r))),t.itemSort&&(o=o.sort((u,d)=>t.itemSort(u,d,r))),Dt(o,u=>{const d=cd(t.callbacks,u);i.push(ge(d,"labelColor",this,u)),a.push(ge(d,"labelPointStyle",this,u)),s.push(ge(d,"labelTextColor",this,u))}),this.labelColors=i,this.labelPointStyles=a,this.labelTextColors=s,this.dataPoints=o,o}update(t,e){const r=this.options.setContext(this.getContext()),i=this._active;let a,s=[];if(!i.length)this.opacity!==0&&(a={opacity:0});else{const o=Vr[r.position].call(this,i,this._eventPosition);s=this._createItems(r),this.title=this.getTitle(s,r),this.beforeBody=this.getBeforeBody(s,r),this.body=this.getBody(s,r),this.afterBody=this.getAfterBody(s,r),this.footer=this.getFooter(s,r);const l=this._size=ad(this,r),c=Object.assign({},o,l),u=sd(this.chart,r,c),d=od(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,a={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:o.x,caretY:o.y}}this._tooltipItems=s,this.$context=void 0,a&&this._resolveAnimations().update(this,a),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,r,i){const a=this.getCaretPosition(t,r,i);e.lineTo(a.x1,a.y1),e.lineTo(a.x2,a.y2),e.lineTo(a.x3,a.y3)}getCaretPosition(t,e,r){const{xAlign:i,yAlign:a}=this,{caretSize:s,cornerRadius:o}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=hn(o),{x:f,y:g}=t,{width:v,height:x}=e;let p,b,m,y,w,T;return a==="center"?(w=g+x/2,i==="left"?(p=f,b=p-s,y=w+s,T=w-s):(p=f+v,b=p+s,y=w-s,T=w+s),m=p):(i==="left"?b=f+Math.max(l,u)+s:i==="right"?b=f+v-Math.max(c,d)-s:b=this.caretX,a==="top"?(y=g,w=y-s,p=b-s,m=b+s):(y=g+x,w=y+s,p=b+s,m=b-s),T=y),{x1:p,x2:b,x3:m,y1:y,y2:w,y3:T}}drawTitle(t,e,r){const i=this.title,a=i.length;let s,o,l;if(a){const c=ir(r.rtl,this.x,this.width);for(t.x=ji(this,r.titleAlign,r),e.textAlign=c.textAlign(r.titleAlign),e.textBaseline="middle",s=Rt(r.titleFont),o=r.titleSpacing,e.fillStyle=r.titleColor,e.font=s.string,l=0;l<a;++l)e.fillText(i[l],c.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+o,l+1===a&&(t.y+=r.titleMarginBottom-o)}}_drawColorBox(t,e,r,i,a){const s=this.labelColors[r],o=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=a,u=Rt(a.bodyFont),d=ji(this,"left",a),f=i.x(d),g=l<u.lineHeight?(u.lineHeight-l)/2:0,v=e.y+g;if(a.usePointStyle){const x={radius:Math.min(c,l)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},p=i.leftForLtr(f,c)+c/2,b=v+l/2;t.strokeStyle=a.multiKeyBackground,t.fillStyle=a.multiKeyBackground,qa(t,x,p,b),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,qa(t,x,p,b)}else{t.lineWidth=ct(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,t.strokeStyle=s.borderColor,t.setLineDash(s.borderDash||[]),t.lineDashOffset=s.borderDashOffset||0;const x=i.leftForLtr(f,c),p=i.leftForLtr(i.xPlus(f,1),c-2),b=hn(s.borderRadius);Object.values(b).some(m=>m!==0)?(t.beginPath(),t.fillStyle=a.multiKeyBackground,er(t,{x,y:v,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),er(t,{x:p,y:v+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(x,v,c,l),t.strokeRect(x,v,c,l),t.fillStyle=s.backgroundColor,t.fillRect(p,v+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,e,r){const{body:i}=this,{bodySpacing:a,bodyAlign:s,displayColors:o,boxHeight:l,boxWidth:c,boxPadding:u}=r,d=Rt(r.bodyFont);let f=d.lineHeight,g=0;const v=ir(r.rtl,this.x,this.width),x=function(M){e.fillText(M,v.x(t.x+g),t.y+f/2),t.y+=f+a},p=v.textAlign(s);let b,m,y,w,T,S,k;for(e.textAlign=s,e.textBaseline="middle",e.font=d.string,t.x=ji(this,p,r),e.fillStyle=r.bodyColor,Dt(this.beforeBody,x),g=o&&p!=="right"?s==="center"?c/2+u:c+2+u:0,w=0,S=i.length;w<S;++w){for(b=i[w],m=this.labelTextColors[w],e.fillStyle=m,Dt(b.before,x),y=b.lines,o&&y.length&&(this._drawColorBox(e,t,w,v,r),f=Math.max(d.lineHeight,l)),T=0,k=y.length;T<k;++T)x(y[T]),f=d.lineHeight;Dt(b.after,x)}g=0,f=d.lineHeight,Dt(this.afterBody,x),t.y-=a}drawFooter(t,e,r){const i=this.footer,a=i.length;let s,o;if(a){const l=ir(r.rtl,this.x,this.width);for(t.x=ji(this,r.footerAlign,r),t.y+=r.footerMarginTop,e.textAlign=l.textAlign(r.footerAlign),e.textBaseline="middle",s=Rt(r.footerFont),e.fillStyle=r.footerColor,e.font=s.string,o=0;o<a;++o)e.fillText(i[o],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+r.footerSpacing}}drawBackground(t,e,r,i){const{xAlign:a,yAlign:s}=this,{x:o,y:l}=t,{width:c,height:u}=r,{topLeft:d,topRight:f,bottomLeft:g,bottomRight:v}=hn(i.cornerRadius);e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.beginPath(),e.moveTo(o+d,l),s==="top"&&this.drawCaret(t,e,r,i),e.lineTo(o+c-f,l),e.quadraticCurveTo(o+c,l,o+c,l+f),s==="center"&&a==="right"&&this.drawCaret(t,e,r,i),e.lineTo(o+c,l+u-v),e.quadraticCurveTo(o+c,l+u,o+c-v,l+u),s==="bottom"&&this.drawCaret(t,e,r,i),e.lineTo(o+g,l+u),e.quadraticCurveTo(o,l+u,o,l+u-g),s==="center"&&a==="left"&&this.drawCaret(t,e,r,i),e.lineTo(o,l+d),e.quadraticCurveTo(o,l,o+d,l),e.closePath(),e.fill(),i.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,r=this.$animations,i=r&&r.x,a=r&&r.y;if(i||a){const s=Vr[t.position].call(this,this._active,this._eventPosition);if(!s)return;const o=this._size=ad(this,t),l=Object.assign({},s,this._size),c=sd(e,t,l),u=od(t,l,c,e);(i._to!==u.x||a._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=o.width,this.height=o.height,this.caretX=s.x,this.caretY=s.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(e);const i={width:this.width,height:this.height},a={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const s=Kt(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=r,this.drawBackground(a,t,i,e),$c(t,e.textDirection),a.y+=s.top,this.drawTitle(a,t,e),this.drawBody(a,t,e),this.drawFooter(a,t,e),jc(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const r=this._active,i=t.map(({datasetIndex:o,index:l})=>{const c=this.chart.getDatasetMeta(o);if(!c)throw new Error("Cannot find a dataset at index "+o);return{datasetIndex:o,element:c.data[l],index:l}}),a=!yi(r,i),s=this._positionChanged(i,e);(a||s)&&(this._active=i,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,r=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,a=this._active||[],s=this._getActiveElements(t,a,e,r),o=this._positionChanged(s,t),l=e||!yi(s,a)||o;return l&&(this._active=s,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,r,i){const a=this.options;if(t.type==="mouseout")return[];if(!i)return e.filter(o=>this.chart.data.datasets[o.datasetIndex]&&this.chart.getDatasetMeta(o.datasetIndex).controller.getParsed(o.index)!==void 0);const s=this.chart.getElementsAtEventForMode(t,a.mode,a,r);return a.reverse&&s.reverse(),s}_positionChanged(t,e){const{caretX:r,caretY:i,options:a}=this,s=Vr[a.position].call(this,t,e);return s!==!1&&(r!==s.x||i!==s.y)}}z(xs,"positioners",Vr);var Vi={id:"tooltip",_element:xs,positioners:Vr,afterInit(n,t,e){e&&(n.tooltip=new xs({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:ud},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Zb=Object.freeze({__proto__:null,Colors:db,Decimation:pb,Filler:Ib,Legend:Yb,SubTitle:$b,Title:zb,Tooltip:Vi});const Jb=(n,t,e,r)=>(typeof t=="string"?(e=n.push(t)-1,r.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function ty(n,t,e,r){const i=n.indexOf(t);if(i===-1)return Jb(n,t,e,r);const a=n.lastIndexOf(t);return i!==a?e:i}const ey=(n,t)=>n===null?null:Zt(Math.round(n),0,t);function dd(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class ws extends Nn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const r=this.getLabels();for(const{index:i,label:a}of e)r[i]===a&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(at(t))return null;const r=this.getLabels();return e=isFinite(e)&&r[e]===t?e:ty(r,t,rt(e,t),this._addedLabels),ey(e,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),e||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,e=this.max,r=this.options.offset,i=[];let a=this.getLabels();a=t===0&&e===a.length-1?a:a.slice(t,e+1),this._valueRange=Math.max(a.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let s=t;s<=e;s++)i.push({value:s});return i}getLabelForValue(t){return dd.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}z(ws,"id","category"),z(ws,"defaults",{ticks:{callback:dd}});function ny(n,t){const e=[],{bounds:i,step:a,min:s,max:o,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=n,g=a||1,v=u-1,{min:x,max:p}=t,b=!at(s),m=!at(o),y=!at(c),w=(p-x)/(d+1);let T=pc((p-x)/v/g)*g,S,k,M,D;if(T<1e-14&&!b&&!m)return[{value:x},{value:p}];D=Math.ceil(p/T)-Math.floor(x/T),D>v&&(T=pc(D*T/v/g)*g),at(l)||(S=Math.pow(10,l),T=Math.ceil(T*S)/S),i==="ticks"?(k=Math.floor(x/T)*T,M=Math.ceil(p/T)*T):(k=x,M=p),b&&m&&a&&Jg((o-s)/a,T/1e3)?(D=Math.round(Math.min((o-s)/T,u)),T=(o-s)/D,k=s,M=o):y?(k=b?s:k,M=m?o:M,D=c-1,T=(M-k)/D):(D=(M-k)/T,Cr(D,Math.round(D),T/1e3)?D=Math.round(D):D=Math.ceil(D));const O=Math.max(bc(T),bc(k));S=Math.pow(10,at(l)?O:l),k=Math.round(k*S)/S,M=Math.round(M*S)/S;let P=0;for(b&&(f&&k!==s?(e.push({value:s}),k<s&&P++,Cr(Math.round((k+P*T)*S)/S,s,fd(s,w,n))&&P++):k<s&&P++);P<D;++P){const A=Math.round((k+P*T)*S)/S;if(m&&A>o)break;e.push({value:A})}return m&&f&&M!==o?e.length&&Cr(e[e.length-1].value,o,fd(o,w,n))?e[e.length-1].value=o:e.push({value:o}):(!m||M===o)&&e.push({value:M}),e}function fd(n,t,{horizontal:e,minRotation:r}){const i=Gt(r),a=(e?Math.sin(i):Math.cos(i))||.001,s=.75*t*(""+n).length;return Math.min(t/a,s)}class qi extends Nn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return at(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:r}=this.getUserBounds();let{min:i,max:a}=this;const s=l=>i=e?i:l,o=l=>a=r?a:l;if(t){const l=Ne(i),c=Ne(a);l<0&&c<0?o(0):l>0&&c>0&&s(0)}if(i===a){let l=a===0?1:Math.abs(a*.05);o(a+l),t||s(i-l)}this.min=i,this.max=a}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),e=e||11),e&&(i=Math.min(e,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},a=this._range||this,s=ny(i,a);return t.bounds==="ticks"&&mc(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let e=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-e)/Math.max(t.length-1,1)/2;e-=i,r+=i}this._startValue=e,this._endValue=r,this._valueRange=r-e}getLabelForValue(t){return Or(t,this.chart.options.locale,this.options.ticks.format)}}class _s extends qi{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Nt(t)?t:0,this.max=Nt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,r=Gt(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,a=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,a.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}z(_s,"id","linear"),z(_s,"defaults",{ticks:{callback:Mi.formatters.numeric}});const qr=n=>Math.floor(dn(n)),Fn=(n,t)=>Math.pow(10,qr(n)+t);function hd(n){return n/Math.pow(10,qr(n))===1}function gd(n,t,e){const r=Math.pow(10,e),i=Math.floor(n/r);return Math.ceil(t/r)-i}function ry(n,t){const e=t-n;let r=qr(e);for(;gd(n,t,r)>10;)r++;for(;gd(n,t,r)<10;)r--;return Math.min(r,qr(n))}function iy(n,{min:t,max:e}){t=xe(n.min,t);const r=[],i=qr(t);let a=ry(t,e),s=a<0?Math.pow(10,Math.abs(a)):1;const o=Math.pow(10,a),l=i>a?Math.pow(10,i):0,c=Math.round((t-l)*s)/s,u=Math.floor((t-l)/o/10)*o*10;let d=Math.floor((c-u)/Math.pow(10,a)),f=xe(n.min,Math.round((l+u+d*Math.pow(10,a))*s)/s);for(;f<e;)r.push({value:f,major:hd(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(a++,d=2,s=a>=0?1:s),f=Math.round((l+u+d*Math.pow(10,a))*s)/s;const g=xe(n.max,f);return r.push({value:g,major:hd(g),significand:d}),r}class Ts extends Nn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const r=qi.prototype.parse.apply(this,[t,e]);if(r===0){this._zero=!0;return}return Nt(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Nt(t)?Math.max(0,t):null,this.max=Nt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Nt(this._userMin)&&(this.min=t===Fn(this.min,0)?Fn(this.min,-1):Fn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let r=this.min,i=this.max;const a=o=>r=t?r:o,s=o=>i=e?i:o;r===i&&(r<=0?(a(1),s(10)):(a(Fn(r,-1)),s(Fn(i,1)))),r<=0&&a(Fn(i,-1)),i<=0&&s(Fn(r,1)),this.min=r,this.max=i}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},r=iy(e,this);return t.bounds==="ticks"&&mc(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":Or(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=dn(t),this._valueRange=dn(this.max)-dn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(dn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}z(Ts,"id","logarithmic"),z(Ts,"defaults",{ticks:{callback:Mi.formatters.logarithmic,major:{enabled:!0}}});function Ms(n){const t=n.ticks;if(t.display&&n.display){const e=Kt(t.backdropPadding);return rt(t.font&&t.font.size,Ut.font.size)+e.height}return 0}function ay(n,t,e){return e=bt(e)?e:[e],{w:mp(n,t.string,e),h:e.length*t.lineHeight}}function pd(n,t,e,r,i){return n===r||n===i?{start:t-e/2,end:t+e/2}:n<r||n>i?{start:t-e,end:t}:{start:t,end:t+e}}function sy(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),r=[],i=[],a=n._pointLabels.length,s=n.options.pointLabels,o=s.centerPointLabels?ft/a:0;for(let l=0;l<a;l++){const c=s.setContext(n.getPointLabelContext(l));i[l]=c.padding;const u=n.getPointPosition(l,n.drawingArea+i[l],o),d=Rt(c.font),f=ay(n.ctx,d,n._pointLabels[l]);r[l]=f;const g=we(n.getIndexAngle(l)+o),v=Math.round(_i(g)),x=pd(v,u.x,f.w,0,180),p=pd(v,u.y,f.h,90,270);oy(e,t,g,x,p)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=uy(n,r,i)}function oy(n,t,e,r,i){const a=Math.abs(Math.sin(e)),s=Math.abs(Math.cos(e));let o=0,l=0;r.start<t.l?(o=(t.l-r.start)/a,n.l=Math.min(n.l,t.l-o)):r.end>t.r&&(o=(r.end-t.r)/a,n.r=Math.max(n.r,t.r+o)),i.start<t.t?(l=(t.t-i.start)/s,n.t=Math.min(n.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/s,n.b=Math.max(n.b,t.b+l))}function ly(n,t,e){const r=n.drawingArea,{extra:i,additionalAngle:a,padding:s,size:o}=e,l=n.getPointPosition(t,r+i+s,a),c=Math.round(_i(we(l.angle+At))),u=hy(l.y,o.h,c),d=dy(c),f=fy(l.x,o.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:f,top:u,right:f+o.w,bottom:u+o.h}}function cy(n,t){if(!t)return!0;const{left:e,top:r,right:i,bottom:a}=n;return!(Ge({x:e,y:r},t)||Ge({x:e,y:a},t)||Ge({x:i,y:r},t)||Ge({x:i,y:a},t))}function uy(n,t,e){const r=[],i=n._pointLabels.length,a=n.options,{centerPointLabels:s,display:o}=a.pointLabels,l={extra:Ms(a)/2,additionalAngle:s?ft/i:0};let c;for(let u=0;u<i;u++){l.padding=e[u],l.size=t[u];const d=ly(n,u,l);r.push(d),o==="auto"&&(d.visible=cy(d,c),d.visible&&(c=d))}return r}function dy(n){return n===0||n===180?"center":n<180?"left":"right"}function fy(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function hy(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function gy(n,t,e){const{left:r,top:i,right:a,bottom:s}=e,{backdropColor:o}=t;if(!at(o)){const l=hn(t.borderRadius),c=Kt(t.backdropPadding);n.fillStyle=o;const u=r-c.left,d=i-c.top,f=a-r+c.width,g=s-i+c.height;Object.values(l).some(v=>v!==0)?(n.beginPath(),er(n,{x:u,y:d,w:f,h:g,radius:l}),n.fill()):n.fillRect(u,d,f,g)}}function py(n,t){const{ctx:e,options:{pointLabels:r}}=n;for(let i=t-1;i>=0;i--){const a=n._pointLabelItems[i];if(!a.visible)continue;const s=r.setContext(n.getPointLabelContext(i));gy(e,s,a);const o=Rt(s.font),{x:l,y:c,textAlign:u}=a;An(e,n._pointLabels[i],l,c+o.lineHeight/2,o,{color:s.color,textAlign:u,textBaseline:"middle"})}}function md(n,t,e,r){const{ctx:i}=n;if(e)i.arc(n.xCenter,n.yCenter,t,0,Ot);else{let a=n.getPointPosition(0,t);i.moveTo(a.x,a.y);for(let s=1;s<r;s++)a=n.getPointPosition(s,t),i.lineTo(a.x,a.y)}}function my(n,t,e,r,i){const a=n.ctx,s=t.circular,{color:o,lineWidth:l}=t;!s&&!r||!o||!l||e<0||(a.save(),a.strokeStyle=o,a.lineWidth=l,a.setLineDash(i.dash),a.lineDashOffset=i.dashOffset,a.beginPath(),md(n,e,s,r),a.closePath(),a.stroke(),a.restore())}function by(n,t,e){return gn(n,{label:e,index:t,type:"pointLabel"})}class Xr extends qi{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=Kt(Ms(this.options)/2),e=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(e,r)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=Nt(t)&&!isNaN(t)?t:0,this.max=Nt(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Ms(this.options))}generateTickLabels(t){qi.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,r)=>{const i=Mt(this.options.pointLabels.callback,[e,r],this);return i||i===0?i:""}).filter((e,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?sy(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,r,i){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((r-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,r,i))}getIndexAngle(t){const e=Ot/(this._pointLabels.length||1),r=this.options.startAngle||0;return we(t*e+Gt(r))}getDistanceFromCenterForValue(t){if(at(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(at(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const r=e[t];return by(this.getContext(),t,r)}}getPointPosition(t,e,r=0){const i=this.getIndexAngle(t)-At+r;return{x:Math.cos(i)*e+this.xCenter,y:Math.sin(i)*e+this.yCenter,angle:i}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:r,right:i,bottom:a}=this._pointLabelItems[t];return{left:e,top:r,right:i,bottom:a}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),md(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:r,grid:i,border:a}=e,s=this._pointLabels.length;let o,l,c;if(e.pointLabels.display&&py(this,s),i.display&&this.ticks.forEach((u,d)=>{if(d!==0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(d),g=i.setContext(f),v=a.setContext(f);my(this,g,l,s,v)}}),r.display){for(t.save(),o=s-1;o>=0;o--){const u=r.setContext(this.getPointLabelContext(o)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),c=this.getPointPosition(o,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,r=e.ticks;if(!r.display)return;const i=this.getIndexAngle(0);let a,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((o,l)=>{if(l===0&&!e.reverse)return;const c=r.setContext(this.getContext(l)),u=Rt(c.font);if(a=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,s=t.measureText(o.label).width,t.fillStyle=c.backdropColor;const d=Kt(c.backdropPadding);t.fillRect(-s/2-d.left,-a-u.size/2-d.top,s+d.width,u.size+d.height)}An(t,o.label,0,-a,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}z(Xr,"id","radialLinear"),z(Xr,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Mi.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),z(Xr,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),z(Xr,"descriptors",{angleLines:{_fallback:"grid"}});const Xi={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}},pe=Object.keys(Xi);function bd(n,t){return n-t}function yd(n,t){if(at(t))return null;const e=n._adapter,{parser:r,round:i,isoWeekday:a}=n._parseOpts;let s=t;return typeof r=="function"&&(s=r(s)),Nt(s)||(s=typeof r=="string"?e.parse(s,r):e.parse(s)),s===null?null:(i&&(s=i==="week"&&(fn(a)||a===!0)?e.startOf(s,"isoWeek",a):e.startOf(s,i)),+s)}function vd(n,t,e,r){const i=pe.length;for(let a=pe.indexOf(n);a<i-1;++a){const s=Xi[pe[a]],o=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((e-t)/(o*s.size))<=r)return pe[a]}return pe[i-1]}function yy(n,t,e,r,i){for(let a=pe.length-1;a>=pe.indexOf(e);a--){const s=pe[a];if(Xi[s].common&&n._adapter.diff(i,r,s)>=t-1)return s}return pe[e?pe.indexOf(e):0]}function vy(n){for(let t=pe.indexOf(n)+1,e=pe.length;t<e;++t)if(Xi[pe[t]].common)return pe[t]}function xd(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:r,hi:i}=Ya(e,t),a=e[r]>=t?e[r]:e[i];n[a]=!0}}function xy(n,t,e,r){const i=n._adapter,a=+i.startOf(t[0].value,r),s=t[t.length-1].value;let o,l;for(o=a;o<=s;o=+i.add(o,1,r))l=e[o],l>=0&&(t[l].major=!0);return t}function wd(n,t,e){const r=[],i={},a=t.length;let s,o;for(s=0;s<a;++s)o=t[s],i[o]=s,r.push({value:o,major:!1});return a===0||!e?r:xy(n,r,i,e)}class Gr extends Nn{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const r=t.time||(t.time={}),i=this._adapter=new uu._date(t.adapters.date);i.init(e),Dr(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:yd(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,r=t.time.unit||"day";let{min:i,max:a,minDefined:s,maxDefined:o}=this.getUserBounds();function l(c){!s&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!o&&!isNaN(c.max)&&(a=Math.max(a,c.max))}(!s||!o)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=Nt(i)&&!isNaN(i)?i:+e.startOf(Date.now(),r),a=Nt(a)&&!isNaN(a)?a:+e.endOf(Date.now(),r)+1,this.min=Math.min(i,a-1),this.max=Math.max(i+1,a)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],r=t[t.length-1]),{min:e,max:r}}buildTicks(){const t=this.options,e=t.time,r=t.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const a=this.min,s=this.max,o=rp(i,a,s);return this._unit=e.unit||(r.autoSkip?vd(e.minUnit,this.min,this.max,this._getLabelCapacity(a)):yy(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:vy(this._unit),this.initOffsets(i),t.reverse&&o.reverse(),wd(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,r=0,i,a;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?e=1-i:e=(this.getDecimalForValue(t[1])-i)/2,a=this.getDecimalForValue(t[t.length-1]),t.length===1?r=a:r=(a-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;e=Zt(e,0,s),r=Zt(r,0,s),this._offsets={start:e,end:r,factor:1/(e+1+r)}}_generate(){const t=this._adapter,e=this.min,r=this.max,i=this.options,a=i.time,s=a.unit||vd(a.minUnit,e,r,this._getLabelCapacity(e)),o=rt(i.ticks.stepSize,1),l=s==="week"?a.isoWeekday:!1,c=fn(l)||l===!0,u={};let d=e,f,g;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":s),t.diff(r,e,s)>1e5*o)throw new Error(e+" and "+r+" are too far apart with stepSize of "+o+" "+s);const v=i.ticks.source==="data"&&this.getDataTimestamps();for(f=d,g=0;f<r;f=+t.add(f,o,s),g++)xd(u,f,v);return(f===r||i.bounds==="ticks"||g===1)&&xd(u,f,v),Object.keys(u).sort(bd).map(x=>+x)}getLabelForValue(t){const e=this._adapter,r=this.options.time;return r.tooltipFormat?e.format(t,r.tooltipFormat):e.format(t,r.displayFormats.datetime)}format(t,e){const i=this.options.time.displayFormats,a=this._unit,s=e||i[a];return this._adapter.format(t,s)}_tickFormatFunction(t,e,r,i){const a=this.options,s=a.ticks.callback;if(s)return Mt(s,[t,e,r],this);const o=a.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&o[l],d=c&&o[c],f=r[e],g=c&&d&&f&&f.major;return this._adapter.format(t,i||(g?d:u))}generateTickLabels(t){let e,r,i;for(e=0,r=t.length;e<r;++e)i=t[e],i.label=this._tickFormatFunction(i.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+r)*e.factor)}getValueForPixel(t){const e=this._offsets,r=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,r=this.ctx.measureText(t).width,i=Gt(this.isHorizontal()?e.maxRotation:e.minRotation),a=Math.cos(i),s=Math.sin(i),o=this._resolveTickFontOptions(0).size;return{w:r*a+o*s,h:r*s+o*a}}_getLabelCapacity(t){const e=this.options.time,r=e.displayFormats,i=r[e.unit]||r.millisecond,a=this._tickFormatFunction(t,0,wd(this,[t],this._majorUnit),i),s=this._getLabelSize(a),o=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return o>0?o:1}getDataTimestamps(){let t=this._cache.data||[],e,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(e=0,r=i.length;e<r;++e)t=t.concat(i[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,r;if(t.length)return t;const i=this.getLabels();for(e=0,r=i.length;e<r;++e)t.push(yd(this,i[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return wc(t.sort(bd))}}z(Gr,"id","time"),z(Gr,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Gi(n,t,e){let r=0,i=n.length-1,a,s,o,l;e?(t>=n[r].pos&&t<=n[i].pos&&({lo:r,hi:i}=Xe(n,"pos",t)),{pos:a,time:o}=n[r],{pos:s,time:l}=n[i]):(t>=n[r].time&&t<=n[i].time&&({lo:r,hi:i}=Xe(n,"time",t)),{time:a,pos:o}=n[r],{time:s,pos:l}=n[i]);const c=s-a;return c?o+(l-o)*(t-a)/c:o}class Ds extends Gr{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Gi(e,this.min),this._tableRange=Gi(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:r}=this,i=[],a=[];let s,o,l,c,u;for(s=0,o=t.length;s<o;++s)c=t[s],c>=e&&c<=r&&i.push(c);if(i.length<2)return[{time:e,pos:0},{time:r,pos:1}];for(s=0,o=i.length;s<o;++s)u=i[s+1],l=i[s-1],c=i[s],Math.round((u+l)/2)!==c&&a.push({time:c,pos:s/(o-1)});return a}_generate(){const t=this.min,e=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(e)||r.length===1)&&r.push(e),r.sort((i,a)=>i-a)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),r=this.getLabelTimestamps();return e.length&&r.length?t=this.normalize(e.concat(r)):t=e.length?e:r,t=this._cache.all=t,t}getDecimalForValue(t){return(Gi(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,r=this.getDecimalForPixel(t)/e.factor-e.end;return Gi(this._table,r*this._tableRange+this._minPos,!0)}}z(Ds,"id","timeseries"),z(Ds,"defaults",Gr.defaults);var wy=Object.freeze({__proto__:null,CategoryScale:ws,LinearScale:_s,LogarithmicScale:Ts,RadialLinearScale:Xr,TimeScale:Gr,TimeSeriesScale:Ds});const _y=[Em,ab,Zb,wy],Ty=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],My=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Dy=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Cy=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],_d=(n,t,e)=>{let r=n;return typeof t=="string"||Array.isArray(t)?r=n.toLocaleString(t,e):(t===!0||e!==void 0)&&(r=n.toLocaleString(void 0,e)),r};function Cs(n,t){if(!Number.isFinite(n))throw new TypeError(`Expected a finite number, got ${typeof n}: ${n}`);t={bits:!1,binary:!1,space:!0,...t};const e=t.bits?t.binary?Cy:Dy:t.binary?My:Ty,r=t.space?" ":"";if(t.signed&&n===0)return` 0${r}${e[0]}`;const i=n<0,a=i?"-":t.signed?"+":"";i&&(n=-n);let s;if(t.minimumFractionDigits!==void 0&&(s={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(s={maximumFractionDigits:t.maximumFractionDigits,...s}),n<1){const u=_d(n,t.locale,s);return a+u+r+e[0]}const o=Math.min(Math.floor(t.binary?Math.log(n)/Math.log(1024):Math.log10(n)/3),e.length-1);n/=(t.binary?1024:1e3)**o,s||(n=n.toPrecision(3));const l=_d(Number(n),t.locale,s),c=e[o];return a+l+r+c}function Ze(n){"@babel/helpers - typeof";return Ze=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ze(n)}function Lt(n){if(n===null||n===!0||n===!1)return NaN;var t=Number(n);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function J(n,t){if(t.length<n)throw new TypeError(n+" argument"+(n>1?"s":"")+" required, but only "+t.length+" present")}function nt(n){J(1,arguments);var t=Object.prototype.toString.call(n);return n instanceof Date||Ze(n)==="object"&&t==="[object Date]"?new Date(n.getTime()):typeof n=="number"||t==="[object Number]"?new Date(n):((typeof n=="string"||t==="[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 Td(n,t){J(2,arguments);var e=nt(n),r=Lt(t);return isNaN(r)?new Date(NaN):(r&&e.setDate(e.getDate()+r),e)}function ks(n,t){J(2,arguments);var e=nt(n),r=Lt(t);if(isNaN(r))return new Date(NaN);if(!r)return e;var i=e.getDate(),a=new Date(e.getTime());a.setMonth(e.getMonth()+r+1,0);var s=a.getDate();return i>=s?a:(e.setFullYear(a.getFullYear(),a.getMonth(),i),e)}function Kr(n,t){J(2,arguments);var e=nt(n).getTime(),r=Lt(t);return new Date(e+r)}var ky=36e5;function Sy(n,t){J(2,arguments);var e=Lt(t);return Kr(n,e*ky)}var Oy={};function vn(){return Oy}function Md(n,t){var e,r,i,a,s,o,l,c;J(1,arguments);var u=vn(),d=Lt((e=(r=(i=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&i!==void 0?i: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&&e!==void 0?e:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=nt(n),g=f.getDay(),v=(g<d?7:0)+g-d;return f.setDate(f.getDate()-v),f.setHours(0,0,0,0),f}function Ki(n){var t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),n.getTime()-t.getTime()}function Ss(n){J(1,arguments);var t=nt(n);return t.setHours(0,0,0,0),t}var Py=864e5;function Ey(n,t){J(2,arguments);var e=Ss(n),r=Ss(t),i=e.getTime()-Ki(e),a=r.getTime()-Ki(r);return Math.round((i-a)/Py)}var Ay=6e4;function Ry(n,t){J(2,arguments);var e=Lt(t);return Kr(n,e*Ay)}function Ly(n,t){J(2,arguments);var e=Lt(t),r=e*3;return ks(n,r)}function Iy(n,t){J(2,arguments);var e=Lt(t);return Kr(n,e*1e3)}function Ny(n,t){J(2,arguments);var e=Lt(t),r=e*7;return Td(n,r)}function Fy(n,t){J(2,arguments);var e=Lt(t);return ks(n,e*12)}function Qr(n,t){J(2,arguments);var e=nt(n),r=nt(t),i=e.getTime()-r.getTime();return i<0?-1:i>0?1:i}var Qi=6e4,Zr=36e5,By=1e3;function Uy(n){return J(1,arguments),n instanceof Date||Ze(n)==="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Os(n){if(J(1,arguments),!Uy(n)&&typeof n!="number")return!1;var t=nt(n);return!isNaN(Number(t))}function Wy(n,t){J(2,arguments);var e=nt(n),r=nt(t),i=e.getFullYear()-r.getFullYear(),a=e.getMonth()-r.getMonth();return i*12+a}function Yy(n,t){J(2,arguments);var e=nt(n),r=nt(t);return e.getFullYear()-r.getFullYear()}function Dd(n,t){var e=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function Cd(n,t){J(2,arguments);var e=nt(n),r=nt(t),i=Dd(e,r),a=Math.abs(Ey(e,r));e.setDate(e.getDate()-i*a);var s=+(Dd(e,r)===-i),o=i*(a-s);return o===0?0:o}function Zi(n,t){return J(2,arguments),nt(n).getTime()-nt(t).getTime()}var kd={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},Hy="trunc";function Jr(n){return n?kd[n]:kd[Hy]}function zy(n,t,e){J(2,arguments);var r=Zi(n,t)/Zr;return Jr(e==null?void 0:e.roundingMethod)(r)}function $y(n,t,e){J(2,arguments);var r=Zi(n,t)/Qi;return Jr(e==null?void 0:e.roundingMethod)(r)}function Sd(n){J(1,arguments);var t=nt(n);return t.setHours(23,59,59,999),t}function Od(n){J(1,arguments);var t=nt(n),e=t.getMonth();return t.setFullYear(t.getFullYear(),e+1,0),t.setHours(23,59,59,999),t}function jy(n){J(1,arguments);var t=nt(n);return Sd(t).getTime()===Od(t).getTime()}function Pd(n,t){J(2,arguments);var e=nt(n),r=nt(t),i=Qr(e,r),a=Math.abs(Wy(e,r)),s;if(a<1)s=0;else{e.getMonth()===1&&e.getDate()>27&&e.setDate(30),e.setMonth(e.getMonth()-i*a);var o=Qr(e,r)===-i;jy(nt(n))&&a===1&&Qr(n,r)===1&&(o=!1),s=i*(a-Number(o))}return s===0?0:s}function Vy(n,t,e){J(2,arguments);var r=Pd(n,t)/3;return Jr(e==null?void 0:e.roundingMethod)(r)}function qy(n,t,e){J(2,arguments);var r=Zi(n,t)/1e3;return Jr(e==null?void 0:e.roundingMethod)(r)}function Xy(n,t,e){J(2,arguments);var r=Cd(n,t)/7;return Jr(e==null?void 0:e.roundingMethod)(r)}function Gy(n,t){J(2,arguments);var e=nt(n),r=nt(t),i=Qr(e,r),a=Math.abs(Yy(e,r));e.setFullYear(1584),r.setFullYear(1584);var s=Qr(e,r)===-i,o=i*(a-Number(s));return o===0?0:o}function Ky(n){J(1,arguments);var t=nt(n);return t.setSeconds(0,0),t}function Qy(n){J(1,arguments);var t=nt(n),e=t.getMonth(),r=e-e%3;return t.setMonth(r,1),t.setHours(0,0,0,0),t}function Zy(n){J(1,arguments);var t=nt(n);return t.setDate(1),t.setHours(0,0,0,0),t}function Jy(n){J(1,arguments);var t=nt(n),e=t.getFullYear();return t.setFullYear(e+1,0,0),t.setHours(23,59,59,999),t}function tv(n){J(1,arguments);var t=nt(n),e=new Date(0);return e.setFullYear(t.getFullYear(),0,1),e.setHours(0,0,0,0),e}function ev(n){J(1,arguments);var t=nt(n);return t.setMinutes(59,59,999),t}function nv(n,t){var e,r,i,a,s,o,l,c;J(1,arguments);var u=vn(),d=Lt((e=(r=(i=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&i!==void 0?i: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&&e!==void 0?e:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=nt(n),g=f.getDay(),v=(g<d?-7:0)+6-(g-d);return f.setDate(f.getDate()+v),f.setHours(23,59,59,999),f}function rv(n){J(1,arguments);var t=nt(n);return t.setSeconds(59,999),t}function iv(n){J(1,arguments);var t=nt(n),e=t.getMonth(),r=e-e%3+3;return t.setMonth(r,0),t.setHours(23,59,59,999),t}function av(n){J(1,arguments);var t=nt(n);return t.setMilliseconds(999),t}function Ed(n,t){J(2,arguments);var e=Lt(t);return Kr(n,-e)}var sv=864e5;function ov(n){J(1,arguments);var t=nt(n),e=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),i=e-r;return Math.floor(i/sv)+1}function sr(n){J(1,arguments);var t=1,e=nt(n),r=e.getUTCDay(),i=(r<t?7:0)+r-t;return e.setUTCDate(e.getUTCDate()-i),e.setUTCHours(0,0,0,0),e}function Ad(n){J(1,arguments);var t=nt(n),e=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(e+1,0,4),r.setUTCHours(0,0,0,0);var i=sr(r),a=new Date(0);a.setUTCFullYear(e,0,4),a.setUTCHours(0,0,0,0);var s=sr(a);return t.getTime()>=i.getTime()?e+1:t.getTime()>=s.getTime()?e:e-1}function lv(n){J(1,arguments);var t=Ad(n),e=new Date(0);e.setUTCFullYear(t,0,4),e.setUTCHours(0,0,0,0);var r=sr(e);return r}var cv=6048e5;function Rd(n){J(1,arguments);var t=nt(n),e=sr(t).getTime()-lv(t).getTime();return Math.round(e/cv)+1}function Bn(n,t){var e,r,i,a,s,o,l,c;J(1,arguments);var u=vn(),d=Lt((e=(r=(i=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&i!==void 0?i: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&&e!==void 0?e:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=nt(n),g=f.getUTCDay(),v=(g<d?7:0)+g-d;return f.setUTCDate(f.getUTCDate()-v),f.setUTCHours(0,0,0,0),f}function Ps(n,t){var e,r,i,a,s,o,l,c;J(1,arguments);var u=nt(n),d=u.getUTCFullYear(),f=vn(),g=Lt((e=(r=(i=(a=t==null?void 0:t.firstWeekContainsDate)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&i!==void 0?i:f.firstWeekContainsDate)!==null&&r!==void 0?r:(l=f.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&e!==void 0?e:1);if(!(g>=1&&g<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var v=new Date(0);v.setUTCFullYear(d+1,0,g),v.setUTCHours(0,0,0,0);var x=Bn(v,t),p=new Date(0);p.setUTCFullYear(d,0,g),p.setUTCHours(0,0,0,0);var b=Bn(p,t);return u.getTime()>=x.getTime()?d+1:u.getTime()>=b.getTime()?d:d-1}function uv(n,t){var e,r,i,a,s,o,l,c;J(1,arguments);var u=vn(),d=Lt((e=(r=(i=(a=t==null?void 0:t.firstWeekContainsDate)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&i!==void 0?i: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&&e!==void 0?e:1),f=Ps(n,t),g=new Date(0);g.setUTCFullYear(f,0,d),g.setUTCHours(0,0,0,0);var v=Bn(g,t);return v}var dv=6048e5;function Ld(n,t){J(1,arguments);var e=nt(n),r=Bn(e,t).getTime()-uv(e,t).getTime();return Math.round(r/dv)+1}function Ct(n,t){for(var e=n<0?"-":"",r=Math.abs(n).toString();r.length<t;)r="0"+r;return e+r}var fv={y:function(t,e){var r=t.getUTCFullYear(),i=r>0?r:1-r;return Ct(e==="yy"?i%100:i,e.length)},M:function(t,e){var r=t.getUTCMonth();return e==="M"?String(r+1):Ct(r+1,2)},d:function(t,e){return Ct(t.getUTCDate(),e.length)},a:function(t,e){var r=t.getUTCHours()/12>=1?"pm":"am";switch(e){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(t,e){return Ct(t.getUTCHours()%12||12,e.length)},H:function(t,e){return Ct(t.getUTCHours(),e.length)},m:function(t,e){return Ct(t.getUTCMinutes(),e.length)},s:function(t,e){return Ct(t.getUTCSeconds(),e.length)},S:function(t,e){var r=e.length,i=t.getUTCMilliseconds(),a=Math.floor(i*Math.pow(10,r-3));return Ct(a,e.length)}};const xn=fv;var or={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},hv={G:function(t,e,r){var i=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return r.era(i,{width:"abbreviated"});case"GGGGG":return r.era(i,{width:"narrow"});case"GGGG":default:return r.era(i,{width:"wide"})}},y:function(t,e,r){if(e==="yo"){var i=t.getUTCFullYear(),a=i>0?i:1-i;return r.ordinalNumber(a,{unit:"year"})}return xn.y(t,e)},Y:function(t,e,r,i){var a=Ps(t,i),s=a>0?a:1-a;if(e==="YY"){var o=s%100;return Ct(o,2)}return e==="Yo"?r.ordinalNumber(s,{unit:"year"}):Ct(s,e.length)},R:function(t,e){var r=Ad(t);return Ct(r,e.length)},u:function(t,e){var r=t.getUTCFullYear();return Ct(r,e.length)},Q:function(t,e,r){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return Ct(i,2);case"Qo":return r.ordinalNumber(i,{unit:"quarter"});case"QQQ":return r.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(i,{width:"wide",context:"formatting"})}},q:function(t,e,r){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return Ct(i,2);case"qo":return r.ordinalNumber(i,{unit:"quarter"});case"qqq":return r.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(i,{width:"wide",context:"standalone"})}},M:function(t,e,r){var i=t.getUTCMonth();switch(e){case"M":case"MM":return xn.M(t,e);case"Mo":return r.ordinalNumber(i+1,{unit:"month"});case"MMM":return r.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(i,{width:"wide",context:"formatting"})}},L:function(t,e,r){var i=t.getUTCMonth();switch(e){case"L":return String(i+1);case"LL":return Ct(i+1,2);case"Lo":return r.ordinalNumber(i+1,{unit:"month"});case"LLL":return r.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(i,{width:"wide",context:"standalone"})}},w:function(t,e,r,i){var a=Ld(t,i);return e==="wo"?r.ordinalNumber(a,{unit:"week"}):Ct(a,e.length)},I:function(t,e,r){var i=Rd(t);return e==="Io"?r.ordinalNumber(i,{unit:"week"}):Ct(i,e.length)},d:function(t,e,r){return e==="do"?r.ordinalNumber(t.getUTCDate(),{unit:"date"}):xn.d(t,e)},D:function(t,e,r){var i=ov(t);return e==="Do"?r.ordinalNumber(i,{unit:"dayOfYear"}):Ct(i,e.length)},E:function(t,e,r){var i=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return r.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(i,{width:"short",context:"formatting"});case"EEEE":default:return r.day(i,{width:"wide",context:"formatting"})}},e:function(t,e,r,i){var a=t.getUTCDay(),s=(a-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return Ct(s,2);case"eo":return r.ordinalNumber(s,{unit:"day"});case"eee":return r.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(a,{width:"short",context:"formatting"});case"eeee":default:return r.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,r,i){var a=t.getUTCDay(),s=(a-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return Ct(s,e.length);case"co":return r.ordinalNumber(s,{unit:"day"});case"ccc":return r.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(a,{width:"narrow",context:"standalone"});case"cccccc":return r.day(a,{width:"short",context:"standalone"});case"cccc":default:return r.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,r){var i=t.getUTCDay(),a=i===0?7:i;switch(e){case"i":return String(a);case"ii":return Ct(a,e.length);case"io":return r.ordinalNumber(a,{unit:"day"});case"iii":return r.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(i,{width:"short",context:"formatting"});case"iiii":default:return r.day(i,{width:"wide",context:"formatting"})}},a:function(t,e,r){var i=t.getUTCHours(),a=i/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,r){var i=t.getUTCHours(),a;switch(i===12?a=or.noon:i===0?a=or.midnight:a=i/12>=1?"pm":"am",e){case"b":case"bb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,r){var i=t.getUTCHours(),a;switch(i>=17?a=or.evening:i>=12?a=or.afternoon:i>=4?a=or.morning:a=or.night,e){case"B":case"BB":case"BBB":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,r){if(e==="ho"){var i=t.getUTCHours()%12;return i===0&&(i=12),r.ordinalNumber(i,{unit:"hour"})}return xn.h(t,e)},H:function(t,e,r){return e==="Ho"?r.ordinalNumber(t.getUTCHours(),{unit:"hour"}):xn.H(t,e)},K:function(t,e,r){var i=t.getUTCHours()%12;return e==="Ko"?r.ordinalNumber(i,{unit:"hour"}):Ct(i,e.length)},k:function(t,e,r){var i=t.getUTCHours();return i===0&&(i=24),e==="ko"?r.ordinalNumber(i,{unit:"hour"}):Ct(i,e.length)},m:function(t,e,r){return e==="mo"?r.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):xn.m(t,e)},s:function(t,e,r){return e==="so"?r.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):xn.s(t,e)},S:function(t,e){return xn.S(t,e)},X:function(t,e,r,i){var a=i._originalDate||t,s=a.getTimezoneOffset();if(s===0)return"Z";switch(e){case"X":return Nd(s);case"XXXX":case"XX":return Un(s);case"XXXXX":case"XXX":default:return Un(s,":")}},x:function(t,e,r,i){var a=i._originalDate||t,s=a.getTimezoneOffset();switch(e){case"x":return Nd(s);case"xxxx":case"xx":return Un(s);case"xxxxx":case"xxx":default:return Un(s,":")}},O:function(t,e,r,i){var a=i._originalDate||t,s=a.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Id(s,":");case"OOOO":default:return"GMT"+Un(s,":")}},z:function(t,e,r,i){var a=i._originalDate||t,s=a.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Id(s,":");case"zzzz":default:return"GMT"+Un(s,":")}},t:function(t,e,r,i){var a=i._originalDate||t,s=Math.floor(a.getTime()/1e3);return Ct(s,e.length)},T:function(t,e,r,i){var a=i._originalDate||t,s=a.getTime();return Ct(s,e.length)}};function Id(n,t){var e=n>0?"-":"+",r=Math.abs(n),i=Math.floor(r/60),a=r%60;if(a===0)return e+String(i);var s=t||"";return e+String(i)+s+Ct(a,2)}function Nd(n,t){if(n%60===0){var e=n>0?"-":"+";return e+Ct(Math.abs(n)/60,2)}return Un(n,t)}function Un(n,t){var e=t||"",r=n>0?"-":"+",i=Math.abs(n),a=Ct(Math.floor(i/60),2),s=Ct(i%60,2);return r+a+e+s}const gv=hv;var Fd=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},Bd=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},pv=function(t,e){var r=t.match(/(P+)(p+)?/)||[],i=r[1],a=r[2];if(!a)return Fd(t,e);var s;switch(i){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",Fd(i,e)).replace("{{time}}",Bd(a,e))},mv={p:Bd,P:pv};const Es=mv;var bv=["D","DD"],yv=["YY","YYYY"];function Ud(n){return bv.indexOf(n)!==-1}function Wd(n){return yv.indexOf(n)!==-1}function Ji(n,t,e){if(n==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var vv={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"}},xv=function(t,e,r){var i,a=vv[t];return typeof a=="string"?i=a:e===1?i=a.one:i=a.other.replace("{{count}}",e.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+i:i+" ago":i};const wv=xv;function As(n){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.width?String(t.width):n.defaultWidth,r=n.formats[e]||n.formats[n.defaultWidth];return r}}var _v={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Tv={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Mv={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Dv={date:As({formats:_v,defaultWidth:"full"}),time:As({formats:Tv,defaultWidth:"full"}),dateTime:As({formats:Mv,defaultWidth:"full"})};const Cv=Dv;var kv={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Sv=function(t,e,r,i){return kv[t]};const Ov=Sv;function ti(n){return function(t,e){var r=e!=null&&e.context?String(e.context):"standalone",i;if(r==="formatting"&&n.formattingValues){var a=n.defaultFormattingWidth||n.defaultWidth,s=e!=null&&e.width?String(e.width):a;i=n.formattingValues[s]||n.formattingValues[a]}else{var o=n.defaultWidth,l=e!=null&&e.width?String(e.width):n.defaultWidth;i=n.values[l]||n.values[o]}var c=n.argumentCallback?n.argumentCallback(t):t;return i[c]}}var Pv={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ev={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Av={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"]},Rv={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"]},Lv={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"}},Iv={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"}},Nv=function(t,e){var r=Number(t),i=r%100;if(i>20||i<10)switch(i%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},Fv={ordinalNumber:Nv,era:ti({values:Pv,defaultWidth:"wide"}),quarter:ti({values:Ev,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:ti({values:Av,defaultWidth:"wide"}),day:ti({values:Rv,defaultWidth:"wide"}),dayPeriod:ti({values:Lv,defaultWidth:"wide",formattingValues:Iv,defaultFormattingWidth:"wide"})};const Bv=Fv;function ei(n){return function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.width,i=r&&n.matchPatterns[r]||n.matchPatterns[n.defaultMatchWidth],a=t.match(i);if(!a)return null;var s=a[0],o=r&&n.parsePatterns[r]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(o)?Wv(o,function(d){return d.test(s)}):Uv(o,function(d){return d.test(s)}),c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;var u=t.slice(s.length);return{value:c,rest:u}}}function Uv(n,t){for(var e in n)if(n.hasOwnProperty(e)&&t(n[e]))return e}function Wv(n,t){for(var e=0;e<n.length;e++)if(t(n[e]))return e}function Yv(n){return function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.match(n.matchPattern);if(!r)return null;var i=r[0],a=t.match(n.parsePattern);if(!a)return null;var s=n.valueCallback?n.valueCallback(a[0]):a[0];s=e.valueCallback?e.valueCallback(s):s;var o=t.slice(i.length);return{value:s,rest:o}}}var Hv=/^(\d+)(th|st|nd|rd)?/i,zv=/\d+/i,$v={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},jv={any:[/^b/i,/^(a|c)/i]},Vv={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},qv={any:[/1/i,/2/i,/3/i,/4/i]},Xv={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},Gv={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]},Kv={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},Qv={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]},Zv={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},Jv={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}},tx={ordinalNumber:Yv({matchPattern:Hv,parsePattern:zv,valueCallback:function(t){return parseInt(t,10)}}),era:ei({matchPatterns:$v,defaultMatchWidth:"wide",parsePatterns:jv,defaultParseWidth:"any"}),quarter:ei({matchPatterns:Vv,defaultMatchWidth:"wide",parsePatterns:qv,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:ei({matchPatterns:Xv,defaultMatchWidth:"wide",parsePatterns:Gv,defaultParseWidth:"any"}),day:ei({matchPatterns:Kv,defaultMatchWidth:"wide",parsePatterns:Qv,defaultParseWidth:"any"}),dayPeriod:ei({matchPatterns:Zv,defaultMatchWidth:"any",parsePatterns:Jv,defaultParseWidth:"any"})},ex={code:"en-US",formatDistance:wv,formatLong:Cv,formatRelative:Ov,localize:Bv,match:tx,options:{weekStartsOn:0,firstWeekContainsDate:1}};const Yd=ex;var nx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,rx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ix=/^'([^]*?)'?$/,ax=/''/g,sx=/[a-zA-Z]/;function ox(n,t,e){var r,i,a,s,o,l,c,u,d,f,g,v,x,p,b,m,y,w;J(2,arguments);var T=String(t),S=vn(),k=(r=(i=e==null?void 0:e.locale)!==null&&i!==void 0?i:S.locale)!==null&&r!==void 0?r:Yd,M=Lt((a=(s=(o=(l=e==null?void 0:e.firstWeekContainsDate)!==null&&l!==void 0?l:e==null||(c=e.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&o!==void 0?o:S.firstWeekContainsDate)!==null&&s!==void 0?s:(d=S.locale)===null||d===void 0||(f=d.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&a!==void 0?a:1);if(!(M>=1&&M<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var D=Lt((g=(v=(x=(p=e==null?void 0:e.weekStartsOn)!==null&&p!==void 0?p:e==null||(b=e.locale)===null||b===void 0||(m=b.options)===null||m===void 0?void 0:m.weekStartsOn)!==null&&x!==void 0?x:S.weekStartsOn)!==null&&v!==void 0?v:(y=S.locale)===null||y===void 0||(w=y.options)===null||w===void 0?void 0:w.weekStartsOn)!==null&&g!==void 0?g:0);if(!(D>=0&&D<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!k.localize)throw new RangeError("locale must contain localize property");if(!k.formatLong)throw new RangeError("locale must contain formatLong property");var O=nt(n);if(!Os(O))throw new RangeError("Invalid time value");var P=Ki(O),A=Ed(O,P),F={firstWeekContainsDate:M,weekStartsOn:D,locale:k,_originalDate:O},q=T.match(rx).map(function($){var H=$[0];if(H==="p"||H==="P"){var I=Es[H];return I($,k.formatLong)}return $}).join("").match(nx).map(function($){if($==="''")return"'";var H=$[0];if(H==="'")return lx($);var I=gv[H];if(I)return!(e!=null&&e.useAdditionalWeekYearTokens)&&Wd($)&&Ji($,t,String(n)),!(e!=null&&e.useAdditionalDayOfYearTokens)&&Ud($)&&Ji($,t,String(n)),I(A,$,k.localize,F);if(H.match(sx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+H+"`");return $}).join("");return q}function lx(n){var t=n.match(ix);return t?t[1].replace(ax,"'"):n}function cx(n,t){if(n==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n}function Hd(n,t){(t==null||t>n.length)&&(t=n.length);for(var e=0,r=new Array(t);e<t;e++)r[e]=n[e];return r}function ux(n,t){if(n){if(typeof n=="string")return Hd(n,t);var e=Object.prototype.toString.call(n).slice(8,-1);if(e==="Object"&&n.constructor&&(e=n.constructor.name),e==="Map"||e==="Set")return Array.from(n);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Hd(n,t)}}function zd(n,t){var e=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!e){if(Array.isArray(n)||(e=ux(n))||t&&n&&typeof n.length=="number"){e&&(n=e);var r=0,i=function(){};return{s:i,n:function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
19
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,s=!1,o;return{s:function(){e=e.call(n)},n:function(){var c=e.next();return a=c.done,c},e:function(c){s=!0,o=c},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(s)throw o}}}}function G(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function Rs(n,t){return Rs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Rs(n,t)}function pt(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),t&&Rs(n,t)}function ta(n){return ta=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ta(n)}function dx(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function fx(n,t){if(t&&(Ze(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return G(n)}function mt(n){var t=dx();return function(){var r=ta(n),i;if(t){var a=ta(this).constructor;i=Reflect.construct(r,arguments,a)}else i=r.apply(this,arguments);return fx(this,i)}}function ht(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function hx(n,t){if(Ze(n)!=="object"||n===null)return n;var e=n[Symbol.toPrimitive];if(e!==void 0){var r=e.call(n,t||"default");if(Ze(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}function $d(n){var t=hx(n,"string");return Ze(t)==="symbol"?t:String(t)}function jd(n,t){for(var e=0;e<t.length;e++){var r=t[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,$d(r.key),r)}}function gt(n,t,e){return t&&jd(n.prototype,t),e&&jd(n,e),Object.defineProperty(n,"prototype",{writable:!1}),n}function V(n,t,e){return t=$d(t),t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}var gx=10,Vd=function(){function n(){ht(this,n),V(this,"priority",void 0),V(this,"subPriority",0)}return gt(n,[{key:"validate",value:function(e,r){return!0}}]),n}(),px=function(n){pt(e,n);var t=mt(e);function e(r,i,a,s,o){var l;return ht(this,e),l=t.call(this),l.value=r,l.validateValue=i,l.setValue=a,l.priority=s,o&&(l.subPriority=o),l}return gt(e,[{key:"validate",value:function(i,a){return this.validateValue(i,this.value,a)}},{key:"set",value:function(i,a,s){return this.setValue(i,a,this.value,s)}}]),e}(Vd),mx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",gx),V(G(r),"subPriority",-1),r}return gt(e,[{key:"set",value:function(i,a){if(a.timestampIsSet)return i;var s=new Date(0);return s.setFullYear(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()),s.setHours(i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds()),s}}]),e}(Vd),wt=function(){function n(){ht(this,n),V(this,"incompatibleTokens",void 0),V(this,"priority",void 0),V(this,"subPriority",void 0)}return gt(n,[{key:"run",value:function(e,r,i,a){var s=this.parse(e,r,i,a);return s?{setter:new px(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}},{key:"validate",value:function(e,r,i){return!0}}]),n}(),bx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",140),V(G(r),"incompatibleTokens",["R","u","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){switch(a){case"G":case"GG":case"GGG":return s.era(i,{width:"abbreviated"})||s.era(i,{width:"narrow"});case"GGGGG":return s.era(i,{width:"narrow"});case"GGGG":default:return s.era(i,{width:"wide"})||s.era(i,{width:"abbreviated"})||s.era(i,{width:"narrow"})}}},{key:"set",value:function(i,a,s){return a.era=s,i.setUTCFullYear(s,0,1),i.setUTCHours(0,0,0,0),i}}]),e}(wt),qt={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}/},Ue={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 Xt(n,t){return n&&{value:t(n.value),rest:n.rest}}function Wt(n,t){var e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function We(n,t){var e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};var r=e[1]==="+"?1:-1,i=e[2]?parseInt(e[2],10):0,a=e[3]?parseInt(e[3],10):0,s=e[5]?parseInt(e[5],10):0;return{value:r*(i*Zr+a*Qi+s*By),rest:t.slice(e[0].length)}}function qd(n){return Wt(qt.anyDigitsSigned,n)}function Vt(n,t){switch(n){case 1:return Wt(qt.singleDigit,t);case 2:return Wt(qt.twoDigits,t);case 3:return Wt(qt.threeDigits,t);case 4:return Wt(qt.fourDigits,t);default:return Wt(new RegExp("^\\d{1,"+n+"}"),t)}}function ea(n,t){switch(n){case 1:return Wt(qt.singleDigitSigned,t);case 2:return Wt(qt.twoDigitsSigned,t);case 3:return Wt(qt.threeDigitsSigned,t);case 4:return Wt(qt.fourDigitsSigned,t);default:return Wt(new RegExp("^-?\\d{1,"+n+"}"),t)}}function Ls(n){switch(n){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 Xd(n,t){var e=t>0,r=e?t:1-t,i;if(r<=50)i=n||100;else{var a=r+50,s=Math.floor(a/100)*100,o=n>=a%100;i=n+s-(o?100:0)}return e?i:1-i}function Gd(n){return n%400===0||n%4===0&&n%100!==0}var yx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",130),V(G(r),"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){var o=function(c){return{year:c,isTwoDigitYear:a==="yy"}};switch(a){case"y":return Xt(Vt(4,i),o);case"yo":return Xt(s.ordinalNumber(i,{unit:"year"}),o);default:return Xt(Vt(a.length,i),o)}}},{key:"validate",value:function(i,a){return a.isTwoDigitYear||a.year>0}},{key:"set",value:function(i,a,s){var o=i.getUTCFullYear();if(s.isTwoDigitYear){var l=Xd(s.year,o);return i.setUTCFullYear(l,0,1),i.setUTCHours(0,0,0,0),i}var c=!("era"in a)||a.era===1?s.year:1-s.year;return i.setUTCFullYear(c,0,1),i.setUTCHours(0,0,0,0),i}}]),e}(wt),vx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",130),V(G(r),"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){var o=function(c){return{year:c,isTwoDigitYear:a==="YY"}};switch(a){case"Y":return Xt(Vt(4,i),o);case"Yo":return Xt(s.ordinalNumber(i,{unit:"year"}),o);default:return Xt(Vt(a.length,i),o)}}},{key:"validate",value:function(i,a){return a.isTwoDigitYear||a.year>0}},{key:"set",value:function(i,a,s,o){var l=Ps(i,o);if(s.isTwoDigitYear){var c=Xd(s.year,l);return i.setUTCFullYear(c,0,o.firstWeekContainsDate),i.setUTCHours(0,0,0,0),Bn(i,o)}var u=!("era"in a)||a.era===1?s.year:1-s.year;return i.setUTCFullYear(u,0,o.firstWeekContainsDate),i.setUTCHours(0,0,0,0),Bn(i,o)}}]),e}(wt),xx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",130),V(G(r),"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a){return ea(a==="R"?4:a.length,i)}},{key:"set",value:function(i,a,s){var o=new Date(0);return o.setUTCFullYear(s,0,4),o.setUTCHours(0,0,0,0),sr(o)}}]),e}(wt),wx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",130),V(G(r),"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a){return ea(a==="u"?4:a.length,i)}},{key:"set",value:function(i,a,s){return i.setUTCFullYear(s,0,1),i.setUTCHours(0,0,0,0),i}}]),e}(wt),_x=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",120),V(G(r),"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){switch(a){case"Q":case"QQ":return Vt(a.length,i);case"Qo":return s.ordinalNumber(i,{unit:"quarter"});case"QQQ":return s.quarter(i,{width:"abbreviated",context:"formatting"})||s.quarter(i,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(i,{width:"wide",context:"formatting"})||s.quarter(i,{width:"abbreviated",context:"formatting"})||s.quarter(i,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(i,a){return a>=1&&a<=4}},{key:"set",value:function(i,a,s){return i.setUTCMonth((s-1)*3,1),i.setUTCHours(0,0,0,0),i}}]),e}(wt),Tx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",120),V(G(r),"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){switch(a){case"q":case"qq":return Vt(a.length,i);case"qo":return s.ordinalNumber(i,{unit:"quarter"});case"qqq":return s.quarter(i,{width:"abbreviated",context:"standalone"})||s.quarter(i,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(i,{width:"wide",context:"standalone"})||s.quarter(i,{width:"abbreviated",context:"standalone"})||s.quarter(i,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(i,a){return a>=1&&a<=4}},{key:"set",value:function(i,a,s){return i.setUTCMonth((s-1)*3,1),i.setUTCHours(0,0,0,0),i}}]),e}(wt),Mx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]),V(G(r),"priority",110),r}return gt(e,[{key:"parse",value:function(i,a,s){var o=function(c){return c-1};switch(a){case"M":return Xt(Wt(qt.month,i),o);case"MM":return Xt(Vt(2,i),o);case"Mo":return Xt(s.ordinalNumber(i,{unit:"month"}),o);case"MMM":return s.month(i,{width:"abbreviated",context:"formatting"})||s.month(i,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(i,{width:"wide",context:"formatting"})||s.month(i,{width:"abbreviated",context:"formatting"})||s.month(i,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(i,a){return a>=0&&a<=11}},{key:"set",value:function(i,a,s){return i.setUTCMonth(s,1),i.setUTCHours(0,0,0,0),i}}]),e}(wt),Dx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",110),V(G(r),"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){var o=function(c){return c-1};switch(a){case"L":return Xt(Wt(qt.month,i),o);case"LL":return Xt(Vt(2,i),o);case"Lo":return Xt(s.ordinalNumber(i,{unit:"month"}),o);case"LLL":return s.month(i,{width:"abbreviated",context:"standalone"})||s.month(i,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(i,{width:"wide",context:"standalone"})||s.month(i,{width:"abbreviated",context:"standalone"})||s.month(i,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(i,a){return a>=0&&a<=11}},{key:"set",value:function(i,a,s){return i.setUTCMonth(s,1),i.setUTCHours(0,0,0,0),i}}]),e}(wt);function Cx(n,t,e){J(2,arguments);var r=nt(n),i=Lt(t),a=Ld(r,e)-i;return r.setUTCDate(r.getUTCDate()-a*7),r}var kx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",100),V(G(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){switch(a){case"w":return Wt(qt.week,i);case"wo":return s.ordinalNumber(i,{unit:"week"});default:return Vt(a.length,i)}}},{key:"validate",value:function(i,a){return a>=1&&a<=53}},{key:"set",value:function(i,a,s,o){return Bn(Cx(i,s,o),o)}}]),e}(wt);function Sx(n,t){J(2,arguments);var e=nt(n),r=Lt(t),i=Rd(e)-r;return e.setUTCDate(e.getUTCDate()-i*7),e}var Ox=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",100),V(G(r),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){switch(a){case"I":return Wt(qt.week,i);case"Io":return s.ordinalNumber(i,{unit:"week"});default:return Vt(a.length,i)}}},{key:"validate",value:function(i,a){return a>=1&&a<=53}},{key:"set",value:function(i,a,s){return sr(Sx(i,s))}}]),e}(wt),Px=[31,28,31,30,31,30,31,31,30,31,30,31],Ex=[31,29,31,30,31,30,31,31,30,31,30,31],Ax=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",90),V(G(r),"subPriority",1),V(G(r),"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){switch(a){case"d":return Wt(qt.date,i);case"do":return s.ordinalNumber(i,{unit:"date"});default:return Vt(a.length,i)}}},{key:"validate",value:function(i,a){var s=i.getUTCFullYear(),o=Gd(s),l=i.getUTCMonth();return o?a>=1&&a<=Ex[l]:a>=1&&a<=Px[l]}},{key:"set",value:function(i,a,s){return i.setUTCDate(s),i.setUTCHours(0,0,0,0),i}}]),e}(wt),Rx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",90),V(G(r),"subpriority",1),V(G(r),"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){switch(a){case"D":case"DD":return Wt(qt.dayOfYear,i);case"Do":return s.ordinalNumber(i,{unit:"date"});default:return Vt(a.length,i)}}},{key:"validate",value:function(i,a){var s=i.getUTCFullYear(),o=Gd(s);return o?a>=1&&a<=366:a>=1&&a<=365}},{key:"set",value:function(i,a,s){return i.setUTCMonth(0,s),i.setUTCHours(0,0,0,0),i}}]),e}(wt);function Is(n,t,e){var r,i,a,s,o,l,c,u;J(2,arguments);var d=vn(),f=Lt((r=(i=(a=(s=e==null?void 0:e.weekStartsOn)!==null&&s!==void 0?s:e==null||(o=e.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&a!==void 0?a:d.weekStartsOn)!==null&&i!==void 0?i:(c=d.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&r!==void 0?r:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var g=nt(n),v=Lt(t),x=g.getUTCDay(),p=v%7,b=(p+7)%7,m=(b<f?7:0)+v-x;return g.setUTCDate(g.getUTCDate()+m),g}var Lx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",90),V(G(r),"incompatibleTokens",["D","i","e","c","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){switch(a){case"E":case"EE":case"EEE":return s.day(i,{width:"abbreviated",context:"formatting"})||s.day(i,{width:"short",context:"formatting"})||s.day(i,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(i,{width:"short",context:"formatting"})||s.day(i,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(i,{width:"wide",context:"formatting"})||s.day(i,{width:"abbreviated",context:"formatting"})||s.day(i,{width:"short",context:"formatting"})||s.day(i,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(i,a){return a>=0&&a<=6}},{key:"set",value:function(i,a,s,o){return i=Is(i,s,o),i.setUTCHours(0,0,0,0),i}}]),e}(wt),Ix=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",90),V(G(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s,o){var l=function(u){var d=Math.floor((u-1)/7)*7;return(u+o.weekStartsOn+6)%7+d};switch(a){case"e":case"ee":return Xt(Vt(a.length,i),l);case"eo":return Xt(s.ordinalNumber(i,{unit:"day"}),l);case"eee":return s.day(i,{width:"abbreviated",context:"formatting"})||s.day(i,{width:"short",context:"formatting"})||s.day(i,{width:"narrow",context:"formatting"});case"eeeee":return s.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(i,{width:"short",context:"formatting"})||s.day(i,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(i,{width:"wide",context:"formatting"})||s.day(i,{width:"abbreviated",context:"formatting"})||s.day(i,{width:"short",context:"formatting"})||s.day(i,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(i,a){return a>=0&&a<=6}},{key:"set",value:function(i,a,s,o){return i=Is(i,s,o),i.setUTCHours(0,0,0,0),i}}]),e}(wt),Nx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",90),V(G(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s,o){var l=function(u){var d=Math.floor((u-1)/7)*7;return(u+o.weekStartsOn+6)%7+d};switch(a){case"c":case"cc":return Xt(Vt(a.length,i),l);case"co":return Xt(s.ordinalNumber(i,{unit:"day"}),l);case"ccc":return s.day(i,{width:"abbreviated",context:"standalone"})||s.day(i,{width:"short",context:"standalone"})||s.day(i,{width:"narrow",context:"standalone"});case"ccccc":return s.day(i,{width:"narrow",context:"standalone"});case"cccccc":return s.day(i,{width:"short",context:"standalone"})||s.day(i,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(i,{width:"wide",context:"standalone"})||s.day(i,{width:"abbreviated",context:"standalone"})||s.day(i,{width:"short",context:"standalone"})||s.day(i,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(i,a){return a>=0&&a<=6}},{key:"set",value:function(i,a,s,o){return i=Is(i,s,o),i.setUTCHours(0,0,0,0),i}}]),e}(wt);function Fx(n,t){J(2,arguments);var e=Lt(t);e%7===0&&(e=e-7);var r=1,i=nt(n),a=i.getUTCDay(),s=e%7,o=(s+7)%7,l=(o<r?7:0)+e-a;return i.setUTCDate(i.getUTCDate()+l),i}var Bx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",90),V(G(r),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){var o=function(c){return c===0?7:c};switch(a){case"i":case"ii":return Vt(a.length,i);case"io":return s.ordinalNumber(i,{unit:"day"});case"iii":return Xt(s.day(i,{width:"abbreviated",context:"formatting"})||s.day(i,{width:"short",context:"formatting"})||s.day(i,{width:"narrow",context:"formatting"}),o);case"iiiii":return Xt(s.day(i,{width:"narrow",context:"formatting"}),o);case"iiiiii":return Xt(s.day(i,{width:"short",context:"formatting"})||s.day(i,{width:"narrow",context:"formatting"}),o);case"iiii":default:return Xt(s.day(i,{width:"wide",context:"formatting"})||s.day(i,{width:"abbreviated",context:"formatting"})||s.day(i,{width:"short",context:"formatting"})||s.day(i,{width:"narrow",context:"formatting"}),o)}}},{key:"validate",value:function(i,a){return a>=1&&a<=7}},{key:"set",value:function(i,a,s){return i=Fx(i,s),i.setUTCHours(0,0,0,0),i}}]),e}(wt),Ux=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",80),V(G(r),"incompatibleTokens",["b","B","H","k","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){switch(a){case"a":case"aa":case"aaa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"})||s.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(i,{width:"wide",context:"formatting"})||s.dayPeriod(i,{width:"abbreviated",context:"formatting"})||s.dayPeriod(i,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(i,a,s){return i.setUTCHours(Ls(s),0,0,0),i}}]),e}(wt),Wx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",80),V(G(r),"incompatibleTokens",["a","B","H","k","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){switch(a){case"b":case"bb":case"bbb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"})||s.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(i,{width:"wide",context:"formatting"})||s.dayPeriod(i,{width:"abbreviated",context:"formatting"})||s.dayPeriod(i,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(i,a,s){return i.setUTCHours(Ls(s),0,0,0),i}}]),e}(wt),Yx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",80),V(G(r),"incompatibleTokens",["a","b","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){switch(a){case"B":case"BB":case"BBB":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"})||s.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(i,{width:"wide",context:"formatting"})||s.dayPeriod(i,{width:"abbreviated",context:"formatting"})||s.dayPeriod(i,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(i,a,s){return i.setUTCHours(Ls(s),0,0,0),i}}]),e}(wt),Hx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",70),V(G(r),"incompatibleTokens",["H","K","k","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){switch(a){case"h":return Wt(qt.hour12h,i);case"ho":return s.ordinalNumber(i,{unit:"hour"});default:return Vt(a.length,i)}}},{key:"validate",value:function(i,a){return a>=1&&a<=12}},{key:"set",value:function(i,a,s){var o=i.getUTCHours()>=12;return o&&s<12?i.setUTCHours(s+12,0,0,0):!o&&s===12?i.setUTCHours(0,0,0,0):i.setUTCHours(s,0,0,0),i}}]),e}(wt),zx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",70),V(G(r),"incompatibleTokens",["a","b","h","K","k","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){switch(a){case"H":return Wt(qt.hour23h,i);case"Ho":return s.ordinalNumber(i,{unit:"hour"});default:return Vt(a.length,i)}}},{key:"validate",value:function(i,a){return a>=0&&a<=23}},{key:"set",value:function(i,a,s){return i.setUTCHours(s,0,0,0),i}}]),e}(wt),$x=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",70),V(G(r),"incompatibleTokens",["h","H","k","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){switch(a){case"K":return Wt(qt.hour11h,i);case"Ko":return s.ordinalNumber(i,{unit:"hour"});default:return Vt(a.length,i)}}},{key:"validate",value:function(i,a){return a>=0&&a<=11}},{key:"set",value:function(i,a,s){var o=i.getUTCHours()>=12;return o&&s<12?i.setUTCHours(s+12,0,0,0):i.setUTCHours(s,0,0,0),i}}]),e}(wt),jx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",70),V(G(r),"incompatibleTokens",["a","b","h","H","K","t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){switch(a){case"k":return Wt(qt.hour24h,i);case"ko":return s.ordinalNumber(i,{unit:"hour"});default:return Vt(a.length,i)}}},{key:"validate",value:function(i,a){return a>=1&&a<=24}},{key:"set",value:function(i,a,s){var o=s<=24?s%24:s;return i.setUTCHours(o,0,0,0),i}}]),e}(wt),Vx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",60),V(G(r),"incompatibleTokens",["t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){switch(a){case"m":return Wt(qt.minute,i);case"mo":return s.ordinalNumber(i,{unit:"minute"});default:return Vt(a.length,i)}}},{key:"validate",value:function(i,a){return a>=0&&a<=59}},{key:"set",value:function(i,a,s){return i.setUTCMinutes(s,0,0),i}}]),e}(wt),qx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",50),V(G(r),"incompatibleTokens",["t","T"]),r}return gt(e,[{key:"parse",value:function(i,a,s){switch(a){case"s":return Wt(qt.second,i);case"so":return s.ordinalNumber(i,{unit:"second"});default:return Vt(a.length,i)}}},{key:"validate",value:function(i,a){return a>=0&&a<=59}},{key:"set",value:function(i,a,s){return i.setUTCSeconds(s,0),i}}]),e}(wt),Xx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",30),V(G(r),"incompatibleTokens",["t","T"]),r}return gt(e,[{key:"parse",value:function(i,a){var s=function(l){return Math.floor(l*Math.pow(10,-a.length+3))};return Xt(Vt(a.length,i),s)}},{key:"set",value:function(i,a,s){return i.setUTCMilliseconds(s),i}}]),e}(wt),Gx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",10),V(G(r),"incompatibleTokens",["t","T","x"]),r}return gt(e,[{key:"parse",value:function(i,a){switch(a){case"X":return We(Ue.basicOptionalMinutes,i);case"XX":return We(Ue.basic,i);case"XXXX":return We(Ue.basicOptionalSeconds,i);case"XXXXX":return We(Ue.extendedOptionalSeconds,i);case"XXX":default:return We(Ue.extended,i)}}},{key:"set",value:function(i,a,s){return a.timestampIsSet?i:new Date(i.getTime()-s)}}]),e}(wt),Kx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",10),V(G(r),"incompatibleTokens",["t","T","X"]),r}return gt(e,[{key:"parse",value:function(i,a){switch(a){case"x":return We(Ue.basicOptionalMinutes,i);case"xx":return We(Ue.basic,i);case"xxxx":return We(Ue.basicOptionalSeconds,i);case"xxxxx":return We(Ue.extendedOptionalSeconds,i);case"xxx":default:return We(Ue.extended,i)}}},{key:"set",value:function(i,a,s){return a.timestampIsSet?i:new Date(i.getTime()-s)}}]),e}(wt),Qx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",40),V(G(r),"incompatibleTokens","*"),r}return gt(e,[{key:"parse",value:function(i){return qd(i)}},{key:"set",value:function(i,a,s){return[new Date(s*1e3),{timestampIsSet:!0}]}}]),e}(wt),Zx=function(n){pt(e,n);var t=mt(e);function e(){var r;ht(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",20),V(G(r),"incompatibleTokens","*"),r}return gt(e,[{key:"parse",value:function(i){return qd(i)}},{key:"set",value:function(i,a,s){return[new Date(s),{timestampIsSet:!0}]}}]),e}(wt),Jx={G:new bx,y:new yx,Y:new vx,R:new xx,u:new wx,Q:new _x,q:new Tx,M:new Mx,L:new Dx,w:new kx,I:new Ox,d:new Ax,D:new Rx,E:new Lx,e:new Ix,c:new Nx,i:new Bx,a:new Ux,b:new Wx,B:new Yx,h:new Hx,H:new zx,K:new $x,k:new jx,m:new Vx,s:new qx,S:new Xx,X:new Gx,x:new Kx,t:new Qx,T:new Zx},tw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ew=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,nw=/^'([^]*?)'?$/,rw=/''/g,iw=/\S/,aw=/[a-zA-Z]/;function sw(n,t,e,r){var i,a,s,o,l,c,u,d,f,g,v,x,p,b,m,y,w,T;J(3,arguments);var S=String(n),k=String(t),M=vn(),D=(i=(a=r==null?void 0:r.locale)!==null&&a!==void 0?a:M.locale)!==null&&i!==void 0?i:Yd;if(!D.match)throw new RangeError("locale must contain match property");var O=Lt((s=(o=(l=(c=r==null?void 0:r.firstWeekContainsDate)!==null&&c!==void 0?c:r==null||(u=r.locale)===null||u===void 0||(d=u.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&l!==void 0?l:M.firstWeekContainsDate)!==null&&o!==void 0?o:(f=M.locale)===null||f===void 0||(g=f.options)===null||g===void 0?void 0:g.firstWeekContainsDate)!==null&&s!==void 0?s:1);if(!(O>=1&&O<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var P=Lt((v=(x=(p=(b=r==null?void 0:r.weekStartsOn)!==null&&b!==void 0?b:r==null||(m=r.locale)===null||m===void 0||(y=m.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&p!==void 0?p:M.weekStartsOn)!==null&&x!==void 0?x:(w=M.locale)===null||w===void 0||(T=w.options)===null||T===void 0?void 0:T.weekStartsOn)!==null&&v!==void 0?v:0);if(!(P>=0&&P<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(k==="")return S===""?nt(e):new Date(NaN);var A={firstWeekContainsDate:O,weekStartsOn:P,locale:D},F=[new mx],q=k.match(ew).map(function(N){var R=N[0];if(R in Es){var Q=Es[R];return Q(N,D.formatLong)}return N}).join("").match(tw),$=[],H=zd(q),I;try{var it=function(){var R=I.value;!(r!=null&&r.useAdditionalWeekYearTokens)&&Wd(R)&&Ji(R,k,n),!(r!=null&&r.useAdditionalDayOfYearTokens)&&Ud(R)&&Ji(R,k,n);var Q=R[0],X=Jx[Q];if(X){var vt=X.incompatibleTokens;if(Array.isArray(vt)){var ut=$.find(function(_t){return vt.includes(_t.token)||_t.token===Q});if(ut)throw new RangeError("The format string mustn't contain `".concat(ut.fullToken,"` and `").concat(R,"` at the same time"))}else if(X.incompatibleTokens==="*"&&$.length>0)throw new RangeError("The format string mustn't contain `".concat(R,"` and any other token at the same time"));$.push({token:Q,fullToken:R});var Pt=X.run(S,R,D.match,A);if(!Pt)return{v:new Date(NaN)};F.push(Pt.setter),S=Pt.rest}else{if(Q.match(aw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+Q+"`");if(R==="''"?R="'":Q==="'"&&(R=ow(R)),S.indexOf(R)===0)S=S.slice(R.length);else return{v:new Date(NaN)}}};for(H.s();!(I=H.n()).done;){var U=it();if(Ze(U)==="object")return U.v}}catch(N){H.e(N)}finally{H.f()}if(S.length>0&&iw.test(S))return new Date(NaN);var yt=F.map(function(N){return N.priority}).sort(function(N,R){return R-N}).filter(function(N,R,Q){return Q.indexOf(N)===R}).map(function(N){return F.filter(function(R){return R.priority===N}).sort(function(R,Q){return Q.subPriority-R.subPriority})}).map(function(N){return N[0]}),dt=nt(e);if(isNaN(dt.getTime()))return new Date(NaN);var Y=Ed(dt,Ki(dt)),L={},B=zd(yt),j;try{for(B.s();!(j=B.n()).done;){var Z=j.value;if(!Z.validate(Y,A))return new Date(NaN);var K=Z.set(Y,L,A);Array.isArray(K)?(Y=K[0],cx(L,K[1])):Y=K}}catch(N){B.e(N)}finally{B.f()}return Y}function ow(n){return n.match(nw)[1].replace(rw,"'")}function lw(n){J(1,arguments);var t=nt(n);return t.setMinutes(0,0,0),t}function cw(n){J(1,arguments);var t=nt(n);return t.setMilliseconds(0),t}function uw(n){J(1,arguments);var t=n/Zr;return Math.floor(t)}function Kd(n,t){var e;J(1,arguments);var r=Lt((e=t==null?void 0:t.additionalDigits)!==null&&e!==void 0?e:2);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof n=="string"||Object.prototype.toString.call(n)==="[object String]"))return new Date(NaN);var i=gw(n),a;if(i.date){var s=pw(i.date,r);a=mw(s.restDateString,s.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);var o=a.getTime(),l=0,c;if(i.time&&(l=bw(i.time),isNaN(l)))return new Date(NaN);if(i.timezone){if(c=yw(i.timezone),isNaN(c))return new Date(NaN)}else{var u=new Date(o+l),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return new Date(o+l+c)}var na={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},dw=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,fw=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,hw=/^([+-])(\d{2})(?::?(\d{2}))?$/;function gw(n){var t={},e=n.split(na.dateTimeDelimiter),r;if(e.length>2)return t;if(/:/.test(e[0])?r=e[0]:(t.date=e[0],r=e[1],na.timeZoneDelimiter.test(t.date)&&(t.date=n.split(na.timeZoneDelimiter)[0],r=n.substr(t.date.length,n.length))),r){var i=na.timezone.exec(r);i?(t.time=r.replace(i[1],""),t.timezone=i[1]):t.time=r}return t}function pw(n,t){var e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=n.match(e);if(!r)return{year:NaN,restDateString:""};var i=r[1]?parseInt(r[1]):null,a=r[2]?parseInt(r[2]):null;return{year:a===null?i:a*100,restDateString:n.slice((r[1]||r[2]).length)}}function mw(n,t){if(t===null)return new Date(NaN);var e=n.match(dw);if(!e)return new Date(NaN);var r=!!e[4],i=ni(e[1]),a=ni(e[2])-1,s=ni(e[3]),o=ni(e[4]),l=ni(e[5])-1;if(r)return Tw(t,o,l)?vw(t,o,l):new Date(NaN);var c=new Date(0);return!ww(t,a,s)||!_w(t,i)?new Date(NaN):(c.setUTCFullYear(t,a,Math.max(i,s)),c)}function ni(n){return n?parseInt(n):1}function bw(n){var t=n.match(fw);if(!t)return NaN;var e=Ns(t[1]),r=Ns(t[2]),i=Ns(t[3]);return Mw(e,r,i)?e*Zr+r*Qi+i*1e3:NaN}function Ns(n){return n&&parseFloat(n.replace(",","."))||0}function yw(n){if(n==="Z")return 0;var t=n.match(hw);if(!t)return 0;var e=t[1]==="+"?-1:1,r=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;return Dw(r,i)?e*(r*Zr+i*Qi):NaN}function vw(n,t,e){var r=new Date(0);r.setUTCFullYear(n,0,4);var i=r.getUTCDay()||7,a=(t-1)*7+e+1-i;return r.setUTCDate(r.getUTCDate()+a),r}var xw=[31,null,31,30,31,30,31,31,30,31,30,31];function Qd(n){return n%400===0||n%4===0&&n%100!==0}function ww(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(xw[t]||(Qd(n)?29:28))}function _w(n,t){return t>=1&&t<=(Qd(n)?366:365)}function Tw(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function Mw(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function Dw(n,t){return t>=0&&t<=59}var ne=(n=>(n.DOUGHNUT="Doughnut",n.HORIZONTAL_BAR="HorizontalBar",n.VERTICAL_BAR="VerticalBar",n.TIMESERIES_LINE="Line",n.TIMESERIES_BAR="TimeSeriesBar",n))(ne||{}),ra=(n=>(n.GAUGE="Gauge",n.TOPN="TopN",n))(ra||{}),Yt=(n=>(n.Hidden="hidden",n.Right="right",n.Bottom="bottom",n))(Yt||{}),lr=(n=>(n.Hidden="hidden",n.SingleMetric="single",n.Full="full",n))(lr||{});const Fs=(n,t)=>{var i,a;const{tooltip:e}=t;if(e.opacity===0&&!n.locked){n.showTooltip=!1;return}const r=n.chartTooltipSortFn||((s,o)=>o.rawValue-s.rawValue);if(e.body&&!n.locked){const s=e.labelColors,o=((a=(i=t.chart.config)==null?void 0:i.options)==null?void 0:a.indexAxis)==="y"?"x":"y",l=[ne.HORIZONTAL_BAR,ne.VERTICAL_BAR].includes(n.chartType),c=[ra.GAUGE,ne.DOUGHNUT].includes(n.chartType);n.tooltipContext=l?e.dataPoints.length>1?e.dataPoints[0].label:"":e.dataPoints[0].parsed.x,n.tooltipSeries=e.dataPoints.map((u,d)=>{const f=c?u.parsed:u.parsed[o];let g;if(n.units==="bytes")g=isNaN(f)?f:Cs(f);else{const x=n.translateUnit(n.units,f);g=`${f%1===0?aa.format(f):aa.format(Number(f.toFixed(wf)))} ${x}`}const v=l&&u.dataset.label!==u.label?u.dataset.label:c?u.dataset.labels[u.dataIndex]:u.dataset.label;return{backgroundColor:s[d].backgroundColor,borderColor:s[d].borderColor,label:v,value:g,rawValue:f}}).sort(r),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},Cw=n=>n&&n.datasets&&n.datasets.length,kw=n=>Cw(n)&&n.datasets.some(t=>t.data.length),Sw=n=>kw(n)&&n.datasets.some(t=>t.data.length>1),Ow=n=>Sw(n)&&n.datasets.some(t=>t.data[0]&&Os(t.data[0].x)),Pw=n=>Ow(n)&&n.datasets.some(t=>t.data[0]&&t.data[0].x.toString().length>=13),Bs=(n,t,e)=>{const i=Math.min(t/1150,1),a=.15,s=1.15;return n.x<e?n.x+t*a*(1-i):n.x-t*s*(1-i)},Ew=(n,t,e)=>n.y<e?n.y+t*.15:n.y-t*.5;function Zd(n,t){let e;return(...r)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...r)},t)}}var me=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Wn(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Us={exports:{}},Jd={exports:{}};(function(n){function t(e){return e&&e.__esModule?e:{default:e}}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(Jd);var Ht=Jd.exports,Ws={exports:{}},Ys={exports:{}},tf={exports:{}};(function(n){function t(e){"@babel/helpers - typeof";return n.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},n.exports.__esModule=!0,n.exports.default=n.exports,t(e)}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(tf);var ef=tf.exports,Hs={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r,i){if(i.length<r)throw new TypeError(r+" argument"+(r>1?"s":"")+" required, but only "+i.length+" present")}n.exports=t.default})(Hs,Hs.exports);var se=Hs.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var r=e(ef),i=e(se);function a(s){return(0,i.default)(1,arguments),s instanceof Date||(0,r.default)(s)==="object"&&Object.prototype.toString.call(s)==="[object Date]"}n.exports=t.default})(Ys,Ys.exports);var Aw=Ys.exports,zs={exports:{}};(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var r=e(ef),i=e(se);function a(s){(0,i.default)(1,arguments);var o=Object.prototype.toString.call(s);return s instanceof Date||(0,r.default)(s)==="object"&&o==="[object Date]"?new Date(s.getTime()):typeof s=="number"||o==="[object Number]"?new Date(s):((typeof s=="string"||o==="[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))}n.exports=t.default})(zs,zs.exports);var Ye=zs.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e(Aw),i=e(Ye),a=e(se);function s(o){if((0,a.default)(1,arguments),!(0,r.default)(o)&&typeof o!="number")return!1;var l=(0,i.default)(o);return!isNaN(Number(l))}n.exports=t.default})(Ws,Ws.exports);var Rw=Ws.exports,$s={exports:{}},js={exports:{}},Vs={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r){if(r===null||r===!0||r===!1)return NaN;var i=Number(r);return isNaN(i)?i:i<0?Math.ceil(i):Math.floor(i)}n.exports=t.default})(Vs,Vs.exports);var Yn=Vs.exports;const Lw=Wn(Yn);(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e(Yn),i=e(Ye),a=e(se);function s(o,l){(0,a.default)(2,arguments);var c=(0,i.default)(o).getTime(),u=(0,r.default)(l);return new Date(c+u)}n.exports=t.default})(js,js.exports);var Iw=js.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e(Iw),i=e(se),a=e(Yn);function s(o,l){(0,i.default)(2,arguments);var c=(0,a.default)(l);return(0,r.default)(o,-c)}n.exports=t.default})($s,$s.exports);var Nw=$s.exports,qs={exports:{}},Xs={exports:{}};(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e(Ye),i=e(se),a=864e5;function s(o){(0,i.default)(1,arguments);var l=(0,r.default)(o),c=l.getTime();l.setUTCMonth(0,1),l.setUTCHours(0,0,0,0);var u=l.getTime(),d=c-u;return Math.floor(d/a)+1}n.exports=t.default})(Xs,Xs.exports);var Fw=Xs.exports,Gs={exports:{}},Ks={exports:{}};(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var r=e(Ye),i=e(se);function a(s){(0,i.default)(1,arguments);var o=1,l=(0,r.default)(s),c=l.getUTCDay(),u=(c<o?7:0)+c-o;return l.setUTCDate(l.getUTCDate()-u),l.setUTCHours(0,0,0,0),l}n.exports=t.default})(Ks,Ks.exports);var Qs=Ks.exports,Zs={exports:{}},Js={exports:{}};(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e(Ye),i=e(se),a=e(Qs);function s(o){(0,i.default)(1,arguments);var l=(0,r.default)(o),c=l.getUTCFullYear(),u=new Date(0);u.setUTCFullYear(c+1,0,4),u.setUTCHours(0,0,0,0);var d=(0,a.default)(u),f=new Date(0);f.setUTCFullYear(c,0,4),f.setUTCHours(0,0,0,0);var g=(0,a.default)(f);return l.getTime()>=d.getTime()?c+1:l.getTime()>=g.getTime()?c:c-1}n.exports=t.default})(Js,Js.exports);var nf=Js.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e(nf),i=e(Qs),a=e(se);function s(o){(0,a.default)(1,arguments);var l=(0,r.default)(o),c=new Date(0);c.setUTCFullYear(l,0,4),c.setUTCHours(0,0,0,0);var u=(0,i.default)(c);return u}n.exports=t.default})(Zs,Zs.exports);var Bw=Zs.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var r=e(Ye),i=e(Qs),a=e(Bw),s=e(se),o=6048e5;function l(c){(0,s.default)(1,arguments);var u=(0,r.default)(c),d=(0,i.default)(u).getTime()-(0,a.default)(u).getTime();return Math.round(d/o)+1}n.exports=t.default})(Gs,Gs.exports);var Uw=Gs.exports,to={exports:{}},eo={exports:{}},Hn={};Object.defineProperty(Hn,"__esModule",{value:!0}),Hn.getDefaultOptions=Ww,Hn.setDefaultOptions=Yw;var rf={};function Ww(){return rf}function Yw(n){rf=n}(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var r=e(Ye),i=e(se),a=e(Yn),s=Hn;function o(l,c){var u,d,f,g,v,x,p,b;(0,i.default)(1,arguments);var m=(0,s.getDefaultOptions)(),y=(0,a.default)((u=(d=(f=(g=c==null?void 0:c.weekStartsOn)!==null&&g!==void 0?g:c==null||(v=c.locale)===null||v===void 0||(x=v.options)===null||x===void 0?void 0:x.weekStartsOn)!==null&&f!==void 0?f:m.weekStartsOn)!==null&&d!==void 0?d:(p=m.locale)===null||p===void 0||(b=p.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&u!==void 0?u:0);if(!(y>=0&&y<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var w=(0,r.default)(l),T=w.getUTCDay(),S=(T<y?7:0)+T-y;return w.setUTCDate(w.getUTCDate()-S),w.setUTCHours(0,0,0,0),w}n.exports=t.default})(eo,eo.exports);var no=eo.exports,ro={exports:{}},io={exports:{}};(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var r=e(Ye),i=e(se),a=e(no),s=e(Yn),o=Hn;function l(c,u){var d,f,g,v,x,p,b,m;(0,i.default)(1,arguments);var y=(0,r.default)(c),w=y.getUTCFullYear(),T=(0,o.getDefaultOptions)(),S=(0,s.default)((d=(f=(g=(v=u==null?void 0:u.firstWeekContainsDate)!==null&&v!==void 0?v:u==null||(x=u.locale)===null||x===void 0||(p=x.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&g!==void 0?g:T.firstWeekContainsDate)!==null&&f!==void 0?f:(b=T.locale)===null||b===void 0||(m=b.options)===null||m===void 0?void 0:m.firstWeekContainsDate)!==null&&d!==void 0?d:1);if(!(S>=1&&S<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var k=new Date(0);k.setUTCFullYear(w+1,0,S),k.setUTCHours(0,0,0,0);var M=(0,a.default)(k,u),D=new Date(0);D.setUTCFullYear(w,0,S),D.setUTCHours(0,0,0,0);var O=(0,a.default)(D,u);return y.getTime()>=M.getTime()?w+1:y.getTime()>=O.getTime()?w:w-1}n.exports=t.default})(io,io.exports);var af=io.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var r=e(af),i=e(se),a=e(no),s=e(Yn),o=Hn;function l(c,u){var d,f,g,v,x,p,b,m;(0,i.default)(1,arguments);var y=(0,o.getDefaultOptions)(),w=(0,s.default)((d=(f=(g=(v=u==null?void 0:u.firstWeekContainsDate)!==null&&v!==void 0?v:u==null||(x=u.locale)===null||x===void 0||(p=x.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&g!==void 0?g:y.firstWeekContainsDate)!==null&&f!==void 0?f:(b=y.locale)===null||b===void 0||(m=b.options)===null||m===void 0?void 0:m.firstWeekContainsDate)!==null&&d!==void 0?d:1),T=(0,r.default)(c,u),S=new Date(0);S.setUTCFullYear(T,0,w),S.setUTCHours(0,0,0,0);var k=(0,a.default)(S,u);return k}n.exports=t.default})(ro,ro.exports);var Hw=ro.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var r=e(Ye),i=e(no),a=e(Hw),s=e(se),o=6048e5;function l(c,u){(0,s.default)(1,arguments);var d=(0,r.default)(c),f=(0,i.default)(d,u).getTime()-(0,a.default)(d,u).getTime();return Math.round(f/o)+1}n.exports=t.default})(to,to.exports);var zw=to.exports,ao={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r,i){for(var a=r<0?"-":"",s=Math.abs(r).toString();s.length<i;)s="0"+s;return a+s}n.exports=t.default})(ao,ao.exports);var sf=ao.exports,so={exports:{}};(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(sf),i={y:function(o,l){var c=o.getUTCFullYear(),u=c>0?c:1-c;return(0,r.default)(l==="yy"?u%100:u,l.length)},M:function(o,l){var c=o.getUTCMonth();return l==="M"?String(c+1):(0,r.default)(c+1,2)},d:function(o,l){return(0,r.default)(o.getUTCDate(),l.length)},a:function(o,l){var c=o.getUTCHours()/12>=1?"pm":"am";switch(l){case"a":case"aa":return c.toUpperCase();case"aaa":return c;case"aaaaa":return c[0];case"aaaa":default:return c==="am"?"a.m.":"p.m."}},h:function(o,l){return(0,r.default)(o.getUTCHours()%12||12,l.length)},H:function(o,l){return(0,r.default)(o.getUTCHours(),l.length)},m:function(o,l){return(0,r.default)(o.getUTCMinutes(),l.length)},s:function(o,l){return(0,r.default)(o.getUTCSeconds(),l.length)},S:function(o,l){var c=l.length,u=o.getUTCMilliseconds(),d=Math.floor(u*Math.pow(10,c-3));return(0,r.default)(d,l.length)}},a=i;t.default=a,n.exports=t.default})(so,so.exports);var $w=so.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(Fw),i=e(Uw),a=e(nf),s=e(zw),o=e(af),l=e(sf),c=e($w),u={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},d={G:function(b,m,y){var w=b.getUTCFullYear()>0?1:0;switch(m){case"G":case"GG":case"GGG":return y.era(w,{width:"abbreviated"});case"GGGGG":return y.era(w,{width:"narrow"});case"GGGG":default:return y.era(w,{width:"wide"})}},y:function(b,m,y){if(m==="yo"){var w=b.getUTCFullYear(),T=w>0?w:1-w;return y.ordinalNumber(T,{unit:"year"})}return c.default.y(b,m)},Y:function(b,m,y,w){var T=(0,o.default)(b,w),S=T>0?T:1-T;if(m==="YY"){var k=S%100;return(0,l.default)(k,2)}return m==="Yo"?y.ordinalNumber(S,{unit:"year"}):(0,l.default)(S,m.length)},R:function(b,m){var y=(0,a.default)(b);return(0,l.default)(y,m.length)},u:function(b,m){var y=b.getUTCFullYear();return(0,l.default)(y,m.length)},Q:function(b,m,y){var w=Math.ceil((b.getUTCMonth()+1)/3);switch(m){case"Q":return String(w);case"QQ":return(0,l.default)(w,2);case"Qo":return y.ordinalNumber(w,{unit:"quarter"});case"QQQ":return y.quarter(w,{width:"abbreviated",context:"formatting"});case"QQQQQ":return y.quarter(w,{width:"narrow",context:"formatting"});case"QQQQ":default:return y.quarter(w,{width:"wide",context:"formatting"})}},q:function(b,m,y){var w=Math.ceil((b.getUTCMonth()+1)/3);switch(m){case"q":return String(w);case"qq":return(0,l.default)(w,2);case"qo":return y.ordinalNumber(w,{unit:"quarter"});case"qqq":return y.quarter(w,{width:"abbreviated",context:"standalone"});case"qqqqq":return y.quarter(w,{width:"narrow",context:"standalone"});case"qqqq":default:return y.quarter(w,{width:"wide",context:"standalone"})}},M:function(b,m,y){var w=b.getUTCMonth();switch(m){case"M":case"MM":return c.default.M(b,m);case"Mo":return y.ordinalNumber(w+1,{unit:"month"});case"MMM":return y.month(w,{width:"abbreviated",context:"formatting"});case"MMMMM":return y.month(w,{width:"narrow",context:"formatting"});case"MMMM":default:return y.month(w,{width:"wide",context:"formatting"})}},L:function(b,m,y){var w=b.getUTCMonth();switch(m){case"L":return String(w+1);case"LL":return(0,l.default)(w+1,2);case"Lo":return y.ordinalNumber(w+1,{unit:"month"});case"LLL":return y.month(w,{width:"abbreviated",context:"standalone"});case"LLLLL":return y.month(w,{width:"narrow",context:"standalone"});case"LLLL":default:return y.month(w,{width:"wide",context:"standalone"})}},w:function(b,m,y,w){var T=(0,s.default)(b,w);return m==="wo"?y.ordinalNumber(T,{unit:"week"}):(0,l.default)(T,m.length)},I:function(b,m,y){var w=(0,i.default)(b);return m==="Io"?y.ordinalNumber(w,{unit:"week"}):(0,l.default)(w,m.length)},d:function(b,m,y){return m==="do"?y.ordinalNumber(b.getUTCDate(),{unit:"date"}):c.default.d(b,m)},D:function(b,m,y){var w=(0,r.default)(b);return m==="Do"?y.ordinalNumber(w,{unit:"dayOfYear"}):(0,l.default)(w,m.length)},E:function(b,m,y){var w=b.getUTCDay();switch(m){case"E":case"EE":case"EEE":return y.day(w,{width:"abbreviated",context:"formatting"});case"EEEEE":return y.day(w,{width:"narrow",context:"formatting"});case"EEEEEE":return y.day(w,{width:"short",context:"formatting"});case"EEEE":default:return y.day(w,{width:"wide",context:"formatting"})}},e:function(b,m,y,w){var T=b.getUTCDay(),S=(T-w.weekStartsOn+8)%7||7;switch(m){case"e":return String(S);case"ee":return(0,l.default)(S,2);case"eo":return y.ordinalNumber(S,{unit:"day"});case"eee":return y.day(T,{width:"abbreviated",context:"formatting"});case"eeeee":return y.day(T,{width:"narrow",context:"formatting"});case"eeeeee":return y.day(T,{width:"short",context:"formatting"});case"eeee":default:return y.day(T,{width:"wide",context:"formatting"})}},c:function(b,m,y,w){var T=b.getUTCDay(),S=(T-w.weekStartsOn+8)%7||7;switch(m){case"c":return String(S);case"cc":return(0,l.default)(S,m.length);case"co":return y.ordinalNumber(S,{unit:"day"});case"ccc":return y.day(T,{width:"abbreviated",context:"standalone"});case"ccccc":return y.day(T,{width:"narrow",context:"standalone"});case"cccccc":return y.day(T,{width:"short",context:"standalone"});case"cccc":default:return y.day(T,{width:"wide",context:"standalone"})}},i:function(b,m,y){var w=b.getUTCDay(),T=w===0?7:w;switch(m){case"i":return String(T);case"ii":return(0,l.default)(T,m.length);case"io":return y.ordinalNumber(T,{unit:"day"});case"iii":return y.day(w,{width:"abbreviated",context:"formatting"});case"iiiii":return y.day(w,{width:"narrow",context:"formatting"});case"iiiiii":return y.day(w,{width:"short",context:"formatting"});case"iiii":default:return y.day(w,{width:"wide",context:"formatting"})}},a:function(b,m,y){var w=b.getUTCHours(),T=w/12>=1?"pm":"am";switch(m){case"a":case"aa":return y.dayPeriod(T,{width:"abbreviated",context:"formatting"});case"aaa":return y.dayPeriod(T,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return y.dayPeriod(T,{width:"narrow",context:"formatting"});case"aaaa":default:return y.dayPeriod(T,{width:"wide",context:"formatting"})}},b:function(b,m,y){var w=b.getUTCHours(),T;switch(w===12?T=u.noon:w===0?T=u.midnight:T=w/12>=1?"pm":"am",m){case"b":case"bb":return y.dayPeriod(T,{width:"abbreviated",context:"formatting"});case"bbb":return y.dayPeriod(T,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return y.dayPeriod(T,{width:"narrow",context:"formatting"});case"bbbb":default:return y.dayPeriod(T,{width:"wide",context:"formatting"})}},B:function(b,m,y){var w=b.getUTCHours(),T;switch(w>=17?T=u.evening:w>=12?T=u.afternoon:w>=4?T=u.morning:T=u.night,m){case"B":case"BB":case"BBB":return y.dayPeriod(T,{width:"abbreviated",context:"formatting"});case"BBBBB":return y.dayPeriod(T,{width:"narrow",context:"formatting"});case"BBBB":default:return y.dayPeriod(T,{width:"wide",context:"formatting"})}},h:function(b,m,y){if(m==="ho"){var w=b.getUTCHours()%12;return w===0&&(w=12),y.ordinalNumber(w,{unit:"hour"})}return c.default.h(b,m)},H:function(b,m,y){return m==="Ho"?y.ordinalNumber(b.getUTCHours(),{unit:"hour"}):c.default.H(b,m)},K:function(b,m,y){var w=b.getUTCHours()%12;return m==="Ko"?y.ordinalNumber(w,{unit:"hour"}):(0,l.default)(w,m.length)},k:function(b,m,y){var w=b.getUTCHours();return w===0&&(w=24),m==="ko"?y.ordinalNumber(w,{unit:"hour"}):(0,l.default)(w,m.length)},m:function(b,m,y){return m==="mo"?y.ordinalNumber(b.getUTCMinutes(),{unit:"minute"}):c.default.m(b,m)},s:function(b,m,y){return m==="so"?y.ordinalNumber(b.getUTCSeconds(),{unit:"second"}):c.default.s(b,m)},S:function(b,m){return c.default.S(b,m)},X:function(b,m,y,w){var T=w._originalDate||b,S=T.getTimezoneOffset();if(S===0)return"Z";switch(m){case"X":return g(S);case"XXXX":case"XX":return v(S);case"XXXXX":case"XXX":default:return v(S,":")}},x:function(b,m,y,w){var T=w._originalDate||b,S=T.getTimezoneOffset();switch(m){case"x":return g(S);case"xxxx":case"xx":return v(S);case"xxxxx":case"xxx":default:return v(S,":")}},O:function(b,m,y,w){var T=w._originalDate||b,S=T.getTimezoneOffset();switch(m){case"O":case"OO":case"OOO":return"GMT"+f(S,":");case"OOOO":default:return"GMT"+v(S,":")}},z:function(b,m,y,w){var T=w._originalDate||b,S=T.getTimezoneOffset();switch(m){case"z":case"zz":case"zzz":return"GMT"+f(S,":");case"zzzz":default:return"GMT"+v(S,":")}},t:function(b,m,y,w){var T=w._originalDate||b,S=Math.floor(T.getTime()/1e3);return(0,l.default)(S,m.length)},T:function(b,m,y,w){var T=w._originalDate||b,S=T.getTime();return(0,l.default)(S,m.length)}};function f(p,b){var m=p>0?"-":"+",y=Math.abs(p),w=Math.floor(y/60),T=y%60;if(T===0)return m+String(w);var S=b||"";return m+String(w)+S+(0,l.default)(T,2)}function g(p,b){if(p%60===0){var m=p>0?"-":"+";return m+(0,l.default)(Math.abs(p)/60,2)}return v(p,b)}function v(p,b){var m=b||"",y=p>0?"-":"+",w=Math.abs(p),T=(0,l.default)(Math.floor(w/60),2),S=(0,l.default)(w%60,2);return y+T+m+S}var x=d;t.default=x,n.exports=t.default})(qs,qs.exports);var jw=qs.exports,oo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(l,c){switch(l){case"P":return c.date({width:"short"});case"PP":return c.date({width:"medium"});case"PPP":return c.date({width:"long"});case"PPPP":default:return c.date({width:"full"})}},r=function(l,c){switch(l){case"p":return c.time({width:"short"});case"pp":return c.time({width:"medium"});case"ppp":return c.time({width:"long"});case"pppp":default:return c.time({width:"full"})}},i=function(l,c){var u=l.match(/(P+)(p+)?/)||[],d=u[1],f=u[2];if(!f)return e(l,c);var g;switch(d){case"P":g=c.dateTime({width:"short"});break;case"PP":g=c.dateTime({width:"medium"});break;case"PPP":g=c.dateTime({width:"long"});break;case"PPPP":default:g=c.dateTime({width:"full"});break}return g.replace("{{date}}",e(d,c)).replace("{{time}}",r(f,c))},a={p:r,P:i},s=a;t.default=s,n.exports=t.default})(oo,oo.exports);var Vw=oo.exports,lo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r){var i=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return i.setUTCFullYear(r.getFullYear()),r.getTime()-i.getTime()}n.exports=t.default})(lo,lo.exports);var of=lo.exports;const lf=Wn(of);var ri={};Object.defineProperty(ri,"__esModule",{value:!0}),ri.isProtectedDayOfYearToken=Gw,ri.isProtectedWeekYearToken=Kw,ri.throwProtectedError=Qw;var qw=["D","DD"],Xw=["YY","YYYY"];function Gw(n){return qw.indexOf(n)!==-1}function Kw(n){return Xw.indexOf(n)!==-1}function Qw(n,t,e){if(n==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var co={exports:{}},uo={exports:{}},fo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e={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"}},r=function(s,o,l){var c,u=e[s];return typeof u=="string"?c=u:o===1?c=u.one:c=u.other.replace("{{count}}",o.toString()),l!=null&&l.addSuffix?l.comparison&&l.comparison>0?"in "+c:c+" ago":c},i=r;t.default=i,n.exports=t.default})(fo,fo.exports);var Zw=fo.exports,ho={exports:{}},go={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r){return function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=i.width?String(i.width):r.defaultWidth,s=r.formats[a]||r.formats[r.defaultWidth];return s}}n.exports=t.default})(go,go.exports);var Jw=go.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(Jw),i={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},a={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},s={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},o={date:(0,r.default)({formats:i,defaultWidth:"full"}),time:(0,r.default)({formats:a,defaultWidth:"full"}),dateTime:(0,r.default)({formats:s,defaultWidth:"full"})},l=o;t.default=l,n.exports=t.default})(ho,ho.exports);var t_=ho.exports,po={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},r=function(s,o,l,c){return e[s]},i=r;t.default=i,n.exports=t.default})(po,po.exports);var e_=po.exports,mo={exports:{}},bo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r){return function(i,a){var s=a!=null&&a.context?String(a.context):"standalone",o;if(s==="formatting"&&r.formattingValues){var l=r.defaultFormattingWidth||r.defaultWidth,c=a!=null&&a.width?String(a.width):l;o=r.formattingValues[c]||r.formattingValues[l]}else{var u=r.defaultWidth,d=a!=null&&a.width?String(a.width):r.defaultWidth;o=r.values[d]||r.values[u]}var f=r.argumentCallback?r.argumentCallback(i):i;return o[f]}}n.exports=t.default})(bo,bo.exports);var n_=bo.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(n_),i={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},a={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},s={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"]},o={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"]},l={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"}},c={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"}},u=function(v,x){var p=Number(v),b=p%100;if(b>20||b<10)switch(b%10){case 1:return p+"st";case 2:return p+"nd";case 3:return p+"rd"}return p+"th"},d={ordinalNumber:u,era:(0,r.default)({values:i,defaultWidth:"wide"}),quarter:(0,r.default)({values:a,defaultWidth:"wide",argumentCallback:function(v){return v-1}}),month:(0,r.default)({values:s,defaultWidth:"wide"}),day:(0,r.default)({values:o,defaultWidth:"wide"}),dayPeriod:(0,r.default)({values:l,defaultWidth:"wide",formattingValues:c,defaultFormattingWidth:"wide"})},f=d;t.default=f,n.exports=t.default})(mo,mo.exports);var r_=mo.exports,yo={exports:{}},vo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(a){return function(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=o.width,c=l&&a.matchPatterns[l]||a.matchPatterns[a.defaultMatchWidth],u=s.match(c);if(!u)return null;var d=u[0],f=l&&a.parsePatterns[l]||a.parsePatterns[a.defaultParseWidth],g=Array.isArray(f)?i(f,function(p){return p.test(d)}):r(f,function(p){return p.test(d)}),v;v=a.valueCallback?a.valueCallback(g):g,v=o.valueCallback?o.valueCallback(v):v;var x=s.slice(d.length);return{value:v,rest:x}}}function r(a,s){for(var o in a)if(a.hasOwnProperty(o)&&s(a[o]))return o}function i(a,s){for(var o=0;o<a.length;o++)if(s(a[o]))return o}n.exports=t.default})(vo,vo.exports);var i_=vo.exports,xo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r){return function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=i.match(r.matchPattern);if(!s)return null;var o=s[0],l=i.match(r.parsePattern);if(!l)return null;var c=r.valueCallback?r.valueCallback(l[0]):l[0];c=a.valueCallback?a.valueCallback(c):c;var u=i.slice(o.length);return{value:c,rest:u}}}n.exports=t.default})(xo,xo.exports);var a_=xo.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(i_),i=e(a_),a=/^(\d+)(th|st|nd|rd)?/i,s=/\d+/i,o={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},l={any:[/^b/i,/^(a|c)/i]},c={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},u={any:[/1/i,/2/i,/3/i,/4/i]},d={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},f={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]},g={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},v={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]},x={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},p={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}},b={ordinalNumber:(0,i.default)({matchPattern:a,parsePattern:s,valueCallback:function(w){return parseInt(w,10)}}),era:(0,r.default)({matchPatterns:o,defaultMatchWidth:"wide",parsePatterns:l,defaultParseWidth:"any"}),quarter:(0,r.default)({matchPatterns:c,defaultMatchWidth:"wide",parsePatterns:u,defaultParseWidth:"any",valueCallback:function(w){return w+1}}),month:(0,r.default)({matchPatterns:d,defaultMatchWidth:"wide",parsePatterns:f,defaultParseWidth:"any"}),day:(0,r.default)({matchPatterns:g,defaultMatchWidth:"wide",parsePatterns:v,defaultParseWidth:"any"}),dayPeriod:(0,r.default)({matchPatterns:x,defaultMatchWidth:"any",parsePatterns:p,defaultParseWidth:"any"})},m=b;t.default=m,n.exports=t.default})(yo,yo.exports);var s_=yo.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(Zw),i=e(t_),a=e(e_),s=e(r_),o=e(s_),l={code:"en-US",formatDistance:r.default,formatLong:i.default,formatRelative:a.default,localize:s.default,match:o.default,options:{weekStartsOn:0,firstWeekContainsDate:1}},c=l;t.default=c,n.exports=t.default})(uo,uo.exports);var o_=uo.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(o_),i=r.default;t.default=i,n.exports=t.default})(co,co.exports);var l_=co.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=y;var r=e(Rw),i=e(Nw),a=e(Ye),s=e(jw),o=e(Vw),l=e(of),c=ri,u=e(Yn),d=e(se),f=Hn,g=e(l_),v=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,x=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,p=/^'([^]*?)'?$/,b=/''/g,m=/[a-zA-Z]/;function y(T,S,k){var M,D,O,P,A,F,q,$,H,I,it,U,yt,dt,Y,L,B,j;(0,d.default)(2,arguments);var Z=String(S),K=(0,f.getDefaultOptions)(),N=(M=(D=k==null?void 0:k.locale)!==null&&D!==void 0?D:K.locale)!==null&&M!==void 0?M:g.default,R=(0,u.default)((O=(P=(A=(F=k==null?void 0:k.firstWeekContainsDate)!==null&&F!==void 0?F:k==null||(q=k.locale)===null||q===void 0||($=q.options)===null||$===void 0?void 0:$.firstWeekContainsDate)!==null&&A!==void 0?A:K.firstWeekContainsDate)!==null&&P!==void 0?P:(H=K.locale)===null||H===void 0||(I=H.options)===null||I===void 0?void 0:I.firstWeekContainsDate)!==null&&O!==void 0?O:1);if(!(R>=1&&R<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var Q=(0,u.default)((it=(U=(yt=(dt=k==null?void 0:k.weekStartsOn)!==null&&dt!==void 0?dt:k==null||(Y=k.locale)===null||Y===void 0||(L=Y.options)===null||L===void 0?void 0:L.weekStartsOn)!==null&&yt!==void 0?yt:K.weekStartsOn)!==null&&U!==void 0?U:(B=K.locale)===null||B===void 0||(j=B.options)===null||j===void 0?void 0:j.weekStartsOn)!==null&&it!==void 0?it:0);if(!(Q>=0&&Q<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!N.localize)throw new RangeError("locale must contain localize property");if(!N.formatLong)throw new RangeError("locale must contain formatLong property");var X=(0,a.default)(T);if(!(0,r.default)(X))throw new RangeError("Invalid time value");var vt=(0,l.default)(X),ut=(0,i.default)(X,vt),Pt={firstWeekContainsDate:R,weekStartsOn:Q,locale:N,_originalDate:X},_t=Z.match(x).map(function(et){var xt=et[0];if(xt==="p"||xt==="P"){var Ft=o.default[xt];return Ft(et,N.formatLong)}return et}).join("").match(v).map(function(et){if(et==="''")return"'";var xt=et[0];if(xt==="'")return w(et);var Ft=s.default[xt];if(Ft)return!(k!=null&&k.useAdditionalWeekYearTokens)&&(0,c.isProtectedWeekYearToken)(et)&&(0,c.throwProtectedError)(et,S,String(T)),!(k!=null&&k.useAdditionalDayOfYearTokens)&&(0,c.isProtectedDayOfYearToken)(et)&&(0,c.throwProtectedError)(et,S,String(T)),Ft(ut,et,N.localize,Pt);if(xt.match(m))throw new RangeError("Format string contains an unescaped latin alphabet character `"+xt+"`");return et}).join("");return _t}function w(T){var S=T.match(p);return S?S[1].replace(b,"'"):T}n.exports=t.default})(Us,Us.exports);var c_=Us.exports;const u_=Wn(c_);function cf(n,t,e){var r=h_(n,e.timeZone,e.locale);return r.formatToParts?d_(r,t):f_(r,t)}function d_(n,t){for(var e=n.formatToParts(t),r=e.length-1;r>=0;--r)if(e[r].type==="timeZoneName")return e[r].value}function f_(n,t){var e=n.format(t).replace(/\u200E/g,""),r=/ [\w-+ ]+$/.exec(e);return r?r[0].substr(1):""}function h_(n,t,e){if(e&&!e.code)throw new Error("date-fns-tz error: Please set a language code on the locale object imported from date-fns, e.g. `locale.code = 'en-US'`");return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function g_(n,t){var e=y_(t);return e.formatToParts?m_(e,n):b_(e,n)}var p_={year:0,month:1,day:2,hour:3,minute:4,second:5};function m_(n,t){try{for(var e=n.formatToParts(t),r=[],i=0;i<e.length;i++){var a=p_[e[i].type];a>=0&&(r[a]=parseInt(e[i].value,10))}return r}catch(s){if(s instanceof RangeError)return[NaN];throw s}}function b_(n,t){var e=n.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[r[3],r[1],r[2],r[4],r[5],r[6]]}var wo={};function y_(n){if(!wo[n]){var t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:"America/New_York",year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),e=t==="06/25/2014, 00:00:00"||t==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";wo[n]=e?new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return wo[n]}function uf(n,t,e,r,i,a,s){var o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(r,i,a,s),o}var df=36e5,v_=6e4,_o={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-]\d{2}):?(\d{2})$/};function To(n,t,e){var r,i;if(!n||(r=_o.timezoneZ.exec(n),r))return 0;var a;if(r=_o.timezoneHH.exec(n),r)return a=parseInt(r[1],10),ff(a)?-(a*df):NaN;if(r=_o.timezoneHHMM.exec(n),r){a=parseInt(r[1],10);var s=parseInt(r[2],10);return ff(a,s)?(i=Math.abs(a)*df+s*v_,a>0?-i:i):NaN}if(__(n)){t=new Date(t||Date.now());var o=e?t:x_(t),l=Mo(o,n),c=e?l:w_(t,l,n);return-c}return NaN}function x_(n){return uf(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Mo(n,t){var e=g_(n,t),r=uf(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime(),i=n.getTime(),a=i%1e3;return i-=a>=0?a:1e3+a,r-i}function w_(n,t,e){var r=n.getTime(),i=r-t,a=Mo(new Date(i),e);if(t===a)return t;i-=a-t;var s=Mo(new Date(i),e);return a===s?a:Math.max(a,s)}function ff(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}var hf={};function __(n){if(hf[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),hf[n]=!0,!0}catch{return!1}}var T_=60*1e3,M_={X:function(n,t,e,r){var i=Do(r.timeZone,r._originalDate||n);if(i===0)return"Z";switch(t){case"X":return gf(i);case"XXXX":case"XX":return cr(i);case"XXXXX":case"XXX":default:return cr(i,":")}},x:function(n,t,e,r){var i=Do(r.timeZone,r._originalDate||n);switch(t){case"x":return gf(i);case"xxxx":case"xx":return cr(i);case"xxxxx":case"xxx":default:return cr(i,":")}},O:function(n,t,e,r){var i=Do(r.timeZone,r._originalDate||n);switch(t){case"O":case"OO":case"OOO":return"GMT"+D_(i,":");case"OOOO":default:return"GMT"+cr(i,":")}},z:function(n,t,e,r){var i=r._originalDate||n;switch(t){case"z":case"zz":case"zzz":return cf("short",i,r);case"zzzz":default:return cf("long",i,r)}}};function Do(n,t){var e=n?To(n,t,!0)/T_:t.getTimezoneOffset();if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function ia(n,t){for(var e=n<0?"-":"",r=Math.abs(n).toString();r.length<t;)r="0"+r;return e+r}function cr(n,t){var e=t||"",r=n>0?"-":"+",i=Math.abs(n),a=ia(Math.floor(i/60),2),s=ia(Math.floor(i%60),2);return r+a+e+s}function gf(n,t){if(n%60===0){var e=n>0?"-":"+";return e+ia(Math.abs(n)/60,2)}return cr(n,t)}function D_(n,t){var e=n>0?"-":"+",r=Math.abs(n),i=Math.floor(r/60),a=r%60;if(a===0)return e+String(i);var s=t||"";return e+String(i)+s+ia(a,2)}const C_=M_;var k_=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Co=36e5,pf=6e4,S_=2,oe={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:k_};function mf(n,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);var e=t||{},r=e.additionalDigits==null?S_:Lw(e.additionalDigits);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(!(typeof n=="string"||Object.prototype.toString.call(n)==="[object String]"))return new Date(NaN);var i=O_(n),a=P_(i.date,r),s=a.year,o=a.restDateString,l=E_(o,s);if(isNaN(l))return new Date(NaN);if(l){var c=l.getTime(),u=0,d;if(i.time&&(u=A_(i.time),isNaN(u)))return new Date(NaN);if(i.timeZone||e.timeZone){if(d=To(i.timeZone||e.timeZone,new Date(c+u)),isNaN(d))return new Date(NaN)}else d=lf(new Date(c+u)),d=lf(new Date(c+u+d));return new Date(c+u+d)}else return new Date(NaN)}function O_(n){var t={},e=oe.dateTimePattern.exec(n),r;if(e?(t.date=e[1],r=e[3]):(e=oe.datePattern.exec(n),e?(t.date=e[1],r=e[2]):(t.date=null,r=n)),r){var i=oe.timeZone.exec(r);i?(t.time=r.replace(i[1],""),t.timeZone=i[1].trim()):t.time=r}return t}function P_(n,t){var e=oe.YYY[t],r=oe.YYYYY[t],i;if(i=oe.YYYY.exec(n)||r.exec(n),i){var a=i[1];return{year:parseInt(a,10),restDateString:n.slice(a.length)}}if(i=oe.YY.exec(n)||e.exec(n),i){var s=i[1];return{year:parseInt(s,10)*100,restDateString:n.slice(s.length)}}return{year:null}}function E_(n,t){if(t===null)return null;var e,r,i,a;if(n.length===0)return r=new Date(0),r.setUTCFullYear(t),r;if(e=oe.MM.exec(n),e)return r=new Date(0),i=parseInt(e[1],10)-1,vf(t,i)?(r.setUTCFullYear(t,i),r):new Date(NaN);if(e=oe.DDD.exec(n),e){r=new Date(0);var s=parseInt(e[1],10);return I_(t,s)?(r.setUTCFullYear(t,0,s),r):new Date(NaN)}if(e=oe.MMDD.exec(n),e){r=new Date(0),i=parseInt(e[1],10)-1;var o=parseInt(e[2],10);return vf(t,i,o)?(r.setUTCFullYear(t,i,o),r):new Date(NaN)}if(e=oe.Www.exec(n),e)return a=parseInt(e[1],10)-1,xf(t,a)?bf(t,a):new Date(NaN);if(e=oe.WwwD.exec(n),e){a=parseInt(e[1],10)-1;var l=parseInt(e[2],10)-1;return xf(t,a,l)?bf(t,a,l):new Date(NaN)}return null}function A_(n){var t,e,r;if(t=oe.HH.exec(n),t)return e=parseFloat(t[1].replace(",",".")),ko(e)?e%24*Co:NaN;if(t=oe.HHMM.exec(n),t)return e=parseInt(t[1],10),r=parseFloat(t[2].replace(",",".")),ko(e,r)?e%24*Co+r*pf:NaN;if(t=oe.HHMMSS.exec(n),t){e=parseInt(t[1],10),r=parseInt(t[2],10);var i=parseFloat(t[3].replace(",","."));return ko(e,r,i)?e%24*Co+r*pf+i*1e3:NaN}return null}function bf(n,t,e){t=t||0,e=e||0;var r=new Date(0);r.setUTCFullYear(n,0,4);var i=r.getUTCDay()||7,a=t*7+e+1-i;return r.setUTCDate(r.getUTCDate()+a),r}var R_=[31,28,31,30,31,30,31,31,30,31,30,31],L_=[31,29,31,30,31,30,31,31,30,31,30,31];function yf(n){return n%400===0||n%4===0&&n%100!==0}function vf(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;var r=yf(n);if(r&&e>L_[t]||!r&&e>R_[t])return!1}return!0}function I_(n,t){if(t<1)return!1;var e=yf(n);return!(e&&t>366||!e&&t>365)}function xf(n,t,e){return!(t<0||t>52||e!=null&&(e<0||e>6))}function ko(n,t,e){return!(n!=null&&(n<0||n>=25)||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}var N_=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function So(n,t,e){var r=String(t),i=e||{},a=r.match(N_);if(a){var s=mf(n,i);r=a.reduce(function(o,l){if(l[0]==="'")return o;var c=o.indexOf(l),u=o[c-1]==="'",d=o.replace(l,"'"+C_[l[0]](s,l,null,i)+"'");return u?d.substring(0,c-1)+d.substring(c+1):d},r)}return u_(n,r,i)}var Oo={exports:{}},Po={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r,i){if(r==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a]);return r}n.exports=t.default})(Po,Po.exports);var F_=Po.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var r=e(F_);function i(a){return(0,r.default)({},a)}n.exports=t.default})(Oo,Oo.exports);var B_=Oo.exports;const U_=Wn(B_);function W_(n,t,e){var r=mf(n,e),i=To(t,r,!0),a=new Date(r.getTime()-i),s=new Date(0);return s.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),s.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),s}function Y_(n,t,e,r){var i=U_(r);return i.timeZone=t,So(W_(n,t),e,i)}const wf=2,_f=10,Tf=12,aa=new Intl.NumberFormat(((sg=document==null?void 0:document.documentElement)==null?void 0:sg.lang)||"en-US");function sa(n,t={}){if(!n)return n;const e=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let r="MMM dd, YYY hh:mm a";t.short&&(r="MMM dd, YYY"),t.includeTZ&&(r+=" (z)");const i=new Date(n);return Y_(i,e,r)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const oa=10,Mf={"1XXCount|1XX|1[0-9][0-9]":{solid:"#0072E5",light:"#4DA6FF",description:"Informational"},"SuccessfulRequests|2XXCount|2XX|2[0-9][0-9]|SUCCESS":{solid:"#0BB652",light:"#6FCC83",description:"Success"},"3XXCount|3XX|3[0-9][0-9]":{solid:"#FDC53B",light:"#FFD982",description:"Redirection"},"4XXCount|4XX|4[0-9][0-9]":{solid:"#FE9439",light:"#FFBA81",description:"Client Errors"},"5XXCount|5XX|5[0-9][0-9]":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},"errorCount|FailedRequests|FAILURE":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},nonStandard:{solid:"#6f7787",light:"#e7e7ec"},standard:{solid:"#1155cb",light:"#8ab3fa"},p99:{solid:"#1356cb",light:"#1356cb"},p95:{solid:"#1fbecd",light:"#1fbecd"},p50:{solid:"#1df97d",light:"#1df97d"},LatencyP99:{solid:"#1356cb",light:"#1356cb"},LatencyP95:{solid:"#1fbecd",light:"#1fbecd"},LatencyP50:{solid:"#1df97d",light:"#1df97d"}},Ce=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],ur=(n,t)=>(t||Ce)[n%Ce.length],ii=(n,t)=>{n[0]==="#"&&(n=n.slice(1));let e=parseInt(n.substring(0,2),16),r=parseInt(n.substring(2,4),16),i=parseInt(n.substring(4,6),16);e=e-t,r=r-t,i=i-t,e>255?e=255:e<0&&(e=0),r>255?r=255:r<0&&(r=0),i>255?i=255:i<0&&(i=0);const a=e.toString(16).length===1?"0"+e.toString(16):e.toString(16),s=r.toString(16).length===1?"0"+r.toString(16):r.toString(16),o=i.toString(16).length===1?"0"+i.toString(16):i.toString(16);return`#${a}${s}${o}`},Df="#6f7787",Cf={100:{background:"#f0f5fd",text:"#10599e"},200:{background:"#e5f7f4",text:"#1b6955"},300:{background:"#fff1d5",text:"#a06027"},400:{background:"#fee3b6",text:"#944d19"},500:{background:"#fedada",text:"#852021"}},H_=n=>{var e;const t=Math.floor(parseInt(n,10)/100)*100;return((e=Cf[t])==null?void 0:e.background)||"#fafafa"},z_={SUCCESS:"#6FCC83",FAILURE:"#FF8484"},$_={"4XX":"#FFBA81","5XX":"#FF8484"},j_={LatencyP99:"#1356cb",LatencyP95:"#1fbecd",LatencyP50:"#1df97d"},V_="#dad4c7",q_=n=>{const t=Object.entries(Mf).find(([e])=>new RegExp(e).test(n));return t&&t[1]||Mf.standard},X_={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},G_=2,K_=0,Eo=new Map,Ao=(n,t)=>t==="bytes"?Cs(n):t==="count/minute"?n.toFixed(2):aa.format(n),kf=n=>{const e=document.createElement("canvas").getContext("2d"),r=Rt({});return e.font=r.string,e.measureText(n).width},Q_=()=>{const n="label_height";if(!Eo.has(n)){const t=Rt({});Eo.set(n,t.lineHeight)}return Eo.get(n)},Z_=n=>n.datasets.reduce((t,e)=>t+e.data.reduce((r,i)=>isNaN(i)?r:r+i,0),0),Sf=(n,t)=>t.datasets.reduce((e,r,i)=>n.isDatasetVisible(i)?e+r.data.reduce((a,s)=>isNaN(s)?a:a+s,0):e,0),Of=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`;function J_(n){const t={enabled:!1,position:"barChartTooltipPosition",callbacks:{label:i=>({label:i.dataset.label,value:i.label})}};Vi.positioners.barChartTooltipPosition=function(i,a){if(!i.length)return!1;const s=this.chart.canvas.getBoundingClientRect(),o=n.tooltipState.width||this.width,l=s.width/2,c=Bs(a,o,l),u=a.y,d=a.x<l?"left":"center";return{x:c-n.tooltipState.offsetX,y:u-n.tooltipState.offsetY,xAlign:d}},ls.modes.customInteractionMode=function(i,a){const s=pn(a,i),o=[];return ls.evaluateInteractionItems(i,i.options.indexAxis||"x",s,(l,c,u)=>{i.options.indexAxis==="y"&&l.inYRange(s.y,!0)&&i.data.datasets[c].data[u]&&o.push({element:l,datasetIndex:c,index:u}),i.options.indexAxis==="x"&&l.inXRange(s.x,!0)&&i.data.datasets[c].data[u]&&o.push({element:l,datasetIndex:c,index:u})}),o};const e=n.numLabels.value>25?_f:Tf;return h.computed(()=>{var i,a,s,o,l,c,u,d;return{indexAxis:n.indexAxis,skipNull:!0,scales:{x:{border:{display:!1},stacked:n.stacked.value,grid:{display:!1,drawBorder:!1},ticks:{maxRotation:90,autoSkip:!1,font:e,callback:function(f,g){const v=this;if(v.chart.options.indexAxis===v.axis){f=v.getLabelForValue(g);const x=10;return f&&f.length>x?f.slice(0,x)+"...":f}return v.getLabelForValue(Number(f))}},title:{display:n.indexAxis==="y"?!at((i=n.metricAxesTitle)==null?void 0:i.value):!at((a=n.dimensionAxesTitle)==null?void 0:a.value),text:n.indexAxis==="y"?(s=n.metricAxesTitle)==null?void 0:s.value:(o=n.dimensionAxesTitle)==null?void 0:o.value,padding:{top:20},font:{weight:"bold"}}},y:{border:{display:!1},stacked:n.stacked.value,beginAtZero:!0,grid:{display:!1,drawBorder:!1},ticks:{font:e,callback:function(f,g){const v=this;return v.chart.options.indexAxis===v.axis?(f=v.getLabelForValue(g),f&&f.length>oa?f.slice(0,oa)+"...":f):v.getLabelForValue(Number(f))}},title:{display:n.indexAxis==="x"?!at((l=n.metricAxesTitle)==null?void 0:l.value):!at((c=n.dimensionAxesTitle)==null?void 0:c.value),text:n.indexAxis==="x"?(u=n.metricAxesTitle)==null?void 0:u.value:(d=n.dimensionAxesTitle)==null?void 0:d.value,padding:{bottom:20},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:f=>{Fs(n.tooltipState,f)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1}})}De.register(..._y);const t1=(n,t)=>{const e=t.datasets.map(i=>i.label),r=n.datasets.map(i=>i.label);return n.datasets.length===t.datasets.length&&e.every((i,a)=>i===r[a])};function e1(n,t,e,r,i){const a=h.shallowRef(null),s=(o,l)=>{if(t.value)return new De(t.value,{type:n,data:o,plugins:r,options:l})};return h.onMounted(()=>{a.value=s(e.value,i.value)}),h.onBeforeUnmount(()=>{at(a.value)||a.value.destroy()}),h.watch(e,(o,l)=>{if(t1(l,o)&&!at(a.value)){for(const[c,u]of o.datasets.entries())Object.assign(a.value.data.datasets[c],u);a.value.data.labels=o.labels,a.value.update()}else at(a.value)||a.value.destroy(),a.value=s(o,i.value)}),h.watch(t,()=>{at(a.value)||a.value.destroy(),a.value=s(e.value,i.value)}),h.watch(i,(o,l)=>{(o.indexAxis!==l.indexAxis||JSON.stringify(o.scales.x.title)!==JSON.stringify(l.scales.x.title)||JSON.stringify(o.scales.y.title)!==JSON.stringify(l.scales.y.title))&&(at(a.value)||a.value.destroy(),a.value=s(e.value,o))}),a}var Pf={exports:{}};(function(n){(function(){function t(c,u){if(u.separator===!1||c<1e3)return c.toString();var d=typeof u.separator=="string"?u.separator:",",f=[],g=Math.round(c).toString().split("");return g.reverse().forEach(function(v,x){x&&x%3===0&&f.push(d),f.push(v)}),f.reverse().join("")}function e(c,u,d){var f=c/u,g=d.round?"round":"floor";return d.decimal===!1?(c=Math[g](f),c.toString()):(d.precision?c=f:c=f<10?Math[g](f*10)/10:Math[g](f),c=c.toString(),typeof d.decimal=="string"&&(c=c.replace(".",d.decimal)),c)}var r=1e3,i=1e4,a=1e6,s=1e9,o=1e12;function l(c,u){var d;u=u||{};var f=c<0;f&&(c=Math.abs(c)),u.precision&&(c=parseFloat(c.toPrecision(u.precision)));var g=u.min10k?i:r;return c<g||u.precision&&u.precision>Math.log10(c)?d=t(e(c,1,u),u):c<a?d=e(c,r,u)+"k":c<s?d=e(c,a,u)+"m":c<o?d=t(e(c,s,u),u)+"b":d=t(e(c,o,u),u)+"t",f&&(d="-"+d),u.capital&&(d=d.toUpperCase()),u.prefix&&(d=u.prefix+d),u.suffix&&(d=d+u.suffix),d}l.addCommas=t,n.exports=l})()})(Pf);var n1=Pf.exports;const ai=Wn(n1);function r1(n,t,e){const{i18n:r}=kt.useI18n(),{translateUnit:i}=kt.useTranslatedUnits();return{legendValues:h.computed(()=>n.value.datasets.reduce((s,o)=>{const l=o.total?o.total:o.data.reduce((u,d)=>u+(typeof d=="number"?Number(d)||0:Number(d&&d.y)||0),0);let c;if(e.value==="bytes")c=isNaN(l)?"0":Cs(l);else{const u=i(e.value,l);c=r&&r.t("legend.datapointValueDisplay",{value:ai(l,{capital:!0}),unit:u})||`${ai(l,{capital:!0})} ${e.value}`}return{...s,[o.label]:{raw:l,formatted:c}}},{}))}}function i1(n){return h.computed(()=>{var i;if(!((i=n.value)!=null&&i.meta))return"";const e=n.value.meta.start_ms,r=n.value.meta.end_ms;return e&&r?`${sa(e)} - ${sa(r,{includeTZ:!0})}`:""})}function a1(n){const t={enabled:!1,position:"doughnutChartTooltipPosition",callbacks:{label:r=>({label:r.dataset.label,value:r.label})}};return Vi.positioners.doughnutChartTooltipPosition=function(r,i){if(!r.length)return!1;const a=this.chart.canvas.getBoundingClientRect(),s=n.tooltipState.width||this.width,o=a.width/2,l=Bs(i,s,o),c=i.y,u=i.x<o?"left":"center";return{x:l-n.tooltipState.offsetX,y:c,xAlign:u}},{options:h.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:r=>{Fs(n.tooltipState,r)}}}}))}}var s1=Object.defineProperty,o1=(n,t,e)=>t in n?s1(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,He=(n,t,e)=>(o1(n,typeof t!="symbol"?t+"":t,e),e),lt=(n=>(n.SECONDLY="Secondly",n.MINUTELY="Minutely",n.HOURLY="Hourly",n.DAILY="Daily",n.WEEKLY="Weekly",n))(lt||{}),zt=(n=>(n.FIFTEEN_MIN="15m",n.ONE_HOUR="1h",n.SIX_HOUR="6h",n.TWELVE_HOUR="12h",n.ONE_DAY="24h",n.SEVEN_DAY="7d",n.THIRTY_DAY="30d",n.CURRENT_WEEK="current_week",n.CURRENT_MONTH="current_month",n.CURRENT_QUARTER="current_quarter",n.PREVIOUS_WEEK="previous_week",n.PREVIOUS_MONTH="previous_month",n.PREVIOUS_QUARTER="previous_quarter",n))(zt||{});function Ro(n){"@babel/helpers - typeof";return Ro=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ro(n)}function la(n){if(n===null||n===!0||n===!1)return NaN;var t=Number(n);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function ze(n,t){if(t.length<n)throw new TypeError(n+" argument"+(n>1?"s":"")+" required, but only "+t.length+" present")}function dr(n){ze(1,arguments);var t=Object.prototype.toString.call(n);return n instanceof Date||Ro(n)==="object"&&t==="[object Date]"?new Date(n.getTime()):typeof n=="number"||t==="[object Number]"?new Date(n):((typeof n=="string"||t==="[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 Ef(n,t){ze(2,arguments);var e=dr(n),r=la(t);return isNaN(r)?new Date(NaN):(r&&e.setDate(e.getDate()+r),e)}function l1(n,t){ze(2,arguments);var e=dr(n),r=la(t);if(isNaN(r))return new Date(NaN);if(!r)return e;var i=e.getDate(),a=new Date(e.getTime());a.setMonth(e.getMonth()+r+1,0);var s=a.getDate();return i>=s?a:(e.setFullYear(a.getFullYear(),a.getMonth(),i),e)}var c1={};function u1(){return c1}function ca(n,t){var e,r,i,a,s,o,l,c;ze(1,arguments);var u=u1(),d=la((e=(r=(i=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&i!==void 0?i: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&&e!==void 0?e:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=dr(n),g=f.getDay(),v=(g<d?7:0)+g-d;return f.setDate(f.getDate()-v),f.setHours(0,0,0,0),f}function Af(n){ze(1,arguments);var t=dr(n);return t.setHours(0,0,0,0),t}var d1=60,f1=3600;function fr(n){ze(1,arguments);var t=dr(n);return t.setDate(1),t.setHours(0,0,0,0),t}function h1(n){ze(1,arguments);var t=dr(n),e=t.getFullYear(),r=t.getMonth(),i=new Date(0);return i.setFullYear(e,r+1,0),i.setHours(0,0,0,0),i.getDate()}function g1(n){return ze(1,arguments),Math.floor(n*f1)}function p1(n){ze(1,arguments);var t=n/d1;return Math.floor(t)}function Rf(n,t){ze(2,arguments);var e=la(t);return l1(n,-e)}function Lo(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Lf={exports:{}},If={exports:{}};(function(n){function t(e){return e&&e.__esModule?e:{default:e}}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(If);var $t=If.exports,Io={exports:{}},No={exports:{}},Nf={exports:{}};(function(n){function t(e){"@babel/helpers - typeof";return n.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},n.exports.__esModule=!0,n.exports.default=n.exports,t(e)}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(Nf);var Ff=Nf.exports,Fo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r,i){if(i.length<r)throw new TypeError(r+" argument"+(r>1?"s":"")+" required, but only "+i.length+" present")}n.exports=t.default})(Fo,Fo.exports);var le=Fo.exports;(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var r=e(Ff),i=e(le);function a(s){return(0,i.default)(1,arguments),s instanceof Date||(0,r.default)(s)==="object"&&Object.prototype.toString.call(s)==="[object Date]"}n.exports=t.default})(No,No.exports);var m1=No.exports,Bo={exports:{}};(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var r=e(Ff),i=e(le);function a(s){(0,i.default)(1,arguments);var o=Object.prototype.toString.call(s);return s instanceof Date||(0,r.default)(s)==="object"&&o==="[object Date]"?new Date(s.getTime()):typeof s=="number"||o==="[object Number]"?new Date(s):((typeof s=="string"||o==="[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))}n.exports=t.default})(Bo,Bo.exports);var $e=Bo.exports;(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e(m1),i=e($e),a=e(le);function s(o){if((0,a.default)(1,arguments),!(0,r.default)(o)&&typeof o!="number")return!1;var l=(0,i.default)(o);return!isNaN(Number(l))}n.exports=t.default})(Io,Io.exports);var b1=Io.exports,Uo={exports:{}},Wo={exports:{}},Yo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r){if(r===null||r===!0||r===!1)return NaN;var i=Number(r);return isNaN(i)?i:i<0?Math.ceil(i):Math.floor(i)}n.exports=t.default})(Yo,Yo.exports);var zn=Yo.exports;const y1=Lo(zn);(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e(zn),i=e($e),a=e(le);function s(o,l){(0,a.default)(2,arguments);var c=(0,i.default)(o).getTime(),u=(0,r.default)(l);return new Date(c+u)}n.exports=t.default})(Wo,Wo.exports);var v1=Wo.exports;(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e(v1),i=e(le),a=e(zn);function s(o,l){(0,i.default)(2,arguments);var c=(0,a.default)(l);return(0,r.default)(o,-c)}n.exports=t.default})(Uo,Uo.exports);var x1=Uo.exports,Ho={exports:{}},zo={exports:{}};(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e($e),i=e(le),a=864e5;function s(o){(0,i.default)(1,arguments);var l=(0,r.default)(o),c=l.getTime();l.setUTCMonth(0,1),l.setUTCHours(0,0,0,0);var u=l.getTime(),d=c-u;return Math.floor(d/a)+1}n.exports=t.default})(zo,zo.exports);var w1=zo.exports,$o={exports:{}},jo={exports:{}};(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var r=e($e),i=e(le);function a(s){(0,i.default)(1,arguments);var o=1,l=(0,r.default)(s),c=l.getUTCDay(),u=(c<o?7:0)+c-o;return l.setUTCDate(l.getUTCDate()-u),l.setUTCHours(0,0,0,0),l}n.exports=t.default})(jo,jo.exports);var Vo=jo.exports,qo={exports:{}},Xo={exports:{}};(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e($e),i=e(le),a=e(Vo);function s(o){(0,i.default)(1,arguments);var l=(0,r.default)(o),c=l.getUTCFullYear(),u=new Date(0);u.setUTCFullYear(c+1,0,4),u.setUTCHours(0,0,0,0);var d=(0,a.default)(u),f=new Date(0);f.setUTCFullYear(c,0,4),f.setUTCHours(0,0,0,0);var g=(0,a.default)(f);return l.getTime()>=d.getTime()?c+1:l.getTime()>=g.getTime()?c:c-1}n.exports=t.default})(Xo,Xo.exports);var Bf=Xo.exports;(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e(Bf),i=e(Vo),a=e(le);function s(o){(0,a.default)(1,arguments);var l=(0,r.default)(o),c=new Date(0);c.setUTCFullYear(l,0,4),c.setUTCHours(0,0,0,0);var u=(0,i.default)(c);return u}n.exports=t.default})(qo,qo.exports);var _1=qo.exports;(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var r=e($e),i=e(Vo),a=e(_1),s=e(le),o=6048e5;function l(c){(0,s.default)(1,arguments);var u=(0,r.default)(c),d=(0,i.default)(u).getTime()-(0,a.default)(u).getTime();return Math.round(d/o)+1}n.exports=t.default})($o,$o.exports);var T1=$o.exports,Go={exports:{}},Ko={exports:{}},$n={};Object.defineProperty($n,"__esModule",{value:!0}),$n.getDefaultOptions=M1,$n.setDefaultOptions=D1;var Uf={};function M1(){return Uf}function D1(n){Uf=n}(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var r=e($e),i=e(le),a=e(zn),s=$n;function o(l,c){var u,d,f,g,v,x,p,b;(0,i.default)(1,arguments);var m=(0,s.getDefaultOptions)(),y=(0,a.default)((u=(d=(f=(g=c==null?void 0:c.weekStartsOn)!==null&&g!==void 0?g:c==null||(v=c.locale)===null||v===void 0||(x=v.options)===null||x===void 0?void 0:x.weekStartsOn)!==null&&f!==void 0?f:m.weekStartsOn)!==null&&d!==void 0?d:(p=m.locale)===null||p===void 0||(b=p.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&u!==void 0?u:0);if(!(y>=0&&y<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var w=(0,r.default)(l),T=w.getUTCDay(),S=(T<y?7:0)+T-y;return w.setUTCDate(w.getUTCDate()-S),w.setUTCHours(0,0,0,0),w}n.exports=t.default})(Ko,Ko.exports);var Qo=Ko.exports,Zo={exports:{}},Jo={exports:{}};(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var r=e($e),i=e(le),a=e(Qo),s=e(zn),o=$n;function l(c,u){var d,f,g,v,x,p,b,m;(0,i.default)(1,arguments);var y=(0,r.default)(c),w=y.getUTCFullYear(),T=(0,o.getDefaultOptions)(),S=(0,s.default)((d=(f=(g=(v=u==null?void 0:u.firstWeekContainsDate)!==null&&v!==void 0?v:u==null||(x=u.locale)===null||x===void 0||(p=x.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&g!==void 0?g:T.firstWeekContainsDate)!==null&&f!==void 0?f:(b=T.locale)===null||b===void 0||(m=b.options)===null||m===void 0?void 0:m.firstWeekContainsDate)!==null&&d!==void 0?d:1);if(!(S>=1&&S<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var k=new Date(0);k.setUTCFullYear(w+1,0,S),k.setUTCHours(0,0,0,0);var M=(0,a.default)(k,u),D=new Date(0);D.setUTCFullYear(w,0,S),D.setUTCHours(0,0,0,0);var O=(0,a.default)(D,u);return y.getTime()>=M.getTime()?w+1:y.getTime()>=O.getTime()?w:w-1}n.exports=t.default})(Jo,Jo.exports);var Wf=Jo.exports;(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var r=e(Wf),i=e(le),a=e(Qo),s=e(zn),o=$n;function l(c,u){var d,f,g,v,x,p,b,m;(0,i.default)(1,arguments);var y=(0,o.getDefaultOptions)(),w=(0,s.default)((d=(f=(g=(v=u==null?void 0:u.firstWeekContainsDate)!==null&&v!==void 0?v:u==null||(x=u.locale)===null||x===void 0||(p=x.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&g!==void 0?g:y.firstWeekContainsDate)!==null&&f!==void 0?f:(b=y.locale)===null||b===void 0||(m=b.options)===null||m===void 0?void 0:m.firstWeekContainsDate)!==null&&d!==void 0?d:1),T=(0,r.default)(c,u),S=new Date(0);S.setUTCFullYear(T,0,w),S.setUTCHours(0,0,0,0);var k=(0,a.default)(S,u);return k}n.exports=t.default})(Zo,Zo.exports);var C1=Zo.exports;(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var r=e($e),i=e(Qo),a=e(C1),s=e(le),o=6048e5;function l(c,u){(0,s.default)(1,arguments);var d=(0,r.default)(c),f=(0,i.default)(d,u).getTime()-(0,a.default)(d,u).getTime();return Math.round(f/o)+1}n.exports=t.default})(Go,Go.exports);var k1=Go.exports,tl={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r,i){for(var a=r<0?"-":"",s=Math.abs(r).toString();s.length<i;)s="0"+s;return a+s}n.exports=t.default})(tl,tl.exports);var Yf=tl.exports,el={exports:{}};(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(Yf),i={y:function(s,o){var l=s.getUTCFullYear(),c=l>0?l:1-l;return(0,r.default)(o==="yy"?c%100:c,o.length)},M:function(s,o){var l=s.getUTCMonth();return o==="M"?String(l+1):(0,r.default)(l+1,2)},d:function(s,o){return(0,r.default)(s.getUTCDate(),o.length)},a:function(s,o){var l=s.getUTCHours()/12>=1?"pm":"am";switch(o){case"a":case"aa":return l.toUpperCase();case"aaa":return l;case"aaaaa":return l[0];case"aaaa":default:return l==="am"?"a.m.":"p.m."}},h:function(s,o){return(0,r.default)(s.getUTCHours()%12||12,o.length)},H:function(s,o){return(0,r.default)(s.getUTCHours(),o.length)},m:function(s,o){return(0,r.default)(s.getUTCMinutes(),o.length)},s:function(s,o){return(0,r.default)(s.getUTCSeconds(),o.length)},S:function(s,o){var l=o.length,c=s.getUTCMilliseconds(),u=Math.floor(c*Math.pow(10,l-3));return(0,r.default)(u,o.length)}},a=i;t.default=a,n.exports=t.default})(el,el.exports);var S1=el.exports;(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(w1),i=e(T1),a=e(Bf),s=e(k1),o=e(Wf),l=e(Yf),c=e(S1),u={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},d={G:function(p,b,m){var y=p.getUTCFullYear()>0?1:0;switch(b){case"G":case"GG":case"GGG":return m.era(y,{width:"abbreviated"});case"GGGGG":return m.era(y,{width:"narrow"});case"GGGG":default:return m.era(y,{width:"wide"})}},y:function(p,b,m){if(b==="yo"){var y=p.getUTCFullYear(),w=y>0?y:1-y;return m.ordinalNumber(w,{unit:"year"})}return c.default.y(p,b)},Y:function(p,b,m,y){var w=(0,o.default)(p,y),T=w>0?w:1-w;if(b==="YY"){var S=T%100;return(0,l.default)(S,2)}return b==="Yo"?m.ordinalNumber(T,{unit:"year"}):(0,l.default)(T,b.length)},R:function(p,b){var m=(0,a.default)(p);return(0,l.default)(m,b.length)},u:function(p,b){var m=p.getUTCFullYear();return(0,l.default)(m,b.length)},Q:function(p,b,m){var y=Math.ceil((p.getUTCMonth()+1)/3);switch(b){case"Q":return String(y);case"QQ":return(0,l.default)(y,2);case"Qo":return m.ordinalNumber(y,{unit:"quarter"});case"QQQ":return m.quarter(y,{width:"abbreviated",context:"formatting"});case"QQQQQ":return m.quarter(y,{width:"narrow",context:"formatting"});case"QQQQ":default:return m.quarter(y,{width:"wide",context:"formatting"})}},q:function(p,b,m){var y=Math.ceil((p.getUTCMonth()+1)/3);switch(b){case"q":return String(y);case"qq":return(0,l.default)(y,2);case"qo":return m.ordinalNumber(y,{unit:"quarter"});case"qqq":return m.quarter(y,{width:"abbreviated",context:"standalone"});case"qqqqq":return m.quarter(y,{width:"narrow",context:"standalone"});case"qqqq":default:return m.quarter(y,{width:"wide",context:"standalone"})}},M:function(p,b,m){var y=p.getUTCMonth();switch(b){case"M":case"MM":return c.default.M(p,b);case"Mo":return m.ordinalNumber(y+1,{unit:"month"});case"MMM":return m.month(y,{width:"abbreviated",context:"formatting"});case"MMMMM":return m.month(y,{width:"narrow",context:"formatting"});case"MMMM":default:return m.month(y,{width:"wide",context:"formatting"})}},L:function(p,b,m){var y=p.getUTCMonth();switch(b){case"L":return String(y+1);case"LL":return(0,l.default)(y+1,2);case"Lo":return m.ordinalNumber(y+1,{unit:"month"});case"LLL":return m.month(y,{width:"abbreviated",context:"standalone"});case"LLLLL":return m.month(y,{width:"narrow",context:"standalone"});case"LLLL":default:return m.month(y,{width:"wide",context:"standalone"})}},w:function(p,b,m,y){var w=(0,s.default)(p,y);return b==="wo"?m.ordinalNumber(w,{unit:"week"}):(0,l.default)(w,b.length)},I:function(p,b,m){var y=(0,i.default)(p);return b==="Io"?m.ordinalNumber(y,{unit:"week"}):(0,l.default)(y,b.length)},d:function(p,b,m){return b==="do"?m.ordinalNumber(p.getUTCDate(),{unit:"date"}):c.default.d(p,b)},D:function(p,b,m){var y=(0,r.default)(p);return b==="Do"?m.ordinalNumber(y,{unit:"dayOfYear"}):(0,l.default)(y,b.length)},E:function(p,b,m){var y=p.getUTCDay();switch(b){case"E":case"EE":case"EEE":return m.day(y,{width:"abbreviated",context:"formatting"});case"EEEEE":return m.day(y,{width:"narrow",context:"formatting"});case"EEEEEE":return m.day(y,{width:"short",context:"formatting"});case"EEEE":default:return m.day(y,{width:"wide",context:"formatting"})}},e:function(p,b,m,y){var w=p.getUTCDay(),T=(w-y.weekStartsOn+8)%7||7;switch(b){case"e":return String(T);case"ee":return(0,l.default)(T,2);case"eo":return m.ordinalNumber(T,{unit:"day"});case"eee":return m.day(w,{width:"abbreviated",context:"formatting"});case"eeeee":return m.day(w,{width:"narrow",context:"formatting"});case"eeeeee":return m.day(w,{width:"short",context:"formatting"});case"eeee":default:return m.day(w,{width:"wide",context:"formatting"})}},c:function(p,b,m,y){var w=p.getUTCDay(),T=(w-y.weekStartsOn+8)%7||7;switch(b){case"c":return String(T);case"cc":return(0,l.default)(T,b.length);case"co":return m.ordinalNumber(T,{unit:"day"});case"ccc":return m.day(w,{width:"abbreviated",context:"standalone"});case"ccccc":return m.day(w,{width:"narrow",context:"standalone"});case"cccccc":return m.day(w,{width:"short",context:"standalone"});case"cccc":default:return m.day(w,{width:"wide",context:"standalone"})}},i:function(p,b,m){var y=p.getUTCDay(),w=y===0?7:y;switch(b){case"i":return String(w);case"ii":return(0,l.default)(w,b.length);case"io":return m.ordinalNumber(w,{unit:"day"});case"iii":return m.day(y,{width:"abbreviated",context:"formatting"});case"iiiii":return m.day(y,{width:"narrow",context:"formatting"});case"iiiiii":return m.day(y,{width:"short",context:"formatting"});case"iiii":default:return m.day(y,{width:"wide",context:"formatting"})}},a:function(p,b,m){var y=p.getUTCHours(),w=y/12>=1?"pm":"am";switch(b){case"a":case"aa":return m.dayPeriod(w,{width:"abbreviated",context:"formatting"});case"aaa":return m.dayPeriod(w,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return m.dayPeriod(w,{width:"narrow",context:"formatting"});case"aaaa":default:return m.dayPeriod(w,{width:"wide",context:"formatting"})}},b:function(p,b,m){var y=p.getUTCHours(),w;switch(y===12?w=u.noon:y===0?w=u.midnight:w=y/12>=1?"pm":"am",b){case"b":case"bb":return m.dayPeriod(w,{width:"abbreviated",context:"formatting"});case"bbb":return m.dayPeriod(w,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return m.dayPeriod(w,{width:"narrow",context:"formatting"});case"bbbb":default:return m.dayPeriod(w,{width:"wide",context:"formatting"})}},B:function(p,b,m){var y=p.getUTCHours(),w;switch(y>=17?w=u.evening:y>=12?w=u.afternoon:y>=4?w=u.morning:w=u.night,b){case"B":case"BB":case"BBB":return m.dayPeriod(w,{width:"abbreviated",context:"formatting"});case"BBBBB":return m.dayPeriod(w,{width:"narrow",context:"formatting"});case"BBBB":default:return m.dayPeriod(w,{width:"wide",context:"formatting"})}},h:function(p,b,m){if(b==="ho"){var y=p.getUTCHours()%12;return y===0&&(y=12),m.ordinalNumber(y,{unit:"hour"})}return c.default.h(p,b)},H:function(p,b,m){return b==="Ho"?m.ordinalNumber(p.getUTCHours(),{unit:"hour"}):c.default.H(p,b)},K:function(p,b,m){var y=p.getUTCHours()%12;return b==="Ko"?m.ordinalNumber(y,{unit:"hour"}):(0,l.default)(y,b.length)},k:function(p,b,m){var y=p.getUTCHours();return y===0&&(y=24),b==="ko"?m.ordinalNumber(y,{unit:"hour"}):(0,l.default)(y,b.length)},m:function(p,b,m){return b==="mo"?m.ordinalNumber(p.getUTCMinutes(),{unit:"minute"}):c.default.m(p,b)},s:function(p,b,m){return b==="so"?m.ordinalNumber(p.getUTCSeconds(),{unit:"second"}):c.default.s(p,b)},S:function(p,b){return c.default.S(p,b)},X:function(p,b,m,y){var w=y._originalDate||p,T=w.getTimezoneOffset();if(T===0)return"Z";switch(b){case"X":return g(T);case"XXXX":case"XX":return v(T);case"XXXXX":case"XXX":default:return v(T,":")}},x:function(p,b,m,y){var w=y._originalDate||p,T=w.getTimezoneOffset();switch(b){case"x":return g(T);case"xxxx":case"xx":return v(T);case"xxxxx":case"xxx":default:return v(T,":")}},O:function(p,b,m,y){var w=y._originalDate||p,T=w.getTimezoneOffset();switch(b){case"O":case"OO":case"OOO":return"GMT"+f(T,":");case"OOOO":default:return"GMT"+v(T,":")}},z:function(p,b,m,y){var w=y._originalDate||p,T=w.getTimezoneOffset();switch(b){case"z":case"zz":case"zzz":return"GMT"+f(T,":");case"zzzz":default:return"GMT"+v(T,":")}},t:function(p,b,m,y){var w=y._originalDate||p,T=Math.floor(w.getTime()/1e3);return(0,l.default)(T,b.length)},T:function(p,b,m,y){var w=y._originalDate||p,T=w.getTime();return(0,l.default)(T,b.length)}};function f(p,b){var m=p>0?"-":"+",y=Math.abs(p),w=Math.floor(y/60),T=y%60;if(T===0)return m+String(w);var S=b||"";return m+String(w)+S+(0,l.default)(T,2)}function g(p,b){if(p%60===0){var m=p>0?"-":"+";return m+(0,l.default)(Math.abs(p)/60,2)}return v(p,b)}function v(p,b){var m=b||"",y=p>0?"-":"+",w=Math.abs(p),T=(0,l.default)(Math.floor(w/60),2),S=(0,l.default)(w%60,2);return y+T+m+S}var x=d;t.default=x,n.exports=t.default})(Ho,Ho.exports);var O1=Ho.exports,nl={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(o,l){switch(o){case"P":return l.date({width:"short"});case"PP":return l.date({width:"medium"});case"PPP":return l.date({width:"long"});case"PPPP":default:return l.date({width:"full"})}},r=function(o,l){switch(o){case"p":return l.time({width:"short"});case"pp":return l.time({width:"medium"});case"ppp":return l.time({width:"long"});case"pppp":default:return l.time({width:"full"})}},i=function(o,l){var c=o.match(/(P+)(p+)?/)||[],u=c[1],d=c[2];if(!d)return e(o,l);var f;switch(u){case"P":f=l.dateTime({width:"short"});break;case"PP":f=l.dateTime({width:"medium"});break;case"PPP":f=l.dateTime({width:"long"});break;case"PPPP":default:f=l.dateTime({width:"full"});break}return f.replace("{{date}}",e(u,l)).replace("{{time}}",r(d,l))},a={p:r,P:i},s=a;t.default=s,n.exports=t.default})(nl,nl.exports);var P1=nl.exports,rl={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r){var i=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return i.setUTCFullYear(r.getFullYear()),r.getTime()-i.getTime()}n.exports=t.default})(rl,rl.exports);var Hf=rl.exports;const zf=Lo(Hf);var si={};Object.defineProperty(si,"__esModule",{value:!0}),si.isProtectedDayOfYearToken=R1,si.isProtectedWeekYearToken=L1,si.throwProtectedError=I1;var E1=["D","DD"],A1=["YY","YYYY"];function R1(n){return E1.indexOf(n)!==-1}function L1(n){return A1.indexOf(n)!==-1}function I1(n,t,e){if(n==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var il={exports:{}},al={exports:{}},sl={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e={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"}},r=function(a,s,o){var l,c=e[a];return typeof c=="string"?l=c:s===1?l=c.one:l=c.other.replace("{{count}}",s.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"in "+l:l+" ago":l},i=r;t.default=i,n.exports=t.default})(sl,sl.exports);var N1=sl.exports,ol={exports:{}},ll={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r){return function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=i.width?String(i.width):r.defaultWidth,s=r.formats[a]||r.formats[r.defaultWidth];return s}}n.exports=t.default})(ll,ll.exports);var F1=ll.exports;(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(F1),i={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},a={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},s={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},o={date:(0,r.default)({formats:i,defaultWidth:"full"}),time:(0,r.default)({formats:a,defaultWidth:"full"}),dateTime:(0,r.default)({formats:s,defaultWidth:"full"})},l=o;t.default=l,n.exports=t.default})(ol,ol.exports);var B1=ol.exports,cl={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},r=function(a,s,o,l){return e[a]},i=r;t.default=i,n.exports=t.default})(cl,cl.exports);var U1=cl.exports,ul={exports:{}},dl={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r){return function(i,a){var s=a!=null&&a.context?String(a.context):"standalone",o;if(s==="formatting"&&r.formattingValues){var l=r.defaultFormattingWidth||r.defaultWidth,c=a!=null&&a.width?String(a.width):l;o=r.formattingValues[c]||r.formattingValues[l]}else{var u=r.defaultWidth,d=a!=null&&a.width?String(a.width):r.defaultWidth;o=r.values[d]||r.values[u]}var f=r.argumentCallback?r.argumentCallback(i):i;return o[f]}}n.exports=t.default})(dl,dl.exports);var W1=dl.exports;(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(W1),i={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},a={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},s={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"]},o={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"]},l={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"}},c={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"}},u=function(g,v){var x=Number(g),p=x%100;if(p>20||p<10)switch(p%10){case 1:return x+"st";case 2:return x+"nd";case 3:return x+"rd"}return x+"th"},d={ordinalNumber:u,era:(0,r.default)({values:i,defaultWidth:"wide"}),quarter:(0,r.default)({values:a,defaultWidth:"wide",argumentCallback:function(g){return g-1}}),month:(0,r.default)({values:s,defaultWidth:"wide"}),day:(0,r.default)({values:o,defaultWidth:"wide"}),dayPeriod:(0,r.default)({values:l,defaultWidth:"wide",formattingValues:c,defaultFormattingWidth:"wide"})},f=d;t.default=f,n.exports=t.default})(ul,ul.exports);var Y1=ul.exports,fl={exports:{}},hl={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(a){return function(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=o.width,c=l&&a.matchPatterns[l]||a.matchPatterns[a.defaultMatchWidth],u=s.match(c);if(!u)return null;var d=u[0],f=l&&a.parsePatterns[l]||a.parsePatterns[a.defaultParseWidth],g=Array.isArray(f)?i(f,function(p){return p.test(d)}):r(f,function(p){return p.test(d)}),v;v=a.valueCallback?a.valueCallback(g):g,v=o.valueCallback?o.valueCallback(v):v;var x=s.slice(d.length);return{value:v,rest:x}}}function r(a,s){for(var o in a)if(a.hasOwnProperty(o)&&s(a[o]))return o}function i(a,s){for(var o=0;o<a.length;o++)if(s(a[o]))return o}n.exports=t.default})(hl,hl.exports);var H1=hl.exports,gl={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r){return function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=i.match(r.matchPattern);if(!s)return null;var o=s[0],l=i.match(r.parsePattern);if(!l)return null;var c=r.valueCallback?r.valueCallback(l[0]):l[0];c=a.valueCallback?a.valueCallback(c):c;var u=i.slice(o.length);return{value:c,rest:u}}}n.exports=t.default})(gl,gl.exports);var z1=gl.exports;(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(H1),i=e(z1),a=/^(\d+)(th|st|nd|rd)?/i,s=/\d+/i,o={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},l={any:[/^b/i,/^(a|c)/i]},c={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},u={any:[/1/i,/2/i,/3/i,/4/i]},d={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},f={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]},g={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},v={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]},x={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},p={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}},b={ordinalNumber:(0,i.default)({matchPattern:a,parsePattern:s,valueCallback:function(y){return parseInt(y,10)}}),era:(0,r.default)({matchPatterns:o,defaultMatchWidth:"wide",parsePatterns:l,defaultParseWidth:"any"}),quarter:(0,r.default)({matchPatterns:c,defaultMatchWidth:"wide",parsePatterns:u,defaultParseWidth:"any",valueCallback:function(y){return y+1}}),month:(0,r.default)({matchPatterns:d,defaultMatchWidth:"wide",parsePatterns:f,defaultParseWidth:"any"}),day:(0,r.default)({matchPatterns:g,defaultMatchWidth:"wide",parsePatterns:v,defaultParseWidth:"any"}),dayPeriod:(0,r.default)({matchPatterns:x,defaultMatchWidth:"any",parsePatterns:p,defaultParseWidth:"any"})},m=b;t.default=m,n.exports=t.default})(fl,fl.exports);var $1=fl.exports;(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(N1),i=e(B1),a=e(U1),s=e(Y1),o=e($1),l={code:"en-US",formatDistance:r.default,formatLong:i.default,formatRelative:a.default,localize:s.default,match:o.default,options:{weekStartsOn:0,firstWeekContainsDate:1}},c=l;t.default=c,n.exports=t.default})(al,al.exports);var j1=al.exports;(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(j1),i=r.default;t.default=i,n.exports=t.default})(il,il.exports);var V1=il.exports;(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=y;var r=e(b1),i=e(x1),a=e($e),s=e(O1),o=e(P1),l=e(Hf),c=si,u=e(zn),d=e(le),f=$n,g=e(V1),v=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,x=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,p=/^'([^]*?)'?$/,b=/''/g,m=/[a-zA-Z]/;function y(T,S,k){var M,D,O,P,A,F,q,$,H,I,it,U,yt,dt,Y,L,B,j;(0,d.default)(2,arguments);var Z=String(S),K=(0,f.getDefaultOptions)(),N=(M=(D=k==null?void 0:k.locale)!==null&&D!==void 0?D:K.locale)!==null&&M!==void 0?M:g.default,R=(0,u.default)((O=(P=(A=(F=k==null?void 0:k.firstWeekContainsDate)!==null&&F!==void 0?F:k==null||(q=k.locale)===null||q===void 0||($=q.options)===null||$===void 0?void 0:$.firstWeekContainsDate)!==null&&A!==void 0?A:K.firstWeekContainsDate)!==null&&P!==void 0?P:(H=K.locale)===null||H===void 0||(I=H.options)===null||I===void 0?void 0:I.firstWeekContainsDate)!==null&&O!==void 0?O:1);if(!(R>=1&&R<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var Q=(0,u.default)((it=(U=(yt=(dt=k==null?void 0:k.weekStartsOn)!==null&&dt!==void 0?dt:k==null||(Y=k.locale)===null||Y===void 0||(L=Y.options)===null||L===void 0?void 0:L.weekStartsOn)!==null&&yt!==void 0?yt:K.weekStartsOn)!==null&&U!==void 0?U:(B=K.locale)===null||B===void 0||(j=B.options)===null||j===void 0?void 0:j.weekStartsOn)!==null&&it!==void 0?it:0);if(!(Q>=0&&Q<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!N.localize)throw new RangeError("locale must contain localize property");if(!N.formatLong)throw new RangeError("locale must contain formatLong property");var X=(0,a.default)(T);if(!(0,r.default)(X))throw new RangeError("Invalid time value");var vt=(0,l.default)(X),ut=(0,i.default)(X,vt),Pt={firstWeekContainsDate:R,weekStartsOn:Q,locale:N,_originalDate:X},_t=Z.match(x).map(function(et){var xt=et[0];if(xt==="p"||xt==="P"){var Ft=o.default[xt];return Ft(et,N.formatLong)}return et}).join("").match(v).map(function(et){if(et==="''")return"'";var xt=et[0];if(xt==="'")return w(et);var Ft=s.default[xt];if(Ft)return!(k!=null&&k.useAdditionalWeekYearTokens)&&(0,c.isProtectedWeekYearToken)(et)&&(0,c.throwProtectedError)(et,S,String(T)),!(k!=null&&k.useAdditionalDayOfYearTokens)&&(0,c.isProtectedDayOfYearToken)(et)&&(0,c.throwProtectedError)(et,S,String(T)),Ft(ut,et,N.localize,Pt);if(xt.match(m))throw new RangeError("Format string contains an unescaped latin alphabet character `"+xt+"`");return et}).join("");return _t}function w(T){var S=T.match(p);return S?S[1].replace(b,"'"):T}n.exports=t.default})(Lf,Lf.exports);function q1(n,t){var e=Q1(t);return e.formatToParts?G1(e,n):K1(e,n)}var X1={year:0,month:1,day:2,hour:3,minute:4,second:5};function G1(n,t){try{for(var e=n.formatToParts(t),r=[],i=0;i<e.length;i++){var a=X1[e[i].type];a>=0&&(r[a]=parseInt(e[i].value,10))}return r}catch(s){if(s instanceof RangeError)return[NaN];throw s}}function K1(n,t){var e=n.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[r[3],r[1],r[2],r[4],r[5],r[6]]}var pl={};function Q1(n){if(!pl[n]){var t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:"America/New_York",year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),e=t==="06/25/2014, 00:00:00"||t==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";pl[n]=e?new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return pl[n]}function ml(n,t,e,r,i,a,s){var o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(r,i,a,s),o}var $f=36e5,Z1=6e4,bl={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-]\d{2}):?(\d{2})$/};function ua(n,t,e){var r,i;if(!n||(r=bl.timezoneZ.exec(n),r))return 0;var a;if(r=bl.timezoneHH.exec(n),r)return a=parseInt(r[1],10),jf(a)?-(a*$f):NaN;if(r=bl.timezoneHHMM.exec(n),r){a=parseInt(r[1],10);var s=parseInt(r[2],10);return jf(a,s)?(i=Math.abs(a)*$f+s*Z1,a>0?-i:i):NaN}if(eT(n)){t=new Date(t||Date.now());var o=e?t:J1(t),l=yl(o,n),c=e?l:tT(t,l,n);return-c}return NaN}function J1(n){return ml(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function yl(n,t){var e=q1(n,t),r=ml(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime(),i=n.getTime(),a=i%1e3;return i-=a>=0?a:1e3+a,r-i}function tT(n,t,e){var r=n.getTime(),i=r-t,a=yl(new Date(i),e);if(t===a)return t;i-=a-t;var s=yl(new Date(i),e);return a===s?a:Math.max(a,s)}function jf(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}var Vf={};function eT(n){if(Vf[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Vf[n]=!0,!0}catch{return!1}}var nT=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/;const qf=nT;var vl=36e5,Xf=6e4,rT=2,ce={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:qf};function xl(n,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);var e=t||{},r=e.additionalDigits==null?rT:y1(e.additionalDigits);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(!(typeof n=="string"||Object.prototype.toString.call(n)==="[object String]"))return new Date(NaN);var i=iT(n),a=aT(i.date,r),s=a.year,o=a.restDateString,l=sT(o,s);if(isNaN(l))return new Date(NaN);if(l){var c=l.getTime(),u=0,d;if(i.time&&(u=oT(i.time),isNaN(u)))return new Date(NaN);if(i.timeZone||e.timeZone){if(d=ua(i.timeZone||e.timeZone,new Date(c+u)),isNaN(d))return new Date(NaN)}else d=zf(new Date(c+u)),d=zf(new Date(c+u+d));return new Date(c+u+d)}else return new Date(NaN)}function iT(n){var t={},e=ce.dateTimePattern.exec(n),r;if(e?(t.date=e[1],r=e[3]):(e=ce.datePattern.exec(n),e?(t.date=e[1],r=e[2]):(t.date=null,r=n)),r){var i=ce.timeZone.exec(r);i?(t.time=r.replace(i[1],""),t.timeZone=i[1].trim()):t.time=r}return t}function aT(n,t){var e=ce.YYY[t],r=ce.YYYYY[t],i;if(i=ce.YYYY.exec(n)||r.exec(n),i){var a=i[1];return{year:parseInt(a,10),restDateString:n.slice(a.length)}}if(i=ce.YY.exec(n)||e.exec(n),i){var s=i[1];return{year:parseInt(s,10)*100,restDateString:n.slice(s.length)}}return{year:null}}function sT(n,t){if(t===null)return null;var e,r,i,a;if(n.length===0)return r=new Date(0),r.setUTCFullYear(t),r;if(e=ce.MM.exec(n),e)return r=new Date(0),i=parseInt(e[1],10)-1,Qf(t,i)?(r.setUTCFullYear(t,i),r):new Date(NaN);if(e=ce.DDD.exec(n),e){r=new Date(0);var s=parseInt(e[1],10);return uT(t,s)?(r.setUTCFullYear(t,0,s),r):new Date(NaN)}if(e=ce.MMDD.exec(n),e){r=new Date(0),i=parseInt(e[1],10)-1;var o=parseInt(e[2],10);return Qf(t,i,o)?(r.setUTCFullYear(t,i,o),r):new Date(NaN)}if(e=ce.Www.exec(n),e)return a=parseInt(e[1],10)-1,Zf(t,a)?Gf(t,a):new Date(NaN);if(e=ce.WwwD.exec(n),e){a=parseInt(e[1],10)-1;var l=parseInt(e[2],10)-1;return Zf(t,a,l)?Gf(t,a,l):new Date(NaN)}return null}function oT(n){var t,e,r;if(t=ce.HH.exec(n),t)return e=parseFloat(t[1].replace(",",".")),wl(e)?e%24*vl:NaN;if(t=ce.HHMM.exec(n),t)return e=parseInt(t[1],10),r=parseFloat(t[2].replace(",",".")),wl(e,r)?e%24*vl+r*Xf:NaN;if(t=ce.HHMMSS.exec(n),t){e=parseInt(t[1],10),r=parseInt(t[2],10);var i=parseFloat(t[3].replace(",","."));return wl(e,r,i)?e%24*vl+r*Xf+i*1e3:NaN}return null}function Gf(n,t,e){t=t||0,e=e||0;var r=new Date(0);r.setUTCFullYear(n,0,4);var i=r.getUTCDay()||7,a=t*7+e+1-i;return r.setUTCDate(r.getUTCDate()+a),r}var lT=[31,28,31,30,31,30,31,31,30,31,30,31],cT=[31,29,31,30,31,30,31,31,30,31,30,31];function Kf(n){return n%400===0||n%4===0&&n%100!==0}function Qf(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;var r=Kf(n);if(r&&e>cT[t]||!r&&e>lT[t])return!1}return!0}function uT(n,t){if(t<1)return!1;var e=Kf(n);return!(e&&t>366||!e&&t>365)}function Zf(n,t,e){return!(t<0||t>52||e!=null&&(e<0||e>6))}function wl(n,t,e){return!(n!=null&&(n<0||n>=25)||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}var _l={exports:{}},Tl={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r,i){if(r==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a]);return r}n.exports=t.default})(Tl,Tl.exports);var dT=Tl.exports;(function(n,t){var e=$t.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var r=e(dT);function i(a){return(0,r.default)({},a)}n.exports=t.default})(_l,_l.exports);var fT=_l.exports;const hT=Lo(fT);function gT(n,t,e){var r=xl(n,e),i=ua(t,r,!0),a=new Date(r.getTime()-i),s=new Date(0);return s.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),s.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),s}function pT(n,t){return-ua(n,t)}function mT(n,t,e){if(typeof n=="string"&&!n.match(qf)){var r=hT(e);return r.timeZone=t,xl(n,r)}var i=xl(n,e),a=ml(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds()).getTime(),s=ua(t,new Date(a));return new Date(a+s)}const bT={[lt.SECONDLY]:1e3,[lt.MINUTELY]:60*1e3,[lt.HOURLY]:60*60*1e3,[lt.DAILY]:60*60*24*1e3,[lt.WEEKLY]:60*60*24*7*1e3};function Ml(n){return n&&Object.values(lt).find(t=>n<=bT[t])||null}const hr=(n,t)=>new Date(n.getTime()-pT(t,n));class Ae{constructor(t){He(this,"timeframeText"),He(this,"key"),He(this,"display"),He(this,"timeframeLength"),He(this,"allowedTiers"),He(this,"defaultResponseGranularity"),He(this,"dataGranularity"),He(this,"isRelative"),He(this,"_startCustom"),He(this,"_endCustom"),this.display=t.display,this.timeframeText=t.timeframeText,this.key=t.key,this.timeframeLength=t.timeframeLength,this.allowedTiers=t.allowedTiers,this.defaultResponseGranularity=t.defaultResponseGranularity,this.dataGranularity=t.dataGranularity,this.isRelative=t.isRelative,this._startCustom=t.startCustom,this._endCustom=t.endCustom}rawEnd(t){return this._endCustom||new Date}rawStart(t){return this._startCustom||new Date(this.rawEnd().getTime()-this.timeframeLengthMs())}timeframeLengthMs(){return this.timeframeLength()*1e3}maximumTimeframeLength(){return this.timeframeLength()}allowedGranularities(){const t=new Set,e=this.maximumTimeframeLength()/3600;return e<=6&&t.add(lt.MINUTELY),e>=2&&e<=7*24&&t.add(lt.HOURLY),e>=2*24&&t.add(lt.DAILY),e>=2*24*14&&t.add(lt.WEEKLY),t}tzAdjustedDate(t){if(!t)return new Date;const e=mT(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return gT(e,t)}}class yT extends Ae{rawStart(t){let e=ca(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=hr(e,t)),e}maximumTimeframeLength(){return 60*60*24*7}}class vT extends Ae{rawStart(t){let e=fr(this.tzAdjustedDate(t));return t&&(e=hr(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class xT extends Ae{rawEnd(t){let e=ca(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=hr(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let r=ca(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(r=hr(r,t)),r}}class wT extends Ae{rawEnd(t){let e=fr(this.tzAdjustedDate(t));return t&&(e=hr(e,t)),e}rawStart(t){let e=fr(Rf(this.tzAdjustedDate(t),1));return t&&(e=hr(e,t)),e}}zt.FIFTEEN_MIN,new Ae({key:zt.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:lt.MINUTELY,dataGranularity:lt.MINUTELY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),zt.ONE_HOUR,new Ae({key:zt.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:lt.MINUTELY,dataGranularity:lt.MINUTELY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),zt.SIX_HOUR,new Ae({key:zt.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:lt.HOURLY,dataGranularity:lt.HOURLY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),zt.TWELVE_HOUR,new Ae({key:zt.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:lt.HOURLY,dataGranularity:lt.HOURLY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),zt.ONE_DAY,new Ae({key:zt.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:lt.HOURLY,dataGranularity:lt.HOURLY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),zt.SEVEN_DAY,new Ae({key:zt.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:lt.DAILY,dataGranularity:lt.DAILY,isRelative:!0,allowedTiers:["trial","plus","enterprise"]}),zt.THIRTY_DAY,new Ae({key:zt.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:lt.DAILY,dataGranularity:lt.DAILY,isRelative:!0,allowedTiers:["trial","plus","enterprise"]}),zt.CURRENT_WEEK,new yT({key:zt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=ca(new Date,{weekStartsOn:1});return(Af(Ef(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:lt.DAILY,dataGranularity:lt.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]}),zt.CURRENT_MONTH,new vT({key:zt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=fr(new Date);return(Af(Ef(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:lt.DAILY,dataGranularity:lt.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]}),zt.PREVIOUS_WEEK,new xT({key:zt.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:lt.DAILY,dataGranularity:lt.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]}),zt.PREVIOUS_MONTH,new wT({key:zt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=fr(new Date),e=fr(Rf(new Date,1));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=_T(t,e)),60*60*24*h1(new Date().setMonth(new Date().getMonth()-1))+g1(n)},defaultResponseGranularity:lt.DAILY,dataGranularity:lt.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]});function _T(n,t){return p1(n.getTimezoneOffset()-t.getTimezoneOffset())}function TT(n){const t=h.computed(()=>{var l,c;return{type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:10,autoSkipPadding:100,source:"auto",maxRotation:0},title:{display:!at((l=n.dimensionAxesTitle)==null?void 0:l.value),text:(c=n.dimensionAxesTitle)==null?void 0:c.value,padding:{top:20},font:{weight:"bold"}}}}),e=h.computed(()=>{var l,c;return{title:{display:!at((l=n.metricAxesTitle)==null?void 0:l.value),text:(c=n.metricAxesTitle)==null?void 0:c.value,padding:{bottom:20},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0}}),r={enabled:!1,position:"lineChartTooltipPosition"};Vi.positioners.lineChartTooltipPosition=function(l,c){if(!l.length||n.tooltipState.locked)return!1;const u=this.chart.canvas.getBoundingClientRect(),d=n.tooltipState.width||this.width,f=n.tooltipState.height||this.height,g=u.width/2,v=u.height/2,x=Bs(c,d,g);let p=Ew(c,f,v);const b=c.y<v?"top":"bottom",m=c.x<g?"left":"center";return f>u.height&&(p=0),{x,y:p,xAlign:m,yAlign:b}};const i=h.computed(()=>{switch(n.granularity.value){case lt.MINUTELY:return"minute";case lt.HOURLY:return"hour";case lt.DAILY:return"day";default:return"day"}}),a=h.computed(()=>uw(Number(n.timeRangeMs.value))>=24?"yyyy-MM-dd h:mm":"h:mm"),s=h.computed(()=>[lt.DAILY,lt.WEEKLY].includes(n.granularity.value)?"yyyy-MM-dd":"yyyy-MM-dd h:mm");return{options:h.computed(()=>({hover:{mode:"index",intersect:!1},elements:{point:{radius:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:{border:{display:!1},...t.value,stacked:n.stacked.value,time:{tooltipFormat:"h:mm:ss a",unit:i.value,displayFormats:{minute:"h:mm:ss a",hour:a.value,day:s.value}}},y:{border:{display:!1},...e.value,stacked:n.stacked.value}},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...r,external:l=>{Fs(n.tooltipState,l)}}},interaction:{mode:"index",intersect:!1}}))}}function MT(n){const{isMultiMetric:t,hasDimensions:e,metricNames:r,barSegmentLabels:i,pivotRecords:a,rowLabels:s,colorPalette:o}=n,{i18n:l}=kt.useI18n();return t?r.map(c=>({label:l&&l.te(`chartLabels.${c}`)&&l.t(`chartLabels.${c}`)||c,backgroundColor:ur(r.indexOf(c),Ce),data:s.map((u,d)=>e?a[`${u.id},${c}`]||0:a[`${d},${c}`]||null)})):Array.from(i).flatMap((c,u)=>{if(!c)return[];const d={},f=Array.isArray(o)?ur(u,o):o[c.name]||ur(u);return d[c.name]=f,{label:l&&l.te(`chartLabels.${c.name}`)&&l.t(`chartLabels.${c.name}`)||c.name,backgroundColor:f,data:s.map(g=>a[`${g.id},${c.id}`]||null)}})}function DT(n,t){const{i18n:e}=kt.useI18n();return h.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const i=t.value.data,{display:a,metric_names:s}=t.value.meta,o=a&&Object.keys(a),l=s&&s.length>1,c=a&&o&&o.length>0;if(!i.length||!s)return{datasets:[],labels:[]};const u=c&&o||s,d=u[0],f=u.length>1?u[1]:u[0],g=Object.fromEntries(l?i.flatMap(y=>s.map((w,T)=>{const S=y.event[d],k=c?`${S},${w}`:`${T},${w}`,M=y.event[w];return[k,M]})):i.map(y=>{const w=c?`${y.event[d]},${y.event[f]}`:`${d},${f}`,T=y.event[s[0]];return[w,T]})),v=a[d],x=a[f],p=c&&v&&Object.entries(v).map(([y,w])=>({id:y,name:w.name}))||s.map(y=>({id:y,name:y})),b=c&&x&&Object.entries(x).map(([y,w])=>({id:y,name:w.name}))||s.map(y=>({id:y,name:y}));return!p||!b?{labels:[],datasets:[]}:{labels:c?Object.entries(a[d]).map(([,y])=>e&&e.te(`chartLabels.${y.name}`)&&e.t(`chartLabels.${y.name}`)||y.name):s.map(y=>e&&e.te(`chartLabels.${y}`)&&e.t(`chartLabels.${y}`)||y),datasets:MT({isMultiMetric:l,hasDimensions:c,metricNames:s,dimensionFieldNames:u,barSegmentLabels:b,pivotRecords:g,rowLabels:p,colorPalette:n.colorPalette||Ce})}}}catch(i){return console.error(i),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const CT=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((r,i)=>r+i*e),kT=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return Kd(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},ST=(n,t,e,r,i)=>{const s=Math.max(t-6e4,Math.max(...(i||[]).map(c=>new Date(c.timestamp).valueOf()))),o=Math.floor((n-r)/e)*e+r,l=Math.floor((s-r)/e)*e+r+e;return CT(o,l,e)};function OT(n,t){const{i18n:e}=kt.useI18n();return h.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const i=t.value.data,{display:a,metric_names:s,start_ms:o,end_ms:l}=t.value.meta;if(!s)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const c=a&&Object.keys(a)||s,u=c&&c[0],d=a[u],f=a&&d&&Object.keys(d).map(T=>({id:T,name:d[T].name}))||s.map(T=>({id:T,name:T})),g=t.value.meta.granularity_ms;if(typeof g!="number"||isNaN(g)||!isFinite(g)||g===0)return console.error("Invalid step value:",g),{datasets:[],labels:[]};if(!i.length)return{datasets:[],labels:[]};const v=kT(o),x=ST(o,l,g,v,i),p=new Set,b=i!=null&&i.length?i.reduce((T,S)=>{const k=new Date(S.timestamp).valueOf(),M=S.event;for(const D of s)p.add(D),k in T||(T[k]={}),D in T[k]||(T[k][D]={});for(const D of s)f.forEach(O=>{M[u]===O.id||D===O.id?(T[k][D]||(T[k][D]={}),T[k][D][O.name]=Math.round(Number(M[D])*1e3)/1e3):c.length||(T[k][D]||(T[k][D]={}),T[k][D][O.name]=Math.round(Number(M[O.id])*1e3)/1e3)});return T},{}):{},m=s.length===1?s.flatMap(T=>f.map(S=>[T,S.name])):f.map(T=>[T.name,T.name]),y={},w=[...m].map(([T,S],k)=>{const M=x.map(F=>F in b&&T in b[F]?{x:F,y:b[F][T][S]||0}:{x:F,y:0});let{colorPalette:D,fill:O}=n;at(D)&&(D=Ce);const P=Array.isArray(D)?ur(k,D):D[S]||ur(k),A=ii(P,50);return y[S]=P,{rawDimension:S,rawMetric:T,label:e&&e.te(`chartLabels.${S}`)&&e.t(`chartLabels.${S}`)||S,borderColor:A,backgroundColor:P,data:M,total:M.reduce((F,{y:q})=>F+Number(q),0),...X_,fill:O,borderWidth:O?K_:G_}});return w.sort((T,S)=>Number(T.total)<Number(S.total)?-1:1),{datasets:w,colorMap:y}}}catch(i){return console.error(i),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const PT=(n,t)=>{h.watch([n,t],(e,r,i)=>{const[a,s]=e;!s||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(s,a),i(()=>{var o;(o=window._AnalyticsChartDataInternal)==null||o.delete(s)}))},{immediate:!0})};function ET(){const{i18n:n}=kt.useI18n();return{translateUnit:(e,r)=>{const i=r===1,a=`chartUnits.${e}`;return n.te(a)?n.t(a,{plural:i?"":"s"}):e}}}const kt={useBarChartOptions:J_,useChartJSCommon:e1,useChartLegendValues:r1,useChartSelectedRange:i1,useExploreResultToDatasets:DT,useExploreResultToTimeDataset:OT,useDoughnutChartOptions:a1,useLinechartOptions:TT,useI18n:wg,useReportChartDataForSynthetics:PT,useTranslatedUnits:ET};/*!
20
20
  * chartjs-plugin-annotation v3.0.1
21
21
  * https://www.chartjs.org/chartjs-plugin-annotation/index
22
22
  * (c) 2023 chartjs-plugin-annotation Contributors
23
23
  * Released under the MIT License
24
- */const Jf={modes:{point(n,t){return da(n,t,{intersect:!0})},nearest(n,t,e){return LT(n,t,e)},x(n,t,e){return da(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return da(n,t,{intersect:e.intersect,axis:"y"})}}};function Dl(n,t,e){return(Jf.modes[e.mode]||Jf.modes.nearest)(n,t,e)}function AT(n,t,e){return e!=="x"&&e!=="y"?n.inRange(t.x,t.y,"x",!0)||n.inRange(t.x,t.y,"y",!0):n.inRange(t.x,t.y,e,!0)}function RT(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function da(n,t,e){return n.visibleElements.filter(r=>e.intersect?r.inRange(t.x,t.y):AT(r,t,e.axis))}function LT(n,t,e){let r=Number.POSITIVE_INFINITY;return da(n,t,e).reduce((i,a)=>{const s=a.getCenterPoint(),o=RT(t,s,e.axis),l=tr(t,o);return l<r?(i=[a],r=l):l===r&&i.push(a),i},[]).sort((i,a)=>i._index-a._index).slice(0,1)}const IT=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,jn=.001,fa=(n,t,e)=>Math.min(e,Math.max(t,n));function NT(n,t,e){for(const r of Object.keys(n))n[r]=fa(n[r],t,e);return n}function FT(n,t,e,r){if(!n||!t||e<=0)return!1;const i=r/2;return Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2)<=Math.pow(e+i,2)}function th(n,{x:t,y:e,x2:r,y2:i},a,s){const o=s/2,l=n.x>=t-o-jn&&n.x<=r+o+jn,c=n.y>=e-o-jn&&n.y<=i+o+jn;return a==="x"?l:(a==="y"||l)&&c}function gr(n,t){const{centerX:e,centerY:r}=n.getProps(["centerX","centerY"],t);return{x:e,y:r}}function BT(n,t,e,r=!0){const i=e.split(".");let a=0;for(const s of t.split(".")){const o=i[a++];if(parseInt(s,10)<parseInt(o,10))break;if(IT(o,s)){if(r)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const eh=n=>typeof n=="string"&&n.endsWith("%"),nh=n=>parseFloat(n)/100,rh=n=>fa(nh(n),0,1),ha=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),UT={box:n=>ha(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>ha(n.centerX,n.centerY),line:n=>ha(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>ha(n.centerX,n.centerY)};function Cl(n,t){return t==="start"?0:t==="end"?n:eh(t)?rh(t)*n:n/2}function wn(n,t,e=!0){return typeof t=="number"?t:eh(t)?(e?rh(t):nh(t))*n:n}function WT(n,t){const{x:e,width:r}=n,i=t.textAlign;return i==="center"?e+r/2:i==="end"||i==="right"?e+r:e}function kl(n,t="center"){return lt(n)?{x:rt(n.x,t),y:rt(n.y,t)}:(n=rt(n,t),{x:n,y:n})}function ih(n){return n&&(fe(n.xValue)||fe(n.yValue))}function oi(n,t,e){const r=e.init;if(r){if(r===!0)return sh(t,e)}else return;return YT(n,t,e)}function ah(n,t,e){let r=!1;return t.forEach(i=>{he(n[i])?(r=!0,e[i]=n[i]):fe(e[i])&&delete e[i]}),r}function sh(n,t){const e=t.type||"line";return UT[e](n)}function YT(n,t,e){const r=Mt(e.init,[{chart:n,properties:t,options:e}]);if(r===!0)return sh(t,e);if(lt(r))return r}const Sl=new Map,HT=n=>isNaN(n)||n<=0,zT=n=>n.reduce(function(t,e){return t+=e.string,t},"");function ga(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function Ol(n,{x:t,y:e},r){r&&(n.translate(t,e),n.rotate(Gt(r)),n.translate(-t,-e))}function _n(n,t){if(t&&t.borderWidth)return n.lineCap=t.borderCapStyle,n.setLineDash(t.borderDash),n.lineDashOffset=t.borderDashOffset,n.lineJoin=t.borderJoinStyle,n.lineWidth=t.borderWidth,n.strokeStyle=t.borderColor,!0}function pr(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function Pl(n,t){const e=t.content;if(ga(e))return{width:wn(e.width,t.width),height:wn(e.height,t.height)};const r=t.font,i=bt(r)?r.map(l=>Rt(l)):[Rt(r)],a=t.textStrokeWidth,s=bt(e)?e:[e],o=s.join()+zT(i)+a+(n._measureText?"-spriting":"");return Sl.has(o)||Sl.set(o,XT(n,s,i,a)),Sl.get(o)}function oh(n,t,e){const{x:r,y:i,width:a,height:s}=t;n.save(),pr(n,e);const o=_n(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),er(n,{x:r,y:i,w:a,h:s,radius:NT(hn(e.borderRadius),0,Math.min(a,s)/2)}),n.closePath(),n.fill(),o&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function $T(n,t,e){const r=e.content;if(ga(r)){n.save(),n.globalAlpha=QT(e.opacity,r.style.opacity),n.drawImage(r,t.x,t.y,t.width,t.height),n.restore();return}const i=bt(r)?r:[r],a=e.font,s=bt(a)?a.map(d=>Rt(d)):[Rt(a)],o=e.color,l=bt(o)?o:[o],c=WT(t,e),u=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,jT(n,e)&&GT(n,{x:c,y:u},i,s),KT(n,{x:c,y:u},i,{fonts:s,colors:l}),n.restore()}function jT(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function VT(n,t,e,r){const{radius:i,options:a}=t,s=a.pointStyle,o=a.rotation;let l=(o||0)*Wa;if(ga(s)){n.save(),n.translate(e,r),n.rotate(l),n.drawImage(s,-s.width/2,-s.height/2,s.width,s.height),n.restore();return}HT(i)||qT(n,{x:e,y:r,radius:i,rotation:o,style:s,rad:l})}function qT(n,{x:t,y:e,radius:r,rotation:i,style:a,rad:s}){let o,l,c,u;switch(n.beginPath(),a){default:n.arc(t,e,r,0,Ot),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(s)*r,e-Math.cos(s)*r),s+=wi,n.lineTo(t+Math.sin(s)*r,e-Math.cos(s)*r),s+=wi,n.lineTo(t+Math.sin(s)*r,e-Math.cos(s)*r),n.closePath();break;case"rectRounded":u=r*.516,c=r-u,o=Math.cos(s+Me)*c,l=Math.sin(s+Me)*c,n.arc(t-o,e-l,u,s-ft,s-At),n.arc(t+l,e-o,u,s-At,s),n.arc(t+o,e+l,u,s,s+At),n.arc(t-l,e+o,u,s+At,s+ft),n.closePath();break;case"rect":if(!i){c=Math.SQRT1_2*r,n.rect(t-c,e-c,2*c,2*c);break}s+=Me;case"rectRot":o=Math.cos(s)*r,l=Math.sin(s)*r,n.moveTo(t-o,e-l),n.lineTo(t+l,e-o),n.lineTo(t+o,e+l),n.lineTo(t-l,e+o),n.closePath();break;case"crossRot":s+=Me;case"cross":o=Math.cos(s)*r,l=Math.sin(s)*r,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o);break;case"star":o=Math.cos(s)*r,l=Math.sin(s)*r,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o),s+=Me,o=Math.cos(s)*r,l=Math.sin(s)*r,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o);break;case"line":o=Math.cos(s)*r,l=Math.sin(s)*r,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l);break;case"dash":n.moveTo(t,e),n.lineTo(t+Math.cos(s)*r,e+Math.sin(s)*r);break}n.fill()}function XT(n,t,e,r){n.save();const i=t.length;let a=0,s=r;for(let o=0;o<i;o++){const l=e[Math.min(o,e.length-1)];n.font=l.string;const c=t[o];a=Math.max(a,n.measureText(c).width+r),s+=l.lineHeight}return n.restore(),{width:a,height:s}}function GT(n,{x:t,y:e},r,i){n.beginPath();let a=0;r.forEach(function(s,o){const l=i[Math.min(o,i.length-1)],c=l.lineHeight;n.font=l.string,n.strokeText(s,t,e+c/2+a),a+=c}),n.stroke()}function KT(n,{x:t,y:e},r,{fonts:i,colors:a}){let s=0;r.forEach(function(o,l){const c=a[Math.min(l,a.length-1)],u=i[Math.min(l,i.length-1)],d=u.lineHeight;n.beginPath(),n.font=u.string,n.fillStyle=c,n.fillText(o,t,e+d/2+s),s+=d,n.fill()})}function QT(n,t){const e=fn(n)?n:t;return fn(e)?fa(e,0,1):1}const lh={xScaleID:{min:"xMin",max:"xMax",start:"left",end:"right",startProp:"x",endProp:"x2"},yScaleID:{min:"yMin",max:"yMax",start:"bottom",end:"top",startProp:"y",endProp:"y2"}};function mr(n,t,e){return t=typeof t=="number"?t:n.parse(t),Nt(t)?n.getPixelForValue(t):e}function Vn(n,t,e){const r=t[e];if(r||e==="scaleID")return r;const i=e.charAt(0),a=Object.values(n).filter(s=>s.axis&&s.axis===i);return a.length?a[0].id:i}function ch(n,t){if(n){const e=n.options.reverse,r=mr(n,t.min,e?t.end:t.start),i=mr(n,t.max,e?t.start:t.end);return{start:r,end:i}}}function uh(n,t){const{chartArea:e,scales:r}=n,i=r[Vn(r,t,"xScaleID")],a=r[Vn(r,t,"yScaleID")];let s=e.width/2,o=e.height/2;return i&&(s=mr(i,t.xValue,i.left+i.width/2)),a&&(o=mr(a,t.yValue,a.top+a.height/2)),{x:s,y:o}}function El(n,t){const e=n.scales,r=e[Vn(e,t,"xScaleID")],i=e[Vn(e,t,"yScaleID")];if(!r&&!i)return{};let{left:a,right:s}=r||n.chartArea,{top:o,bottom:l}=i||n.chartArea;const c=hh(r,{min:t.xMin,max:t.xMax,start:a,end:s});a=c.start,s=c.end;const u=hh(i,{min:t.yMin,max:t.yMax,start:l,end:o});return o=u.start,l=u.end,{x:a,y:o,x2:s,y2:l,width:s-a,height:l-o,centerX:a+(s-a)/2,centerY:o+(l-o)/2}}function dh(n,t){if(!ih(t)){const e=El(n,t);let r=t.radius;(!r||isNaN(r))&&(r=Math.min(e.width,e.height)/2,t.radius=r);const i=r*2,a=e.centerX+t.xAdjust,s=e.centerY+t.yAdjust;return{x:a-r,y:s-r,x2:a+r,y2:s+r,centerX:a,centerY:s,width:i,height:i,radius:r}}return JT(n,t)}function ZT(n,t){const{scales:e,chartArea:r}=n,i=e[t.scaleID],a={x:r.left,y:r.top,x2:r.right,y2:r.bottom};return i?tM(i,a,t):eM(e,a,t),a}function fh(n,t){const e=El(n,t);return e.initProperties=oi(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:iM(n,e,t),initProperties:e.initProperties}],e}function JT(n,t){const e=uh(n,t),r=t.radius*2;return{x:e.x-t.radius+t.xAdjust,y:e.y-t.radius+t.yAdjust,x2:e.x+t.radius+t.xAdjust,y2:e.y+t.radius+t.yAdjust,centerX:e.x+t.xAdjust,centerY:e.y+t.yAdjust,radius:t.radius,width:r,height:r}}function hh(n,t){const e=ch(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function tM(n,t,e){const r=mr(n,e.value,NaN),i=mr(n,e.endValue,r);n.isHorizontal()?(t.x=r,t.x2=i):(t.y=r,t.y2=i)}function eM(n,t,e){for(const r of Object.keys(lh)){const i=n[Vn(n,e,r)];if(i){const{min:a,max:s,start:o,end:l,startProp:c,endProp:u}=lh[r],d=ch(i,{min:e[a],max:e[s],start:i[o],end:i[l]});t[c]=d.start,t[u]=d.end}}}function nM({properties:n,options:t},e,r,i){const{x:a,x2:s,width:o}=n;return gh({start:a,end:s,size:o,borderWidth:t.borderWidth},{position:r.x,padding:{start:i.left,end:i.right},adjust:t.label.xAdjust,size:e.width})}function rM({properties:n,options:t},e,r,i){const{y:a,y2:s,height:o}=n;return gh({start:a,end:s,size:o,borderWidth:t.borderWidth},{position:r.y,padding:{start:i.top,end:i.bottom},adjust:t.label.yAdjust,size:e.height})}function gh(n,t){const{start:e,end:r,borderWidth:i}=n,{position:a,padding:{start:s,end:o},adjust:l}=t,c=r-i-e-s-o-t.size;return e+i/2+l+Cl(c,a)}function iM(n,t,e){const r=e.label;r.backgroundColor="transparent",r.callout.display=!1;const i=kl(r.position),a=Kt(r.padding),s=Pl(n.ctx,r),o=nM({properties:t,options:e},s,i,a),l=rM({properties:t,options:e},s,i,a),c=s.width+a.width,u=s.height+a.height;return{x:o,y:l,x2:o+c,y2:l+u,width:c,height:u,centerX:o+c/2,centerY:l+u/2,rotation:r.rotation}}function qn(n,t,e){const r=Math.cos(e),i=Math.sin(e),a=t.x,s=t.y;return{x:a+r*(n.x-a)-i*(n.y-s),y:s+i*(n.x-a)+r*(n.y-s)}}const Al=["enter","leave"],Rl=Al.concat("click");function aM(n,t,e){t.listened=ah(e,Rl,t.listeners),t.moveListened=!1,t._getElements=Dl,Al.forEach(r=>{he(e[r])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(r=>{!t.listened&&he(r.click)&&(t.listened=!0),t.moveListened||Al.forEach(i=>{he(r[i])&&(t.listened=!0,t.moveListened=!0)})})}function sM(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return oM(n,t,e);case"click":return lM(n,t,e)}}function oM(n,t,e){if(!n.moveListened)return;let r;t.type==="mousemove"?r=Dl(n,t,e.interaction):r=[];const i=n.hovered;n.hovered=r;const a={state:n,event:t};let s=ph(a,"leave",i,r);return ph(a,"enter",r,i)||s}function ph({state:n,event:t},e,r,i){let a;for(const s of r)i.indexOf(s)<0&&(a=mh(s.options[e]||n.listeners[e],s,t)||a);return a}function lM(n,t,e){const r=n.listeners,i=Dl(n,t,e.interaction);let a;for(const s of i)a=mh(s.options.click||r.click,s,t)||a;return a}function mh(n,t,e){return Mt(n,[t.$context,e])===!0}const pa=["afterDraw","beforeDraw"];function cM(n,t,e){const r=t.visibleElements;t.hooked=ah(e,pa,t.hooks),t.hooked||r.forEach(i=>{t.hooked||pa.forEach(a=>{he(i.options[a])&&(t.hooked=!0)})})}function bh(n,t,e){if(n.hooked){const r=t.options[e]||n.hooks[e];return Mt(r,[t.$context])}}function uM(n,t,e){const r=pM(n.scales,t,e);let i=yh(t,r,"min","suggestedMin");i=yh(t,r,"max","suggestedMax")||i,i&&he(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function dM(n,t){for(const e of n)hM(e,t)}function yh(n,t,e,r){if(Nt(t[e])&&!fM(n.options,e,r)){const i=n[e]!==t[e];return n[e]=t[e],i}}function fM(n,t,e){return fe(n[t])||fe(n[e])}function hM(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const r=Vn(t,n,e);r&&!t[r]&&gM(n,e)&&console.warn(`No scale found with id '${r}' for annotation '${n.id}'`)}}function gM(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const r of["Min","Max","Value"])if(fe(n[e+r]))return!0;return!1}function pM(n,t,e){const r=t.axis,i=t.id,a=r+"ScaleID",s={min:rt(t.min,Number.NEGATIVE_INFINITY),max:rt(t.max,Number.POSITIVE_INFINITY)};for(const o of e)o.scaleID===i?vh(o,t,["value","endValue"],s):Vn(n,o,a)===i&&vh(o,t,[r+"Min",r+"Max",r+"Value"],s);return s}function vh(n,t,e,r){for(const i of e){const a=n[i];if(fe(a)){const s=t.parse(a);r.min=Math.min(r.min,s),r.max=Math.max(r.max,s)}}}class br extends ee{inRange(t,e,r,i){const{x:a,y:s}=qn({x:t,y:e},this.getCenterPoint(i),Gt(-this.options.rotation));return th({x:a,y:s},this.getProps(["x","y","x2","y2"],i),r,this.options.borderWidth)}getCenterPoint(t){return gr(this,t)}draw(t){t.save(),Ol(t,this.getCenterPoint(),this.options.rotation),oh(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return fh(t,e)}}br.id="boxAnnotation",br.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,label:{backgroundColor:"transparent",borderWidth:0,callout:{display:!1},color:"black",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,opacity:void 0,padding:6,position:"center",rotation:void 0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},br.defaultRoutes={borderColor:"color",backgroundColor:"color"},br.descriptors={label:{_fallback:!0}};const xh=["left","bottom","top","right"];class li extends ee{inRange(t,e,r,i){const{x:a,y:s}=qn({x:t,y:e},this.getCenterPoint(i),Gt(-this.rotation));return th({x:a,y:s},this.getProps(["x","y","x2","y2"],i),r,this.options.borderWidth)}getCenterPoint(t){return gr(this,t)}draw(t){const e=this.options,r=!fe(this._visible)||this._visible;!e.display||!e.content||!r||(t.save(),Ol(t,this.getCenterPoint(),this.rotation),bM(t,this),oh(t,this,e),$T(t,MM(this),e),t.restore())}resolveElementProperties(t,e){let r;if(ih(e))r=uh(t,e);else{const{centerX:o,centerY:l}=El(t,e);r={x:o,y:l}}const i=Kt(e.padding),a=Pl(t.ctx,e),s=mM(r,a,e,i);return{initProperties:oi(t,s,e),pointX:r.x,pointY:r.y,...s,rotation:e.rotation}}}li.id="labelAnnotation",li.defaults={adjustScaleRange:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:!1,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,init:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},li.defaultRoutes={borderColor:"color"};function mM(n,t,e,r){const i=t.width+r.width+e.borderWidth,a=t.height+r.height+e.borderWidth,s=kl(e.position,"center"),o=wh(n.x,i,e.xAdjust,s.x),l=wh(n.y,a,e.yAdjust,s.y);return{x:o,y:l,x2:o+i,y2:l+a,width:i,height:a,centerX:o+i/2,centerY:l+a/2}}function wh(n,t,e=0,r){return n-Cl(t,r)+e}function bM(n,t){const{pointX:e,pointY:r,options:i}=t,a=i.callout,s=a&&a.display&&_M(t,a);if(!s||DM(t,a,s))return;if(n.save(),n.beginPath(),!_n(n,a))return n.restore();const{separatorStart:l,separatorEnd:c}=yM(t,s),{sideStart:u,sideEnd:d}=xM(t,s,l);(a.margin>0||i.borderWidth===0)&&(n.moveTo(l.x,l.y),n.lineTo(c.x,c.y)),n.moveTo(u.x,u.y),n.lineTo(d.x,d.y);const f=qn({x:e,y:r},t.getCenterPoint(),Gt(-t.rotation));n.lineTo(f.x,f.y),n.stroke(),n.restore()}function yM(n,t){const{x:e,y:r,x2:i,y2:a}=n,s=vM(n,t);let o,l;return t==="left"||t==="right"?(o={x:e+s,y:r},l={x:o.x,y:a}):(o={x:e,y:r+s},l={x:i,y:o.y}),{separatorStart:o,separatorEnd:l}}function vM(n,t){const{width:e,height:r,options:i}=n,a=i.callout.margin+i.borderWidth/2;return t==="right"?e+a:t==="bottom"?r+a:-a}function xM(n,t,e){const{y:r,width:i,height:a,options:s}=n,o=s.callout.start,l=wM(t,s.callout);let c,u;return t==="left"||t==="right"?(c={x:e.x,y:r+wn(a,o)},u={x:c.x+l,y:c.y}):(c={x:e.x+wn(i,o),y:e.y},u={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:u}}function wM(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function _M(n,t){const e=t.position;return xh.includes(e)?e:TM(n,t)}function TM(n,t){const{x:e,y:r,x2:i,y2:a,width:s,height:o,pointX:l,pointY:c,centerX:u,centerY:d,rotation:f}=n,g={x:u,y:d},v=t.start,x=wn(s,v),p=wn(o,v),b=[e,e+x,e+x,i],m=[r+p,a,r,a],y=[];for(let w=0;w<4;w++){const T=qn({x:b[w],y:m[w]},g,Gt(f));y.push({position:xh[w],distance:tr(T,{x:l,y:c})})}return y.sort((w,T)=>w.distance-T.distance)[0].position}function MM({x:n,y:t,width:e,height:r,options:i}){const a=i.borderWidth/2,s=Kt(i.padding);return{x:n+s.left+a,y:t+s.top+a,width:e-s.left-s.right-i.borderWidth,height:r-s.top-s.bottom-i.borderWidth}}function DM(n,t,e){const{pointX:r,pointY:i}=n,a=t.margin;let s=r,o=i;return e==="left"?s+=a:e==="right"?s-=a:e==="top"?o+=a:e==="bottom"&&(o-=a),n.inRange(s,o)}const Ll=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),Il=(n,t,e)=>Ll(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,_h=(n,t,e)=>Ll(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,ci=n=>n*n,CM=(n,t,{x:e,y:r,x2:i,y2:a},s)=>s==="y"?{start:Math.min(r,a),end:Math.max(r,a),value:t}:{start:Math.min(e,i),end:Math.max(e,i),value:n},Th=(n,t,e,r)=>(1-r)*(1-r)*n+2*(1-r)*r*t+r*r*e,Nl=(n,t,e,r)=>({x:Th(n.x,t.x,e.x,r),y:Th(n.y,t.y,e.y,r)}),Mh=(n,t,e,r)=>2*(1-r)*(t-n)+2*r*(e-t),Dh=(n,t,e,r)=>-Math.atan2(Mh(n.x,t.x,e.x,r),Mh(n.y,t.y,e.y,r))+.5*ft;class ui extends ee{inRange(t,e,r,i){const a=this.options.borderWidth/2;if(r!=="x"&&r!=="y"){const s={mouseX:t,mouseY:e},{path:o,ctx:l}=this;if(o){_n(l,this.options);const{chart:u}=this.$context,d=t*u.currentDevicePixelRatio,f=e*u.currentDevicePixelRatio,g=l.isPointInStroke(o,d,f)||Fl(this,s,i);return l.restore(),g}const c=ci(a);return PM(this,s,c,i)||Fl(this,s,i)}return kM(this,{mouseX:t,mouseY:e},r,{hBorderWidth:a,useFinalPosition:i})}getCenterPoint(t){return gr(this,t)}draw(t){const{x:e,y:r,x2:i,y2:a,cp:s,options:o}=this;if(t.save(),!_n(t,o))return t.restore();pr(t,o);const l=Math.sqrt(Math.pow(i-e,2)+Math.pow(a-r,2));if(o.curve&&s)return BM(t,this,s,l),t.restore();const{startOpts:c,endOpts:u,startAdjust:d,endAdjust:f}=Ph(this),g=Math.atan2(a-r,i-e);t.translate(e,r),t.rotate(g),t.beginPath(),t.moveTo(0+d,0),t.lineTo(l-f,0),t.shadowColor=o.borderShadowColor,t.stroke(),Bl(t,0,d,c),Bl(t,l,-f,u),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const r=ZT(t,e),{x:i,y:a,x2:s,y2:o}=r,l=SM(r,t.chartArea),c=l?OM({x:i,y:a},{x:s,y:o},t.chartArea):{x:i,y:a,x2:s,y2:o,width:Math.abs(s-i),height:Math.abs(o-a)};if(c.centerX=(s+i)/2,c.centerY=(o+a)/2,c.initProperties=oi(t,c,e),e.curve){const d={x:c.x,y:c.y},f={x:c.x2,y:c.y2};c.cp=FM(c,e,tr(d,f))}const u=EM(t,c,e.label);return u._visible=l,c.elements=[{type:"label",optionScope:"label",properties:u,initProperties:c.initProperties}],c}}ui.id="lineAnnotation";const Ch={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};ui.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},Ch),fill:!1,length:12,start:Object.assign({},Ch),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},li.defaults.callout),color:"#fff",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},ui.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},ui.defaultRoutes={borderColor:"color"};function kM(n,{mouseX:t,mouseY:e},r,{hBorderWidth:i,useFinalPosition:a}){const s=CM(t,e,n.getProps(["x","y","x2","y2"],a),r);return s.value>=s.start-i&&s.value<=s.end+i||Fl(n,{mouseX:t,mouseY:e},a,r)}function SM({x:n,y:t,x2:e,y2:r},{top:i,right:a,bottom:s,left:o}){return!(n<o&&e<o||n>a&&e>a||t<i&&r<i||t>s&&r>s)}function kh({x:n,y:t},e,{top:r,right:i,bottom:a,left:s}){return n<s&&(t=_h(s,{x:n,y:t},e),n=s),n>i&&(t=_h(i,{x:n,y:t},e),n=i),t<r&&(n=Il(r,{x:n,y:t},e),t=r),t>a&&(n=Il(a,{x:n,y:t},e),t=a),{x:n,y:t}}function OM(n,t,e){const{x:r,y:i}=kh(n,t,e),{x:a,y:s}=kh(t,n,e);return{x:r,y:i,x2:a,y2:s,width:Math.abs(a-r),height:Math.abs(s-i)}}function PM(n,{mouseX:t,mouseY:e},r=jn,i){const{x:a,y:s,x2:o,y2:l}=n.getProps(["x","y","x2","y2"],i),c=o-a,u=l-s,d=ci(c)+ci(u),f=d===0?-1:((t-a)*c+(e-s)*u)/d;let g,v;return f<0?(g=a,v=s):f>1?(g=o,v=l):(g=a+f*c,v=s+f*u),ci(t-g)+ci(e-v)<=r}function Fl(n,{mouseX:t,mouseY:e},r,i){const a=n.label;return a.options.display&&a.inRange(t,e,i,r)}function EM(n,t,e){const r=e.borderWidth,i=Kt(e.padding),a=Pl(n.ctx,e),s=a.width+i.width+r,o=a.height+i.height+r;return RM(t,e,{width:s,height:o,padding:i},n.chartArea)}function AM(n){const{x:t,y:e,x2:r,y2:i}=n,a=Math.atan2(i-e,r-t);return a>ft/2?a-ft:a<ft/-2?a+ft:a}function RM(n,t,e,r){const{width:i,height:a,padding:s}=e,{xAdjust:o,yAdjust:l}=t,c={x:n.x,y:n.y},u={x:n.x2,y:n.y2},d=t.rotation==="auto"?AM(n):Gt(t.rotation),f=LM(i,a,d),g=IM(n,t,{labelSize:f,padding:s},r),v=n.cp?Nl(c,n.cp,u,g):Ll(c,u,g),x={size:f.w,min:r.left,max:r.right,padding:s.left},p={size:f.h,min:r.top,max:r.bottom,padding:s.top},b=Oh(v.x,x)+o,m=Oh(v.y,p)+l;return{x:b-i/2,y:m-a/2,x2:b+i/2,y2:m+a/2,centerX:b,centerY:m,pointX:v.x,pointY:v.y,width:i,height:a,rotation:_i(d)}}function LM(n,t,e){const r=Math.cos(e),i=Math.sin(e);return{w:Math.abs(n*r)+Math.abs(t*i),h:Math.abs(n*i)+Math.abs(t*r)}}function IM(n,t,e,r){let i;const a=NM(n,r);return t.position==="start"?i=Sh({w:n.x2-n.x,h:n.y2-n.y},e,t,a):t.position==="end"?i=1-Sh({w:n.x-n.x2,h:n.y-n.y2},e,t,a):i=Cl(1,t.position),i}function Sh(n,t,e,r){const{labelSize:i,padding:a}=t,s=n.w*r.dx,o=n.h*r.dy,l=s>0&&(i.w/2+a.left-r.x)/s,c=o>0&&(i.h/2+a.top-r.y)/o;return fa(Math.max(l,c),0,.25)}function NM(n,t){const{x:e,x2:r,y:i,y2:a}=n,s=Math.min(i,a)-t.top,o=Math.min(e,r)-t.left,l=t.bottom-Math.max(i,a),c=t.right-Math.max(e,r);return{x:Math.min(o,c),y:Math.min(s,l),dx:o<=c?1:-1,dy:s<=l?1:-1}}function Oh(n,t){const{size:e,min:r,max:i,padding:a}=t,s=e/2;return e>i-r?(i+r)/2:(r>=n-a-s&&(n=r+a+s),i<=n+a+s&&(n=i-a-s),n)}function Ph(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,r=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:r,startAdjust:Eh(n,e),endAdjust:Eh(n,r)}}function Eh(n,t){if(!t||!t.display)return 0;const{length:e,width:r}=t,i=n.options.borderWidth/2,a={x:e,y:r+i};return Math.abs(Il(0,a,{x:0,y:i}))}function Bl(n,t,e,r){if(!r||!r.display)return;const{length:i,width:a,fill:s,backgroundColor:o,borderColor:l}=r,c=Math.abs(t-i)+e;n.beginPath(),pr(n,r),_n(n,r),n.moveTo(c,-a),n.lineTo(t+e,0),n.lineTo(c,a),s===!0?(n.fillStyle=o||l,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=r.borderShadowColor,n.stroke()}function FM(n,t,e){const{x:r,y:i,x2:a,y2:s,centerX:o,centerY:l}=n,c=Math.atan2(s-i,a-r),u=kl(t.controlPoint,0),d={x:o+wn(e,u.x,!1),y:l+wn(e,u.y,!1)};return qn(d,{x:o,y:l},c)}function Ah(n,{x:t,y:e},{angle:r,adjust:i},a){!a||!a.display||(n.save(),n.translate(t,e),n.rotate(r),Bl(n,0,-i,a),n.restore())}function BM(n,t,e,r){const{x:i,y:a,x2:s,y2:o,options:l}=t,{startOpts:c,endOpts:u,startAdjust:d,endAdjust:f}=Ph(t),g={x:i,y:a},v={x:s,y:o},x=Dh(g,e,v,0),p=Dh(g,e,v,1)-ft,b=Nl(g,e,v,d/r),m=Nl(g,e,v,1-f/r),y=new Path2D;n.beginPath(),y.moveTo(b.x,b.y),y.quadraticCurveTo(e.x,e.y,m.x,m.y),n.shadowColor=l.borderShadowColor,n.stroke(y),t.path=y,t.ctx=n,Ah(n,b,{angle:x,adjust:d},c),Ah(n,m,{angle:p,adjust:f},u)}class di extends ee{inRange(t,e,r,i){const a=this.options.rotation,s=this.options.borderWidth;if(r!=="x"&&r!=="y")return UM({x:t,y:e},this.getProps(["width","height","centerX","centerY"],i),a,s);const{x:o,y:l,x2:c,y2:u}=this.getProps(["x","y","x2","y2"],i),d=s/2,f=r==="y"?{start:l,end:u}:{start:o,end:c},g=qn({x:t,y:e},this.getCenterPoint(i),Gt(-a));return g[r]>=f.start-d-jn&&g[r]<=f.end+d+jn}getCenterPoint(t){return gr(this,t)}draw(t){const{width:e,height:r,centerX:i,centerY:a,options:s}=this;t.save(),Ol(t,this.getCenterPoint(),s.rotation),pr(t,this.options),t.beginPath(),t.fillStyle=s.backgroundColor;const o=_n(t,s);t.ellipse(i,a,r/2,e/2,ft/2,0,2*ft),t.fill(),o&&(t.shadowColor=s.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return fh(t,e)}}di.id="ellipseAnnotation",di.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,label:Object.assign({},br.defaults.label),rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},di.defaultRoutes={borderColor:"color",backgroundColor:"color"},di.descriptors={label:{_fallback:!0}};function UM(n,t,e,r){const{width:i,height:a,centerX:s,centerY:o}=t,l=i/2,c=a/2;if(l<=0||c<=0)return!1;const u=Gt(e||0),d=r/2||0,f=Math.cos(u),g=Math.sin(u),v=Math.pow(f*(n.x-s)+g*(n.y-o),2),x=Math.pow(g*(n.x-s)-f*(n.y-o),2);return v/Math.pow(l+d,2)+x/Math.pow(c+d,2)<=1.0001}class ma extends ee{inRange(t,e,r,i){const{x:a,y:s,x2:o,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],i),u=this.options.borderWidth;if(r!=="x"&&r!=="y")return FT({x:t,y:e},this.getCenterPoint(i),c/2,u);const d=u/2,f=r==="y"?{start:s,end:l,value:e}:{start:a,end:o,value:t};return f.value>=f.start-d&&f.value<=f.end+d}getCenterPoint(t){return gr(this,t)}draw(t){const e=this.options,r=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,pr(t,e);const i=_n(t,e);VT(t,this,this.centerX,this.centerY),i&&!ga(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=r}resolveElementProperties(t,e){const r=dh(t,e);return r.initProperties=oi(t,r,e),r}}ma.id="pointAnnotation",ma.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,pointStyle:"circle",radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},ma.defaultRoutes={borderColor:"color",backgroundColor:"color"};class ba extends ee{inRange(t,e,r,i){if(r!=="x"&&r!=="y")return this.options.radius>=.1&&this.elements.length>1&&YM(this.elements,t,e,i);const a=qn({x:t,y:e},this.getCenterPoint(i),Gt(-this.options.rotation)),s=this.elements.map(c=>r==="y"?c.bY:c.bX),o=Math.min(...s),l=Math.max(...s);return a[r]>=o&&a[r]<=l}getCenterPoint(t){return gr(this,t)}draw(t){const{elements:e,options:r}=this;t.save(),t.beginPath(),t.fillStyle=r.backgroundColor,pr(t,r);const i=_n(t,r);let a=!0;for(const s of e)a?(t.moveTo(s.x,s.y),a=!1):t.lineTo(s.x,s.y);t.closePath(),t.fill(),i&&(t.shadowColor=r.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,e){const r=dh(t,e),{sides:i,rotation:a}=e,s=[],o=2*ft/i;let l=a*Wa;for(let c=0;c<i;c++,l+=o){const u=WM(r,e,l);u.initProperties=oi(t,r,e),s.push(u)}return r.elements=s,r}}ba.id="polygonAnnotation",ba.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,point:{radius:0},radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,sides:3,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},ba.defaultRoutes={borderColor:"color",backgroundColor:"color"};function WM({centerX:n,centerY:t},{radius:e,borderWidth:r},i){const a=r/2,s=Math.sin(i),o=Math.cos(i),l={x:n+s*e,y:t-o*e};return{type:"point",optionScope:"point",properties:{x:l.x,y:l.y,centerX:l.x,centerY:l.y,bX:n+s*(e+a),bY:t-o*(e+a)}}}function YM(n,t,e,r){let i=!1,a=n[n.length-1].getProps(["bX","bY"],r);for(const s of n){const o=s.getProps(["bX","bY"],r);o.bY>e!=a.bY>e&&t<(a.bX-o.bX)*(e-o.bY)/(a.bY-o.bY)+o.bX&&(i=!i),a=o}return i}const Tn={box:br,ellipse:di,label:li,line:ui,point:ma,polygon:ba};Object.keys(Tn).forEach(n=>{Ut.describe(`elements.${Tn[n].id}`,{_fallback:"plugins.annotation.common"})});const HM={update:Object.assign},zM=Rl.concat(pa),Rh=(n,t)=>lt(t)?Yl(n,t):n,Ul=n=>n==="color"||n==="font";function Wl(n="line"){return Tn[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function $M(n,t,e,r){const i=VM(n,e.animations,r),a=t.annotations,s=GM(t.elements,a);for(let o=0;o<a.length;o++){const l=a[o],c=Lh(s,o,l.type),u=l.setContext(XM(n,c,l)),d=c.resolveElementProperties(n,u);d.skip=jM(d),"elements"in d&&(qM(c,d.elements,u,i),delete d.elements),fe(c.x)||Object.assign(c,d),Object.assign(c,d.initProperties),d.options=Ih(u),i.update(c,d)}}function jM(n){return isNaN(n.x)||isNaN(n.y)}function VM(n,t,e){return e==="reset"||e==="none"||e==="resize"?HM:new ts(n,t)}function qM(n,t,e,r){const i=n.elements||(n.elements=[]);i.length=t.length;for(let a=0;a<t.length;a++){const s=t[a],o=s.properties,l=Lh(i,a,s.type,s.initProperties),c=e[s.optionScope].override(s);o.options=Ih(c),r.update(l,o)}}function Lh(n,t,e,r){const i=Tn[Wl(e)];let a=n[t];return(!a||!(a instanceof i))&&(a=n[t]=new i,Object.assign(a,r)),a}function Ih(n){const t=Tn[Wl(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,Yl(n,t.defaults),Yl(n,t.defaultRoutes));for(const r of zM)e[r]=n[r];return e}function Yl(n,t){const e={};for(const r of Object.keys(t)){const i=t[r],a=n[r];Ul(r)&&bt(a)?e[r]=a.map(s=>Rh(s,i)):e[r]=Rh(a,i)}return e}function XM(n,t,e){return t.$context||(t.$context=Object.assign(Object.create(n.getContext()),{element:t,id:e.id,type:"annotation"}))}function GM(n,t){const e=t.length,r=n.length;if(r<e){const i=e-r;n.splice(r,0,...new Array(i))}else r>e&&n.splice(e,r-e);return n}var KM="3.0.1";const Mn=new Map,QM=Rl.concat(pa);var Nh={id:"annotation",version:KM,beforeRegister(){BT("chart.js","4.0",De.version)},afterRegister(){De.register(Tn)},afterUnregister(){De.unregister(Tn)},beforeInit(n){Mn.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const r=Mn.get(n),i=r.annotations=[];let a=e.annotations;lt(a)?Object.keys(a).forEach(s=>{const o=a[s];lt(o)&&(o.id=s,i.push(o))}):bt(a)&&i.push(...a),dM(i,n.scales)},afterDataLimits(n,t){const e=Mn.get(n);uM(n,t.scale,e.annotations.filter(r=>r.display&&r.adjustScaleRange))},afterUpdate(n,t,e){const r=Mn.get(n);aM(n,r,e),$M(n,r,e,t.mode),r.visibleElements=r.elements.filter(i=>!i.skip&&i.options.display),cM(n,r,e)},beforeDatasetsDraw(n,t,e){ya(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){ya(n,"afterDatasetsDraw",e.clip)},beforeDraw(n,t,e){ya(n,"beforeDraw",e.clip)},afterDraw(n,t,e){ya(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const r=Mn.get(n);sM(r,t.event,e)&&(t.changed=!0)},afterDestroy(n){Mn.delete(n)},_getState(n){return Mn.get(n)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:n=>!QM.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${Tn[Wl(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:Ul,_fallback:!0},_indexable:Ul}},additionalOptionScopes:[""]};function ya(n,t,e){const{ctx:r,chartArea:i}=n,a=Mn.get(n);e&&Er(r,i);const s=ZM(a.visibleElements,t).sort((o,l)=>o.element.options.z-l.element.options.z);for(const o of s)JM(r,i,a,o);e&&Ar(r)}function ZM(n,t){const e=[];for(const r of n)if(r.options.drawTime===t&&e.push({element:r,main:!0}),r.elements&&r.elements.length)for(const i of r.elements)i.options.display&&i.options.drawTime===t&&e.push({element:i});return e}function JM(n,t,e,r){const i=r.element;r.main?(bh(e,i,"beforeDraw"),i.draw(n,t),bh(e,i,"afterDraw")):i.draw(n,t)}const va="24px",Fh=(n,t)=>{const e=n.__vccOpts||n;for(const[r,i]of t)e[r]=i;return e},tD=n=>(h.pushScopeId("data-v-195368ff"),n=n(),h.popScopeId(),n),eD=["aria-hidden"],nD={key:0,"data-testid":"kui-icon-svg-title"},rD=tD(()=>h.createElementVNode("path",{d:"M9 20C8.45 20 7.97917 19.8042 7.5875 19.4125C7.19583 19.0208 7 18.55 7 18C7 17.45 7.19583 16.9792 7.5875 16.5875C7.97917 16.1958 8.45 16 9 16C9.55 16 10.0208 16.1958 10.4125 16.5875C10.8042 16.9792 11 17.45 11 18C11 18.55 10.8042 19.0208 10.4125 19.4125C10.0208 19.8042 9.55 20 9 20ZM15 20C14.45 20 13.9792 19.8042 13.5875 19.4125C13.1958 19.0208 13 18.55 13 18C13 17.45 13.1958 16.9792 13.5875 16.5875C13.9792 16.1958 14.45 16 15 16C15.55 16 16.0208 16.1958 16.4125 16.5875C16.8042 16.9792 17 17.45 17 18C17 18.55 16.8042 19.0208 16.4125 19.4125C16.0208 19.8042 15.55 20 15 20ZM9 14C8.45 14 7.97917 13.8042 7.5875 13.4125C7.19583 13.0208 7 12.55 7 12C7 11.45 7.19583 10.9792 7.5875 10.5875C7.97917 10.1958 8.45 10 9 10C9.55 10 10.0208 10.1958 10.4125 10.5875C10.8042 10.9792 11 11.45 11 12C11 12.55 10.8042 13.0208 10.4125 13.4125C10.0208 13.8042 9.55 14 9 14ZM15 14C14.45 14 13.9792 13.8042 13.5875 13.4125C13.1958 13.0208 13 12.55 13 12C13 11.45 13.1958 10.9792 13.5875 10.5875C13.9792 10.1958 14.45 10 15 10C15.55 10 16.0208 10.1958 16.4125 10.5875C16.8042 10.9792 17 11.45 17 12C17 12.55 16.8042 13.0208 16.4125 13.4125C16.0208 13.8042 15.55 14 15 14ZM9 8C8.45 8 7.97917 7.80417 7.5875 7.4125C7.19583 7.02083 7 6.55 7 6C7 5.45 7.19583 4.97917 7.5875 4.5875C7.97917 4.19583 8.45 4 9 4C9.55 4 10.0208 4.19583 10.4125 4.5875C10.8042 4.97917 11 5.45 11 6C11 6.55 10.8042 7.02083 10.4125 7.4125C10.0208 7.80417 9.55 8 9 8ZM15 8C14.45 8 13.9792 7.80417 13.5875 7.4125C13.1958 7.02083 13 6.55 13 6C13 5.45 13.1958 4.97917 13.5875 4.5875C13.9792 4.19583 14.45 4 15 4C15.55 4 16.0208 4.19583 16.4125 4.5875C16.8042 4.97917 17 5.45 17 6C17 6.55 16.8042 7.02083 16.4125 7.4125C16.0208 7.80417 15.55 8 15 8Z",fill:"currentColor"},null,-1)),iD=h.defineComponent({__name:"DragIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:va,validator:n=>{if(typeof n=="number"&&n>0)return!0;if(typeof n=="string"){const t=String(n).replace(/px/gi,""),e=Number(t);if(e&&!isNaN(e)&&Number.isInteger(e)&&e>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(n){const t=n,e=h.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const i=String(t.size).replace(/px/gi,""),a=Number(i);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return`${a}px`}return va}),r=h.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:e.value,lineHeight:"0",width:e.value}));return(i,a)=>(h.openBlock(),h.createBlock(h.resolveDynamicComponent(n.as),{"aria-hidden":n.decorative?"true":void 0,class:"kui-icon drag-icon","data-testid":"kui-icon-wrapper-drag-icon",style:h.normalizeStyle(r.value)},{default:h.withCtx(()=>[(h.openBlock(),h.createElementBlock("svg",{"aria-hidden":n.decorative?"true":void 0,"data-testid":"kui-icon-svg-drag-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[n.title?(h.openBlock(),h.createElementBlock("title",nD,h.toDisplayString(n.title),1)):h.createCommentVNode("",!0),rD],8,eD))]),_:1},8,["aria-hidden","style"]))}}),aD=Fh(iD,[["__scopeId","data-v-195368ff"]]),sD=n=>(h.pushScopeId("data-v-d7b122fd"),n=n(),h.popScopeId(),n),oD=["aria-hidden"],lD={key:0,"data-testid":"kui-icon-svg-title"},cD=sD(()=>h.createElementVNode("path",{d:"M12.025 22.05C11.7583 22.05 11.5042 22 11.2625 21.9C11.0208 21.8 10.8 21.6583 10.6 21.475L2.575 13.45C2.39167 13.25 2.25 13.0292 2.15 12.7875C2.05 12.5458 2 12.2917 2 12.025C2 11.7583 2.05 11.5 2.15 11.25C2.25 11 2.39167 10.7833 2.575 10.6L10.6 2.575C10.8 2.375 11.0208 2.22917 11.2625 2.1375C11.5042 2.04583 11.7583 2 12.025 2C12.2917 2 12.55 2.04583 12.8 2.1375C13.05 2.22917 13.2667 2.375 13.45 2.575L21.475 10.6C21.675 10.7833 21.8208 11 21.9125 11.25C22.0042 11.5 22.05 11.7583 22.05 12.025C22.05 12.2917 22.0042 12.5458 21.9125 12.7875C21.8208 13.0292 21.675 13.25 21.475 13.45L13.45 21.475C13.2667 21.6583 13.05 21.8 12.8 21.9C12.55 22 12.2917 22.05 12.025 22.05ZM11.025 13.025H13.025V7.025H11.025V13.025ZM12.025 16.025C12.3083 16.025 12.5458 15.9292 12.7375 15.7375C12.9292 15.5458 13.025 15.3083 13.025 15.025C13.025 14.7417 12.9292 14.5042 12.7375 14.3125C12.5458 14.1208 12.3083 14.025 12.025 14.025C11.7417 14.025 11.5042 14.1208 11.3125 14.3125C11.1208 14.5042 11.025 14.7417 11.025 15.025C11.025 15.3083 11.1208 15.5458 11.3125 15.7375C11.5042 15.9292 11.7417 16.025 12.025 16.025Z",fill:"currentColor"},null,-1)),uD=h.defineComponent({__name:"WarningIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:va,validator:n=>{if(typeof n=="number"&&n>0)return!0;if(typeof n=="string"){const t=String(n).replace(/px/gi,""),e=Number(t);if(e&&!isNaN(e)&&Number.isInteger(e)&&e>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(n){const t=n,e=h.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const i=String(t.size).replace(/px/gi,""),a=Number(i);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return`${a}px`}return va}),r=h.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:e.value,lineHeight:"0",width:e.value}));return(i,a)=>(h.openBlock(),h.createBlock(h.resolveDynamicComponent(n.as),{"aria-hidden":n.decorative?"true":void 0,class:"kui-icon warning-icon","data-testid":"kui-icon-wrapper-warning-icon",style:h.normalizeStyle(r.value)},{default:h.withCtx(()=>[(h.openBlock(),h.createElementBlock("svg",{"aria-hidden":n.decorative?"true":void 0,"data-testid":"kui-icon-svg-warning-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[n.title?(h.openBlock(),h.createElementBlock("title",lD,h.toDisplayString(n.title),1)):h.createCommentVNode("",!0),cD],8,oD))]),_:1},8,["aria-hidden","style"]))}}),dD=Fh(uD,[["__scopeId","data-v-d7b122fd"]]),fD="#6c7489",hD="#995c00",gD="20px",pD="40px",mD={class:"tooltip-title"},bD={class:"title font-bold"},yD={key:1,class:"subtitle"},vD={class:"tooltip"},xD={key:0},wD={class:"display-label"},_D={class:"display-value"},TD=h.defineComponent({__name:"ChartTooltip",props:{showTooltip:{type:Boolean,required:!0,default:!1},left:{type:String,required:!1,default:null},top:{type:String,required:!1,default:null},tooltipTitle:{type:String,required:!1,default:""},context:{type:[String,Number],required:!1,default:""},series:{type:Array,required:!0,default:()=>[]},locked:{type:Boolean,required:!1,default:!1}},emits:["dimensions","top","left"],setup(n,{emit:t}){const e=t,r=n,i=h.ref(null),a=h.ref(!1),s=h.ref({x:0,y:0}),o=h.ref({x:0,y:0}),l=h.ref({left:r.left,top:r.top});h.watch(i,g=>{if(g){const{width:v,height:x}=g.getBoundingClientRect();e("dimensions",{width:v,height:x})}}),h.watch(()=>r.locked,g=>{g?(l.value.left=r.left,l.value.top=r.top):g===!1&&(e("top",l.value.top),e("left",l.value.left))});function c(g){if(i.value){a.value=!0;const v=window.getComputedStyle(i.value),x=v.transform||v.webkitTransform||v.mozTransform,p=new DOMMatrix(x),b=p.m41,m=p.m42;s.value={x:b,y:m},o.value={x:g.clientX,y:g.clientY},window.addEventListener("mousemove",d),window.addEventListener("mouseup",f)}}let u=null;function d(g){g.preventDefault(),g.stopPropagation(),a.value&&(u!==null&&window.cancelAnimationFrame(u),u=window.requestAnimationFrame(()=>{const v=g.clientX-o.value.x,x=g.clientY-o.value.y;l.value.left=`${s.value.x+v}px`,l.value.top=`${s.value.y+x}px`}))}function f(){a.value=!1,u!==null&&window.cancelAnimationFrame(u),window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",f)}return(g,v)=>n.showTooltip?(h.openBlock(),h.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:i,class:h.normalizeClass(["tooltip-container",{locked:n.locked}]),style:h.normalizeStyle({transform:n.locked?`translate(${l.value.left}, ${l.value.top})`:`translate(${n.left}, ${n.top})`,left:"0",top:"0",pointerEvents:n.locked?"all":"none"}),onMousedown:c},[h.createElementVNode("div",mD,[h.createElementVNode("span",bD,h.toDisplayString(n.tooltipTitle),1),n.locked?(h.openBlock(),h.createBlock(h.unref(aD),{key:0,class:"drag-icon",color:h.unref(fD)},null,8,["color"])):h.createCommentVNode("",!0),n.context?(h.openBlock(),h.createElementBlock("span",yD,h.toDisplayString(n.context),1)):h.createCommentVNode("",!0)]),h.createElementVNode("ul",vD,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.series,({backgroundColor:x,borderColor:p,label:b,value:m})=>(h.openBlock(),h.createElementBlock(h.Fragment,{key:b},[n.series.length?(h.openBlock(),h.createElementBlock("li",xD,[h.createElementVNode("div",{class:"tooltip-legend",style:h.normalizeStyle({background:x,"border-color":p})},null,4),h.createElementVNode("span",wD,h.toDisplayString(b),1),h.createElementVNode("span",_D,h.toDisplayString(m),1)])):h.createCommentVNode("",!0)],64))),128))])],38)):h.createCommentVNode("",!0)}}),Je=(n,t)=>{const e=n.__vccOpts||n;for(const[r,i]of t)e[r]=i;return e},Hl=Je(TD,[["__scopeId","data-v-d8d2d0cd"]]),MD=["onClick"],DD=["title"],CD={key:0,class:"sub-label"},zl=Je(h.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){const t=n,e=h.ref(),r=h.ref([]),i=h.ref(!1),a=h.inject("showLegendValues",!0),s=h.inject("legendPosition",h.ref(Yt.Right)),o=h.ref([]),l=()=>{const m=e.value;if(!m||!r.value||m.children.length===0)return 0;const y=m.children[0].getBoundingClientRect().top;for(const w of r.value)if(w.getBoundingClientRect().top>y)return!0;return!1},c=()=>{e.value&&s.value===Yt.Bottom?l()?i.value=!0:i.value=!1:e.value&&s.value===Yt.Right&&(i.value=!0)},u=()=>{if(e.value&&s.value===Yt.Bottom){let m=0;r.value.forEach(w=>{const T=Array.from(w.children).reduce((S,k)=>S+k.offsetWidth,0);T>m&&(m=T)});const y=parseInt(pD,10);e.value.style.gridTemplateColumns=`repeat(auto-fit, ${m+y}px)`}c()},d=()=>{if(t.items.length!==o.value.length)return o.value=t.items,!0;for(let m=0;m<t.items.length;m++)if(t.items[m].text!==o.value[m].text)return o.value=t.items,!0;return!1};h.watch(()=>t.items,()=>{d()&&u()},{immediate:!0,flush:"post"});const f=h.ref(0),g=h.ref(0),v=new ResizeObserver(Zd(m=>{const y=m[0],w=y.contentRect.width,T=y.contentRect.height;w!==f.value&&T===g.value&&u(),f.value=w,g.value=T},100));h.watch(()=>s.value,()=>{u()}),h.onMounted(()=>{o.value=t.items,e.value&&v.observe(e.value),window.requestAnimationFrame(()=>{u()})}),h.onBeforeUnmount(()=>{e.value&&v.unobserve(e.value)});const x=(m=0,y)=>{if(t.chartInstance===null)return;const w=t.chartInstance instanceof De?t.chartInstance:t.chartInstance.chart;p(m,y)?w.hide(m,y):w.show(m,y),w.update()},p=(m=0,y)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const w=t.chartInstance instanceof De?t.chartInstance:t.chartInstance.chart,T=w.getDatasetMeta(m);return T.dataset||y===void 0?w.isDatasetVisible(m):!(T.data.length&&T.data[y].hidden)},b=m=>({[Yt.Right]:"vertical",[Yt.Bottom]:"horizontal",[Yt.Hidden]:"hidden"})[m];return(m,y)=>h.unref(s)!==h.unref(Yt).Hidden?(h.openBlock(),h.createElementBlock("ul",{key:0,ref_key:"legendContainerRef",ref:e,class:h.normalizeClass(["legend-container",b(h.unref(s))]),"data-testid":"legend"},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.items,({fillStyle:w,strokeStyle:T,text:S,datasetIndex:k,index:M,value:D})=>(h.openBlock(),h.createElementBlock("li",{key:S,ref_for:!0,ref_key:"legendItemsRef",ref:r,onClick:O=>x(k,M)},[h.createElementVNode("div",{class:"legend",style:h.normalizeStyle({background:w,"border-color":T})},null,4),h.createElementVNode("div",{class:h.normalizeClass(["label-container",{"strike-through":!p(k,M)}])},[h.createElementVNode("div",{class:h.normalizeClass(["label",{"truncate-label":i.value}]),title:S},h.toDisplayString(S),11,DD),D&&h.unref(a)?(h.openBlock(),h.createElementBlock("div",CD,h.toDisplayString(D.formatted),1)):h.createCommentVNode("",!0)],2)],8,MD))),128))],2)):h.createCommentVNode("",!0)}}),[["__scopeId","data-v-6a4f1f3c"]]);let xa;const kD=new Uint8Array(16);function SD(){if(!xa&&(xa=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!xa))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return xa(kD)}const re=[];for(let n=0;n<256;++n)re.push((n+256).toString(16).slice(1));function OD(n,t=0){return re[n[t+0]]+re[n[t+1]]+re[n[t+2]]+re[n[t+3]]+"-"+re[n[t+4]]+re[n[t+5]]+"-"+re[n[t+6]]+re[n[t+7]]+"-"+re[n[t+8]]+re[n[t+9]]+"-"+re[n[t+10]]+re[n[t+11]]+re[n[t+12]]+re[n[t+13]]+re[n[t+14]]+re[n[t+15]]}const Bh={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Dn(n,t,e){if(Bh.randomUUID&&!t&&!n)return Bh.randomUUID();n=n||{};const r=n.random||(n.rng||SD)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){e=e||0;for(let i=0;i<16;++i)t[e+i]=r[i];return t}return OD(r)}const Uh=(n,t)=>{const e=n.ctx,r=n.scales.y,i=n.scales.x,a=t[t.length-1].element;e.save(),e.strokeStyle="rgba(100, 100, 100, 1)",e.lineWidth=3,n.options.indexAxis==="x"?e.strokeRect(a.x-a.width/2,a.y,a.width,r.bottom-a.y):e.strokeRect(i.left,a.y-a.height/2,a.x-i.left,a.height),e.restore()},Wh={id:"highlightPlugin",clicked:!1,afterDatasetsDraw:function(n){this.clickedElements&&this.clickedElements.length&&Uh(n,this.clickedElements)},afterEvent:function(n,{event:t}){var i;if(t.type!=="click"||!t.native)return;this.clicked=!this.clicked;const e=((i=n.options.interaction)==null?void 0:i.mode)||"index",r=n.getElementsAtEventForMode(t.native,e,{intersect:!1},!0);r.length&&this.clicked?(this.clickedElements=r,Uh(n,this.clickedElements),this.previousHoverOption=n.options.hover,n.options.hover={mode:null}):(delete this.clickedElements,n.options.hover=this.previousHoverOption||n.options.hover,this.clicked=!1)},beforeDestroy(n){delete this.clickedElements,n.options.hover=this.previousHoverOption||n.options.hover,this.clicked=!1}},Yh=6,PD="100%",ED="100%",AD=20,RD=20,Hh=6,LD=0,ID=10,ND=10,FD=1,BD=Je(h.defineComponent({__name:"StackedBarChart",props:{chartData:{type:Object,required:!1,default:()=>({labels:[],datasets:[]})},tooltipTitle:{type:String,required:!1,default:""},legendValues:{type:Object,required:!1,default:null},metricUnit:{type:String,required:!1,default:""},orientation:{type:String,required:!1,default:"horizontal",validator:n=>["horizontal","vertical"].includes(n)},annotations:{type:Boolean,required:!1,default:!0},metricAxesTitle:{type:String,required:!1,default:null},dimensionAxesTitle:{type:String,required:!1,default:null},stacked:{type:Boolean,required:!1,default:!0},syntheticsDataKey:{type:String,required:!1,default:""},chartLegendSortFn:{type:Function,required:!1,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,required:!1,default:(n,t)=>t.rawValue-n.rawValue}},setup(n){const t=n,{i18n:e}=kt.useI18n(),{translateUnit:r}=kt.useTranslatedUnits(),i=h.ref(null),a=({chart:L},B)=>{var K;const j=L.data,Z=(K=j.labels)==null?void 0:K.indexOf(B);return j.datasets.reduce((N,R,Q)=>{if(L.isDatasetVisible(Q)){const X=R.data[Z];return isNaN(X)?N:N+X}else return N},0)},s=(L,B,j,Z)=>{const K=Z==="horizontal";B===null&&(B=e.t("entityNoName"));const N={type:"label",yValue:X=>K?B:a(X,B),xValue:X=>K?a(X,B):B},R={...N,position:K?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>K?0:-Math.abs(Q_()),content:X=>Ao(a(X,B),j)},Q={...N,content:X=>Of(a(X,B),Sf(X.chart,L)),position:K?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:X=>K?kf(Ao(a(X,B),j)):0,color:Df};return{[`${B}-value`]:R,[`${B}-percent`]:Q}},o=h.ref(null),l=h.ref(),c=h.ref(Dn()),u=Dn(),d=Dn(),f=h.ref([]),g=h.ref(h.inject("legendPosition",Yt.Right)),v=h.ref({show:!1,top:"0px",left:"0px",text:"",offset:0}),x=h.toRef(t,"metricUnit"),p=h.computed(()=>h.toRef(t,"orientation").value==="horizontal"),b=h.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:x,translateUnit:r,offsetX:0,offsetY:0,width:0,height:0,locked:!1,chartType:p.value?ne.HORIZONTAL_BAR:ne.VERTICAL_BAR,chartTooltipSortFn:t.chartTooltipSortFn}),m=h.ref(0),y=()=>{var L;return t.annotations&&((L=t.chartData.labels)==null?void 0:L.reduce((B,j)=>Object.assign(B,s(t.chartData,j,x.value,t.orientation)),{}))},w={id:c.value,afterUpdate(L){m.value+=1,f.value=L.options.plugins.legend.labels.generateLabels(L).map(B=>({...B,value:t.legendValues&&t.legendValues[B.text]})).sort(t.chartLegendSortFn)}},T={id:u,afterUpdate(L){L.options.plugins.annotation.annotations=t.annotations?y():{}}},M=[w,{id:"axisHover",afterEvent(L,B){if(v.value.show=!1,B.event.type==="mousemove"){const j=B.event,Z=L.options.indexAxis,K=L.scales,N=L.scales[Z].getLabelForValue(Number(L.scales[Z].getValueForPixel(j[Z])));if((Q=>Q==="x"?j.y>K.x.top:j.x<K.y.right)(Z))if(b.locked||(b.showTooltip=!1),N.length>oa){const X=L.canvas.getContext("2d").measureText(N).width,vt=Math.abs(Math.round(j.x-X*.5)),ut=Math.round(j.x+X*.5);v.value.left=Z==="x"?`${(vt>0?vt:ut)-v.value.offset}px`:`${j.x-X*.5-v.value.offset}px`,v.value.top=`${j.y-50}px`,v.value.show=!0,v.value.text=N}else v.value.show=!1;else v.value.show=!1}}},{id:d,afterUpdate(L){L.options.layout.padding.right=p.value?I.value:0}},Wh,...t.annotations?[T]:[]],D=h.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),O=h.ref(0),P=h.ref(0),A=new ResizeObserver(Zd(L=>{O.value=L[0].contentRect.width,P.value=L[0].contentRect.height},100)),F=h.computed(()=>{var B,j;const L=(j=(B=t.chartData)==null?void 0:B.labels)==null?void 0:j.length;return o.value&&L&&!p.value?`${Math.max(L*(AD+Hh),O.value)}px`:PD}),q=h.computed(()=>{var B,j;const L=(j=(B=t.chartData)==null?void 0:B.labels)==null?void 0:j.length;return o.value&&L&&p.value?`${Math.max(L*(RD+Hh),P.value)}px`:ED});kt.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey")),h.onMounted(()=>{t.annotations&&De.register(Nh),i.value&&A.observe(i.value)}),h.onUnmounted(()=>{i.value&&A.unobserve(i.value)});const $=h.computed(()=>{const L=kt.useBarChartOptions({tooltipState:b,legendID:c.value,stacked:h.toRef(t,"stacked"),metricAxesTitle:h.toRef(t,"metricAxesTitle"),dimensionAxesTitle:h.toRef(t,"dimensionAxesTitle"),indexAxis:p.value?"y":"x",numLabels:D});return{...L.value,plugins:{...L.value.plugins,annotation:{annotations:y(),clip:!1}},layout:{autoPadding:!1,padding:{right:0,top:6*Yh}}}}),H=kt.useChartJSCommon("bar",o,h.toRef(t,"chartData"),M,$),I=h.computed(()=>{m.value;const L=t.chartData.labels,B=t.chartData.datasets,j=L.map((N,R)=>B.reduce((Q,X)=>isNaN(Number(X.data[R]))?Q:Q+Number(X.data[R]),0)),Z=H.value?Sf(H.value,t.chartData):Z_(t.chartData);return j.map(N=>kf(Ao(N,x.value)+Of(N,Z))).reduce((N,R)=>Math.max(N,R),0)+Yh});h.onBeforeUnmount(()=>{De.unregister(Nh)});const it={[Yt.Right]:"legend-row",[Yt.Bottom]:"column"},U=h.computed(()=>{if(l.value&&H.value){const L=window.devicePixelRatio,B=H.value,j=B.scales.y.width*L+FD,Z=(B.scales.y.height+B.scales.y.top+B.scales.x.height)*L,K=l.value.getContext("2d");return K.scale(L,L),K.canvas.width=j,K.canvas.height=Z,K.canvas.style.width=`${j/L}px`,K.canvas.style.height=`${Z/L}px`,{scale:L,width:j*L,height:Z*L,targetCtx:K}}return null}),yt=L=>{const B=L.target;if(U.value&&H.value&&!p.value){const j=U.value.scale,Z=U.value.targetCtx,K=U.value.width,N=U.value.height,R=H.value,Q=R.canvas;Z.fillStyle="white",B.scrollLeft>=LD&&B.scrollLeft<=ID?(Z.globalCompositeOperation="source-over",Z.clearRect(0,0,K,N),Z.drawImage(Q,0,0,K,N,0,0,K,N),Z.globalCompositeOperation="destination-over",Z.fillRect(0,0,K,N)):(Z.globalCompositeOperation="source-over",Z.fillRect(0,(R.scales.y.height+R.scales.y.top+ND)*j,K,R.scales.x.height*j))}b.offsetY=B.scrollTop,b.offsetX=B.scrollLeft,v.value.offset=B.scrollLeft},dt=({width:L,height:B})=>{b.width=L,b.height=B};h.watch(()=>t.orientation,()=>{var L;if(l.value&&U.value){const B=U.value.width,j=U.value.height;((L=l.value)==null?void 0:L.getContext("2d")).clearRect(0,0,B,j)}b.showTooltip=!1,b.locked=!1}),h.watch(()=>t.annotations,L=>{H.value&&(L?H.value.options.plugins.annotation.annotations=y(t.chartData):delete H.value.options.plugins.annotation.annotations)});const Y=()=>{b.showTooltip&&(b.locked=!b.locked)};return(L,B)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["chart-parent",it[g.value]])},[h.createElementVNode("canvas",{ref_key:"axis",ref:l,class:"axis"},null,512),h.createElementVNode("div",{ref_key:"chartContainerRef",ref:i,class:"chart-container","on:scroll":yt,onClick:B[0]||(B[0]=j=>Y())},[h.createElementVNode("div",{class:"chart-body",style:h.normalizeStyle({width:F.value,height:q.value})},[h.createElementVNode("canvas",{ref_key:"canvas",ref:o},null,512)],4)],544),v.value.show?(h.openBlock(),h.createElementBlock("div",{key:0,class:"axis-tooltip",style:h.normalizeStyle({top:v.value.top,left:v.value.left})},h.toDisplayString(v.value.text),5)):h.createCommentVNode("",!0),h.createVNode(Hl,{context:b.tooltipContext,left:b.left,locked:b.locked,series:b.tooltipSeries,"show-tooltip":b.showTooltip,"tooltip-title":n.tooltipTitle,top:b.top,onDimensions:dt},null,8,["context","left","locked","series","show-tooltip","tooltip-title","top"]),h.createVNode(zl,{id:c.value,"chart-instance":h.unref(H),items:f.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-969f27ea"]]);/*!
24
+ */const Jf={modes:{point(n,t){return da(n,t,{intersect:!0})},nearest(n,t,e){return LT(n,t,e)},x(n,t,e){return da(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return da(n,t,{intersect:e.intersect,axis:"y"})}}};function Dl(n,t,e){return(Jf.modes[e.mode]||Jf.modes.nearest)(n,t,e)}function AT(n,t,e){return e!=="x"&&e!=="y"?n.inRange(t.x,t.y,"x",!0)||n.inRange(t.x,t.y,"y",!0):n.inRange(t.x,t.y,e,!0)}function RT(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function da(n,t,e){return n.visibleElements.filter(r=>e.intersect?r.inRange(t.x,t.y):AT(r,t,e.axis))}function LT(n,t,e){let r=Number.POSITIVE_INFINITY;return da(n,t,e).reduce((i,a)=>{const s=a.getCenterPoint(),o=RT(t,s,e.axis),l=tr(t,o);return l<r?(i=[a],r=l):l===r&&i.push(a),i},[]).sort((i,a)=>i._index-a._index).slice(0,1)}const IT=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,jn=.001,fa=(n,t,e)=>Math.min(e,Math.max(t,n));function NT(n,t,e){for(const r of Object.keys(n))n[r]=fa(n[r],t,e);return n}function FT(n,t,e,r){if(!n||!t||e<=0)return!1;const i=r/2;return Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2)<=Math.pow(e+i,2)}function th(n,{x:t,y:e,x2:r,y2:i},a,s){const o=s/2,l=n.x>=t-o-jn&&n.x<=r+o+jn,c=n.y>=e-o-jn&&n.y<=i+o+jn;return a==="x"?l:(a==="y"||l)&&c}function gr(n,t){const{centerX:e,centerY:r}=n.getProps(["centerX","centerY"],t);return{x:e,y:r}}function BT(n,t,e,r=!0){const i=e.split(".");let a=0;for(const s of t.split(".")){const o=i[a++];if(parseInt(s,10)<parseInt(o,10))break;if(IT(o,s)){if(r)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const eh=n=>typeof n=="string"&&n.endsWith("%"),nh=n=>parseFloat(n)/100,rh=n=>fa(nh(n),0,1),ha=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),UT={box:n=>ha(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>ha(n.centerX,n.centerY),line:n=>ha(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>ha(n.centerX,n.centerY)};function Cl(n,t){return t==="start"?0:t==="end"?n:eh(t)?rh(t)*n:n/2}function wn(n,t,e=!0){return typeof t=="number"?t:eh(t)?(e?rh(t):nh(t))*n:n}function WT(n,t){const{x:e,width:r}=n,i=t.textAlign;return i==="center"?e+r/2:i==="end"||i==="right"?e+r:e}function kl(n,t="center"){return ct(n)?{x:rt(n.x,t),y:rt(n.y,t)}:(n=rt(n,t),{x:n,y:n})}function ih(n){return n&&(fe(n.xValue)||fe(n.yValue))}function oi(n,t,e){const r=e.init;if(r){if(r===!0)return sh(t,e)}else return;return YT(n,t,e)}function ah(n,t,e){let r=!1;return t.forEach(i=>{he(n[i])?(r=!0,e[i]=n[i]):fe(e[i])&&delete e[i]}),r}function sh(n,t){const e=t.type||"line";return UT[e](n)}function YT(n,t,e){const r=Mt(e.init,[{chart:n,properties:t,options:e}]);if(r===!0)return sh(t,e);if(ct(r))return r}const Sl=new Map,HT=n=>isNaN(n)||n<=0,zT=n=>n.reduce(function(t,e){return t+=e.string,t},"");function ga(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function Ol(n,{x:t,y:e},r){r&&(n.translate(t,e),n.rotate(Gt(r)),n.translate(-t,-e))}function _n(n,t){if(t&&t.borderWidth)return n.lineCap=t.borderCapStyle,n.setLineDash(t.borderDash),n.lineDashOffset=t.borderDashOffset,n.lineJoin=t.borderJoinStyle,n.lineWidth=t.borderWidth,n.strokeStyle=t.borderColor,!0}function pr(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function Pl(n,t){const e=t.content;if(ga(e))return{width:wn(e.width,t.width),height:wn(e.height,t.height)};const r=t.font,i=bt(r)?r.map(l=>Rt(l)):[Rt(r)],a=t.textStrokeWidth,s=bt(e)?e:[e],o=s.join()+zT(i)+a+(n._measureText?"-spriting":"");return Sl.has(o)||Sl.set(o,XT(n,s,i,a)),Sl.get(o)}function oh(n,t,e){const{x:r,y:i,width:a,height:s}=t;n.save(),pr(n,e);const o=_n(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),er(n,{x:r,y:i,w:a,h:s,radius:NT(hn(e.borderRadius),0,Math.min(a,s)/2)}),n.closePath(),n.fill(),o&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function $T(n,t,e){const r=e.content;if(ga(r)){n.save(),n.globalAlpha=QT(e.opacity,r.style.opacity),n.drawImage(r,t.x,t.y,t.width,t.height),n.restore();return}const i=bt(r)?r:[r],a=e.font,s=bt(a)?a.map(d=>Rt(d)):[Rt(a)],o=e.color,l=bt(o)?o:[o],c=WT(t,e),u=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,jT(n,e)&&GT(n,{x:c,y:u},i,s),KT(n,{x:c,y:u},i,{fonts:s,colors:l}),n.restore()}function jT(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function VT(n,t,e,r){const{radius:i,options:a}=t,s=a.pointStyle,o=a.rotation;let l=(o||0)*Wa;if(ga(s)){n.save(),n.translate(e,r),n.rotate(l),n.drawImage(s,-s.width/2,-s.height/2,s.width,s.height),n.restore();return}HT(i)||qT(n,{x:e,y:r,radius:i,rotation:o,style:s,rad:l})}function qT(n,{x:t,y:e,radius:r,rotation:i,style:a,rad:s}){let o,l,c,u;switch(n.beginPath(),a){default:n.arc(t,e,r,0,Ot),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(s)*r,e-Math.cos(s)*r),s+=wi,n.lineTo(t+Math.sin(s)*r,e-Math.cos(s)*r),s+=wi,n.lineTo(t+Math.sin(s)*r,e-Math.cos(s)*r),n.closePath();break;case"rectRounded":u=r*.516,c=r-u,o=Math.cos(s+Me)*c,l=Math.sin(s+Me)*c,n.arc(t-o,e-l,u,s-ft,s-At),n.arc(t+l,e-o,u,s-At,s),n.arc(t+o,e+l,u,s,s+At),n.arc(t-l,e+o,u,s+At,s+ft),n.closePath();break;case"rect":if(!i){c=Math.SQRT1_2*r,n.rect(t-c,e-c,2*c,2*c);break}s+=Me;case"rectRot":o=Math.cos(s)*r,l=Math.sin(s)*r,n.moveTo(t-o,e-l),n.lineTo(t+l,e-o),n.lineTo(t+o,e+l),n.lineTo(t-l,e+o),n.closePath();break;case"crossRot":s+=Me;case"cross":o=Math.cos(s)*r,l=Math.sin(s)*r,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o);break;case"star":o=Math.cos(s)*r,l=Math.sin(s)*r,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o),s+=Me,o=Math.cos(s)*r,l=Math.sin(s)*r,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o);break;case"line":o=Math.cos(s)*r,l=Math.sin(s)*r,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l);break;case"dash":n.moveTo(t,e),n.lineTo(t+Math.cos(s)*r,e+Math.sin(s)*r);break}n.fill()}function XT(n,t,e,r){n.save();const i=t.length;let a=0,s=r;for(let o=0;o<i;o++){const l=e[Math.min(o,e.length-1)];n.font=l.string;const c=t[o];a=Math.max(a,n.measureText(c).width+r),s+=l.lineHeight}return n.restore(),{width:a,height:s}}function GT(n,{x:t,y:e},r,i){n.beginPath();let a=0;r.forEach(function(s,o){const l=i[Math.min(o,i.length-1)],c=l.lineHeight;n.font=l.string,n.strokeText(s,t,e+c/2+a),a+=c}),n.stroke()}function KT(n,{x:t,y:e},r,{fonts:i,colors:a}){let s=0;r.forEach(function(o,l){const c=a[Math.min(l,a.length-1)],u=i[Math.min(l,i.length-1)],d=u.lineHeight;n.beginPath(),n.font=u.string,n.fillStyle=c,n.fillText(o,t,e+d/2+s),s+=d,n.fill()})}function QT(n,t){const e=fn(n)?n:t;return fn(e)?fa(e,0,1):1}const lh={xScaleID:{min:"xMin",max:"xMax",start:"left",end:"right",startProp:"x",endProp:"x2"},yScaleID:{min:"yMin",max:"yMax",start:"bottom",end:"top",startProp:"y",endProp:"y2"}};function mr(n,t,e){return t=typeof t=="number"?t:n.parse(t),Nt(t)?n.getPixelForValue(t):e}function Vn(n,t,e){const r=t[e];if(r||e==="scaleID")return r;const i=e.charAt(0),a=Object.values(n).filter(s=>s.axis&&s.axis===i);return a.length?a[0].id:i}function ch(n,t){if(n){const e=n.options.reverse,r=mr(n,t.min,e?t.end:t.start),i=mr(n,t.max,e?t.start:t.end);return{start:r,end:i}}}function uh(n,t){const{chartArea:e,scales:r}=n,i=r[Vn(r,t,"xScaleID")],a=r[Vn(r,t,"yScaleID")];let s=e.width/2,o=e.height/2;return i&&(s=mr(i,t.xValue,i.left+i.width/2)),a&&(o=mr(a,t.yValue,a.top+a.height/2)),{x:s,y:o}}function El(n,t){const e=n.scales,r=e[Vn(e,t,"xScaleID")],i=e[Vn(e,t,"yScaleID")];if(!r&&!i)return{};let{left:a,right:s}=r||n.chartArea,{top:o,bottom:l}=i||n.chartArea;const c=hh(r,{min:t.xMin,max:t.xMax,start:a,end:s});a=c.start,s=c.end;const u=hh(i,{min:t.yMin,max:t.yMax,start:l,end:o});return o=u.start,l=u.end,{x:a,y:o,x2:s,y2:l,width:s-a,height:l-o,centerX:a+(s-a)/2,centerY:o+(l-o)/2}}function dh(n,t){if(!ih(t)){const e=El(n,t);let r=t.radius;(!r||isNaN(r))&&(r=Math.min(e.width,e.height)/2,t.radius=r);const i=r*2,a=e.centerX+t.xAdjust,s=e.centerY+t.yAdjust;return{x:a-r,y:s-r,x2:a+r,y2:s+r,centerX:a,centerY:s,width:i,height:i,radius:r}}return JT(n,t)}function ZT(n,t){const{scales:e,chartArea:r}=n,i=e[t.scaleID],a={x:r.left,y:r.top,x2:r.right,y2:r.bottom};return i?tM(i,a,t):eM(e,a,t),a}function fh(n,t){const e=El(n,t);return e.initProperties=oi(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:iM(n,e,t),initProperties:e.initProperties}],e}function JT(n,t){const e=uh(n,t),r=t.radius*2;return{x:e.x-t.radius+t.xAdjust,y:e.y-t.radius+t.yAdjust,x2:e.x+t.radius+t.xAdjust,y2:e.y+t.radius+t.yAdjust,centerX:e.x+t.xAdjust,centerY:e.y+t.yAdjust,radius:t.radius,width:r,height:r}}function hh(n,t){const e=ch(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function tM(n,t,e){const r=mr(n,e.value,NaN),i=mr(n,e.endValue,r);n.isHorizontal()?(t.x=r,t.x2=i):(t.y=r,t.y2=i)}function eM(n,t,e){for(const r of Object.keys(lh)){const i=n[Vn(n,e,r)];if(i){const{min:a,max:s,start:o,end:l,startProp:c,endProp:u}=lh[r],d=ch(i,{min:e[a],max:e[s],start:i[o],end:i[l]});t[c]=d.start,t[u]=d.end}}}function nM({properties:n,options:t},e,r,i){const{x:a,x2:s,width:o}=n;return gh({start:a,end:s,size:o,borderWidth:t.borderWidth},{position:r.x,padding:{start:i.left,end:i.right},adjust:t.label.xAdjust,size:e.width})}function rM({properties:n,options:t},e,r,i){const{y:a,y2:s,height:o}=n;return gh({start:a,end:s,size:o,borderWidth:t.borderWidth},{position:r.y,padding:{start:i.top,end:i.bottom},adjust:t.label.yAdjust,size:e.height})}function gh(n,t){const{start:e,end:r,borderWidth:i}=n,{position:a,padding:{start:s,end:o},adjust:l}=t,c=r-i-e-s-o-t.size;return e+i/2+l+Cl(c,a)}function iM(n,t,e){const r=e.label;r.backgroundColor="transparent",r.callout.display=!1;const i=kl(r.position),a=Kt(r.padding),s=Pl(n.ctx,r),o=nM({properties:t,options:e},s,i,a),l=rM({properties:t,options:e},s,i,a),c=s.width+a.width,u=s.height+a.height;return{x:o,y:l,x2:o+c,y2:l+u,width:c,height:u,centerX:o+c/2,centerY:l+u/2,rotation:r.rotation}}function qn(n,t,e){const r=Math.cos(e),i=Math.sin(e),a=t.x,s=t.y;return{x:a+r*(n.x-a)-i*(n.y-s),y:s+i*(n.x-a)+r*(n.y-s)}}const Al=["enter","leave"],Rl=Al.concat("click");function aM(n,t,e){t.listened=ah(e,Rl,t.listeners),t.moveListened=!1,t._getElements=Dl,Al.forEach(r=>{he(e[r])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(r=>{!t.listened&&he(r.click)&&(t.listened=!0),t.moveListened||Al.forEach(i=>{he(r[i])&&(t.listened=!0,t.moveListened=!0)})})}function sM(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return oM(n,t,e);case"click":return lM(n,t,e)}}function oM(n,t,e){if(!n.moveListened)return;let r;t.type==="mousemove"?r=Dl(n,t,e.interaction):r=[];const i=n.hovered;n.hovered=r;const a={state:n,event:t};let s=ph(a,"leave",i,r);return ph(a,"enter",r,i)||s}function ph({state:n,event:t},e,r,i){let a;for(const s of r)i.indexOf(s)<0&&(a=mh(s.options[e]||n.listeners[e],s,t)||a);return a}function lM(n,t,e){const r=n.listeners,i=Dl(n,t,e.interaction);let a;for(const s of i)a=mh(s.options.click||r.click,s,t)||a;return a}function mh(n,t,e){return Mt(n,[t.$context,e])===!0}const pa=["afterDraw","beforeDraw"];function cM(n,t,e){const r=t.visibleElements;t.hooked=ah(e,pa,t.hooks),t.hooked||r.forEach(i=>{t.hooked||pa.forEach(a=>{he(i.options[a])&&(t.hooked=!0)})})}function bh(n,t,e){if(n.hooked){const r=t.options[e]||n.hooks[e];return Mt(r,[t.$context])}}function uM(n,t,e){const r=pM(n.scales,t,e);let i=yh(t,r,"min","suggestedMin");i=yh(t,r,"max","suggestedMax")||i,i&&he(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function dM(n,t){for(const e of n)hM(e,t)}function yh(n,t,e,r){if(Nt(t[e])&&!fM(n.options,e,r)){const i=n[e]!==t[e];return n[e]=t[e],i}}function fM(n,t,e){return fe(n[t])||fe(n[e])}function hM(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const r=Vn(t,n,e);r&&!t[r]&&gM(n,e)&&console.warn(`No scale found with id '${r}' for annotation '${n.id}'`)}}function gM(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const r of["Min","Max","Value"])if(fe(n[e+r]))return!0;return!1}function pM(n,t,e){const r=t.axis,i=t.id,a=r+"ScaleID",s={min:rt(t.min,Number.NEGATIVE_INFINITY),max:rt(t.max,Number.POSITIVE_INFINITY)};for(const o of e)o.scaleID===i?vh(o,t,["value","endValue"],s):Vn(n,o,a)===i&&vh(o,t,[r+"Min",r+"Max",r+"Value"],s);return s}function vh(n,t,e,r){for(const i of e){const a=n[i];if(fe(a)){const s=t.parse(a);r.min=Math.min(r.min,s),r.max=Math.max(r.max,s)}}}class br extends ee{inRange(t,e,r,i){const{x:a,y:s}=qn({x:t,y:e},this.getCenterPoint(i),Gt(-this.options.rotation));return th({x:a,y:s},this.getProps(["x","y","x2","y2"],i),r,this.options.borderWidth)}getCenterPoint(t){return gr(this,t)}draw(t){t.save(),Ol(t,this.getCenterPoint(),this.options.rotation),oh(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return fh(t,e)}}br.id="boxAnnotation",br.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,label:{backgroundColor:"transparent",borderWidth:0,callout:{display:!1},color:"black",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,opacity:void 0,padding:6,position:"center",rotation:void 0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},br.defaultRoutes={borderColor:"color",backgroundColor:"color"},br.descriptors={label:{_fallback:!0}};const xh=["left","bottom","top","right"];class li extends ee{inRange(t,e,r,i){const{x:a,y:s}=qn({x:t,y:e},this.getCenterPoint(i),Gt(-this.rotation));return th({x:a,y:s},this.getProps(["x","y","x2","y2"],i),r,this.options.borderWidth)}getCenterPoint(t){return gr(this,t)}draw(t){const e=this.options,r=!fe(this._visible)||this._visible;!e.display||!e.content||!r||(t.save(),Ol(t,this.getCenterPoint(),this.rotation),bM(t,this),oh(t,this,e),$T(t,MM(this),e),t.restore())}resolveElementProperties(t,e){let r;if(ih(e))r=uh(t,e);else{const{centerX:o,centerY:l}=El(t,e);r={x:o,y:l}}const i=Kt(e.padding),a=Pl(t.ctx,e),s=mM(r,a,e,i);return{initProperties:oi(t,s,e),pointX:r.x,pointY:r.y,...s,rotation:e.rotation}}}li.id="labelAnnotation",li.defaults={adjustScaleRange:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:!1,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,init:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},li.defaultRoutes={borderColor:"color"};function mM(n,t,e,r){const i=t.width+r.width+e.borderWidth,a=t.height+r.height+e.borderWidth,s=kl(e.position,"center"),o=wh(n.x,i,e.xAdjust,s.x),l=wh(n.y,a,e.yAdjust,s.y);return{x:o,y:l,x2:o+i,y2:l+a,width:i,height:a,centerX:o+i/2,centerY:l+a/2}}function wh(n,t,e=0,r){return n-Cl(t,r)+e}function bM(n,t){const{pointX:e,pointY:r,options:i}=t,a=i.callout,s=a&&a.display&&_M(t,a);if(!s||DM(t,a,s))return;if(n.save(),n.beginPath(),!_n(n,a))return n.restore();const{separatorStart:l,separatorEnd:c}=yM(t,s),{sideStart:u,sideEnd:d}=xM(t,s,l);(a.margin>0||i.borderWidth===0)&&(n.moveTo(l.x,l.y),n.lineTo(c.x,c.y)),n.moveTo(u.x,u.y),n.lineTo(d.x,d.y);const f=qn({x:e,y:r},t.getCenterPoint(),Gt(-t.rotation));n.lineTo(f.x,f.y),n.stroke(),n.restore()}function yM(n,t){const{x:e,y:r,x2:i,y2:a}=n,s=vM(n,t);let o,l;return t==="left"||t==="right"?(o={x:e+s,y:r},l={x:o.x,y:a}):(o={x:e,y:r+s},l={x:i,y:o.y}),{separatorStart:o,separatorEnd:l}}function vM(n,t){const{width:e,height:r,options:i}=n,a=i.callout.margin+i.borderWidth/2;return t==="right"?e+a:t==="bottom"?r+a:-a}function xM(n,t,e){const{y:r,width:i,height:a,options:s}=n,o=s.callout.start,l=wM(t,s.callout);let c,u;return t==="left"||t==="right"?(c={x:e.x,y:r+wn(a,o)},u={x:c.x+l,y:c.y}):(c={x:e.x+wn(i,o),y:e.y},u={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:u}}function wM(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function _M(n,t){const e=t.position;return xh.includes(e)?e:TM(n,t)}function TM(n,t){const{x:e,y:r,x2:i,y2:a,width:s,height:o,pointX:l,pointY:c,centerX:u,centerY:d,rotation:f}=n,g={x:u,y:d},v=t.start,x=wn(s,v),p=wn(o,v),b=[e,e+x,e+x,i],m=[r+p,a,r,a],y=[];for(let w=0;w<4;w++){const T=qn({x:b[w],y:m[w]},g,Gt(f));y.push({position:xh[w],distance:tr(T,{x:l,y:c})})}return y.sort((w,T)=>w.distance-T.distance)[0].position}function MM({x:n,y:t,width:e,height:r,options:i}){const a=i.borderWidth/2,s=Kt(i.padding);return{x:n+s.left+a,y:t+s.top+a,width:e-s.left-s.right-i.borderWidth,height:r-s.top-s.bottom-i.borderWidth}}function DM(n,t,e){const{pointX:r,pointY:i}=n,a=t.margin;let s=r,o=i;return e==="left"?s+=a:e==="right"?s-=a:e==="top"?o+=a:e==="bottom"&&(o-=a),n.inRange(s,o)}const Ll=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),Il=(n,t,e)=>Ll(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,_h=(n,t,e)=>Ll(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,ci=n=>n*n,CM=(n,t,{x:e,y:r,x2:i,y2:a},s)=>s==="y"?{start:Math.min(r,a),end:Math.max(r,a),value:t}:{start:Math.min(e,i),end:Math.max(e,i),value:n},Th=(n,t,e,r)=>(1-r)*(1-r)*n+2*(1-r)*r*t+r*r*e,Nl=(n,t,e,r)=>({x:Th(n.x,t.x,e.x,r),y:Th(n.y,t.y,e.y,r)}),Mh=(n,t,e,r)=>2*(1-r)*(t-n)+2*r*(e-t),Dh=(n,t,e,r)=>-Math.atan2(Mh(n.x,t.x,e.x,r),Mh(n.y,t.y,e.y,r))+.5*ft;class ui extends ee{inRange(t,e,r,i){const a=this.options.borderWidth/2;if(r!=="x"&&r!=="y"){const s={mouseX:t,mouseY:e},{path:o,ctx:l}=this;if(o){_n(l,this.options);const{chart:u}=this.$context,d=t*u.currentDevicePixelRatio,f=e*u.currentDevicePixelRatio,g=l.isPointInStroke(o,d,f)||Fl(this,s,i);return l.restore(),g}const c=ci(a);return PM(this,s,c,i)||Fl(this,s,i)}return kM(this,{mouseX:t,mouseY:e},r,{hBorderWidth:a,useFinalPosition:i})}getCenterPoint(t){return gr(this,t)}draw(t){const{x:e,y:r,x2:i,y2:a,cp:s,options:o}=this;if(t.save(),!_n(t,o))return t.restore();pr(t,o);const l=Math.sqrt(Math.pow(i-e,2)+Math.pow(a-r,2));if(o.curve&&s)return BM(t,this,s,l),t.restore();const{startOpts:c,endOpts:u,startAdjust:d,endAdjust:f}=Ph(this),g=Math.atan2(a-r,i-e);t.translate(e,r),t.rotate(g),t.beginPath(),t.moveTo(0+d,0),t.lineTo(l-f,0),t.shadowColor=o.borderShadowColor,t.stroke(),Bl(t,0,d,c),Bl(t,l,-f,u),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const r=ZT(t,e),{x:i,y:a,x2:s,y2:o}=r,l=SM(r,t.chartArea),c=l?OM({x:i,y:a},{x:s,y:o},t.chartArea):{x:i,y:a,x2:s,y2:o,width:Math.abs(s-i),height:Math.abs(o-a)};if(c.centerX=(s+i)/2,c.centerY=(o+a)/2,c.initProperties=oi(t,c,e),e.curve){const d={x:c.x,y:c.y},f={x:c.x2,y:c.y2};c.cp=FM(c,e,tr(d,f))}const u=EM(t,c,e.label);return u._visible=l,c.elements=[{type:"label",optionScope:"label",properties:u,initProperties:c.initProperties}],c}}ui.id="lineAnnotation";const Ch={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};ui.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},Ch),fill:!1,length:12,start:Object.assign({},Ch),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},li.defaults.callout),color:"#fff",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},ui.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},ui.defaultRoutes={borderColor:"color"};function kM(n,{mouseX:t,mouseY:e},r,{hBorderWidth:i,useFinalPosition:a}){const s=CM(t,e,n.getProps(["x","y","x2","y2"],a),r);return s.value>=s.start-i&&s.value<=s.end+i||Fl(n,{mouseX:t,mouseY:e},a,r)}function SM({x:n,y:t,x2:e,y2:r},{top:i,right:a,bottom:s,left:o}){return!(n<o&&e<o||n>a&&e>a||t<i&&r<i||t>s&&r>s)}function kh({x:n,y:t},e,{top:r,right:i,bottom:a,left:s}){return n<s&&(t=_h(s,{x:n,y:t},e),n=s),n>i&&(t=_h(i,{x:n,y:t},e),n=i),t<r&&(n=Il(r,{x:n,y:t},e),t=r),t>a&&(n=Il(a,{x:n,y:t},e),t=a),{x:n,y:t}}function OM(n,t,e){const{x:r,y:i}=kh(n,t,e),{x:a,y:s}=kh(t,n,e);return{x:r,y:i,x2:a,y2:s,width:Math.abs(a-r),height:Math.abs(s-i)}}function PM(n,{mouseX:t,mouseY:e},r=jn,i){const{x:a,y:s,x2:o,y2:l}=n.getProps(["x","y","x2","y2"],i),c=o-a,u=l-s,d=ci(c)+ci(u),f=d===0?-1:((t-a)*c+(e-s)*u)/d;let g,v;return f<0?(g=a,v=s):f>1?(g=o,v=l):(g=a+f*c,v=s+f*u),ci(t-g)+ci(e-v)<=r}function Fl(n,{mouseX:t,mouseY:e},r,i){const a=n.label;return a.options.display&&a.inRange(t,e,i,r)}function EM(n,t,e){const r=e.borderWidth,i=Kt(e.padding),a=Pl(n.ctx,e),s=a.width+i.width+r,o=a.height+i.height+r;return RM(t,e,{width:s,height:o,padding:i},n.chartArea)}function AM(n){const{x:t,y:e,x2:r,y2:i}=n,a=Math.atan2(i-e,r-t);return a>ft/2?a-ft:a<ft/-2?a+ft:a}function RM(n,t,e,r){const{width:i,height:a,padding:s}=e,{xAdjust:o,yAdjust:l}=t,c={x:n.x,y:n.y},u={x:n.x2,y:n.y2},d=t.rotation==="auto"?AM(n):Gt(t.rotation),f=LM(i,a,d),g=IM(n,t,{labelSize:f,padding:s},r),v=n.cp?Nl(c,n.cp,u,g):Ll(c,u,g),x={size:f.w,min:r.left,max:r.right,padding:s.left},p={size:f.h,min:r.top,max:r.bottom,padding:s.top},b=Oh(v.x,x)+o,m=Oh(v.y,p)+l;return{x:b-i/2,y:m-a/2,x2:b+i/2,y2:m+a/2,centerX:b,centerY:m,pointX:v.x,pointY:v.y,width:i,height:a,rotation:_i(d)}}function LM(n,t,e){const r=Math.cos(e),i=Math.sin(e);return{w:Math.abs(n*r)+Math.abs(t*i),h:Math.abs(n*i)+Math.abs(t*r)}}function IM(n,t,e,r){let i;const a=NM(n,r);return t.position==="start"?i=Sh({w:n.x2-n.x,h:n.y2-n.y},e,t,a):t.position==="end"?i=1-Sh({w:n.x-n.x2,h:n.y-n.y2},e,t,a):i=Cl(1,t.position),i}function Sh(n,t,e,r){const{labelSize:i,padding:a}=t,s=n.w*r.dx,o=n.h*r.dy,l=s>0&&(i.w/2+a.left-r.x)/s,c=o>0&&(i.h/2+a.top-r.y)/o;return fa(Math.max(l,c),0,.25)}function NM(n,t){const{x:e,x2:r,y:i,y2:a}=n,s=Math.min(i,a)-t.top,o=Math.min(e,r)-t.left,l=t.bottom-Math.max(i,a),c=t.right-Math.max(e,r);return{x:Math.min(o,c),y:Math.min(s,l),dx:o<=c?1:-1,dy:s<=l?1:-1}}function Oh(n,t){const{size:e,min:r,max:i,padding:a}=t,s=e/2;return e>i-r?(i+r)/2:(r>=n-a-s&&(n=r+a+s),i<=n+a+s&&(n=i-a-s),n)}function Ph(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,r=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:r,startAdjust:Eh(n,e),endAdjust:Eh(n,r)}}function Eh(n,t){if(!t||!t.display)return 0;const{length:e,width:r}=t,i=n.options.borderWidth/2,a={x:e,y:r+i};return Math.abs(Il(0,a,{x:0,y:i}))}function Bl(n,t,e,r){if(!r||!r.display)return;const{length:i,width:a,fill:s,backgroundColor:o,borderColor:l}=r,c=Math.abs(t-i)+e;n.beginPath(),pr(n,r),_n(n,r),n.moveTo(c,-a),n.lineTo(t+e,0),n.lineTo(c,a),s===!0?(n.fillStyle=o||l,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=r.borderShadowColor,n.stroke()}function FM(n,t,e){const{x:r,y:i,x2:a,y2:s,centerX:o,centerY:l}=n,c=Math.atan2(s-i,a-r),u=kl(t.controlPoint,0),d={x:o+wn(e,u.x,!1),y:l+wn(e,u.y,!1)};return qn(d,{x:o,y:l},c)}function Ah(n,{x:t,y:e},{angle:r,adjust:i},a){!a||!a.display||(n.save(),n.translate(t,e),n.rotate(r),Bl(n,0,-i,a),n.restore())}function BM(n,t,e,r){const{x:i,y:a,x2:s,y2:o,options:l}=t,{startOpts:c,endOpts:u,startAdjust:d,endAdjust:f}=Ph(t),g={x:i,y:a},v={x:s,y:o},x=Dh(g,e,v,0),p=Dh(g,e,v,1)-ft,b=Nl(g,e,v,d/r),m=Nl(g,e,v,1-f/r),y=new Path2D;n.beginPath(),y.moveTo(b.x,b.y),y.quadraticCurveTo(e.x,e.y,m.x,m.y),n.shadowColor=l.borderShadowColor,n.stroke(y),t.path=y,t.ctx=n,Ah(n,b,{angle:x,adjust:d},c),Ah(n,m,{angle:p,adjust:f},u)}class di extends ee{inRange(t,e,r,i){const a=this.options.rotation,s=this.options.borderWidth;if(r!=="x"&&r!=="y")return UM({x:t,y:e},this.getProps(["width","height","centerX","centerY"],i),a,s);const{x:o,y:l,x2:c,y2:u}=this.getProps(["x","y","x2","y2"],i),d=s/2,f=r==="y"?{start:l,end:u}:{start:o,end:c},g=qn({x:t,y:e},this.getCenterPoint(i),Gt(-a));return g[r]>=f.start-d-jn&&g[r]<=f.end+d+jn}getCenterPoint(t){return gr(this,t)}draw(t){const{width:e,height:r,centerX:i,centerY:a,options:s}=this;t.save(),Ol(t,this.getCenterPoint(),s.rotation),pr(t,this.options),t.beginPath(),t.fillStyle=s.backgroundColor;const o=_n(t,s);t.ellipse(i,a,r/2,e/2,ft/2,0,2*ft),t.fill(),o&&(t.shadowColor=s.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return fh(t,e)}}di.id="ellipseAnnotation",di.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,label:Object.assign({},br.defaults.label),rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},di.defaultRoutes={borderColor:"color",backgroundColor:"color"},di.descriptors={label:{_fallback:!0}};function UM(n,t,e,r){const{width:i,height:a,centerX:s,centerY:o}=t,l=i/2,c=a/2;if(l<=0||c<=0)return!1;const u=Gt(e||0),d=r/2||0,f=Math.cos(u),g=Math.sin(u),v=Math.pow(f*(n.x-s)+g*(n.y-o),2),x=Math.pow(g*(n.x-s)-f*(n.y-o),2);return v/Math.pow(l+d,2)+x/Math.pow(c+d,2)<=1.0001}class ma extends ee{inRange(t,e,r,i){const{x:a,y:s,x2:o,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],i),u=this.options.borderWidth;if(r!=="x"&&r!=="y")return FT({x:t,y:e},this.getCenterPoint(i),c/2,u);const d=u/2,f=r==="y"?{start:s,end:l,value:e}:{start:a,end:o,value:t};return f.value>=f.start-d&&f.value<=f.end+d}getCenterPoint(t){return gr(this,t)}draw(t){const e=this.options,r=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,pr(t,e);const i=_n(t,e);VT(t,this,this.centerX,this.centerY),i&&!ga(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=r}resolveElementProperties(t,e){const r=dh(t,e);return r.initProperties=oi(t,r,e),r}}ma.id="pointAnnotation",ma.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,pointStyle:"circle",radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},ma.defaultRoutes={borderColor:"color",backgroundColor:"color"};class ba extends ee{inRange(t,e,r,i){if(r!=="x"&&r!=="y")return this.options.radius>=.1&&this.elements.length>1&&YM(this.elements,t,e,i);const a=qn({x:t,y:e},this.getCenterPoint(i),Gt(-this.options.rotation)),s=this.elements.map(c=>r==="y"?c.bY:c.bX),o=Math.min(...s),l=Math.max(...s);return a[r]>=o&&a[r]<=l}getCenterPoint(t){return gr(this,t)}draw(t){const{elements:e,options:r}=this;t.save(),t.beginPath(),t.fillStyle=r.backgroundColor,pr(t,r);const i=_n(t,r);let a=!0;for(const s of e)a?(t.moveTo(s.x,s.y),a=!1):t.lineTo(s.x,s.y);t.closePath(),t.fill(),i&&(t.shadowColor=r.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,e){const r=dh(t,e),{sides:i,rotation:a}=e,s=[],o=2*ft/i;let l=a*Wa;for(let c=0;c<i;c++,l+=o){const u=WM(r,e,l);u.initProperties=oi(t,r,e),s.push(u)}return r.elements=s,r}}ba.id="polygonAnnotation",ba.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,point:{radius:0},radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,sides:3,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},ba.defaultRoutes={borderColor:"color",backgroundColor:"color"};function WM({centerX:n,centerY:t},{radius:e,borderWidth:r},i){const a=r/2,s=Math.sin(i),o=Math.cos(i),l={x:n+s*e,y:t-o*e};return{type:"point",optionScope:"point",properties:{x:l.x,y:l.y,centerX:l.x,centerY:l.y,bX:n+s*(e+a),bY:t-o*(e+a)}}}function YM(n,t,e,r){let i=!1,a=n[n.length-1].getProps(["bX","bY"],r);for(const s of n){const o=s.getProps(["bX","bY"],r);o.bY>e!=a.bY>e&&t<(a.bX-o.bX)*(e-o.bY)/(a.bY-o.bY)+o.bX&&(i=!i),a=o}return i}const Tn={box:br,ellipse:di,label:li,line:ui,point:ma,polygon:ba};Object.keys(Tn).forEach(n=>{Ut.describe(`elements.${Tn[n].id}`,{_fallback:"plugins.annotation.common"})});const HM={update:Object.assign},zM=Rl.concat(pa),Rh=(n,t)=>ct(t)?Yl(n,t):n,Ul=n=>n==="color"||n==="font";function Wl(n="line"){return Tn[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function $M(n,t,e,r){const i=VM(n,e.animations,r),a=t.annotations,s=GM(t.elements,a);for(let o=0;o<a.length;o++){const l=a[o],c=Lh(s,o,l.type),u=l.setContext(XM(n,c,l)),d=c.resolveElementProperties(n,u);d.skip=jM(d),"elements"in d&&(qM(c,d.elements,u,i),delete d.elements),fe(c.x)||Object.assign(c,d),Object.assign(c,d.initProperties),d.options=Ih(u),i.update(c,d)}}function jM(n){return isNaN(n.x)||isNaN(n.y)}function VM(n,t,e){return e==="reset"||e==="none"||e==="resize"?HM:new ts(n,t)}function qM(n,t,e,r){const i=n.elements||(n.elements=[]);i.length=t.length;for(let a=0;a<t.length;a++){const s=t[a],o=s.properties,l=Lh(i,a,s.type,s.initProperties),c=e[s.optionScope].override(s);o.options=Ih(c),r.update(l,o)}}function Lh(n,t,e,r){const i=Tn[Wl(e)];let a=n[t];return(!a||!(a instanceof i))&&(a=n[t]=new i,Object.assign(a,r)),a}function Ih(n){const t=Tn[Wl(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,Yl(n,t.defaults),Yl(n,t.defaultRoutes));for(const r of zM)e[r]=n[r];return e}function Yl(n,t){const e={};for(const r of Object.keys(t)){const i=t[r],a=n[r];Ul(r)&&bt(a)?e[r]=a.map(s=>Rh(s,i)):e[r]=Rh(a,i)}return e}function XM(n,t,e){return t.$context||(t.$context=Object.assign(Object.create(n.getContext()),{element:t,id:e.id,type:"annotation"}))}function GM(n,t){const e=t.length,r=n.length;if(r<e){const i=e-r;n.splice(r,0,...new Array(i))}else r>e&&n.splice(e,r-e);return n}var KM="3.0.1";const Mn=new Map,QM=Rl.concat(pa);var Nh={id:"annotation",version:KM,beforeRegister(){BT("chart.js","4.0",De.version)},afterRegister(){De.register(Tn)},afterUnregister(){De.unregister(Tn)},beforeInit(n){Mn.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const r=Mn.get(n),i=r.annotations=[];let a=e.annotations;ct(a)?Object.keys(a).forEach(s=>{const o=a[s];ct(o)&&(o.id=s,i.push(o))}):bt(a)&&i.push(...a),dM(i,n.scales)},afterDataLimits(n,t){const e=Mn.get(n);uM(n,t.scale,e.annotations.filter(r=>r.display&&r.adjustScaleRange))},afterUpdate(n,t,e){const r=Mn.get(n);aM(n,r,e),$M(n,r,e,t.mode),r.visibleElements=r.elements.filter(i=>!i.skip&&i.options.display),cM(n,r,e)},beforeDatasetsDraw(n,t,e){ya(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){ya(n,"afterDatasetsDraw",e.clip)},beforeDraw(n,t,e){ya(n,"beforeDraw",e.clip)},afterDraw(n,t,e){ya(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const r=Mn.get(n);sM(r,t.event,e)&&(t.changed=!0)},afterDestroy(n){Mn.delete(n)},_getState(n){return Mn.get(n)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:n=>!QM.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${Tn[Wl(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:Ul,_fallback:!0},_indexable:Ul}},additionalOptionScopes:[""]};function ya(n,t,e){const{ctx:r,chartArea:i}=n,a=Mn.get(n);e&&Er(r,i);const s=ZM(a.visibleElements,t).sort((o,l)=>o.element.options.z-l.element.options.z);for(const o of s)JM(r,i,a,o);e&&Ar(r)}function ZM(n,t){const e=[];for(const r of n)if(r.options.drawTime===t&&e.push({element:r,main:!0}),r.elements&&r.elements.length)for(const i of r.elements)i.options.display&&i.options.drawTime===t&&e.push({element:i});return e}function JM(n,t,e,r){const i=r.element;r.main?(bh(e,i,"beforeDraw"),i.draw(n,t),bh(e,i,"afterDraw")):i.draw(n,t)}const va="24px",Fh=(n,t)=>{const e=n.__vccOpts||n;for(const[r,i]of t)e[r]=i;return e},tD=n=>(h.pushScopeId("data-v-195368ff"),n=n(),h.popScopeId(),n),eD=["aria-hidden"],nD={key:0,"data-testid":"kui-icon-svg-title"},rD=tD(()=>h.createElementVNode("path",{d:"M9 20C8.45 20 7.97917 19.8042 7.5875 19.4125C7.19583 19.0208 7 18.55 7 18C7 17.45 7.19583 16.9792 7.5875 16.5875C7.97917 16.1958 8.45 16 9 16C9.55 16 10.0208 16.1958 10.4125 16.5875C10.8042 16.9792 11 17.45 11 18C11 18.55 10.8042 19.0208 10.4125 19.4125C10.0208 19.8042 9.55 20 9 20ZM15 20C14.45 20 13.9792 19.8042 13.5875 19.4125C13.1958 19.0208 13 18.55 13 18C13 17.45 13.1958 16.9792 13.5875 16.5875C13.9792 16.1958 14.45 16 15 16C15.55 16 16.0208 16.1958 16.4125 16.5875C16.8042 16.9792 17 17.45 17 18C17 18.55 16.8042 19.0208 16.4125 19.4125C16.0208 19.8042 15.55 20 15 20ZM9 14C8.45 14 7.97917 13.8042 7.5875 13.4125C7.19583 13.0208 7 12.55 7 12C7 11.45 7.19583 10.9792 7.5875 10.5875C7.97917 10.1958 8.45 10 9 10C9.55 10 10.0208 10.1958 10.4125 10.5875C10.8042 10.9792 11 11.45 11 12C11 12.55 10.8042 13.0208 10.4125 13.4125C10.0208 13.8042 9.55 14 9 14ZM15 14C14.45 14 13.9792 13.8042 13.5875 13.4125C13.1958 13.0208 13 12.55 13 12C13 11.45 13.1958 10.9792 13.5875 10.5875C13.9792 10.1958 14.45 10 15 10C15.55 10 16.0208 10.1958 16.4125 10.5875C16.8042 10.9792 17 11.45 17 12C17 12.55 16.8042 13.0208 16.4125 13.4125C16.0208 13.8042 15.55 14 15 14ZM9 8C8.45 8 7.97917 7.80417 7.5875 7.4125C7.19583 7.02083 7 6.55 7 6C7 5.45 7.19583 4.97917 7.5875 4.5875C7.97917 4.19583 8.45 4 9 4C9.55 4 10.0208 4.19583 10.4125 4.5875C10.8042 4.97917 11 5.45 11 6C11 6.55 10.8042 7.02083 10.4125 7.4125C10.0208 7.80417 9.55 8 9 8ZM15 8C14.45 8 13.9792 7.80417 13.5875 7.4125C13.1958 7.02083 13 6.55 13 6C13 5.45 13.1958 4.97917 13.5875 4.5875C13.9792 4.19583 14.45 4 15 4C15.55 4 16.0208 4.19583 16.4125 4.5875C16.8042 4.97917 17 5.45 17 6C17 6.55 16.8042 7.02083 16.4125 7.4125C16.0208 7.80417 15.55 8 15 8Z",fill:"currentColor"},null,-1)),iD=h.defineComponent({__name:"DragIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:va,validator:n=>{if(typeof n=="number"&&n>0)return!0;if(typeof n=="string"){const t=String(n).replace(/px/gi,""),e=Number(t);if(e&&!isNaN(e)&&Number.isInteger(e)&&e>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(n){const t=n,e=h.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const i=String(t.size).replace(/px/gi,""),a=Number(i);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return`${a}px`}return va}),r=h.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:e.value,lineHeight:"0",width:e.value}));return(i,a)=>(h.openBlock(),h.createBlock(h.resolveDynamicComponent(n.as),{"aria-hidden":n.decorative?"true":void 0,class:"kui-icon drag-icon","data-testid":"kui-icon-wrapper-drag-icon",style:h.normalizeStyle(r.value)},{default:h.withCtx(()=>[(h.openBlock(),h.createElementBlock("svg",{"aria-hidden":n.decorative?"true":void 0,"data-testid":"kui-icon-svg-drag-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[n.title?(h.openBlock(),h.createElementBlock("title",nD,h.toDisplayString(n.title),1)):h.createCommentVNode("",!0),rD],8,eD))]),_:1},8,["aria-hidden","style"]))}}),aD=Fh(iD,[["__scopeId","data-v-195368ff"]]),sD=n=>(h.pushScopeId("data-v-d7b122fd"),n=n(),h.popScopeId(),n),oD=["aria-hidden"],lD={key:0,"data-testid":"kui-icon-svg-title"},cD=sD(()=>h.createElementVNode("path",{d:"M12.025 22.05C11.7583 22.05 11.5042 22 11.2625 21.9C11.0208 21.8 10.8 21.6583 10.6 21.475L2.575 13.45C2.39167 13.25 2.25 13.0292 2.15 12.7875C2.05 12.5458 2 12.2917 2 12.025C2 11.7583 2.05 11.5 2.15 11.25C2.25 11 2.39167 10.7833 2.575 10.6L10.6 2.575C10.8 2.375 11.0208 2.22917 11.2625 2.1375C11.5042 2.04583 11.7583 2 12.025 2C12.2917 2 12.55 2.04583 12.8 2.1375C13.05 2.22917 13.2667 2.375 13.45 2.575L21.475 10.6C21.675 10.7833 21.8208 11 21.9125 11.25C22.0042 11.5 22.05 11.7583 22.05 12.025C22.05 12.2917 22.0042 12.5458 21.9125 12.7875C21.8208 13.0292 21.675 13.25 21.475 13.45L13.45 21.475C13.2667 21.6583 13.05 21.8 12.8 21.9C12.55 22 12.2917 22.05 12.025 22.05ZM11.025 13.025H13.025V7.025H11.025V13.025ZM12.025 16.025C12.3083 16.025 12.5458 15.9292 12.7375 15.7375C12.9292 15.5458 13.025 15.3083 13.025 15.025C13.025 14.7417 12.9292 14.5042 12.7375 14.3125C12.5458 14.1208 12.3083 14.025 12.025 14.025C11.7417 14.025 11.5042 14.1208 11.3125 14.3125C11.1208 14.5042 11.025 14.7417 11.025 15.025C11.025 15.3083 11.1208 15.5458 11.3125 15.7375C11.5042 15.9292 11.7417 16.025 12.025 16.025Z",fill:"currentColor"},null,-1)),uD=h.defineComponent({__name:"WarningIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:va,validator:n=>{if(typeof n=="number"&&n>0)return!0;if(typeof n=="string"){const t=String(n).replace(/px/gi,""),e=Number(t);if(e&&!isNaN(e)&&Number.isInteger(e)&&e>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(n){const t=n,e=h.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const i=String(t.size).replace(/px/gi,""),a=Number(i);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return`${a}px`}return va}),r=h.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:e.value,lineHeight:"0",width:e.value}));return(i,a)=>(h.openBlock(),h.createBlock(h.resolveDynamicComponent(n.as),{"aria-hidden":n.decorative?"true":void 0,class:"kui-icon warning-icon","data-testid":"kui-icon-wrapper-warning-icon",style:h.normalizeStyle(r.value)},{default:h.withCtx(()=>[(h.openBlock(),h.createElementBlock("svg",{"aria-hidden":n.decorative?"true":void 0,"data-testid":"kui-icon-svg-warning-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[n.title?(h.openBlock(),h.createElementBlock("title",lD,h.toDisplayString(n.title),1)):h.createCommentVNode("",!0),cD],8,oD))]),_:1},8,["aria-hidden","style"]))}}),dD=Fh(uD,[["__scopeId","data-v-d7b122fd"]]),fD="#6c7489",hD="#995c00",gD="20px",pD="40px",mD={class:"tooltip-title"},bD={class:"title font-bold"},yD={key:1,class:"subtitle"},vD={class:"tooltip"},xD={key:0},wD={class:"display-label"},_D={class:"display-value"},TD=h.defineComponent({__name:"ChartTooltip",props:{showTooltip:{type:Boolean,required:!0,default:!1},left:{type:String,required:!1,default:null},top:{type:String,required:!1,default:null},tooltipTitle:{type:String,required:!1,default:""},context:{type:[String,Number],required:!1,default:""},series:{type:Array,required:!0,default:()=>[]},locked:{type:Boolean,required:!1,default:!1}},emits:["dimensions","top","left"],setup(n,{emit:t}){const e=t,r=n,i=h.ref(null),a=h.ref(!1),s=h.ref({x:0,y:0}),o=h.ref({x:0,y:0}),l=h.ref({left:r.left,top:r.top});h.watch(i,g=>{if(g){const{width:v,height:x}=g.getBoundingClientRect();e("dimensions",{width:v,height:x})}}),h.watch(()=>r.locked,g=>{g?(l.value.left=r.left,l.value.top=r.top):g===!1&&(e("top",l.value.top),e("left",l.value.left))});function c(g){if(i.value){a.value=!0;const v=window.getComputedStyle(i.value),x=v.transform||v.webkitTransform||v.mozTransform,p=new DOMMatrix(x),b=p.m41,m=p.m42;s.value={x:b,y:m},o.value={x:g.clientX,y:g.clientY},window.addEventListener("mousemove",d),window.addEventListener("mouseup",f)}}let u=null;function d(g){g.preventDefault(),g.stopPropagation(),a.value&&(u!==null&&window.cancelAnimationFrame(u),u=window.requestAnimationFrame(()=>{const v=g.clientX-o.value.x,x=g.clientY-o.value.y;l.value.left=`${s.value.x+v}px`,l.value.top=`${s.value.y+x}px`}))}function f(){a.value=!1,u!==null&&window.cancelAnimationFrame(u),window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",f)}return(g,v)=>n.showTooltip?(h.openBlock(),h.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:i,class:h.normalizeClass(["tooltip-container",{locked:n.locked}]),style:h.normalizeStyle({transform:n.locked?`translate(${l.value.left}, ${l.value.top})`:`translate(${n.left}, ${n.top})`,left:"0",top:"0",pointerEvents:n.locked?"all":"none"}),onMousedown:c},[h.createElementVNode("div",mD,[h.createElementVNode("span",bD,h.toDisplayString(n.tooltipTitle),1),n.locked?(h.openBlock(),h.createBlock(h.unref(aD),{key:0,class:"drag-icon",color:h.unref(fD)},null,8,["color"])):h.createCommentVNode("",!0),n.context?(h.openBlock(),h.createElementBlock("span",yD,h.toDisplayString(n.context),1)):h.createCommentVNode("",!0)]),h.createElementVNode("ul",vD,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.series,({backgroundColor:x,borderColor:p,label:b,value:m})=>(h.openBlock(),h.createElementBlock(h.Fragment,{key:b},[n.series.length?(h.openBlock(),h.createElementBlock("li",xD,[h.createElementVNode("div",{class:"tooltip-legend",style:h.normalizeStyle({background:x,"border-color":p})},null,4),h.createElementVNode("span",wD,h.toDisplayString(b),1),h.createElementVNode("span",_D,h.toDisplayString(m),1)])):h.createCommentVNode("",!0)],64))),128))])],38)):h.createCommentVNode("",!0)}}),Je=(n,t)=>{const e=n.__vccOpts||n;for(const[r,i]of t)e[r]=i;return e},Hl=Je(TD,[["__scopeId","data-v-d8d2d0cd"]]),MD=["onClick"],DD=["title"],CD={key:0,class:"sub-label"},zl=Je(h.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){const t=n,e=h.ref(),r=h.ref([]),i=h.ref(!1),a=h.inject("showLegendValues",!0),s=h.inject("legendPosition",h.ref(Yt.Right)),o=h.ref([]),l=()=>{const m=e.value;if(!m||!r.value||m.children.length===0)return 0;const y=m.children[0].getBoundingClientRect().top;for(const w of r.value)if(w.getBoundingClientRect().top>y)return!0;return!1},c=()=>{e.value&&s.value===Yt.Bottom?l()?i.value=!0:i.value=!1:e.value&&s.value===Yt.Right&&(i.value=!0)},u=()=>{if(e.value&&s.value===Yt.Bottom){let m=0;r.value.forEach(w=>{const T=Array.from(w.children).reduce((S,k)=>S+k.offsetWidth,0);T>m&&(m=T)});const y=parseInt(pD,10);e.value.style.gridTemplateColumns=`repeat(auto-fit, ${m+y}px)`}c()},d=()=>{if(t.items.length!==o.value.length)return o.value=t.items,!0;for(let m=0;m<t.items.length;m++)if(t.items[m].text!==o.value[m].text)return o.value=t.items,!0;return!1};h.watch(()=>t.items,()=>{d()&&u()},{immediate:!0,flush:"post"});const f=h.ref(0),g=h.ref(0),v=new ResizeObserver(Zd(m=>{const y=m[0],w=y.contentRect.width,T=y.contentRect.height;w!==f.value&&T===g.value&&u(),f.value=w,g.value=T},100));h.watch(()=>s.value,()=>{u()}),h.onMounted(()=>{o.value=t.items,e.value&&v.observe(e.value),window.requestAnimationFrame(()=>{u()})}),h.onBeforeUnmount(()=>{e.value&&v.unobserve(e.value)});const x=(m=0,y)=>{if(t.chartInstance===null)return;const w=t.chartInstance instanceof De?t.chartInstance:t.chartInstance.chart;p(m,y)?w.hide(m,y):w.show(m,y),w.update()},p=(m=0,y)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const w=t.chartInstance instanceof De?t.chartInstance:t.chartInstance.chart,T=w.getDatasetMeta(m);return T.dataset||y===void 0?w.isDatasetVisible(m):!(T.data.length&&T.data[y].hidden)},b=m=>({[Yt.Right]:"vertical",[Yt.Bottom]:"horizontal",[Yt.Hidden]:"hidden"})[m];return(m,y)=>h.unref(s)!==h.unref(Yt).Hidden?(h.openBlock(),h.createElementBlock("ul",{key:0,ref_key:"legendContainerRef",ref:e,class:h.normalizeClass(["legend-container",b(h.unref(s))]),"data-testid":"legend"},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.items,({fillStyle:w,strokeStyle:T,text:S,datasetIndex:k,index:M,value:D})=>(h.openBlock(),h.createElementBlock("li",{key:S,ref_for:!0,ref_key:"legendItemsRef",ref:r,onClick:O=>x(k,M)},[h.createElementVNode("div",{class:"legend",style:h.normalizeStyle({background:w,"border-color":T})},null,4),h.createElementVNode("div",{class:h.normalizeClass(["label-container",{"strike-through":!p(k,M)}])},[h.createElementVNode("div",{class:h.normalizeClass(["label",{"truncate-label":i.value}]),title:S},h.toDisplayString(S),11,DD),D&&h.unref(a)?(h.openBlock(),h.createElementBlock("div",CD,h.toDisplayString(D.formatted),1)):h.createCommentVNode("",!0)],2)],8,MD))),128))],2)):h.createCommentVNode("",!0)}}),[["__scopeId","data-v-6a4f1f3c"]]);let xa;const kD=new Uint8Array(16);function SD(){if(!xa&&(xa=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!xa))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return xa(kD)}const re=[];for(let n=0;n<256;++n)re.push((n+256).toString(16).slice(1));function OD(n,t=0){return re[n[t+0]]+re[n[t+1]]+re[n[t+2]]+re[n[t+3]]+"-"+re[n[t+4]]+re[n[t+5]]+"-"+re[n[t+6]]+re[n[t+7]]+"-"+re[n[t+8]]+re[n[t+9]]+"-"+re[n[t+10]]+re[n[t+11]]+re[n[t+12]]+re[n[t+13]]+re[n[t+14]]+re[n[t+15]]}const Bh={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Dn(n,t,e){if(Bh.randomUUID&&!t&&!n)return Bh.randomUUID();n=n||{};const r=n.random||(n.rng||SD)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){e=e||0;for(let i=0;i<16;++i)t[e+i]=r[i];return t}return OD(r)}const Uh=(n,t)=>{const e=n.ctx,r=n.scales.y,i=n.scales.x,a=t[t.length-1].element;e.save(),e.strokeStyle="rgba(100, 100, 100, 1)",e.lineWidth=3,n.options.indexAxis==="x"?e.strokeRect(a.x-a.width/2,a.y,a.width,r.bottom-a.y):e.strokeRect(i.left,a.y-a.height/2,a.x-i.left,a.height),e.restore()},Wh={id:"highlightPlugin",clicked:!1,afterDatasetsDraw:function(n){this.clickedElements&&this.clickedElements.length&&Uh(n,this.clickedElements)},afterEvent:function(n,{event:t}){var i;if(t.type!=="click"||!t.native)return;this.clicked=!this.clicked;const e=((i=n.options.interaction)==null?void 0:i.mode)||"index",r=n.getElementsAtEventForMode(t.native,e,{intersect:!1},!0);r.length&&this.clicked?(this.clickedElements=r,Uh(n,this.clickedElements),this.previousHoverOption=n.options.hover,n.options.hover={mode:null}):(delete this.clickedElements,n.options.hover=this.previousHoverOption||n.options.hover,this.clicked=!1)},beforeDestroy(n){delete this.clickedElements,n.options.hover=this.previousHoverOption||n.options.hover,this.clicked=!1}},Yh=6,PD="100%",ED="100%",AD=20,RD=20,Hh=6,LD=0,ID=10,ND=10,FD=1,BD=Je(h.defineComponent({__name:"StackedBarChart",props:{chartData:{type:Object,required:!1,default:()=>({labels:[],datasets:[]})},tooltipTitle:{type:String,required:!1,default:""},legendValues:{type:Object,required:!1,default:null},metricUnit:{type:String,required:!1,default:""},orientation:{type:String,required:!1,default:"horizontal",validator:n=>["horizontal","vertical"].includes(n)},annotations:{type:Boolean,required:!1,default:!0},metricAxesTitle:{type:String,required:!1,default:null},dimensionAxesTitle:{type:String,required:!1,default:null},stacked:{type:Boolean,required:!1,default:!0},syntheticsDataKey:{type:String,required:!1,default:""},chartLegendSortFn:{type:Function,required:!1,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,required:!1,default:(n,t)=>t.rawValue-n.rawValue}},setup(n){const t=n,{i18n:e}=kt.useI18n(),{translateUnit:r}=kt.useTranslatedUnits(),i=h.ref(null),a=({chart:L},B)=>{var K;const j=L.data,Z=(K=j.labels)==null?void 0:K.indexOf(B);return j.datasets.reduce((N,R,Q)=>{if(L.isDatasetVisible(Q)){const X=R.data[Z];return isNaN(X)?N:N+X}else return N},0)},s=(L,B,j,Z)=>{const K=Z==="horizontal";B===null&&(B=e.t("entityNoName"));const N={type:"label",yValue:X=>K?B:a(X,B),xValue:X=>K?a(X,B):B},R={...N,position:K?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>K?0:-Math.abs(Q_()),content:X=>Ao(a(X,B),j)},Q={...N,content:X=>Of(a(X,B),Sf(X.chart,L)),position:K?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:X=>K?kf(Ao(a(X,B),j)):0,color:Df};return{[`${B}-value`]:R,[`${B}-percent`]:Q}},o=h.ref(null),l=h.ref(),c=h.ref(Dn()),u=Dn(),d=Dn(),f=h.ref([]),g=h.ref(h.inject("legendPosition",Yt.Right)),v=h.ref({show:!1,top:"0px",left:"0px",text:"",offset:0}),x=h.toRef(t,"metricUnit"),p=h.computed(()=>h.toRef(t,"orientation").value==="horizontal"),b=h.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:x,translateUnit:r,offsetX:0,offsetY:0,width:0,height:0,locked:!1,chartType:p.value?ne.HORIZONTAL_BAR:ne.VERTICAL_BAR,chartTooltipSortFn:t.chartTooltipSortFn}),m=h.ref(0),y=()=>{var L;return t.annotations&&((L=t.chartData.labels)==null?void 0:L.reduce((B,j)=>Object.assign(B,s(t.chartData,j,x.value,t.orientation)),{}))},w={id:c.value,afterUpdate(L){m.value+=1,f.value=L.options.plugins.legend.labels.generateLabels(L).map(B=>({...B,value:t.legendValues&&t.legendValues[B.text]})).sort(t.chartLegendSortFn)}},T={id:u,afterUpdate(L){L.options.plugins.annotation.annotations=t.annotations?y():{}}},M=[w,{id:"axisHover",afterEvent(L,B){if(v.value.show=!1,B.event.type==="mousemove"){const j=B.event,Z=L.options.indexAxis,K=L.scales,N=L.scales[Z].getLabelForValue(Number(L.scales[Z].getValueForPixel(j[Z])));if((Q=>Q==="x"?j.y>K.x.top:j.x<K.y.right)(Z))if(b.locked||(b.showTooltip=!1),N.length>oa){const X=L.canvas.getContext("2d").measureText(N).width,vt=Math.abs(Math.round(j.x-X*.5)),ut=Math.round(j.x+X*.5);v.value.left=Z==="x"?`${(vt>0?vt:ut)-v.value.offset}px`:`${j.x-X*.5-v.value.offset}px`,v.value.top=`${j.y-50}px`,v.value.show=!0,v.value.text=N}else v.value.show=!1;else v.value.show=!1}}},{id:d,afterUpdate(L){L.options.layout.padding.right=p.value?I.value:0}},Wh,...t.annotations?[T]:[]],D=h.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),O=h.ref(0),P=h.ref(0),A=new ResizeObserver(Zd(L=>{O.value=L[0].contentRect.width,P.value=L[0].contentRect.height},100)),F=h.computed(()=>{var B,j;const L=(j=(B=t.chartData)==null?void 0:B.labels)==null?void 0:j.length;return o.value&&L&&!p.value?`${Math.max(L*(AD+Hh),O.value)}px`:PD}),q=h.computed(()=>{var B,j;const L=(j=(B=t.chartData)==null?void 0:B.labels)==null?void 0:j.length;return o.value&&L&&p.value?`${Math.max(L*(RD+Hh),P.value)}px`:ED});kt.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey")),h.onMounted(()=>{t.annotations&&De.register(Nh),i.value&&A.observe(i.value)}),h.onUnmounted(()=>{i.value&&A.unobserve(i.value)});const $=h.computed(()=>{const L=kt.useBarChartOptions({tooltipState:b,legendID:c.value,stacked:h.toRef(t,"stacked"),metricAxesTitle:h.toRef(t,"metricAxesTitle"),dimensionAxesTitle:h.toRef(t,"dimensionAxesTitle"),indexAxis:p.value?"y":"x",numLabels:D});return{...L.value,plugins:{...L.value.plugins,annotation:{annotations:y(),clip:!1}},layout:{autoPadding:!1,padding:{right:0,top:6*Yh}}}}),H=kt.useChartJSCommon("bar",o,h.toRef(t,"chartData"),M,$),I=h.computed(()=>{m.value;const L=t.chartData.labels,B=t.chartData.datasets,j=L.map((N,R)=>B.reduce((Q,X)=>isNaN(Number(X.data[R]))?Q:Q+Number(X.data[R]),0)),Z=H.value?Sf(H.value,t.chartData):Z_(t.chartData);return j.map(N=>kf(Ao(N,x.value)+Of(N,Z))).reduce((N,R)=>Math.max(N,R),0)+Yh});h.onBeforeUnmount(()=>{De.unregister(Nh)});const it={[Yt.Right]:"legend-row",[Yt.Bottom]:"column"},U=h.computed(()=>{if(l.value&&H.value){const L=window.devicePixelRatio,B=H.value,j=B.scales.y.width*L+FD,Z=(B.scales.y.height+B.scales.y.top+B.scales.x.height)*L,K=l.value.getContext("2d");return K.scale(L,L),K.canvas.width=j,K.canvas.height=Z,K.canvas.style.width=`${j/L}px`,K.canvas.style.height=`${Z/L}px`,{scale:L,width:j*L,height:Z*L,targetCtx:K}}return null}),yt=L=>{const B=L.target;if(U.value&&H.value&&!p.value){const j=U.value.scale,Z=U.value.targetCtx,K=U.value.width,N=U.value.height,R=H.value,Q=R.canvas;Z.fillStyle="white",B.scrollLeft>=LD&&B.scrollLeft<=ID?(Z.globalCompositeOperation="source-over",Z.clearRect(0,0,K,N),Z.drawImage(Q,0,0,K,N,0,0,K,N),Z.globalCompositeOperation="destination-over",Z.fillRect(0,0,K,N)):(Z.globalCompositeOperation="source-over",Z.fillRect(0,(R.scales.y.height+R.scales.y.top+ND)*j,K,R.scales.x.height*j))}b.offsetY=B.scrollTop,b.offsetX=B.scrollLeft,v.value.offset=B.scrollLeft},dt=({width:L,height:B})=>{b.width=L,b.height=B};h.watch(()=>t.orientation,()=>{var L;if(l.value&&U.value){const B=U.value.width,j=U.value.height;((L=l.value)==null?void 0:L.getContext("2d")).clearRect(0,0,B,j)}b.showTooltip=!1,b.locked=!1}),h.watch(()=>t.annotations,L=>{H.value&&(L?H.value.options.plugins.annotation.annotations=y(t.chartData):delete H.value.options.plugins.annotation.annotations)});const Y=()=>{b.showTooltip&&(b.locked=!b.locked)};return(L,B)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["chart-parent",it[g.value]])},[h.createElementVNode("canvas",{ref_key:"axis",ref:l,class:"axis"},null,512),h.createElementVNode("div",{ref_key:"chartContainerRef",ref:i,class:"chart-container","on:scroll":yt,onClick:B[0]||(B[0]=j=>Y())},[h.createElementVNode("div",{class:"chart-body",style:h.normalizeStyle({width:F.value,height:q.value})},[h.createElementVNode("canvas",{ref_key:"canvas",ref:o},null,512)],4)],544),v.value.show?(h.openBlock(),h.createElementBlock("div",{key:0,class:"axis-tooltip",style:h.normalizeStyle({top:v.value.top,left:v.value.left})},h.toDisplayString(v.value.text),5)):h.createCommentVNode("",!0),h.createVNode(Hl,{context:b.tooltipContext,left:b.left,locked:b.locked,series:b.tooltipSeries,"show-tooltip":b.showTooltip,"tooltip-title":n.tooltipTitle,top:b.top,onDimensions:dt},null,8,["context","left","locked","series","show-tooltip","tooltip-title","top"]),h.createVNode(zl,{id:c.value,"chart-instance":h.unref(H),items:f.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-969f27ea"]]);/*!
25
25
  * chartjs-adapter-date-fns v3.0.0
26
26
  * https://www.chartjs.org
27
27
  * (c) 2022 chartjs-adapter-date-fns Contributors
28
28
  * Released under the MIT license
29
- */const UD={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"};uu._date.override({_id:"date-fns",formats:function(){return UD},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=nt(n):e==="string"&&(typeof t=="string"?n=sw(n,t,new Date,this.options):n=Kd(n,this.options)),Os(n)?n.getTime():null},format:function(n,t){return ox(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return Kr(n,t);case"second":return Iy(n,t);case"minute":return Ry(n,t);case"hour":return Sy(n,t);case"day":return Td(n,t);case"week":return Ny(n,t);case"month":return ks(n,t);case"quarter":return Ly(n,t);case"year":return Fy(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return Zi(n,t);case"second":return qy(n,t);case"minute":return $y(n,t);case"hour":return zy(n,t);case"day":return Cd(n,t);case"week":return Xy(n,t);case"month":return Pd(n,t);case"quarter":return Vy(n,t);case"year":return Gy(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return cw(n);case"minute":return Ky(n);case"hour":return lw(n);case"day":return Ss(n);case"week":return Md(n);case"isoWeek":return Md(n,{weekStartsOn:+e});case"month":return Zy(n);case"quarter":return Qy(n);case"year":return tv(n);default:return n}},endOf:function(n,t){switch(t){case"second":return av(n);case"minute":return rv(n);case"hour":return ev(n);case"day":return Sd(n);case"week":return nv(n);case"month":return Od(n);case"quarter":return iv(n);case"year":return Jy(n);default:return n}}});const zh={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},WD={type:{type:String,required:!0},...zh,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},YD=h.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function yr(n){return h.isProxy(n)?h.toRaw(n):n}function HD(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return h.isProxy(t)?new Proxy(n,{}):n}function zD(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function $h(n,t){n.labels=t}function jh(n,t,e){const r=[];n.datasets=t.map(i=>{const a=n.datasets.find(s=>s[e]===i[e]);return!a||!i.data||r.includes(a)?{...i}:(r.push(a),Object.assign(a,i),a)})}function $D(n,t){const e={labels:[],datasets:[]};return $h(e,n.labels),jh(e,n.datasets,t),e}const jD=h.defineComponent({props:WD,setup(n,t){let{expose:e,slots:r}=t;const i=h.ref(null),a=h.shallowRef(null);e({chart:a});const s=()=>{if(!i.value)return;const{type:c,data:u,options:d,plugins:f,datasetIdKey:g}=n,v=$D(u,g),x=HD(v,u);a.value=new De(i.value,{type:c,data:x,options:{...d},plugins:f})},o=()=>{const c=h.toRaw(a.value);c&&(c.destroy(),a.value=null)},l=c=>{c.update(n.updateMode)};return h.onMounted(s),h.onBeforeUnmount(o),h.watch([()=>n.options,()=>n.data],(c,u)=>{let[d,f]=c,[g,v]=u;const x=h.toRaw(a.value);if(!x)return;let p=!1;if(d){const b=yr(d),m=yr(g);b&&b!==m&&(zD(x,b),p=!0)}if(f){const b=yr(f.labels),m=yr(v.labels),y=yr(f.datasets),w=yr(v.datasets);b!==m&&($h(x.config.data,b),p=!0),y&&y!==w&&(jh(x.config.data,y,n.datasetIdKey),p=!0)}p&&h.nextTick(()=>{l(x)})},{deep:!0}),()=>h.h("canvas",{role:"img",ariaLabel:n.ariaLabel,ariaDescribedby:n.ariaDescribedby,ref:i},[h.h("p",{},[r.default?r.default():""])])}});function $l(n,t){return De.register(t),h.defineComponent({props:zh,setup(e,r){let{expose:i}=r;const a=h.shallowRef(null),s=o=>{a.value=o==null?void 0:o.chart};return i({chart:a}),()=>h.h(jD,YD({ref:s},{type:n,...e}))}})}const VD=$l("bar",Ir),Vh=$l("doughnut",mn),qD=$l("line",Nr),XD={class:"chart-container"},GD=h.defineComponent({__name:"DoughnutChart",props:{chartData:{type:Object,required:!1,default:null},fill:{type:Boolean,required:!1,default:!1},tooltipTitle:{type:String,required:!0},metricUnit:{type:String,required:!1,default:""},legendPosition:{type:String,required:!1,default:Yt.Right},legendValues:{type:Object,required:!1,default:null},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:Ce}},setup(n){const t=n,{translateUnit:e}=kt.useTranslatedUnits(),r=h.ref(Dn()),i=h.ref(Dn()),a=h.ref([]),s=h.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:t.metricUnit,translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartType:ne.DOUGHNUT}),o={id:r.value,afterUpdate(x){a.value=x.options.plugins.legend.labels.generateLabels(x).map(p=>({...p,value:t.legendValues&&t.legendValues[p.text],hidden:!1}))}},l=h.computed(()=>[o]),c=h.computed(()=>[t.chartData.datasets.reduce((p,b)=>(p.labels.push(b.label),p.backgroundColor.push(b.backgroundColor),p.borderColor.push(ii(b.backgroundColor,50)),p.data.push(b.data.reduce((m,y)=>m+y,0)),p),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),u=h.computed(()=>({...t.chartData,datasets:c.value}));kt.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const{options:d}=kt.useDoughnutChartOptions({tooltipState:s,legendID:r.value}),f=h.ref(),g=x=>({[Yt.Right]:"legend-row",[Yt.Bottom]:"column",[Yt.Hidden]:"hidden"})[x],v=({width:x,height:p})=>{s.width=x,s.height=p};return(x,p)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["chart-parent",g(n.legendPosition)]),"data-testid":"doughnut-chart-parent"},[h.createElementVNode("div",XD,[h.createVNode(h.unref(Vh),{ref_key:"chartInstance",ref:f,"chart-id":i.value,data:u.value,options:h.unref(d),plugins:l.value},null,8,["chart-id","data","options","plugins"]),h.createVNode(Hl,{left:s.left,series:s.tooltipSeries,"show-tooltip":s.showTooltip,"tooltip-title":n.tooltipTitle,top:s.top,unit:n.metricUnit,onDimensions:v},null,8,["left","series","show-tooltip","tooltip-title","top","unit"])]),h.createVNode(zl,{id:r.value,"chart-instance":f.value,items:a.value,position:n.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),KD=Je(GD,[["__scopeId","data-v-b3095003"]]),qh=(n,t,e,r)=>{n.save(),n.beginPath(),n.moveTo(t,e),n.lineTo(t,r),n.lineWidth=1,n.strokeStyle="#0275d8",n.stroke(),n.restore()},jl={id:"linePlugin",afterDatasetsDraw:function(n){if(n.tooltip&&n.tooltip.getActiveElements()&&n.tooltip.getActiveElements().length&&!this.clickedSegment){const{x:t}=n.tooltip.dataPoints[0].element,e=n.ctx;qh(e,t,n.scales.y.top,n.scales.y.bottom)}if(this.clickedSegment){const{x:t}=this.clickedSegment.element,e=n.ctx;qh(e,t,n.scales.y.top,n.scales.y.bottom)}},beforeDestroy(){delete this.clickedSegment}},QD=h.defineComponent({__name:"TimeSeriesChart",props:{chartData:{type:Object,required:!1,default:null},type:{type:String,required:!1,default:ne.TIMESERIES_LINE},fill:{type:Boolean,required:!1,default:!1},tooltipTitle:{type:String,required:!0},metricUnit:{type:String,required:!1,default:""},timeRangeMs:{type:Number,required:!1,default:void 0},granularity:{type:String,required:!0},stacked:{type:Boolean,required:!1,default:!0},legendValues:{type:Object,required:!1,default:null},metricAxesTitle:{type:String,required:!1,default:null},dimensionAxesTitle:{type:String,required:!1,default:null},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:Ce},chartLegendSortFn:{type:Function,required:!1,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,required:!1,default:(n,t)=>t.rawValue-n.rawValue}},setup(n){const t=n,{translateUnit:e}=kt.useTranslatedUnits(),r=h.ref(),i=h.ref(Dn()),a=h.ref(Dn()),s=h.ref([]),o=h.ref(),l=h.ref(h.inject("legendPosition",Yt.Right)),c=h.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:h.toRef(t,"metricUnit"),translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartType:t.type,locked:!1,chartTooltipSortFn:t.chartTooltipSortFn}),u={id:i.value,afterUpdate(m){s.value=m.options.plugins.legend.labels.generateLabels(m).map(y=>({...y,value:t.legendValues&&t.legendValues[y.text]})).sort(t.chartLegendSortFn)}},d=h.computed(()=>[u,Wh,...t.type===ne.TIMESERIES_LINE?[jl]:[]]),{options:f}=kt.useLinechartOptions({tooltipState:c,timeRangeMs:h.toRef(t,"timeRangeMs"),granularity:h.toRef(t,"granularity"),legendID:i.value,stacked:h.toRef(t,"stacked"),metricAxesTitle:h.toRef(t,"metricAxesTitle"),dimensionAxesTitle:h.toRef(t,"dimensionAxesTitle")}),g=h.computed(()=>({...t.chartData,datasets:t.chartData.datasets.map((m,y)=>(Array.isArray(t.datasetColors)?(m.backgroundColor=t.datasetColors[y%t.datasetColors.length],m.borderColor=ii(m.backgroundColor,50)):m.rawDimension in t.datasetColors&&(m.backgroundColor=t.datasetColors[m.rawDimension],m.borderColor=ii(m.backgroundColor,50)),m.fill=t.fill,m))}));kt.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const v=m=>sa(m,{short:[ct.DAILY,ct.WEEKLY].includes(t.granularity)}),x=m=>({[Yt.Right]:"legend-row",[Yt.Bottom]:"column",[Yt.Hidden]:"hidden"})[m],p=({width:m,height:y})=>{c.width=m,c.height=y},b=()=>{var m,y,w;c.locked=!c.locked,r.value&&((y=(m=r.value.chart.tooltip)==null?void 0:m.dataPoints)!=null&&y.length)&&(jl.clickedSegment=c.locked?(w=r.value.chart.tooltip)==null?void 0:w.dataPoints[0]:void 0)};return h.watch(()=>t.type,()=>{c.locked=!1,c.showTooltip=!1,delete jl.clickedSegment}),(m,y)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["chart-parent",x(l.value)]),"data-testid":"line-chart-parent"},[h.createElementVNode("div",{class:"chart-container",onClick:y[0]||(y[0]=w=>b())},[n.type===h.unref(ne).TIMESERIES_LINE?(h.openBlock(),h.createBlock(h.unref(qD),{key:0,ref_key:"chartInstance",ref:r,"chart-id":a.value,data:g.value,"data-testid":"time-series-line-chart",options:h.unref(f),plugins:d.value},null,8,["chart-id","data","options","plugins"])):n.type===h.unref(ne).TIMESERIES_BAR?(h.openBlock(),h.createBlock(h.unref(VD),{key:1,ref_key:"chartInstance",ref:r,"chart-id":a.value,data:g.value,"data-testid":"time-series-bar-chart",options:h.unref(f),plugins:d.value},null,8,["chart-id","data","options","plugins"])):h.createCommentVNode("",!0)]),h.createVNode(Hl,{ref_key:"tooltipElement",ref:o,context:v(c.tooltipContext),"data-testid":"tooltip",left:c.left,locked:c.locked,series:c.tooltipSeries,"show-tooltip":c.showTooltip,"tooltip-title":n.tooltipTitle,top:c.top,unit:n.metricUnit,onDimensions:p,onLeft:y[1]||(y[1]=w=>c.left=w),onTop:y[2]||(y[2]=w=>c.top=w)},null,8,["context","left","locked","series","show-tooltip","tooltip-title","top","unit"]),h.createVNode(zl,{id:i.value,"chart-instance":r.value,"data-testid":"legend",items:s.value},null,8,["id","chart-instance","items"])],2))}}),ZD=Je(QD,[["__scopeId","data-v-3abbf084"]]);var Xn=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(Xn||{}),wa={exports:{}};wa.exports,function(n,t){var e=200,r="Expected a function",i="__lodash_hash_undefined__",a=1,s=2,o=1/0,l=9007199254740991,c="[object Arguments]",u="[object Array]",d="[object Boolean]",f="[object Date]",g="[object Error]",v="[object Function]",x="[object GeneratorFunction]",p="[object Map]",b="[object Number]",m="[object Object]",y="[object Promise]",w="[object RegExp]",T="[object Set]",S="[object String]",k="[object Symbol]",M="[object WeakMap]",D="[object ArrayBuffer]",O="[object DataView]",P="[object Float32Array]",A="[object Float64Array]",F="[object Int8Array]",q="[object Int16Array]",$="[object Int32Array]",H="[object Uint8Array]",I="[object Uint8ClampedArray]",it="[object Uint16Array]",U="[object Uint32Array]",yt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,dt=/^\w*$/,Y=/^\./,L=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,B=/[\\^$.*+?()[\]{}|]/g,j=/\\(\\)?/g,Z=/^\[object .+?Constructor\]$/,K=/^(?:0|[1-9]\d*)$/,N={};N[P]=N[A]=N[F]=N[q]=N[$]=N[H]=N[I]=N[it]=N[U]=!0,N[c]=N[u]=N[D]=N[d]=N[O]=N[f]=N[g]=N[v]=N[p]=N[b]=N[m]=N[w]=N[T]=N[S]=N[M]=!1;var R=typeof me=="object"&&me&&me.Object===Object&&me,Q=typeof self=="object"&&self&&self.Object===Object&&self,X=R||Q||Function("return this")(),vt=t&&!t.nodeType&&t,ut=vt&&!0&&n&&!n.nodeType&&n,Pt=ut&&ut.exports===vt,_t=Pt&&R.process,et=function(){try{return _t&&_t.binding("util")}catch{}}(),xt=et&&et.isTypedArray;function Ft(_,C){for(var E=-1,W=_?_.length:0;++E<W;)if(C(_[E],E,_))return!0;return!1}function ke(_){return function(C){return C==null?void 0:C[_]}}function Re(_,C){for(var E=-1,W=Array(_);++E<_;)W[E]=C(E);return W}function be(_){return function(C){return _(C)}}function It(_,C){return _==null?void 0:_[C]}function Bt(_){var C=!1;if(_!=null&&typeof _.toString!="function")try{C=!!(_+"")}catch{}return C}function tn(_){var C=-1,E=Array(_.size);return _.forEach(function(W,ot){E[++C]=[ot,W]}),E}function St(_,C){return function(E){return _(C(E))}}function kn(_){var C=-1,E=Array(_.size);return _.forEach(function(W){E[++C]=W}),E}var Le=Array.prototype,en=Function.prototype,_e=Object.prototype,Se=X["__core-js_shared__"],Ie=function(){var _=/[^.]+$/.exec(Se&&Se.keys&&Se.keys.IE_PROTO||"");return _?"Symbol(src)_1."+_:""}(),ue=en.toString,ye=_e.hasOwnProperty,Qt=_e.toString,_a=RegExp("^"+ue.call(ye).replace(B,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),vr=X.Symbol,og=X.Uint8Array,pk=_e.propertyIsEnumerable,mk=Le.splice,bk=St(Object.keys,Object),Gl=xr(X,"DataView"),hi=xr(X,"Map"),Kl=xr(X,"Promise"),Ql=xr(X,"Set"),Zl=xr(X,"WeakMap"),gi=xr(Object,"create"),yk=Kn(Gl),vk=Kn(hi),xk=Kn(Kl),wk=Kn(Ql),_k=Kn(Zl),Ta=vr?vr.prototype:void 0,Jl=Ta?Ta.valueOf:void 0,lg=Ta?Ta.toString:void 0;function Gn(_){var C=-1,E=_?_.length:0;for(this.clear();++C<E;){var W=_[C];this.set(W[0],W[1])}}function Tk(){this.__data__=gi?gi(null):{}}function Mk(_){return this.has(_)&&delete this.__data__[_]}function Dk(_){var C=this.__data__;if(gi){var E=C[_];return E===i?void 0:E}return ye.call(C,_)?C[_]:void 0}function Ck(_){var C=this.__data__;return gi?C[_]!==void 0:ye.call(C,_)}function kk(_,C){var E=this.__data__;return E[_]=gi&&C===void 0?i:C,this}Gn.prototype.clear=Tk,Gn.prototype.delete=Mk,Gn.prototype.get=Dk,Gn.prototype.has=Ck,Gn.prototype.set=kk;function nn(_){var C=-1,E=_?_.length:0;for(this.clear();++C<E;){var W=_[C];this.set(W[0],W[1])}}function Sk(){this.__data__=[]}function Ok(_){var C=this.__data__,E=Da(C,_);if(E<0)return!1;var W=C.length-1;return E==W?C.pop():mk.call(C,E,1),!0}function Pk(_){var C=this.__data__,E=Da(C,_);return E<0?void 0:C[E][1]}function Ek(_){return Da(this.__data__,_)>-1}function Ak(_,C){var E=this.__data__,W=Da(E,_);return W<0?E.push([_,C]):E[W][1]=C,this}nn.prototype.clear=Sk,nn.prototype.delete=Ok,nn.prototype.get=Pk,nn.prototype.has=Ek,nn.prototype.set=Ak;function rn(_){var C=-1,E=_?_.length:0;for(this.clear();++C<E;){var W=_[C];this.set(W[0],W[1])}}function Rk(){this.__data__={hash:new Gn,map:new(hi||nn),string:new Gn}}function Lk(_){return Ca(this,_).delete(_)}function Ik(_){return Ca(this,_).get(_)}function Nk(_){return Ca(this,_).has(_)}function Fk(_,C){return Ca(this,_).set(_,C),this}rn.prototype.clear=Rk,rn.prototype.delete=Lk,rn.prototype.get=Ik,rn.prototype.has=Nk,rn.prototype.set=Fk;function Ma(_){var C=-1,E=_?_.length:0;for(this.__data__=new rn;++C<E;)this.add(_[C])}function Bk(_){return this.__data__.set(_,i),this}function Uk(_){return this.__data__.has(_)}Ma.prototype.add=Ma.prototype.push=Bk,Ma.prototype.has=Uk;function an(_){this.__data__=new nn(_)}function Wk(){this.__data__=new nn}function Yk(_){return this.__data__.delete(_)}function Hk(_){return this.__data__.get(_)}function zk(_){return this.__data__.has(_)}function $k(_,C){var E=this.__data__;if(E instanceof nn){var W=E.__data__;if(!hi||W.length<e-1)return W.push([_,C]),this;E=this.__data__=new rn(W)}return E.set(_,C),this}an.prototype.clear=Wk,an.prototype.delete=Yk,an.prototype.get=Hk,an.prototype.has=zk,an.prototype.set=$k;function jk(_,C){var E=Qn(_)||mg(_)?Re(_.length,String):[],W=E.length,ot=!!W;for(var tt in _)(C||ye.call(_,tt))&&!(ot&&(tt=="length"||fg(tt,W)))&&E.push(tt);return E}function Da(_,C){for(var E=_.length;E--;)if(pg(_[E][0],C))return E;return-1}var Vk=sS();function qk(_,C){return _&&Vk(_,C,Ea)}function cg(_,C){C=ka(C,_)?[C]:ug(C);for(var E=0,W=C.length;_!=null&&E<W;)_=_[Sa(C[E++])];return E&&E==W?_:void 0}function Xk(_){return Qt.call(_)}function Gk(_,C){return _!=null&&C in Object(_)}function tc(_,C,E,W,ot){return _===C?!0:_==null||C==null||!Oa(_)&&!Pa(C)?_!==_&&C!==C:Kk(_,C,tc,E,W,ot)}function Kk(_,C,E,W,ot,tt){var Tt=Qn(_),Et=Qn(C),jt=u,Jt=u;Tt||(jt=Sn(_),jt=jt==c?m:jt),Et||(Jt=Sn(C),Jt=Jt==c?m:Jt);var de=jt==m&&!Bt(_),ve=Jt==m&&!Bt(C),te=jt==Jt;if(te&&!de)return tt||(tt=new an),Tt||mS(_)?dg(_,C,E,W,ot,tt):oS(_,C,jt,E,W,ot,tt);if(!(ot&s)){var Oe=de&&ye.call(_,"__wrapped__"),Pe=ve&&ye.call(C,"__wrapped__");if(Oe||Pe){var On=Oe?_.value():_,sn=Pe?C.value():C;return tt||(tt=new an),E(On,sn,W,ot,tt)}}return te?(tt||(tt=new an),lS(_,C,E,W,ot,tt)):!1}function Qk(_,C,E,W){var ot=E.length,tt=ot,Tt=!W;if(_==null)return!tt;for(_=Object(_);ot--;){var Et=E[ot];if(Tt&&Et[2]?Et[1]!==_[Et[0]]:!(Et[0]in _))return!1}for(;++ot<tt;){Et=E[ot];var jt=Et[0],Jt=_[jt],de=Et[1];if(Tt&&Et[2]){if(Jt===void 0&&!(jt in _))return!1}else{var ve=new an;if(W)var te=W(Jt,de,jt,_,C,ve);if(!(te===void 0?tc(de,Jt,W,a|s,ve):te))return!1}}return!0}function Zk(_){if(!Oa(_)||fS(_))return!1;var C=yg(_)||Bt(_)?_a:Z;return C.test(Kn(_))}function Jk(_){return Pa(_)&&nc(_.length)&&!!N[Qt.call(_)]}function tS(_){return typeof _=="function"?_:_==null?wS:typeof _=="object"?Qn(_)?rS(_[0],_[1]):nS(_):_S(_)}function eS(_){if(!hS(_))return bk(_);var C=[];for(var E in Object(_))ye.call(_,E)&&E!="constructor"&&C.push(E);return C}function nS(_){var C=cS(_);return C.length==1&&C[0][2]?gg(C[0][0],C[0][1]):function(E){return E===_||Qk(E,_,C)}}function rS(_,C){return ka(_)&&hg(C)?gg(Sa(_),C):function(E){var W=yS(E,_);return W===void 0&&W===C?vS(E,_):tc(C,W,void 0,a|s)}}function iS(_){return function(C){return cg(C,_)}}function aS(_){if(typeof _=="string")return _;if(rc(_))return lg?lg.call(_):"";var C=_+"";return C=="0"&&1/_==-o?"-0":C}function ug(_){return Qn(_)?_:gS(_)}function sS(_){return function(C,E,W){for(var ot=-1,tt=Object(C),Tt=W(C),Et=Tt.length;Et--;){var jt=Tt[_?Et:++ot];if(E(tt[jt],jt,tt)===!1)break}return C}}function dg(_,C,E,W,ot,tt){var Tt=ot&s,Et=_.length,jt=C.length;if(Et!=jt&&!(Tt&&jt>Et))return!1;var Jt=tt.get(_);if(Jt&&tt.get(C))return Jt==C;var de=-1,ve=!0,te=ot&a?new Ma:void 0;for(tt.set(_,C),tt.set(C,_);++de<Et;){var Oe=_[de],Pe=C[de];if(W)var On=Tt?W(Pe,Oe,de,C,_,tt):W(Oe,Pe,de,_,C,tt);if(On!==void 0){if(On)continue;ve=!1;break}if(te){if(!Ft(C,function(sn,Zn){if(!te.has(Zn)&&(Oe===sn||E(Oe,sn,W,ot,tt)))return te.add(Zn)})){ve=!1;break}}else if(!(Oe===Pe||E(Oe,Pe,W,ot,tt))){ve=!1;break}}return tt.delete(_),tt.delete(C),ve}function oS(_,C,E,W,ot,tt,Tt){switch(E){case O:if(_.byteLength!=C.byteLength||_.byteOffset!=C.byteOffset)return!1;_=_.buffer,C=C.buffer;case D:return!(_.byteLength!=C.byteLength||!W(new og(_),new og(C)));case d:case f:case b:return pg(+_,+C);case g:return _.name==C.name&&_.message==C.message;case w:case S:return _==C+"";case p:var Et=tn;case T:var jt=tt&s;if(Et||(Et=kn),_.size!=C.size&&!jt)return!1;var Jt=Tt.get(_);if(Jt)return Jt==C;tt|=a,Tt.set(_,C);var de=dg(Et(_),Et(C),W,ot,tt,Tt);return Tt.delete(_),de;case k:if(Jl)return Jl.call(_)==Jl.call(C)}return!1}function lS(_,C,E,W,ot,tt){var Tt=ot&s,Et=Ea(_),jt=Et.length,Jt=Ea(C),de=Jt.length;if(jt!=de&&!Tt)return!1;for(var ve=jt;ve--;){var te=Et[ve];if(!(Tt?te in C:ye.call(C,te)))return!1}var Oe=tt.get(_);if(Oe&&tt.get(C))return Oe==C;var Pe=!0;tt.set(_,C),tt.set(C,_);for(var On=Tt;++ve<jt;){te=Et[ve];var sn=_[te],Zn=C[te];if(W)var vg=Tt?W(Zn,sn,te,C,_,tt):W(sn,Zn,te,_,C,tt);if(!(vg===void 0?sn===Zn||E(sn,Zn,W,ot,tt):vg)){Pe=!1;break}On||(On=te=="constructor")}if(Pe&&!On){var Aa=_.constructor,Ra=C.constructor;Aa!=Ra&&"constructor"in _&&"constructor"in C&&!(typeof Aa=="function"&&Aa instanceof Aa&&typeof Ra=="function"&&Ra instanceof Ra)&&(Pe=!1)}return tt.delete(_),tt.delete(C),Pe}function Ca(_,C){var E=_.__data__;return dS(C)?E[typeof C=="string"?"string":"hash"]:E.map}function cS(_){for(var C=Ea(_),E=C.length;E--;){var W=C[E],ot=_[W];C[E]=[W,ot,hg(ot)]}return C}function xr(_,C){var E=It(_,C);return Zk(E)?E:void 0}var Sn=Xk;(Gl&&Sn(new Gl(new ArrayBuffer(1)))!=O||hi&&Sn(new hi)!=p||Kl&&Sn(Kl.resolve())!=y||Ql&&Sn(new Ql)!=T||Zl&&Sn(new Zl)!=M)&&(Sn=function(_){var C=Qt.call(_),E=C==m?_.constructor:void 0,W=E?Kn(E):void 0;if(W)switch(W){case yk:return O;case vk:return p;case xk:return y;case wk:return T;case _k:return M}return C});function uS(_,C,E){C=ka(C,_)?[C]:ug(C);for(var W,ot=-1,Tt=C.length;++ot<Tt;){var tt=Sa(C[ot]);if(!(W=_!=null&&E(_,tt)))break;_=_[tt]}if(W)return W;var Tt=_?_.length:0;return!!Tt&&nc(Tt)&&fg(tt,Tt)&&(Qn(_)||mg(_))}function fg(_,C){return C=C??l,!!C&&(typeof _=="number"||K.test(_))&&_>-1&&_%1==0&&_<C}function ka(_,C){if(Qn(_))return!1;var E=typeof _;return E=="number"||E=="symbol"||E=="boolean"||_==null||rc(_)?!0:dt.test(_)||!yt.test(_)||C!=null&&_ in Object(C)}function dS(_){var C=typeof _;return C=="string"||C=="number"||C=="symbol"||C=="boolean"?_!=="__proto__":_===null}function fS(_){return!!Ie&&Ie in _}function hS(_){var C=_&&_.constructor,E=typeof C=="function"&&C.prototype||_e;return _===E}function hg(_){return _===_&&!Oa(_)}function gg(_,C){return function(E){return E==null?!1:E[_]===C&&(C!==void 0||_ in Object(E))}}var gS=ec(function(_){_=bS(_);var C=[];return Y.test(_)&&C.push(""),_.replace(L,function(E,W,ot,tt){C.push(ot?tt.replace(j,"$1"):W||E)}),C});function Sa(_){if(typeof _=="string"||rc(_))return _;var C=_+"";return C=="0"&&1/_==-o?"-0":C}function Kn(_){if(_!=null){try{return ue.call(_)}catch{}try{return _+""}catch{}}return""}function ec(_,C){if(typeof _!="function"||C&&typeof C!="function")throw new TypeError(r);var E=function(){var W=arguments,ot=C?C.apply(this,W):W[0],tt=E.cache;if(tt.has(ot))return tt.get(ot);var Tt=_.apply(this,W);return E.cache=tt.set(ot,Tt),Tt};return E.cache=new(ec.Cache||rn),E}ec.Cache=rn;function pg(_,C){return _===C||_!==_&&C!==C}function mg(_){return pS(_)&&ye.call(_,"callee")&&(!pk.call(_,"callee")||Qt.call(_)==c)}var Qn=Array.isArray;function bg(_){return _!=null&&nc(_.length)&&!yg(_)}function pS(_){return Pa(_)&&bg(_)}function yg(_){var C=Oa(_)?Qt.call(_):"";return C==v||C==x}function nc(_){return typeof _=="number"&&_>-1&&_%1==0&&_<=l}function Oa(_){var C=typeof _;return!!_&&(C=="object"||C=="function")}function Pa(_){return!!_&&typeof _=="object"}function rc(_){return typeof _=="symbol"||Pa(_)&&Qt.call(_)==k}var mS=xt?be(xt):Jk;function bS(_){return _==null?"":aS(_)}function yS(_,C,E){var W=_==null?void 0:cg(_,C);return W===void 0?E:W}function vS(_,C){return _!=null&&uS(_,C,Gk)}function Ea(_){return bg(_)?jk(_):eS(_)}function xS(_,C){var E={};return C=tS(C),qk(_,function(W,ot,tt){E[C(W,ot,tt)]=W}),E}function wS(_){return _}function _S(_){return ka(_)?ke(Sa(_)):iS(_)}n.exports=xS}(wa,wa.exports);var JD=wa.exports;const tC=Wn(JD);var eC=1/0,nC=9007199254740991,rC="[object Arguments]",iC="[object Function]",aC="[object GeneratorFunction]",sC="[object Symbol]",oC=typeof me=="object"&&me&&me.Object===Object&&me,lC=typeof self=="object"&&self&&self.Object===Object&&self,cC=oC||lC||Function("return this")();function uC(n,t,e){switch(e.length){case 0:return n.call(t);case 1:return n.call(t,e[0]);case 2:return n.call(t,e[0],e[1]);case 3:return n.call(t,e[0],e[1],e[2])}return n.apply(t,e)}function dC(n,t){for(var e=-1,r=n?n.length:0,i=Array(r);++e<r;)i[e]=t(n[e],e,n);return i}function fC(n,t){for(var e=-1,r=t.length,i=n.length;++e<r;)n[i+e]=t[e];return n}var Vl=Object.prototype,hC=Vl.hasOwnProperty,ql=Vl.toString,Xh=cC.Symbol,gC=Vl.propertyIsEnumerable,Gh=Xh?Xh.isConcatSpreadable:void 0,Kh=Math.max;function Qh(n,t,e,r,i){var a=-1,s=n.length;for(e||(e=yC),i||(i=[]);++a<s;){var o=n[a];t>0&&e(o)?t>1?Qh(o,t-1,e,r,i):fC(i,o):r||(i[i.length]=o)}return i}function pC(n,t){return n=Object(n),mC(n,t,function(e,r){return r in n})}function mC(n,t,e){for(var r=-1,i=t.length,a={};++r<i;){var s=t[r],o=n[s];e(o,s)&&(a[s]=o)}return a}function bC(n,t){return t=Kh(t===void 0?n.length-1:t,0),function(){for(var e=arguments,r=-1,i=Kh(e.length-t,0),a=Array(i);++r<i;)a[r]=e[t+r];r=-1;for(var s=Array(t+1);++r<t;)s[r]=e[r];return s[t]=a,uC(n,this,s)}}function yC(n){return wC(n)||xC(n)||!!(Gh&&n&&n[Gh])}function vC(n){if(typeof n=="string"||kC(n))return n;var t=n+"";return t=="0"&&1/n==-eC?"-0":t}function xC(n){return TC(n)&&hC.call(n,"callee")&&(!gC.call(n,"callee")||ql.call(n)==rC)}var wC=Array.isArray;function _C(n){return n!=null&&DC(n.length)&&!MC(n)}function TC(n){return Zh(n)&&_C(n)}function MC(n){var t=CC(n)?ql.call(n):"";return t==iC||t==aC}function DC(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=nC}function CC(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function Zh(n){return!!n&&typeof n=="object"}function kC(n){return typeof n=="symbol"||Zh(n)&&ql.call(n)==sC}var SC=bC(function(n,t){return n==null?{}:pC(n,dC(Qh(t,1),vC))}),OC=SC;const PC=Wn(OC);var Jh={exports:{}};(function(n,t){(function(e,r){r()})(me,function(){function e(c,u){return typeof u>"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function r(c,u,d){var f=new XMLHttpRequest;f.open("GET",c),f.responseType="blob",f.onload=function(){l(f.response,u,d)},f.onerror=function(){console.error("could not download file")},f.send()}function i(c){var u=new XMLHttpRequest;u.open("HEAD",c,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function a(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var u=document.createEvent("MouseEvents");u.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(u)}}var s=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof me=="object"&&me.global===me?me:void 0,o=s.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=s.saveAs||(typeof window!="object"||window!==s?function(){}:"download"in HTMLAnchorElement.prototype&&!o?function(c,u,d){var f=s.URL||s.webkitURL,g=document.createElement("a");u=u||c.name||"download",g.download=u,g.rel="noopener",typeof c=="string"?(g.href=c,g.origin===location.origin?a(g):i(g.href)?r(c,u,d):a(g,g.target="_blank")):(g.href=f.createObjectURL(c),setTimeout(function(){f.revokeObjectURL(g.href)},4e4),setTimeout(function(){a(g)},0))}:"msSaveOrOpenBlob"in navigator?function(c,u,d){if(u=u||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(e(c,d),u);else if(i(c))r(c,u,d);else{var f=document.createElement("a");f.href=c,f.target="_blank",setTimeout(function(){a(f)})}}:function(c,u,d,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof c=="string")return r(c,u,d);var g=c.type==="application/octet-stream",v=/constructor/i.test(s.HTMLElement)||s.safari,x=/CriOS\/[\d]+/.test(navigator.userAgent);if((x||g&&v||o)&&typeof FileReader<"u"){var p=new FileReader;p.onloadend=function(){var y=p.result;y=x?y:y.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=y:location=y,f=null},p.readAsDataURL(c)}else{var b=s.URL||s.webkitURL,m=b.createObjectURL(c);f?f.location=m:location.href=m,f=null,setTimeout(function(){b.revokeObjectURL(m)},4e4)}});s.saveAs=l.saveAs=l,n.exports=l})})(Jh);var EC=Jh.exports,tg={exports:{}};/* @license
29
+ */const UD={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"};uu._date.override({_id:"date-fns",formats:function(){return UD},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=nt(n):e==="string"&&(typeof t=="string"?n=sw(n,t,new Date,this.options):n=Kd(n,this.options)),Os(n)?n.getTime():null},format:function(n,t){return ox(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return Kr(n,t);case"second":return Iy(n,t);case"minute":return Ry(n,t);case"hour":return Sy(n,t);case"day":return Td(n,t);case"week":return Ny(n,t);case"month":return ks(n,t);case"quarter":return Ly(n,t);case"year":return Fy(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return Zi(n,t);case"second":return qy(n,t);case"minute":return $y(n,t);case"hour":return zy(n,t);case"day":return Cd(n,t);case"week":return Xy(n,t);case"month":return Pd(n,t);case"quarter":return Vy(n,t);case"year":return Gy(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return cw(n);case"minute":return Ky(n);case"hour":return lw(n);case"day":return Ss(n);case"week":return Md(n);case"isoWeek":return Md(n,{weekStartsOn:+e});case"month":return Zy(n);case"quarter":return Qy(n);case"year":return tv(n);default:return n}},endOf:function(n,t){switch(t){case"second":return av(n);case"minute":return rv(n);case"hour":return ev(n);case"day":return Sd(n);case"week":return nv(n);case"month":return Od(n);case"quarter":return iv(n);case"year":return Jy(n);default:return n}}});const zh={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},WD={type:{type:String,required:!0},...zh,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},YD=h.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function yr(n){return h.isProxy(n)?h.toRaw(n):n}function HD(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return h.isProxy(t)?new Proxy(n,{}):n}function zD(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function $h(n,t){n.labels=t}function jh(n,t,e){const r=[];n.datasets=t.map(i=>{const a=n.datasets.find(s=>s[e]===i[e]);return!a||!i.data||r.includes(a)?{...i}:(r.push(a),Object.assign(a,i),a)})}function $D(n,t){const e={labels:[],datasets:[]};return $h(e,n.labels),jh(e,n.datasets,t),e}const jD=h.defineComponent({props:WD,setup(n,t){let{expose:e,slots:r}=t;const i=h.ref(null),a=h.shallowRef(null);e({chart:a});const s=()=>{if(!i.value)return;const{type:c,data:u,options:d,plugins:f,datasetIdKey:g}=n,v=$D(u,g),x=HD(v,u);a.value=new De(i.value,{type:c,data:x,options:{...d},plugins:f})},o=()=>{const c=h.toRaw(a.value);c&&(c.destroy(),a.value=null)},l=c=>{c.update(n.updateMode)};return h.onMounted(s),h.onBeforeUnmount(o),h.watch([()=>n.options,()=>n.data],(c,u)=>{let[d,f]=c,[g,v]=u;const x=h.toRaw(a.value);if(!x)return;let p=!1;if(d){const b=yr(d),m=yr(g);b&&b!==m&&(zD(x,b),p=!0)}if(f){const b=yr(f.labels),m=yr(v.labels),y=yr(f.datasets),w=yr(v.datasets);b!==m&&($h(x.config.data,b),p=!0),y&&y!==w&&(jh(x.config.data,y,n.datasetIdKey),p=!0)}p&&h.nextTick(()=>{l(x)})},{deep:!0}),()=>h.h("canvas",{role:"img",ariaLabel:n.ariaLabel,ariaDescribedby:n.ariaDescribedby,ref:i},[h.h("p",{},[r.default?r.default():""])])}});function $l(n,t){return De.register(t),h.defineComponent({props:zh,setup(e,r){let{expose:i}=r;const a=h.shallowRef(null),s=o=>{a.value=o==null?void 0:o.chart};return i({chart:a}),()=>h.h(jD,YD({ref:s},{type:n,...e}))}})}const VD=$l("bar",Ir),Vh=$l("doughnut",mn),qD=$l("line",Nr),XD={class:"chart-container"},GD=h.defineComponent({__name:"DoughnutChart",props:{chartData:{type:Object,required:!1,default:null},fill:{type:Boolean,required:!1,default:!1},tooltipTitle:{type:String,required:!0},metricUnit:{type:String,required:!1,default:""},legendPosition:{type:String,required:!1,default:Yt.Right},legendValues:{type:Object,required:!1,default:null},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:Ce}},setup(n){const t=n,{translateUnit:e}=kt.useTranslatedUnits(),r=h.ref(Dn()),i=h.ref(Dn()),a=h.ref([]),s=h.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:t.metricUnit,translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartType:ne.DOUGHNUT}),o={id:r.value,afterUpdate(x){a.value=x.options.plugins.legend.labels.generateLabels(x).map(p=>({...p,value:t.legendValues&&t.legendValues[p.text],hidden:!1}))}},l=h.computed(()=>[o]),c=h.computed(()=>[t.chartData.datasets.reduce((p,b)=>(p.labels.push(b.label),p.backgroundColor.push(b.backgroundColor),p.borderColor.push(ii(b.backgroundColor,50)),p.data.push(b.data.reduce((m,y)=>m+y,0)),p),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),u=h.computed(()=>({...t.chartData,datasets:c.value}));kt.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const{options:d}=kt.useDoughnutChartOptions({tooltipState:s,legendID:r.value}),f=h.ref(),g=x=>({[Yt.Right]:"legend-row",[Yt.Bottom]:"column",[Yt.Hidden]:"hidden"})[x],v=({width:x,height:p})=>{s.width=x,s.height=p};return(x,p)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["chart-parent",g(n.legendPosition)]),"data-testid":"doughnut-chart-parent"},[h.createElementVNode("div",XD,[h.createVNode(h.unref(Vh),{ref_key:"chartInstance",ref:f,"chart-id":i.value,data:u.value,options:h.unref(d),plugins:l.value},null,8,["chart-id","data","options","plugins"]),h.createVNode(Hl,{left:s.left,series:s.tooltipSeries,"show-tooltip":s.showTooltip,"tooltip-title":n.tooltipTitle,top:s.top,unit:n.metricUnit,onDimensions:v},null,8,["left","series","show-tooltip","tooltip-title","top","unit"])]),h.createVNode(zl,{id:r.value,"chart-instance":f.value,items:a.value,position:n.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),KD=Je(GD,[["__scopeId","data-v-b3095003"]]),qh=(n,t,e,r)=>{n.save(),n.beginPath(),n.moveTo(t,e),n.lineTo(t,r),n.lineWidth=1,n.strokeStyle="#0275d8",n.stroke(),n.restore()},jl={id:"linePlugin",afterDatasetsDraw:function(n){if(n.tooltip&&n.tooltip.getActiveElements()&&n.tooltip.getActiveElements().length&&!this.clickedSegment){const{x:t}=n.tooltip.dataPoints[0].element,e=n.ctx;qh(e,t,n.scales.y.top,n.scales.y.bottom)}if(this.clickedSegment){const{x:t}=this.clickedSegment.element,e=n.ctx;qh(e,t,n.scales.y.top,n.scales.y.bottom)}},beforeDestroy(){delete this.clickedSegment}},QD=h.defineComponent({__name:"TimeSeriesChart",props:{chartData:{type:Object,required:!1,default:null},type:{type:String,required:!1,default:ne.TIMESERIES_LINE},fill:{type:Boolean,required:!1,default:!1},tooltipTitle:{type:String,required:!0},metricUnit:{type:String,required:!1,default:""},timeRangeMs:{type:Number,required:!1,default:void 0},granularity:{type:String,required:!0},stacked:{type:Boolean,required:!1,default:!0},legendValues:{type:Object,required:!1,default:null},metricAxesTitle:{type:String,required:!1,default:null},dimensionAxesTitle:{type:String,required:!1,default:null},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:Ce},chartLegendSortFn:{type:Function,required:!1,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,required:!1,default:(n,t)=>t.rawValue-n.rawValue}},setup(n){const t=n,{translateUnit:e}=kt.useTranslatedUnits(),r=h.ref(),i=h.ref(Dn()),a=h.ref(Dn()),s=h.ref([]),o=h.ref(),l=h.ref(h.inject("legendPosition",Yt.Right)),c=h.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:h.toRef(t,"metricUnit"),translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartType:t.type,locked:!1,chartTooltipSortFn:t.chartTooltipSortFn}),u={id:i.value,afterUpdate(m){s.value=m.options.plugins.legend.labels.generateLabels(m).map(y=>({...y,value:t.legendValues&&t.legendValues[y.text]})).sort(t.chartLegendSortFn)}},d=h.computed(()=>[u,Wh,...t.type===ne.TIMESERIES_LINE?[jl]:[]]),{options:f}=kt.useLinechartOptions({tooltipState:c,timeRangeMs:h.toRef(t,"timeRangeMs"),granularity:h.toRef(t,"granularity"),legendID:i.value,stacked:h.toRef(t,"stacked"),metricAxesTitle:h.toRef(t,"metricAxesTitle"),dimensionAxesTitle:h.toRef(t,"dimensionAxesTitle")}),g=h.computed(()=>({...t.chartData,datasets:t.chartData.datasets.map((m,y)=>(Array.isArray(t.datasetColors)?(m.backgroundColor=t.datasetColors[y%t.datasetColors.length],m.borderColor=ii(m.backgroundColor,50)):m.rawDimension in t.datasetColors&&(m.backgroundColor=t.datasetColors[m.rawDimension],m.borderColor=ii(m.backgroundColor,50)),m.fill=t.fill,m))}));kt.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const v=m=>sa(m,{short:[lt.DAILY,lt.WEEKLY].includes(t.granularity)}),x=m=>({[Yt.Right]:"legend-row",[Yt.Bottom]:"column",[Yt.Hidden]:"hidden"})[m],p=({width:m,height:y})=>{c.width=m,c.height=y},b=()=>{var m,y,w;c.locked=!c.locked,r.value&&((y=(m=r.value.chart.tooltip)==null?void 0:m.dataPoints)!=null&&y.length)&&(jl.clickedSegment=c.locked?(w=r.value.chart.tooltip)==null?void 0:w.dataPoints[0]:void 0)};return h.watch(()=>t.type,()=>{c.locked=!1,c.showTooltip=!1,delete jl.clickedSegment}),(m,y)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["chart-parent",x(l.value)]),"data-testid":"line-chart-parent"},[h.createElementVNode("div",{class:"chart-container",onClick:y[0]||(y[0]=w=>b())},[n.type===h.unref(ne).TIMESERIES_LINE?(h.openBlock(),h.createBlock(h.unref(qD),{key:0,ref_key:"chartInstance",ref:r,"chart-id":a.value,data:g.value,"data-testid":"time-series-line-chart",options:h.unref(f),plugins:d.value},null,8,["chart-id","data","options","plugins"])):n.type===h.unref(ne).TIMESERIES_BAR?(h.openBlock(),h.createBlock(h.unref(VD),{key:1,ref_key:"chartInstance",ref:r,"chart-id":a.value,data:g.value,"data-testid":"time-series-bar-chart",options:h.unref(f),plugins:d.value},null,8,["chart-id","data","options","plugins"])):h.createCommentVNode("",!0)]),h.createVNode(Hl,{ref_key:"tooltipElement",ref:o,context:v(c.tooltipContext),"data-testid":"tooltip",left:c.left,locked:c.locked,series:c.tooltipSeries,"show-tooltip":c.showTooltip,"tooltip-title":n.tooltipTitle,top:c.top,unit:n.metricUnit,onDimensions:p,onLeft:y[1]||(y[1]=w=>c.left=w),onTop:y[2]||(y[2]=w=>c.top=w)},null,8,["context","left","locked","series","show-tooltip","tooltip-title","top","unit"]),h.createVNode(zl,{id:i.value,"chart-instance":r.value,"data-testid":"legend",items:s.value},null,8,["id","chart-instance","items"])],2))}}),ZD=Je(QD,[["__scopeId","data-v-3abbf084"]]);var Xn=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(Xn||{}),wa={exports:{}};wa.exports,function(n,t){var e=200,r="Expected a function",i="__lodash_hash_undefined__",a=1,s=2,o=1/0,l=9007199254740991,c="[object Arguments]",u="[object Array]",d="[object Boolean]",f="[object Date]",g="[object Error]",v="[object Function]",x="[object GeneratorFunction]",p="[object Map]",b="[object Number]",m="[object Object]",y="[object Promise]",w="[object RegExp]",T="[object Set]",S="[object String]",k="[object Symbol]",M="[object WeakMap]",D="[object ArrayBuffer]",O="[object DataView]",P="[object Float32Array]",A="[object Float64Array]",F="[object Int8Array]",q="[object Int16Array]",$="[object Int32Array]",H="[object Uint8Array]",I="[object Uint8ClampedArray]",it="[object Uint16Array]",U="[object Uint32Array]",yt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,dt=/^\w*$/,Y=/^\./,L=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,B=/[\\^$.*+?()[\]{}|]/g,j=/\\(\\)?/g,Z=/^\[object .+?Constructor\]$/,K=/^(?:0|[1-9]\d*)$/,N={};N[P]=N[A]=N[F]=N[q]=N[$]=N[H]=N[I]=N[it]=N[U]=!0,N[c]=N[u]=N[D]=N[d]=N[O]=N[f]=N[g]=N[v]=N[p]=N[b]=N[m]=N[w]=N[T]=N[S]=N[M]=!1;var R=typeof me=="object"&&me&&me.Object===Object&&me,Q=typeof self=="object"&&self&&self.Object===Object&&self,X=R||Q||Function("return this")(),vt=t&&!t.nodeType&&t,ut=vt&&!0&&n&&!n.nodeType&&n,Pt=ut&&ut.exports===vt,_t=Pt&&R.process,et=function(){try{return _t&&_t.binding("util")}catch{}}(),xt=et&&et.isTypedArray;function Ft(_,C){for(var E=-1,W=_?_.length:0;++E<W;)if(C(_[E],E,_))return!0;return!1}function ke(_){return function(C){return C==null?void 0:C[_]}}function Re(_,C){for(var E=-1,W=Array(_);++E<_;)W[E]=C(E);return W}function be(_){return function(C){return _(C)}}function It(_,C){return _==null?void 0:_[C]}function Bt(_){var C=!1;if(_!=null&&typeof _.toString!="function")try{C=!!(_+"")}catch{}return C}function tn(_){var C=-1,E=Array(_.size);return _.forEach(function(W,ot){E[++C]=[ot,W]}),E}function St(_,C){return function(E){return _(C(E))}}function kn(_){var C=-1,E=Array(_.size);return _.forEach(function(W){E[++C]=W}),E}var Le=Array.prototype,en=Function.prototype,_e=Object.prototype,Se=X["__core-js_shared__"],Ie=function(){var _=/[^.]+$/.exec(Se&&Se.keys&&Se.keys.IE_PROTO||"");return _?"Symbol(src)_1."+_:""}(),ue=en.toString,ye=_e.hasOwnProperty,Qt=_e.toString,_a=RegExp("^"+ue.call(ye).replace(B,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),vr=X.Symbol,og=X.Uint8Array,pk=_e.propertyIsEnumerable,mk=Le.splice,bk=St(Object.keys,Object),Gl=xr(X,"DataView"),hi=xr(X,"Map"),Kl=xr(X,"Promise"),Ql=xr(X,"Set"),Zl=xr(X,"WeakMap"),gi=xr(Object,"create"),yk=Kn(Gl),vk=Kn(hi),xk=Kn(Kl),wk=Kn(Ql),_k=Kn(Zl),Ta=vr?vr.prototype:void 0,Jl=Ta?Ta.valueOf:void 0,lg=Ta?Ta.toString:void 0;function Gn(_){var C=-1,E=_?_.length:0;for(this.clear();++C<E;){var W=_[C];this.set(W[0],W[1])}}function Tk(){this.__data__=gi?gi(null):{}}function Mk(_){return this.has(_)&&delete this.__data__[_]}function Dk(_){var C=this.__data__;if(gi){var E=C[_];return E===i?void 0:E}return ye.call(C,_)?C[_]:void 0}function Ck(_){var C=this.__data__;return gi?C[_]!==void 0:ye.call(C,_)}function kk(_,C){var E=this.__data__;return E[_]=gi&&C===void 0?i:C,this}Gn.prototype.clear=Tk,Gn.prototype.delete=Mk,Gn.prototype.get=Dk,Gn.prototype.has=Ck,Gn.prototype.set=kk;function nn(_){var C=-1,E=_?_.length:0;for(this.clear();++C<E;){var W=_[C];this.set(W[0],W[1])}}function Sk(){this.__data__=[]}function Ok(_){var C=this.__data__,E=Da(C,_);if(E<0)return!1;var W=C.length-1;return E==W?C.pop():mk.call(C,E,1),!0}function Pk(_){var C=this.__data__,E=Da(C,_);return E<0?void 0:C[E][1]}function Ek(_){return Da(this.__data__,_)>-1}function Ak(_,C){var E=this.__data__,W=Da(E,_);return W<0?E.push([_,C]):E[W][1]=C,this}nn.prototype.clear=Sk,nn.prototype.delete=Ok,nn.prototype.get=Pk,nn.prototype.has=Ek,nn.prototype.set=Ak;function rn(_){var C=-1,E=_?_.length:0;for(this.clear();++C<E;){var W=_[C];this.set(W[0],W[1])}}function Rk(){this.__data__={hash:new Gn,map:new(hi||nn),string:new Gn}}function Lk(_){return Ca(this,_).delete(_)}function Ik(_){return Ca(this,_).get(_)}function Nk(_){return Ca(this,_).has(_)}function Fk(_,C){return Ca(this,_).set(_,C),this}rn.prototype.clear=Rk,rn.prototype.delete=Lk,rn.prototype.get=Ik,rn.prototype.has=Nk,rn.prototype.set=Fk;function Ma(_){var C=-1,E=_?_.length:0;for(this.__data__=new rn;++C<E;)this.add(_[C])}function Bk(_){return this.__data__.set(_,i),this}function Uk(_){return this.__data__.has(_)}Ma.prototype.add=Ma.prototype.push=Bk,Ma.prototype.has=Uk;function an(_){this.__data__=new nn(_)}function Wk(){this.__data__=new nn}function Yk(_){return this.__data__.delete(_)}function Hk(_){return this.__data__.get(_)}function zk(_){return this.__data__.has(_)}function $k(_,C){var E=this.__data__;if(E instanceof nn){var W=E.__data__;if(!hi||W.length<e-1)return W.push([_,C]),this;E=this.__data__=new rn(W)}return E.set(_,C),this}an.prototype.clear=Wk,an.prototype.delete=Yk,an.prototype.get=Hk,an.prototype.has=zk,an.prototype.set=$k;function jk(_,C){var E=Qn(_)||mg(_)?Re(_.length,String):[],W=E.length,ot=!!W;for(var tt in _)(C||ye.call(_,tt))&&!(ot&&(tt=="length"||fg(tt,W)))&&E.push(tt);return E}function Da(_,C){for(var E=_.length;E--;)if(pg(_[E][0],C))return E;return-1}var Vk=sS();function qk(_,C){return _&&Vk(_,C,Ea)}function cg(_,C){C=ka(C,_)?[C]:ug(C);for(var E=0,W=C.length;_!=null&&E<W;)_=_[Sa(C[E++])];return E&&E==W?_:void 0}function Xk(_){return Qt.call(_)}function Gk(_,C){return _!=null&&C in Object(_)}function tc(_,C,E,W,ot){return _===C?!0:_==null||C==null||!Oa(_)&&!Pa(C)?_!==_&&C!==C:Kk(_,C,tc,E,W,ot)}function Kk(_,C,E,W,ot,tt){var Tt=Qn(_),Et=Qn(C),jt=u,Jt=u;Tt||(jt=Sn(_),jt=jt==c?m:jt),Et||(Jt=Sn(C),Jt=Jt==c?m:Jt);var de=jt==m&&!Bt(_),ve=Jt==m&&!Bt(C),te=jt==Jt;if(te&&!de)return tt||(tt=new an),Tt||mS(_)?dg(_,C,E,W,ot,tt):oS(_,C,jt,E,W,ot,tt);if(!(ot&s)){var Oe=de&&ye.call(_,"__wrapped__"),Pe=ve&&ye.call(C,"__wrapped__");if(Oe||Pe){var On=Oe?_.value():_,sn=Pe?C.value():C;return tt||(tt=new an),E(On,sn,W,ot,tt)}}return te?(tt||(tt=new an),lS(_,C,E,W,ot,tt)):!1}function Qk(_,C,E,W){var ot=E.length,tt=ot,Tt=!W;if(_==null)return!tt;for(_=Object(_);ot--;){var Et=E[ot];if(Tt&&Et[2]?Et[1]!==_[Et[0]]:!(Et[0]in _))return!1}for(;++ot<tt;){Et=E[ot];var jt=Et[0],Jt=_[jt],de=Et[1];if(Tt&&Et[2]){if(Jt===void 0&&!(jt in _))return!1}else{var ve=new an;if(W)var te=W(Jt,de,jt,_,C,ve);if(!(te===void 0?tc(de,Jt,W,a|s,ve):te))return!1}}return!0}function Zk(_){if(!Oa(_)||fS(_))return!1;var C=yg(_)||Bt(_)?_a:Z;return C.test(Kn(_))}function Jk(_){return Pa(_)&&nc(_.length)&&!!N[Qt.call(_)]}function tS(_){return typeof _=="function"?_:_==null?wS:typeof _=="object"?Qn(_)?rS(_[0],_[1]):nS(_):_S(_)}function eS(_){if(!hS(_))return bk(_);var C=[];for(var E in Object(_))ye.call(_,E)&&E!="constructor"&&C.push(E);return C}function nS(_){var C=cS(_);return C.length==1&&C[0][2]?gg(C[0][0],C[0][1]):function(E){return E===_||Qk(E,_,C)}}function rS(_,C){return ka(_)&&hg(C)?gg(Sa(_),C):function(E){var W=yS(E,_);return W===void 0&&W===C?vS(E,_):tc(C,W,void 0,a|s)}}function iS(_){return function(C){return cg(C,_)}}function aS(_){if(typeof _=="string")return _;if(rc(_))return lg?lg.call(_):"";var C=_+"";return C=="0"&&1/_==-o?"-0":C}function ug(_){return Qn(_)?_:gS(_)}function sS(_){return function(C,E,W){for(var ot=-1,tt=Object(C),Tt=W(C),Et=Tt.length;Et--;){var jt=Tt[_?Et:++ot];if(E(tt[jt],jt,tt)===!1)break}return C}}function dg(_,C,E,W,ot,tt){var Tt=ot&s,Et=_.length,jt=C.length;if(Et!=jt&&!(Tt&&jt>Et))return!1;var Jt=tt.get(_);if(Jt&&tt.get(C))return Jt==C;var de=-1,ve=!0,te=ot&a?new Ma:void 0;for(tt.set(_,C),tt.set(C,_);++de<Et;){var Oe=_[de],Pe=C[de];if(W)var On=Tt?W(Pe,Oe,de,C,_,tt):W(Oe,Pe,de,_,C,tt);if(On!==void 0){if(On)continue;ve=!1;break}if(te){if(!Ft(C,function(sn,Zn){if(!te.has(Zn)&&(Oe===sn||E(Oe,sn,W,ot,tt)))return te.add(Zn)})){ve=!1;break}}else if(!(Oe===Pe||E(Oe,Pe,W,ot,tt))){ve=!1;break}}return tt.delete(_),tt.delete(C),ve}function oS(_,C,E,W,ot,tt,Tt){switch(E){case O:if(_.byteLength!=C.byteLength||_.byteOffset!=C.byteOffset)return!1;_=_.buffer,C=C.buffer;case D:return!(_.byteLength!=C.byteLength||!W(new og(_),new og(C)));case d:case f:case b:return pg(+_,+C);case g:return _.name==C.name&&_.message==C.message;case w:case S:return _==C+"";case p:var Et=tn;case T:var jt=tt&s;if(Et||(Et=kn),_.size!=C.size&&!jt)return!1;var Jt=Tt.get(_);if(Jt)return Jt==C;tt|=a,Tt.set(_,C);var de=dg(Et(_),Et(C),W,ot,tt,Tt);return Tt.delete(_),de;case k:if(Jl)return Jl.call(_)==Jl.call(C)}return!1}function lS(_,C,E,W,ot,tt){var Tt=ot&s,Et=Ea(_),jt=Et.length,Jt=Ea(C),de=Jt.length;if(jt!=de&&!Tt)return!1;for(var ve=jt;ve--;){var te=Et[ve];if(!(Tt?te in C:ye.call(C,te)))return!1}var Oe=tt.get(_);if(Oe&&tt.get(C))return Oe==C;var Pe=!0;tt.set(_,C),tt.set(C,_);for(var On=Tt;++ve<jt;){te=Et[ve];var sn=_[te],Zn=C[te];if(W)var vg=Tt?W(Zn,sn,te,C,_,tt):W(sn,Zn,te,_,C,tt);if(!(vg===void 0?sn===Zn||E(sn,Zn,W,ot,tt):vg)){Pe=!1;break}On||(On=te=="constructor")}if(Pe&&!On){var Aa=_.constructor,Ra=C.constructor;Aa!=Ra&&"constructor"in _&&"constructor"in C&&!(typeof Aa=="function"&&Aa instanceof Aa&&typeof Ra=="function"&&Ra instanceof Ra)&&(Pe=!1)}return tt.delete(_),tt.delete(C),Pe}function Ca(_,C){var E=_.__data__;return dS(C)?E[typeof C=="string"?"string":"hash"]:E.map}function cS(_){for(var C=Ea(_),E=C.length;E--;){var W=C[E],ot=_[W];C[E]=[W,ot,hg(ot)]}return C}function xr(_,C){var E=It(_,C);return Zk(E)?E:void 0}var Sn=Xk;(Gl&&Sn(new Gl(new ArrayBuffer(1)))!=O||hi&&Sn(new hi)!=p||Kl&&Sn(Kl.resolve())!=y||Ql&&Sn(new Ql)!=T||Zl&&Sn(new Zl)!=M)&&(Sn=function(_){var C=Qt.call(_),E=C==m?_.constructor:void 0,W=E?Kn(E):void 0;if(W)switch(W){case yk:return O;case vk:return p;case xk:return y;case wk:return T;case _k:return M}return C});function uS(_,C,E){C=ka(C,_)?[C]:ug(C);for(var W,ot=-1,Tt=C.length;++ot<Tt;){var tt=Sa(C[ot]);if(!(W=_!=null&&E(_,tt)))break;_=_[tt]}if(W)return W;var Tt=_?_.length:0;return!!Tt&&nc(Tt)&&fg(tt,Tt)&&(Qn(_)||mg(_))}function fg(_,C){return C=C??l,!!C&&(typeof _=="number"||K.test(_))&&_>-1&&_%1==0&&_<C}function ka(_,C){if(Qn(_))return!1;var E=typeof _;return E=="number"||E=="symbol"||E=="boolean"||_==null||rc(_)?!0:dt.test(_)||!yt.test(_)||C!=null&&_ in Object(C)}function dS(_){var C=typeof _;return C=="string"||C=="number"||C=="symbol"||C=="boolean"?_!=="__proto__":_===null}function fS(_){return!!Ie&&Ie in _}function hS(_){var C=_&&_.constructor,E=typeof C=="function"&&C.prototype||_e;return _===E}function hg(_){return _===_&&!Oa(_)}function gg(_,C){return function(E){return E==null?!1:E[_]===C&&(C!==void 0||_ in Object(E))}}var gS=ec(function(_){_=bS(_);var C=[];return Y.test(_)&&C.push(""),_.replace(L,function(E,W,ot,tt){C.push(ot?tt.replace(j,"$1"):W||E)}),C});function Sa(_){if(typeof _=="string"||rc(_))return _;var C=_+"";return C=="0"&&1/_==-o?"-0":C}function Kn(_){if(_!=null){try{return ue.call(_)}catch{}try{return _+""}catch{}}return""}function ec(_,C){if(typeof _!="function"||C&&typeof C!="function")throw new TypeError(r);var E=function(){var W=arguments,ot=C?C.apply(this,W):W[0],tt=E.cache;if(tt.has(ot))return tt.get(ot);var Tt=_.apply(this,W);return E.cache=tt.set(ot,Tt),Tt};return E.cache=new(ec.Cache||rn),E}ec.Cache=rn;function pg(_,C){return _===C||_!==_&&C!==C}function mg(_){return pS(_)&&ye.call(_,"callee")&&(!pk.call(_,"callee")||Qt.call(_)==c)}var Qn=Array.isArray;function bg(_){return _!=null&&nc(_.length)&&!yg(_)}function pS(_){return Pa(_)&&bg(_)}function yg(_){var C=Oa(_)?Qt.call(_):"";return C==v||C==x}function nc(_){return typeof _=="number"&&_>-1&&_%1==0&&_<=l}function Oa(_){var C=typeof _;return!!_&&(C=="object"||C=="function")}function Pa(_){return!!_&&typeof _=="object"}function rc(_){return typeof _=="symbol"||Pa(_)&&Qt.call(_)==k}var mS=xt?be(xt):Jk;function bS(_){return _==null?"":aS(_)}function yS(_,C,E){var W=_==null?void 0:cg(_,C);return W===void 0?E:W}function vS(_,C){return _!=null&&uS(_,C,Gk)}function Ea(_){return bg(_)?jk(_):eS(_)}function xS(_,C){var E={};return C=tS(C),qk(_,function(W,ot,tt){E[C(W,ot,tt)]=W}),E}function wS(_){return _}function _S(_){return ka(_)?ke(Sa(_)):iS(_)}n.exports=xS}(wa,wa.exports);var JD=wa.exports;const tC=Wn(JD);var eC=1/0,nC=9007199254740991,rC="[object Arguments]",iC="[object Function]",aC="[object GeneratorFunction]",sC="[object Symbol]",oC=typeof me=="object"&&me&&me.Object===Object&&me,lC=typeof self=="object"&&self&&self.Object===Object&&self,cC=oC||lC||Function("return this")();function uC(n,t,e){switch(e.length){case 0:return n.call(t);case 1:return n.call(t,e[0]);case 2:return n.call(t,e[0],e[1]);case 3:return n.call(t,e[0],e[1],e[2])}return n.apply(t,e)}function dC(n,t){for(var e=-1,r=n?n.length:0,i=Array(r);++e<r;)i[e]=t(n[e],e,n);return i}function fC(n,t){for(var e=-1,r=t.length,i=n.length;++e<r;)n[i+e]=t[e];return n}var Vl=Object.prototype,hC=Vl.hasOwnProperty,ql=Vl.toString,Xh=cC.Symbol,gC=Vl.propertyIsEnumerable,Gh=Xh?Xh.isConcatSpreadable:void 0,Kh=Math.max;function Qh(n,t,e,r,i){var a=-1,s=n.length;for(e||(e=yC),i||(i=[]);++a<s;){var o=n[a];t>0&&e(o)?t>1?Qh(o,t-1,e,r,i):fC(i,o):r||(i[i.length]=o)}return i}function pC(n,t){return n=Object(n),mC(n,t,function(e,r){return r in n})}function mC(n,t,e){for(var r=-1,i=t.length,a={};++r<i;){var s=t[r],o=n[s];e(o,s)&&(a[s]=o)}return a}function bC(n,t){return t=Kh(t===void 0?n.length-1:t,0),function(){for(var e=arguments,r=-1,i=Kh(e.length-t,0),a=Array(i);++r<i;)a[r]=e[t+r];r=-1;for(var s=Array(t+1);++r<t;)s[r]=e[r];return s[t]=a,uC(n,this,s)}}function yC(n){return wC(n)||xC(n)||!!(Gh&&n&&n[Gh])}function vC(n){if(typeof n=="string"||kC(n))return n;var t=n+"";return t=="0"&&1/n==-eC?"-0":t}function xC(n){return TC(n)&&hC.call(n,"callee")&&(!gC.call(n,"callee")||ql.call(n)==rC)}var wC=Array.isArray;function _C(n){return n!=null&&DC(n.length)&&!MC(n)}function TC(n){return Zh(n)&&_C(n)}function MC(n){var t=CC(n)?ql.call(n):"";return t==iC||t==aC}function DC(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=nC}function CC(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function Zh(n){return!!n&&typeof n=="object"}function kC(n){return typeof n=="symbol"||Zh(n)&&ql.call(n)==sC}var SC=bC(function(n,t){return n==null?{}:pC(n,dC(Qh(t,1),vC))}),OC=SC;const PC=Wn(OC);var Jh={exports:{}};(function(n,t){(function(e,r){r()})(me,function(){function e(c,u){return typeof u>"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function r(c,u,d){var f=new XMLHttpRequest;f.open("GET",c),f.responseType="blob",f.onload=function(){l(f.response,u,d)},f.onerror=function(){console.error("could not download file")},f.send()}function i(c){var u=new XMLHttpRequest;u.open("HEAD",c,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function a(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var u=document.createEvent("MouseEvents");u.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(u)}}var s=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof me=="object"&&me.global===me?me:void 0,o=s.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=s.saveAs||(typeof window!="object"||window!==s?function(){}:"download"in HTMLAnchorElement.prototype&&!o?function(c,u,d){var f=s.URL||s.webkitURL,g=document.createElement("a");u=u||c.name||"download",g.download=u,g.rel="noopener",typeof c=="string"?(g.href=c,g.origin===location.origin?a(g):i(g.href)?r(c,u,d):a(g,g.target="_blank")):(g.href=f.createObjectURL(c),setTimeout(function(){f.revokeObjectURL(g.href)},4e4),setTimeout(function(){a(g)},0))}:"msSaveOrOpenBlob"in navigator?function(c,u,d){if(u=u||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(e(c,d),u);else if(i(c))r(c,u,d);else{var f=document.createElement("a");f.href=c,f.target="_blank",setTimeout(function(){a(f)})}}:function(c,u,d,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof c=="string")return r(c,u,d);var g=c.type==="application/octet-stream",v=/constructor/i.test(s.HTMLElement)||s.safari,x=/CriOS\/[\d]+/.test(navigator.userAgent);if((x||g&&v||o)&&typeof FileReader<"u"){var p=new FileReader;p.onloadend=function(){var y=p.result;y=x?y:y.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=y:location=y,f=null},p.readAsDataURL(c)}else{var b=s.URL||s.webkitURL,m=b.createObjectURL(c);f?f.location=m:location.href=m,f=null,setTimeout(function(){b.revokeObjectURL(m)},4e4)}});s.saveAs=l.saveAs=l,n.exports=l})})(Jh);var EC=Jh.exports,tg={exports:{}};/* @license
30
30
  Papa Parse
31
31
  v5.4.1
32
32
  https://github.com/mholt/PapaParse
@@ -41,4 +41,4 @@ License: MIT
41
41
  `&&P!=="\r"&&P!==`\r
42
42
  `&&(P=`
43
43
  `);var I=0,it=!1;this.parse=function(U,yt,dt){if(typeof U!="string")throw new Error("Input must be a string");var Y=U.length,L=O.length,B=P.length,j=A.length,Z=k(F),K=[],N=[],R=[],Q=I=0;if(!U)return ue();if(M.header&&!yt){var X=U.split(P)[0].split(O),vt=[],ut={},Pt=!1;for(var _t in X){var et=X[_t];k(M.transformHeader)&&(et=M.transformHeader(et,_t));var xt=et,Ft=ut[et]||0;for(0<Ft&&(Pt=!0,xt=et+"_"+Ft),ut[et]=Ft+1;vt.includes(xt);)xt=xt+"_"+Ft;vt.push(xt)}if(Pt){var ke=U.split(P);ke[0]=vt.join(O),U=ke.join(P)}}if($||$!==!1&&U.indexOf(D)===-1){for(var Re=U.split(P),be=0;be<Re.length;be++){if(R=Re[be],I+=R.length,be!==Re.length-1)I+=P.length;else if(dt)return ue();if(!A||R.substring(0,j)!==A){if(Z){if(K=[],en(R.split(O)),ye(),it)return ue()}else en(R.split(O));if(q&&q<=be)return K=K.slice(0,q),ue(!0)}}return ue()}for(var It=U.indexOf(O,I),Bt=U.indexOf(P,I),tn=new RegExp(p(H)+p(D),"g"),St=U.indexOf(D,I);;)if(U[I]!==D)if(A&&R.length===0&&U.substring(I,I+j)===A){if(Bt===-1)return ue();I=Bt+B,Bt=U.indexOf(P,I),It=U.indexOf(O,I)}else if(It!==-1&&(It<Bt||Bt===-1))R.push(U.substring(I,It)),I=It+L,It=U.indexOf(O,I);else{if(Bt===-1)break;if(R.push(U.substring(I,Bt)),Ie(Bt+B),Z&&(ye(),it))return ue();if(q&&K.length>=q)return ue(!0)}else for(St=I,I++;;){if((St=U.indexOf(D,St+1))===-1)return dt||N.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:K.length,index:I}),Se();if(St===Y-1)return Se(U.substring(I,St).replace(tn,D));if(D!==H||U[St+1]!==H){if(D===H||St===0||U[St-1]!==H){It!==-1&&It<St+1&&(It=U.indexOf(O,St+1)),Bt!==-1&&Bt<St+1&&(Bt=U.indexOf(P,St+1));var kn=_e(Bt===-1?It:Math.min(It,Bt));if(U.substr(St+1+kn,L)===O){R.push(U.substring(I,St).replace(tn,D)),U[I=St+1+kn+L]!==D&&(St=U.indexOf(D,I)),It=U.indexOf(O,I),Bt=U.indexOf(P,I);break}var Le=_e(Bt);if(U.substring(St+1+Le,St+1+Le+B)===P){if(R.push(U.substring(I,St).replace(tn,D)),Ie(St+1+Le+B),It=U.indexOf(O,I),St=U.indexOf(D,I),Z&&(ye(),it))return ue();if(q&&K.length>=q)return ue(!0);break}N.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:K.length,index:I}),St++}}else St++}return Se();function en(Qt){K.push(Qt),Q=I}function _e(Qt){var _a=0;if(Qt!==-1){var vr=U.substring(St+1,Qt);vr&&vr.trim()===""&&(_a=vr.length)}return _a}function Se(Qt){return dt||(Qt===void 0&&(Qt=U.substring(I)),R.push(Qt),I=Y,en(R),Z&&ye()),ue()}function Ie(Qt){I=Qt,en(R),R=[],Bt=U.indexOf(P,I)}function ue(Qt){return{data:K,errors:N,meta:{delimiter:O,linebreak:P,aborted:it,truncated:!!Qt,cursor:Q+(yt||0)}}}function ye(){F(ue()),K=[],N=[]}},this.abort=function(){it=!0},this.getCharIndex=function(){return I}}function m(M){var D=M.data,O=s[D.workerId],P=!1;if(D.error)O.userError(D.error,D.file);else if(D.results&&D.results.data){var A={abort:function(){P=!0,y(D.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:w,resume:w};if(k(O.userStep)){for(var F=0;F<D.results.data.length&&(O.userStep({data:D.results.data[F],errors:D.results.errors,meta:D.results.meta},A),!P);F++);delete D.results}else k(O.userChunk)&&(O.userChunk(D.results,A,D.file),delete D.results)}D.finished&&!P&&y(D.workerId,D.results)}function y(M,D){var O=s[M];k(O.userComplete)&&O.userComplete(D),O.terminate(),delete s[M]}function w(){throw new Error("Not implemented.")}function T(M){if(typeof M!="object"||M===null)return M;var D=Array.isArray(M)?[]:{};for(var O in M)D[O]=T(M[O]);return D}function S(M,D){return function(){M.apply(D,arguments)}}function k(M){return typeof M=="function"}return a&&(r.onmessage=function(M){var D=M.data;if(l.WORKER_ID===void 0&&D&&(l.WORKER_ID=D.workerId),typeof D.input=="string")r.postMessage({workerId:l.WORKER_ID,results:l.parse(D.input,D.config),finished:!0});else if(r.File&&D.input instanceof File||D.input instanceof Object){var O=l.parse(D.input,D.config);O&&r.postMessage({workerId:l.WORKER_ID,results:O,finished:!0})}}),(d.prototype=Object.create(u.prototype)).constructor=d,(f.prototype=Object.create(u.prototype)).constructor=f,(g.prototype=Object.create(g.prototype)).constructor=g,(v.prototype=Object.create(u.prototype)).constructor=v,l})})(tg);var AC=tg.exports;const RC=["id"],LC=h.defineComponent({__name:"VueJsonCsv",props:{data:{type:Array,required:!0},fields:{type:Array,required:!1,default:null},labels:{type:Object,required:!1,default:null},filename:{type:String,default:"report-data.csv"},delimiter:{type:String,default:",",required:!1},separatorExcel:{type:Boolean,default:!1},encoding:{type:String,default:"utf-8"},testing:{type:Boolean,required:!1,default:!1}},emits:["export-started","export-finished"],setup(n,{emit:t}){const e=t,r=n,i=h.computed(()=>`export_${new Date().getTime()}`),a=h.computed(()=>{const u=l();return u.length?u:null}),s=()=>{const u=r.labels;if(typeof r.fields!==Xn.Object)throw new Error("Labels needs to be a object containing key / value pairs.");return typeof u===Xn.Object?d=>tC(d,(f,g)=>u[g]||g):d=>d},o=()=>{const u=r.fields;if(typeof r.fields!==Xn.Object&&!Array.isArray(u))throw new Error("Fields needs to be an array of strings.");return Array.isArray(u)?d=>PC(d,u):d=>d},l=()=>{if(typeof r.fields===Xn.Undefined&&typeof r.labels===Xn.Undefined)return r.data;const u=s(),d=o();return r.data.map(f=>u(d(f)))},c=()=>{if(!(a!=null&&a.value)){console.warn("No data to export");return}e("export-started",a.value);let u=AC.unparse(a.value,Object.assign({delimiter:r.delimiter,encoding:r.encoding}));if(r.separatorExcel&&(u="SEP="+r.delimiter+`\r
44
- `+u),r.encoding==="utf-8"&&(u="\uFEFF"+u),e("export-finished",r.filename),!r.testing){const d=new Blob([u],{type:"text/csv;charset="+r.encoding});EC.saveAs(d,r.filename)}};return(u,d)=>(h.openBlock(),h.createElementBlock("div",{id:i.value,"data-testid":"export-csv",onClick:c},[h.renderSlot(u.$slots,"default",{},()=>[h.createTextVNode("Download "+h.toDisplayString(n.filename),1)])],8,RC))}}),IC=h.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(n){const t=n,e=h.computed(()=>Object.keys(t.headers));return(r,i)=>(h.openBlock(),h.createElementBlock("div",null,[h.createVNode(LC,{data:r.rows,fields:e.value,filename:r.filename,labels:r.headers},{default:h.withCtx(()=>[h.renderSlot(r.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),NC={class:"kong-ui-public-csv-export-modal"},FC={key:0,class:"selected-range"},BC={key:1,class:"text-muted",tag:"span"},eg=3,ng=h.defineComponent({__name:"CsvExportModal",props:{filename:{},modalDescription:{default:void 0},chartData:{}},emits:["toggleModal"],setup(n,{emit:t}){const{i18n:e}=kt.useI18n(),r=n,i=t,a=`${r.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,s=h.ref(!0),o=h.computed(()=>{var x,p;return!!((p=(x=r.chartData)==null?void 0:x.data)!=null&&p.length)}),l=h.ref(1),c=h.computed(()=>g.value.rows.length),u=kt.useChartSelectedRange(h.toRef(r,"chartData")),d=h.computed(()=>e.t("csvExport.previewRows",{rowsMax:Math.min(eg,c.value),rowsTotal:c.value,plural:c.value===1?"":"s"})),f=()=>{i("toggleModal",!1)},g=h.computed(()=>{var T,S,k;if(!o.value||!((T=r.chartData)!=null&&T.meta.metric_names))return{headers:[],rows:[],csvHeaders:{}};const x=r.chartData.data.some(M=>M.timestamp!==r.chartData.data[0].timestamp),p=r.chartData.data.map(M=>{const D=new Date(M.timestamp);return{...Object.keys(M.event).reduce((P,A)=>{if(A in r.chartData.meta.display){const F=M.event[A],q=r.chartData.meta.display[A];P[A]=F&&q&&q[F].name||M.event[A]}else P[A]=M.event[A];return P},{}),...x?{timestamp:So(D,"yyyy-MM-dd HH:mm:ss"),tzOffset:So(D,"XXX")}:{}}});let b=[];x&&(b=[{label:e.t("csvExport.Timestamp"),key:"timestamp"},{label:e.t("csvExport.UtcOffset"),key:"tzOffset"}]);const m="display"in r.chartData.meta&&((S=r.chartData.meta)!=null&&S.display)?(k=r.chartData.meta)==null?void 0:k.display:{},y=[...b,...Object.keys(m).map(M=>({label:e.t(`chartLabels.${M}`),key:M})),...r.chartData.meta.metric_names.map(M=>({label:e.t(`chartLabels.${M}`),key:M}))],w=y.reduce((M,D)=>(M[D.key]=D.label,M),{});return{headers:y,csvHeaders:w,rows:p}}),v=()=>{const{rows:x}=g.value;return s.value=!1,{total:Number(x.length)||0,data:x.slice(0,eg)}};return h.watch(g,()=>{l.value++}),(x,p)=>{const b=h.resolveComponent("KEmptyState"),m=h.resolveComponent("KTable"),y=h.resolveComponent("KButton"),w=h.resolveComponent("KModal");return h.openBlock(),h.createElementBlock("div",NC,[h.createVNode(w,{class:"vitals-report","data-testid":"csv-export-modal","show-dismiss-icon":"",title:h.unref(e).t("csvExport.exportPreview"),visible:"",onCancel:f,onKeyup:h.withKeys(f,["esc"])},{default:h.withCtx(()=>{var T;return[h.createElementVNode("div",null,[o.value?(h.openBlock(),h.createElementBlock("div",FC,[h.createElementVNode("p",null,h.toDisplayString(x.modalDescription?x.modalDescription:h.unref(e).t("csvExport.exportDescription")),1),h.createElementVNode("p",null,h.toDisplayString(h.unref(e).t("csvExport.exportTimeRange"))+": "+h.toDisplayString(h.unref(u)),1)])):h.createCommentVNode("",!0),h.createVNode(m,{class:"vitals-table","disable-pagination":"","disable-sorting":"",fetcher:v,"fetcher-cache-key":String(l.value),"has-hover":!1,headers:((T=g.value)==null?void 0:T.headers)||[]},{"empty-state":h.withCtx(()=>[h.createVNode(b,{"cta-is-hidden":"",icon:"stateNoData","icon-size":"96"},{title:h.withCtx(()=>[h.createElementVNode("h5",null,h.toDisplayString(h.unref(e).t("csvExport.noDataRange")),1)]),message:h.withCtx(()=>[h.createElementVNode("p",null,h.toDisplayString(h.unref(e).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"]),!s.value&&o.value?(h.openBlock(),h.createElementBlock("div",BC,h.toDisplayString(d.value),1)):h.createCommentVNode("",!0)])]}),"footer-actions":h.withCtx(()=>[h.createVNode(y,{appearance:"tertiary",class:"cancel-btn",onClick:f},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("csvExport.cancelButton")),1)]),_:1}),h.createVNode(IC,{class:"vitals-report-export-button",filename:a,headers:g.value.csvHeaders,rows:g.value.rows},{default:h.withCtx(()=>[h.createVNode(y,{appearance:"primary","data-testid":"csv-download-button",disabled:s.value||!o.value},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}}),rg=h.defineComponent({__name:"CsvExportButton",props:{data:{type:Object,required:!0},text:{type:String,required:!1,default:void 0},buttonAppearance:{type:String,required:!1,default:()=>"tertiary"},filenamePrefix:{type:String,required:!1,default:void 0}},setup(n){const t=n,{i18n:e}=kt.useI18n(),r=h.computed(()=>t.filenamePrefix||e.t("csvExport.defaultFilename")),i=h.ref(!1),a=o=>{i.value=o},s=()=>{a(!0)};return(o,l)=>{const c=h.resolveComponent("KButton");return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createVNode(c,{appearance:n.buttonAppearance,class:"chart-export-button-display","data-testid":"csv-export-button",onClick:h.withModifiers(s,["prevent"])},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(n.text||h.unref(e).t("csvExport.exportButton")),1)]),_:1},8,["appearance"]),i.value?(h.openBlock(),h.createBlock(ng,{key:0,"chart-data":n.data,filename:r.value,onToggleModal:a},null,8,["chart-data","filename"])):h.createCommentVNode("",!0)],64)}}}),UC={class:"analytics-chart-shell"},WC={class:"chart-header"},YC={key:0,class:"chart-title"},HC={class:"chart-header-icons-wrapper"},zC={key:1,class:"chart-export-button"},$C={key:1,class:"analytics-chart-parent"},jC=h.defineComponent({__name:"AnalyticsChart",props:{allowCsvExport:{type:Boolean,required:!1,default:!1},chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},tooltipTitle:{type:String,required:!1,default:""},emptyStateTitle:{type:String,required:!1,default:""},emptyStateDescription:{type:String,required:!1,default:""},chartTitle:{type:String,required:!1,default:""},filenamePrefix:{type:String,required:!1,default:""},legendPosition:{type:String,required:!1,default:Yt.Right},syntheticsDataKey:{type:String,required:!1,default:""},showLegendValues:{type:Boolean,required:!1,default:!0},showAnnotations:{type:Boolean,required:!1,default:!0}},setup(n){const t=n,{i18n:e}=kt.useI18n(),r=h.toRef(t,"chartData"),i=h.computed(()=>g.value?kt.useExploreResultToTimeDataset({fill:t.chartOptions.fill,colorPalette:t.chartOptions.chartDatasetColors||Ce},h.toRef(t,"chartData")).value:kt.useExploreResultToDatasets({fill:t.chartOptions.fill,colorPalette:t.chartOptions.chartDatasetColors||Ce},h.toRef(t,"chartData")).value),a=h.computed(()=>{var k;return(k=t.chartData)!=null&&k.meta?"start_ms"in t.chartData.meta?t.chartData.meta.end_ms-t.chartData.meta.start_ms:void 0:0}),s=h.computed(()=>{var k;return(k=t.chartData.meta)!=null&&k.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""}),o=h.computed(()=>t.showLegendValues&&t.legendPosition!==Yt.Bottom),{legendValues:l}=kt.useChartLegendValues(i,t.chartOptions.type,s),c=h.computed(()=>{var k,M,D;return((D=(M=(k=t.chartData)==null?void 0:k.meta)==null?void 0:M.limit)==null?void 0:D.toString())||null}),u=h.computed(()=>{var k,M;return((M=(k=t.chartData)==null?void 0:k.meta)==null?void 0:M.truncated)||!1}),d=e.t("limitedResultsShown",{maxReturned:c.value}),f=h.computed(()=>[ne.VERTICAL_BAR.toString(),ne.HORIZONTAL_BAR.toString()].includes(t.chartOptions.type)),g=h.computed(()=>[ne.TIMESERIES_BAR,ne.TIMESERIES_LINE].some(k=>k===t.chartOptions.type)),v=h.computed(()=>t.chartOptions.type===ne.DOUGHNUT),x=h.computed(()=>t.chartOptions.type.includes("Vertical")?"vertical":"horizontal"),p=h.computed(()=>{var D,O,P;if(!((D=t.chartData)!=null&&D.meta.metric_names)||!((O=t.chartData)!=null&&O.meta.metric_units))return;const k=t.chartData.meta.metric_names[0],M=t.chartData.meta.metric_units[k];return((P=t.chartOptions)==null?void 0:P.metricAxesTitle)||e.te(`metricAxisTitles.${k}`)&&e.te(`chartUnits.${M}`)&&e.t(`metricAxisTitles.${k}`,{unit:e.t(`chartUnits.${M}`,{plural:"s"})})||void 0}),b=h.computed(()=>{const k=g.value?"Time":Object.keys(t.chartData.meta.display||t.chartData.meta.metric_names)[0];return t.chartOptions.dimensionAxesTitle||e.te(`chartLabels.${k}`)&&e.t(`chartLabels.${k}`)||void 0}),m=h.computed(()=>{const k=Ml(Number(t.chartData.meta.granularity_ms));return e.t(`granularityAxisTitles.${k}`)}),y=h.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),w=h.computed(()=>t.emptyStateDescription||e.t("noDataAvailableDescription")),T=h.computed(()=>g.value?Pw(i.value):t.chartData&&t.chartData.meta&&t.chartData.data.length),S=h.computed(()=>t.chartData.meta.granularity_ms?Ml(t.chartData.meta.granularity_ms)||ct.HOURLY:Ml(new Date(t.chartData.data[1].timestamp).getTime()-new Date(t.chartData.data[0].timestamp).getTime())||ct.HOURLY);return h.provide("showLegendValues",o),h.provide("legendPosition",h.toRef(t,"legendPosition")),(k,M)=>{const D=h.resolveComponent("KTooltip"),O=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",UC,[h.createElementVNode("div",WC,[n.chartTitle?(h.openBlock(),h.createElementBlock("div",YC,h.toDisplayString(n.chartTitle),1)):h.createCommentVNode("",!0),h.createElementVNode("div",HC,[T.value&&u.value&&c.value?(h.openBlock(),h.createBlock(D,{key:0,class:"tooltip","max-width":"500",placement:"right"},{content:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(d)),1)]),default:h.withCtx(()=>[h.createVNode(h.unref(dD),{color:h.unref(hD),decorative:"",size:h.unref(gD)},null,8,["color","size"])]),_:1})):h.createCommentVNode("",!0)]),n.allowCsvExport&&T.value?(h.openBlock(),h.createElementBlock("div",zC,[h.createVNode(rg,{data:r.value,"filename-prefix":n.filenamePrefix},null,8,["data","filename-prefix"])])):h.createCommentVNode("",!0)]),T.value?(h.openBlock(),h.createElementBlock("div",$C,[g.value?(h.openBlock(),h.createBlock(ZD,{key:0,"chart-data":i.value,"chart-legend-sort-fn":n.chartOptions.chartLegendSortFn,"chart-tooltip-sort-fn":n.chartOptions.chartTooltipSortFn,"dataset-colors":n.chartOptions.chartDatasetColors,"dimension-axes-title":m.value,fill:n.chartOptions.fill,granularity:S.value,"legend-values":h.unref(l),"metric-axes-title":p.value,"metric-unit":s.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,"time-range-ms":a.value,"tooltip-title":n.tooltipTitle,type:n.chartOptions.type},null,8,["chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dataset-colors","dimension-axes-title","fill","granularity","legend-values","metric-axes-title","metric-unit","stacked","synthetics-data-key","time-range-ms","tooltip-title","type"])):f.value?(h.openBlock(),h.createBlock(BD,{key:1,annotations:n.showAnnotations,"chart-data":i.value,"chart-legend-sort-fn":n.chartOptions.chartLegendSortFn,"chart-tooltip-sort-fn":n.chartOptions.chartTooltipSortFn,"data-testid":"bar-chart-container","dimension-axes-title":b.value,"legend-values":h.unref(l),"metric-axes-title":p.value,"metric-unit":s.value,orientation:x.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,"tooltip-title":n.tooltipTitle},null,8,["annotations","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","legend-values","metric-axes-title","metric-unit","orientation","stacked","synthetics-data-key","tooltip-title"])):v.value?(h.openBlock(),h.createBlock(KD,{key:2,"chart-data":i.value,"dataset-colors":n.chartOptions.chartDatasetColors,fill:n.chartOptions.fill,"legend-position":n.legendPosition,"legend-values":h.unref(l),"metric-unit":s.value,"synthetics-data-key":n.syntheticsDataKey,"tooltip-title":n.tooltipTitle},null,8,["chart-data","dataset-colors","fill","legend-position","legend-values","metric-unit","synthetics-data-key","tooltip-title"])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(O,{key:0,class:"chart-empty-state","cta-is-hidden":!0,"data-testid":"no-data-in-report",icon:"stateNoData","icon-size":"170"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(y.value),1)]),message:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(w.value),1)]),_:1}))])}}}),VC=Je(jC,[["__scopeId","data-v-410a8b13"]]),qC={class:"chart-parent","data-testid":"doughnut-chart-parent"},XC={class:"chart-totals-flex"},GC={key:1,class:"metric-small","data-testid":"doughnut-chart-total"},KC=h.defineComponent({__name:"GaugeChart",props:{chartData:{type:Object,required:!1,default:null},metricDisplay:{type:String,required:!1,default:lr.Hidden},numerator:{type:Number,required:!1,default:0},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:Ce},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=kt.useI18n(),r=h.ref(Dn()),i=h.computed(()=>[t.chartData.datasets.reduce((v,x)=>(v.labels.push(x.label),v.borderColor.push(x.backgroundColor),v.backgroundColor.push(x.backgroundColor),v.data.push(x.data.reduce((p,b)=>p+b,0)),v),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),a=h.computed(()=>({...t.chartData,datasets:i.value}));kt.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const s={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},o=h.ref(),l=h.computed(()=>{var g;return ai((g=i==null?void 0:i.value[0])==null?void 0:g.data[t.numerator],{capital:!0})}),c=h.computed(()=>{var g,v;return ai(((g=i==null?void 0:i.value[0])==null?void 0:g.data[0])+((v=i==null?void 0:i.value[0])==null?void 0:v.data[1]),{capital:!0})}),u=h.computed(()=>{var g;return`color: ${(g=i==null?void 0:i.value[0])==null?void 0:g.backgroundColor[t.numerator]}`}),d=h.computed(()=>[lr.Full,lr.SingleMetric].includes(t.metricDisplay)),f=h.computed(()=>t.metricDisplay===lr.Full);return(g,v)=>(h.openBlock(),h.createElementBlock("div",qC,[h.createElementVNode("div",XC,[d.value?(h.openBlock(),h.createElementBlock("div",{key:0,class:"metric-large","data-testid":"doughnut-chart-metric",style:h.normalizeStyle(u.value)},h.toDisplayString(l.value),5)):h.createCommentVNode("",!0),f.value?(h.openBlock(),h.createElementBlock("div",GC,h.toDisplayString(h.unref(e).t("total"))+": "+h.toDisplayString(c.value),1)):h.createCommentVNode("",!0)]),h.createElementVNode("div",{class:"chart-container",style:h.normalizeStyle({height:n.height,width:n.width})},[h.createVNode(h.unref(Vh),{ref_key:"chartInstance",ref:o,"chart-id":r.value,data:a.value,options:s},null,8,["chart-id","data","options"])],4)]))}}),QC=Je(KC,[["__scopeId","data-v-5871cb7a"]]),ZC={class:"simple-chart-shell"},JC={key:1,class:"analytics-chart-parent"},tk=Je(h.defineComponent({__name:"SimpleChart",props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},emptyStateTitle:{type:String,required:!1,default:""},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=kt.useI18n(),r=h.computed(()=>{var c;const l=kt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||Ce},h.toRef(t,"chartData")).value;return(c=t.chartOptions)!=null&&c.reverseDataset&&(l==null||l.datasets.reverse()),l}),i=h.computed(()=>{var l;return(l=t.chartData.meta)!=null&&l.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""}),a=h.computed(()=>t.chartOptions.type===ra.GAUGE),s=h.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),o=h.computed(()=>t.chartData&&t.chartData.meta&&t.chartData.data.length);return(l,c)=>{const u=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",ZC,[o.value?(h.openBlock(),h.createElementBlock("div",JC,[a.value?(h.openBlock(),h.createBlock(QC,{key:0,"chart-data":r.value,"dataset-colors":n.chartOptions.chartDatasetColors,"is-simple":"","metric-display":n.chartOptions.metricDisplay,"metric-unit":i.value,numerator:n.chartOptions.numerator,"synthetics-data-key":n.syntheticsDataKey,width:n.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","numerator","synthetics-data-key","width"])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(u,{key:0,class:"chart-empty-state","cta-is-hidden":!0,"data-testid":"no-data-in-report",icon:"stateNoData","icon-size":"80"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(s.value),1)]),_:1}))])}}}),[["__scopeId","data-v-7d1a0034"]]),ek={class:"top-n-card-title","data-testid":"top-n-card-title"},nk={class:"top-n-card-description","data-testid":"top-n-card-description"},rk={key:3,class:"top-n-table","data-testid":"top-n-table"},ik={class:"table-headings"},ak={class:"table-row"},sk={class:"column-1"},ok={class:"column-2"},lk={class:"table-body","data-testid":"top-n-data"},ck=["data-testid"],uk={class:"column-1"},dk={class:"column-2"},fk=Je(h.defineComponent({__name:"TopNTable",props:{title:{type:String,required:!0},description:{type:String,default:""},data:{type:Object,required:!0},emptyStateTitle:{type:String,default:""},isLoading:{type:Boolean,default:!1}},setup(n){const t=n,{i18n:e}=kt.useI18n(),r=h.computed(()=>t.data.data),i=h.computed(()=>{var v;return!!((v=r.value)!=null&&v.length)}),a=h.computed(()=>{var v,x;return(v=t.data.meta)!=null&&v.display&&((x=Object.keys(t.data.meta.display))==null?void 0:x[0])||""}),s=h.computed(()=>a.value?t.data.meta.display[a.value]:{}),o=h.computed(()=>{var v,x;return(x=(v=t.data.meta)==null?void 0:v.metric_names)!=null&&x.length?t.data.meta.metric_names[0]:""}),l=h.computed(()=>o.value?e.t(`chartLabels.${o.value}`)||o.value:""),c=h.computed(()=>{if(!i.value)return"";if(t.data.meta){if(s.value&&!Object.keys(s.value).length)return e.t("topNTable.errors.display");if(!o.value)return e.t("topNTable.errors.metricNames")}else return e.t("topNTable.errors.meta");return""}),u=v=>{const x=v.event;return String(x[a.value])},d=v=>{const x=u(v),p=s.value&&s.value[x];return p?p.name:"-"},f=v=>{const x=u(v),p=s.value&&s.value[x];return p?!!p.deleted:!1},g=v=>{if(!o.value)return"–";const p=v.event[o.value];return p?ai(p,{capital:!0,round:!0}):"–"};return(v,x)=>{const p=h.resolveComponent("KEmptyState"),b=h.resolveComponent("KSkeleton"),m=h.resolveComponent("KCard");return h.openBlock(),h.createBlock(m,{class:"kong-ui-public-top-n-table"},h.createSlots({default:h.withCtx(()=>[c.value?(h.openBlock(),h.createBlock(p,{key:0,"cta-is-hidden":"","data-testid":"top-n-error-state","is-error":""},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),message:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(c.value),1)]),_:1})):n.isLoading?(h.openBlock(),h.createBlock(b,{key:1,"table-columns":2,type:"table"})):i.value?(h.openBlock(),h.createElementBlock("div",rk,[h.createElementVNode("div",ik,[h.createElementVNode("div",ak,[h.createElementVNode("div",sk,h.toDisplayString(h.unref(e).t("topNTable.nameLabel")),1),h.createElementVNode("div",ok,h.toDisplayString(l.value),1)])]),h.createElementVNode("div",lk,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(r.value,(y,w)=>(h.openBlock(),h.createElementBlock("div",{key:`entry-${w}`,class:"table-row","data-testid":`row-${u(y)}`},[h.createElementVNode("div",uk,[h.renderSlot(v.$slots,"name",{record:{id:u(y),name:d(y),deleted:f(y),dimension:a.value}},()=>[h.createTextVNode(h.toDisplayString(d(y)),1)],!0)]),h.createElementVNode("div",dk,"   "+h.toDisplayString(g(y)),1)],8,ck))),128))])])):(h.openBlock(),h.createBlock(p,{key:2,"cta-is-hidden":"","data-testid":"top-n-empty-state",icon:"stateNoData","icon-size":"80"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(n.emptyStateTitle||h.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[n.title?{name:"title",fn:h.withCtx(()=>[h.createElementVNode("div",ek,h.toDisplayString(n.title),1)]),key:"0"}:void 0,n.description?{name:"actions",fn:h.withCtx(()=>[h.createElementVNode("div",nk,h.toDisplayString(n.description),1)]),key:"1"}:void 0]),1024)}}}),[["__scopeId","data-v-12271773"]]),Xl="#e0e4ea",hk={100:["#c8e2fd","#80bfff","#4da6ff","#1a8cff","#0072e5","#0059b2"],200:["#ceedd2","#9edca6","#89d595","#6fcc83","#44c26b","#0bb652","#0ca84a","#169643","#196e33","#1b572a"],300:["#fff4db","#ffe9b8","#ffe2a1","#ffd982","#ffd062","#fdc53b","#f4bb1e","#e8b00b","#d9a30f","#c89407"],400:["#ffead8","#ffd5b1","#ffc899","#ffba81","#ffae6b","#fe9439","#f6871d","#eb7c0c","#da700c","#cc6100"],500:["#ffd5d5","#ffb6b6","#ff9d9d","#ff8484","#ff6a6a","#ff4545","#fb1f1f","#e90b0b","#d40202","#be0202"]},fi=(n,t)=>{let e=1;const r=hk[n],i=new Map;for(const a of t)i.set(a,r[e]),e=e%(r.length-1)+1;return i.set(-1,r[0]),i},ig=new Map([[100,fi("100",[100,101,102,103])],[200,fi("200",[200,201,202,203,204,205,206,207,208,226])],[300,fi("300",[300,301,302,303,304,305,307,308])],[400,fi("400",[400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,421,422,423,424,425,426,428,429,431,451])],[500,fi("500",[500,501,502,503,504,505,506,507,508,510,511])]]),ag=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100,r=ig.get(e);return r===void 0?Xl:r.get(t)??r.get(-1)??Xl},gk=n=>{const t=ag(n);return{solid:t,light:t}};st.AnalyticsChart=VC,st.ChartLegendPosition=Yt,st.ChartMetricDisplay=lr,st.ChartTypes=ne,st.ChartTypesSimple=ra,st.CsvExportButton=rg,st.CsvExportModal=ng,st.DECIMAL_DISPLAY=wf,st.FONT_SIZE_REGULAR=Tf,st.FONT_SIZE_SMALL=_f,st.MAX_LABEL_LENGTH=oa,st.OTHERS_COLOR=V_,st.SimpleChart=tk,st.TopNTable=fk,st.ValidType=Xn,st.accessibleGrey=Df,st.apiRequestStatusCodeColors=Cf,st.codesInSpec=ig,st.darkenColor=ii,st.datavisPalette=Ce,st.errorRateColors=$_,st.formatTime=sa,st.latencyColors=j_,st.lightGrey=Xl,st.lookupColor=q_,st.lookupDatavisColor=ur,st.lookupStatusCodeCategoryColor=gk,st.lookupStatusCodeColor=ag,st.numberFormatter=aa,st.statusCodeBadgeBackgroundColor=H_,st.trafficColors=z_,Object.defineProperty(st,Symbol.toStringTag,{value:"Module"})});
44
+ `+u),r.encoding==="utf-8"&&(u="\uFEFF"+u),e("export-finished",r.filename),!r.testing){const d=new Blob([u],{type:"text/csv;charset="+r.encoding});EC.saveAs(d,r.filename)}};return(u,d)=>(h.openBlock(),h.createElementBlock("div",{id:i.value,"data-testid":"export-csv",onClick:c},[h.renderSlot(u.$slots,"default",{},()=>[h.createTextVNode("Download "+h.toDisplayString(n.filename),1)])],8,RC))}}),IC=h.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(n){const t=n,e=h.computed(()=>Object.keys(t.headers));return(r,i)=>(h.openBlock(),h.createElementBlock("div",null,[h.createVNode(LC,{data:r.rows,fields:e.value,filename:r.filename,labels:r.headers},{default:h.withCtx(()=>[h.renderSlot(r.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),NC={class:"kong-ui-public-csv-export-modal"},FC={key:0,class:"selected-range"},BC={key:1,class:"text-muted",tag:"span"},eg=3,ng=h.defineComponent({__name:"CsvExportModal",props:{filename:{},modalDescription:{default:void 0},chartData:{}},emits:["toggleModal"],setup(n,{emit:t}){const{i18n:e}=kt.useI18n(),r=n,i=t,a=`${r.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,s=h.ref(!0),o=h.computed(()=>{var x,p;return!!((p=(x=r.chartData)==null?void 0:x.data)!=null&&p.length)}),l=h.ref(1),c=h.computed(()=>g.value.rows.length),u=kt.useChartSelectedRange(h.toRef(r,"chartData")),d=h.computed(()=>e.t("csvExport.previewRows",{rowsMax:Math.min(eg,c.value),rowsTotal:c.value,plural:c.value===1?"":"s"})),f=()=>{i("toggleModal",!1)},g=h.computed(()=>{var T,S,k;if(!o.value||!((T=r.chartData)!=null&&T.meta.metric_names))return{headers:[],rows:[],csvHeaders:{}};const x=r.chartData.data.some(M=>M.timestamp!==r.chartData.data[0].timestamp),p=r.chartData.data.map(M=>{const D=new Date(M.timestamp);return{...Object.keys(M.event).reduce((P,A)=>{if(A in r.chartData.meta.display){const F=M.event[A],q=r.chartData.meta.display[A];P[A]=F&&q&&q[F].name||M.event[A]}else P[A]=M.event[A];return P},{}),...x?{timestamp:So(D,"yyyy-MM-dd HH:mm:ss"),tzOffset:So(D,"XXX")}:{}}});let b=[];x&&(b=[{label:e.t("csvExport.Timestamp"),key:"timestamp"},{label:e.t("csvExport.UtcOffset"),key:"tzOffset"}]);const m="display"in r.chartData.meta&&((S=r.chartData.meta)!=null&&S.display)?(k=r.chartData.meta)==null?void 0:k.display:{},y=[...b,...Object.keys(m).map(M=>({label:e.t(`chartLabels.${M}`),key:M})),...r.chartData.meta.metric_names.map(M=>({label:e.t(`chartLabels.${M}`),key:M}))],w=y.reduce((M,D)=>(M[D.key]=D.label,M),{});return{headers:y,csvHeaders:w,rows:p}}),v=()=>{const{rows:x}=g.value;return s.value=!1,{total:Number(x.length)||0,data:x.slice(0,eg)}};return h.watch(g,()=>{l.value++}),(x,p)=>{const b=h.resolveComponent("KEmptyState"),m=h.resolveComponent("KTable"),y=h.resolveComponent("KButton"),w=h.resolveComponent("KModal");return h.openBlock(),h.createElementBlock("div",NC,[h.createVNode(w,{class:"vitals-report","data-testid":"csv-export-modal","show-dismiss-icon":"",title:h.unref(e).t("csvExport.exportPreview"),visible:"",onCancel:f,onKeyup:h.withKeys(f,["esc"])},{default:h.withCtx(()=>{var T;return[h.createElementVNode("div",null,[o.value?(h.openBlock(),h.createElementBlock("div",FC,[h.createElementVNode("p",null,h.toDisplayString(x.modalDescription?x.modalDescription:h.unref(e).t("csvExport.exportDescription")),1),h.createElementVNode("p",null,h.toDisplayString(h.unref(e).t("csvExport.exportTimeRange"))+": "+h.toDisplayString(h.unref(u)),1)])):h.createCommentVNode("",!0),h.createVNode(m,{class:"vitals-table","disable-pagination":"","disable-sorting":"",fetcher:v,"fetcher-cache-key":String(l.value),"has-hover":!1,headers:((T=g.value)==null?void 0:T.headers)||[]},{"empty-state":h.withCtx(()=>[h.createVNode(b,{"cta-is-hidden":"",icon:"stateNoData","icon-size":"96"},{title:h.withCtx(()=>[h.createElementVNode("h5",null,h.toDisplayString(h.unref(e).t("csvExport.noDataRange")),1)]),message:h.withCtx(()=>[h.createElementVNode("p",null,h.toDisplayString(h.unref(e).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"]),!s.value&&o.value?(h.openBlock(),h.createElementBlock("div",BC,h.toDisplayString(d.value),1)):h.createCommentVNode("",!0)])]}),"footer-actions":h.withCtx(()=>[h.createVNode(y,{appearance:"tertiary",class:"cancel-btn",onClick:f},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("csvExport.cancelButton")),1)]),_:1}),h.createVNode(IC,{class:"vitals-report-export-button",filename:a,headers:g.value.csvHeaders,rows:g.value.rows},{default:h.withCtx(()=>[h.createVNode(y,{appearance:"primary","data-testid":"csv-download-button",disabled:s.value||!o.value},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}}),rg=h.defineComponent({__name:"CsvExportButton",props:{data:{type:Object,required:!0},text:{type:String,required:!1,default:void 0},buttonAppearance:{type:String,required:!1,default:()=>"tertiary"},filenamePrefix:{type:String,required:!1,default:void 0}},setup(n){const t=n,{i18n:e}=kt.useI18n(),r=h.computed(()=>t.filenamePrefix||e.t("csvExport.defaultFilename")),i=h.ref(!1),a=o=>{i.value=o},s=()=>{a(!0)};return(o,l)=>{const c=h.resolveComponent("KButton");return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createVNode(c,{appearance:n.buttonAppearance,class:"chart-export-button-display","data-testid":"csv-export-button",onClick:h.withModifiers(s,["prevent"])},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(n.text||h.unref(e).t("csvExport.exportButton")),1)]),_:1},8,["appearance"]),i.value?(h.openBlock(),h.createBlock(ng,{key:0,"chart-data":n.data,filename:r.value,onToggleModal:a},null,8,["chart-data","filename"])):h.createCommentVNode("",!0)],64)}}}),UC={class:"analytics-chart-shell"},WC={class:"chart-header"},YC={key:0,class:"chart-title"},HC={class:"chart-header-icons-wrapper"},zC={key:1,class:"chart-export-button"},$C={key:1,class:"analytics-chart-parent"},jC=h.defineComponent({__name:"AnalyticsChart",props:{allowCsvExport:{type:Boolean,required:!1,default:!1},chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},tooltipTitle:{type:String,required:!1,default:""},emptyStateTitle:{type:String,required:!1,default:""},emptyStateDescription:{type:String,required:!1,default:""},chartTitle:{type:String,required:!1,default:""},filenamePrefix:{type:String,required:!1,default:""},legendPosition:{type:String,required:!1,default:Yt.Right},syntheticsDataKey:{type:String,required:!1,default:""},showLegendValues:{type:Boolean,required:!1,default:!0},showAnnotations:{type:Boolean,required:!1,default:!0}},setup(n){const t=n,{i18n:e}=kt.useI18n(),r=h.toRef(t,"chartData"),i=h.computed(()=>g.value?kt.useExploreResultToTimeDataset({fill:t.chartOptions.fill,colorPalette:t.chartOptions.chartDatasetColors||Ce},h.toRef(t,"chartData")).value:kt.useExploreResultToDatasets({fill:t.chartOptions.fill,colorPalette:t.chartOptions.chartDatasetColors||Ce},h.toRef(t,"chartData")).value),a=h.computed(()=>{var k;return(k=t.chartData)!=null&&k.meta?"start_ms"in t.chartData.meta?t.chartData.meta.end_ms-t.chartData.meta.start_ms:void 0:0}),s=h.computed(()=>{var k;return(k=t.chartData.meta)!=null&&k.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""}),o=h.computed(()=>t.showLegendValues&&t.legendPosition!==Yt.Bottom),{legendValues:l}=kt.useChartLegendValues(i,t.chartOptions.type,s),c=h.computed(()=>{var k,M,D;return((D=(M=(k=t.chartData)==null?void 0:k.meta)==null?void 0:M.limit)==null?void 0:D.toString())||null}),u=h.computed(()=>{var k,M;return((M=(k=t.chartData)==null?void 0:k.meta)==null?void 0:M.truncated)||!1}),d=e.t("limitedResultsShown",{maxReturned:c.value}),f=h.computed(()=>[ne.VERTICAL_BAR.toString(),ne.HORIZONTAL_BAR.toString()].includes(t.chartOptions.type)),g=h.computed(()=>[ne.TIMESERIES_BAR,ne.TIMESERIES_LINE].some(k=>k===t.chartOptions.type)),v=h.computed(()=>t.chartOptions.type===ne.DOUGHNUT),x=h.computed(()=>t.chartOptions.type.includes("Vertical")?"vertical":"horizontal"),p=h.computed(()=>{var D,O,P;if(!((D=t.chartData)!=null&&D.meta.metric_names)||!((O=t.chartData)!=null&&O.meta.metric_units))return;const k=t.chartData.meta.metric_names[0],M=t.chartData.meta.metric_units[k];return((P=t.chartOptions)==null?void 0:P.metricAxesTitle)||e.te(`metricAxisTitles.${k}`)&&e.te(`chartUnits.${M}`)&&e.t(`metricAxisTitles.${k}`,{unit:e.t(`chartUnits.${M}`,{plural:"s"})})||void 0}),b=h.computed(()=>{const k=g.value?"Time":Object.keys(t.chartData.meta.display||t.chartData.meta.metric_names)[0];return t.chartOptions.dimensionAxesTitle||e.te(`chartLabels.${k}`)&&e.t(`chartLabels.${k}`)||void 0}),m=h.computed(()=>{const k=Ml(Number(t.chartData.meta.granularity_ms));return e.t(`granularityAxisTitles.${k}`)}),y=h.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),w=h.computed(()=>t.emptyStateDescription||e.t("noDataAvailableDescription")),T=h.computed(()=>g.value?Pw(i.value):t.chartData&&t.chartData.meta&&t.chartData.data.length),S=h.computed(()=>t.chartData.meta.granularity_ms?Ml(t.chartData.meta.granularity_ms)||lt.HOURLY:Ml(new Date(t.chartData.data[1].timestamp).getTime()-new Date(t.chartData.data[0].timestamp).getTime())||lt.HOURLY);return h.provide("showLegendValues",o),h.provide("legendPosition",h.toRef(t,"legendPosition")),(k,M)=>{const D=h.resolveComponent("KTooltip"),O=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",UC,[h.createElementVNode("div",WC,[n.chartTitle?(h.openBlock(),h.createElementBlock("div",YC,h.toDisplayString(n.chartTitle),1)):h.createCommentVNode("",!0),h.createElementVNode("div",HC,[T.value&&u.value&&c.value?(h.openBlock(),h.createBlock(D,{key:0,class:"tooltip","max-width":"500",placement:"right"},{content:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(d)),1)]),default:h.withCtx(()=>[h.createVNode(h.unref(dD),{color:h.unref(hD),decorative:"",size:h.unref(gD)},null,8,["color","size"])]),_:1})):h.createCommentVNode("",!0)]),n.allowCsvExport&&T.value?(h.openBlock(),h.createElementBlock("div",zC,[h.createVNode(rg,{data:r.value,"filename-prefix":n.filenamePrefix},null,8,["data","filename-prefix"])])):h.createCommentVNode("",!0)]),T.value?(h.openBlock(),h.createElementBlock("div",$C,[g.value?(h.openBlock(),h.createBlock(ZD,{key:0,"chart-data":i.value,"chart-legend-sort-fn":n.chartOptions.chartLegendSortFn,"chart-tooltip-sort-fn":n.chartOptions.chartTooltipSortFn,"dataset-colors":n.chartOptions.chartDatasetColors,"dimension-axes-title":m.value,fill:n.chartOptions.fill,granularity:S.value,"legend-values":h.unref(l),"metric-axes-title":p.value,"metric-unit":s.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,"time-range-ms":a.value,"tooltip-title":n.tooltipTitle,type:n.chartOptions.type},null,8,["chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dataset-colors","dimension-axes-title","fill","granularity","legend-values","metric-axes-title","metric-unit","stacked","synthetics-data-key","time-range-ms","tooltip-title","type"])):f.value?(h.openBlock(),h.createBlock(BD,{key:1,annotations:n.showAnnotations,"chart-data":i.value,"chart-legend-sort-fn":n.chartOptions.chartLegendSortFn,"chart-tooltip-sort-fn":n.chartOptions.chartTooltipSortFn,"data-testid":"bar-chart-container","dimension-axes-title":b.value,"legend-values":h.unref(l),"metric-axes-title":p.value,"metric-unit":s.value,orientation:x.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,"tooltip-title":n.tooltipTitle},null,8,["annotations","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","legend-values","metric-axes-title","metric-unit","orientation","stacked","synthetics-data-key","tooltip-title"])):v.value?(h.openBlock(),h.createBlock(KD,{key:2,"chart-data":i.value,"dataset-colors":n.chartOptions.chartDatasetColors,fill:n.chartOptions.fill,"legend-position":n.legendPosition,"legend-values":h.unref(l),"metric-unit":s.value,"synthetics-data-key":n.syntheticsDataKey,"tooltip-title":n.tooltipTitle},null,8,["chart-data","dataset-colors","fill","legend-position","legend-values","metric-unit","synthetics-data-key","tooltip-title"])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(O,{key:0,class:"chart-empty-state","cta-is-hidden":!0,"data-testid":"no-data-in-report",icon:"stateNoData","icon-size":"170"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(y.value),1)]),message:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(w.value),1)]),_:1}))])}}}),VC=Je(jC,[["__scopeId","data-v-410a8b13"]]),qC={class:"chart-parent","data-testid":"doughnut-chart-parent"},XC={class:"chart-totals-flex"},GC={key:1,class:"metric-small","data-testid":"doughnut-chart-total"},KC=h.defineComponent({__name:"GaugeChart",props:{chartData:{type:Object,required:!1,default:null},metricDisplay:{type:String,required:!1,default:lr.Hidden},numerator:{type:Number,required:!1,default:0},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:Ce},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=kt.useI18n(),r=h.ref(Dn()),i=h.computed(()=>[t.chartData.datasets.reduce((v,x)=>(v.labels.push(x.label),v.borderColor.push(x.backgroundColor),v.backgroundColor.push(x.backgroundColor),v.data.push(x.data.reduce((p,b)=>p+b,0)),v),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),a=h.computed(()=>({...t.chartData,datasets:i.value}));kt.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const s={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},o=h.ref(),l=h.computed(()=>{var g;return ai((g=i==null?void 0:i.value[0])==null?void 0:g.data[t.numerator],{capital:!0})}),c=h.computed(()=>{var g,v;return ai(((g=i==null?void 0:i.value[0])==null?void 0:g.data[0])+((v=i==null?void 0:i.value[0])==null?void 0:v.data[1]),{capital:!0})}),u=h.computed(()=>{var g;return`color: ${(g=i==null?void 0:i.value[0])==null?void 0:g.backgroundColor[t.numerator]}`}),d=h.computed(()=>[lr.Full,lr.SingleMetric].includes(t.metricDisplay)),f=h.computed(()=>t.metricDisplay===lr.Full);return(g,v)=>(h.openBlock(),h.createElementBlock("div",qC,[h.createElementVNode("div",XC,[d.value?(h.openBlock(),h.createElementBlock("div",{key:0,class:"metric-large","data-testid":"doughnut-chart-metric",style:h.normalizeStyle(u.value)},h.toDisplayString(l.value),5)):h.createCommentVNode("",!0),f.value?(h.openBlock(),h.createElementBlock("div",GC,h.toDisplayString(h.unref(e).t("total"))+": "+h.toDisplayString(c.value),1)):h.createCommentVNode("",!0)]),h.createElementVNode("div",{class:"chart-container",style:h.normalizeStyle({height:n.height,width:n.width})},[h.createVNode(h.unref(Vh),{ref_key:"chartInstance",ref:o,"chart-id":r.value,data:a.value,options:s},null,8,["chart-id","data","options"])],4)]))}}),QC=Je(KC,[["__scopeId","data-v-5871cb7a"]]),ZC={class:"simple-chart-shell"},JC={key:1,class:"analytics-chart-parent"},tk=Je(h.defineComponent({__name:"SimpleChart",props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},emptyStateTitle:{type:String,required:!1,default:""},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=kt.useI18n(),r=h.computed(()=>{var c;const l=kt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||Ce},h.toRef(t,"chartData")).value;return(c=t.chartOptions)!=null&&c.reverseDataset&&(l==null||l.datasets.reverse()),l}),i=h.computed(()=>{var l;return(l=t.chartData.meta)!=null&&l.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""}),a=h.computed(()=>t.chartOptions.type===ra.GAUGE),s=h.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),o=h.computed(()=>t.chartData&&t.chartData.meta&&t.chartData.data.length);return(l,c)=>{const u=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",ZC,[o.value?(h.openBlock(),h.createElementBlock("div",JC,[a.value?(h.openBlock(),h.createBlock(QC,{key:0,"chart-data":r.value,"dataset-colors":n.chartOptions.chartDatasetColors,"is-simple":"","metric-display":n.chartOptions.metricDisplay,"metric-unit":i.value,numerator:n.chartOptions.numerator,"synthetics-data-key":n.syntheticsDataKey,width:n.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","numerator","synthetics-data-key","width"])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(u,{key:0,class:"chart-empty-state","cta-is-hidden":!0,"data-testid":"no-data-in-report",icon:"stateNoData","icon-size":"80"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(s.value),1)]),_:1}))])}}}),[["__scopeId","data-v-7d1a0034"]]),ek={class:"top-n-card-title","data-testid":"top-n-card-title"},nk={class:"top-n-card-description","data-testid":"top-n-card-description"},rk={key:3,class:"top-n-table","data-testid":"top-n-table"},ik={class:"table-headings"},ak={class:"table-row"},sk={class:"column-1"},ok={class:"column-2"},lk={class:"table-body","data-testid":"top-n-data"},ck=["data-testid"],uk={class:"column-1"},dk={class:"column-2"},fk=Je(h.defineComponent({__name:"TopNTable",props:{title:{type:String,required:!0},description:{type:String,default:""},data:{type:Object,required:!0},emptyStateTitle:{type:String,default:""},isLoading:{type:Boolean,default:!1}},setup(n){const t=n,{i18n:e}=kt.useI18n(),r=h.computed(()=>t.data.data),i=h.computed(()=>{var v;return!!((v=r.value)!=null&&v.length)}),a=h.computed(()=>{var v,x;return(v=t.data.meta)!=null&&v.display&&((x=Object.keys(t.data.meta.display))==null?void 0:x[0])||""}),s=h.computed(()=>a.value?t.data.meta.display[a.value]:{}),o=h.computed(()=>{var v,x;return(x=(v=t.data.meta)==null?void 0:v.metric_names)!=null&&x.length?t.data.meta.metric_names[0]:""}),l=h.computed(()=>o.value?e.t(`chartLabels.${o.value}`)||o.value:""),c=h.computed(()=>{if(!i.value)return"";if(t.data.meta){if(s.value&&!Object.keys(s.value).length)return e.t("topNTable.errors.display");if(!o.value)return e.t("topNTable.errors.metricNames")}else return e.t("topNTable.errors.meta");return""}),u=v=>{const x=v.event;return String(x[a.value])},d=v=>{const x=u(v),p=s.value&&s.value[x];return p?p.name:"-"},f=v=>{const x=u(v),p=s.value&&s.value[x];return p?!!p.deleted:!1},g=v=>{if(!o.value)return"–";const p=v.event[o.value];return p?ai(p,{capital:!0,round:!0}):"–"};return(v,x)=>{const p=h.resolveComponent("KEmptyState"),b=h.resolveComponent("KSkeleton"),m=h.resolveComponent("KCard");return h.openBlock(),h.createBlock(m,{class:"kong-ui-public-top-n-table"},h.createSlots({default:h.withCtx(()=>[c.value?(h.openBlock(),h.createBlock(p,{key:0,"cta-is-hidden":"","data-testid":"top-n-error-state","is-error":""},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),message:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(c.value),1)]),_:1})):n.isLoading?(h.openBlock(),h.createBlock(b,{key:1,"table-columns":2,type:"table"})):i.value?(h.openBlock(),h.createElementBlock("div",rk,[h.createElementVNode("div",ik,[h.createElementVNode("div",ak,[h.createElementVNode("div",sk,h.toDisplayString(h.unref(e).t("topNTable.nameLabel")),1),h.createElementVNode("div",ok,h.toDisplayString(l.value),1)])]),h.createElementVNode("div",lk,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(r.value,(y,w)=>(h.openBlock(),h.createElementBlock("div",{key:`entry-${w}`,class:"table-row","data-testid":`row-${u(y)}`},[h.createElementVNode("div",uk,[h.renderSlot(v.$slots,"name",{record:{id:u(y),name:d(y),deleted:f(y),dimension:a.value}},()=>[h.createTextVNode(h.toDisplayString(d(y)),1)],!0)]),h.createElementVNode("div",dk,"   "+h.toDisplayString(g(y)),1)],8,ck))),128))])])):(h.openBlock(),h.createBlock(p,{key:2,"cta-is-hidden":"","data-testid":"top-n-empty-state",icon:"stateNoData","icon-size":"80"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(n.emptyStateTitle||h.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[n.title?{name:"title",fn:h.withCtx(()=>[h.createElementVNode("div",ek,h.toDisplayString(n.title),1)]),key:"0"}:void 0,n.description?{name:"actions",fn:h.withCtx(()=>[h.createElementVNode("div",nk,h.toDisplayString(n.description),1)]),key:"1"}:void 0]),1024)}}}),[["__scopeId","data-v-12271773"]]),Xl="#e0e4ea",hk={100:["#c8e2fd","#80bfff","#4da6ff","#1a8cff","#0072e5","#0059b2"],200:["#ceedd2","#9edca6","#89d595","#6fcc83","#44c26b","#0bb652","#0ca84a","#169643","#196e33","#1b572a"],300:["#fff4db","#ffe9b8","#ffe2a1","#ffd982","#ffd062","#fdc53b","#f4bb1e","#e8b00b","#d9a30f","#c89407"],400:["#ffead8","#ffd5b1","#ffc899","#ffba81","#ffae6b","#fe9439","#f6871d","#eb7c0c","#da700c","#cc6100"],500:["#ffd5d5","#ffb6b6","#ff9d9d","#ff8484","#ff6a6a","#ff4545","#fb1f1f","#e90b0b","#d40202","#be0202"]},fi=(n,t)=>{let e=1;const r=hk[n],i=new Map;for(const a of t)i.set(a,r[e]),e=e%(r.length-1)+1;return i.set(-1,r[0]),i},ig=new Map([[100,fi("100",[100,101,102,103])],[200,fi("200",[200,201,202,203,204,205,206,207,208,226])],[300,fi("300",[300,301,302,303,304,305,307,308])],[400,fi("400",[400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,421,422,423,424,425,426,428,429,431,451])],[500,fi("500",[500,501,502,503,504,505,506,507,508,510,511])]]),ag=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100,r=ig.get(e);return r===void 0?Xl:r.get(t)??r.get(-1)??Xl},gk=n=>{const t=ag(n);return{solid:t,light:t}};st.AnalyticsChart=VC,st.ChartLegendPosition=Yt,st.ChartMetricDisplay=lr,st.ChartTypes=ne,st.ChartTypesSimple=ra,st.CsvExportButton=rg,st.CsvExportModal=ng,st.DECIMAL_DISPLAY=wf,st.FONT_SIZE_REGULAR=Tf,st.FONT_SIZE_SMALL=_f,st.MAX_LABEL_LENGTH=oa,st.OTHERS_COLOR=V_,st.SimpleChart=tk,st.TopNTable=fk,st.ValidType=Xn,st.accessibleGrey=Df,st.apiRequestStatusCodeColors=Cf,st.codesInSpec=ig,st.darkenColor=ii,st.datavisPalette=Ce,st.errorRateColors=$_,st.formatTime=sa,st.latencyColors=j_,st.lightGrey=Xl,st.lookupColor=q_,st.lookupDatavisColor=ur,st.lookupStatusCodeCategoryColor=gk,st.lookupStatusCodeColor=ag,st.numberFormatter=aa,st.statusCodeBadgeBackgroundColor=H_,st.trafficColors=z_,Object.defineProperty(st,Symbol.toStringTag,{value:"Module"})});