@kong-ui-public/analytics-chart 10.1.1 → 10.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/vitals-chart.umd.js
CHANGED
|
@@ -8,36 +8,36 @@
|
|
|
8
8
|
* https://www.chartjs.org
|
|
9
9
|
* (c) 2025 Chart.js Contributors
|
|
10
10
|
* Released under the MIT License
|
|
11
|
-
*/function Ke(){}const $g=(()=>{let n=0;return()=>n++})();function st(n){return n==null}function kt(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 ht(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function Rt(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function Me(n,t){return Rt(n)?n:t}function rt(n,t){return typeof n>"u"?t:n}const Ug=(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 Dt(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function St(n,t,e,i){let s,r,o;if(kt(n))for(r=n.length,s=0;s<r;s++)t.call(e,n[s],s);else if(ht(n))for(o=Object.keys(n),r=o.length,s=0;s<r;s++)t.call(e,n[o[s]],o[s])}function Gs(n,t){let e,i,s,r;if(!n||!t||n.length!==t.length)return!1;for(e=0,i=n.length;e<i;++e)if(s=n[e],r=t[e],s.datasetIndex!==r.datasetIndex||s.index!==r.index)return!1;return!0}function Ks(n){if(kt(n))return n.map(Ks);if(ht(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let s=0;for(;s<i;++s)t[e[s]]=Ks(n[e[s]]);return t}return n}function hc(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Xg(n,t,e,i){if(!hc(n))return;const s=t[n],r=e[n];ht(s)&&ht(r)?ji(s,r,i):t[n]=Ks(r)}function ji(n,t,e){const i=kt(t)?t:[t],s=i.length;if(!ht(n))return n;e=e||{};const r=e.merger||Xg;let o;for(let a=0;a<s;++a){if(o=i[a],!ht(o))continue;const l=Object.keys(o);for(let c=0,u=l.length;c<u;++c)r(l[c],n,o,e)}return n}function Vi(n,t){return ji(n,t,{merger:qg})}function qg(n,t,e){if(!hc(n))return;const i=t[n],s=e[n];ht(i)&&ht(s)?Vi(i,s):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=Ks(s))}const fc={"":n=>n,x:n=>n.x,y:n=>n.y};function Gg(n){const t=n.split("."),e=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function Kg(n){const t=Gg(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function yn(n,t){return(fc[t]||(fc[t]=Kg(t)))(n)}function To(n){return n.charAt(0).toUpperCase()+n.slice(1)}const ge=n=>typeof n<"u",pe=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 Zg(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const ct=Math.PI,Ot=2*ct,Qg=Ot+ct,Zs=Number.POSITIVE_INFINITY,Co=ct/180,Et=ct/2,De=ct/4,Qs=ct*2/3,bn=Math.log10,He=Math.sign;function $i(n,t,e){return Math.abs(n-t)<e}function pc(n){const t=Math.round(n);n=$i(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(bn(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function Jg(n){const t=[],e=Math.sqrt(n);let i;for(i=1;i<e;i++)n%i===0&&(t.push(i),t.push(n/i));return e===(e|0)&&t.push(e),t.sort((s,r)=>s-r).pop(),t}function tp(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function _n(n){return!tp(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function ep(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function mc(n,t,e){let i,s,r;for(i=0,s=n.length;i<s;i++)r=n[i][e],isNaN(r)||(t.min=Math.min(t.min,r),t.max=Math.max(t.max,r))}function $t(n){return n*(ct/180)}function Js(n){return n*(180/ct)}function yc(n){if(!Rt(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function tr(n,t){const e=t.x-n.x,i=t.y-n.y,s=Math.sqrt(e*e+i*i);let r=Math.atan2(i,e);return r<-.5*ct&&(r+=Ot),{angle:r,distance:s}}function ui(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function np(n,t){return(n-t+Qg)%Ot-ct}function se(n){return(n%Ot+Ot)%Ot}function Ui(n,t,e,i){const s=se(n),r=se(t),o=se(e),a=se(r-s),l=se(o-s),c=se(s-r),u=se(s-o);return s===r||s===o||i&&r===o||a>l&&c<u}function Qt(n,t,e){return Math.max(t,Math.min(e,n))}function ip(n){return Qt(n,-32768,32767)}function Ze(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function Po(n,t,e){e=e||(o=>n[o]<t);let i=n.length-1,s=0,r;for(;i-s>1;)r=s+i>>1,e(r)?s=r:i=r;return{lo:s,hi:i}}const Qe=(n,t,e,i)=>Po(n,e,i?s=>{const r=n[s][t];return r<e||r===e&&n[s+1][t]===e}:s=>n[s][t]<e),sp=(n,t,e)=>Po(n,e,i=>n[i][t]>=e);function rp(n,t,e){let i=0,s=n.length;for(;i<s&&n[i]<t;)i++;for(;s>i&&n[s-1]>e;)s--;return i>0||s<n.length?n.slice(i,s):n}const bc=["push","pop","shift","splice","unshift"];function op(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),bc.forEach(e=>{const i="_onData"+To(e),s=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...r){const o=s.apply(this,r);return n._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...r)}),o}})})}function _c(n,t){const e=n._chartjs;if(!e)return;const i=e.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(bc.forEach(r=>{delete n[r]}),delete n._chartjs)}function xc(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const wc=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function vc(n,t){let e=[],i=!1;return function(...s){e=s,i||(i=!0,wc.call(window,()=>{i=!1,n.apply(t,e)}))}}function ap(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const Oo=n=>n==="start"?"left":n==="end"?"right":"center",re=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,lp=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function Mc(n,t,e){const i=t.length;let s=0,r=i;if(n._sorted){const{iScale:o,vScale:a,_parsed:l}=n,c=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null,u=o.axis,{min:d,max:f,minDefined:g,maxDefined:p}=o.getUserBounds();if(g){if(s=Math.min(Qe(l,u,d).lo,e?i:Qe(t,u,o.getPixelForValue(d)).lo),c){const y=l.slice(0,s+1).reverse().findIndex(x=>!st(x[a.axis]));s-=Math.max(0,y)}s=Qt(s,0,i-1)}if(p){let y=Math.max(Qe(l,o.axis,f,!0).hi+1,e?0:Qe(t,u,o.getPixelForValue(f),!0).hi+1);if(c){const x=l.slice(y-1).findIndex(v=>!st(v[a.axis]));y+=Math.max(0,x)}r=Qt(y,s,i)-s}else r=i-s}return{start:s,count:r}}function kc(n){const{xScale:t,yScale:e,_scaleRanges:i}=n,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=s,!0;const r=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,s),r}const er=n=>n===0||n===1,Dc=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*Ot/e)),Sc=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*Ot/e)+1,Xi={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*Et)+1,easeOutSine:n=>Math.sin(n*Et),easeInOutSine:n=>-.5*(Math.cos(ct*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=>er(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=>er(n)?n:Dc(n,.075,.3),easeOutElastic:n=>er(n)?n:Sc(n,.075,.3),easeInOutElastic(n){return er(n)?n:n<.5?.5*Dc(n*2,.1125,.45):.5+.5*Sc(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-Xi.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?Xi.easeInBounce(n*2)*.5:Xi.easeOutBounce(n*2-1)*.5+.5};function Eo(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Tc(n){return Eo(n)?n:new Yi(n)}function Ao(n){return Eo(n)?n:new Yi(n).saturate(.5).darken(.1).hexString()}const cp=["x","y","borderWidth","radius","tension"],up=["color","borderColor","backgroundColor"];function dp(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:up},numbers:{type:"number",properties:cp}}),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 hp(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Cc=new Map;function fp(n,t){t=t||{};const e=n+JSON.stringify(t);let i=Cc.get(e);return i||(i=new Intl.NumberFormat(n,t),Cc.set(e,i)),i}function qi(n,t,e){return fp(t,e).format(n)}const Pc={values(n){return kt(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const i=this.chart.options.locale;let s,r=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)&&(s="scientific"),r=gp(n,e)}const o=bn(Math.abs(r)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),qi(n,i,l)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(bn(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?Pc.numeric.call(this,n,t,e):""}};function gp(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 nr={formatters:Pc};function pp(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:nr.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 Fn=Object.create(null),Ro=Object.create(null);function Gi(n,t){if(!t)return n;const e=t.split(".");for(let i=0,s=e.length;i<s;++i){const r=e[i];n=n[r]||(n[r]=Object.create(null))}return n}function Io(n,t,e){return typeof t=="string"?ji(Gi(n,t),e):ji(Gi(n,""),t)}class mp{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=i=>i.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=(i,s)=>Ao(s.backgroundColor),this.hoverBorderColor=(i,s)=>Ao(s.borderColor),this.hoverColor=(i,s)=>Ao(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Io(this,t,e)}get(t){return Gi(this,t)}describe(t,e){return Io(Ro,t,e)}override(t,e){return Io(Fn,t,e)}route(t,e,i,s){const r=Gi(this,t),o=Gi(this,i),a="_"+e;Object.defineProperties(r,{[a]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=o[s];return ht(l)?Object.assign({},c,l):rt(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var At=new mp({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[dp,hp,pp]);function yp(n){return!n||st(n.size)||st(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function ir(n,t,e,i,s){let r=t[s];return r||(r=t[s]=n.measureText(s).width,e.push(s)),r>i&&(i=r),i}function bp(n,t,e,i){i=i||{};let s=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},r=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let o=0;const a=e.length;let l,c,u,d,f;for(l=0;l<a;l++)if(d=e[l],d!=null&&!kt(d))o=ir(n,s,r,o,d);else if(kt(d))for(c=0,u=d.length;c<u;c++)f=d[c],f!=null&&!kt(f)&&(o=ir(n,s,r,o,f));n.restore();const g=r.length/2;if(g>e.length){for(l=0;l<g;l++)delete s[r[l]];r.splice(0,g)}return o}function zn(n,t,e){const i=n.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*i)/i+s}function Oc(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function Lo(n,t,e,i){Ec(n,t,e,i,null)}function Ec(n,t,e,i,s){let r,o,a,l,c,u,d,f;const g=t.pointStyle,p=t.rotation,y=t.radius;let x=(p||0)*Co;if(g&&typeof g=="object"&&(r=g.toString(),r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(x),n.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),n.restore();return}if(!(isNaN(y)||y<=0)){switch(n.beginPath(),g){default:s?n.ellipse(e,i,s/2,y,0,0,Ot):n.arc(e,i,y,0,Ot),n.closePath();break;case"triangle":u=s?s/2:y,n.moveTo(e+Math.sin(x)*u,i-Math.cos(x)*y),x+=Qs,n.lineTo(e+Math.sin(x)*u,i-Math.cos(x)*y),x+=Qs,n.lineTo(e+Math.sin(x)*u,i-Math.cos(x)*y),n.closePath();break;case"rectRounded":c=y*.516,l=y-c,o=Math.cos(x+De)*l,d=Math.cos(x+De)*(s?s/2-c:l),a=Math.sin(x+De)*l,f=Math.sin(x+De)*(s?s/2-c:l),n.arc(e-d,i-a,c,x-ct,x-Et),n.arc(e+f,i-o,c,x-Et,x),n.arc(e+d,i+a,c,x,x+Et),n.arc(e-f,i+o,c,x+Et,x+ct),n.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*y,u=s?s/2:l,n.rect(e-u,i-l,2*u,2*l);break}x+=De;case"rectRot":d=Math.cos(x)*(s?s/2:y),o=Math.cos(x)*y,a=Math.sin(x)*y,f=Math.sin(x)*(s?s/2:y),n.moveTo(e-d,i-a),n.lineTo(e+f,i-o),n.lineTo(e+d,i+a),n.lineTo(e-f,i+o),n.closePath();break;case"crossRot":x+=De;case"cross":d=Math.cos(x)*(s?s/2:y),o=Math.cos(x)*y,a=Math.sin(x)*y,f=Math.sin(x)*(s?s/2:y),n.moveTo(e-d,i-a),n.lineTo(e+d,i+a),n.moveTo(e+f,i-o),n.lineTo(e-f,i+o);break;case"star":d=Math.cos(x)*(s?s/2:y),o=Math.cos(x)*y,a=Math.sin(x)*y,f=Math.sin(x)*(s?s/2:y),n.moveTo(e-d,i-a),n.lineTo(e+d,i+a),n.moveTo(e+f,i-o),n.lineTo(e-f,i+o),x+=De,d=Math.cos(x)*(s?s/2:y),o=Math.cos(x)*y,a=Math.sin(x)*y,f=Math.sin(x)*(s?s/2:y),n.moveTo(e-d,i-a),n.lineTo(e+d,i+a),n.moveTo(e+f,i-o),n.lineTo(e-f,i+o);break;case"line":o=s?s/2:Math.cos(x)*y,a=Math.sin(x)*y,n.moveTo(e-o,i-a),n.lineTo(e+o,i+a);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(x)*(s?s/2:y),i+Math.sin(x)*y);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function Je(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 Ki(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function Zi(n){n.restore()}function _p(n,t,e,i,s){if(!t)return n.lineTo(e.x,e.y);if(s==="middle"){const r=(t.x+e.x)/2;n.lineTo(r,t.y),n.lineTo(r,e.y)}else s==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function xp(n,t,e,i){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function wp(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),st(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 vp(n,t,e,i,s){if(s.strikethrough||s.underline){const r=n.measureText(i),o=t-r.actualBoundingBoxLeft,a=t+r.actualBoundingBoxRight,l=e-r.actualBoundingBoxAscent,c=e+r.actualBoundingBoxDescent,u=s.strikethrough?(l+c)/2:c;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(o,u),n.lineTo(a,u),n.stroke()}}function Mp(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function Bn(n,t,e,i,s,r={}){const o=kt(t)?t:[t],a=r.strokeWidth>0&&r.strokeColor!=="";let l,c;for(n.save(),n.font=s.string,wp(n,r),l=0;l<o.length;++l)c=o[l],r.backdrop&&Mp(n,r.backdrop),a&&(r.strokeColor&&(n.strokeStyle=r.strokeColor),st(r.strokeWidth)||(n.lineWidth=r.strokeWidth),n.strokeText(c,e,i,r.maxWidth)),n.fillText(c,e,i,r.maxWidth),vp(n,e,i,c,r),i+=Number(s.lineHeight);n.restore()}function di(n,t){const{x:e,y:i,w:s,h:r,radius:o}=t;n.arc(e+o.topLeft,i+o.topLeft,o.topLeft,1.5*ct,ct,!0),n.lineTo(e,i+r-o.bottomLeft),n.arc(e+o.bottomLeft,i+r-o.bottomLeft,o.bottomLeft,ct,Et,!0),n.lineTo(e+s-o.bottomRight,i+r),n.arc(e+s-o.bottomRight,i+r-o.bottomRight,o.bottomRight,Et,0,!0),n.lineTo(e+s,i+o.topRight),n.arc(e+s-o.topRight,i+o.topRight,o.topRight,0,-Et,!0),n.lineTo(e+o.topLeft,i)}const kp=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Dp=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Sp(n,t){const e=(""+n).match(kp);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 Tp=n=>+n||0;function No(n,t){const e={},i=ht(t),s=i?Object.keys(t):t,r=ht(n)?i?o=>rt(n[o],n[t[o]]):o=>n[o]:()=>n;for(const o of s)e[o]=Tp(r(o));return e}function Ac(n){return No(n,{top:"y",right:"x",bottom:"y",left:"x"})}function xn(n){return No(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Ut(n){const t=Ac(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function It(n,t){n=n||{},t=t||At.font;let e=rt(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=rt(n.style,t.style);i&&!(""+i).match(Dp)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:rt(n.family,t.family),lineHeight:Sp(rt(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:rt(n.weight,t.weight),string:""};return s.string=yp(s),s}function Qi(n,t,e,i){let s,r,o;for(s=0,r=n.length;s<r;++s)if(o=n[s],o!==void 0&&o!==void 0)return o}function Cp(n,t,e){const{min:i,max:s}=n,r=dc(t,(s-i)/2),o=(a,l)=>e&&a===0?0:a+l;return{min:o(i,-Math.abs(r)),max:o(s,r)}}function wn(n,t){return Object.assign(Object.create(n),t)}function Fo(n,t=[""],e,i,s=()=>n[0]){const r=e||n;typeof i>"u"&&(i=Fc("_fallback",n));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:r,_fallback:i,_getTarget:s,override:a=>Fo([a,...n],t,r,i)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete n[0][l],!0},get(a,l){return Ic(a,l,()=>Np(l,t,n,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(a,l){return zc(a).includes(l)},ownKeys(a){return zc(a)},set(a,l,c){const u=a._storage||(a._storage=s());return a[l]=u[l]=c,delete a._keys,!0}})}function hi(n,t,e,i){const s={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Rc(n,i),setContext:r=>hi(n,r,e,i),override:r=>hi(n.override(r),t,e,i)};return new Proxy(s,{deleteProperty(r,o){return delete r[o],delete n[o],!0},get(r,o,a){return Ic(r,o,()=>Op(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(r,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(r,o,a){return n[o]=a,delete r[o],!0}})}function Rc(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=n;return{allKeys:s,scriptable:e,indexable:i,isScriptable:pe(e)?e:()=>e,isIndexable:pe(i)?i:()=>i}}const Pp=(n,t)=>n?n+To(t):t,zo=(n,t)=>ht(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Ic(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];const i=e();return n[t]=i,i}function Op(n,t,e){const{_proxy:i,_context:s,_subProxy:r,_descriptors:o}=n;let a=i[t];return pe(a)&&o.isScriptable(t)&&(a=Ep(t,a,n,e)),kt(a)&&a.length&&(a=Ap(t,a,n,o.isIndexable)),zo(t,a)&&(a=hi(a,s,r&&r[t],o)),a}function Ep(n,t,e,i){const{_proxy:s,_context:r,_subProxy:o,_stack:a}=e;if(a.has(n))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+n);a.add(n);let l=t(r,o||i);return a.delete(n),zo(n,l)&&(l=Bo(s._scopes,s,n,l)),l}function Ap(n,t,e,i){const{_proxy:s,_context:r,_subProxy:o,_descriptors:a}=e;if(typeof r.index<"u"&&i(n))return t[r.index%t.length];if(ht(t[0])){const l=t,c=s._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=Bo(c,s,n,u);t.push(hi(d,r,o&&o[n],a))}}return t}function Lc(n,t,e){return pe(n)?n(t,e):n}const Rp=(n,t)=>n===!0?t:typeof n=="string"?yn(t,n):void 0;function Ip(n,t,e,i,s){for(const r of t){const o=Rp(e,r);if(o){n.add(o);const a=Lc(o._fallback,e,s);if(typeof a<"u"&&a!==e&&a!==i)return a}else if(o===!1&&typeof i<"u"&&e!==i)return null}return!1}function Bo(n,t,e,i){const s=t._rootScopes,r=Lc(t._fallback,e,i),o=[...n,...s],a=new Set;a.add(i);let l=Nc(a,o,e,r||e,i);return l===null||typeof r<"u"&&r!==e&&(l=Nc(a,o,r,l,i),l===null)?!1:Fo(Array.from(a),[""],s,r,()=>Lp(t,e,i))}function Nc(n,t,e,i,s){for(;e;)e=Ip(n,t,e,i,s);return e}function Lp(n,t,e){const i=n._getTarget();t in i||(i[t]={});const s=i[t];return kt(s)&&ht(e)?e:s||{}}function Np(n,t,e,i){let s;for(const r of t)if(s=Fc(Pp(r,n),e),typeof s<"u")return zo(n,s)?Bo(e,i,n,s):s}function Fc(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function zc(n){let t=n._keys;return t||(t=n._keys=Fp(n._scopes)),t}function Fp(n){const t=new Set;for(const e of n)for(const i of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function Bc(n,t,e,i){const{iScale:s}=n,{key:r="r"}=this._parsing,o=new Array(i);let a,l,c,u;for(a=0,l=i;a<l;++a)c=a+e,u=t[c],o[a]={r:s.parse(yn(u,r),c)};return o}const zp=Number.EPSILON||1e-14,fi=(n,t)=>t<n.length&&!n[t].skip&&n[t],Hc=n=>n==="x"?"y":"x";function Bp(n,t,e,i){const s=n.skip?t:n,r=t,o=e.skip?t:e,a=ui(r,s),l=ui(o,r);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=i*c,f=i*u;return{previous:{x:r.x-d*(o.x-s.x),y:r.y-d*(o.y-s.y)},next:{x:r.x+f*(o.x-s.x),y:r.y+f*(o.y-s.y)}}}function Hp(n,t,e){const i=n.length;let s,r,o,a,l,c=fi(n,0);for(let u=0;u<i-1;++u)if(l=c,c=fi(n,u+1),!(!l||!c)){if($i(t[u],0,zp)){e[u]=e[u+1]=0;continue}s=e[u]/t[u],r=e[u+1]/t[u],a=Math.pow(s,2)+Math.pow(r,2),!(a<=9)&&(o=3/Math.sqrt(a),e[u]=s*o*t[u],e[u+1]=r*o*t[u])}}function Wp(n,t,e="x"){const i=Hc(e),s=n.length;let r,o,a,l=fi(n,0);for(let c=0;c<s;++c){if(o=a,a=l,l=fi(n,c+1),!a)continue;const u=a[e],d=a[i];o&&(r=(u-o[e])/3,a[`cp1${e}`]=u-r,a[`cp1${i}`]=d-r*t[c]),l&&(r=(l[e]-u)/3,a[`cp2${e}`]=u+r,a[`cp2${i}`]=d+r*t[c])}}function Yp(n,t="x"){const e=Hc(t),i=n.length,s=Array(i).fill(0),r=Array(i);let o,a,l,c=fi(n,0);for(o=0;o<i;++o)if(a=l,l=c,c=fi(n,o+1),!!l){if(c){const u=c[t]-l[t];s[o]=u!==0?(c[e]-l[e])/u:0}r[o]=a?c?He(s[o-1])!==He(s[o])?0:(s[o-1]+s[o])/2:s[o-1]:s[o]}Hp(n,s,r),Wp(n,r,t)}function sr(n,t,e){return Math.max(Math.min(n,e),t)}function jp(n,t){let e,i,s,r,o,a=Je(n[0],t);for(e=0,i=n.length;e<i;++e)o=r,r=a,a=e<i-1&&Je(n[e+1],t),r&&(s=n[e],o&&(s.cp1x=sr(s.cp1x,t.left,t.right),s.cp1y=sr(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=sr(s.cp2x,t.left,t.right),s.cp2y=sr(s.cp2y,t.top,t.bottom)))}function Vp(n,t,e,i,s){let r,o,a,l;if(t.spanGaps&&(n=n.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Yp(n,s);else{let c=i?n[n.length-1]:n[0];for(r=0,o=n.length;r<o;++r)a=n[r],l=Bp(c,a,n[Math.min(r+1,o-(i?0:1))%o],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&jp(n,e)}function Ho(){return typeof window<"u"&&typeof document<"u"}function Wo(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function rr(n,t,e){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=n,i}const or=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function $p(n,t){return or(n).getPropertyValue(t)}const Up=["top","right","bottom","left"];function Hn(n,t,e){const i={};e=e?"-"+e:"";for(let s=0;s<4;s++){const r=Up[s];i[r]=parseFloat(n[t+"-"+r+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Xp=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function qp(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:s,offsetY:r}=i;let o=!1,a,l;if(Xp(s,r,n.target))a=s,l=r;else{const c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function vn(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,s=or(e),r=s.boxSizing==="border-box",o=Hn(s,"padding"),a=Hn(s,"border","width"),{x:l,y:c,box:u}=qp(n,e),d=o.left+(u&&a.left),f=o.top+(u&&a.top);let{width:g,height:p}=t;return r&&(g-=o.width+a.width,p-=o.height+a.height),{x:Math.round((l-d)/g*e.width/i),y:Math.round((c-f)/p*e.height/i)}}function Gp(n,t,e){let i,s;if(t===void 0||e===void 0){const r=n&&Wo(n);if(!r)t=n.clientWidth,e=n.clientHeight;else{const o=r.getBoundingClientRect(),a=or(r),l=Hn(a,"border","width"),c=Hn(a,"padding");t=o.width-c.width-l.width,e=o.height-c.height-l.height,i=rr(a.maxWidth,r,"clientWidth"),s=rr(a.maxHeight,r,"clientHeight")}}return{width:t,height:e,maxWidth:i||Zs,maxHeight:s||Zs}}const ar=n=>Math.round(n*10)/10;function Kp(n,t,e,i){const s=or(n),r=Hn(s,"margin"),o=rr(s.maxWidth,n,"clientWidth")||Zs,a=rr(s.maxHeight,n,"clientHeight")||Zs,l=Gp(n,t,e);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const f=Hn(s,"border","width"),g=Hn(s,"padding");c-=g.width+f.width,u-=g.height+f.height}return c=Math.max(0,c-r.width),u=Math.max(0,i?c/i:u-r.height),c=ar(Math.min(c,o,l.maxWidth)),u=ar(Math.min(u,a,l.maxHeight)),c&&!u&&(u=ar(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=ar(Math.floor(u*i))),{width:c,height:u}}function Wc(n,t,e){const i=t||1,s=Math.floor(n.height*i),r=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const o=n.canvas;return o.style&&(e||!o.style.height&&!o.style.width)&&(o.style.height=`${n.height}px`,o.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||o.height!==s||o.width!==r?(n.currentDevicePixelRatio=i,o.height=s,o.width=r,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Zp=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};Ho()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n}();function Yc(n,t){const e=$p(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Wn(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function Qp(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:i==="middle"?e<.5?n.y:t.y:i==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function Jp(n,t,e,i){const s={x:n.cp2x,y:n.cp2y},r={x:t.cp1x,y:t.cp1y},o=Wn(n,s,e),a=Wn(s,r,e),l=Wn(r,t,e),c=Wn(o,a,e),u=Wn(a,l,e);return Wn(c,u,e)}const tm=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,i){return e-i},leftForLtr(e,i){return e-i}}},em=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function gi(n,t,e){return n?tm(t,e):em()}function jc(n,t){let e,i;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=i)}function Vc(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function $c(n){return n==="angle"?{between:Ui,compare:np,normalize:se}:{between:Ze,compare:(t,e)=>t-e,normalize:t=>t}}function Uc({start:n,end:t,count:e,loop:i,style:s}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:s}}function nm(n,t,e){const{property:i,start:s,end:r}=e,{between:o,normalize:a}=$c(i),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&&o(a(t[c%l][i]),s,r);++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:i,start:s,end:r}=e,o=t.length,{compare:a,between:l,normalize:c}=$c(i),{start:u,end:d,loop:f,style:g}=nm(n,t,e),p=[];let y=!1,x=null,v,M,D;const S=()=>l(s,D,v)&&a(s,D)!==0,C=()=>a(r,v)===0||l(r,D,v),R=()=>y||S(),O=()=>!y||C();for(let b=u,_=u;b<=d;++b)M=t[b%o],!M.skip&&(v=c(M[i]),v!==D&&(y=l(v,s,r),x===null&&R()&&(x=a(v,s)===0?b:_),x!==null&&O()&&(p.push(Uc({start:x,end:b,loop:f,count:o,style:g})),x=null),_=b,D=v));return x!==null&&p.push(Uc({start:x,end:d,loop:f,count:o,style:g})),p}function qc(n,t){const e=[],i=n.segments;for(let s=0;s<i.length;s++){const r=Xc(i[s],n.points,t);r.length&&e.push(...r)}return e}function im(n,t,e,i){let s=0,r=t-1;if(e&&!i)for(;s<t&&!n[s].skip;)s++;for(;s<t&&n[s].skip;)s++;for(s%=t,e&&(r+=s);r>s&&n[r%t].skip;)r--;return r%=t,{start:s,end:r}}function sm(n,t,e,i){const s=n.length,r=[];let o=t,a=n[t],l;for(l=t+1;l<=e;++l){const c=n[l%s];c.skip||c.stop?a.skip||(i=!1,r.push({start:t%s,end:(l-1)%s,loop:i}),t=o=c.stop?l:null):(o=l,a.skip&&(t=l)),a=c}return o!==null&&r.push({start:t%s,end:o%s,loop:i}),r}function rm(n,t){const e=n.points,i=n.options.spanGaps,s=e.length;if(!s)return[];const r=!!n._loop,{start:o,end:a}=im(e,s,r,i);if(i===!0)return Gc(n,[{start:o,end:a,loop:r}],e,t);const l=a<o?a+s:a,c=!!n._fullLoop&&o===0&&a===s-1;return Gc(n,sm(e,o,l,c),e,t)}function Gc(n,t,e,i){return!i||!i.setContext||!e?t:om(n,t,e,i)}function om(n,t,e,i){const s=n._chart.getContext(),r=Kc(n.options),{_datasetIndex:o,options:{spanGaps:a}}=n,l=e.length,c=[];let u=r,d=t[0].start,f=d;function g(p,y,x,v){const M=a?-1:1;if(p!==y){for(p+=l;e[p%l].skip;)p-=M;for(;e[y%l].skip;)y+=M;p%l!==y%l&&(c.push({start:p%l,end:y%l,loop:x,style:v}),u=v,d=y%l)}}for(const p of t){d=a?d:p.start;let y=e[d%l],x;for(f=d+1;f<=p.end;f++){const v=e[f%l];x=Kc(i.setContext(wn(s,{type:"segment",p0:y,p1:v,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:o}))),am(x,u)&&g(d,f-1,p.loop,u),y=v,u=x}d<f-1&&g(d,f-1,p.loop,u)}return c}function Kc(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=[],i=function(s,r){return Eo(r)?(e.includes(r)||e.push(r),e.indexOf(r)):r};return JSON.stringify(n,i)!==JSON.stringify(t,i)}function lr(n,t,e){return n.options.clip?n[e]:t[e]}function lm(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:lr(e,t,"left"),right:lr(e,t,"right"),top:lr(i,t,"top"),bottom:lr(i,t,"bottom")}:t}function Zc(n,t){const e=t._clip;if(e.disabled)return!1;const i=lm(t,n.chartArea);return{left:e.left===!1?0:i.left-(e.left===!0?0:e.left),right:e.right===!1?n.width:i.right+(e.right===!0?0:e.right),top:e.top===!1?0:i.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?n.height:i.bottom+(e.bottom===!0?0:e.bottom)}}/*!
|
|
11
|
+
*/function Ke(){}const $g=(()=>{let n=0;return()=>n++})();function st(n){return n==null}function kt(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 ht(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function Rt(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function Me(n,t){return Rt(n)?n:t}function rt(n,t){return typeof n>"u"?t:n}const Ug=(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 Dt(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function St(n,t,e,i){let s,r,o;if(kt(n))for(r=n.length,s=0;s<r;s++)t.call(e,n[s],s);else if(ht(n))for(o=Object.keys(n),r=o.length,s=0;s<r;s++)t.call(e,n[o[s]],o[s])}function Gs(n,t){let e,i,s,r;if(!n||!t||n.length!==t.length)return!1;for(e=0,i=n.length;e<i;++e)if(s=n[e],r=t[e],s.datasetIndex!==r.datasetIndex||s.index!==r.index)return!1;return!0}function Ks(n){if(kt(n))return n.map(Ks);if(ht(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let s=0;for(;s<i;++s)t[e[s]]=Ks(n[e[s]]);return t}return n}function hc(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Xg(n,t,e,i){if(!hc(n))return;const s=t[n],r=e[n];ht(s)&&ht(r)?ji(s,r,i):t[n]=Ks(r)}function ji(n,t,e){const i=kt(t)?t:[t],s=i.length;if(!ht(n))return n;e=e||{};const r=e.merger||Xg;let o;for(let a=0;a<s;++a){if(o=i[a],!ht(o))continue;const l=Object.keys(o);for(let c=0,u=l.length;c<u;++c)r(l[c],n,o,e)}return n}function Vi(n,t){return ji(n,t,{merger:qg})}function qg(n,t,e){if(!hc(n))return;const i=t[n],s=e[n];ht(i)&&ht(s)?Vi(i,s):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=Ks(s))}const fc={"":n=>n,x:n=>n.x,y:n=>n.y};function Gg(n){const t=n.split("."),e=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function Kg(n){const t=Gg(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function yn(n,t){return(fc[t]||(fc[t]=Kg(t)))(n)}function To(n){return n.charAt(0).toUpperCase()+n.slice(1)}const ge=n=>typeof n<"u",pe=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 Zg(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const ct=Math.PI,Ot=2*ct,Qg=Ot+ct,Zs=Number.POSITIVE_INFINITY,Co=ct/180,Et=ct/2,De=ct/4,Qs=ct*2/3,bn=Math.log10,He=Math.sign;function $i(n,t,e){return Math.abs(n-t)<e}function pc(n){const t=Math.round(n);n=$i(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(bn(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function Jg(n){const t=[],e=Math.sqrt(n);let i;for(i=1;i<e;i++)n%i===0&&(t.push(i),t.push(n/i));return e===(e|0)&&t.push(e),t.sort((s,r)=>s-r).pop(),t}function tp(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function _n(n){return!tp(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function ep(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function mc(n,t,e){let i,s,r;for(i=0,s=n.length;i<s;i++)r=n[i][e],isNaN(r)||(t.min=Math.min(t.min,r),t.max=Math.max(t.max,r))}function $t(n){return n*(ct/180)}function Js(n){return n*(180/ct)}function yc(n){if(!Rt(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function tr(n,t){const e=t.x-n.x,i=t.y-n.y,s=Math.sqrt(e*e+i*i);let r=Math.atan2(i,e);return r<-.5*ct&&(r+=Ot),{angle:r,distance:s}}function ui(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function np(n,t){return(n-t+Qg)%Ot-ct}function se(n){return(n%Ot+Ot)%Ot}function Ui(n,t,e,i){const s=se(n),r=se(t),o=se(e),a=se(r-s),l=se(o-s),c=se(s-r),u=se(s-o);return s===r||s===o||i&&r===o||a>l&&c<u}function Qt(n,t,e){return Math.max(t,Math.min(e,n))}function ip(n){return Qt(n,-32768,32767)}function Ze(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function Po(n,t,e){e=e||(o=>n[o]<t);let i=n.length-1,s=0,r;for(;i-s>1;)r=s+i>>1,e(r)?s=r:i=r;return{lo:s,hi:i}}const Qe=(n,t,e,i)=>Po(n,e,i?s=>{const r=n[s][t];return r<e||r===e&&n[s+1][t]===e}:s=>n[s][t]<e),sp=(n,t,e)=>Po(n,e,i=>n[i][t]>=e);function rp(n,t,e){let i=0,s=n.length;for(;i<s&&n[i]<t;)i++;for(;s>i&&n[s-1]>e;)s--;return i>0||s<n.length?n.slice(i,s):n}const bc=["push","pop","shift","splice","unshift"];function op(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),bc.forEach(e=>{const i="_onData"+To(e),s=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...r){const o=s.apply(this,r);return n._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...r)}),o}})})}function _c(n,t){const e=n._chartjs;if(!e)return;const i=e.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(bc.forEach(r=>{delete n[r]}),delete n._chartjs)}function xc(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const wc=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function vc(n,t){let e=[],i=!1;return function(...s){e=s,i||(i=!0,wc.call(window,()=>{i=!1,n.apply(t,e)}))}}function ap(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const Oo=n=>n==="start"?"left":n==="end"?"right":"center",re=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,lp=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function Mc(n,t,e){const i=t.length;let s=0,r=i;if(n._sorted){const{iScale:o,vScale:a,_parsed:l}=n,c=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null,u=o.axis,{min:d,max:f,minDefined:g,maxDefined:p}=o.getUserBounds();if(g){if(s=Math.min(Qe(l,u,d).lo,e?i:Qe(t,u,o.getPixelForValue(d)).lo),c){const y=l.slice(0,s+1).reverse().findIndex(x=>!st(x[a.axis]));s-=Math.max(0,y)}s=Qt(s,0,i-1)}if(p){let y=Math.max(Qe(l,o.axis,f,!0).hi+1,e?0:Qe(t,u,o.getPixelForValue(f),!0).hi+1);if(c){const x=l.slice(y-1).findIndex(v=>!st(v[a.axis]));y+=Math.max(0,x)}r=Qt(y,s,i)-s}else r=i-s}return{start:s,count:r}}function kc(n){const{xScale:t,yScale:e,_scaleRanges:i}=n,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=s,!0;const r=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,s),r}const er=n=>n===0||n===1,Dc=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*Ot/e)),Sc=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*Ot/e)+1,Xi={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*Et)+1,easeOutSine:n=>Math.sin(n*Et),easeInOutSine:n=>-.5*(Math.cos(ct*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=>er(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=>er(n)?n:Dc(n,.075,.3),easeOutElastic:n=>er(n)?n:Sc(n,.075,.3),easeInOutElastic(n){return er(n)?n:n<.5?.5*Dc(n*2,.1125,.45):.5+.5*Sc(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-Xi.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?Xi.easeInBounce(n*2)*.5:Xi.easeOutBounce(n*2-1)*.5+.5};function Eo(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Tc(n){return Eo(n)?n:new Yi(n)}function Ao(n){return Eo(n)?n:new Yi(n).saturate(.5).darken(.1).hexString()}const cp=["x","y","borderWidth","radius","tension"],up=["color","borderColor","backgroundColor"];function dp(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:up},numbers:{type:"number",properties:cp}}),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 hp(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Cc=new Map;function fp(n,t){t=t||{};const e=n+JSON.stringify(t);let i=Cc.get(e);return i||(i=new Intl.NumberFormat(n,t),Cc.set(e,i)),i}function qi(n,t,e){return fp(t,e).format(n)}const Pc={values(n){return kt(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const i=this.chart.options.locale;let s,r=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)&&(s="scientific"),r=gp(n,e)}const o=bn(Math.abs(r)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),qi(n,i,l)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(bn(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?Pc.numeric.call(this,n,t,e):""}};function gp(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 nr={formatters:Pc};function pp(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:nr.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 Fn=Object.create(null),Ro=Object.create(null);function Gi(n,t){if(!t)return n;const e=t.split(".");for(let i=0,s=e.length;i<s;++i){const r=e[i];n=n[r]||(n[r]=Object.create(null))}return n}function Io(n,t,e){return typeof t=="string"?ji(Gi(n,t),e):ji(Gi(n,""),t)}class mp{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=i=>i.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=(i,s)=>Ao(s.backgroundColor),this.hoverBorderColor=(i,s)=>Ao(s.borderColor),this.hoverColor=(i,s)=>Ao(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Io(this,t,e)}get(t){return Gi(this,t)}describe(t,e){return Io(Ro,t,e)}override(t,e){return Io(Fn,t,e)}route(t,e,i,s){const r=Gi(this,t),o=Gi(this,i),a="_"+e;Object.defineProperties(r,{[a]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=o[s];return ht(l)?Object.assign({},c,l):rt(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var At=new mp({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[dp,hp,pp]);function yp(n){return!n||st(n.size)||st(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function ir(n,t,e,i,s){let r=t[s];return r||(r=t[s]=n.measureText(s).width,e.push(s)),r>i&&(i=r),i}function bp(n,t,e,i){i=i||{};let s=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},r=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let o=0;const a=e.length;let l,c,u,d,f;for(l=0;l<a;l++)if(d=e[l],d!=null&&!kt(d))o=ir(n,s,r,o,d);else if(kt(d))for(c=0,u=d.length;c<u;c++)f=d[c],f!=null&&!kt(f)&&(o=ir(n,s,r,o,f));n.restore();const g=r.length/2;if(g>e.length){for(l=0;l<g;l++)delete s[r[l]];r.splice(0,g)}return o}function zn(n,t,e){const i=n.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*i)/i+s}function Oc(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function Lo(n,t,e,i){Ec(n,t,e,i,null)}function Ec(n,t,e,i,s){let r,o,a,l,c,u,d,f;const g=t.pointStyle,p=t.rotation,y=t.radius;let x=(p||0)*Co;if(g&&typeof g=="object"&&(r=g.toString(),r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(x),n.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),n.restore();return}if(!(isNaN(y)||y<=0)){switch(n.beginPath(),g){default:s?n.ellipse(e,i,s/2,y,0,0,Ot):n.arc(e,i,y,0,Ot),n.closePath();break;case"triangle":u=s?s/2:y,n.moveTo(e+Math.sin(x)*u,i-Math.cos(x)*y),x+=Qs,n.lineTo(e+Math.sin(x)*u,i-Math.cos(x)*y),x+=Qs,n.lineTo(e+Math.sin(x)*u,i-Math.cos(x)*y),n.closePath();break;case"rectRounded":c=y*.516,l=y-c,o=Math.cos(x+De)*l,d=Math.cos(x+De)*(s?s/2-c:l),a=Math.sin(x+De)*l,f=Math.sin(x+De)*(s?s/2-c:l),n.arc(e-d,i-a,c,x-ct,x-Et),n.arc(e+f,i-o,c,x-Et,x),n.arc(e+d,i+a,c,x,x+Et),n.arc(e-f,i+o,c,x+Et,x+ct),n.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*y,u=s?s/2:l,n.rect(e-u,i-l,2*u,2*l);break}x+=De;case"rectRot":d=Math.cos(x)*(s?s/2:y),o=Math.cos(x)*y,a=Math.sin(x)*y,f=Math.sin(x)*(s?s/2:y),n.moveTo(e-d,i-a),n.lineTo(e+f,i-o),n.lineTo(e+d,i+a),n.lineTo(e-f,i+o),n.closePath();break;case"crossRot":x+=De;case"cross":d=Math.cos(x)*(s?s/2:y),o=Math.cos(x)*y,a=Math.sin(x)*y,f=Math.sin(x)*(s?s/2:y),n.moveTo(e-d,i-a),n.lineTo(e+d,i+a),n.moveTo(e+f,i-o),n.lineTo(e-f,i+o);break;case"star":d=Math.cos(x)*(s?s/2:y),o=Math.cos(x)*y,a=Math.sin(x)*y,f=Math.sin(x)*(s?s/2:y),n.moveTo(e-d,i-a),n.lineTo(e+d,i+a),n.moveTo(e+f,i-o),n.lineTo(e-f,i+o),x+=De,d=Math.cos(x)*(s?s/2:y),o=Math.cos(x)*y,a=Math.sin(x)*y,f=Math.sin(x)*(s?s/2:y),n.moveTo(e-d,i-a),n.lineTo(e+d,i+a),n.moveTo(e+f,i-o),n.lineTo(e-f,i+o);break;case"line":o=s?s/2:Math.cos(x)*y,a=Math.sin(x)*y,n.moveTo(e-o,i-a),n.lineTo(e+o,i+a);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(x)*(s?s/2:y),i+Math.sin(x)*y);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function Je(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 Ki(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function Zi(n){n.restore()}function _p(n,t,e,i,s){if(!t)return n.lineTo(e.x,e.y);if(s==="middle"){const r=(t.x+e.x)/2;n.lineTo(r,t.y),n.lineTo(r,e.y)}else s==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function xp(n,t,e,i){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function wp(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),st(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 vp(n,t,e,i,s){if(s.strikethrough||s.underline){const r=n.measureText(i),o=t-r.actualBoundingBoxLeft,a=t+r.actualBoundingBoxRight,l=e-r.actualBoundingBoxAscent,c=e+r.actualBoundingBoxDescent,u=s.strikethrough?(l+c)/2:c;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(o,u),n.lineTo(a,u),n.stroke()}}function Mp(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function Bn(n,t,e,i,s,r={}){const o=kt(t)?t:[t],a=r.strokeWidth>0&&r.strokeColor!=="";let l,c;for(n.save(),n.font=s.string,wp(n,r),l=0;l<o.length;++l)c=o[l],r.backdrop&&Mp(n,r.backdrop),a&&(r.strokeColor&&(n.strokeStyle=r.strokeColor),st(r.strokeWidth)||(n.lineWidth=r.strokeWidth),n.strokeText(c,e,i,r.maxWidth)),n.fillText(c,e,i,r.maxWidth),vp(n,e,i,c,r),i+=Number(s.lineHeight);n.restore()}function di(n,t){const{x:e,y:i,w:s,h:r,radius:o}=t;n.arc(e+o.topLeft,i+o.topLeft,o.topLeft,1.5*ct,ct,!0),n.lineTo(e,i+r-o.bottomLeft),n.arc(e+o.bottomLeft,i+r-o.bottomLeft,o.bottomLeft,ct,Et,!0),n.lineTo(e+s-o.bottomRight,i+r),n.arc(e+s-o.bottomRight,i+r-o.bottomRight,o.bottomRight,Et,0,!0),n.lineTo(e+s,i+o.topRight),n.arc(e+s-o.topRight,i+o.topRight,o.topRight,0,-Et,!0),n.lineTo(e+o.topLeft,i)}const kp=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Dp=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Sp(n,t){const e=(""+n).match(kp);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 Tp=n=>+n||0;function No(n,t){const e={},i=ht(t),s=i?Object.keys(t):t,r=ht(n)?i?o=>rt(n[o],n[t[o]]):o=>n[o]:()=>n;for(const o of s)e[o]=Tp(r(o));return e}function Ac(n){return No(n,{top:"y",right:"x",bottom:"y",left:"x"})}function xn(n){return No(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Ut(n){const t=Ac(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function It(n,t){n=n||{},t=t||At.font;let e=rt(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=rt(n.style,t.style);i&&!(""+i).match(Dp)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:rt(n.family,t.family),lineHeight:Sp(rt(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:rt(n.weight,t.weight),string:""};return s.string=yp(s),s}function Qi(n,t,e,i){let s,r,o;for(s=0,r=n.length;s<r;++s)if(o=n[s],o!==void 0&&o!==void 0)return o}function Cp(n,t,e){const{min:i,max:s}=n,r=dc(t,(s-i)/2),o=(a,l)=>e&&a===0?0:a+l;return{min:o(i,-Math.abs(r)),max:o(s,r)}}function wn(n,t){return Object.assign(Object.create(n),t)}function Fo(n,t=[""],e,i,s=()=>n[0]){const r=e||n;typeof i>"u"&&(i=Fc("_fallback",n));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:r,_fallback:i,_getTarget:s,override:a=>Fo([a,...n],t,r,i)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete n[0][l],!0},get(a,l){return Ic(a,l,()=>Np(l,t,n,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(a,l){return zc(a).includes(l)},ownKeys(a){return zc(a)},set(a,l,c){const u=a._storage||(a._storage=s());return a[l]=u[l]=c,delete a._keys,!0}})}function hi(n,t,e,i){const s={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Rc(n,i),setContext:r=>hi(n,r,e,i),override:r=>hi(n.override(r),t,e,i)};return new Proxy(s,{deleteProperty(r,o){return delete r[o],delete n[o],!0},get(r,o,a){return Ic(r,o,()=>Op(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(r,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(r,o,a){return n[o]=a,delete r[o],!0}})}function Rc(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=n;return{allKeys:s,scriptable:e,indexable:i,isScriptable:pe(e)?e:()=>e,isIndexable:pe(i)?i:()=>i}}const Pp=(n,t)=>n?n+To(t):t,zo=(n,t)=>ht(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Ic(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];const i=e();return n[t]=i,i}function Op(n,t,e){const{_proxy:i,_context:s,_subProxy:r,_descriptors:o}=n;let a=i[t];return pe(a)&&o.isScriptable(t)&&(a=Ep(t,a,n,e)),kt(a)&&a.length&&(a=Ap(t,a,n,o.isIndexable)),zo(t,a)&&(a=hi(a,s,r&&r[t],o)),a}function Ep(n,t,e,i){const{_proxy:s,_context:r,_subProxy:o,_stack:a}=e;if(a.has(n))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+n);a.add(n);let l=t(r,o||i);return a.delete(n),zo(n,l)&&(l=Bo(s._scopes,s,n,l)),l}function Ap(n,t,e,i){const{_proxy:s,_context:r,_subProxy:o,_descriptors:a}=e;if(typeof r.index<"u"&&i(n))return t[r.index%t.length];if(ht(t[0])){const l=t,c=s._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=Bo(c,s,n,u);t.push(hi(d,r,o&&o[n],a))}}return t}function Lc(n,t,e){return pe(n)?n(t,e):n}const Rp=(n,t)=>n===!0?t:typeof n=="string"?yn(t,n):void 0;function Ip(n,t,e,i,s){for(const r of t){const o=Rp(e,r);if(o){n.add(o);const a=Lc(o._fallback,e,s);if(typeof a<"u"&&a!==e&&a!==i)return a}else if(o===!1&&typeof i<"u"&&e!==i)return null}return!1}function Bo(n,t,e,i){const s=t._rootScopes,r=Lc(t._fallback,e,i),o=[...n,...s],a=new Set;a.add(i);let l=Nc(a,o,e,r||e,i);return l===null||typeof r<"u"&&r!==e&&(l=Nc(a,o,r,l,i),l===null)?!1:Fo(Array.from(a),[""],s,r,()=>Lp(t,e,i))}function Nc(n,t,e,i,s){for(;e;)e=Ip(n,t,e,i,s);return e}function Lp(n,t,e){const i=n._getTarget();t in i||(i[t]={});const s=i[t];return kt(s)&&ht(e)?e:s||{}}function Np(n,t,e,i){let s;for(const r of t)if(s=Fc(Pp(r,n),e),typeof s<"u")return zo(n,s)?Bo(e,i,n,s):s}function Fc(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function zc(n){let t=n._keys;return t||(t=n._keys=Fp(n._scopes)),t}function Fp(n){const t=new Set;for(const e of n)for(const i of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function Bc(n,t,e,i){const{iScale:s}=n,{key:r="r"}=this._parsing,o=new Array(i);let a,l,c,u;for(a=0,l=i;a<l;++a)c=a+e,u=t[c],o[a]={r:s.parse(yn(u,r),c)};return o}const zp=Number.EPSILON||1e-14,fi=(n,t)=>t<n.length&&!n[t].skip&&n[t],Hc=n=>n==="x"?"y":"x";function Bp(n,t,e,i){const s=n.skip?t:n,r=t,o=e.skip?t:e,a=ui(r,s),l=ui(o,r);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=i*c,f=i*u;return{previous:{x:r.x-d*(o.x-s.x),y:r.y-d*(o.y-s.y)},next:{x:r.x+f*(o.x-s.x),y:r.y+f*(o.y-s.y)}}}function Hp(n,t,e){const i=n.length;let s,r,o,a,l,c=fi(n,0);for(let u=0;u<i-1;++u)if(l=c,c=fi(n,u+1),!(!l||!c)){if($i(t[u],0,zp)){e[u]=e[u+1]=0;continue}s=e[u]/t[u],r=e[u+1]/t[u],a=Math.pow(s,2)+Math.pow(r,2),!(a<=9)&&(o=3/Math.sqrt(a),e[u]=s*o*t[u],e[u+1]=r*o*t[u])}}function Wp(n,t,e="x"){const i=Hc(e),s=n.length;let r,o,a,l=fi(n,0);for(let c=0;c<s;++c){if(o=a,a=l,l=fi(n,c+1),!a)continue;const u=a[e],d=a[i];o&&(r=(u-o[e])/3,a[`cp1${e}`]=u-r,a[`cp1${i}`]=d-r*t[c]),l&&(r=(l[e]-u)/3,a[`cp2${e}`]=u+r,a[`cp2${i}`]=d+r*t[c])}}function Yp(n,t="x"){const e=Hc(t),i=n.length,s=Array(i).fill(0),r=Array(i);let o,a,l,c=fi(n,0);for(o=0;o<i;++o)if(a=l,l=c,c=fi(n,o+1),!!l){if(c){const u=c[t]-l[t];s[o]=u!==0?(c[e]-l[e])/u:0}r[o]=a?c?He(s[o-1])!==He(s[o])?0:(s[o-1]+s[o])/2:s[o-1]:s[o]}Hp(n,s,r),Wp(n,r,t)}function sr(n,t,e){return Math.max(Math.min(n,e),t)}function jp(n,t){let e,i,s,r,o,a=Je(n[0],t);for(e=0,i=n.length;e<i;++e)o=r,r=a,a=e<i-1&&Je(n[e+1],t),r&&(s=n[e],o&&(s.cp1x=sr(s.cp1x,t.left,t.right),s.cp1y=sr(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=sr(s.cp2x,t.left,t.right),s.cp2y=sr(s.cp2y,t.top,t.bottom)))}function Vp(n,t,e,i,s){let r,o,a,l;if(t.spanGaps&&(n=n.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Yp(n,s);else{let c=i?n[n.length-1]:n[0];for(r=0,o=n.length;r<o;++r)a=n[r],l=Bp(c,a,n[Math.min(r+1,o-(i?0:1))%o],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&jp(n,e)}function Ho(){return typeof window<"u"&&typeof document<"u"}function Wo(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function rr(n,t,e){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=n,i}const or=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function $p(n,t){return or(n).getPropertyValue(t)}const Up=["top","right","bottom","left"];function Hn(n,t,e){const i={};e=e?"-"+e:"";for(let s=0;s<4;s++){const r=Up[s];i[r]=parseFloat(n[t+"-"+r+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Xp=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function qp(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:s,offsetY:r}=i;let o=!1,a,l;if(Xp(s,r,n.target))a=s,l=r;else{const c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function vn(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,s=or(e),r=s.boxSizing==="border-box",o=Hn(s,"padding"),a=Hn(s,"border","width"),{x:l,y:c,box:u}=qp(n,e),d=o.left+(u&&a.left),f=o.top+(u&&a.top);let{width:g,height:p}=t;return r&&(g-=o.width+a.width,p-=o.height+a.height),{x:Math.round((l-d)/g*e.width/i),y:Math.round((c-f)/p*e.height/i)}}function Gp(n,t,e){let i,s;if(t===void 0||e===void 0){const r=n&&Wo(n);if(!r)t=n.clientWidth,e=n.clientHeight;else{const o=r.getBoundingClientRect(),a=or(r),l=Hn(a,"border","width"),c=Hn(a,"padding");t=o.width-c.width-l.width,e=o.height-c.height-l.height,i=rr(a.maxWidth,r,"clientWidth"),s=rr(a.maxHeight,r,"clientHeight")}}return{width:t,height:e,maxWidth:i||Zs,maxHeight:s||Zs}}const ar=n=>Math.round(n*10)/10;function Kp(n,t,e,i){const s=or(n),r=Hn(s,"margin"),o=rr(s.maxWidth,n,"clientWidth")||Zs,a=rr(s.maxHeight,n,"clientHeight")||Zs,l=Gp(n,t,e);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const f=Hn(s,"border","width"),g=Hn(s,"padding");c-=g.width+f.width,u-=g.height+f.height}return c=Math.max(0,c-r.width),u=Math.max(0,i?c/i:u-r.height),c=ar(Math.min(c,o,l.maxWidth)),u=ar(Math.min(u,a,l.maxHeight)),c&&!u&&(u=ar(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=ar(Math.floor(u*i))),{width:c,height:u}}function Wc(n,t,e){const i=t||1,s=Math.floor(n.height*i),r=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const o=n.canvas;return o.style&&(e||!o.style.height&&!o.style.width)&&(o.style.height=`${n.height}px`,o.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||o.height!==s||o.width!==r?(n.currentDevicePixelRatio=i,o.height=s,o.width=r,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Zp=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};Ho()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n}();function Yc(n,t){const e=$p(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Wn(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function Qp(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:i==="middle"?e<.5?n.y:t.y:i==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function Jp(n,t,e,i){const s={x:n.cp2x,y:n.cp2y},r={x:t.cp1x,y:t.cp1y},o=Wn(n,s,e),a=Wn(s,r,e),l=Wn(r,t,e),c=Wn(o,a,e),u=Wn(a,l,e);return Wn(c,u,e)}const tm=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,i){return e-i},leftForLtr(e,i){return e-i}}},em=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function gi(n,t,e){return n?tm(t,e):em()}function jc(n,t){let e,i;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=i)}function Vc(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function $c(n){return n==="angle"?{between:Ui,compare:np,normalize:se}:{between:Ze,compare:(t,e)=>t-e,normalize:t=>t}}function Uc({start:n,end:t,count:e,loop:i,style:s}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:s}}function nm(n,t,e){const{property:i,start:s,end:r}=e,{between:o,normalize:a}=$c(i),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&&o(a(t[c%l][i]),s,r);++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:i,start:s,end:r}=e,o=t.length,{compare:a,between:l,normalize:c}=$c(i),{start:u,end:d,loop:f,style:g}=nm(n,t,e),p=[];let y=!1,x=null,v,M,D;const S=()=>l(s,D,v)&&a(s,D)!==0,P=()=>a(r,v)===0||l(r,D,v),R=()=>y||S(),O=()=>!y||P();for(let b=u,_=u;b<=d;++b)M=t[b%o],!M.skip&&(v=c(M[i]),v!==D&&(y=l(v,s,r),x===null&&R()&&(x=a(v,s)===0?b:_),x!==null&&O()&&(p.push(Uc({start:x,end:b,loop:f,count:o,style:g})),x=null),_=b,D=v));return x!==null&&p.push(Uc({start:x,end:d,loop:f,count:o,style:g})),p}function qc(n,t){const e=[],i=n.segments;for(let s=0;s<i.length;s++){const r=Xc(i[s],n.points,t);r.length&&e.push(...r)}return e}function im(n,t,e,i){let s=0,r=t-1;if(e&&!i)for(;s<t&&!n[s].skip;)s++;for(;s<t&&n[s].skip;)s++;for(s%=t,e&&(r+=s);r>s&&n[r%t].skip;)r--;return r%=t,{start:s,end:r}}function sm(n,t,e,i){const s=n.length,r=[];let o=t,a=n[t],l;for(l=t+1;l<=e;++l){const c=n[l%s];c.skip||c.stop?a.skip||(i=!1,r.push({start:t%s,end:(l-1)%s,loop:i}),t=o=c.stop?l:null):(o=l,a.skip&&(t=l)),a=c}return o!==null&&r.push({start:t%s,end:o%s,loop:i}),r}function rm(n,t){const e=n.points,i=n.options.spanGaps,s=e.length;if(!s)return[];const r=!!n._loop,{start:o,end:a}=im(e,s,r,i);if(i===!0)return Gc(n,[{start:o,end:a,loop:r}],e,t);const l=a<o?a+s:a,c=!!n._fullLoop&&o===0&&a===s-1;return Gc(n,sm(e,o,l,c),e,t)}function Gc(n,t,e,i){return!i||!i.setContext||!e?t:om(n,t,e,i)}function om(n,t,e,i){const s=n._chart.getContext(),r=Kc(n.options),{_datasetIndex:o,options:{spanGaps:a}}=n,l=e.length,c=[];let u=r,d=t[0].start,f=d;function g(p,y,x,v){const M=a?-1:1;if(p!==y){for(p+=l;e[p%l].skip;)p-=M;for(;e[y%l].skip;)y+=M;p%l!==y%l&&(c.push({start:p%l,end:y%l,loop:x,style:v}),u=v,d=y%l)}}for(const p of t){d=a?d:p.start;let y=e[d%l],x;for(f=d+1;f<=p.end;f++){const v=e[f%l];x=Kc(i.setContext(wn(s,{type:"segment",p0:y,p1:v,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:o}))),am(x,u)&&g(d,f-1,p.loop,u),y=v,u=x}d<f-1&&g(d,f-1,p.loop,u)}return c}function Kc(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=[],i=function(s,r){return Eo(r)?(e.includes(r)||e.push(r),e.indexOf(r)):r};return JSON.stringify(n,i)!==JSON.stringify(t,i)}function lr(n,t,e){return n.options.clip?n[e]:t[e]}function lm(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:lr(e,t,"left"),right:lr(e,t,"right"),top:lr(i,t,"top"),bottom:lr(i,t,"bottom")}:t}function Zc(n,t){const e=t._clip;if(e.disabled)return!1;const i=lm(t,n.chartArea);return{left:e.left===!1?0:i.left-(e.left===!0?0:e.left),right:e.right===!1?n.width:i.right+(e.right===!0?0:e.right),top:e.top===!1?0:i.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?n.height:i.bottom+(e.bottom===!0?0:e.bottom)}}/*!
|
|
12
12
|
* Chart.js v4.5.0
|
|
13
13
|
* https://www.chartjs.org
|
|
14
14
|
* (c) 2025 Chart.js Contributors
|
|
15
15
|
* Released under the MIT License
|
|
16
|
-
*/class cm{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const r=e.listeners[s],o=e.duration;r.forEach(a=>a({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=wc.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const r=i.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),r.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=r.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}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((i,s)=>Math.max(i,s._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 i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var tn=new cm;const Qc="transparent",um={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=Tc(n||Qc),s=i.valid&&Tc(t||Qc);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class dm{constructor(t,e,i,s){const r=e[i];s=Qi([t.to,s,r,t.from]);const o=Qi([t.from,r,s]);this._active=!0,this._fn=t.fn||um[t.type||typeof o],this._easing=Xi[t.easing]||Xi.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=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Qi([t.to,e,s,t.from]),this._from=Qi([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||e<i),!this._active){this._target[s]=a,this._notify(!0);return}if(e<0){this._target[s]=r;return}l=e/i%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][e]()}}class Yo{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!ht(t))return;const e=Object.keys(At.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const r=t[s];if(!ht(r))return;const o={};for(const a of e)o[a]=r[a];(kt(r.properties)&&r.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,o)})})}_animateOptions(t,e){const i=e.options,s=fm(t,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&hm(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,e){const i=this._properties,s=[],r=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const u=e[c];let d=r[c];const f=i.get(c);if(d)if(f&&d.active()){d.update(f,u,a);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}r[c]=d=new dm(f,t,c,u),s.push(d)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return tn.add(this._chart,i),!0}}function hm(n,t){const e=[],i=Object.keys(t);for(let s=0;s<i.length;s++){const r=n[i[s]];r&&r.active()&&e.push(r.wait())}return Promise.all(e)}function fm(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||{},i=e.reverse,s=e.min===void 0?t:0,r=e.max===void 0?t:0;return{start:i?r:s,end:i?s:r}}function gm(n,t,e){if(e===!1)return!1;const i=Jc(n,e),s=Jc(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function pm(n){let t,e,i,s;return ht(n)?(t=n.top,e=n.right,i=n.bottom,s=n.left):t=e=i=s=n,{top:t,right:e,bottom:i,left:s,disabled:n===!1}}function tu(n,t){const e=[],i=n._getSortedDatasetMetas(t);let s,r;for(s=0,r=i.length;s<r;++s)e.push(i[s].index);return e}function eu(n,t,e,i={}){const s=n.keys,r=i.mode==="single";let o,a,l,c;if(t===null)return;let u=!1;for(o=0,a=s.length;o<a;++o){if(l=+s[o],l===e){if(u=!0,i.all)continue;break}c=n.values[l],Rt(c)&&(r||t===0||He(t)===He(c))&&(t+=c)}return!u&&!i.all?0:t}function mm(n,t){const{iScale:e,vScale:i}=t,s=e.axis==="x"?"x":"y",r=i.axis==="x"?"x":"y",o=Object.keys(n),a=new Array(o.length);let l,c,u;for(l=0,c=o.length;l<c;++l)u=o[l],a[l]={[s]:u,[r]:n[u]};return a}function jo(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function ym(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function bm(n){const{min:t,max:e,minDefined:i,maxDefined:s}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function _m(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function nu(n,t,e,i){for(const s of t.getMatchingVisibleMetas(i).reverse()){const r=n[s.index];if(e&&r>0||!e&&r<0)return s.index}return null}function iu(n,t){const{chart:e,_cachedMeta:i}=n,s=e._stacks||(e._stacks={}),{iScale:r,vScale:o,index:a}=i,l=r.axis,c=o.axis,u=ym(r,o,i),d=t.length;let f;for(let g=0;g<d;++g){const p=t[g],{[l]:y,[c]:x}=p,v=p._stacks||(p._stacks={});f=v[c]=_m(s,u,y),f[a]=x,f._top=nu(f,o,!0,i.type),f._bottom=nu(f,o,!1,i.type);const M=f._visualValues||(f._visualValues={});M[a]=x}}function Vo(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function xm(n,t){return wn(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function wm(n,t,e){return wn(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Ji(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const s of t){const r=s._stacks;if(!r||r[i]===void 0||r[i][e]===void 0)return;delete r[i][e],r[i]._visualValues!==void 0&&r[i]._visualValues[e]!==void 0&&delete r[i]._visualValues[e]}}}const $o=n=>n==="reset"||n==="none",su=(n,t)=>t?n:Object.assign({},n),vm=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:tu(e,!0),values:null};class Ie{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=jo(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&&Ji(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(d,f,g,p)=>d==="x"?f:d==="r"?p:g,r=e.xAxisID=rt(i.xAxisID,Vo(t,"x")),o=e.yAxisID=rt(i.yAxisID,Vo(t,"y")),a=e.rAxisID=rt(i.rAxisID,Vo(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,r,o,a),u=e.vAxisID=s(l,o,r,a);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),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&&_c(this._data,this),t._stacked&&Ji(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(ht(e)){const s=this._cachedMeta;this._data=mm(e,s)}else if(i!==e){if(i){_c(i,this);const s=this._cachedMeta;Ji(s),s._parsed=[]}e&&Object.isExtensible(e)&&op(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,i=this.getDataset();let s=!1;this._dataCheck();const r=e._stacked;e._stacked=jo(e.vScale,e),e.stack!==i.stack&&(s=!0,Ji(e),e.stack=i.stack),this._resyncElements(t),(s||r!==e._stacked)&&(iu(this,e._parsed),e._stacked=jo(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:r,_stacked:o}=i,a=r.axis;let l=t===0&&e===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,d,f;if(this._parsing===!1)i._parsed=s,i._sorted=!0,f=s;else{kt(s[t])?f=this.parseArrayData(i,s,t,e):ht(s[t])?f=this.parseObjectData(i,s,t,e):f=this.parsePrimitiveData(i,s,t,e);const g=()=>d[a]===null||c&&d[a]<c[a];for(u=0;u<e;++u)i._parsed[u+t]=d=f[u],l&&(g()&&(l=!1),c=d);i._sorted=l}o&&iu(this,f)}parsePrimitiveData(t,e,i,s){const{iScale:r,vScale:o}=t,a=r.axis,l=o.axis,c=r.getLabels(),u=r===o,d=new Array(s);let f,g,p;for(f=0,g=s;f<g;++f)p=f+i,d[f]={[a]:u||r.parse(c[p],p),[l]:o.parse(e[p],p)};return d}parseArrayData(t,e,i,s){const{xScale:r,yScale:o}=t,a=new Array(s);let l,c,u,d;for(l=0,c=s;l<c;++l)u=l+i,d=e[u],a[l]={x:r.parse(d[0],u),y:o.parse(d[1],u)};return a}parseObjectData(t,e,i,s){const{xScale:r,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let u,d,f,g;for(u=0,d=s;u<d;++u)f=u+i,g=e[f],c[u]={x:r.parse(yn(g,a),f),y:o.parse(yn(g,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,r=this._cachedMeta,o=e[t.axis],a={keys:tu(s,!0),values:e._stacks[t.axis]._visualValues};return eu(a,o,r.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const r=i[e.axis];let o=r===null?NaN:r;const a=s&&i._stacks[e.axis];s&&a&&(s.values=a,o=eu(s,r,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,r=i._sorted&&t===i.iScale,o=s.length,a=this._getOtherScale(t),l=vm(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=bm(a);let f,g;function p(){g=s[f];const y=g[a.axis];return!Rt(g[t.axis])||u>y||d<y}for(f=0;f<o&&!(!p()&&(this.updateRangeFromParsed(c,t,g,l),r));++f);if(r){for(f=o-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(c,t,g,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,r,o;for(s=0,r=e.length;s<r;++s)o=e[s][t.axis],Rt(o)&&i.push(o);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,r=this.getParsed(t);return{label:i?""+i.getLabelForValue(r[i.axis]):"",value:s?""+s.getLabelForValue(r[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=pm(rt(this.options.clip,gm(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],r=e.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(t,r,a,l),u=a;u<a+l;++u){const d=s[u];d.hidden||(d.active&&c?o.push(d):d.draw(t,r))}for(u=0;u<o.length;++u)o[u].draw(t,r)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let r;if(t>=0&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];r=o.$context||(o.$context=wm(this.getContext(),t,o)),r.parsed=this.getParsed(t),r.raw=s.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=xm(this.chart.getContext(),this.index)),r.dataset=s,r.index=r.datasetIndex=this.index;return r.active=!!e,r.mode=i,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s=e==="active",r=this._cachedDataOpts,o=t+"-"+e,a=r[o],l=this.enableOptionSharing&&ge(i);if(a)return su(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=s?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),g=Object.keys(At.elements[t]),p=()=>this.getContext(i,s,e),y=c.resolveNamedOptions(f,g,p,d);return y.$shared&&(y.$shared=l,r[o]=Object.freeze(su(y,l))),y}_resolveAnimations(t,e,i){const s=this.chart,r=this._cachedDataOpts,o=`animation-${e}`,a=r[o];if(a)return a;let l;if(s.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,i,e))}const c=new Yo(s,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||$o(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,r=this.getSharedOptions(i),o=this.includeOptions(e,r)||r!==s;return this.updateSharedOptions(r,e,i),{sharedOptions:r,includeOptions:o}}updateElement(t,e,i,s){$o(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!$o(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const r=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"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,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=i.length,r=e.length,o=Math.min(r,s);o&&this.parse(0,o),r>s?this._insertElements(s,r-s,t):r<s&&this._removeElements(r,s-r)}_insertElements(t,e,i=!0){const s=this._cachedMeta,r=s.data,o=t+e;let a;const l=c=>{for(c.length+=e,a=c.length-1;a>=o;a--)c[a]=c[a-e]};for(l(r),a=t;a<o;++a)r[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),i&&this.updateElements(r,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&Ji(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}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 i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}E(Ie,"defaults",{}),E(Ie,"datasetElementType",null),E(Ie,"dataElementType",null);function Mm(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let s=0,r=e.length;s<r;s++)i=i.concat(e[s].controller.getAllParsedValues(n));n._cache.$bar=xc(i.sort((s,r)=>s-r))}return n._cache.$bar}function km(n){const t=n.iScale,e=Mm(t,n.type);let i=t._length,s,r,o,a;const l=()=>{o===32767||o===-32768||(ge(a)&&(i=Math.min(i,Math.abs(o-a)||i)),a=o)};for(s=0,r=e.length;s<r;++s)o=t.getPixelForValue(e[s]),l();for(a=void 0,s=0,r=t.ticks.length;s<r;++s)o=t.getPixelForTick(s),l();return i}function Dm(n,t,e,i){const s=e.barThickness;let r,o;return st(s)?(r=t.min*e.categoryPercentage,o=e.barPercentage):(r=s*i,o=1),{chunk:r/i,ratio:o,start:t.pixels[n]-r/2}}function Sm(n,t,e,i){const s=t.pixels,r=s[n];let o=n>0?s[n-1]:null,a=n<s.length-1?s[n+1]:null;const l=e.categoryPercentage;o===null&&(o=r-(a===null?t.end-t.start:a-r)),a===null&&(a=r+r-o);const c=r-(r-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/i,ratio:e.barPercentage,start:c}}function Tm(n,t,e,i){const s=e.parse(n[0],i),r=e.parse(n[1],i),o=Math.min(s,r),a=Math.max(s,r);let l=o,c=a;Math.abs(o)>Math.abs(a)&&(l=a,c=o),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}function ru(n,t,e,i){return kt(n)?Tm(n,t,e,i):t[e.axis]=e.parse(n,i),t}function ou(n,t,e,i){const s=n.iScale,r=n.vScale,o=s.getLabels(),a=s===r,l=[];let c,u,d,f;for(c=e,u=e+i;c<u;++c)f=t[c],d={},d[s.axis]=a||s.parse(o[c],c),l.push(ru(f,d,r,c));return l}function Uo(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function Cm(n,t,e){return n!==0?He(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Pm(n){let t,e,i,s,r;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(s="end",r="start"):(s="start",r="end"),{start:e,end:i,reverse:t,top:s,bottom:r}}function Om(n,t,e,i){let s=t.borderSkipped;const r={};if(!s){n.borderSkipped=r;return}if(s===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:a,reverse:l,top:c,bottom:u}=Pm(n);s==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=c:(e._bottom||0)===i?s=u:(r[au(u,o,a,l)]=!0,s=c)),r[au(s,o,a,l)]=!0,n.borderSkipped=r}function au(n,t,e,i){return i?(n=Em(n,t,e),n=lu(n,e,t)):n=lu(n,t,e),n}function Em(n,t,e){return n===t?e:n===e?t:n}function lu(n,t,e){return n==="start"?t:n==="end"?e:n}function Am(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class ts extends Ie{parsePrimitiveData(t,e,i,s){return ou(t,e,i,s)}parseArrayData(t,e,i,s){return ou(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:r,vScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=r.axis==="x"?a:l,u=o.axis==="x"?a:l,d=[];let f,g,p,y;for(f=i,g=i+s;f<g;++f)y=e[f],p={},p[r.axis]=r.parse(yn(y,c),f),d.push(ru(yn(y,u),p,o,f));return d}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const r=i._custom;r&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:s}=e,r=this.getParsed(t),o=r._custom,a=Uo(o)?"["+o.start+", "+o.end+"]":""+s.getLabelForValue(r[s.axis]);return{label:""+i.getLabelForValue(r[i.axis]),value:a}}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,i,s){const r=s==="reset",{index:o,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:f}=this._getSharedOptions(e,s);for(let g=e;g<e+i;g++){const p=this.getParsed(g),y=r||st(p[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(g),x=this._calculateBarIndexPixels(g,u),v=(p._stacks||{})[a.axis],M={horizontal:c,base:y.base,enableBorderRadius:!v||Uo(p._custom)||o===v._top||o===v._bottom,x:c?y.head:x.center,y:c?x.center:y.head,height:c?x.size:Math.abs(y.size),width:c?Math.abs(y.size):x.size};f&&(M.options=d||this.resolveDataElementOptions(g,t[g].active?"active":s));const D=M.options||t[g].options;Om(M,D,v,o),Am(M,D,u.ratio),this.updateElement(t[g],g,M,s)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),r=i.options.stacked,o=[],a=this._cachedMeta.controller.getParsed(e),l=a&&a[i.axis],c=u=>{const d=u._parsed.find(g=>g[i.axis]===l),f=d&&d[u.vScale.axis];if(st(f)||isNaN(f))return!0};for(const u of s)if(!(e!==void 0&&c(u))&&((r===!1||o.indexOf(u.stack)===-1||r===void 0&&u.stack===void 0)&&o.push(u.stack),u.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[rt(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){const s=this._getStacks(t,i),r=e!==void 0?s.indexOf(e):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let r,o;for(r=0,o=e.data.length;r<o;++r)s.push(i.getPixelForValue(this.getParsed(r)[i.axis],r));const a=t.barThickness;return{min:a||km(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:s},options:{base:r,minBarLength:o}}=this,a=r||0,l=this.getParsed(t),c=l._custom,u=Uo(c);let d=l[e.axis],f=0,g=i?this.applyStack(e,l,i):d,p,y;g!==d&&(f=g-d,g=d),u&&(d=c.barStart,g=c.barEnd-c.barStart,d!==0&&He(d)!==He(c.barEnd)&&(f=0),f+=d);const x=!st(r)&&!u?r:f;let v=e.getPixelForValue(x);if(this.chart.getDataVisibility(t)?p=e.getPixelForValue(f+g):p=v,y=p-v,Math.abs(y)<o){y=Cm(y,e,a)*o,d===a&&(v-=y/2);const M=e.getPixelForDecimal(0),D=e.getPixelForDecimal(1),S=Math.min(M,D),C=Math.max(M,D);v=Math.max(Math.min(v,C),S),p=v+y,i&&!u&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(p)-e.getValueForPixel(v))}if(v===e.getPixelForValue(a)){const M=He(y)*e.getLineWidthForValue(a)/2;v+=M,y-=M}return{size:y,base:v,head:p,center:p+y/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,r=s.skipNull,o=rt(s.maxBarThickness,1/0);let a,l;const c=this._getAxisCount();if(e.grouped){const u=r?this._getStackCount(t):e.stackCount,d=s.barThickness==="flex"?Sm(t,e,s,u*c):Dm(t,e,s,u*c),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,g=this._getAxis().indexOf(rt(f,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0)+g;a=d.start+d.chunk*p+d.chunk/2,l=Math.min(o,d.chunk*d.ratio)}else a=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(o,e.min*e.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let r=0;for(;r<s;++r)this.getParsed(r)[e.axis]!==null&&!i[r].hidden&&i[r].draw(this._ctx)}}E(ts,"id","bar"),E(ts,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),E(ts,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class cr extends Ie{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){const r=super.parsePrimitiveData(t,e,i,s);for(let o=0;o<r.length;o++)r[o]._custom=this.resolveDataElementOptions(o+i).radius;return r}parseArrayData(t,e,i,s){const r=super.parseArrayData(t,e,i,s);for(let o=0;o<r.length;o++){const a=e[i+o];r[o]._custom=rt(a[2],this.resolveDataElementOptions(o+i).radius)}return r}parseObjectData(t,e,i,s){const r=super.parseObjectData(t,e,i,s);for(let o=0;o<r.length;o++){const a=e[i+o];r[o]._custom=rt(a&&a.r&&+a.r,this.resolveDataElementOptions(o+i).radius)}return r}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=e,o=this.getParsed(t),a=s.getLabelForValue(o.x),l=r.getLabelForValue(o.y),c=o._custom;return{label:i[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const r=s==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),u=o.axis,d=a.axis;for(let f=e;f<e+i;f++){const g=t[f],p=!r&&this.getParsed(f),y={},x=y[u]=r?o.getPixelForDecimal(.5):o.getPixelForValue(p[u]),v=y[d]=r?a.getBasePixel():a.getPixelForValue(p[d]);y.skip=isNaN(x)||isNaN(v),c&&(y.options=l||this.resolveDataElementOptions(f,g.active?"active":s),r&&(y.options.radius=0)),this.updateElement(g,f,y,s)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const r=s.radius;return e!=="active"&&(s.radius=0),s.radius+=rt(i&&i._custom,r),s}}E(cr,"id","bubble"),E(cr,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),E(cr,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Rm(n,t,e){let i=1,s=1,r=0,o=0;if(t<Ot){const a=n,l=a+t,c=Math.cos(a),u=Math.sin(a),d=Math.cos(l),f=Math.sin(l),g=(D,S,C)=>Ui(D,a,l,!0)?1:Math.max(S,S*e,C,C*e),p=(D,S,C)=>Ui(D,a,l,!0)?-1:Math.min(S,S*e,C,C*e),y=g(0,c,d),x=g(Et,u,f),v=p(ct,c,d),M=p(ct+Et,u,f);i=(y-v)/2,s=(x-M)/2,r=-(y+v)/2,o=-(x+M)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:o}}class en extends Ie{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 i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let r=l=>+i[l];if(ht(i[t])){const{key:l="value"}=this._parsing;r=c=>+yn(i[c],l)}let o,a;for(o=t,a=t+e;o<a;++o)s._parsed[o]=r(o)}}_getRotation(){return $t(this.options.rotation-90)}_getCircumference(){return $t(this.options.circumference)}_getRotationExtents(){let t=Ot,e=-Ot;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const s=this.chart.getDatasetMeta(i).controller,r=s._getRotation(),o=s._getCircumference();t=Math.min(t,r),e=Math.max(e,r+o)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,r=s.data,o=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-o)/2,0),l=Math.min(Ug(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:g,offsetX:p,offsetY:y}=Rm(d,u,l),x=(i.width-o)/f,v=(i.height-o)/g,M=Math.max(Math.min(x,v)/2,0),D=dc(this.options.radius,M),S=Math.max(D*l,0),C=(D-S)/this._getVisibleDatasetWeightTotal();this.offsetX=p*D,this.offsetY=y*D,s.total=this.calculateTotal(),this.outerRadius=D-C*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-C*c,0),this.updateElements(r,0,r.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,r=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*r/Ot)}updateElements(t,e,i,s){const r=s==="reset",o=this.chart,a=o.chartArea,c=o.options.animation,u=(a.left+a.right)/2,d=(a.top+a.bottom)/2,f=r&&c.animateScale,g=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:y,includeOptions:x}=this._getSharedOptions(e,s);let v=this._getRotation(),M;for(M=0;M<e;++M)v+=this._circumference(M,r);for(M=e;M<e+i;++M){const D=this._circumference(M,r),S=t[M],C={x:u+this.offsetX,y:d+this.offsetY,startAngle:v,endAngle:v+D,circumference:D,outerRadius:p,innerRadius:g};x&&(C.options=y||this.resolveDataElementOptions(M,S.active?"active":s)),v+=D,this.updateElement(S,M,C,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,s;for(s=0;s<e.length;s++){const r=t._parsed[s];r!==null&&!isNaN(r)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(i+=Math.abs(r))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?Ot*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=qi(e._parsed[t],i.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,r,o,a,l;if(!t){for(s=0,r=i.data.datasets.length;s<r;++s)if(i.isDatasetVisible(s)){o=i.getDatasetMeta(s),t=o.data,a=o.controller;break}}if(!t)return 0;for(s=0,r=t.length;s<r;++s)l=a.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){const r=this.resolveDataElementOptions(i);e=Math.max(e,r.offset||0,r.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));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}}E(en,"id","doughnut"),E(en,"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"}),E(en,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),E(en,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class es extends Ie{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=e,o=this.chart._animationsDisabled;let{start:a,count:l}=Mc(e,s,o);this._drawStart=a,this._drawCount=l,kc(e)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,e,i,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,s),f=o.axis,g=a.axis,{spanGaps:p,segment:y}=this.options,x=_n(p)?p:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||r||s==="none",M=e+i,D=t.length;let S=e>0&&this.getParsed(e-1);for(let C=0;C<D;++C){const R=t[C],O=v?R:{};if(C<e||C>=M){O.skip=!0;continue}const b=this.getParsed(C),_=st(b[g]),T=O[f]=o.getPixelForValue(b[f],C),I=O[g]=r||_?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,b,l):b[g],C);O.skip=isNaN(T)||isNaN(I)||_,O.stop=C>0&&Math.abs(b[f]-S[f])>x,y&&(O.parsed=b,O.raw=c.data[C]),d&&(O.options=u||this.resolveDataElementOptions(C,R.active?"active":s)),v||this.updateElement(R,C,O,s),S=b}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const r=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}E(es,"id","line"),E(es,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),E(es,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class ns extends Ie{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=qi(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,e,i,s){return Bc.bind(this)(t,e,i,s)}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((i,s)=>{const r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(r<e.min&&(e.min=r),r>e.max&&(e.max=r))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,i,s){const r=s==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,f=c.getIndexAngle(0)-.5*ct;let g=f,p;const y=360/this.countVisibleElements();for(p=0;p<e;++p)g+=this._computeAngle(p,s,y);for(p=e;p<e+i;p++){const x=t[p];let v=g,M=g+this._computeAngle(p,s,y),D=o.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;g=M,r&&(l.animateScale&&(D=0),l.animateRotate&&(v=M=f));const S={x:u,y:d,innerRadius:0,outerRadius:D,startAngle:v,endAngle:M,options:this.resolveDataElementOptions(p,x.active?"active":s)};this.updateElement(x,p,S,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?$t(this.resolveDataElementOptions(t,e).angle||i):0}}E(ns,"id","polarArea"),E(ns,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),E(ns,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Xo extends en{}E(Xo,"id","pie"),E(Xo,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class ur extends Ie{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return Bc.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],r=e.iScale.getLabels();if(i.points=s,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:r.length===s.length,options:o};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const r=this._cachedMeta.rScale,o=s==="reset";for(let a=e;a<e+i;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":s),u=r.getPointPositionForValue(a,this.getParsed(a).r),d=o?r.xCenter:u.x,f=o?r.yCenter:u.y,g={x:d,y:f,angle:u.angle,skip:isNaN(d)||isNaN(f),options:c};this.updateElement(l,a,g,s)}}}E(ur,"id","radar"),E(ur,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),E(ur,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class dr extends Ie{getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=e,o=this.getParsed(t),a=s.getLabelForValue(o.x),l=r.getLabelForValue(o.y);return{label:i[t]||"",value:"("+a+", "+l+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled;let{start:r,count:o}=Mc(e,i,s);if(this._drawStart=r,this._drawCount=o,kc(e)&&(r=0,o=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=e;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,r,o,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(e,s),d=this.getSharedOptions(u),f=this.includeOptions(s,d),g=o.axis,p=a.axis,{spanGaps:y,segment:x}=this.options,v=_n(y)?y:Number.POSITIVE_INFINITY,M=this.chart._animationsDisabled||r||s==="none";let D=e>0&&this.getParsed(e-1);for(let S=e;S<e+i;++S){const C=t[S],R=this.getParsed(S),O=M?C:{},b=st(R[p]),_=O[g]=o.getPixelForValue(R[g],S),T=O[p]=r||b?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,R,l):R[p],S);O.skip=isNaN(_)||isNaN(T)||b,O.stop=S>0&&Math.abs(R[g]-D[g])>v,x&&(O.parsed=R,O.raw=c.data[S]),f&&(O.options=d||this.resolveDataElementOptions(S,C.active?"active":s)),M||this.updateElement(C,S,O,s),D=R}this.updateSharedOptions(d,s,u)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let a=0;for(let l=e.length-1;l>=0;--l)a=Math.max(a,e[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const r=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,r,o)/2}}E(dr,"id","scatter"),E(dr,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),E(dr,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Im=Object.freeze({__proto__:null,BarController:ts,BubbleController:cr,DoughnutController:en,LineController:es,PieController:Xo,PolarAreaController:ns,RadarController:ur,ScatterController:dr});function Yn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class qo{constructor(t){E(this,"options");this.options=t||{}}static override(t){Object.assign(qo.prototype,t)}init(){}formats(){return Yn()}parse(){return Yn()}format(){return Yn()}add(){return Yn()}diff(){return Yn()}startOf(){return Yn()}endOf(){return Yn()}}var cu={_date:qo};function Lm(n,t,e,i){const{controller:s,data:r,_sorted:o}=n,a=s._cachedMeta.iScale,l=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&o&&r.length){const c=a._reversePixels?sp:Qe;if(i){if(s._sharedOptions){const u=r[0],d=typeof u.getRange=="function"&&u.getRange(t);if(d){const f=c(r,t,e-d),g=c(r,t,e+d);return{lo:f.lo,hi:g.hi}}}}else{const u=c(r,t,e);if(l){const{vScale:d}=s._cachedMeta,{_parsed:f}=n,g=f.slice(0,u.lo+1).reverse().findIndex(y=>!st(y[d.axis]));u.lo-=Math.max(0,g);const p=f.slice(u.hi).findIndex(y=>!st(y[d.axis]));u.hi+=Math.max(0,p)}return u}}return{lo:0,hi:r.length-1}}function is(n,t,e,i,s){const r=n.getSortedVisibleDatasetMetas(),o=e[t];for(let a=0,l=r.length;a<l;++a){const{index:c,data:u}=r[a],{lo:d,hi:f}=Lm(r[a],t,o,s);for(let g=d;g<=f;++g){const p=u[g];p.skip||i(p,c,g)}}}function Nm(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,s){const r=t?Math.abs(i.x-s.x):0,o=e?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(o,2))}}function Go(n,t,e,i,s){const r=[];return!s&&!n.isPointInArea(t)||is(n,e,t,function(a,l,c){!s&&!Je(a,n.chartArea,0)||a.inRange(t.x,t.y,i)&&r.push({element:a,datasetIndex:l,index:c})},!0),r}function Fm(n,t,e,i){let s=[];function r(o,a,l){const{startAngle:c,endAngle:u}=o.getProps(["startAngle","endAngle"],i),{angle:d}=tr(o,{x:t.x,y:t.y});Ui(d,c,u)&&s.push({element:o,datasetIndex:a,index:l})}return is(n,e,t,r),s}function zm(n,t,e,i,s,r){let o=[];const a=Nm(e);let l=Number.POSITIVE_INFINITY;function c(u,d,f){const g=u.inRange(t.x,t.y,s);if(i&&!g)return;const p=u.getCenterPoint(s);if(!(!!r||n.isPointInArea(p))&&!g)return;const x=a(t,p);x<l?(o=[{element:u,datasetIndex:d,index:f}],l=x):x===l&&o.push({element:u,datasetIndex:d,index:f})}return is(n,e,t,c),o}function Ko(n,t,e,i,s,r){return!r&&!n.isPointInArea(t)?[]:e==="r"&&!i?Fm(n,t,e,s):zm(n,t,e,i,s,r)}function uu(n,t,e,i,s){const r=[],o=e==="x"?"inXRange":"inYRange";let a=!1;return is(n,e,t,(l,c,u)=>{l[o]&&l[o](t[e],s)&&(r.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:r}var Zo={evaluateInteractionItems:is,modes:{index(n,t,e,i){const s=vn(t,n),r=e.axis||"x",o=e.includeInvisible||!1,a=e.intersect?Go(n,s,r,i,o):Ko(n,s,r,!1,i,o),l=[];return a.length?(n.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(n,t,e,i){const s=vn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;let a=e.intersect?Go(n,s,r,i,o):Ko(n,s,r,!1,i,o);if(a.length>0){const l=a[0].datasetIndex,c=n.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(n,t,e,i){const s=vn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;return Go(n,s,r,i,o)},nearest(n,t,e,i){const s=vn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;return Ko(n,s,r,e.intersect,i,o)},x(n,t,e,i){const s=vn(t,n);return uu(n,s,"x",e.intersect,i)},y(n,t,e,i){const s=vn(t,n);return uu(n,s,"y",e.intersect,i)}}};const du=["left","top","right","bottom"];function ss(n,t){return n.filter(e=>e.pos===t)}function hu(n,t){return n.filter(e=>du.indexOf(e.pos)===-1&&e.box.axis===t)}function rs(n,t){return n.sort((e,i)=>{const s=t?i:e,r=t?e:i;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function Bm(n){const t=[];let e,i,s,r,o,a;for(e=0,i=(n||[]).length;e<i;++e)s=n[e],{position:r,options:{stack:o,stackWeight:a=1}}=s,t.push({index:e,box:s,pos:r,horizontal:s.isHorizontal(),weight:s.weight,stack:o&&r+o,stackWeight:a});return t}function Hm(n){const t={};for(const e of n){const{stack:i,pos:s,stackWeight:r}=e;if(!i||!du.includes(s))continue;const o=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=r}return t}function Wm(n,t){const e=Hm(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let r,o,a;for(r=0,o=n.length;r<o;++r){a=n[r];const{fullSize:l}=a.box,c=e[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*i:l&&t.availableWidth,a.height=s):(a.width=i,a.height=u?u*s:l&&t.availableHeight)}return e}function Ym(n){const t=Bm(n),e=rs(t.filter(c=>c.box.fullSize),!0),i=rs(ss(t,"left"),!0),s=rs(ss(t,"right")),r=rs(ss(t,"top"),!0),o=rs(ss(t,"bottom")),a=hu(t,"x"),l=hu(t,"y");return{fullSize:e,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:ss(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}function fu(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function gu(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 jm(n,t,e,i){const{pos:s,box:r}=e,o=n.maxPadding;if(!ht(s)){e.size&&(n[s]-=e.size);const d=i[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?r.height:r.width),e.size=d.size/d.count,n[s]+=e.size}r.getPadding&&gu(o,r.getPadding());const a=Math.max(0,t.outerWidth-fu(o,n,"left","right")),l=Math.max(0,t.outerHeight-fu(o,n,"top","bottom")),c=a!==n.w,u=l!==n.h;return n.w=a,n.h=l,e.horizontal?{same:c,other:u}:{same:u,other:c}}function Vm(n){const t=n.maxPadding;function e(i){const s=Math.max(t[i]-n[i],0);return n[i]+=s,s}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function $m(n,t){const e=t.maxPadding;function i(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{r[o]=Math.max(t[o],e[o])}),r}return i(n?["left","right"]:["top","bottom"])}function os(n,t,e,i){const s=[];let r,o,a,l,c,u;for(r=0,o=n.length,c=0;r<o;++r){a=n[r],l=a.box,l.update(a.width||t.w,a.height||t.h,$m(a.horizontal,t));const{same:d,other:f}=jm(t,e,a,i);c|=d&&s.length,u=u||f,l.fullSize||s.push(a)}return c&&os(s,t,e,i)||u}function hr(n,t,e,i,s){n.top=e,n.left=t,n.right=t+i,n.bottom=e+s,n.width=i,n.height=s}function pu(n,t,e,i){const s=e.padding;let{x:r,y:o}=t;for(const a of n){const l=a.box,c=i[a.stack]||{placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*u,f=c.size||l.height;ge(c.start)&&(o=c.start),l.fullSize?hr(l,s.left,o,e.outerWidth-s.right-s.left,f):hr(l,t.left+c.placed,o,d,f),c.start=o,c.placed+=d,o=l.bottom}else{const d=t.h*u,f=c.size||l.width;ge(c.start)&&(r=c.start),l.fullSize?hr(l,r,s.top,f,e.outerHeight-s.bottom-s.top):hr(l,r,t.top+c.placed,f,d),c.start=r,c.placed+=d,r=l.right}}t.x=r,t.y=o}var oe={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,i){if(!n)return;const s=Ut(n.options.layout.padding),r=Math.max(t-s.width,0),o=Math.max(e-s.height,0),a=Ym(n.boxes),l=a.vertical,c=a.horizontal;St(n.boxes,y=>{typeof y.beforeLayout=="function"&&y.beforeLayout()});const u=l.reduce((y,x)=>x.box.options&&x.box.options.display===!1?y:y+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},s);gu(f,Ut(i));const g=Object.assign({maxPadding:f,w:r,h:o,x:s.left,y:s.top},s),p=Wm(l.concat(c),d);os(a.fullSize,g,d,p),os(l,g,d,p),os(c,g,d,p)&&os(l,g,d,p),Vm(g),pu(a.leftAndTop,g,d,p),g.x+=g.w,g.y+=g.h,pu(a.rightAndBottom,g,d,p),n.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},St(a.chartArea,y=>{const x=y.box;Object.assign(x,n.chartArea),x.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class mu{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class Um extends mu{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const fr="$chartjs",Xm={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},yu=n=>n===null||n==="";function qm(n,t){const e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[fr]={initial:{height:i,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",yu(s)){const r=Yc(n,"width");r!==void 0&&(n.width=r)}if(yu(i))if(n.style.height==="")n.height=n.width/(t||2);else{const r=Yc(n,"height");r!==void 0&&(n.height=r)}return n}const bu=Zp?{passive:!0}:!1;function Gm(n,t,e){n&&n.addEventListener(t,e,bu)}function Km(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,bu)}function Zm(n,t){const e=Xm[n.type]||n.type,{x:i,y:s}=vn(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function gr(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function Qm(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||gr(a.addedNodes,i),o=o&&!gr(a.removedNodes,i);o&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function Jm(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||gr(a.removedNodes,i),o=o&&!gr(a.addedNodes,i);o&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const as=new Map;let _u=0;function xu(){const n=window.devicePixelRatio;n!==_u&&(_u=n,as.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function ty(n,t){as.size||window.addEventListener("resize",xu),as.set(n,t)}function ey(n){as.delete(n),as.size||window.removeEventListener("resize",xu)}function ny(n,t,e){const i=n.canvas,s=i&&Wo(i);if(!s)return;const r=vc((a,l)=>{const c=s.clientWidth;e(a,l),c<s.clientWidth&&e()},window),o=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return o.observe(s),ty(n,r),o}function Qo(n,t,e){e&&e.disconnect(),t==="resize"&&ey(n)}function iy(n,t,e){const i=n.canvas,s=vc(r=>{n.ctx!==null&&e(Zm(r,n))},n);return Gm(i,t,s),s}class sy extends mu{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(qm(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[fr])return!1;const i=e[fr].initial;["height","width"].forEach(r=>{const o=i[r];st(o)?e.removeAttribute(r):e.setAttribute(r,o)});const s=i.style||{};return Object.keys(s).forEach(r=>{e.style[r]=s[r]}),e.width=e.width,delete e[fr],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),o={attach:Qm,detach:Jm,resize:ny}[e]||iy;s[e]=o(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:Qo,detach:Qo,resize:Qo}[e]||Km)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return Kp(t,e,i,s)}isAttached(t){const e=t&&Wo(t);return!!(e&&e.isConnected)}}function ry(n){return!Ho()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Um:sy}class Jt{constructor(){E(this,"x");E(this,"y");E(this,"active",!1);E(this,"options");E(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return _n(this.x)&&_n(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach(r=>{s[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),s}}E(Jt,"defaults",{}),E(Jt,"defaultRoutes");function oy(n,t){const e=n.options.ticks,i=ay(n),s=Math.min(e.maxTicksLimit||i,i),r=e.major.enabled?cy(t):[],o=r.length,a=r[0],l=r[o-1],c=[];if(o>s)return uy(t,c,r,o/s),c;const u=ly(r,t,s);if(o>0){let d,f;const g=o>1?Math.round((l-a)/(o-1)):null;for(pr(t,c,u,st(g)?0:a-g,a),d=0,f=o-1;d<f;d++)pr(t,c,u,r[d],r[d+1]);return pr(t,c,u,l,st(g)?t.length:l+g),c}return pr(t,c,u),c}function ay(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),s=n._maxLength/e;return Math.floor(Math.min(i,s))}function ly(n,t,e){const i=dy(n),s=t.length/e;if(!i)return Math.max(s,1);const r=Jg(i);for(let o=0,a=r.length-1;o<a;o++){const l=r[o];if(l>s)return l}return Math.max(s,1)}function cy(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function uy(n,t,e,i){let s=0,r=e[0],o;for(i=Math.ceil(i),o=0;o<n.length;o++)o===r&&(t.push(n[o]),s++,r=e[s*i])}function pr(n,t,e,i,s){const r=rt(i,0),o=Math.min(rt(s,n.length),n.length);let a=0,l,c,u;for(e=Math.ceil(e),s&&(l=s-i,e=l/Math.floor(l/e)),u=r;u<0;)a++,u=Math.round(r+a*e);for(c=Math.max(r,0);c<o;c++)c===u&&(t.push(n[c]),a++,u=Math.round(r+a*e))}function dy(n){const t=n.length;let e,i;if(t<2)return!1;for(i=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==i)return!1;return i}const hy=n=>n==="left"?"right":n==="right"?"left":n,wu=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,vu=(n,t)=>Math.min(t||n,n);function Mu(n,t){const e=[],i=n.length/t,s=n.length;let r=0;for(;r<s;r+=i)e.push(n[Math.floor(r)]);return e}function fy(n,t,e){const i=n.ticks.length,s=Math.min(t,i-1),r=n._startPixel,o=n._endPixel,a=1e-6;let l=n.getPixelForTick(s),c;if(!(e&&(i===1?c=Math.max(l-r,o-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<r-a||l>o+a)))return l}function gy(n,t){St(n,e=>{const i=e.gc,s=i.length/2;let r;if(s>t){for(r=0;r<s;++r)delete e.data[i[r]];i.splice(0,s)}})}function ls(n){return n.drawTicks?n.tickLength:0}function ku(n,t){if(!n.display)return 0;const e=It(n.font,t),i=Ut(n.padding);return(kt(n.text)?n.text.length:1)*e.lineHeight+i.height}function py(n,t){return wn(n,{scale:t,type:"scale"})}function my(n,t,e){return wn(n,{tick:e,index:t,type:"tick"})}function yy(n,t,e){let i=Oo(n);return(e&&t!=="right"||!e&&t==="right")&&(i=hy(i)),i}function by(n,t,e,i){const{top:s,left:r,bottom:o,right:a,chart:l}=n,{chartArea:c,scales:u}=l;let d=0,f,g,p;const y=o-s,x=a-r;if(n.isHorizontal()){if(g=re(i,r,a),ht(e)){const v=Object.keys(e)[0],M=e[v];p=u[v].getPixelForValue(M)+y-t}else e==="center"?p=(c.bottom+c.top)/2+y-t:p=wu(n,e,t);f=a-r}else{if(ht(e)){const v=Object.keys(e)[0],M=e[v];g=u[v].getPixelForValue(M)-x+t}else e==="center"?g=(c.left+c.right)/2-x+t:g=wu(n,e,t);p=re(i,o,s),d=e==="left"?-Et:Et}return{titleX:g,titleY:p,maxWidth:f,rotation:d}}class jn extends Jt{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:i,_suggestedMax:s}=this;return t=Me(t,Number.POSITIVE_INFINITY),e=Me(e,Number.NEGATIVE_INFINITY),i=Me(i,Number.POSITIVE_INFINITY),s=Me(s,Number.NEGATIVE_INFINITY),{min:Me(t,i),max:Me(e,s),minDefined:Rt(t),maxDefined:Rt(e)}}getMinMax(t){let{min:e,max:i,minDefined:s,maxDefined:r}=this.getUserBounds(),o;if(s&&r)return{min:e,max:i};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)o=a[l].controller.getMinMax(this,t),s||(e=Math.min(e,o.min)),r||(i=Math.max(i,o.max));return e=r&&e>i?i:e,i=s&&e>i?e:i,{min:Me(e,Me(i,e)),max:Me(i,Me(e,i))}}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(){Dt(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Cp(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Mu(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=oy(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,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Dt(this.options.afterUpdate,[this])}beforeSetDimensions(){Dt(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(){Dt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Dt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Dt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,r;for(i=0,s=t.length;i<s;i++)r=t[i],r.label=Dt(e.callback,[r.value,i,t],this)}afterTickToLabelConversion(){Dt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Dt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=vu(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,r=e.maxRotation;let o=s,a,l,c;if(!this._isVisible()||!e.display||s>=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,g=Qt(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:g/(i-1),d+6>a&&(a=g/(i-(t.offset?.5:1)),l=this.maxHeight-ls(t.grid)-e.padding-ku(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),o=Js(Math.min(Math.asin(Qt((u.highest.height+6)/a,-1,1)),Math.asin(Qt(l/c,-1,1))-Math.asin(Qt(f/c,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){Dt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Dt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=ku(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=ls(r)+l):(t.height=this.maxHeight,t.width=ls(r)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),g=i.padding*2,p=$t(this.labelRotation),y=Math.cos(p),x=Math.sin(p);if(a){const v=i.mirror?0:x*d.width+y*f.height;t.height=Math.min(this.maxHeight,t.height+v+g)}else{const v=i.mirror?0:y*d.width+x*f.height;t.width=Math.min(this.maxWidth,t.width+v+g)}this._calculatePadding(c,u,x,y)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="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=s*t.width,g=i*e.height):(f=i*t.height,g=s*e.width):r==="start"?g=e.width:r==="end"?f=t.width:r!=="inner"&&(f=t.width/2,g=e.width/2),this.paddingLeft=Math.max((f-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((g-d+o)*this.width/(this.width-d),0)}else{let u=e.height/2,d=t.height/2;r==="start"?(u=0,d=t.height):r==="end"&&(u=e.height,d=0),this.paddingTop=u+o,this.paddingBottom=d+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Dt(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,i;for(e=0,i=t.length;e<i;e++)st(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=Mu(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:s,_longestTextCache:r}=this,o=[],a=[],l=Math.floor(e/vu(e,i));let c=0,u=0,d,f,g,p,y,x,v,M,D,S,C;for(d=0;d<e;d+=l){if(p=t[d].label,y=this._resolveTickFontOptions(d),s.font=x=y.string,v=r[x]=r[x]||{data:{},gc:[]},M=y.lineHeight,D=S=0,!st(p)&&!kt(p))D=ir(s,v.data,v.gc,D,p),S=M;else if(kt(p))for(f=0,g=p.length;f<g;++f)C=p[f],!st(C)&&!kt(C)&&(D=ir(s,v.data,v.gc,D,C),S+=M);o.push(D),a.push(S),c=Math.max(D,c),u=Math.max(S,u)}gy(r,e);const R=o.indexOf(c),O=a.indexOf(u),b=_=>({width:o[_]||0,height:a[_]||0});return{first:b(0),last:b(e-1),widest:b(R),highest:b(O),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return ip(this._alignToPixels?zn(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 i=e[t];return i.$context||(i.$context=my(this.getContext(),t,i))}return this.$context||(this.$context=py(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=$t(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),r=this._getLabelSizes(),o=t.autoSkipPadding||0,a=r?r.widest.width+o:0,l=r?r.highest.height+o:0;return this.isHorizontal()?l*i>a*s?a/i:l/s:l*s<a*i?l/i:a/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:r,position:o,border:a}=s,l=r.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=ls(r),g=[],p=a.setContext(this.getContext()),y=p.display?p.width:0,x=y/2,v=function(Q){return zn(i,Q,y)};let M,D,S,C,R,O,b,_,T,I,P,F;if(o==="top")M=v(this.bottom),O=this.bottom-f,_=M-x,I=v(t.top)+x,F=t.bottom;else if(o==="bottom")M=v(this.top),I=t.top,F=v(t.bottom)-x,O=M+x,_=this.top+f;else if(o==="left")M=v(this.right),R=this.right-f,b=M-x,T=v(t.left)+x,P=t.right;else if(o==="right")M=v(this.left),T=t.left,P=v(t.right)-x,R=M+x,b=this.left+f;else if(e==="x"){if(o==="center")M=v((t.top+t.bottom)/2+.5);else if(ht(o)){const Q=Object.keys(o)[0],$=o[Q];M=v(this.chart.scales[Q].getPixelForValue($))}I=t.top,F=t.bottom,O=M+x,_=O+f}else if(e==="y"){if(o==="center")M=v((t.left+t.right)/2);else if(ht(o)){const Q=Object.keys(o)[0],$=o[Q];M=v(this.chart.scales[Q].getPixelForValue($))}R=M-x,b=R-f,T=t.left,P=t.right}const U=rt(s.ticks.maxTicksLimit,d),X=Math.max(1,Math.ceil(d/U));for(D=0;D<d;D+=X){const Q=this.getContext(D),$=r.setContext(Q),ut=a.setContext(Q),V=$.lineWidth,G=$.color,J=ut.dash||[],z=ut.dashOffset,B=$.tickWidth,ft=$.tickColor,yt=$.tickBorderDash||[],vt=$.tickBorderDashOffset;S=fy(this,D,l),S!==void 0&&(C=zn(i,S,V),c?R=b=T=P=C:O=_=I=F=C,g.push({tx1:R,ty1:O,tx2:b,ty2:_,x1:T,y1:I,x2:P,y2:F,width:V,color:G,borderDash:J,borderDashOffset:z,tickWidth:B,tickColor:ft,tickBorderDash:yt,tickBorderDashOffset:vt}))}return this._ticksLength=d,this._borderValue=M,g}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:r}=i,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=r,f=ls(i.grid),g=f+u,p=d?-u:g,y=-$t(this.labelRotation),x=[];let v,M,D,S,C,R,O,b,_,T,I,P,F="middle";if(s==="top")R=this.bottom-p,O=this._getXAxisLabelAlignment();else if(s==="bottom")R=this.top+p,O=this._getXAxisLabelAlignment();else if(s==="left"){const X=this._getYAxisLabelAlignment(f);O=X.textAlign,C=X.x}else if(s==="right"){const X=this._getYAxisLabelAlignment(f);O=X.textAlign,C=X.x}else if(e==="x"){if(s==="center")R=(t.top+t.bottom)/2+g;else if(ht(s)){const X=Object.keys(s)[0],Q=s[X];R=this.chart.scales[X].getPixelForValue(Q)+g}O=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")C=(t.left+t.right)/2-g;else if(ht(s)){const X=Object.keys(s)[0],Q=s[X];C=this.chart.scales[X].getPixelForValue(Q)}O=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?F="top":l==="end"&&(F="bottom"));const U=this._getLabelSizes();for(v=0,M=a.length;v<M;++v){D=a[v],S=D.label;const X=r.setContext(this.getContext(v));b=this.getPixelForTick(v)+r.labelOffset,_=this._resolveTickFontOptions(v),T=_.lineHeight,I=kt(S)?S.length:1;const Q=I/2,$=X.color,ut=X.textStrokeColor,V=X.textStrokeWidth;let G=O;o?(C=b,O==="inner"&&(v===M-1?G=this.options.reverse?"left":"right":v===0?G=this.options.reverse?"right":"left":G="center"),s==="top"?c==="near"||y!==0?P=-I*T+T/2:c==="center"?P=-U.highest.height/2-Q*T+T:P=-U.highest.height+T/2:c==="near"||y!==0?P=T/2:c==="center"?P=U.highest.height/2-Q*T:P=U.highest.height-I*T,d&&(P*=-1),y!==0&&!X.showLabelBackdrop&&(C+=T/2*Math.sin(y))):(R=b,P=(1-I)*T/2);let J;if(X.showLabelBackdrop){const z=Ut(X.backdropPadding),B=U.heights[v],ft=U.widths[v];let yt=P-z.top,vt=0-z.left;switch(F){case"middle":yt-=B/2;break;case"bottom":yt-=B;break}switch(O){case"center":vt-=ft/2;break;case"right":vt-=ft;break;case"inner":v===M-1?vt-=ft:v>0&&(vt-=ft/2);break}J={left:vt,top:yt,width:ft+z.width,height:B+z.height,color:X.backdropColor}}x.push({label:S,font:_,textOffset:P,options:{rotation:y,color:$,strokeColor:ut,strokeWidth:V,textAlign:G,textBaseline:F,translation:[C,R],backdrop:J}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-$t(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:r}}=this.options,o=this._getLabelSizes(),a=t+r,l=o.widest.width;let c,u;return e==="left"?s?(u=this.right+r,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):e==="right"?s?(u=this.left+r,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,i==="near"?c="left":i==="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:i,top:s,width:r,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,r,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(r=>r.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(e.display)for(r=0,o=s.length;r<o;++r){const l=s[r];e.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:s}}=this,r=i.setContext(this.getContext()),o=i.display?r.width:0;if(!o)return;const a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,f;this.isHorizontal()?(c=zn(t,this.left,o)-o/2,u=zn(t,this.right,a)+a/2,d=f=l):(d=zn(t,this.top,o)-o/2,f=zn(t,this.bottom,a)+a/2,c=u=l),e.save(),e.lineWidth=r.width,e.strokeStyle=r.color,e.beginPath(),e.moveTo(c,d),e.lineTo(u,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&Ki(i,s);const r=this.getLabelItems(t);for(const o of r){const a=o.options,l=o.font,c=o.label,u=o.textOffset;Bn(i,c,0,u,l,a)}s&&Zi(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const r=It(i.font),o=Ut(i.padding),a=i.align;let l=r.lineHeight/2;e==="bottom"||e==="center"||ht(e)?(l+=o.bottom,kt(i.text)&&(l+=r.lineHeight*(i.text.length-1))):l+=o.top;const{titleX:c,titleY:u,maxWidth:d,rotation:f}=by(this,l,e,a);Bn(t,i.text,0,0,r,{color:i.color,maxWidth:d,rotation:f,textAlign:yy(a,e,s),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,i=rt(t.grid&&t.grid.z,-1),s=rt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==jn.prototype.draw?[{z:e,draw:r=>{this.draw(r)}}]:[{z:i,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let r,o;for(r=0,o=e.length;r<o;++r){const a=e[r];a[i]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return It(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class mr{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,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 i;wy(e)&&(i=this.register(e));const s=this.items,r=t.id,o=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in s||(s[r]=t,_y(t,o,i),this.override&&At.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in At[s]&&(delete At[s][i],this.override&&delete Fn[i])}}function _y(n,t,e){const i=ji(Object.create(null),[e?At.get(e):{},At.get(t),n.defaults]);At.set(t,i),n.defaultRoutes&&xy(t,n.defaultRoutes),n.descriptors&&At.describe(t,n.descriptors)}function xy(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),s=i.pop(),r=[n].concat(i).join("."),o=t[e].split("."),a=o.pop(),l=o.join(".");At.route(r,s,l,a)})}function wy(n){return"id"in n&&"defaults"in n}class vy{constructor(){this.controllers=new mr(Ie,"datasets",!0),this.elements=new mr(Jt,"elements"),this.plugins=new mr(Object,"plugins"),this.scales=new mr(jn,"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,i){[...e].forEach(s=>{const r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):St(s,o=>{const a=i||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,e,i){const s=To(t);Dt(i["before"+s],[],i),e[t](i),Dt(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var We=new vy;class My{constructor(){this._init=[]}notify(t,e,i,s){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const r=s?this._descriptors(t).filter(s):this._descriptors(t),o=this._notify(r,t,e,i);return e==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,i,s){s=s||{};for(const r of t){const o=r.plugin,a=o[i],l=[e,s,r.options];if(Dt(a,l,o)===!1&&s.cancelable)return!1}return!0}invalidate(){st(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 i=t&&t.config,s=rt(i.options&&i.options.plugins,{}),r=ky(i);return s===!1&&!e?[]:Sy(t,r,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(r,o)=>r.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function ky(n){const t={},e=[],i=Object.keys(We.plugins.items);for(let r=0;r<i.length;r++)e.push(We.getPlugin(i[r]));const s=n.plugins||[];for(let r=0;r<s.length;r++){const o=s[r];e.indexOf(o)===-1&&(e.push(o),t[o.id]=!0)}return{plugins:e,localIds:t}}function Dy(n,t){return!t&&n===!1?null:n===!0?{}:n}function Sy(n,{plugins:t,localIds:e},i,s){const r=[],o=n.getContext();for(const a of t){const l=a.id,c=Dy(i[l],s);c!==null&&r.push({plugin:a,options:Ty(n.config,{plugin:a,local:e[l]},c,o)})}return r}function Ty(n,{plugin:t,local:e},i,s){const r=n.pluginScopeKeys(t),o=n.getOptionScopes(i,r);return e&&t.defaults&&o.push(t.defaults),n.createResolver(o,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Jo(n,t){const e=At.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Cy(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function Py(n,t){return n===t?"_index_":"_value_"}function Du(n){if(n==="x"||n==="y"||n==="r")return n}function Oy(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function ta(n,...t){if(Du(n))return n;for(const e of t){const i=e.axis||Oy(e.position)||n.length>1&&Du(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Su(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function Ey(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(e.length)return Su(n,"x",e[0])||Su(n,"y",e[0])}return{}}function Ay(n,t){const e=Fn[n.type]||{scales:{}},i=t.scales||{},s=Jo(n.type,t),r=Object.create(null);return Object.keys(i).forEach(o=>{const a=i[o];if(!ht(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=ta(o,a,Ey(o,n),At.scales[a.type]),c=Py(l,s),u=e.scales||{};r[o]=Vi(Object.create(null),[{axis:l},a,u[l],u[c]])}),n.data.datasets.forEach(o=>{const a=o.type||n.type,l=o.indexAxis||Jo(a,t),u=(Fn[a]||{}).scales||{};Object.keys(u).forEach(d=>{const f=Cy(d,l),g=o[f+"AxisID"]||f;r[g]=r[g]||Object.create(null),Vi(r[g],[{axis:f},i[g],u[d]])})}),Object.keys(r).forEach(o=>{const a=r[o];Vi(a,[At.scales[a.type],At.scale])}),r}function Tu(n){const t=n.options||(n.options={});t.plugins=rt(t.plugins,{}),t.scales=Ay(n,t)}function Cu(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function Ry(n){return n=n||{},n.data=Cu(n.data),Tu(n),n}const Pu=new Map,Ou=new Set;function yr(n,t){let e=Pu.get(n);return e||(e=t(),Pu.set(n,e),Ou.add(e)),e}const cs=(n,t,e)=>{const i=yn(t,e);i!==void 0&&n.add(i)};class Iy{constructor(t){this._config=Ry(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=Cu(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(),Tu(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return yr(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return yr(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return yr(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return yr(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return(!s||e)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:r}=this,o=this._cachedScopes(t,i),a=o.get(e);if(a)return a;const l=new Set;e.forEach(u=>{t&&(l.add(t),u.forEach(d=>cs(l,t,d))),u.forEach(d=>cs(l,s,d)),u.forEach(d=>cs(l,Fn[r]||{},d)),u.forEach(d=>cs(l,At,d)),u.forEach(d=>cs(l,Ro,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Ou.has(e)&&o.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Fn[e]||{},At.datasets[e]||{},{type:e},At,Ro]}resolveNamedOptions(t,e,i,s=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=Eu(this._resolverCache,t,s);let l=o;if(Ny(o,e)){r.$shared=!1,i=pe(i)?i():i;const c=this.createResolver(t,i,a);l=hi(o,i,c)}for(const c of e)r[c]=l[c];return r}createResolver(t,e,i=[""],s){const{resolver:r}=Eu(this._resolverCache,t,i);return ht(e)?hi(r,e,void 0,s):r}}function Eu(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const s=e.join();let r=i.get(s);return r||(r={resolver:Fo(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,r)),r}const Ly=n=>ht(n)&&Object.getOwnPropertyNames(n).some(t=>pe(n[t]));function Ny(n,t){const{isScriptable:e,isIndexable:i}=Rc(n);for(const s of t){const r=e(s),o=i(s),a=(o||r)&&n[s];if(r&&(pe(a)||Ly(a))||o&&kt(a))return!0}return!1}var Fy="4.5.0";const zy=["top","bottom","left","right","chartArea"];function Au(n,t){return n==="top"||n==="bottom"||zy.indexOf(n)===-1&&t==="x"}function Ru(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function Iu(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),Dt(e&&e.onComplete,[n],t)}function By(n){const t=n.chart,e=t.options.animation;Dt(e&&e.onProgress,[n],t)}function Lu(n){return Ho()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const br={},Nu=n=>{const t=Lu(n);return Object.values(br).filter(e=>e.canvas===t).pop()};function Hy(n,t,e){const i=Object.keys(n);for(const s of i){const r=+s;if(r>=t){const o=n[s];delete n[s],(e>0||r>t)&&(n[r+e]=o)}}}function Wy(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}let Se=(On=class{static register(...t){We.add(...t),Fu()}static unregister(...t){We.remove(...t),Fu()}constructor(t,e){const i=this.config=new Iy(e),s=Lu(t),r=Nu(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||ry(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=$g(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=o,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 My,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=ap(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],br[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}tn.listen(this,"complete",Iu),tn.listen(this,"progress",By),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:r}=this;return st(t)?e&&r?r:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return We}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Wc(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Oc(this.canvas,this.ctx),this}stop(){return tn.stop(this),this}resize(t,e){tn.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,e,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Wc(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),Dt(i.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};St(e,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((o,a)=>(o[a]=!1,o),{});let r=[];e&&(r=r.concat(Object.keys(e).map(o=>{const a=e[o],l=ta(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),St(r,o=>{const a=o.options,l=a.id,c=ta(l,a),u=rt(a.type,o.dtype);(a.position===void 0||Au(a.position,c)!==Au(o.dposition))&&(a.position=o.dposition),s[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{const f=We.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),St(s,(o,a)=>{o||delete i[a]}),St(i,o=>{oe.configure(this,o,o.options),oe.addBox(this,o)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((s,r)=>s.index-r.index),i>e){for(let s=e;s<i;++s)this._destroyDatasetMeta(s);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Ru("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,s)=>{e.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const r=e[i];let o=this.getDatasetMeta(i);const a=r.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(i),o=this.getDatasetMeta(i)),o.type=a,o.indexAxis=r.indexAxis||Jo(a,this.options),o.order=r.order||0,o.index=i,o.label=""+r.label,o.visible=this.isDatasetVisible(i),o.controller)o.controller.updateIndex(i),o.controller.linkScales();else{const l=We.getController(a),{datasetElementType:c,dataElementType:u}=At.datasets[a];Object.assign(l,{dataElementType:We.getElement(u),datasetElementType:c&&We.getElement(c)}),o.controller=new l(this,i),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){St(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 i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),f=!s&&r.indexOf(d)===-1;d.buildOrUpdateElements(f),o=Math.max(+d.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),s||St(r,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Ru("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){St(this.scales,t=>{oe.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!gc(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:r}of e){const o=i==="_removeElements"?-r:r;Hy(t,s,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),s=i(0);for(let r=1;r<e;r++)if(!gc(s,i(r)))return;return Array.from(s).map(r=>r.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;oe.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],St(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,pe(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(tn.has(this)?this.attached&&!tn.running(this)&&tn.start(this):(this.draw(),Iu({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}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,i=[];let s,r;for(s=0,r=e.length;s<r;++s){const o=e[s];(!t||o.visible)&&i.push(o)}return i}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,i={meta:t,index:t.index,cancelable:!0},s=Zc(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&Ki(e,s),t.controller.draw(),s&&Zi(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return Je(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const r=Zo.modes[e];return typeof r=="function"?r(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter(r=>r&&r._dataset===e).pop();return s||(s={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},i.push(s)),s}getContext(){return this.$context||(this.$context=wn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,s);ge(e)?(r.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(r,{visible:i}),this.update(a=>a.datasetIndex===t?s: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(),tn.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(),Oc(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete br[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,i=(r,o)=>{e.addEventListener(this,r,o),t[r]=o},s=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};St(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",r),i("detach",o)};o=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){St(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},St(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let r,o,a,l;for(e==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){o=t[a];const c=o&&this.getDatasetMeta(o.datasetIndex).controller;c&&c[s+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:r,index:o})=>{const a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!Gs(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const s=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),o=r(e,t),a=i?t:r(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const r=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:r}=this,o=e,a=this._getActiveElements(t,s,i,o),l=Zg(t),c=Wy(t,this._lastEvent,i,l);i&&(this._lastEvent=null,Dt(r.onHover,[t,a,this],this),l&&Dt(r.onClick,[t,a,this],this));const u=!Gs(a,s);return(u||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=c,u}_getActiveElements(t,e,i,s){if(t.type==="mouseout")return[];if(!i)return e;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}},E(On,"defaults",At),E(On,"instances",br),E(On,"overrides",Fn),E(On,"registry",We),E(On,"version",Fy),E(On,"getChart",Nu),On);function Fu(){return St(Se.instances,n=>n._plugins.invalidate())}function Yy(n,t,e){const{startAngle:i,x:s,y:r,outerRadius:o,innerRadius:a,options:l}=t,{borderWidth:c,borderJoinStyle:u}=l,d=Math.min(c/o,se(i-e));if(n.beginPath(),n.arc(s,r,o-c/2,i+d/2,e-d/2),a>0){const f=Math.min(c/a,se(i-e));n.arc(s,r,a+c/2,e-f/2,i+f/2,!0)}else{const f=Math.min(c/2,o*se(i-e));if(u==="round")n.arc(s,r,f,e-ct/2,i+ct/2,!0);else if(u==="bevel"){const g=2*f*f,p=-g*Math.cos(e+ct/2)+s,y=-g*Math.sin(e+ct/2)+r,x=g*Math.cos(i+ct/2)+s,v=g*Math.sin(i+ct/2)+r;n.lineTo(p,y),n.lineTo(x,v)}}n.closePath(),n.moveTo(0,0),n.rect(0,0,n.canvas.width,n.canvas.height),n.clip("evenodd")}function jy(n,t,e){const{startAngle:i,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=t;let c=s/a;n.beginPath(),n.arc(r,o,a,i-c,e+c),l>s?(c=s/l,n.arc(r,o,l,e+c,i-c,!0)):n.arc(r,o,s,e+Et,i-Et),n.closePath(),n.clip()}function Vy(n){return No(n,["outerStart","outerEnd","innerStart","innerEnd"])}function $y(n,t,e,i){const s=Vy(n.options.borderRadius),r=(e-t)/2,o=Math.min(r,i*t/2),a=l=>{const c=(e-Math.min(r,l))*i/2;return Qt(l,0,Math.min(r,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:Qt(s.innerStart,0,o),innerEnd:Qt(s.innerEnd,0,o)}}function pi(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function _r(n,t,e,i,s,r){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+i+e-c,0),f=u>0?u+i+e+c:0;let g=0;const p=s-l;if(i){const X=u>0?u-i:0,Q=d>0?d-i:0,$=(X+Q)/2,ut=$!==0?p*$/($+i):p;g=(p-ut)/2}const y=Math.max(.001,p*d-e/ct)/d,x=(p-y)/2,v=l+x+g,M=s-x-g,{outerStart:D,outerEnd:S,innerStart:C,innerEnd:R}=$y(t,f,d,M-v),O=d-D,b=d-S,_=v+D/O,T=M-S/b,I=f+C,P=f+R,F=v+C/I,U=M-R/P;if(n.beginPath(),r){const X=(_+T)/2;if(n.arc(o,a,d,_,X),n.arc(o,a,d,X,T),S>0){const V=pi(b,T,o,a);n.arc(V.x,V.y,S,T,M+Et)}const Q=pi(P,M,o,a);if(n.lineTo(Q.x,Q.y),R>0){const V=pi(P,U,o,a);n.arc(V.x,V.y,R,M+Et,U+Math.PI)}const $=(M-R/f+(v+C/f))/2;if(n.arc(o,a,f,M-R/f,$,!0),n.arc(o,a,f,$,v+C/f,!0),C>0){const V=pi(I,F,o,a);n.arc(V.x,V.y,C,F+Math.PI,v-Et)}const ut=pi(O,v,o,a);if(n.lineTo(ut.x,ut.y),D>0){const V=pi(O,_,o,a);n.arc(V.x,V.y,D,v-Et,_)}}else{n.moveTo(o,a);const X=Math.cos(_)*d+o,Q=Math.sin(_)*d+a;n.lineTo(X,Q);const $=Math.cos(T)*d+o,ut=Math.sin(T)*d+a;n.lineTo($,ut)}n.closePath()}function Uy(n,t,e,i,s){const{fullCircles:r,startAngle:o,circumference:a}=t;let l=t.endAngle;if(r){_r(n,t,e,i,l,s);for(let c=0;c<r;++c)n.fill();isNaN(a)||(l=o+(a%Ot||Ot))}return _r(n,t,e,i,l,s),n.fill(),l}function Xy(n,t,e,i,s){const{fullCircles:r,startAngle:o,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:f,borderRadius:g}=l,p=l.borderAlign==="inner";if(!c)return;n.setLineDash(d||[]),n.lineDashOffset=f,p?(n.lineWidth=c*2,n.lineJoin=u||"round"):(n.lineWidth=c,n.lineJoin=u||"bevel");let y=t.endAngle;if(r){_r(n,t,e,i,y,s);for(let x=0;x<r;++x)n.stroke();isNaN(a)||(y=o+(a%Ot||Ot))}p&&jy(n,t,y),l.selfJoin&&y-o>=ct&&g===0&&u!=="miter"&&Yy(n,t,y),r||(_r(n,t,e,i,y,s),n.stroke())}class us extends Jt{constructor(e){super();E(this,"circumference");E(this,"endAngle");E(this,"fullCircles");E(this,"innerRadius");E(this,"outerRadius");E(this,"pixelMargin");E(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,i,s){const r=this.getProps(["x","y"],s),{angle:o,distance:a}=tr(r,{x:e,y:i}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),g=(this.options.spacing+this.options.borderWidth)/2,p=rt(f,c-l),y=Ui(o,l,c)&&l!==c,x=p>=Ot||y,v=Ze(a,u+g,d+g);return x&&v}getCenterPoint(e){const{x:i,y:s,startAngle:r,endAngle:o,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:u}=this.options,d=(r+o)/2,f=(a+l+u+c)/2;return{x:i+Math.cos(d)*f,y:s+Math.sin(d)*f}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:i,circumference:s}=this,r=(i.offset||0)/4,o=(i.spacing||0)/2,a=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>Ot?Math.floor(s/Ot):0,s===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*r,Math.sin(l)*r);const c=1-Math.sin(Math.min(ct,s||0)),u=r*c;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,Uy(e,this,u,o,a),Xy(e,this,u,o,a),e.restore()}}E(us,"id","arc"),E(us,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),E(us,"defaultRoutes",{backgroundColor:"backgroundColor"}),E(us,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function zu(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 qy(n,t,e){n.lineTo(e.x,e.y)}function Gy(n){return n.stepped?_p:n.tension||n.cubicInterpolationMode==="monotone"?xp:qy}function Bu(n,t,e={}){const i=n.length,{start:s=0,end:r=i-1}=e,{start:o,end:a}=t,l=Math.max(s,o),c=Math.min(r,a),u=s<o&&r<o||s>a&&r>a;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function Ky(n,t,e,i){const{points:s,options:r}=t,{count:o,start:a,loop:l,ilen:c}=Bu(s,e,i),u=Gy(r);let{move:d=!0,reverse:f}=i||{},g,p,y;for(g=0;g<=c;++g)p=s[(a+(f?c-g:g))%o],!p.skip&&(d?(n.moveTo(p.x,p.y),d=!1):u(n,y,p,f,r.stepped),y=p);return l&&(p=s[(a+(f?c:0))%o],u(n,y,p,f,r.stepped)),!!l}function Zy(n,t,e,i){const s=t.points,{count:r,start:o,ilen:a}=Bu(s,e,i),{move:l=!0,reverse:c}=i||{};let u=0,d=0,f,g,p,y,x,v;const M=S=>(o+(c?a-S:S))%r,D=()=>{y!==x&&(n.lineTo(u,x),n.lineTo(u,y),n.lineTo(u,v))};for(l&&(g=s[M(0)],n.moveTo(g.x,g.y)),f=0;f<=a;++f){if(g=s[M(f)],g.skip)continue;const S=g.x,C=g.y,R=S|0;R===p?(C<y?y=C:C>x&&(x=C),u=(d*u+S)/++d):(D(),n.lineTo(S,C),p=R,d=0,y=x=C),v=C}D()}function ea(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Zy:Ky}function Qy(n){return n.stepped?Qp:n.tension||n.cubicInterpolationMode==="monotone"?Jp:Wn}function Jy(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),zu(n,t.options),n.stroke(s)}function tb(n,t,e,i){const{segments:s,options:r}=t,o=ea(t);for(const a of s)zu(n,r,a.style),n.beginPath(),o(n,t,a,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const eb=typeof Path2D=="function";function nb(n,t,e,i){eb&&!t.options.segment?Jy(n,t,e,i):tb(n,t,e,i)}class Mn extends Jt{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 i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;Vp(this._points,i,t,s,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,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],r=this.points,o=qc(this,{property:e,start:s,end:s});if(!o.length)return;const a=[],l=Qy(i);let c,u;for(c=0,u=o.length;c<u;++c){const{start:d,end:f}=o[c],g=r[d],p=r[f];if(g===p){a.push(g);continue}const y=Math.abs((s-g[e])/(p[e]-g[e])),x=l(g,p,y,i.stepped);x[e]=t[e],a.push(x)}return a.length===1?a[0]:a}pathSegment(t,e,i){return ea(this)(t,this,e,i)}path(t,e,i){const s=this.segments,r=ea(this);let o=this._loop;e=e||0,i=i||this.points.length-e;for(const a of s)o&=r(t,this,a,{start:e,end:e+i-1});return!!o}draw(t,e,i,s){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),nb(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}E(Mn,"id","line"),E(Mn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),E(Mn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),E(Mn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Hu(n,t,e,i){const s=n.options,{[e]:r}=n.getProps([e],i);return Math.abs(t-r)<s.radius+s.hitRadius}class xr extends Jt{constructor(e){super();E(this,"parsed");E(this,"skip");E(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,i,s){const r=this.options,{x:o,y:a}=this.getProps(["x","y"],s);return Math.pow(e-o,2)+Math.pow(i-a,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(e,i){return Hu(this,e,"x",i)}inYRange(e,i){return Hu(this,e,"y",i)}getCenterPoint(e){const{x:i,y:s}=this.getProps(["x","y"],e);return{x:i,y:s}}size(e){e=e||this.options||{};let i=e.radius||0;i=Math.max(i,i&&e.hoverRadius||0);const s=i&&e.borderWidth||0;return(i+s)*2}draw(e,i){const s=this.options;this.skip||s.radius<.1||!Je(this,i,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,Lo(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}E(xr,"id","point"),E(xr,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),E(xr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Wu(n,t){const{x:e,y:i,base:s,width:r,height:o}=n.getProps(["x","y","base","width","height"],t);let a,l,c,u,d;return n.horizontal?(d=o/2,a=Math.min(e,s),l=Math.max(e,s),c=i-d,u=i+d):(d=r/2,a=e-d,l=e+d,c=Math.min(i,s),u=Math.max(i,s)),{left:a,top:c,right:l,bottom:u}}function kn(n,t,e,i){return n?0:Qt(t,e,i)}function ib(n,t,e){const i=n.options.borderWidth,s=n.borderSkipped,r=Ac(i);return{t:kn(s.top,r.top,0,e),r:kn(s.right,r.right,0,t),b:kn(s.bottom,r.bottom,0,e),l:kn(s.left,r.left,0,t)}}function sb(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,r=xn(s),o=Math.min(t,e),a=n.borderSkipped,l=i||ht(s);return{topLeft:kn(!l||a.top||a.left,r.topLeft,0,o),topRight:kn(!l||a.top||a.right,r.topRight,0,o),bottomLeft:kn(!l||a.bottom||a.left,r.bottomLeft,0,o),bottomRight:kn(!l||a.bottom||a.right,r.bottomRight,0,o)}}function rb(n){const t=Wu(n),e=t.right-t.left,i=t.bottom-t.top,s=ib(n,e/2,i/2),r=sb(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:r},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,r.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(s.b,s.r))}}}}function na(n,t,e,i){const s=t===null,r=e===null,a=n&&!(s&&r)&&Wu(n,i);return a&&(s||Ze(t,a.left,a.right))&&(r||Ze(e,a.top,a.bottom))}function ob(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function ab(n,t){n.rect(t.x,t.y,t.w,t.h)}function ia(n,t,e={}){const i=n.x!==e.x?-t:0,s=n.y!==e.y?-t:0,r=(n.x+n.w!==e.x+e.w?t:0)-i,o=(n.y+n.h!==e.y+e.h?t:0)-s;return{x:n.x+i,y:n.y+s,w:n.w+r,h:n.h+o,radius:n.radius}}class wr extends Jt{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:i,backgroundColor:s}}=this,{inner:r,outer:o}=rb(this),a=ob(o.radius)?di:ab;t.save(),(o.w!==r.w||o.h!==r.h)&&(t.beginPath(),a(t,ia(o,e,r)),t.clip(),a(t,ia(r,-e,o)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,ia(r,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return na(this,t,e,i)}inXRange(t,e){return na(this,t,null,e)}inYRange(t,e){return na(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+s)/2:e,y:r?i:(i+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}E(wr,"id","bar"),E(wr,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),E(wr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var lb=Object.freeze({__proto__:null,ArcElement:us,BarElement:wr,LineElement:Mn,PointElement:xr});const sa=["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)"],Yu=sa.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function ju(n){return sa[n%sa.length]}function Vu(n){return Yu[n%Yu.length]}function cb(n,t){return n.borderColor=ju(t),n.backgroundColor=Vu(t),++t}function ub(n,t){return n.backgroundColor=n.data.map(()=>ju(t++)),t}function db(n,t){return n.backgroundColor=n.data.map(()=>Vu(t++)),t}function hb(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof en?t=ub(e,t):s instanceof ns?t=db(e,t):s&&(t=cb(e,t))}}function $u(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function fb(n){return n&&(n.borderColor||n.backgroundColor)}function gb(){return At.borderColor!=="rgba(0,0,0,0.1)"||At.backgroundColor!=="rgba(0,0,0,0.1)"}var pb={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:s}=n.config,{elements:r}=s,o=$u(i)||fb(s)||r&&$u(r)||gb();if(!e.forceOverride&&o)return;const a=hb(n);i.forEach(a)}};function mb(n,t,e,i,s){const r=s.samples||i;if(r>=e)return n.slice(t,t+e);const o=[],a=(e-2)/(r-2);let l=0;const c=t+e-1;let u=t,d,f,g,p,y;for(o[l++]=n[u],d=0;d<r-2;d++){let x=0,v=0,M;const D=Math.floor((d+1)*a)+1+t,S=Math.min(Math.floor((d+2)*a)+1,e)+t,C=S-D;for(M=D;M<S;M++)x+=n[M].x,v+=n[M].y;x/=C,v/=C;const R=Math.floor(d*a)+1+t,O=Math.min(Math.floor((d+1)*a)+1,e)+t,{x:b,y:_}=n[u];for(g=p=-1,M=R;M<O;M++)p=.5*Math.abs((b-x)*(n[M].y-_)-(b-n[M].x)*(v-_)),p>g&&(g=p,f=n[M],y=M);o[l++]=f,u=y}return o[l++]=n[c],o}function yb(n,t,e,i){let s=0,r=0,o,a,l,c,u,d,f,g,p,y;const x=[],v=t+e-1,M=n[t].x,S=n[v].x-M;for(o=t;o<t+e;++o){a=n[o],l=(a.x-M)/S*i,c=a.y;const C=l|0;if(C===u)c<p?(p=c,d=o):c>y&&(y=c,f=o),s=(r*s+a.x)/++r;else{const R=o-1;if(!st(d)&&!st(f)){const O=Math.min(d,f),b=Math.max(d,f);O!==g&&O!==R&&x.push({...n[O],x:s}),b!==g&&b!==R&&x.push({...n[b],x:s})}o>0&&R!==g&&x.push(n[R]),x.push(a),u=C,r=0,p=y=c,d=f=g=o}}return x}function Uu(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=>{Uu(t)})}function bb(n,t){const e=t.length;let i=0,s;const{iScale:r}=n,{min:o,max:a,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=Qt(Qe(t,r.axis,o).lo,0,e-1)),c?s=Qt(Qe(t,r.axis,a).hi+1,i,e)-i:s=e-i,{start:i,count:s}}var _b={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){Xu(n);return}const i=n.width;n.data.datasets.forEach((s,r)=>{const{_data:o,indexAxis:a}=s,l=n.getDatasetMeta(r),c=o||s.data;if(Qi([a,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}=bb(l,c);const g=e.threshold||4*i;if(f<=g){Uu(s);return}st(o)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(y){this._data=y}}));let p;switch(e.algorithm){case"lttb":p=mb(c,d,f,i,e);break;case"min-max":p=yb(c,d,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=p})},destroy(n){Xu(n)}};function xb(n,t,e){const i=n.segments,s=n.points,r=t.points,o=[];for(const a of i){let{start:l,end:c}=a;c=vr(l,c,s);const u=ra(e,s[l],s[c],a.loop);if(!t.segments){o.push({source:a,target:u,start:s[l],end:s[c]});continue}const d=qc(t,u);for(const f of d){const g=ra(e,r[f.start],r[f.end],f.loop),p=Xc(a,s,g);for(const y of p)o.push({source:y,target:f,start:{[e]:qu(u,g,"start",Math.max)},end:{[e]:qu(u,g,"end",Math.min)}})}}return o}function ra(n,t,e,i){if(i)return;let s=t[n],r=e[n];return n==="angle"&&(s=se(s),r=se(r)),{property:n,start:s,end:r}}function wb(n,t){const{x:e=null,y:i=null}=n||{},s=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=vr(o,a,s);const l=s[o],c=s[a];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):e!==null&&(r.push({x:e,y:l.y}),r.push({x:e,y:c.y}))}),r}function vr(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function qu(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function Gu(n,t){let e=[],i=!1;return kt(n)?(i=!0,e=n):e=wb(n,t),e.length?new Mn({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function Ku(n){return n&&n.fill!==!1}function vb(n,t,e){let s=n[t].fill;const r=[t];let o;if(!e)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!Rt(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;r.push(s),s=o.fill}return!1}function Mb(n,t,e){const i=Tb(n);if(ht(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Rt(s)&&Math.floor(s)===s?kb(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function kb(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function Db(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:ht(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Sb(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:ht(n)?i=n.value:i=t.getBaseValue(),i}function Tb(n){const t=n.options,e=t.fill;let i=rt(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function Cb(n){const{scale:t,index:e,line:i}=n,s=[],r=i.segments,o=i.points,a=Pb(t,e);a.push(Gu({x:null,y:t.bottom},i));for(let l=0;l<r.length;l++){const c=r[l];for(let u=c.start;u<=c.end;u++)Ob(s,o[u],a)}return new Mn({points:s,options:{}})}function Pb(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const r=i[s];if(r.index===t)break;r.hidden||e.unshift(r.dataset)}return e}function Ob(n,t,e){const i=[];for(let s=0;s<e.length;s++){const r=e[s],{first:o,last:a,point:l}=Eb(r,t,"x");if(!(!l||o&&a)){if(o)i.unshift(l);else if(n.push(l),!a)break}}n.push(...i)}function Eb(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const s=i[e],r=n.segments,o=n.points;let a=!1,l=!1;for(let c=0;c<r.length;c++){const u=r[c],d=o[u.start][e],f=o[u.end][e];if(Ze(s,d,f)){a=s===d,l=s===f;break}}return{first:a,last:l,point:i}}class Zu{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:r,radius:o}=this;return e=e||{start:0,end:Ot},t.arc(s,r,o,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,r=t.angle;return{x:e+Math.cos(r)*s,y:i+Math.sin(r)*s,angle:r}}}function Ab(n){const{chart:t,fill:e,line:i}=n;if(Rt(e))return Rb(t,e);if(e==="stack")return Cb(n);if(e==="shape")return!0;const s=Ib(n);return s instanceof Zu?s:Gu(s,i)}function Rb(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function Ib(n){return(n.scale||{}).getPointPositionForValue?Nb(n):Lb(n)}function Lb(n){const{scale:t={},fill:e}=n,i=Db(e,t);if(Rt(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function Nb(n){const{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,r=i.reverse?t.max:t.min,o=Sb(e,t,r),a=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,r);return new Zu({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(o)})}for(let l=0;l<s;++l)a.push(t.getPointPositionForValue(l,o));return a}function oa(n,t,e){const i=Ab(t),{chart:s,index:r,line:o,scale:a,axis:l}=t,c=o.options,u=c.fill,d=c.backgroundColor,{above:f=d,below:g=d}=u||{},p=s.getDatasetMeta(r),y=Zc(s,p);i&&o.points.length&&(Ki(n,e),Fb(n,{line:o,target:i,above:f,below:g,area:e,scale:a,axis:l,clip:y}),Zi(n))}function Fb(n,t){const{line:e,target:i,above:s,below:r,area:o,scale:a,clip:l}=t,c=e._loop?"angle":t.axis;n.save();let u=r;r!==s&&(c==="x"?(Qu(n,i,o.top),aa(n,{line:e,target:i,color:s,scale:a,property:c,clip:l}),n.restore(),n.save(),Qu(n,i,o.bottom)):c==="y"&&(Ju(n,i,o.left),aa(n,{line:e,target:i,color:r,scale:a,property:c,clip:l}),n.restore(),n.save(),Ju(n,i,o.right),u=s)),aa(n,{line:e,target:i,color:u,scale:a,property:c,clip:l}),n.restore()}function Qu(n,t,e){const{segments:i,points:s}=t;let r=!0,o=!1;n.beginPath();for(const a of i){const{start:l,end:c}=a,u=s[l],d=s[vr(l,c,s)];r?(n.moveTo(u.x,u.y),r=!1):(n.lineTo(u.x,e),n.lineTo(u.x,u.y)),o=!!t.pathSegment(n,a,{move:o}),o?n.closePath():n.lineTo(d.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function Ju(n,t,e){const{segments:i,points:s}=t;let r=!0,o=!1;n.beginPath();for(const a of i){const{start:l,end:c}=a,u=s[l],d=s[vr(l,c,s)];r?(n.moveTo(u.x,u.y),r=!1):(n.lineTo(e,u.y),n.lineTo(u.x,u.y)),o=!!t.pathSegment(n,a,{move:o}),o?n.closePath():n.lineTo(e,d.y)}n.lineTo(e,t.first().y),n.closePath(),n.clip()}function aa(n,t){const{line:e,target:i,property:s,color:r,scale:o,clip:a}=t,l=xb(e,i,s);for(const{source:c,target:u,start:d,end:f}of l){const{style:{backgroundColor:g=r}={}}=c,p=i!==!0;n.save(),n.fillStyle=g,zb(n,o,a,p&&ra(s,d,f)),n.beginPath();const y=!!e.pathSegment(n,c);let x;if(p){y?n.closePath():td(n,i,f,s);const v=!!i.pathSegment(n,u,{move:y,reverse:!0});x=y&&v,x||td(n,i,d,s)}n.closePath(),n.fill(x?"evenodd":"nonzero"),n.restore()}}function zb(n,t,e,i){const s=t.chart.chartArea,{property:r,start:o,end:a}=i||{};if(r==="x"||r==="y"){let l,c,u,d;r==="x"?(l=o,c=s.top,u=a,d=s.bottom):(l=s.left,c=o,u=s.right,d=a),n.beginPath(),e&&(l=Math.max(l,e.left),u=Math.min(u,e.right),c=Math.max(c,e.top),d=Math.min(d,e.bottom)),n.rect(l,c,u-l,d-c),n.clip()}}function td(n,t,e,i){const s=t.interpolate(e,i);s&&n.lineTo(s.x,s.y)}var Bb={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,s=[];let r,o,a,l;for(o=0;o<i;++o)r=n.getDatasetMeta(o),a=r.dataset,l=null,a&&a.options&&a instanceof Mn&&(l={visible:n.isDatasetVisible(o),index:o,fill:Mb(a,o,i),chart:n,axis:r.controller.options.indexAxis,scale:r.vScale,line:a}),r.$filler=l,s.push(l);for(o=0;o<i;++o)l=s[o],!(!l||l.fill===!1)&&(l.fill=vb(s,o,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",s=n.getSortedVisibleDatasetMetas(),r=n.chartArea;for(let o=s.length-1;o>=0;--o){const a=s[o].$filler;a&&(a.line.updateControlPoints(r,a.axis),i&&a.fill&&oa(n.ctx,a,r))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const r=i[s].$filler;Ku(r)&&oa(n.ctx,r,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!Ku(i)||e.drawTime!=="beforeDatasetDraw"||oa(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const ed=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},Hb=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class nd extends Jt{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,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,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=Dt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,s)=>t.sort(i,s,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 i=t.labels,s=It(i.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=ed(i,r);let c,u;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,r,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a;let d=t;r.textAlign="left",r.textBaseline="middle";let f=-1,g=-u;return this.legendItems.forEach((p,y)=>{const x=i+e/2+r.measureText(p.text).width;(y===0||c[c.length-1]+x+2*a>o)&&(d+=u,c[c.length-(y>0?0:1)]=0,g+=u,f++),l[y]={left:0,top:g,row:f,width:x,height:s},c[c.length-1]+=x+a}),d}_fitCols(t,e,i,s){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-t;let d=a,f=0,g=0,p=0,y=0;return this.legendItems.forEach((x,v)=>{const{itemWidth:M,itemHeight:D}=Wb(i,e,r,x,s);v>0&&g+D+2*a>u&&(d+=f+a,c.push({width:f,height:g}),p+=f+a,y++,f=g=0),l[v]={left:p,top:g,col:y,width:M,height:D},f=Math.max(f,M),g+=D+a}),d+=f,c.push({width:f,height:g}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:r}}=this,o=gi(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=re(i,this.left+s,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=re(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+s}else{let a=0,l=re(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=re(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Ki(t,this),this._draw(),Zi(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:r,labels:o}=t,a=At.color,l=gi(t.rtl,this.left,this.width),c=It(o.font),{padding:u}=o,d=c.size,f=d/2;let g;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:p,boxHeight:y,itemHeight:x}=ed(o,d),v=function(R,O,b){if(isNaN(p)||p<=0||isNaN(y)||y<0)return;s.save();const _=rt(b.lineWidth,1);if(s.fillStyle=rt(b.fillStyle,a),s.lineCap=rt(b.lineCap,"butt"),s.lineDashOffset=rt(b.lineDashOffset,0),s.lineJoin=rt(b.lineJoin,"miter"),s.lineWidth=_,s.strokeStyle=rt(b.strokeStyle,a),s.setLineDash(rt(b.lineDash,[])),o.usePointStyle){const T={radius:y*Math.SQRT2/2,pointStyle:b.pointStyle,rotation:b.rotation,borderWidth:_},I=l.xPlus(R,p/2),P=O+f;Ec(s,T,I,P,o.pointStyleWidth&&p)}else{const T=O+Math.max((d-y)/2,0),I=l.leftForLtr(R,p),P=xn(b.borderRadius);s.beginPath(),Object.values(P).some(F=>F!==0)?di(s,{x:I,y:T,w:p,h:y,radius:P}):s.rect(I,T,p,y),s.fill(),_!==0&&s.stroke()}s.restore()},M=function(R,O,b){Bn(s,b.text,R,O+x/2,c,{strikethrough:b.hidden,textAlign:l.textAlign(b.textAlign)})},D=this.isHorizontal(),S=this._computeTitleHeight();D?g={x:re(r,this.left+u,this.right-i[0]),y:this.top+u+S,line:0}:g={x:this.left+u,y:re(r,this.top+S+u,this.bottom-e[0].height),line:0},jc(this.ctx,t.textDirection);const C=x+u;this.legendItems.forEach((R,O)=>{s.strokeStyle=R.fontColor,s.fillStyle=R.fontColor;const b=s.measureText(R.text).width,_=l.textAlign(R.textAlign||(R.textAlign=o.textAlign)),T=p+f+b;let I=g.x,P=g.y;l.setWidth(this.width),D?O>0&&I+T+u>this.right&&(P=g.y+=C,g.line++,I=g.x=re(r,this.left+u,this.right-i[g.line])):O>0&&P+C>this.bottom&&(I=g.x=I+e[g.line].width+u,g.line++,P=g.y=re(r,this.top+S+u,this.bottom-e[g.line].height));const F=l.x(I);if(v(F,P,R),I=lp(_,I+p+f,D?I+T:this.right,t.rtl),M(l.x(I),P,R),D)g.x+=T+u;else if(typeof R.text!="string"){const U=c.lineHeight;g.y+=id(R,U)+u}else g.y+=C}),Vc(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=It(e.font),s=Ut(e.padding);if(!e.display)return;const r=gi(t.rtl,this.left,this.width),o=this.ctx,a=e.position,l=i.size/2,c=s.top+l;let u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=re(t.align,d,this.right-f);else{const p=this.columnSizes.reduce((y,x)=>Math.max(y,x.height),0);u=c+re(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const g=re(a,d,d+f);o.textAlign=r.textAlign(Oo(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,Bn(o,e.text,g,u,i)}_computeTitleHeight(){const t=this.options.title,e=It(t.font),i=Ut(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,r;if(Ze(t,this.left,this.right)&&Ze(e,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(s=r[i],Ze(t,s.left,s.left+s.width)&&Ze(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!Vb(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,r=Hb(s,i);s&&!r&&Dt(e.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!r&&Dt(e.onHover,[t,i,this],this)}else i&&Dt(e.onClick,[t,i,this],this)}}function Wb(n,t,e,i,s){const r=Yb(i,n,t,e),o=jb(s,i,t.lineHeight);return{itemWidth:r,itemHeight:o}}function Yb(n,t,e,i){let s=n.text;return s&&typeof s!="string"&&(s=s.reduce((r,o)=>r.length>o.length?r:o)),t+e.size/2+i.measureText(s).width}function jb(n,t,e){let i=n;return typeof t.text!="string"&&(i=id(t,e)),i}function id(n,t){const e=n.text?n.text.length:0;return t*e}function Vb(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var $b={id:"legend",_element:nd,start(n,t,e){const i=n.legend=new nd({ctx:n.ctx,options:e,chart:n});oe.configure(n,i,e),oe.addBox(n,i)},stop(n){oe.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;oe.configure(n,i,e),i.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 i=t.datasetIndex,s=e.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),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:i,textAlign:s,color:r,useBorderRadius:o,borderRadius:a}}=n.legend.options;return n._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),u=Ut(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:r,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:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:o&&(a||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 la extends Jt{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 i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=kt(i.text)?i.text.length:1;this._padding=Ut(i.padding);const r=s*It(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:s,right:r,options:o}=this,a=o.align;let l=0,c,u,d;return this.isHorizontal()?(u=re(a,i,r),d=e+t,c=r-i):(o.position==="left"?(u=i+t,d=re(a,s,e),l=ct*-.5):(u=r-t,d=re(a,e,s),l=ct*.5),c=s-e),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=It(e.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);Bn(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:Oo(e.align),textBaseline:"middle",translation:[o,a]})}}function Ub(n,t){const e=new la({ctx:n.ctx,options:t,chart:n});oe.configure(n,e,t),oe.addBox(n,e),n.titleBlock=e}var Xb={id:"title",_element:la,start(n,t,e){Ub(n,e)},stop(n){const t=n.titleBlock;oe.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;oe.configure(n,i,e),i.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 Mr=new WeakMap;var qb={id:"subtitle",start(n,t,e){const i=new la({ctx:n.ctx,options:e,chart:n});oe.configure(n,i,e),oe.addBox(n,i),Mr.set(n,i)},stop(n){oe.removeBox(n,Mr.get(n)),Mr.delete(n)},beforeUpdate(n,t,e){const i=Mr.get(n);oe.configure(n,i,e),i.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 ds={average(n){if(!n.length)return!1;let t,e,i=new Set,s=0,r=0;for(t=0,e=n.length;t<e;++t){const a=n[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();i.add(l.x),s+=l.y,++r}}return r===0||i.size===0?!1:{x:[...i].reduce((a,l)=>a+l)/i.size,y:s/r}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,s=Number.POSITIVE_INFINITY,r,o,a;for(r=0,o=n.length;r<o;++r){const l=n[r].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=ui(t,c);u<s&&(s=u,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function Ye(n,t){return t&&(kt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function nn(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
|
16
|
+
*/class cm{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const r=e.listeners[s],o=e.duration;r.forEach(a=>a({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=wc.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const r=i.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),r.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=r.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}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((i,s)=>Math.max(i,s._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 i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var tn=new cm;const Qc="transparent",um={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=Tc(n||Qc),s=i.valid&&Tc(t||Qc);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class dm{constructor(t,e,i,s){const r=e[i];s=Qi([t.to,s,r,t.from]);const o=Qi([t.from,r,s]);this._active=!0,this._fn=t.fn||um[t.type||typeof o],this._easing=Xi[t.easing]||Xi.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=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Qi([t.to,e,s,t.from]),this._from=Qi([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||e<i),!this._active){this._target[s]=a,this._notify(!0);return}if(e<0){this._target[s]=r;return}l=e/i%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][e]()}}class Yo{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!ht(t))return;const e=Object.keys(At.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const r=t[s];if(!ht(r))return;const o={};for(const a of e)o[a]=r[a];(kt(r.properties)&&r.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,o)})})}_animateOptions(t,e){const i=e.options,s=fm(t,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&hm(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,e){const i=this._properties,s=[],r=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const u=e[c];let d=r[c];const f=i.get(c);if(d)if(f&&d.active()){d.update(f,u,a);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}r[c]=d=new dm(f,t,c,u),s.push(d)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return tn.add(this._chart,i),!0}}function hm(n,t){const e=[],i=Object.keys(t);for(let s=0;s<i.length;s++){const r=n[i[s]];r&&r.active()&&e.push(r.wait())}return Promise.all(e)}function fm(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||{},i=e.reverse,s=e.min===void 0?t:0,r=e.max===void 0?t:0;return{start:i?r:s,end:i?s:r}}function gm(n,t,e){if(e===!1)return!1;const i=Jc(n,e),s=Jc(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function pm(n){let t,e,i,s;return ht(n)?(t=n.top,e=n.right,i=n.bottom,s=n.left):t=e=i=s=n,{top:t,right:e,bottom:i,left:s,disabled:n===!1}}function tu(n,t){const e=[],i=n._getSortedDatasetMetas(t);let s,r;for(s=0,r=i.length;s<r;++s)e.push(i[s].index);return e}function eu(n,t,e,i={}){const s=n.keys,r=i.mode==="single";let o,a,l,c;if(t===null)return;let u=!1;for(o=0,a=s.length;o<a;++o){if(l=+s[o],l===e){if(u=!0,i.all)continue;break}c=n.values[l],Rt(c)&&(r||t===0||He(t)===He(c))&&(t+=c)}return!u&&!i.all?0:t}function mm(n,t){const{iScale:e,vScale:i}=t,s=e.axis==="x"?"x":"y",r=i.axis==="x"?"x":"y",o=Object.keys(n),a=new Array(o.length);let l,c,u;for(l=0,c=o.length;l<c;++l)u=o[l],a[l]={[s]:u,[r]:n[u]};return a}function jo(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function ym(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function bm(n){const{min:t,max:e,minDefined:i,maxDefined:s}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function _m(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function nu(n,t,e,i){for(const s of t.getMatchingVisibleMetas(i).reverse()){const r=n[s.index];if(e&&r>0||!e&&r<0)return s.index}return null}function iu(n,t){const{chart:e,_cachedMeta:i}=n,s=e._stacks||(e._stacks={}),{iScale:r,vScale:o,index:a}=i,l=r.axis,c=o.axis,u=ym(r,o,i),d=t.length;let f;for(let g=0;g<d;++g){const p=t[g],{[l]:y,[c]:x}=p,v=p._stacks||(p._stacks={});f=v[c]=_m(s,u,y),f[a]=x,f._top=nu(f,o,!0,i.type),f._bottom=nu(f,o,!1,i.type);const M=f._visualValues||(f._visualValues={});M[a]=x}}function Vo(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function xm(n,t){return wn(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function wm(n,t,e){return wn(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Ji(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const s of t){const r=s._stacks;if(!r||r[i]===void 0||r[i][e]===void 0)return;delete r[i][e],r[i]._visualValues!==void 0&&r[i]._visualValues[e]!==void 0&&delete r[i]._visualValues[e]}}}const $o=n=>n==="reset"||n==="none",su=(n,t)=>t?n:Object.assign({},n),vm=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:tu(e,!0),values:null};class Ie{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=jo(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&&Ji(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(d,f,g,p)=>d==="x"?f:d==="r"?p:g,r=e.xAxisID=rt(i.xAxisID,Vo(t,"x")),o=e.yAxisID=rt(i.yAxisID,Vo(t,"y")),a=e.rAxisID=rt(i.rAxisID,Vo(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,r,o,a),u=e.vAxisID=s(l,o,r,a);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),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&&_c(this._data,this),t._stacked&&Ji(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(ht(e)){const s=this._cachedMeta;this._data=mm(e,s)}else if(i!==e){if(i){_c(i,this);const s=this._cachedMeta;Ji(s),s._parsed=[]}e&&Object.isExtensible(e)&&op(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,i=this.getDataset();let s=!1;this._dataCheck();const r=e._stacked;e._stacked=jo(e.vScale,e),e.stack!==i.stack&&(s=!0,Ji(e),e.stack=i.stack),this._resyncElements(t),(s||r!==e._stacked)&&(iu(this,e._parsed),e._stacked=jo(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:r,_stacked:o}=i,a=r.axis;let l=t===0&&e===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,d,f;if(this._parsing===!1)i._parsed=s,i._sorted=!0,f=s;else{kt(s[t])?f=this.parseArrayData(i,s,t,e):ht(s[t])?f=this.parseObjectData(i,s,t,e):f=this.parsePrimitiveData(i,s,t,e);const g=()=>d[a]===null||c&&d[a]<c[a];for(u=0;u<e;++u)i._parsed[u+t]=d=f[u],l&&(g()&&(l=!1),c=d);i._sorted=l}o&&iu(this,f)}parsePrimitiveData(t,e,i,s){const{iScale:r,vScale:o}=t,a=r.axis,l=o.axis,c=r.getLabels(),u=r===o,d=new Array(s);let f,g,p;for(f=0,g=s;f<g;++f)p=f+i,d[f]={[a]:u||r.parse(c[p],p),[l]:o.parse(e[p],p)};return d}parseArrayData(t,e,i,s){const{xScale:r,yScale:o}=t,a=new Array(s);let l,c,u,d;for(l=0,c=s;l<c;++l)u=l+i,d=e[u],a[l]={x:r.parse(d[0],u),y:o.parse(d[1],u)};return a}parseObjectData(t,e,i,s){const{xScale:r,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let u,d,f,g;for(u=0,d=s;u<d;++u)f=u+i,g=e[f],c[u]={x:r.parse(yn(g,a),f),y:o.parse(yn(g,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,r=this._cachedMeta,o=e[t.axis],a={keys:tu(s,!0),values:e._stacks[t.axis]._visualValues};return eu(a,o,r.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const r=i[e.axis];let o=r===null?NaN:r;const a=s&&i._stacks[e.axis];s&&a&&(s.values=a,o=eu(s,r,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,r=i._sorted&&t===i.iScale,o=s.length,a=this._getOtherScale(t),l=vm(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=bm(a);let f,g;function p(){g=s[f];const y=g[a.axis];return!Rt(g[t.axis])||u>y||d<y}for(f=0;f<o&&!(!p()&&(this.updateRangeFromParsed(c,t,g,l),r));++f);if(r){for(f=o-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(c,t,g,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,r,o;for(s=0,r=e.length;s<r;++s)o=e[s][t.axis],Rt(o)&&i.push(o);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,r=this.getParsed(t);return{label:i?""+i.getLabelForValue(r[i.axis]):"",value:s?""+s.getLabelForValue(r[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=pm(rt(this.options.clip,gm(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],r=e.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(t,r,a,l),u=a;u<a+l;++u){const d=s[u];d.hidden||(d.active&&c?o.push(d):d.draw(t,r))}for(u=0;u<o.length;++u)o[u].draw(t,r)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let r;if(t>=0&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];r=o.$context||(o.$context=wm(this.getContext(),t,o)),r.parsed=this.getParsed(t),r.raw=s.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=xm(this.chart.getContext(),this.index)),r.dataset=s,r.index=r.datasetIndex=this.index;return r.active=!!e,r.mode=i,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s=e==="active",r=this._cachedDataOpts,o=t+"-"+e,a=r[o],l=this.enableOptionSharing&&ge(i);if(a)return su(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=s?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),g=Object.keys(At.elements[t]),p=()=>this.getContext(i,s,e),y=c.resolveNamedOptions(f,g,p,d);return y.$shared&&(y.$shared=l,r[o]=Object.freeze(su(y,l))),y}_resolveAnimations(t,e,i){const s=this.chart,r=this._cachedDataOpts,o=`animation-${e}`,a=r[o];if(a)return a;let l;if(s.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,i,e))}const c=new Yo(s,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||$o(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,r=this.getSharedOptions(i),o=this.includeOptions(e,r)||r!==s;return this.updateSharedOptions(r,e,i),{sharedOptions:r,includeOptions:o}}updateElement(t,e,i,s){$o(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!$o(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const r=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"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,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=i.length,r=e.length,o=Math.min(r,s);o&&this.parse(0,o),r>s?this._insertElements(s,r-s,t):r<s&&this._removeElements(r,s-r)}_insertElements(t,e,i=!0){const s=this._cachedMeta,r=s.data,o=t+e;let a;const l=c=>{for(c.length+=e,a=c.length-1;a>=o;a--)c[a]=c[a-e]};for(l(r),a=t;a<o;++a)r[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),i&&this.updateElements(r,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&Ji(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}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 i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}E(Ie,"defaults",{}),E(Ie,"datasetElementType",null),E(Ie,"dataElementType",null);function Mm(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let s=0,r=e.length;s<r;s++)i=i.concat(e[s].controller.getAllParsedValues(n));n._cache.$bar=xc(i.sort((s,r)=>s-r))}return n._cache.$bar}function km(n){const t=n.iScale,e=Mm(t,n.type);let i=t._length,s,r,o,a;const l=()=>{o===32767||o===-32768||(ge(a)&&(i=Math.min(i,Math.abs(o-a)||i)),a=o)};for(s=0,r=e.length;s<r;++s)o=t.getPixelForValue(e[s]),l();for(a=void 0,s=0,r=t.ticks.length;s<r;++s)o=t.getPixelForTick(s),l();return i}function Dm(n,t,e,i){const s=e.barThickness;let r,o;return st(s)?(r=t.min*e.categoryPercentage,o=e.barPercentage):(r=s*i,o=1),{chunk:r/i,ratio:o,start:t.pixels[n]-r/2}}function Sm(n,t,e,i){const s=t.pixels,r=s[n];let o=n>0?s[n-1]:null,a=n<s.length-1?s[n+1]:null;const l=e.categoryPercentage;o===null&&(o=r-(a===null?t.end-t.start:a-r)),a===null&&(a=r+r-o);const c=r-(r-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/i,ratio:e.barPercentage,start:c}}function Tm(n,t,e,i){const s=e.parse(n[0],i),r=e.parse(n[1],i),o=Math.min(s,r),a=Math.max(s,r);let l=o,c=a;Math.abs(o)>Math.abs(a)&&(l=a,c=o),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}function ru(n,t,e,i){return kt(n)?Tm(n,t,e,i):t[e.axis]=e.parse(n,i),t}function ou(n,t,e,i){const s=n.iScale,r=n.vScale,o=s.getLabels(),a=s===r,l=[];let c,u,d,f;for(c=e,u=e+i;c<u;++c)f=t[c],d={},d[s.axis]=a||s.parse(o[c],c),l.push(ru(f,d,r,c));return l}function Uo(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function Cm(n,t,e){return n!==0?He(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Pm(n){let t,e,i,s,r;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(s="end",r="start"):(s="start",r="end"),{start:e,end:i,reverse:t,top:s,bottom:r}}function Om(n,t,e,i){let s=t.borderSkipped;const r={};if(!s){n.borderSkipped=r;return}if(s===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:a,reverse:l,top:c,bottom:u}=Pm(n);s==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=c:(e._bottom||0)===i?s=u:(r[au(u,o,a,l)]=!0,s=c)),r[au(s,o,a,l)]=!0,n.borderSkipped=r}function au(n,t,e,i){return i?(n=Em(n,t,e),n=lu(n,e,t)):n=lu(n,t,e),n}function Em(n,t,e){return n===t?e:n===e?t:n}function lu(n,t,e){return n==="start"?t:n==="end"?e:n}function Am(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class ts extends Ie{parsePrimitiveData(t,e,i,s){return ou(t,e,i,s)}parseArrayData(t,e,i,s){return ou(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:r,vScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=r.axis==="x"?a:l,u=o.axis==="x"?a:l,d=[];let f,g,p,y;for(f=i,g=i+s;f<g;++f)y=e[f],p={},p[r.axis]=r.parse(yn(y,c),f),d.push(ru(yn(y,u),p,o,f));return d}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const r=i._custom;r&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:s}=e,r=this.getParsed(t),o=r._custom,a=Uo(o)?"["+o.start+", "+o.end+"]":""+s.getLabelForValue(r[s.axis]);return{label:""+i.getLabelForValue(r[i.axis]),value:a}}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,i,s){const r=s==="reset",{index:o,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:f}=this._getSharedOptions(e,s);for(let g=e;g<e+i;g++){const p=this.getParsed(g),y=r||st(p[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(g),x=this._calculateBarIndexPixels(g,u),v=(p._stacks||{})[a.axis],M={horizontal:c,base:y.base,enableBorderRadius:!v||Uo(p._custom)||o===v._top||o===v._bottom,x:c?y.head:x.center,y:c?x.center:y.head,height:c?x.size:Math.abs(y.size),width:c?Math.abs(y.size):x.size};f&&(M.options=d||this.resolveDataElementOptions(g,t[g].active?"active":s));const D=M.options||t[g].options;Om(M,D,v,o),Am(M,D,u.ratio),this.updateElement(t[g],g,M,s)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),r=i.options.stacked,o=[],a=this._cachedMeta.controller.getParsed(e),l=a&&a[i.axis],c=u=>{const d=u._parsed.find(g=>g[i.axis]===l),f=d&&d[u.vScale.axis];if(st(f)||isNaN(f))return!0};for(const u of s)if(!(e!==void 0&&c(u))&&((r===!1||o.indexOf(u.stack)===-1||r===void 0&&u.stack===void 0)&&o.push(u.stack),u.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[rt(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){const s=this._getStacks(t,i),r=e!==void 0?s.indexOf(e):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let r,o;for(r=0,o=e.data.length;r<o;++r)s.push(i.getPixelForValue(this.getParsed(r)[i.axis],r));const a=t.barThickness;return{min:a||km(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:s},options:{base:r,minBarLength:o}}=this,a=r||0,l=this.getParsed(t),c=l._custom,u=Uo(c);let d=l[e.axis],f=0,g=i?this.applyStack(e,l,i):d,p,y;g!==d&&(f=g-d,g=d),u&&(d=c.barStart,g=c.barEnd-c.barStart,d!==0&&He(d)!==He(c.barEnd)&&(f=0),f+=d);const x=!st(r)&&!u?r:f;let v=e.getPixelForValue(x);if(this.chart.getDataVisibility(t)?p=e.getPixelForValue(f+g):p=v,y=p-v,Math.abs(y)<o){y=Cm(y,e,a)*o,d===a&&(v-=y/2);const M=e.getPixelForDecimal(0),D=e.getPixelForDecimal(1),S=Math.min(M,D),P=Math.max(M,D);v=Math.max(Math.min(v,P),S),p=v+y,i&&!u&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(p)-e.getValueForPixel(v))}if(v===e.getPixelForValue(a)){const M=He(y)*e.getLineWidthForValue(a)/2;v+=M,y-=M}return{size:y,base:v,head:p,center:p+y/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,r=s.skipNull,o=rt(s.maxBarThickness,1/0);let a,l;const c=this._getAxisCount();if(e.grouped){const u=r?this._getStackCount(t):e.stackCount,d=s.barThickness==="flex"?Sm(t,e,s,u*c):Dm(t,e,s,u*c),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,g=this._getAxis().indexOf(rt(f,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0)+g;a=d.start+d.chunk*p+d.chunk/2,l=Math.min(o,d.chunk*d.ratio)}else a=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(o,e.min*e.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let r=0;for(;r<s;++r)this.getParsed(r)[e.axis]!==null&&!i[r].hidden&&i[r].draw(this._ctx)}}E(ts,"id","bar"),E(ts,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),E(ts,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class cr extends Ie{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){const r=super.parsePrimitiveData(t,e,i,s);for(let o=0;o<r.length;o++)r[o]._custom=this.resolveDataElementOptions(o+i).radius;return r}parseArrayData(t,e,i,s){const r=super.parseArrayData(t,e,i,s);for(let o=0;o<r.length;o++){const a=e[i+o];r[o]._custom=rt(a[2],this.resolveDataElementOptions(o+i).radius)}return r}parseObjectData(t,e,i,s){const r=super.parseObjectData(t,e,i,s);for(let o=0;o<r.length;o++){const a=e[i+o];r[o]._custom=rt(a&&a.r&&+a.r,this.resolveDataElementOptions(o+i).radius)}return r}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=e,o=this.getParsed(t),a=s.getLabelForValue(o.x),l=r.getLabelForValue(o.y),c=o._custom;return{label:i[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const r=s==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),u=o.axis,d=a.axis;for(let f=e;f<e+i;f++){const g=t[f],p=!r&&this.getParsed(f),y={},x=y[u]=r?o.getPixelForDecimal(.5):o.getPixelForValue(p[u]),v=y[d]=r?a.getBasePixel():a.getPixelForValue(p[d]);y.skip=isNaN(x)||isNaN(v),c&&(y.options=l||this.resolveDataElementOptions(f,g.active?"active":s),r&&(y.options.radius=0)),this.updateElement(g,f,y,s)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const r=s.radius;return e!=="active"&&(s.radius=0),s.radius+=rt(i&&i._custom,r),s}}E(cr,"id","bubble"),E(cr,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),E(cr,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Rm(n,t,e){let i=1,s=1,r=0,o=0;if(t<Ot){const a=n,l=a+t,c=Math.cos(a),u=Math.sin(a),d=Math.cos(l),f=Math.sin(l),g=(D,S,P)=>Ui(D,a,l,!0)?1:Math.max(S,S*e,P,P*e),p=(D,S,P)=>Ui(D,a,l,!0)?-1:Math.min(S,S*e,P,P*e),y=g(0,c,d),x=g(Et,u,f),v=p(ct,c,d),M=p(ct+Et,u,f);i=(y-v)/2,s=(x-M)/2,r=-(y+v)/2,o=-(x+M)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:o}}class en extends Ie{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 i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let r=l=>+i[l];if(ht(i[t])){const{key:l="value"}=this._parsing;r=c=>+yn(i[c],l)}let o,a;for(o=t,a=t+e;o<a;++o)s._parsed[o]=r(o)}}_getRotation(){return $t(this.options.rotation-90)}_getCircumference(){return $t(this.options.circumference)}_getRotationExtents(){let t=Ot,e=-Ot;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const s=this.chart.getDatasetMeta(i).controller,r=s._getRotation(),o=s._getCircumference();t=Math.min(t,r),e=Math.max(e,r+o)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,r=s.data,o=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-o)/2,0),l=Math.min(Ug(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:g,offsetX:p,offsetY:y}=Rm(d,u,l),x=(i.width-o)/f,v=(i.height-o)/g,M=Math.max(Math.min(x,v)/2,0),D=dc(this.options.radius,M),S=Math.max(D*l,0),P=(D-S)/this._getVisibleDatasetWeightTotal();this.offsetX=p*D,this.offsetY=y*D,s.total=this.calculateTotal(),this.outerRadius=D-P*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-P*c,0),this.updateElements(r,0,r.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,r=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*r/Ot)}updateElements(t,e,i,s){const r=s==="reset",o=this.chart,a=o.chartArea,c=o.options.animation,u=(a.left+a.right)/2,d=(a.top+a.bottom)/2,f=r&&c.animateScale,g=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:y,includeOptions:x}=this._getSharedOptions(e,s);let v=this._getRotation(),M;for(M=0;M<e;++M)v+=this._circumference(M,r);for(M=e;M<e+i;++M){const D=this._circumference(M,r),S=t[M],P={x:u+this.offsetX,y:d+this.offsetY,startAngle:v,endAngle:v+D,circumference:D,outerRadius:p,innerRadius:g};x&&(P.options=y||this.resolveDataElementOptions(M,S.active?"active":s)),v+=D,this.updateElement(S,M,P,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,s;for(s=0;s<e.length;s++){const r=t._parsed[s];r!==null&&!isNaN(r)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(i+=Math.abs(r))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?Ot*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=qi(e._parsed[t],i.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,r,o,a,l;if(!t){for(s=0,r=i.data.datasets.length;s<r;++s)if(i.isDatasetVisible(s)){o=i.getDatasetMeta(s),t=o.data,a=o.controller;break}}if(!t)return 0;for(s=0,r=t.length;s<r;++s)l=a.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){const r=this.resolveDataElementOptions(i);e=Math.max(e,r.offset||0,r.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));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}}E(en,"id","doughnut"),E(en,"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"}),E(en,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),E(en,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class es extends Ie{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=e,o=this.chart._animationsDisabled;let{start:a,count:l}=Mc(e,s,o);this._drawStart=a,this._drawCount=l,kc(e)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,e,i,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,s),f=o.axis,g=a.axis,{spanGaps:p,segment:y}=this.options,x=_n(p)?p:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||r||s==="none",M=e+i,D=t.length;let S=e>0&&this.getParsed(e-1);for(let P=0;P<D;++P){const R=t[P],O=v?R:{};if(P<e||P>=M){O.skip=!0;continue}const b=this.getParsed(P),_=st(b[g]),C=O[f]=o.getPixelForValue(b[f],P),I=O[g]=r||_?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,b,l):b[g],P);O.skip=isNaN(C)||isNaN(I)||_,O.stop=P>0&&Math.abs(b[f]-S[f])>x,y&&(O.parsed=b,O.raw=c.data[P]),d&&(O.options=u||this.resolveDataElementOptions(P,R.active?"active":s)),v||this.updateElement(R,P,O,s),S=b}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const r=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}E(es,"id","line"),E(es,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),E(es,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class ns extends Ie{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=qi(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,e,i,s){return Bc.bind(this)(t,e,i,s)}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((i,s)=>{const r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(r<e.min&&(e.min=r),r>e.max&&(e.max=r))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,i,s){const r=s==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,f=c.getIndexAngle(0)-.5*ct;let g=f,p;const y=360/this.countVisibleElements();for(p=0;p<e;++p)g+=this._computeAngle(p,s,y);for(p=e;p<e+i;p++){const x=t[p];let v=g,M=g+this._computeAngle(p,s,y),D=o.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;g=M,r&&(l.animateScale&&(D=0),l.animateRotate&&(v=M=f));const S={x:u,y:d,innerRadius:0,outerRadius:D,startAngle:v,endAngle:M,options:this.resolveDataElementOptions(p,x.active?"active":s)};this.updateElement(x,p,S,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?$t(this.resolveDataElementOptions(t,e).angle||i):0}}E(ns,"id","polarArea"),E(ns,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),E(ns,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Xo extends en{}E(Xo,"id","pie"),E(Xo,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class ur extends Ie{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return Bc.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],r=e.iScale.getLabels();if(i.points=s,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:r.length===s.length,options:o};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const r=this._cachedMeta.rScale,o=s==="reset";for(let a=e;a<e+i;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":s),u=r.getPointPositionForValue(a,this.getParsed(a).r),d=o?r.xCenter:u.x,f=o?r.yCenter:u.y,g={x:d,y:f,angle:u.angle,skip:isNaN(d)||isNaN(f),options:c};this.updateElement(l,a,g,s)}}}E(ur,"id","radar"),E(ur,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),E(ur,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class dr extends Ie{getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=e,o=this.getParsed(t),a=s.getLabelForValue(o.x),l=r.getLabelForValue(o.y);return{label:i[t]||"",value:"("+a+", "+l+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled;let{start:r,count:o}=Mc(e,i,s);if(this._drawStart=r,this._drawCount=o,kc(e)&&(r=0,o=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=e;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,r,o,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(e,s),d=this.getSharedOptions(u),f=this.includeOptions(s,d),g=o.axis,p=a.axis,{spanGaps:y,segment:x}=this.options,v=_n(y)?y:Number.POSITIVE_INFINITY,M=this.chart._animationsDisabled||r||s==="none";let D=e>0&&this.getParsed(e-1);for(let S=e;S<e+i;++S){const P=t[S],R=this.getParsed(S),O=M?P:{},b=st(R[p]),_=O[g]=o.getPixelForValue(R[g],S),C=O[p]=r||b?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,R,l):R[p],S);O.skip=isNaN(_)||isNaN(C)||b,O.stop=S>0&&Math.abs(R[g]-D[g])>v,x&&(O.parsed=R,O.raw=c.data[S]),f&&(O.options=d||this.resolveDataElementOptions(S,P.active?"active":s)),M||this.updateElement(P,S,O,s),D=R}this.updateSharedOptions(d,s,u)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let a=0;for(let l=e.length-1;l>=0;--l)a=Math.max(a,e[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const r=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,r,o)/2}}E(dr,"id","scatter"),E(dr,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),E(dr,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Im=Object.freeze({__proto__:null,BarController:ts,BubbleController:cr,DoughnutController:en,LineController:es,PieController:Xo,PolarAreaController:ns,RadarController:ur,ScatterController:dr});function Yn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class qo{constructor(t){E(this,"options");this.options=t||{}}static override(t){Object.assign(qo.prototype,t)}init(){}formats(){return Yn()}parse(){return Yn()}format(){return Yn()}add(){return Yn()}diff(){return Yn()}startOf(){return Yn()}endOf(){return Yn()}}var cu={_date:qo};function Lm(n,t,e,i){const{controller:s,data:r,_sorted:o}=n,a=s._cachedMeta.iScale,l=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&o&&r.length){const c=a._reversePixels?sp:Qe;if(i){if(s._sharedOptions){const u=r[0],d=typeof u.getRange=="function"&&u.getRange(t);if(d){const f=c(r,t,e-d),g=c(r,t,e+d);return{lo:f.lo,hi:g.hi}}}}else{const u=c(r,t,e);if(l){const{vScale:d}=s._cachedMeta,{_parsed:f}=n,g=f.slice(0,u.lo+1).reverse().findIndex(y=>!st(y[d.axis]));u.lo-=Math.max(0,g);const p=f.slice(u.hi).findIndex(y=>!st(y[d.axis]));u.hi+=Math.max(0,p)}return u}}return{lo:0,hi:r.length-1}}function is(n,t,e,i,s){const r=n.getSortedVisibleDatasetMetas(),o=e[t];for(let a=0,l=r.length;a<l;++a){const{index:c,data:u}=r[a],{lo:d,hi:f}=Lm(r[a],t,o,s);for(let g=d;g<=f;++g){const p=u[g];p.skip||i(p,c,g)}}}function Nm(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,s){const r=t?Math.abs(i.x-s.x):0,o=e?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(o,2))}}function Go(n,t,e,i,s){const r=[];return!s&&!n.isPointInArea(t)||is(n,e,t,function(a,l,c){!s&&!Je(a,n.chartArea,0)||a.inRange(t.x,t.y,i)&&r.push({element:a,datasetIndex:l,index:c})},!0),r}function Fm(n,t,e,i){let s=[];function r(o,a,l){const{startAngle:c,endAngle:u}=o.getProps(["startAngle","endAngle"],i),{angle:d}=tr(o,{x:t.x,y:t.y});Ui(d,c,u)&&s.push({element:o,datasetIndex:a,index:l})}return is(n,e,t,r),s}function zm(n,t,e,i,s,r){let o=[];const a=Nm(e);let l=Number.POSITIVE_INFINITY;function c(u,d,f){const g=u.inRange(t.x,t.y,s);if(i&&!g)return;const p=u.getCenterPoint(s);if(!(!!r||n.isPointInArea(p))&&!g)return;const x=a(t,p);x<l?(o=[{element:u,datasetIndex:d,index:f}],l=x):x===l&&o.push({element:u,datasetIndex:d,index:f})}return is(n,e,t,c),o}function Ko(n,t,e,i,s,r){return!r&&!n.isPointInArea(t)?[]:e==="r"&&!i?Fm(n,t,e,s):zm(n,t,e,i,s,r)}function uu(n,t,e,i,s){const r=[],o=e==="x"?"inXRange":"inYRange";let a=!1;return is(n,e,t,(l,c,u)=>{l[o]&&l[o](t[e],s)&&(r.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:r}var Zo={evaluateInteractionItems:is,modes:{index(n,t,e,i){const s=vn(t,n),r=e.axis||"x",o=e.includeInvisible||!1,a=e.intersect?Go(n,s,r,i,o):Ko(n,s,r,!1,i,o),l=[];return a.length?(n.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(n,t,e,i){const s=vn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;let a=e.intersect?Go(n,s,r,i,o):Ko(n,s,r,!1,i,o);if(a.length>0){const l=a[0].datasetIndex,c=n.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(n,t,e,i){const s=vn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;return Go(n,s,r,i,o)},nearest(n,t,e,i){const s=vn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;return Ko(n,s,r,e.intersect,i,o)},x(n,t,e,i){const s=vn(t,n);return uu(n,s,"x",e.intersect,i)},y(n,t,e,i){const s=vn(t,n);return uu(n,s,"y",e.intersect,i)}}};const du=["left","top","right","bottom"];function ss(n,t){return n.filter(e=>e.pos===t)}function hu(n,t){return n.filter(e=>du.indexOf(e.pos)===-1&&e.box.axis===t)}function rs(n,t){return n.sort((e,i)=>{const s=t?i:e,r=t?e:i;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function Bm(n){const t=[];let e,i,s,r,o,a;for(e=0,i=(n||[]).length;e<i;++e)s=n[e],{position:r,options:{stack:o,stackWeight:a=1}}=s,t.push({index:e,box:s,pos:r,horizontal:s.isHorizontal(),weight:s.weight,stack:o&&r+o,stackWeight:a});return t}function Hm(n){const t={};for(const e of n){const{stack:i,pos:s,stackWeight:r}=e;if(!i||!du.includes(s))continue;const o=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=r}return t}function Wm(n,t){const e=Hm(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let r,o,a;for(r=0,o=n.length;r<o;++r){a=n[r];const{fullSize:l}=a.box,c=e[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*i:l&&t.availableWidth,a.height=s):(a.width=i,a.height=u?u*s:l&&t.availableHeight)}return e}function Ym(n){const t=Bm(n),e=rs(t.filter(c=>c.box.fullSize),!0),i=rs(ss(t,"left"),!0),s=rs(ss(t,"right")),r=rs(ss(t,"top"),!0),o=rs(ss(t,"bottom")),a=hu(t,"x"),l=hu(t,"y");return{fullSize:e,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:ss(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}function fu(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function gu(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 jm(n,t,e,i){const{pos:s,box:r}=e,o=n.maxPadding;if(!ht(s)){e.size&&(n[s]-=e.size);const d=i[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?r.height:r.width),e.size=d.size/d.count,n[s]+=e.size}r.getPadding&&gu(o,r.getPadding());const a=Math.max(0,t.outerWidth-fu(o,n,"left","right")),l=Math.max(0,t.outerHeight-fu(o,n,"top","bottom")),c=a!==n.w,u=l!==n.h;return n.w=a,n.h=l,e.horizontal?{same:c,other:u}:{same:u,other:c}}function Vm(n){const t=n.maxPadding;function e(i){const s=Math.max(t[i]-n[i],0);return n[i]+=s,s}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function $m(n,t){const e=t.maxPadding;function i(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{r[o]=Math.max(t[o],e[o])}),r}return i(n?["left","right"]:["top","bottom"])}function os(n,t,e,i){const s=[];let r,o,a,l,c,u;for(r=0,o=n.length,c=0;r<o;++r){a=n[r],l=a.box,l.update(a.width||t.w,a.height||t.h,$m(a.horizontal,t));const{same:d,other:f}=jm(t,e,a,i);c|=d&&s.length,u=u||f,l.fullSize||s.push(a)}return c&&os(s,t,e,i)||u}function hr(n,t,e,i,s){n.top=e,n.left=t,n.right=t+i,n.bottom=e+s,n.width=i,n.height=s}function pu(n,t,e,i){const s=e.padding;let{x:r,y:o}=t;for(const a of n){const l=a.box,c=i[a.stack]||{placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*u,f=c.size||l.height;ge(c.start)&&(o=c.start),l.fullSize?hr(l,s.left,o,e.outerWidth-s.right-s.left,f):hr(l,t.left+c.placed,o,d,f),c.start=o,c.placed+=d,o=l.bottom}else{const d=t.h*u,f=c.size||l.width;ge(c.start)&&(r=c.start),l.fullSize?hr(l,r,s.top,f,e.outerHeight-s.bottom-s.top):hr(l,r,t.top+c.placed,f,d),c.start=r,c.placed+=d,r=l.right}}t.x=r,t.y=o}var oe={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,i){if(!n)return;const s=Ut(n.options.layout.padding),r=Math.max(t-s.width,0),o=Math.max(e-s.height,0),a=Ym(n.boxes),l=a.vertical,c=a.horizontal;St(n.boxes,y=>{typeof y.beforeLayout=="function"&&y.beforeLayout()});const u=l.reduce((y,x)=>x.box.options&&x.box.options.display===!1?y:y+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},s);gu(f,Ut(i));const g=Object.assign({maxPadding:f,w:r,h:o,x:s.left,y:s.top},s),p=Wm(l.concat(c),d);os(a.fullSize,g,d,p),os(l,g,d,p),os(c,g,d,p)&&os(l,g,d,p),Vm(g),pu(a.leftAndTop,g,d,p),g.x+=g.w,g.y+=g.h,pu(a.rightAndBottom,g,d,p),n.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},St(a.chartArea,y=>{const x=y.box;Object.assign(x,n.chartArea),x.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class mu{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class Um extends mu{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const fr="$chartjs",Xm={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},yu=n=>n===null||n==="";function qm(n,t){const e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[fr]={initial:{height:i,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",yu(s)){const r=Yc(n,"width");r!==void 0&&(n.width=r)}if(yu(i))if(n.style.height==="")n.height=n.width/(t||2);else{const r=Yc(n,"height");r!==void 0&&(n.height=r)}return n}const bu=Zp?{passive:!0}:!1;function Gm(n,t,e){n&&n.addEventListener(t,e,bu)}function Km(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,bu)}function Zm(n,t){const e=Xm[n.type]||n.type,{x:i,y:s}=vn(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function gr(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function Qm(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||gr(a.addedNodes,i),o=o&&!gr(a.removedNodes,i);o&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function Jm(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||gr(a.removedNodes,i),o=o&&!gr(a.addedNodes,i);o&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const as=new Map;let _u=0;function xu(){const n=window.devicePixelRatio;n!==_u&&(_u=n,as.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function ty(n,t){as.size||window.addEventListener("resize",xu),as.set(n,t)}function ey(n){as.delete(n),as.size||window.removeEventListener("resize",xu)}function ny(n,t,e){const i=n.canvas,s=i&&Wo(i);if(!s)return;const r=vc((a,l)=>{const c=s.clientWidth;e(a,l),c<s.clientWidth&&e()},window),o=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return o.observe(s),ty(n,r),o}function Qo(n,t,e){e&&e.disconnect(),t==="resize"&&ey(n)}function iy(n,t,e){const i=n.canvas,s=vc(r=>{n.ctx!==null&&e(Zm(r,n))},n);return Gm(i,t,s),s}class sy extends mu{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(qm(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[fr])return!1;const i=e[fr].initial;["height","width"].forEach(r=>{const o=i[r];st(o)?e.removeAttribute(r):e.setAttribute(r,o)});const s=i.style||{};return Object.keys(s).forEach(r=>{e.style[r]=s[r]}),e.width=e.width,delete e[fr],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),o={attach:Qm,detach:Jm,resize:ny}[e]||iy;s[e]=o(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:Qo,detach:Qo,resize:Qo}[e]||Km)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return Kp(t,e,i,s)}isAttached(t){const e=t&&Wo(t);return!!(e&&e.isConnected)}}function ry(n){return!Ho()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Um:sy}class Jt{constructor(){E(this,"x");E(this,"y");E(this,"active",!1);E(this,"options");E(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return _n(this.x)&&_n(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach(r=>{s[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),s}}E(Jt,"defaults",{}),E(Jt,"defaultRoutes");function oy(n,t){const e=n.options.ticks,i=ay(n),s=Math.min(e.maxTicksLimit||i,i),r=e.major.enabled?cy(t):[],o=r.length,a=r[0],l=r[o-1],c=[];if(o>s)return uy(t,c,r,o/s),c;const u=ly(r,t,s);if(o>0){let d,f;const g=o>1?Math.round((l-a)/(o-1)):null;for(pr(t,c,u,st(g)?0:a-g,a),d=0,f=o-1;d<f;d++)pr(t,c,u,r[d],r[d+1]);return pr(t,c,u,l,st(g)?t.length:l+g),c}return pr(t,c,u),c}function ay(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),s=n._maxLength/e;return Math.floor(Math.min(i,s))}function ly(n,t,e){const i=dy(n),s=t.length/e;if(!i)return Math.max(s,1);const r=Jg(i);for(let o=0,a=r.length-1;o<a;o++){const l=r[o];if(l>s)return l}return Math.max(s,1)}function cy(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function uy(n,t,e,i){let s=0,r=e[0],o;for(i=Math.ceil(i),o=0;o<n.length;o++)o===r&&(t.push(n[o]),s++,r=e[s*i])}function pr(n,t,e,i,s){const r=rt(i,0),o=Math.min(rt(s,n.length),n.length);let a=0,l,c,u;for(e=Math.ceil(e),s&&(l=s-i,e=l/Math.floor(l/e)),u=r;u<0;)a++,u=Math.round(r+a*e);for(c=Math.max(r,0);c<o;c++)c===u&&(t.push(n[c]),a++,u=Math.round(r+a*e))}function dy(n){const t=n.length;let e,i;if(t<2)return!1;for(i=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==i)return!1;return i}const hy=n=>n==="left"?"right":n==="right"?"left":n,wu=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,vu=(n,t)=>Math.min(t||n,n);function Mu(n,t){const e=[],i=n.length/t,s=n.length;let r=0;for(;r<s;r+=i)e.push(n[Math.floor(r)]);return e}function fy(n,t,e){const i=n.ticks.length,s=Math.min(t,i-1),r=n._startPixel,o=n._endPixel,a=1e-6;let l=n.getPixelForTick(s),c;if(!(e&&(i===1?c=Math.max(l-r,o-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<r-a||l>o+a)))return l}function gy(n,t){St(n,e=>{const i=e.gc,s=i.length/2;let r;if(s>t){for(r=0;r<s;++r)delete e.data[i[r]];i.splice(0,s)}})}function ls(n){return n.drawTicks?n.tickLength:0}function ku(n,t){if(!n.display)return 0;const e=It(n.font,t),i=Ut(n.padding);return(kt(n.text)?n.text.length:1)*e.lineHeight+i.height}function py(n,t){return wn(n,{scale:t,type:"scale"})}function my(n,t,e){return wn(n,{tick:e,index:t,type:"tick"})}function yy(n,t,e){let i=Oo(n);return(e&&t!=="right"||!e&&t==="right")&&(i=hy(i)),i}function by(n,t,e,i){const{top:s,left:r,bottom:o,right:a,chart:l}=n,{chartArea:c,scales:u}=l;let d=0,f,g,p;const y=o-s,x=a-r;if(n.isHorizontal()){if(g=re(i,r,a),ht(e)){const v=Object.keys(e)[0],M=e[v];p=u[v].getPixelForValue(M)+y-t}else e==="center"?p=(c.bottom+c.top)/2+y-t:p=wu(n,e,t);f=a-r}else{if(ht(e)){const v=Object.keys(e)[0],M=e[v];g=u[v].getPixelForValue(M)-x+t}else e==="center"?g=(c.left+c.right)/2-x+t:g=wu(n,e,t);p=re(i,o,s),d=e==="left"?-Et:Et}return{titleX:g,titleY:p,maxWidth:f,rotation:d}}class jn extends Jt{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:i,_suggestedMax:s}=this;return t=Me(t,Number.POSITIVE_INFINITY),e=Me(e,Number.NEGATIVE_INFINITY),i=Me(i,Number.POSITIVE_INFINITY),s=Me(s,Number.NEGATIVE_INFINITY),{min:Me(t,i),max:Me(e,s),minDefined:Rt(t),maxDefined:Rt(e)}}getMinMax(t){let{min:e,max:i,minDefined:s,maxDefined:r}=this.getUserBounds(),o;if(s&&r)return{min:e,max:i};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)o=a[l].controller.getMinMax(this,t),s||(e=Math.min(e,o.min)),r||(i=Math.max(i,o.max));return e=r&&e>i?i:e,i=s&&e>i?e:i,{min:Me(e,Me(i,e)),max:Me(i,Me(e,i))}}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(){Dt(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Cp(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Mu(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=oy(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,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Dt(this.options.afterUpdate,[this])}beforeSetDimensions(){Dt(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(){Dt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Dt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Dt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,r;for(i=0,s=t.length;i<s;i++)r=t[i],r.label=Dt(e.callback,[r.value,i,t],this)}afterTickToLabelConversion(){Dt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Dt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=vu(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,r=e.maxRotation;let o=s,a,l,c;if(!this._isVisible()||!e.display||s>=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,g=Qt(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:g/(i-1),d+6>a&&(a=g/(i-(t.offset?.5:1)),l=this.maxHeight-ls(t.grid)-e.padding-ku(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),o=Js(Math.min(Math.asin(Qt((u.highest.height+6)/a,-1,1)),Math.asin(Qt(l/c,-1,1))-Math.asin(Qt(f/c,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){Dt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Dt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=ku(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=ls(r)+l):(t.height=this.maxHeight,t.width=ls(r)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),g=i.padding*2,p=$t(this.labelRotation),y=Math.cos(p),x=Math.sin(p);if(a){const v=i.mirror?0:x*d.width+y*f.height;t.height=Math.min(this.maxHeight,t.height+v+g)}else{const v=i.mirror?0:y*d.width+x*f.height;t.width=Math.min(this.maxWidth,t.width+v+g)}this._calculatePadding(c,u,x,y)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="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=s*t.width,g=i*e.height):(f=i*t.height,g=s*e.width):r==="start"?g=e.width:r==="end"?f=t.width:r!=="inner"&&(f=t.width/2,g=e.width/2),this.paddingLeft=Math.max((f-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((g-d+o)*this.width/(this.width-d),0)}else{let u=e.height/2,d=t.height/2;r==="start"?(u=0,d=t.height):r==="end"&&(u=e.height,d=0),this.paddingTop=u+o,this.paddingBottom=d+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Dt(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,i;for(e=0,i=t.length;e<i;e++)st(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=Mu(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:s,_longestTextCache:r}=this,o=[],a=[],l=Math.floor(e/vu(e,i));let c=0,u=0,d,f,g,p,y,x,v,M,D,S,P;for(d=0;d<e;d+=l){if(p=t[d].label,y=this._resolveTickFontOptions(d),s.font=x=y.string,v=r[x]=r[x]||{data:{},gc:[]},M=y.lineHeight,D=S=0,!st(p)&&!kt(p))D=ir(s,v.data,v.gc,D,p),S=M;else if(kt(p))for(f=0,g=p.length;f<g;++f)P=p[f],!st(P)&&!kt(P)&&(D=ir(s,v.data,v.gc,D,P),S+=M);o.push(D),a.push(S),c=Math.max(D,c),u=Math.max(S,u)}gy(r,e);const R=o.indexOf(c),O=a.indexOf(u),b=_=>({width:o[_]||0,height:a[_]||0});return{first:b(0),last:b(e-1),widest:b(R),highest:b(O),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return ip(this._alignToPixels?zn(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 i=e[t];return i.$context||(i.$context=my(this.getContext(),t,i))}return this.$context||(this.$context=py(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=$t(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),r=this._getLabelSizes(),o=t.autoSkipPadding||0,a=r?r.widest.width+o:0,l=r?r.highest.height+o:0;return this.isHorizontal()?l*i>a*s?a/i:l/s:l*s<a*i?l/i:a/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:r,position:o,border:a}=s,l=r.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=ls(r),g=[],p=a.setContext(this.getContext()),y=p.display?p.width:0,x=y/2,v=function(Q){return zn(i,Q,y)};let M,D,S,P,R,O,b,_,C,I,T,F;if(o==="top")M=v(this.bottom),O=this.bottom-f,_=M-x,I=v(t.top)+x,F=t.bottom;else if(o==="bottom")M=v(this.top),I=t.top,F=v(t.bottom)-x,O=M+x,_=this.top+f;else if(o==="left")M=v(this.right),R=this.right-f,b=M-x,C=v(t.left)+x,T=t.right;else if(o==="right")M=v(this.left),C=t.left,T=v(t.right)-x,R=M+x,b=this.left+f;else if(e==="x"){if(o==="center")M=v((t.top+t.bottom)/2+.5);else if(ht(o)){const Q=Object.keys(o)[0],V=o[Q];M=v(this.chart.scales[Q].getPixelForValue(V))}I=t.top,F=t.bottom,O=M+x,_=O+f}else if(e==="y"){if(o==="center")M=v((t.left+t.right)/2);else if(ht(o)){const Q=Object.keys(o)[0],V=o[Q];M=v(this.chart.scales[Q].getPixelForValue(V))}R=M-x,b=R-f,C=t.left,T=t.right}const U=rt(s.ticks.maxTicksLimit,d),X=Math.max(1,Math.ceil(d/U));for(D=0;D<d;D+=X){const Q=this.getContext(D),V=r.setContext(Q),ut=a.setContext(Q),$=V.lineWidth,G=V.color,J=ut.dash||[],z=ut.dashOffset,B=V.tickWidth,ft=V.tickColor,yt=V.tickBorderDash||[],vt=V.tickBorderDashOffset;S=fy(this,D,l),S!==void 0&&(P=zn(i,S,$),c?R=b=C=T=P:O=_=I=F=P,g.push({tx1:R,ty1:O,tx2:b,ty2:_,x1:C,y1:I,x2:T,y2:F,width:$,color:G,borderDash:J,borderDashOffset:z,tickWidth:B,tickColor:ft,tickBorderDash:yt,tickBorderDashOffset:vt}))}return this._ticksLength=d,this._borderValue=M,g}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:r}=i,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=r,f=ls(i.grid),g=f+u,p=d?-u:g,y=-$t(this.labelRotation),x=[];let v,M,D,S,P,R,O,b,_,C,I,T,F="middle";if(s==="top")R=this.bottom-p,O=this._getXAxisLabelAlignment();else if(s==="bottom")R=this.top+p,O=this._getXAxisLabelAlignment();else if(s==="left"){const X=this._getYAxisLabelAlignment(f);O=X.textAlign,P=X.x}else if(s==="right"){const X=this._getYAxisLabelAlignment(f);O=X.textAlign,P=X.x}else if(e==="x"){if(s==="center")R=(t.top+t.bottom)/2+g;else if(ht(s)){const X=Object.keys(s)[0],Q=s[X];R=this.chart.scales[X].getPixelForValue(Q)+g}O=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")P=(t.left+t.right)/2-g;else if(ht(s)){const X=Object.keys(s)[0],Q=s[X];P=this.chart.scales[X].getPixelForValue(Q)}O=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?F="top":l==="end"&&(F="bottom"));const U=this._getLabelSizes();for(v=0,M=a.length;v<M;++v){D=a[v],S=D.label;const X=r.setContext(this.getContext(v));b=this.getPixelForTick(v)+r.labelOffset,_=this._resolveTickFontOptions(v),C=_.lineHeight,I=kt(S)?S.length:1;const Q=I/2,V=X.color,ut=X.textStrokeColor,$=X.textStrokeWidth;let G=O;o?(P=b,O==="inner"&&(v===M-1?G=this.options.reverse?"left":"right":v===0?G=this.options.reverse?"right":"left":G="center"),s==="top"?c==="near"||y!==0?T=-I*C+C/2:c==="center"?T=-U.highest.height/2-Q*C+C:T=-U.highest.height+C/2:c==="near"||y!==0?T=C/2:c==="center"?T=U.highest.height/2-Q*C:T=U.highest.height-I*C,d&&(T*=-1),y!==0&&!X.showLabelBackdrop&&(P+=C/2*Math.sin(y))):(R=b,T=(1-I)*C/2);let J;if(X.showLabelBackdrop){const z=Ut(X.backdropPadding),B=U.heights[v],ft=U.widths[v];let yt=T-z.top,vt=0-z.left;switch(F){case"middle":yt-=B/2;break;case"bottom":yt-=B;break}switch(O){case"center":vt-=ft/2;break;case"right":vt-=ft;break;case"inner":v===M-1?vt-=ft:v>0&&(vt-=ft/2);break}J={left:vt,top:yt,width:ft+z.width,height:B+z.height,color:X.backdropColor}}x.push({label:S,font:_,textOffset:T,options:{rotation:y,color:V,strokeColor:ut,strokeWidth:$,textAlign:G,textBaseline:F,translation:[P,R],backdrop:J}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-$t(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:r}}=this.options,o=this._getLabelSizes(),a=t+r,l=o.widest.width;let c,u;return e==="left"?s?(u=this.right+r,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):e==="right"?s?(u=this.left+r,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,i==="near"?c="left":i==="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:i,top:s,width:r,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,r,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(r=>r.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(e.display)for(r=0,o=s.length;r<o;++r){const l=s[r];e.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:s}}=this,r=i.setContext(this.getContext()),o=i.display?r.width:0;if(!o)return;const a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,f;this.isHorizontal()?(c=zn(t,this.left,o)-o/2,u=zn(t,this.right,a)+a/2,d=f=l):(d=zn(t,this.top,o)-o/2,f=zn(t,this.bottom,a)+a/2,c=u=l),e.save(),e.lineWidth=r.width,e.strokeStyle=r.color,e.beginPath(),e.moveTo(c,d),e.lineTo(u,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&Ki(i,s);const r=this.getLabelItems(t);for(const o of r){const a=o.options,l=o.font,c=o.label,u=o.textOffset;Bn(i,c,0,u,l,a)}s&&Zi(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const r=It(i.font),o=Ut(i.padding),a=i.align;let l=r.lineHeight/2;e==="bottom"||e==="center"||ht(e)?(l+=o.bottom,kt(i.text)&&(l+=r.lineHeight*(i.text.length-1))):l+=o.top;const{titleX:c,titleY:u,maxWidth:d,rotation:f}=by(this,l,e,a);Bn(t,i.text,0,0,r,{color:i.color,maxWidth:d,rotation:f,textAlign:yy(a,e,s),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,i=rt(t.grid&&t.grid.z,-1),s=rt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==jn.prototype.draw?[{z:e,draw:r=>{this.draw(r)}}]:[{z:i,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let r,o;for(r=0,o=e.length;r<o;++r){const a=e[r];a[i]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return It(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class mr{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,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 i;wy(e)&&(i=this.register(e));const s=this.items,r=t.id,o=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in s||(s[r]=t,_y(t,o,i),this.override&&At.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in At[s]&&(delete At[s][i],this.override&&delete Fn[i])}}function _y(n,t,e){const i=ji(Object.create(null),[e?At.get(e):{},At.get(t),n.defaults]);At.set(t,i),n.defaultRoutes&&xy(t,n.defaultRoutes),n.descriptors&&At.describe(t,n.descriptors)}function xy(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),s=i.pop(),r=[n].concat(i).join("."),o=t[e].split("."),a=o.pop(),l=o.join(".");At.route(r,s,l,a)})}function wy(n){return"id"in n&&"defaults"in n}class vy{constructor(){this.controllers=new mr(Ie,"datasets",!0),this.elements=new mr(Jt,"elements"),this.plugins=new mr(Object,"plugins"),this.scales=new mr(jn,"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,i){[...e].forEach(s=>{const r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):St(s,o=>{const a=i||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,e,i){const s=To(t);Dt(i["before"+s],[],i),e[t](i),Dt(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var We=new vy;class My{constructor(){this._init=[]}notify(t,e,i,s){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const r=s?this._descriptors(t).filter(s):this._descriptors(t),o=this._notify(r,t,e,i);return e==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,i,s){s=s||{};for(const r of t){const o=r.plugin,a=o[i],l=[e,s,r.options];if(Dt(a,l,o)===!1&&s.cancelable)return!1}return!0}invalidate(){st(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 i=t&&t.config,s=rt(i.options&&i.options.plugins,{}),r=ky(i);return s===!1&&!e?[]:Sy(t,r,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(r,o)=>r.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function ky(n){const t={},e=[],i=Object.keys(We.plugins.items);for(let r=0;r<i.length;r++)e.push(We.getPlugin(i[r]));const s=n.plugins||[];for(let r=0;r<s.length;r++){const o=s[r];e.indexOf(o)===-1&&(e.push(o),t[o.id]=!0)}return{plugins:e,localIds:t}}function Dy(n,t){return!t&&n===!1?null:n===!0?{}:n}function Sy(n,{plugins:t,localIds:e},i,s){const r=[],o=n.getContext();for(const a of t){const l=a.id,c=Dy(i[l],s);c!==null&&r.push({plugin:a,options:Ty(n.config,{plugin:a,local:e[l]},c,o)})}return r}function Ty(n,{plugin:t,local:e},i,s){const r=n.pluginScopeKeys(t),o=n.getOptionScopes(i,r);return e&&t.defaults&&o.push(t.defaults),n.createResolver(o,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Jo(n,t){const e=At.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Cy(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function Py(n,t){return n===t?"_index_":"_value_"}function Du(n){if(n==="x"||n==="y"||n==="r")return n}function Oy(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function ta(n,...t){if(Du(n))return n;for(const e of t){const i=e.axis||Oy(e.position)||n.length>1&&Du(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Su(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function Ey(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(e.length)return Su(n,"x",e[0])||Su(n,"y",e[0])}return{}}function Ay(n,t){const e=Fn[n.type]||{scales:{}},i=t.scales||{},s=Jo(n.type,t),r=Object.create(null);return Object.keys(i).forEach(o=>{const a=i[o];if(!ht(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=ta(o,a,Ey(o,n),At.scales[a.type]),c=Py(l,s),u=e.scales||{};r[o]=Vi(Object.create(null),[{axis:l},a,u[l],u[c]])}),n.data.datasets.forEach(o=>{const a=o.type||n.type,l=o.indexAxis||Jo(a,t),u=(Fn[a]||{}).scales||{};Object.keys(u).forEach(d=>{const f=Cy(d,l),g=o[f+"AxisID"]||f;r[g]=r[g]||Object.create(null),Vi(r[g],[{axis:f},i[g],u[d]])})}),Object.keys(r).forEach(o=>{const a=r[o];Vi(a,[At.scales[a.type],At.scale])}),r}function Tu(n){const t=n.options||(n.options={});t.plugins=rt(t.plugins,{}),t.scales=Ay(n,t)}function Cu(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function Ry(n){return n=n||{},n.data=Cu(n.data),Tu(n),n}const Pu=new Map,Ou=new Set;function yr(n,t){let e=Pu.get(n);return e||(e=t(),Pu.set(n,e),Ou.add(e)),e}const cs=(n,t,e)=>{const i=yn(t,e);i!==void 0&&n.add(i)};class Iy{constructor(t){this._config=Ry(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=Cu(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(),Tu(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return yr(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return yr(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return yr(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return yr(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return(!s||e)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:r}=this,o=this._cachedScopes(t,i),a=o.get(e);if(a)return a;const l=new Set;e.forEach(u=>{t&&(l.add(t),u.forEach(d=>cs(l,t,d))),u.forEach(d=>cs(l,s,d)),u.forEach(d=>cs(l,Fn[r]||{},d)),u.forEach(d=>cs(l,At,d)),u.forEach(d=>cs(l,Ro,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Ou.has(e)&&o.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Fn[e]||{},At.datasets[e]||{},{type:e},At,Ro]}resolveNamedOptions(t,e,i,s=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=Eu(this._resolverCache,t,s);let l=o;if(Ny(o,e)){r.$shared=!1,i=pe(i)?i():i;const c=this.createResolver(t,i,a);l=hi(o,i,c)}for(const c of e)r[c]=l[c];return r}createResolver(t,e,i=[""],s){const{resolver:r}=Eu(this._resolverCache,t,i);return ht(e)?hi(r,e,void 0,s):r}}function Eu(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const s=e.join();let r=i.get(s);return r||(r={resolver:Fo(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,r)),r}const Ly=n=>ht(n)&&Object.getOwnPropertyNames(n).some(t=>pe(n[t]));function Ny(n,t){const{isScriptable:e,isIndexable:i}=Rc(n);for(const s of t){const r=e(s),o=i(s),a=(o||r)&&n[s];if(r&&(pe(a)||Ly(a))||o&&kt(a))return!0}return!1}var Fy="4.5.0";const zy=["top","bottom","left","right","chartArea"];function Au(n,t){return n==="top"||n==="bottom"||zy.indexOf(n)===-1&&t==="x"}function Ru(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function Iu(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),Dt(e&&e.onComplete,[n],t)}function By(n){const t=n.chart,e=t.options.animation;Dt(e&&e.onProgress,[n],t)}function Lu(n){return Ho()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const br={},Nu=n=>{const t=Lu(n);return Object.values(br).filter(e=>e.canvas===t).pop()};function Hy(n,t,e){const i=Object.keys(n);for(const s of i){const r=+s;if(r>=t){const o=n[s];delete n[s],(e>0||r>t)&&(n[r+e]=o)}}}function Wy(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}let Se=(On=class{static register(...t){We.add(...t),Fu()}static unregister(...t){We.remove(...t),Fu()}constructor(t,e){const i=this.config=new Iy(e),s=Lu(t),r=Nu(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||ry(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=$g(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=o,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 My,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=ap(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],br[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}tn.listen(this,"complete",Iu),tn.listen(this,"progress",By),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:r}=this;return st(t)?e&&r?r:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return We}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Wc(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Oc(this.canvas,this.ctx),this}stop(){return tn.stop(this),this}resize(t,e){tn.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,e,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Wc(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),Dt(i.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};St(e,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((o,a)=>(o[a]=!1,o),{});let r=[];e&&(r=r.concat(Object.keys(e).map(o=>{const a=e[o],l=ta(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),St(r,o=>{const a=o.options,l=a.id,c=ta(l,a),u=rt(a.type,o.dtype);(a.position===void 0||Au(a.position,c)!==Au(o.dposition))&&(a.position=o.dposition),s[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{const f=We.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),St(s,(o,a)=>{o||delete i[a]}),St(i,o=>{oe.configure(this,o,o.options),oe.addBox(this,o)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((s,r)=>s.index-r.index),i>e){for(let s=e;s<i;++s)this._destroyDatasetMeta(s);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Ru("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,s)=>{e.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const r=e[i];let o=this.getDatasetMeta(i);const a=r.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(i),o=this.getDatasetMeta(i)),o.type=a,o.indexAxis=r.indexAxis||Jo(a,this.options),o.order=r.order||0,o.index=i,o.label=""+r.label,o.visible=this.isDatasetVisible(i),o.controller)o.controller.updateIndex(i),o.controller.linkScales();else{const l=We.getController(a),{datasetElementType:c,dataElementType:u}=At.datasets[a];Object.assign(l,{dataElementType:We.getElement(u),datasetElementType:c&&We.getElement(c)}),o.controller=new l(this,i),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){St(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 i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),f=!s&&r.indexOf(d)===-1;d.buildOrUpdateElements(f),o=Math.max(+d.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),s||St(r,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Ru("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){St(this.scales,t=>{oe.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!gc(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:r}of e){const o=i==="_removeElements"?-r:r;Hy(t,s,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),s=i(0);for(let r=1;r<e;r++)if(!gc(s,i(r)))return;return Array.from(s).map(r=>r.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;oe.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],St(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,pe(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(tn.has(this)?this.attached&&!tn.running(this)&&tn.start(this):(this.draw(),Iu({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}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,i=[];let s,r;for(s=0,r=e.length;s<r;++s){const o=e[s];(!t||o.visible)&&i.push(o)}return i}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,i={meta:t,index:t.index,cancelable:!0},s=Zc(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&Ki(e,s),t.controller.draw(),s&&Zi(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return Je(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const r=Zo.modes[e];return typeof r=="function"?r(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter(r=>r&&r._dataset===e).pop();return s||(s={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},i.push(s)),s}getContext(){return this.$context||(this.$context=wn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,s);ge(e)?(r.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(r,{visible:i}),this.update(a=>a.datasetIndex===t?s: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(),tn.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(),Oc(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete br[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,i=(r,o)=>{e.addEventListener(this,r,o),t[r]=o},s=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};St(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",r),i("detach",o)};o=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){St(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},St(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let r,o,a,l;for(e==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){o=t[a];const c=o&&this.getDatasetMeta(o.datasetIndex).controller;c&&c[s+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:r,index:o})=>{const a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!Gs(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const s=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),o=r(e,t),a=i?t:r(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const r=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:r}=this,o=e,a=this._getActiveElements(t,s,i,o),l=Zg(t),c=Wy(t,this._lastEvent,i,l);i&&(this._lastEvent=null,Dt(r.onHover,[t,a,this],this),l&&Dt(r.onClick,[t,a,this],this));const u=!Gs(a,s);return(u||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=c,u}_getActiveElements(t,e,i,s){if(t.type==="mouseout")return[];if(!i)return e;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}},E(On,"defaults",At),E(On,"instances",br),E(On,"overrides",Fn),E(On,"registry",We),E(On,"version",Fy),E(On,"getChart",Nu),On);function Fu(){return St(Se.instances,n=>n._plugins.invalidate())}function Yy(n,t,e){const{startAngle:i,x:s,y:r,outerRadius:o,innerRadius:a,options:l}=t,{borderWidth:c,borderJoinStyle:u}=l,d=Math.min(c/o,se(i-e));if(n.beginPath(),n.arc(s,r,o-c/2,i+d/2,e-d/2),a>0){const f=Math.min(c/a,se(i-e));n.arc(s,r,a+c/2,e-f/2,i+f/2,!0)}else{const f=Math.min(c/2,o*se(i-e));if(u==="round")n.arc(s,r,f,e-ct/2,i+ct/2,!0);else if(u==="bevel"){const g=2*f*f,p=-g*Math.cos(e+ct/2)+s,y=-g*Math.sin(e+ct/2)+r,x=g*Math.cos(i+ct/2)+s,v=g*Math.sin(i+ct/2)+r;n.lineTo(p,y),n.lineTo(x,v)}}n.closePath(),n.moveTo(0,0),n.rect(0,0,n.canvas.width,n.canvas.height),n.clip("evenodd")}function jy(n,t,e){const{startAngle:i,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=t;let c=s/a;n.beginPath(),n.arc(r,o,a,i-c,e+c),l>s?(c=s/l,n.arc(r,o,l,e+c,i-c,!0)):n.arc(r,o,s,e+Et,i-Et),n.closePath(),n.clip()}function Vy(n){return No(n,["outerStart","outerEnd","innerStart","innerEnd"])}function $y(n,t,e,i){const s=Vy(n.options.borderRadius),r=(e-t)/2,o=Math.min(r,i*t/2),a=l=>{const c=(e-Math.min(r,l))*i/2;return Qt(l,0,Math.min(r,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:Qt(s.innerStart,0,o),innerEnd:Qt(s.innerEnd,0,o)}}function pi(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function _r(n,t,e,i,s,r){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+i+e-c,0),f=u>0?u+i+e+c:0;let g=0;const p=s-l;if(i){const X=u>0?u-i:0,Q=d>0?d-i:0,V=(X+Q)/2,ut=V!==0?p*V/(V+i):p;g=(p-ut)/2}const y=Math.max(.001,p*d-e/ct)/d,x=(p-y)/2,v=l+x+g,M=s-x-g,{outerStart:D,outerEnd:S,innerStart:P,innerEnd:R}=$y(t,f,d,M-v),O=d-D,b=d-S,_=v+D/O,C=M-S/b,I=f+P,T=f+R,F=v+P/I,U=M-R/T;if(n.beginPath(),r){const X=(_+C)/2;if(n.arc(o,a,d,_,X),n.arc(o,a,d,X,C),S>0){const $=pi(b,C,o,a);n.arc($.x,$.y,S,C,M+Et)}const Q=pi(T,M,o,a);if(n.lineTo(Q.x,Q.y),R>0){const $=pi(T,U,o,a);n.arc($.x,$.y,R,M+Et,U+Math.PI)}const V=(M-R/f+(v+P/f))/2;if(n.arc(o,a,f,M-R/f,V,!0),n.arc(o,a,f,V,v+P/f,!0),P>0){const $=pi(I,F,o,a);n.arc($.x,$.y,P,F+Math.PI,v-Et)}const ut=pi(O,v,o,a);if(n.lineTo(ut.x,ut.y),D>0){const $=pi(O,_,o,a);n.arc($.x,$.y,D,v-Et,_)}}else{n.moveTo(o,a);const X=Math.cos(_)*d+o,Q=Math.sin(_)*d+a;n.lineTo(X,Q);const V=Math.cos(C)*d+o,ut=Math.sin(C)*d+a;n.lineTo(V,ut)}n.closePath()}function Uy(n,t,e,i,s){const{fullCircles:r,startAngle:o,circumference:a}=t;let l=t.endAngle;if(r){_r(n,t,e,i,l,s);for(let c=0;c<r;++c)n.fill();isNaN(a)||(l=o+(a%Ot||Ot))}return _r(n,t,e,i,l,s),n.fill(),l}function Xy(n,t,e,i,s){const{fullCircles:r,startAngle:o,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:f,borderRadius:g}=l,p=l.borderAlign==="inner";if(!c)return;n.setLineDash(d||[]),n.lineDashOffset=f,p?(n.lineWidth=c*2,n.lineJoin=u||"round"):(n.lineWidth=c,n.lineJoin=u||"bevel");let y=t.endAngle;if(r){_r(n,t,e,i,y,s);for(let x=0;x<r;++x)n.stroke();isNaN(a)||(y=o+(a%Ot||Ot))}p&&jy(n,t,y),l.selfJoin&&y-o>=ct&&g===0&&u!=="miter"&&Yy(n,t,y),r||(_r(n,t,e,i,y,s),n.stroke())}class us extends Jt{constructor(e){super();E(this,"circumference");E(this,"endAngle");E(this,"fullCircles");E(this,"innerRadius");E(this,"outerRadius");E(this,"pixelMargin");E(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,i,s){const r=this.getProps(["x","y"],s),{angle:o,distance:a}=tr(r,{x:e,y:i}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),g=(this.options.spacing+this.options.borderWidth)/2,p=rt(f,c-l),y=Ui(o,l,c)&&l!==c,x=p>=Ot||y,v=Ze(a,u+g,d+g);return x&&v}getCenterPoint(e){const{x:i,y:s,startAngle:r,endAngle:o,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:u}=this.options,d=(r+o)/2,f=(a+l+u+c)/2;return{x:i+Math.cos(d)*f,y:s+Math.sin(d)*f}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:i,circumference:s}=this,r=(i.offset||0)/4,o=(i.spacing||0)/2,a=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>Ot?Math.floor(s/Ot):0,s===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*r,Math.sin(l)*r);const c=1-Math.sin(Math.min(ct,s||0)),u=r*c;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,Uy(e,this,u,o,a),Xy(e,this,u,o,a),e.restore()}}E(us,"id","arc"),E(us,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),E(us,"defaultRoutes",{backgroundColor:"backgroundColor"}),E(us,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function zu(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 qy(n,t,e){n.lineTo(e.x,e.y)}function Gy(n){return n.stepped?_p:n.tension||n.cubicInterpolationMode==="monotone"?xp:qy}function Bu(n,t,e={}){const i=n.length,{start:s=0,end:r=i-1}=e,{start:o,end:a}=t,l=Math.max(s,o),c=Math.min(r,a),u=s<o&&r<o||s>a&&r>a;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function Ky(n,t,e,i){const{points:s,options:r}=t,{count:o,start:a,loop:l,ilen:c}=Bu(s,e,i),u=Gy(r);let{move:d=!0,reverse:f}=i||{},g,p,y;for(g=0;g<=c;++g)p=s[(a+(f?c-g:g))%o],!p.skip&&(d?(n.moveTo(p.x,p.y),d=!1):u(n,y,p,f,r.stepped),y=p);return l&&(p=s[(a+(f?c:0))%o],u(n,y,p,f,r.stepped)),!!l}function Zy(n,t,e,i){const s=t.points,{count:r,start:o,ilen:a}=Bu(s,e,i),{move:l=!0,reverse:c}=i||{};let u=0,d=0,f,g,p,y,x,v;const M=S=>(o+(c?a-S:S))%r,D=()=>{y!==x&&(n.lineTo(u,x),n.lineTo(u,y),n.lineTo(u,v))};for(l&&(g=s[M(0)],n.moveTo(g.x,g.y)),f=0;f<=a;++f){if(g=s[M(f)],g.skip)continue;const S=g.x,P=g.y,R=S|0;R===p?(P<y?y=P:P>x&&(x=P),u=(d*u+S)/++d):(D(),n.lineTo(S,P),p=R,d=0,y=x=P),v=P}D()}function ea(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Zy:Ky}function Qy(n){return n.stepped?Qp:n.tension||n.cubicInterpolationMode==="monotone"?Jp:Wn}function Jy(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),zu(n,t.options),n.stroke(s)}function tb(n,t,e,i){const{segments:s,options:r}=t,o=ea(t);for(const a of s)zu(n,r,a.style),n.beginPath(),o(n,t,a,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const eb=typeof Path2D=="function";function nb(n,t,e,i){eb&&!t.options.segment?Jy(n,t,e,i):tb(n,t,e,i)}class Mn extends Jt{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 i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;Vp(this._points,i,t,s,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,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],r=this.points,o=qc(this,{property:e,start:s,end:s});if(!o.length)return;const a=[],l=Qy(i);let c,u;for(c=0,u=o.length;c<u;++c){const{start:d,end:f}=o[c],g=r[d],p=r[f];if(g===p){a.push(g);continue}const y=Math.abs((s-g[e])/(p[e]-g[e])),x=l(g,p,y,i.stepped);x[e]=t[e],a.push(x)}return a.length===1?a[0]:a}pathSegment(t,e,i){return ea(this)(t,this,e,i)}path(t,e,i){const s=this.segments,r=ea(this);let o=this._loop;e=e||0,i=i||this.points.length-e;for(const a of s)o&=r(t,this,a,{start:e,end:e+i-1});return!!o}draw(t,e,i,s){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),nb(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}E(Mn,"id","line"),E(Mn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),E(Mn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),E(Mn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Hu(n,t,e,i){const s=n.options,{[e]:r}=n.getProps([e],i);return Math.abs(t-r)<s.radius+s.hitRadius}class xr extends Jt{constructor(e){super();E(this,"parsed");E(this,"skip");E(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,i,s){const r=this.options,{x:o,y:a}=this.getProps(["x","y"],s);return Math.pow(e-o,2)+Math.pow(i-a,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(e,i){return Hu(this,e,"x",i)}inYRange(e,i){return Hu(this,e,"y",i)}getCenterPoint(e){const{x:i,y:s}=this.getProps(["x","y"],e);return{x:i,y:s}}size(e){e=e||this.options||{};let i=e.radius||0;i=Math.max(i,i&&e.hoverRadius||0);const s=i&&e.borderWidth||0;return(i+s)*2}draw(e,i){const s=this.options;this.skip||s.radius<.1||!Je(this,i,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,Lo(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}E(xr,"id","point"),E(xr,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),E(xr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Wu(n,t){const{x:e,y:i,base:s,width:r,height:o}=n.getProps(["x","y","base","width","height"],t);let a,l,c,u,d;return n.horizontal?(d=o/2,a=Math.min(e,s),l=Math.max(e,s),c=i-d,u=i+d):(d=r/2,a=e-d,l=e+d,c=Math.min(i,s),u=Math.max(i,s)),{left:a,top:c,right:l,bottom:u}}function kn(n,t,e,i){return n?0:Qt(t,e,i)}function ib(n,t,e){const i=n.options.borderWidth,s=n.borderSkipped,r=Ac(i);return{t:kn(s.top,r.top,0,e),r:kn(s.right,r.right,0,t),b:kn(s.bottom,r.bottom,0,e),l:kn(s.left,r.left,0,t)}}function sb(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,r=xn(s),o=Math.min(t,e),a=n.borderSkipped,l=i||ht(s);return{topLeft:kn(!l||a.top||a.left,r.topLeft,0,o),topRight:kn(!l||a.top||a.right,r.topRight,0,o),bottomLeft:kn(!l||a.bottom||a.left,r.bottomLeft,0,o),bottomRight:kn(!l||a.bottom||a.right,r.bottomRight,0,o)}}function rb(n){const t=Wu(n),e=t.right-t.left,i=t.bottom-t.top,s=ib(n,e/2,i/2),r=sb(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:r},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,r.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(s.b,s.r))}}}}function na(n,t,e,i){const s=t===null,r=e===null,a=n&&!(s&&r)&&Wu(n,i);return a&&(s||Ze(t,a.left,a.right))&&(r||Ze(e,a.top,a.bottom))}function ob(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function ab(n,t){n.rect(t.x,t.y,t.w,t.h)}function ia(n,t,e={}){const i=n.x!==e.x?-t:0,s=n.y!==e.y?-t:0,r=(n.x+n.w!==e.x+e.w?t:0)-i,o=(n.y+n.h!==e.y+e.h?t:0)-s;return{x:n.x+i,y:n.y+s,w:n.w+r,h:n.h+o,radius:n.radius}}class wr extends Jt{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:i,backgroundColor:s}}=this,{inner:r,outer:o}=rb(this),a=ob(o.radius)?di:ab;t.save(),(o.w!==r.w||o.h!==r.h)&&(t.beginPath(),a(t,ia(o,e,r)),t.clip(),a(t,ia(r,-e,o)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,ia(r,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return na(this,t,e,i)}inXRange(t,e){return na(this,t,null,e)}inYRange(t,e){return na(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+s)/2:e,y:r?i:(i+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}E(wr,"id","bar"),E(wr,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),E(wr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var lb=Object.freeze({__proto__:null,ArcElement:us,BarElement:wr,LineElement:Mn,PointElement:xr});const sa=["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)"],Yu=sa.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function ju(n){return sa[n%sa.length]}function Vu(n){return Yu[n%Yu.length]}function cb(n,t){return n.borderColor=ju(t),n.backgroundColor=Vu(t),++t}function ub(n,t){return n.backgroundColor=n.data.map(()=>ju(t++)),t}function db(n,t){return n.backgroundColor=n.data.map(()=>Vu(t++)),t}function hb(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof en?t=ub(e,t):s instanceof ns?t=db(e,t):s&&(t=cb(e,t))}}function $u(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function fb(n){return n&&(n.borderColor||n.backgroundColor)}function gb(){return At.borderColor!=="rgba(0,0,0,0.1)"||At.backgroundColor!=="rgba(0,0,0,0.1)"}var pb={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:s}=n.config,{elements:r}=s,o=$u(i)||fb(s)||r&&$u(r)||gb();if(!e.forceOverride&&o)return;const a=hb(n);i.forEach(a)}};function mb(n,t,e,i,s){const r=s.samples||i;if(r>=e)return n.slice(t,t+e);const o=[],a=(e-2)/(r-2);let l=0;const c=t+e-1;let u=t,d,f,g,p,y;for(o[l++]=n[u],d=0;d<r-2;d++){let x=0,v=0,M;const D=Math.floor((d+1)*a)+1+t,S=Math.min(Math.floor((d+2)*a)+1,e)+t,P=S-D;for(M=D;M<S;M++)x+=n[M].x,v+=n[M].y;x/=P,v/=P;const R=Math.floor(d*a)+1+t,O=Math.min(Math.floor((d+1)*a)+1,e)+t,{x:b,y:_}=n[u];for(g=p=-1,M=R;M<O;M++)p=.5*Math.abs((b-x)*(n[M].y-_)-(b-n[M].x)*(v-_)),p>g&&(g=p,f=n[M],y=M);o[l++]=f,u=y}return o[l++]=n[c],o}function yb(n,t,e,i){let s=0,r=0,o,a,l,c,u,d,f,g,p,y;const x=[],v=t+e-1,M=n[t].x,S=n[v].x-M;for(o=t;o<t+e;++o){a=n[o],l=(a.x-M)/S*i,c=a.y;const P=l|0;if(P===u)c<p?(p=c,d=o):c>y&&(y=c,f=o),s=(r*s+a.x)/++r;else{const R=o-1;if(!st(d)&&!st(f)){const O=Math.min(d,f),b=Math.max(d,f);O!==g&&O!==R&&x.push({...n[O],x:s}),b!==g&&b!==R&&x.push({...n[b],x:s})}o>0&&R!==g&&x.push(n[R]),x.push(a),u=P,r=0,p=y=c,d=f=g=o}}return x}function Uu(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=>{Uu(t)})}function bb(n,t){const e=t.length;let i=0,s;const{iScale:r}=n,{min:o,max:a,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=Qt(Qe(t,r.axis,o).lo,0,e-1)),c?s=Qt(Qe(t,r.axis,a).hi+1,i,e)-i:s=e-i,{start:i,count:s}}var _b={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){Xu(n);return}const i=n.width;n.data.datasets.forEach((s,r)=>{const{_data:o,indexAxis:a}=s,l=n.getDatasetMeta(r),c=o||s.data;if(Qi([a,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}=bb(l,c);const g=e.threshold||4*i;if(f<=g){Uu(s);return}st(o)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(y){this._data=y}}));let p;switch(e.algorithm){case"lttb":p=mb(c,d,f,i,e);break;case"min-max":p=yb(c,d,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=p})},destroy(n){Xu(n)}};function xb(n,t,e){const i=n.segments,s=n.points,r=t.points,o=[];for(const a of i){let{start:l,end:c}=a;c=vr(l,c,s);const u=ra(e,s[l],s[c],a.loop);if(!t.segments){o.push({source:a,target:u,start:s[l],end:s[c]});continue}const d=qc(t,u);for(const f of d){const g=ra(e,r[f.start],r[f.end],f.loop),p=Xc(a,s,g);for(const y of p)o.push({source:y,target:f,start:{[e]:qu(u,g,"start",Math.max)},end:{[e]:qu(u,g,"end",Math.min)}})}}return o}function ra(n,t,e,i){if(i)return;let s=t[n],r=e[n];return n==="angle"&&(s=se(s),r=se(r)),{property:n,start:s,end:r}}function wb(n,t){const{x:e=null,y:i=null}=n||{},s=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=vr(o,a,s);const l=s[o],c=s[a];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):e!==null&&(r.push({x:e,y:l.y}),r.push({x:e,y:c.y}))}),r}function vr(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function qu(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function Gu(n,t){let e=[],i=!1;return kt(n)?(i=!0,e=n):e=wb(n,t),e.length?new Mn({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function Ku(n){return n&&n.fill!==!1}function vb(n,t,e){let s=n[t].fill;const r=[t];let o;if(!e)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!Rt(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;r.push(s),s=o.fill}return!1}function Mb(n,t,e){const i=Tb(n);if(ht(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Rt(s)&&Math.floor(s)===s?kb(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function kb(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function Db(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:ht(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Sb(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:ht(n)?i=n.value:i=t.getBaseValue(),i}function Tb(n){const t=n.options,e=t.fill;let i=rt(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function Cb(n){const{scale:t,index:e,line:i}=n,s=[],r=i.segments,o=i.points,a=Pb(t,e);a.push(Gu({x:null,y:t.bottom},i));for(let l=0;l<r.length;l++){const c=r[l];for(let u=c.start;u<=c.end;u++)Ob(s,o[u],a)}return new Mn({points:s,options:{}})}function Pb(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const r=i[s];if(r.index===t)break;r.hidden||e.unshift(r.dataset)}return e}function Ob(n,t,e){const i=[];for(let s=0;s<e.length;s++){const r=e[s],{first:o,last:a,point:l}=Eb(r,t,"x");if(!(!l||o&&a)){if(o)i.unshift(l);else if(n.push(l),!a)break}}n.push(...i)}function Eb(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const s=i[e],r=n.segments,o=n.points;let a=!1,l=!1;for(let c=0;c<r.length;c++){const u=r[c],d=o[u.start][e],f=o[u.end][e];if(Ze(s,d,f)){a=s===d,l=s===f;break}}return{first:a,last:l,point:i}}class Zu{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:r,radius:o}=this;return e=e||{start:0,end:Ot},t.arc(s,r,o,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,r=t.angle;return{x:e+Math.cos(r)*s,y:i+Math.sin(r)*s,angle:r}}}function Ab(n){const{chart:t,fill:e,line:i}=n;if(Rt(e))return Rb(t,e);if(e==="stack")return Cb(n);if(e==="shape")return!0;const s=Ib(n);return s instanceof Zu?s:Gu(s,i)}function Rb(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function Ib(n){return(n.scale||{}).getPointPositionForValue?Nb(n):Lb(n)}function Lb(n){const{scale:t={},fill:e}=n,i=Db(e,t);if(Rt(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function Nb(n){const{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,r=i.reverse?t.max:t.min,o=Sb(e,t,r),a=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,r);return new Zu({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(o)})}for(let l=0;l<s;++l)a.push(t.getPointPositionForValue(l,o));return a}function oa(n,t,e){const i=Ab(t),{chart:s,index:r,line:o,scale:a,axis:l}=t,c=o.options,u=c.fill,d=c.backgroundColor,{above:f=d,below:g=d}=u||{},p=s.getDatasetMeta(r),y=Zc(s,p);i&&o.points.length&&(Ki(n,e),Fb(n,{line:o,target:i,above:f,below:g,area:e,scale:a,axis:l,clip:y}),Zi(n))}function Fb(n,t){const{line:e,target:i,above:s,below:r,area:o,scale:a,clip:l}=t,c=e._loop?"angle":t.axis;n.save();let u=r;r!==s&&(c==="x"?(Qu(n,i,o.top),aa(n,{line:e,target:i,color:s,scale:a,property:c,clip:l}),n.restore(),n.save(),Qu(n,i,o.bottom)):c==="y"&&(Ju(n,i,o.left),aa(n,{line:e,target:i,color:r,scale:a,property:c,clip:l}),n.restore(),n.save(),Ju(n,i,o.right),u=s)),aa(n,{line:e,target:i,color:u,scale:a,property:c,clip:l}),n.restore()}function Qu(n,t,e){const{segments:i,points:s}=t;let r=!0,o=!1;n.beginPath();for(const a of i){const{start:l,end:c}=a,u=s[l],d=s[vr(l,c,s)];r?(n.moveTo(u.x,u.y),r=!1):(n.lineTo(u.x,e),n.lineTo(u.x,u.y)),o=!!t.pathSegment(n,a,{move:o}),o?n.closePath():n.lineTo(d.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function Ju(n,t,e){const{segments:i,points:s}=t;let r=!0,o=!1;n.beginPath();for(const a of i){const{start:l,end:c}=a,u=s[l],d=s[vr(l,c,s)];r?(n.moveTo(u.x,u.y),r=!1):(n.lineTo(e,u.y),n.lineTo(u.x,u.y)),o=!!t.pathSegment(n,a,{move:o}),o?n.closePath():n.lineTo(e,d.y)}n.lineTo(e,t.first().y),n.closePath(),n.clip()}function aa(n,t){const{line:e,target:i,property:s,color:r,scale:o,clip:a}=t,l=xb(e,i,s);for(const{source:c,target:u,start:d,end:f}of l){const{style:{backgroundColor:g=r}={}}=c,p=i!==!0;n.save(),n.fillStyle=g,zb(n,o,a,p&&ra(s,d,f)),n.beginPath();const y=!!e.pathSegment(n,c);let x;if(p){y?n.closePath():td(n,i,f,s);const v=!!i.pathSegment(n,u,{move:y,reverse:!0});x=y&&v,x||td(n,i,d,s)}n.closePath(),n.fill(x?"evenodd":"nonzero"),n.restore()}}function zb(n,t,e,i){const s=t.chart.chartArea,{property:r,start:o,end:a}=i||{};if(r==="x"||r==="y"){let l,c,u,d;r==="x"?(l=o,c=s.top,u=a,d=s.bottom):(l=s.left,c=o,u=s.right,d=a),n.beginPath(),e&&(l=Math.max(l,e.left),u=Math.min(u,e.right),c=Math.max(c,e.top),d=Math.min(d,e.bottom)),n.rect(l,c,u-l,d-c),n.clip()}}function td(n,t,e,i){const s=t.interpolate(e,i);s&&n.lineTo(s.x,s.y)}var Bb={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,s=[];let r,o,a,l;for(o=0;o<i;++o)r=n.getDatasetMeta(o),a=r.dataset,l=null,a&&a.options&&a instanceof Mn&&(l={visible:n.isDatasetVisible(o),index:o,fill:Mb(a,o,i),chart:n,axis:r.controller.options.indexAxis,scale:r.vScale,line:a}),r.$filler=l,s.push(l);for(o=0;o<i;++o)l=s[o],!(!l||l.fill===!1)&&(l.fill=vb(s,o,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",s=n.getSortedVisibleDatasetMetas(),r=n.chartArea;for(let o=s.length-1;o>=0;--o){const a=s[o].$filler;a&&(a.line.updateControlPoints(r,a.axis),i&&a.fill&&oa(n.ctx,a,r))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const r=i[s].$filler;Ku(r)&&oa(n.ctx,r,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!Ku(i)||e.drawTime!=="beforeDatasetDraw"||oa(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const ed=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},Hb=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class nd extends Jt{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,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,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=Dt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,s)=>t.sort(i,s,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 i=t.labels,s=It(i.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=ed(i,r);let c,u;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,r,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a;let d=t;r.textAlign="left",r.textBaseline="middle";let f=-1,g=-u;return this.legendItems.forEach((p,y)=>{const x=i+e/2+r.measureText(p.text).width;(y===0||c[c.length-1]+x+2*a>o)&&(d+=u,c[c.length-(y>0?0:1)]=0,g+=u,f++),l[y]={left:0,top:g,row:f,width:x,height:s},c[c.length-1]+=x+a}),d}_fitCols(t,e,i,s){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-t;let d=a,f=0,g=0,p=0,y=0;return this.legendItems.forEach((x,v)=>{const{itemWidth:M,itemHeight:D}=Wb(i,e,r,x,s);v>0&&g+D+2*a>u&&(d+=f+a,c.push({width:f,height:g}),p+=f+a,y++,f=g=0),l[v]={left:p,top:g,col:y,width:M,height:D},f=Math.max(f,M),g+=D+a}),d+=f,c.push({width:f,height:g}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:r}}=this,o=gi(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=re(i,this.left+s,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=re(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+s}else{let a=0,l=re(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=re(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Ki(t,this),this._draw(),Zi(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:r,labels:o}=t,a=At.color,l=gi(t.rtl,this.left,this.width),c=It(o.font),{padding:u}=o,d=c.size,f=d/2;let g;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:p,boxHeight:y,itemHeight:x}=ed(o,d),v=function(R,O,b){if(isNaN(p)||p<=0||isNaN(y)||y<0)return;s.save();const _=rt(b.lineWidth,1);if(s.fillStyle=rt(b.fillStyle,a),s.lineCap=rt(b.lineCap,"butt"),s.lineDashOffset=rt(b.lineDashOffset,0),s.lineJoin=rt(b.lineJoin,"miter"),s.lineWidth=_,s.strokeStyle=rt(b.strokeStyle,a),s.setLineDash(rt(b.lineDash,[])),o.usePointStyle){const C={radius:y*Math.SQRT2/2,pointStyle:b.pointStyle,rotation:b.rotation,borderWidth:_},I=l.xPlus(R,p/2),T=O+f;Ec(s,C,I,T,o.pointStyleWidth&&p)}else{const C=O+Math.max((d-y)/2,0),I=l.leftForLtr(R,p),T=xn(b.borderRadius);s.beginPath(),Object.values(T).some(F=>F!==0)?di(s,{x:I,y:C,w:p,h:y,radius:T}):s.rect(I,C,p,y),s.fill(),_!==0&&s.stroke()}s.restore()},M=function(R,O,b){Bn(s,b.text,R,O+x/2,c,{strikethrough:b.hidden,textAlign:l.textAlign(b.textAlign)})},D=this.isHorizontal(),S=this._computeTitleHeight();D?g={x:re(r,this.left+u,this.right-i[0]),y:this.top+u+S,line:0}:g={x:this.left+u,y:re(r,this.top+S+u,this.bottom-e[0].height),line:0},jc(this.ctx,t.textDirection);const P=x+u;this.legendItems.forEach((R,O)=>{s.strokeStyle=R.fontColor,s.fillStyle=R.fontColor;const b=s.measureText(R.text).width,_=l.textAlign(R.textAlign||(R.textAlign=o.textAlign)),C=p+f+b;let I=g.x,T=g.y;l.setWidth(this.width),D?O>0&&I+C+u>this.right&&(T=g.y+=P,g.line++,I=g.x=re(r,this.left+u,this.right-i[g.line])):O>0&&T+P>this.bottom&&(I=g.x=I+e[g.line].width+u,g.line++,T=g.y=re(r,this.top+S+u,this.bottom-e[g.line].height));const F=l.x(I);if(v(F,T,R),I=lp(_,I+p+f,D?I+C:this.right,t.rtl),M(l.x(I),T,R),D)g.x+=C+u;else if(typeof R.text!="string"){const U=c.lineHeight;g.y+=id(R,U)+u}else g.y+=P}),Vc(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=It(e.font),s=Ut(e.padding);if(!e.display)return;const r=gi(t.rtl,this.left,this.width),o=this.ctx,a=e.position,l=i.size/2,c=s.top+l;let u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=re(t.align,d,this.right-f);else{const p=this.columnSizes.reduce((y,x)=>Math.max(y,x.height),0);u=c+re(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const g=re(a,d,d+f);o.textAlign=r.textAlign(Oo(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,Bn(o,e.text,g,u,i)}_computeTitleHeight(){const t=this.options.title,e=It(t.font),i=Ut(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,r;if(Ze(t,this.left,this.right)&&Ze(e,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(s=r[i],Ze(t,s.left,s.left+s.width)&&Ze(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!Vb(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,r=Hb(s,i);s&&!r&&Dt(e.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!r&&Dt(e.onHover,[t,i,this],this)}else i&&Dt(e.onClick,[t,i,this],this)}}function Wb(n,t,e,i,s){const r=Yb(i,n,t,e),o=jb(s,i,t.lineHeight);return{itemWidth:r,itemHeight:o}}function Yb(n,t,e,i){let s=n.text;return s&&typeof s!="string"&&(s=s.reduce((r,o)=>r.length>o.length?r:o)),t+e.size/2+i.measureText(s).width}function jb(n,t,e){let i=n;return typeof t.text!="string"&&(i=id(t,e)),i}function id(n,t){const e=n.text?n.text.length:0;return t*e}function Vb(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var $b={id:"legend",_element:nd,start(n,t,e){const i=n.legend=new nd({ctx:n.ctx,options:e,chart:n});oe.configure(n,i,e),oe.addBox(n,i)},stop(n){oe.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;oe.configure(n,i,e),i.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 i=t.datasetIndex,s=e.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),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:i,textAlign:s,color:r,useBorderRadius:o,borderRadius:a}}=n.legend.options;return n._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),u=Ut(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:r,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:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:o&&(a||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 la extends Jt{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 i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=kt(i.text)?i.text.length:1;this._padding=Ut(i.padding);const r=s*It(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:s,right:r,options:o}=this,a=o.align;let l=0,c,u,d;return this.isHorizontal()?(u=re(a,i,r),d=e+t,c=r-i):(o.position==="left"?(u=i+t,d=re(a,s,e),l=ct*-.5):(u=r-t,d=re(a,e,s),l=ct*.5),c=s-e),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=It(e.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);Bn(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:Oo(e.align),textBaseline:"middle",translation:[o,a]})}}function Ub(n,t){const e=new la({ctx:n.ctx,options:t,chart:n});oe.configure(n,e,t),oe.addBox(n,e),n.titleBlock=e}var Xb={id:"title",_element:la,start(n,t,e){Ub(n,e)},stop(n){const t=n.titleBlock;oe.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;oe.configure(n,i,e),i.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 Mr=new WeakMap;var qb={id:"subtitle",start(n,t,e){const i=new la({ctx:n.ctx,options:e,chart:n});oe.configure(n,i,e),oe.addBox(n,i),Mr.set(n,i)},stop(n){oe.removeBox(n,Mr.get(n)),Mr.delete(n)},beforeUpdate(n,t,e){const i=Mr.get(n);oe.configure(n,i,e),i.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 ds={average(n){if(!n.length)return!1;let t,e,i=new Set,s=0,r=0;for(t=0,e=n.length;t<e;++t){const a=n[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();i.add(l.x),s+=l.y,++r}}return r===0||i.size===0?!1:{x:[...i].reduce((a,l)=>a+l)/i.size,y:s/r}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,s=Number.POSITIVE_INFINITY,r,o,a;for(r=0,o=n.length;r<o;++r){const l=n[r].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=ui(t,c);u<s&&(s=u,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function Ye(n,t){return t&&(kt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function nn(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
|
17
17
|
`)>-1?n.split(`
|
|
18
|
-
`):n}function Gb(n,t){const{element:e,datasetIndex:i,index:s}=t,r=n.getDatasetMeta(i).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:n,label:o,parsed:r.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function sd(n,t){const e=n.chart.ctx,{body:i,footer:s,title:r}=n,{boxWidth:o,boxHeight:a}=t,l=It(t.bodyFont),c=It(t.titleFont),u=It(t.footerFont),d=r.length,f=s.length,g=i.length,p=Ut(t.padding);let y=p.height,x=0,v=i.reduce((S,C)=>S+C.before.length+C.lines.length+C.after.length,0);if(v+=n.beforeBody.length+n.afterBody.length,d&&(y+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),v){const S=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;y+=g*S+(v-g)*l.lineHeight+(v-1)*t.bodySpacing}f&&(y+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let M=0;const D=function(S){x=Math.max(x,e.measureText(S).width+M)};return e.save(),e.font=c.string,St(n.title,D),e.font=l.string,St(n.beforeBody.concat(n.afterBody),D),M=t.displayColors?o+2+t.boxPadding:0,St(i,S=>{St(S.before,D),St(S.lines,D),St(S.after,D)}),M=0,e.font=u.string,St(n.footer,D),e.restore(),x+=p.width,{width:x,height:y}}function Kb(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function Zb(n,t,e,i){const{x:s,width:r}=i,o=e.caretSize+e.caretPadding;if(n==="left"&&s+r+o>t.width||n==="right"&&s-r-o<0)return!0}function Qb(n,t,e,i){const{x:s,width:r}=e,{width:o,chartArea:{left:a,right:l}}=n;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),Zb(c,n,t,e)&&(c="center"),c}function rd(n,t,e){const i=e.yAlign||t.yAlign||Kb(n,e);return{xAlign:e.xAlign||t.xAlign||Qb(n,t,e,i),yAlign:i}}function Jb(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function t0(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function od(n,t,e,i){const{caretSize:s,caretPadding:r,cornerRadius:o}=n,{xAlign:a,yAlign:l}=e,c=s+r,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:g}=xn(o);let p=Jb(t,a);const y=t0(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,f)+s:a==="right"&&(p+=Math.max(d,g)+s),{x:Qt(p,0,i.width-t.width),y:Qt(y,0,i.height-t.height)}}function kr(n,t,e){const i=Ut(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function ad(n){return Ye([],nn(n))}function e0(n,t,e){return wn(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function ld(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const cd={beforeTitle:Ke,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:Ke,beforeBody:Ke,beforeLabel:Ke,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 st(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:Ke,afterBody:Ke,beforeFooter:Ke,footer:Ke,afterFooter:Ke};function me(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?cd[t].call(e,i):s}class ca extends Jt{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,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,r=new Yo(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=e0(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=me(i,"beforeTitle",this,t),r=me(i,"title",this,t),o=me(i,"afterTitle",this,t);let a=[];return a=Ye(a,nn(s)),a=Ye(a,nn(r)),a=Ye(a,nn(o)),a}getBeforeBody(t,e){return ad(me(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return St(t,r=>{const o={before:[],lines:[],after:[]},a=ld(i,r);Ye(o.before,nn(me(a,"beforeLabel",this,r))),Ye(o.lines,me(a,"label",this,r)),Ye(o.after,nn(me(a,"afterLabel",this,r))),s.push(o)}),s}getAfterBody(t,e){return ad(me(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=me(i,"beforeFooter",this,t),r=me(i,"footer",this,t),o=me(i,"afterFooter",this,t);let a=[];return a=Ye(a,nn(s)),a=Ye(a,nn(r)),a=Ye(a,nn(o)),a}_createItems(t){const e=this._active,i=this.chart.data,s=[],r=[],o=[];let a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(Gb(this.chart,e[l]));return t.filter&&(a=a.filter((u,d,f)=>t.filter(u,d,f,i))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,i))),St(a,u=>{const d=ld(t.callbacks,u);s.push(me(d,"labelColor",this,u)),r.push(me(d,"labelPointStyle",this,u)),o.push(me(d,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let r,o=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const a=ds[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const l=this._size=sd(this,i),c=Object.assign({},a,l),u=rd(this.chart,i,c),d=od(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const r=this.getCaretPosition(t,i,s);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:r}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=xn(a),{x:f,y:g}=t,{width:p,height:y}=e;let x,v,M,D,S,C;return r==="center"?(S=g+y/2,s==="left"?(x=f,v=x-o,D=S+o,C=S-o):(x=f+p,v=x+o,D=S-o,C=S+o),M=x):(s==="left"?v=f+Math.max(l,u)+o:s==="right"?v=f+p-Math.max(c,d)-o:v=this.caretX,r==="top"?(D=g,S=D-o,x=v-o,M=v+o):(D=g+y,S=D+o,x=v+o,M=v-o),C=D),{x1:x,x2:v,x3:M,y1:D,y2:S,y3:C}}drawTitle(t,e,i){const s=this.title,r=s.length;let o,a,l;if(r){const c=gi(i.rtl,this.x,this.width);for(t.x=kr(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",o=It(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,l=0;l<r;++l)e.fillText(s[l],c.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===r&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,e,i,s,r){const o=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=r,u=It(r.bodyFont),d=kr(this,"left",r),f=s.x(d),g=l<u.lineHeight?(u.lineHeight-l)/2:0,p=e.y+g;if(r.usePointStyle){const y={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},x=s.leftForLtr(f,c)+c/2,v=p+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Lo(t,y,x,v),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Lo(t,y,x,v)}else{t.lineWidth=ht(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const y=s.leftForLtr(f,c),x=s.leftForLtr(s.xPlus(f,1),c-2),v=xn(o.borderRadius);Object.values(v).some(M=>M!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,di(t,{x:y,y:p,w:c,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),di(t,{x,y:p+1,w:c-2,h:l-2,radius:v}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(y,p,c,l),t.strokeRect(y,p,c,l),t.fillStyle=o.backgroundColor,t.fillRect(x,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=It(i.bodyFont);let f=d.lineHeight,g=0;const p=gi(i.rtl,this.x,this.width),y=function(b){e.fillText(b,p.x(t.x+g),t.y+f/2),t.y+=f+r},x=p.textAlign(o);let v,M,D,S,C,R,O;for(e.textAlign=o,e.textBaseline="middle",e.font=d.string,t.x=kr(this,x,i),e.fillStyle=i.bodyColor,St(this.beforeBody,y),g=a&&x!=="right"?o==="center"?c/2+u:c+2+u:0,S=0,R=s.length;S<R;++S){for(v=s[S],M=this.labelTextColors[S],e.fillStyle=M,St(v.before,y),D=v.lines,a&&D.length&&(this._drawColorBox(e,t,S,p,i),f=Math.max(d.lineHeight,l)),C=0,O=D.length;C<O;++C)y(D[C]),f=d.lineHeight;St(v.after,y)}g=0,f=d.lineHeight,St(this.afterBody,y),t.y-=r}drawFooter(t,e,i){const s=this.footer,r=s.length;let o,a;if(r){const l=gi(i.rtl,this.x,this.width);for(t.x=kr(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",o=It(i.footerFont),e.fillStyle=i.footerColor,e.font=o.string,a=0;a<r;++a)e.fillText(s[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:r,yAlign:o}=this,{x:a,y:l}=t,{width:c,height:u}=i,{topLeft:d,topRight:f,bottomLeft:g,bottomRight:p}=xn(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(a+d,l),o==="top"&&this.drawCaret(t,e,i,s),e.lineTo(a+c-f,l),e.quadraticCurveTo(a+c,l,a+c,l+f),o==="center"&&r==="right"&&this.drawCaret(t,e,i,s),e.lineTo(a+c,l+u-p),e.quadraticCurveTo(a+c,l+u,a+c-p,l+u),o==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(a+g,l+u),e.quadraticCurveTo(a,l+u,a,l+u-g),o==="center"&&r==="left"&&this.drawCaret(t,e,i,s),e.lineTo(a,l+d),e.quadraticCurveTo(a,l,a+d,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const o=ds[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=sd(this,t),l=Object.assign({},o,this._size),c=rd(e,t,l),u=od(t,l,c,e);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Ut(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,s,e),jc(t,e.textDirection),r.y+=o.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),Vc(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!Gs(i,s),o=this._positionChanged(s,e);(r||o)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],o=this._getActiveElements(t,r,e,i),a=this._positionChanged(o,t),l=e||!Gs(o,r)||a;return l&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:s,options:r}=this,o=ds[r.position].call(this,t,e);return o!==!1&&(i!==o.x||s!==o.y)}}E(ca,"positioners",ds);var je={id:"tooltip",_element:ca,positioners:ds,afterInit(n,t,e){e&&(n.tooltip=new ca({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:cd},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"]},n0=Object.freeze({__proto__:null,Colors:pb,Decimation:_b,Filler:Bb,Legend:$b,SubTitle:qb,Title:Xb,Tooltip:je});const i0=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function s0(n,t,e,i){const s=n.indexOf(t);if(s===-1)return i0(n,t,e,i);const r=n.lastIndexOf(t);return s!==r?e:s}const r0=(n,t)=>n===null?null:Qt(Math.round(n),0,t);function ud(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class ua extends jn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:s,label:r}of e)i[s]===r&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(st(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:s0(i,t,rt(e,t),this._addedLabels),r0(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let r=this.getLabels();r=t===0&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=t;o<=e;o++)s.push({value:o});return s}getLabelForValue(t){return ud.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}}E(ua,"id","category"),E(ua,"defaults",{ticks:{callback:ud}});function o0(n,t){const e=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=n,g=r||1,p=u-1,{min:y,max:x}=t,v=!st(o),M=!st(a),D=!st(c),S=(x-y)/(d+1);let C=pc((x-y)/p/g)*g,R,O,b,_;if(C<1e-14&&!v&&!M)return[{value:y},{value:x}];_=Math.ceil(x/C)-Math.floor(y/C),_>p&&(C=pc(_*C/p/g)*g),st(l)||(R=Math.pow(10,l),C=Math.ceil(C*R)/R),s==="ticks"?(O=Math.floor(y/C)*C,b=Math.ceil(x/C)*C):(O=y,b=x),v&&M&&r&&ep((a-o)/r,C/1e3)?(_=Math.round(Math.min((a-o)/C,u)),C=(a-o)/_,O=o,b=a):D?(O=v?o:O,b=M?a:b,_=c-1,C=(b-O)/_):(_=(b-O)/C,$i(_,Math.round(_),C/1e3)?_=Math.round(_):_=Math.ceil(_));const T=Math.max(yc(C),yc(O));R=Math.pow(10,st(l)?T:l),O=Math.round(O*R)/R,b=Math.round(b*R)/R;let I=0;for(v&&(f&&O!==o?(e.push({value:o}),O<o&&I++,$i(Math.round((O+I*C)*R)/R,o,dd(o,S,n))&&I++):O<o&&I++);I<_;++I){const P=Math.round((O+I*C)*R)/R;if(M&&P>a)break;e.push({value:P})}return M&&f&&b!==a?e.length&&$i(e[e.length-1].value,a,dd(a,S,n))?e[e.length-1].value=a:e.push({value:a}):(!M||b===a)&&e.push({value:b}),e}function dd(n,t,{horizontal:e,minRotation:i}){const s=$t(i),r=(e?Math.sin(s):Math.cos(s))||.001,o=.75*t*(""+n).length;return Math.min(t/r,o)}class Dr extends jn{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 st(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:r}=this;const o=l=>s=e?s:l,a=l=>r=i?r:l;if(t){const l=He(s),c=He(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(s===r){let l=r===0?1:Math.abs(r*.05);a(r+l),t||o(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,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},r=this._range||this,o=o0(s,r);return t.bounds==="ticks"&&mc(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return qi(t,this.chart.options.locale,this.options.ticks.format)}}class da extends Dr{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Rt(t)?t:0,this.max=Rt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=$t(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}E(da,"id","linear"),E(da,"defaults",{ticks:{callback:nr.formatters.numeric}});const hs=n=>Math.floor(bn(n)),Vn=(n,t)=>Math.pow(10,hs(n)+t);function hd(n){return n/Math.pow(10,hs(n))===1}function fd(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function a0(n,t){const e=t-n;let i=hs(e);for(;fd(n,t,i)>10;)i++;for(;fd(n,t,i)<10;)i--;return Math.min(i,hs(n))}function l0(n,{min:t,max:e}){t=Me(n.min,t);const i=[],s=hs(t);let r=a0(t,e),o=r<0?Math.pow(10,Math.abs(r)):1;const a=Math.pow(10,r),l=s>r?Math.pow(10,s):0,c=Math.round((t-l)*o)/o,u=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((c-u)/Math.pow(10,r)),f=Me(n.min,Math.round((l+u+d*Math.pow(10,r))*o)/o);for(;f<e;)i.push({value:f,major:hd(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(r++,d=2,o=r>=0?1:o),f=Math.round((l+u+d*Math.pow(10,r))*o)/o;const g=Me(n.max,f);return i.push({value:g,major:hd(g),significand:d}),i}class ha extends jn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Dr.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return Rt(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Rt(t)?Math.max(0,t):null,this.max=Rt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Rt(this._userMin)&&(this.min=t===Vn(this.min,0)?Vn(this.min,-1):Vn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const r=a=>i=t?i:a,o=a=>s=e?s:a;i===s&&(i<=0?(r(1),o(10)):(r(Vn(i,-1)),o(Vn(s,1)))),i<=0&&r(Vn(s,-1)),s<=0&&o(Vn(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=l0(e,this);return t.bounds==="ticks"&&mc(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":qi(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=bn(t),this._valueRange=bn(this.max)-bn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(bn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}E(ha,"id","logarithmic"),E(ha,"defaults",{ticks:{callback:nr.formatters.logarithmic,major:{enabled:!0}}});function fa(n){const t=n.ticks;if(t.display&&n.display){const e=Ut(t.backdropPadding);return rt(t.font&&t.font.size,At.font.size)+e.height}return 0}function c0(n,t,e){return e=kt(e)?e:[e],{w:bp(n,t.string,e),h:e.length*t.lineHeight}}function gd(n,t,e,i,s){return n===i||n===s?{start:t-e/2,end:t+e/2}:n<i||n>s?{start:t-e,end:t}:{start:t,end:t+e}}function u0(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),i=[],s=[],r=n._pointLabels.length,o=n.options.pointLabels,a=o.centerPointLabels?ct/r:0;for(let l=0;l<r;l++){const c=o.setContext(n.getPointLabelContext(l));s[l]=c.padding;const u=n.getPointPosition(l,n.drawingArea+s[l],a),d=It(c.font),f=c0(n.ctx,d,n._pointLabels[l]);i[l]=f;const g=se(n.getIndexAngle(l)+a),p=Math.round(Js(g)),y=gd(p,u.x,f.w,0,180),x=gd(p,u.y,f.h,90,270);d0(e,t,g,y,x)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=g0(n,i,s)}function d0(n,t,e,i,s){const r=Math.abs(Math.sin(e)),o=Math.abs(Math.cos(e));let a=0,l=0;i.start<t.l?(a=(t.l-i.start)/r,n.l=Math.min(n.l,t.l-a)):i.end>t.r&&(a=(i.end-t.r)/r,n.r=Math.max(n.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/o,n.t=Math.min(n.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/o,n.b=Math.max(n.b,t.b+l))}function h0(n,t,e){const i=n.drawingArea,{extra:s,additionalAngle:r,padding:o,size:a}=e,l=n.getPointPosition(t,i+s+o,r),c=Math.round(Js(se(l.angle+Et))),u=y0(l.y,a.h,c),d=p0(c),f=m0(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:f,top:u,right:f+a.w,bottom:u+a.h}}function f0(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:r}=n;return!(Je({x:e,y:i},t)||Je({x:e,y:r},t)||Je({x:s,y:i},t)||Je({x:s,y:r},t))}function g0(n,t,e){const i=[],s=n._pointLabels.length,r=n.options,{centerPointLabels:o,display:a}=r.pointLabels,l={extra:fa(r)/2,additionalAngle:o?ct/s:0};let c;for(let u=0;u<s;u++){l.padding=e[u],l.size=t[u];const d=h0(n,u,l);i.push(d),a==="auto"&&(d.visible=f0(d,c),d.visible&&(c=d))}return i}function p0(n){return n===0||n===180?"center":n<180?"left":"right"}function m0(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function y0(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function b0(n,t,e){const{left:i,top:s,right:r,bottom:o}=e,{backdropColor:a}=t;if(!st(a)){const l=xn(t.borderRadius),c=Ut(t.backdropPadding);n.fillStyle=a;const u=i-c.left,d=s-c.top,f=r-i+c.width,g=o-s+c.height;Object.values(l).some(p=>p!==0)?(n.beginPath(),di(n,{x:u,y:d,w:f,h:g,radius:l}),n.fill()):n.fillRect(u,d,f,g)}}function _0(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let s=t-1;s>=0;s--){const r=n._pointLabelItems[s];if(!r.visible)continue;const o=i.setContext(n.getPointLabelContext(s));b0(e,o,r);const a=It(o.font),{x:l,y:c,textAlign:u}=r;Bn(e,n._pointLabels[s],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function pd(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,Ot);else{let r=n.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let o=1;o<i;o++)r=n.getPointPosition(o,t),s.lineTo(r.x,r.y)}}function x0(n,t,e,i,s){const r=n.ctx,o=t.circular,{color:a,lineWidth:l}=t;!o&&!i||!a||!l||e<0||(r.save(),r.strokeStyle=a,r.lineWidth=l,r.setLineDash(s.dash||[]),r.lineDashOffset=s.dashOffset,r.beginPath(),pd(n,e,o,i),r.closePath(),r.stroke(),r.restore())}function w0(n,t,e){return wn(n,{label:e,index:t,type:"pointLabel"})}class fs extends Dr{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=Ut(fa(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=Rt(t)&&!isNaN(t)?t:0,this.max=Rt(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/fa(this.options))}generateTickLabels(t){Dr.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=Dt(this.options.pointLabels.callback,[e,i],this);return s||s===0?s:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?u0(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){const e=Ot/(this._pointLabels.length||1),i=this.options.startAngle||0;return se(t*e+$t(i))}getDistanceFromCenterForValue(t){if(st(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(st(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 i=e[t];return w0(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-Et+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}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:i,right:s,bottom:r}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:r}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),pd(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s,border:r}=e,o=this._pointLabels.length;let a,l,c;if(e.pointLabels.display&&_0(this,o),s.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(d),g=s.setContext(f),p=r.setContext(f);x0(this,g,l,o,p)}}),i.display){for(t.save(),a=o-1;a>=0;a--){const u=i.setContext(this.getPointLabelContext(a)),{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.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const c=i.setContext(this.getContext(l)),u=It(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=Ut(c.backdropPadding);t.fillRect(-o/2-d.left,-r-u.size/2-d.top,o+d.width,u.size+d.height)}Bn(t,a.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}E(fs,"id","radialLinear"),E(fs,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:nr.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),E(fs,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),E(fs,"descriptors",{angleLines:{_fallback:"grid"}});const Sr={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}},ye=Object.keys(Sr);function md(n,t){return n-t}function yd(n,t){if(st(t))return null;const e=n._adapter,{parser:i,round:s,isoWeekday:r}=n._parseOpts;let o=t;return typeof i=="function"&&(o=i(o)),Rt(o)||(o=typeof i=="string"?e.parse(o,i):e.parse(o)),o===null?null:(s&&(o=s==="week"&&(_n(r)||r===!0)?e.startOf(o,"isoWeek",r):e.startOf(o,s)),+o)}function bd(n,t,e,i){const s=ye.length;for(let r=ye.indexOf(n);r<s-1;++r){const o=Sr[ye[r]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((e-t)/(a*o.size))<=i)return ye[r]}return ye[s-1]}function v0(n,t,e,i,s){for(let r=ye.length-1;r>=ye.indexOf(e);r--){const o=ye[r];if(Sr[o].common&&n._adapter.diff(s,i,o)>=t-1)return o}return ye[e?ye.indexOf(e):0]}function M0(n){for(let t=ye.indexOf(n)+1,e=ye.length;t<e;++t)if(Sr[ye[t]].common)return ye[t]}function _d(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=Po(e,t),r=e[i]>=t?e[i]:e[s];n[r]=!0}}function k0(n,t,e,i){const s=n._adapter,r=+s.startOf(t[0].value,i),o=t[t.length-1].value;let a,l;for(a=r;a<=o;a=+s.add(a,1,i))l=e[a],l>=0&&(t[l].major=!0);return t}function xd(n,t,e){const i=[],s={},r=t.length;let o,a;for(o=0;o<r;++o)a=t[o],s[a]=o,i.push({value:a,major:!1});return r===0||!e?i:k0(n,i,s,e)}class gs extends jn{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 i=t.time||(t.time={}),s=this._adapter=new cu._date(t.adapters.date);s.init(e),Vi(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.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,i=t.time.unit||"day";let{min:s,max:r,minDefined:o,maxDefined:a}=this.getUserBounds();function l(c){!o&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(r=Math.max(r,c.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=Rt(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),r=Rt(r)&&!isNaN(r)?r:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,r-1),this.max=Math.max(s+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const r=this.min,o=this.max,a=rp(s,r,o);return this._unit=e.unit||(i.autoSkip?bd(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):v0(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:M0(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),xd(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;e=Qt(e,0,o),i=Qt(i,0,o),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,r=s.time,o=r.unit||bd(r.minUnit,e,i,this._getLabelCapacity(e)),a=rt(s.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=_n(l)||l===!0,u={};let d=e,f,g;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":o),t.diff(i,e,o)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+o);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(f=d,g=0;f<i;f=+t.add(f,a,o),g++)_d(u,f,p);return(f===i||s.bounds==="ticks"||g===1)&&_d(u,f,p),Object.keys(u).sort(md).map(y=>+y)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,r=this._unit,o=e||s[r];return this._adapter.format(t,o)}_tickFormatFunction(t,e,i,s){const r=this.options,o=r.ticks.callback;if(o)return Dt(o,[t,e,i],this);const a=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],f=i[e],g=c&&d&&f&&f.major;return this._adapter.format(t,s||(g?d:u))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=$t(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(s),o=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:i*r+a*o,h:i*o+a*r}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,r=this._tickFormatFunction(t,0,xd(this,[t],this._majorUnit),s),o=this._getLabelSize(r),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,i=s.length;e<i;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(yd(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return xc(t.sort(md))}}E(gs,"id","time"),E(gs,"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 Tr(n,t,e){let i=0,s=n.length-1,r,o,a,l;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=Qe(n,"pos",t)),{pos:r,time:a}=n[i],{pos:o,time:l}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=Qe(n,"time",t)),{time:r,pos:a}=n[i],{time:o,pos:l}=n[s]);const c=o-r;return c?a+(l-a)*(t-r)/c:a}class ga extends gs{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=Tr(e,this.min),this._tableRange=Tr(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],r=[];let o,a,l,c,u;for(o=0,a=t.length;o<a;++o)c=t[o],c>=e&&c<=i&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,a=s.length;o<a;++o)u=s[o+1],l=s[o-1],c=s[o],Math.round((u+l)/2)!==c&&r.push({time:c,pos:o/(a-1)});return r}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((s,r)=>s-r)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Tr(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Tr(this._table,i*this._tableRange+this._minPos,!0)}}E(ga,"id","timeseries"),E(ga,"defaults",gs.defaults);var D0=Object.freeze({__proto__:null,CategoryScale:ua,LinearScale:da,LogarithmicScale:ha,RadialLinearScale:fs,TimeScale:gs,TimeSeriesScale:ga});const S0=[Im,lb,n0,D0],wd=6048e5,T0=864e5,ps=6e4,mi=36e5,C0=1e3,vd=Symbol.for("constructDateFrom");function Ft(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&vd in n?n[vd](t):n instanceof Date?new n.constructor(t):new Date(t)}function lt(n,t){return Ft(t||n,n)}function Cr(n,t,e){const i=lt(n,e==null?void 0:e.in);return isNaN(t)?Ft((e==null?void 0:e.in)||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function pa(n,t,e){const i=lt(n,e==null?void 0:e.in);if(isNaN(t))return Ft(n,NaN);if(!t)return i;const s=i.getDate(),r=Ft(n,i.getTime());r.setMonth(i.getMonth()+t+1,0);const o=r.getDate();return s>=o?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}function ma(n,t,e){return Ft(n,+lt(n)+t)}function P0(n,t,e){return ma(n,t*mi)}let O0={};function $n(){return O0}function Ve(n,t){var a,l,c,u;const e=$n(),i=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,s=lt(n,t==null?void 0:t.in),r=s.getDay(),o=(r<i?7:0)+r-i;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function yi(n,t){return Ve(n,{...t,weekStartsOn:1})}function Md(n,t){const e=lt(n,t==null?void 0:t.in),i=e.getFullYear(),s=Ft(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=yi(s),o=Ft(e,0);o.setFullYear(i,0,4),o.setHours(0,0,0,0);const a=yi(o);return e.getTime()>=r.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function Pr(n){const t=lt(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function Un(n,...t){const e=Ft.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function ya(n,t){const e=lt(n,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function kd(n,t,e){const[i,s]=Un(e==null?void 0:e.in,n,t),r=ya(i),o=ya(s),a=+r-Pr(r),l=+o-Pr(o);return Math.round((a-l)/T0)}function E0(n,t){const e=Md(n,t),i=Ft(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),yi(i)}function A0(n,t,e){const i=lt(n,e==null?void 0:e.in);return i.setTime(i.getTime()+t*ps),i}function R0(n,t,e){return pa(n,t*3,e)}function I0(n,t,e){return ma(n,t*1e3)}function L0(n,t,e){return Cr(n,t*7,e)}function N0(n,t,e){return pa(n,t*12,e)}function ms(n,t){const e=+lt(n)-+lt(t);return e<0?-1:e>0?1:e}function F0(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function ba(n){return!(!F0(n)&&typeof n!="number"||isNaN(+lt(n)))}function z0(n,t,e){const[i,s]=Un(e==null?void 0:e.in,n,t),r=i.getFullYear()-s.getFullYear(),o=i.getMonth()-s.getMonth();return r*12+o}function B0(n,t,e){const[i,s]=Un(e==null?void 0:e.in,n,t);return i.getFullYear()-s.getFullYear()}function Dd(n,t,e){const[i,s]=Un(e==null?void 0:e.in,n,t),r=Sd(i,s),o=Math.abs(kd(i,s));i.setDate(i.getDate()-r*o);const a=+(Sd(i,s)===-r),l=r*(o-a);return l===0?0:l}function Sd(n,t){const 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 ys(n){return t=>{const i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function H0(n,t,e){const[i,s]=Un(e==null?void 0:e.in,n,t),r=(+i-+s)/mi;return ys(e==null?void 0:e.roundingMethod)(r)}function _a(n,t){return+lt(n)-+lt(t)}function W0(n,t,e){const i=_a(n,t)/ps;return ys(e==null?void 0:e.roundingMethod)(i)}function Td(n,t){const e=lt(n,t==null?void 0:t.in);return e.setHours(23,59,59,999),e}function Cd(n,t){const e=lt(n,t==null?void 0:t.in),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function Y0(n,t){const e=lt(n,t==null?void 0:t.in);return+Td(e,t)==+Cd(e,t)}function Pd(n,t,e){const[i,s,r]=Un(e==null?void 0:e.in,n,n,t),o=ms(s,r),a=Math.abs(z0(s,r));if(a<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-o*a);let l=ms(s,r)===-o;Y0(i)&&a===1&&ms(i,r)===1&&(l=!1);const c=o*(a-+l);return c===0?0:c}function j0(n,t,e){const i=Pd(n,t,e)/3;return ys(e==null?void 0:e.roundingMethod)(i)}function V0(n,t,e){const i=_a(n,t)/1e3;return ys(e==null?void 0:e.roundingMethod)(i)}function $0(n,t,e){const i=Dd(n,t,e)/7;return ys(e==null?void 0:e.roundingMethod)(i)}function U0(n,t,e){const[i,s]=Un(e==null?void 0:e.in,n,t),r=ms(i,s),o=Math.abs(B0(i,s));i.setFullYear(1584),s.setFullYear(1584);const a=ms(i,s)===-r,l=r*(o-+a);return l===0?0:l}function X0(n,t){const e=lt(n,t==null?void 0:t.in),i=e.getMonth(),s=i-i%3;return e.setMonth(s,1),e.setHours(0,0,0,0),e}function q0(n,t){const e=lt(n,t==null?void 0:t.in);return e.setDate(1),e.setHours(0,0,0,0),e}function G0(n,t){const e=lt(n,t==null?void 0:t.in),i=e.getFullYear();return e.setFullYear(i+1,0,0),e.setHours(23,59,59,999),e}function Od(n,t){const e=lt(n,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function K0(n,t){const e=lt(n,t==null?void 0:t.in);return e.setMinutes(59,59,999),e}function Z0(n,t){var a,l;const e=$n(),i=e.weekStartsOn??((l=(a=e.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??0,s=lt(n,t==null?void 0:t.in),r=s.getDay(),o=(r<i?-7:0)+6-(r-i);return s.setDate(s.getDate()+o),s.setHours(23,59,59,999),s}function Q0(n,t){const e=lt(n,t==null?void 0:t.in);return e.setSeconds(59,999),e}function J0(n,t){const e=lt(n,t==null?void 0:t.in),i=e.getMonth(),s=i-i%3+3;return e.setMonth(s,0),e.setHours(23,59,59,999),e}function t_(n,t){const e=lt(n,t==null?void 0:t.in);return e.setMilliseconds(999),e}const 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"}},n_=(n,t,e)=>{let i;const s=e_[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function xa(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const i_={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},s_={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},r_={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},o_={date:xa({formats:i_,defaultWidth:"full"}),time:xa({formats:s_,defaultWidth:"full"}),dateTime:xa({formats:r_,defaultWidth:"full"})},a_={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},l_=(n,t,e,i)=>a_[n];function bs(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const o=n.defaultFormattingWidth||n.defaultWidth,a=e!=null&&e.width?String(e.width):o;s=n.formattingValues[a]||n.formattingValues[o]}else{const o=n.defaultWidth,a=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[a]||n.values[o]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const c_={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},u_={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},d_={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"]},h_={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"]},f_={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"}},g_={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"}},p_={ordinalNumber:(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:bs({values:c_,defaultWidth:"wide"}),quarter:bs({values:u_,defaultWidth:"wide",argumentCallback:n=>n-1}),month:bs({values:d_,defaultWidth:"wide"}),day:bs({values:h_,defaultWidth:"wide"}),dayPeriod:bs({values:f_,defaultWidth:"wide",formattingValues:g_,defaultFormattingWidth:"wide"})};function _s(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(s);if(!r)return null;const o=r[0],a=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(a)?y_(a,d=>d.test(o)):m_(a,d=>d.test(o));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(o.length);return{value:c,rest:u}}}function m_(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function y_(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function b_(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],r=t.match(n.parsePattern);if(!r)return null;let o=n.valueCallback?n.valueCallback(r[0]):r[0];o=e.valueCallback?e.valueCallback(o):o;const a=t.slice(s.length);return{value:o,rest:a}}}const __=/^(\d+)(th|st|nd|rd)?/i,x_=/\d+/i,w_={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},v_={any:[/^b/i,/^(a|c)/i]},M_={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},k_={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},S_={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]},T_={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},C_={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]},P_={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},O_={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}},E_={ordinalNumber:b_({matchPattern:__,parsePattern:x_,valueCallback:n=>parseInt(n,10)}),era:_s({matchPatterns:w_,defaultMatchWidth:"wide",parsePatterns:v_,defaultParseWidth:"any"}),quarter:_s({matchPatterns:M_,defaultMatchWidth:"wide",parsePatterns:k_,defaultParseWidth:"any",valueCallback:n=>n+1}),month:_s({matchPatterns:D_,defaultMatchWidth:"wide",parsePatterns:S_,defaultParseWidth:"any"}),day:_s({matchPatterns:T_,defaultMatchWidth:"wide",parsePatterns:C_,defaultParseWidth:"any"}),dayPeriod:_s({matchPatterns:P_,defaultMatchWidth:"any",parsePatterns:O_,defaultParseWidth:"any"})},Ed={code:"en-US",formatDistance:n_,formatLong:o_,formatRelative:l_,localize:p_,match:E_,options:{weekStartsOn:0,firstWeekContainsDate:1}};function A_(n,t){const e=lt(n,t==null?void 0:t.in);return kd(e,Od(e))+1}function Ad(n,t){const e=lt(n,t==null?void 0:t.in),i=+yi(e)-+E0(e);return Math.round(i/wd)+1}function wa(n,t){var u,d,f,g;const e=lt(n,t==null?void 0:t.in),i=e.getFullYear(),s=$n(),r=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??s.firstWeekContainsDate??((g=(f=s.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=Ft((t==null?void 0:t.in)||n,0);o.setFullYear(i+1,0,r),o.setHours(0,0,0,0);const a=Ve(o,t),l=Ft((t==null?void 0:t.in)||n,0);l.setFullYear(i,0,r),l.setHours(0,0,0,0);const c=Ve(l,t);return+e>=+a?i+1:+e>=+c?i:i-1}function R_(n,t){var a,l,c,u;const e=$n(),i=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,s=wa(n,t),r=Ft((t==null?void 0:t.in)||n,0);return r.setFullYear(s,0,i),r.setHours(0,0,0,0),Ve(r,t)}function Rd(n,t){const e=lt(n,t==null?void 0:t.in),i=+Ve(e,t)-+R_(e,t);return Math.round(i/wd)+1}function Tt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Dn={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Tt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Tt(e+1,2)},d(n,t){return Tt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Tt(n.getHours()%12||12,t.length)},H(n,t){return Tt(n.getHours(),t.length)},m(n,t){return Tt(n.getMinutes(),t.length)},s(n,t){return Tt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return Tt(s,t.length)}},bi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Id={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return Dn.y(n,t)},Y:function(n,t,e,i){const s=wa(n,i),r=s>0?s:1-s;if(t==="YY"){const o=r%100;return Tt(o,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Tt(r,t.length)},R:function(n,t){const e=Md(n);return Tt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Tt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Tt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Tt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return Dn.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return Tt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=Rd(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):Tt(s,t.length)},I:function(n,t,e){const i=Ad(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Tt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):Dn.d(n,t)},D:function(n,t,e){const i=A_(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Tt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return Tt(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return Tt(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return Tt(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const s=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=bi.noon:i===0?s=bi.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let s;switch(i>=17?s=bi.evening:i>=12?s=bi.afternoon:i>=4?s=bi.morning:s=bi.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return Dn.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Dn.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Tt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Tt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):Dn.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Dn.s(n,t)},S:function(n,t){return Dn.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Nd(i);case"XXXX":case"XX":return Xn(i);case"XXXXX":case"XXX":default:return Xn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Nd(i);case"xxxx":case"xx":return Xn(i);case"xxxxx":case"xxx":default:return Xn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Ld(i,":");case"OOOO":default:return"GMT"+Xn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Ld(i,":");case"zzzz":default:return"GMT"+Xn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Tt(i,t.length)},T:function(n,t,e){return Tt(+n,t.length)}};function Ld(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Tt(r,2)}function Nd(n,t){return n%60===0?(n>0?"-":"+")+Tt(Math.abs(n)/60,2):Xn(n,t)}function Xn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Tt(Math.trunc(i/60),2),r=Tt(i%60,2);return e+s+t+r}const Fd=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},zd=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},va={p:zd,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Fd(n,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",Fd(i,t)).replace("{{time}}",zd(s,t))}},I_=/^D+$/,L_=/^Y+$/,N_=["D","DD","YY","YYYY"];function Bd(n){return I_.test(n)}function Hd(n){return L_.test(n)}function Ma(n,t,e){const i=F_(n,t,e);if(console.warn(i),N_.includes(n))throw new RangeError(i)}function F_(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const z_=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,B_=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,H_=/^'([^]*?)'?$/,W_=/''/g,Y_=/[a-zA-Z]/;function Wd(n,t,e){var u,d,f,g,p,y,x,v;const i=$n(),s=(e==null?void 0:e.locale)??i.locale??Ed,r=(e==null?void 0:e.firstWeekContainsDate)??((d=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??i.firstWeekContainsDate??((g=(f=i.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=(e==null?void 0:e.weekStartsOn)??((y=(p=e==null?void 0:e.locale)==null?void 0:p.options)==null?void 0:y.weekStartsOn)??i.weekStartsOn??((v=(x=i.locale)==null?void 0:x.options)==null?void 0:v.weekStartsOn)??0,a=lt(n,e==null?void 0:e.in);if(!ba(a))throw new RangeError("Invalid time value");let l=t.match(B_).map(M=>{const D=M[0];if(D==="p"||D==="P"){const S=va[D];return S(M,s.formatLong)}return M}).join("").match(z_).map(M=>{if(M==="''")return{isToken:!1,value:"'"};const D=M[0];if(D==="'")return{isToken:!1,value:j_(M)};if(Id[D])return{isToken:!0,value:M};if(D.match(Y_))throw new RangeError("Format string contains an unescaped latin alphabet character `"+D+"`");return{isToken:!1,value:M}});s.localize.preprocessor&&(l=s.localize.preprocessor(a,l));const c={firstWeekContainsDate:r,weekStartsOn:o,locale:s};return l.map(M=>{if(!M.isToken)return M.value;const D=M.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&Hd(D)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&Bd(D))&&Ma(D,t,String(n));const S=Id[D[0]];return S(a,D,s.localize,c)}).join("")}function j_(n){const t=n.match(H_);return t?t[1].replace(W_,"'"):n}function Yd(){return Object.assign({},$n())}function V_(n,t){const e=lt(n,t==null?void 0:t.in).getDay();return e===0?7:e}function $_(n,t){const e=U_(t)?new t(0):Ft(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function U_(n){var t;return typeof n=="function"&&((t=n.prototype)==null?void 0:t.constructor)===n}const X_=10;class jd{constructor(){E(this,"subPriority",0)}validate(t,e){return!0}}class q_ extends jd{constructor(t,e,i,s,r){super(),this.value=t,this.validateValue=e,this.setValue=i,this.priority=s,r&&(this.subPriority=r)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,i){return this.setValue(t,e,this.value,i)}}class G_ extends jd{constructor(e,i){super();E(this,"priority",X_);E(this,"subPriority",-1);this.context=e||(s=>Ft(i,s))}set(e,i){return i.timestampIsSet?e:Ft(e,$_(e,this.context))}}class wt{run(t,e,i,s){const r=this.parse(t,e,i,s);return r?{setter:new q_(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}validate(t,e,i){return!0}}class K_ extends wt{constructor(){super(...arguments);E(this,"priority",140);E(this,"incompatibleTokens",["R","u","t","T"])}parse(e,i,s){switch(i){case"G":case"GG":case"GGG":return s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"});case"GGGGG":return s.era(e,{width:"narrow"});case"GGGG":default:return s.era(e,{width:"wide"})||s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"})}}set(e,i,s){return i.era=s,e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}const Yt={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}/},$e={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 jt(n,t){return n&&{value:t(n.value),rest:n.rest}}function Lt(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function Ue(n,t){const e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};const i=e[1]==="+"?1:-1,s=e[2]?parseInt(e[2],10):0,r=e[3]?parseInt(e[3],10):0,o=e[5]?parseInt(e[5],10):0;return{value:i*(s*mi+r*ps+o*C0),rest:t.slice(e[0].length)}}function Vd(n){return Lt(Yt.anyDigitsSigned,n)}function zt(n,t){switch(n){case 1:return Lt(Yt.singleDigit,t);case 2:return Lt(Yt.twoDigits,t);case 3:return Lt(Yt.threeDigits,t);case 4:return Lt(Yt.fourDigits,t);default:return Lt(new RegExp("^\\d{1,"+n+"}"),t)}}function Or(n,t){switch(n){case 1:return Lt(Yt.singleDigitSigned,t);case 2:return Lt(Yt.twoDigitsSigned,t);case 3:return Lt(Yt.threeDigitsSigned,t);case 4:return Lt(Yt.fourDigitsSigned,t);default:return Lt(new RegExp("^-?\\d{1,"+n+"}"),t)}}function ka(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 $d(n,t){const e=t>0,i=e?t:1-t;let s;if(i<=50)s=n||100;else{const r=i+50,o=Math.trunc(r/100)*100,a=n>=r%100;s=n+o-(a?100:0)}return e?s:1-s}function Ud(n){return n%400===0||n%4===0&&n%100!==0}class Z_ extends wt{constructor(){super(...arguments);E(this,"priority",130);E(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,i,s){const r=o=>({year:o,isTwoDigitYear:i==="yy"});switch(i){case"y":return jt(zt(4,e),r);case"yo":return jt(s.ordinalNumber(e,{unit:"year"}),r);default:return jt(zt(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s){const r=e.getFullYear();if(s.isTwoDigitYear){const a=$d(s.year,r);return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}const o=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}}class Q_ extends wt{constructor(){super(...arguments);E(this,"priority",130);E(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,i,s){const r=o=>({year:o,isTwoDigitYear:i==="YY"});switch(i){case"Y":return jt(zt(4,e),r);case"Yo":return jt(s.ordinalNumber(e,{unit:"year"}),r);default:return jt(zt(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s,r){const o=wa(e,r);if(s.isTwoDigitYear){const l=$d(s.year,o);return e.setFullYear(l,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Ve(e,r)}const a=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(a,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Ve(e,r)}}class J_ extends wt{constructor(){super(...arguments);E(this,"priority",130);E(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,i){return Or(i==="R"?4:i.length,e)}set(e,i,s){const r=Ft(e,0);return r.setFullYear(s,0,4),r.setHours(0,0,0,0),yi(r)}}class tx extends wt{constructor(){super(...arguments);E(this,"priority",130);E(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,i){return Or(i==="u"?4:i.length,e)}set(e,i,s){return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}class ex extends wt{constructor(){super(...arguments);E(this,"priority",120);E(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"Q":case"QQ":return zt(i.length,e);case"Qo":return s.ordinalNumber(e,{unit:"quarter"});case"QQQ":return s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(e,{width:"wide",context:"formatting"})||s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class nx extends wt{constructor(){super(...arguments);E(this,"priority",120);E(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"q":case"qq":return zt(i.length,e);case"qo":return s.ordinalNumber(e,{unit:"quarter"});case"qqq":return s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(e,{width:"wide",context:"standalone"})||s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class ix extends wt{constructor(){super(...arguments);E(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);E(this,"priority",110)}parse(e,i,s){const r=o=>o-1;switch(i){case"M":return jt(Lt(Yt.month,e),r);case"MM":return jt(zt(2,e),r);case"Mo":return jt(s.ordinalNumber(e,{unit:"month"}),r);case"MMM":return s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(e,{width:"wide",context:"formatting"})||s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}}class sx extends wt{constructor(){super(...arguments);E(this,"priority",110);E(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,i,s){const r=o=>o-1;switch(i){case"L":return jt(Lt(Yt.month,e),r);case"LL":return jt(zt(2,e),r);case"Lo":return jt(s.ordinalNumber(e,{unit:"month"}),r);case"LLL":return s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(e,{width:"wide",context:"standalone"})||s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}}function rx(n,t,e){const i=lt(n,e==null?void 0:e.in),s=Rd(i,e)-t;return i.setDate(i.getDate()-s*7),lt(i,e==null?void 0:e.in)}class ox extends wt{constructor(){super(...arguments);E(this,"priority",100);E(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,i,s){switch(i){case"w":return Lt(Yt.week,e);case"wo":return s.ordinalNumber(e,{unit:"week"});default:return zt(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s,r){return Ve(rx(e,s,r),r)}}function ax(n,t,e){const i=lt(n,e==null?void 0:e.in),s=Ad(i,e)-t;return i.setDate(i.getDate()-s*7),i}class lx extends wt{constructor(){super(...arguments);E(this,"priority",100);E(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,i,s){switch(i){case"I":return Lt(Yt.week,e);case"Io":return s.ordinalNumber(e,{unit:"week"});default:return zt(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s){return yi(ax(e,s))}}const cx=[31,28,31,30,31,30,31,31,30,31,30,31],ux=[31,29,31,30,31,30,31,31,30,31,30,31];class dx extends wt{constructor(){super(...arguments);E(this,"priority",90);E(this,"subPriority",1);E(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"d":return Lt(Yt.date,e);case"do":return s.ordinalNumber(e,{unit:"date"});default:return zt(i.length,e)}}validate(e,i){const s=e.getFullYear(),r=Ud(s),o=e.getMonth();return r?i>=1&&i<=ux[o]:i>=1&&i<=cx[o]}set(e,i,s){return e.setDate(s),e.setHours(0,0,0,0),e}}class hx extends wt{constructor(){super(...arguments);E(this,"priority",90);E(this,"subpriority",1);E(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,i,s){switch(i){case"D":case"DD":return Lt(Yt.dayOfYear,e);case"Do":return s.ordinalNumber(e,{unit:"date"});default:return zt(i.length,e)}}validate(e,i){const s=e.getFullYear();return Ud(s)?i>=1&&i<=366:i>=1&&i<=365}set(e,i,s){return e.setMonth(0,s),e.setHours(0,0,0,0),e}}function Da(n,t,e){var d,f,g,p;const i=$n(),s=(e==null?void 0:e.weekStartsOn)??((f=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??i.weekStartsOn??((p=(g=i.locale)==null?void 0:g.options)==null?void 0:p.weekStartsOn)??0,r=lt(n,e==null?void 0:e.in),o=r.getDay(),l=(t%7+7)%7,c=7-s,u=t<0||t>6?t-(o+c)%7:(l+c)%7-(o+c)%7;return Cr(r,u,e)}class fx extends wt{constructor(){super(...arguments);E(this,"priority",90);E(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"E":case"EE":case"EEE":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Da(e,s,r),e.setHours(0,0,0,0),e}}class gx extends wt{constructor(){super(...arguments);E(this,"priority",90);E(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,i,s,r){const o=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(i){case"e":case"ee":return jt(zt(i.length,e),o);case"eo":return jt(s.ordinalNumber(e,{unit:"day"}),o);case"eee":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeeee":return s.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Da(e,s,r),e.setHours(0,0,0,0),e}}class px extends wt{constructor(){super(...arguments);E(this,"priority",90);E(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,i,s,r){const o=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(i){case"c":case"cc":return jt(zt(i.length,e),o);case"co":return jt(s.ordinalNumber(e,{unit:"day"}),o);case"ccc":return s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"ccccc":return s.day(e,{width:"narrow",context:"standalone"});case"cccccc":return s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(e,{width:"wide",context:"standalone"})||s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Da(e,s,r),e.setHours(0,0,0,0),e}}function mx(n,t,e){const i=lt(n,e==null?void 0:e.in),s=V_(i,e),r=t-s;return Cr(i,r,e)}class yx extends wt{constructor(){super(...arguments);E(this,"priority",90);E(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,i,s){const r=o=>o===0?7:o;switch(i){case"i":case"ii":return zt(i.length,e);case"io":return s.ordinalNumber(e,{unit:"day"});case"iii":return jt(s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiii":return jt(s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return jt(s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiii":default:return jt(s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r)}}validate(e,i){return i>=1&&i<=7}set(e,i,s){return e=mx(e,s),e.setHours(0,0,0,0),e}}class bx extends wt{constructor(){super(...arguments);E(this,"priority",80);E(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,i,s){switch(i){case"a":case"aa":case"aaa":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(ka(s),0,0,0),e}}class _x extends wt{constructor(){super(...arguments);E(this,"priority",80);E(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,i,s){switch(i){case"b":case"bb":case"bbb":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(ka(s),0,0,0),e}}class xx extends wt{constructor(){super(...arguments);E(this,"priority",80);E(this,"incompatibleTokens",["a","b","t","T"])}parse(e,i,s){switch(i){case"B":case"BB":case"BBB":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(ka(s),0,0,0),e}}class wx extends wt{constructor(){super(...arguments);E(this,"priority",70);E(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,i,s){switch(i){case"h":return Lt(Yt.hour12h,e);case"ho":return s.ordinalNumber(e,{unit:"hour"});default:return zt(i.length,e)}}validate(e,i){return i>=1&&i<=12}set(e,i,s){const r=e.getHours()>=12;return r&&s<12?e.setHours(s+12,0,0,0):!r&&s===12?e.setHours(0,0,0,0):e.setHours(s,0,0,0),e}}class vx extends wt{constructor(){super(...arguments);E(this,"priority",70);E(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,i,s){switch(i){case"H":return Lt(Yt.hour23h,e);case"Ho":return s.ordinalNumber(e,{unit:"hour"});default:return zt(i.length,e)}}validate(e,i){return i>=0&&i<=23}set(e,i,s){return e.setHours(s,0,0,0),e}}class Mx extends wt{constructor(){super(...arguments);E(this,"priority",70);E(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,i,s){switch(i){case"K":return Lt(Yt.hour11h,e);case"Ko":return s.ordinalNumber(e,{unit:"hour"});default:return zt(i.length,e)}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.getHours()>=12&&s<12?e.setHours(s+12,0,0,0):e.setHours(s,0,0,0),e}}class kx extends wt{constructor(){super(...arguments);E(this,"priority",70);E(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,i,s){switch(i){case"k":return Lt(Yt.hour24h,e);case"ko":return s.ordinalNumber(e,{unit:"hour"});default:return zt(i.length,e)}}validate(e,i){return i>=1&&i<=24}set(e,i,s){const r=s<=24?s%24:s;return e.setHours(r,0,0,0),e}}class Dx extends wt{constructor(){super(...arguments);E(this,"priority",60);E(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"m":return Lt(Yt.minute,e);case"mo":return s.ordinalNumber(e,{unit:"minute"});default:return zt(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setMinutes(s,0,0),e}}class Sx extends wt{constructor(){super(...arguments);E(this,"priority",50);E(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"s":return Lt(Yt.second,e);case"so":return s.ordinalNumber(e,{unit:"second"});default:return zt(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setSeconds(s,0),e}}class Tx extends wt{constructor(){super(...arguments);E(this,"priority",30);E(this,"incompatibleTokens",["t","T"])}parse(e,i){const s=r=>Math.trunc(r*Math.pow(10,-i.length+3));return jt(zt(i.length,e),s)}set(e,i,s){return e.setMilliseconds(s),e}}class Cx extends wt{constructor(){super(...arguments);E(this,"priority",10);E(this,"incompatibleTokens",["t","T","x"])}parse(e,i){switch(i){case"X":return Ue($e.basicOptionalMinutes,e);case"XX":return Ue($e.basic,e);case"XXXX":return Ue($e.basicOptionalSeconds,e);case"XXXXX":return Ue($e.extendedOptionalSeconds,e);case"XXX":default:return Ue($e.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Ft(e,e.getTime()-Pr(e)-s)}}class Px extends wt{constructor(){super(...arguments);E(this,"priority",10);E(this,"incompatibleTokens",["t","T","X"])}parse(e,i){switch(i){case"x":return Ue($e.basicOptionalMinutes,e);case"xx":return Ue($e.basic,e);case"xxxx":return Ue($e.basicOptionalSeconds,e);case"xxxxx":return Ue($e.extendedOptionalSeconds,e);case"xxx":default:return Ue($e.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Ft(e,e.getTime()-Pr(e)-s)}}class Ox extends wt{constructor(){super(...arguments);E(this,"priority",40);E(this,"incompatibleTokens","*")}parse(e){return Vd(e)}set(e,i,s){return[Ft(e,s*1e3),{timestampIsSet:!0}]}}class Ex extends wt{constructor(){super(...arguments);E(this,"priority",20);E(this,"incompatibleTokens","*")}parse(e){return Vd(e)}set(e,i,s){return[Ft(e,s),{timestampIsSet:!0}]}}const Ax={G:new K_,y:new Z_,Y:new Q_,R:new J_,u:new tx,Q:new ex,q:new nx,M:new ix,L:new sx,w:new ox,I:new lx,d:new dx,D:new hx,E:new fx,e:new gx,c:new px,i:new yx,a:new bx,b:new _x,B:new xx,h:new wx,H:new vx,K:new Mx,k:new kx,m:new Dx,s:new Sx,S:new Tx,X:new Cx,x:new Px,t:new Ox,T:new Ex},Rx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ix=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Lx=/^'([^]*?)'?$/,Nx=/''/g,Fx=/\S/,zx=/[a-zA-Z]/;function Bx(n,t,e,i){var x,v,M,D,S,C,R,O;const s=()=>Ft((i==null?void 0:i.in)||e,NaN),r=Yd(),o=(i==null?void 0:i.locale)??r.locale??Ed,a=(i==null?void 0:i.firstWeekContainsDate)??((v=(x=i==null?void 0:i.locale)==null?void 0:x.options)==null?void 0:v.firstWeekContainsDate)??r.firstWeekContainsDate??((D=(M=r.locale)==null?void 0:M.options)==null?void 0:D.firstWeekContainsDate)??1,l=(i==null?void 0:i.weekStartsOn)??((C=(S=i==null?void 0:i.locale)==null?void 0:S.options)==null?void 0:C.weekStartsOn)??r.weekStartsOn??((O=(R=r.locale)==null?void 0:R.options)==null?void 0:O.weekStartsOn)??0;if(!t)return n?s():lt(e,i==null?void 0:i.in);const c={firstWeekContainsDate:a,weekStartsOn:l,locale:o},u=[new G_(i==null?void 0:i.in,e)],d=t.match(Ix).map(b=>{const _=b[0];if(_ in va){const T=va[_];return T(b,o.formatLong)}return b}).join("").match(Rx),f=[];for(let b of d){!(i!=null&&i.useAdditionalWeekYearTokens)&&Hd(b)&&Ma(b,t,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&Bd(b)&&Ma(b,t,n);const _=b[0],T=Ax[_];if(T){const{incompatibleTokens:I}=T;if(Array.isArray(I)){const F=f.find(U=>I.includes(U.token)||U.token===_);if(F)throw new RangeError(`The format string mustn't contain \`${F.fullToken}\` and \`${b}\` at the same time`)}else if(T.incompatibleTokens==="*"&&f.length>0)throw new RangeError(`The format string mustn't contain \`${b}\` and any other token at the same time`);f.push({token:_,fullToken:b});const P=T.run(n,b,o.match,c);if(!P)return s();u.push(P.setter),n=P.rest}else{if(_.match(zx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");if(b==="''"?b="'":_==="'"&&(b=Hx(b)),n.indexOf(b)===0)n=n.slice(b.length);else return s()}}if(n.length>0&&Fx.test(n))return s();const g=u.map(b=>b.priority).sort((b,_)=>_-b).filter((b,_,T)=>T.indexOf(b)===_).map(b=>u.filter(_=>_.priority===b).sort((_,T)=>T.subPriority-_.subPriority)).map(b=>b[0]);let p=lt(e,i==null?void 0:i.in);if(isNaN(+p))return s();const y={};for(const b of g){if(!b.validate(p,c))return s();const _=b.set(p,y,c);Array.isArray(_)?(p=_[0],Object.assign(y,_[1])):p=_}return p}function Hx(n){return n.match(Lx)[1].replace(Nx,"'")}function Wx(n,t){const e=lt(n,t==null?void 0:t.in);return e.setMinutes(0,0,0),e}function Yx(n,t){const e=lt(n,t==null?void 0:t.in);return e.setSeconds(0,0),e}function jx(n,t){const e=lt(n,t==null?void 0:t.in);return e.setMilliseconds(0),e}function Vx(n){const t=n/mi;return Math.trunc(t)}function Xd(n,t){const e=()=>Ft(t==null?void 0:t.in,NaN),i=(t==null?void 0:t.additionalDigits)??2,s=qx(n);let r;if(s.date){const c=Gx(s.date,i);r=Kx(c.restDateString,c.year)}if(!r||isNaN(+r))return e();const o=+r;let a=0,l;if(s.time&&(a=Zx(s.time),isNaN(a)))return e();if(s.timezone){if(l=Qx(s.timezone),isNaN(l))return e()}else{const c=new Date(o+a),u=lt(0,t==null?void 0:t.in);return u.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),u.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),u}return lt(o+a+l,t==null?void 0:t.in)}const Er={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},$x=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Ux=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Xx=/^([+-])(\d{2})(?::?(\d{2}))?$/;function qx(n){const t={},e=n.split(Er.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],Er.timeZoneDelimiter.test(t.date)&&(t.date=n.split(Er.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const s=Er.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function Gx(n,t){const e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};const s=i[1]?parseInt(i[1]):null,r=i[2]?parseInt(i[2]):null;return{year:r===null?s:r*100,restDateString:n.slice((i[1]||i[2]).length)}}function Kx(n,t){if(t===null)return new Date(NaN);const e=n.match($x);if(!e)return new Date(NaN);const i=!!e[4],s=xs(e[1]),r=xs(e[2])-1,o=xs(e[3]),a=xs(e[4]),l=xs(e[5])-1;if(i)return iw(t,a,l)?Jx(t,a,l):new Date(NaN);{const c=new Date(0);return!ew(t,r,o)||!nw(t,s)?new Date(NaN):(c.setUTCFullYear(t,r,Math.max(s,o)),c)}}function xs(n){return n?parseInt(n):1}function Zx(n){const t=n.match(Ux);if(!t)return NaN;const e=Sa(t[1]),i=Sa(t[2]),s=Sa(t[3]);return sw(e,i,s)?e*mi+i*ps+s*1e3:NaN}function Sa(n){return n&&parseFloat(n.replace(",","."))||0}function Qx(n){if(n==="Z")return 0;const t=n.match(Xx);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return rw(i,s)?e*(i*mi+s*ps):NaN}function Jx(n,t,e){const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=(t-1)*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const tw=[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 ew(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(tw[t]||(qd(n)?29:28))}function nw(n,t){return t>=1&&t<=(qd(n)?366:365)}function iw(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function sw(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function rw(n,t){return t>=0&&t<=59}const Ar=n=>["interactive","zoom-interactive"].includes(n),ow=(n,t,e)=>{var r,o;const{tooltip:i}=t;if(i.opacity===0&&!Ar(n.interactionMode)){n.showTooltip=!1;return}const s=n.chartTooltipSortFn||((a,l)=>l.rawValue-a.rawValue);if(i.body&&!Ar(n.interactionMode)){const a=i.labelColors,l=((o=(r=t.chart.config)==null?void 0:r.options)==null?void 0:o.indexAxis)==="y"?"x":"y";n.tooltipContext=vh(new Date(i.dataPoints[0].parsed.x),e,!0),n.tooltipSeries=i.dataPoints.map((c,u)=>{const d=c.parsed[l],f=Mh(d,n.units,{translateUnit:n.translateUnit}),g=c.dataset.label;return{backgroundColor:a[u].backgroundColor,borderColor:a[u].borderColor,label:g,value:f,rawValue:d,isSegmentEmpty:c.dataset.isSegmentEmpty}}).sort(s),n.left=`${i.x}px`,n.top=`${i.y}px`,n.showTooltip=!0}},Gd=(n,t)=>{var s,r;const{tooltip:e}=t;if(e.opacity===0&&!Ar(n.interactionMode)){n.showTooltip=!1;return}const i=n.chartTooltipSortFn||((o,a)=>a.rawValue-o.rawValue);if(e.body&&!Ar(n.interactionMode)){const o=e.labelColors,a=((r=(s=t.chart.config)==null?void 0:s.options)==null?void 0:r.indexAxis)==="y"?"x":"y",l=["gauge","donut"].includes(n.chartType);l?n.tooltipContext=n.dimensionDisplay||e.dataPoints[0].label:e.chart.data.isMultiDimension?n.tooltipContext=e.dataPoints[0].label:n.tooltipContext=n.dimensionDisplay||"",n.tooltipSeries=e.dataPoints.map((c,u)=>{const d=l?c.parsed:c.parsed[a],f=Mh(d,n.units,{translateUnit:n.translateUnit});let g;return l?g=c.dataset.labels[c.dataIndex]:g=c.dataset.label,{backgroundColor:o[u].backgroundColor,borderColor:o[u].borderColor,label:g,value:f,rawValue:d,isSegmentEmpty:c.dataset.isSegmentEmpty}}).sort(i),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},aw=n=>n&&n.datasets&&n.datasets.length,lw=n=>aw(n)&&n.datasets.some(t=>t.data.length),cw=n=>n.datasets.some(t=>t.data[0]&&ba(t.data[0].x)),uw=n=>!!lw(n)&&n.datasets.some(t=>t.data.length==1),dw=n=>cw(n)&&n.datasets.some(t=>t.data[0]&&t.data[0].x.toString().length>=13),Ta=(n,t,e)=>{const s=Math.min(t/1150,1);return n.x<e?n.x+t*.15*(1-s):n.x-t*1.15*(1-s)},hw=(n,t,e)=>n.y<e?n.y+t*.15:n.y-t*.5;function Ca(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}const Kd=(n,t,e)=>{const i=n.data;return n.options.plugins.legend.labels.generateLabels(n).filter(s=>{var r;return!((r=t==null?void 0:t[s.text])!=null&&r.isThreshold)}).map((s,r)=>({...s,value:t&&t[s.text],isSegmentEmpty:i.datasets[r].isSegmentEmpty})).sort(e)},fw=2,Zd=10,Qd=12,Pa=new Intl.NumberFormat(((_g=document==null?void 0:document.documentElement)==null?void 0:_g.lang)||"en-US"),Rr=10,Jd={"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"}},sn=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Ir=(n,t)=>(t||sn)[n%sn.length],th=(n,t)=>{n[0]==="#"&&(n=n.slice(1));let e=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16);e=e-t,i=i-t,s=s-t,e>255?e=255:e<0&&(e=0),i>255?i=255:i<0&&(i=0),s>255?s=255:s<0&&(s=0);const r=e.toString(16).length===1?"0"+e.toString(16):e.toString(16),o=i.toString(16).length===1?"0"+i.toString(16):i.toString(16),a=s.toString(16).length===1?"0"+s.toString(16):s.toString(16);return`#${r}${o}${a}`},eh="#6f7787",nh={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"}},gw=n=>{var e;const t=Math.floor(parseInt(n,10)/100)*100;return((e=nh[t])==null?void 0:e.background)||"#fafafa"},pw={SUCCESS:"#6FCC83",FAILURE:"#FF8484"},mw={"4XX":"#FFBA81","5XX":"#FF8484"},yw={LatencyP99:"#1356cb",LatencyP95:"#1fbecd",LatencyP50:"#1df97d"},bw="#dad4c7",ih="#afb7c5",_w=n=>{const t=Object.entries(Jd).find(([e])=>new RegExp(e).test(n));return t&&t[1]||Jd.standard},Oa=(n,t,e,i)=>{let s;return e?s=ih:Array.isArray(i)?s=Ir(n,i):s=i[t],s||Ir(n)},xw={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},ww=2,vw=0,Ea=new Map,Aa=(n,t)=>t==="bytes"?Fr(n):t==="count/minute"?n.toFixed(2):Pa.format(n),sh=n=>{const e=document.createElement("canvas").getContext("2d"),i=It({});return e.font=i.string,e.measureText(n).width},Mw=()=>{const n="label_height";if(!Ea.has(n)){const t=It({});Ea.set(n,t.lineHeight)}return Ea.get(n)},kw=n=>n.datasets.reduce((t,e)=>t+e.data.reduce((i,s)=>isNaN(s)?i:i+s,0),0),rh=(n,t)=>t.datasets.reduce((e,i,s)=>n.isDatasetVisible(s)?e+i.data.reduce((r,o)=>isNaN(o)?r:r+o,0):e,0),oh=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,Ra="#e0e4ea",Dw={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"]},ws=(n,t)=>{let e=1;const i=Dw[n],s=new Map;for(const r of t)s.set(r,i[e]),e=e%(i.length-1)+1;return s.set(-1,i[0]),s},ah=new Map([[100,ws("100",[100,101,102,103])],[200,ws("200",[200,201,202,203,204,205,206,207,208,226])],[300,ws("300",[300,301,302,303,304,305,307,308])],[400,ws("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,ws("500",[500,501,502,503,504,505,506,507,508,510,511])]]),Ia=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100,i=ah.get(e);return i===void 0?Ra:i.get(t)??i.get(-1)??Ra},Sw=n=>{const t=Ia(n);return{solid:t,light:t}},Lr={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=Ia(`${t}`),n),{}),____OTHER____:"#DAD4C7","1XX":"#4DA6FF","2XX":"#6FCC83","3XX":"#FFD982","4XX":"#FFBA81","5XX":"#FF8484"};function lh(n,t,e){const i=Yd(),s=Pw(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?Tw(s,t):Cw(s,t)}function Tw(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function Cw(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function Pw(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function Ow(n,t){const e=Lw(t);return"formatToParts"in e?Aw(e,n):Rw(e,n)}const Ew={year:0,month:1,day:2,hour:3,minute:4,second:5};function Aw(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=Ew[e[s].type];r!==void 0&&(i[r]=parseInt(e[s].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function Rw(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const La={},ch=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),Iw=ch==="06/25/2014, 00:00:00"||ch==="06/25/2014 00:00:00";function Lw(n){return La[n]||(La[n]=Iw?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"}):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"})),La[n]}function uh(n,t,e,i,s,r,o){const a=new Date(0);return a.setUTCFullYear(n,t,e),a.setUTCHours(i,s,r,o),a}const dh=36e5,Nw=6e4,Na={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Fa(n,t,e){if(!n)return 0;let i=Na.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=Na.timezoneHH.exec(n),i)return s=parseInt(i[1],10),hh(s)?-(s*dh):NaN;if(i=Na.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const o=parseInt(i[3],10);return hh(s,o)?(r=Math.abs(s)*dh+o*Nw,i[1]==="+"?-r:r):NaN}if(Bw(n)){t=new Date(t||Date.now());const o=e?t:Fw(t),a=za(o,n);return-(e?a:zw(t,a,n))}return NaN}function Fw(n){return uh(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function za(n,t){const e=Ow(n,t),i=uh(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let s=n.getTime();const r=s%1e3;return s-=r>=0?r:1e3+r,i-s}function zw(n,t,e){let s=n.getTime()-t;const r=za(new Date(s),e);if(t===r)return t;s-=r-t;const o=za(new Date(s),e);return r===o?r:Math.max(r,o)}function hh(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const fh={};function Bw(n){if(fh[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),fh[n]=!0,!0}catch{return!1}}const Hw=60*1e3,Ww={X:function(n,t,e){const i=Ba(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return gh(i);case"XXXX":case"XX":return _i(i);case"XXXXX":case"XXX":default:return _i(i,":")}},x:function(n,t,e){const i=Ba(e.timeZone,n);switch(t){case"x":return gh(i);case"xxxx":case"xx":return _i(i);case"xxxxx":case"xxx":default:return _i(i,":")}},O:function(n,t,e){const i=Ba(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Yw(i,":");case"OOOO":default:return"GMT"+_i(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return lh("short",n,e);case"zzzz":default:return lh("long",n,e)}}};function Ba(n,t){const e=n?Fa(n,t,!0)/Hw:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Nr(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function _i(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Nr(Math.floor(i/60),2),r=Nr(Math.floor(i%60),2);return e+s+t+r}function gh(n,t){return n%60===0?(n>0?"-":"+")+Nr(Math.abs(n)/60,2):_i(n,t)}function Yw(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.floor(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Nr(r,2)}function ph(n){const 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-+t}const jw=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Ha=36e5,mh=6e4,Vw=2,ue={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,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:jw};function yh(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?Vw:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==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(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=$w(n),{year:s,restDateString:r}=Uw(i.date,e),o=Xw(r,s);if(o===null||isNaN(o.getTime()))return new Date(NaN);if(o){const a=o.getTime();let l=0,c;if(i.time&&(l=qw(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Fa(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=ph(new Date(a+l)),c=ph(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function $w(n){const t={};let e=ue.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=ue.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=ue.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function Uw(n,t){if(n){const e=ue.YYY[t],i=ue.YYYYY[t];let s=ue.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=ue.YY.exec(n)||e.exec(n),s){const r=s[1];return{year:parseInt(r,10)*100,restDateString:n.slice(r.length)}}}return{year:null}}function Xw(n,t){if(t===null)return null;let e,i,s;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let r=ue.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,xh(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=ue.DDD.exec(n),r){e=new Date(0);const o=parseInt(r[1],10);return Zw(t,o)?(e.setUTCFullYear(t,0,o),e):new Date(NaN)}if(r=ue.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const o=parseInt(r[2],10);return xh(t,i,o)?(e.setUTCFullYear(t,i,o),e):new Date(NaN)}if(r=ue.Www.exec(n),r)return s=parseInt(r[1],10)-1,wh(s)?bh(t,s):new Date(NaN);if(r=ue.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const o=parseInt(r[2],10)-1;return wh(s,o)?bh(t,s,o):new Date(NaN)}return null}function qw(n){let t,e,i=ue.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Wa(t)?t%24*Ha:NaN;if(i=ue.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Wa(t,e)?t%24*Ha+e*mh:NaN;if(i=ue.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Wa(t,e,s)?t%24*Ha+e*mh+s*1e3:NaN}return null}function bh(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=t*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const Gw=[31,28,31,30,31,30,31,31,30,31,30,31],Kw=[31,29,31,30,31,30,31,31,30,31,30,31];function _h(n){return n%400===0||n%4===0&&n%100!==0}function xh(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=_h(n);if(i&&e>Kw[t]||!i&&e>Gw[t])return!1}return!0}function Zw(n,t){if(t<1)return!1;const e=_h(n);return!(e&&t>366||!e&&t>365)}function wh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Wa(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const Qw=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Ya(n,t,e={}){t=String(t);const i=t.match(Qw);if(i){const s=yh(e.originalDate||n,e);t=i.reduce(function(r,o){if(o[0]==="'")return r;const a=r.indexOf(o),l=r[a-1]==="'",c=r.replace(o,"'"+Ww[o[0]](s,o,e)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return Wd(n,t,e)}function Jw(n,t,e){n=yh(n,e);const i=Fa(t,n,!0),s=new Date(n.getTime()-i),r=new Date(0);return r.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),r.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),r}function qn(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Ya(Jw(n,t,{timeZone:i.timeZone}),e,i)}const vh=(n,t,e,i)=>{const s=Intl.DateTimeFormat().resolvedOptions().timeZone;switch(t){case"secondly":case"tenSecondly":case"thirtySecondly":return qn(n,s,e?"yyyy-MM-dd h:mm:ss a":"h:mm:ss a");case"minutely":case"fiveMinutely":case"tenMinutely":case"thirtyMinutely":case"hourly":case"twoHourly":return qn(n,s,e?"yyyy-MM-dd h:mm a":"h:mm a");case"twelveHourly":return qn(n,s,"yyyy-MM-dd h:mm a");case"daily":return qn(n,s,"yyyy-MM-dd");case"weekly":return`${qn(n,s,"yyyy")} W${qn(n,s,"II")}`;default:return qn(n,s,"yyyy-MM-dd h:mm:ss a")}},Fr=(n,t)=>{if(isNaN(n))return"0 B";const{i18n:e}=bt.useI18n(),i=t?0x4000000000000:1e15,s=t?1099511627776:1e12,r=t?1073741824:1e9,o=t?1048576:1e6,a=t?1024:1e3;let l;return n>=i?l=e.formatNumber(Number.parseFloat((n/i).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):n>=s?l=e.formatNumber(Number.parseFloat((n/s).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):n>=r?l=e.formatNumber(Number.parseFloat((n/r).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):n>=o?l=e.formatNumber(Number.parseFloat((n/o).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):n>=a?l=e.formatNumber(Number.parseFloat((n/a).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):l=e.formatNumber(Number.parseFloat(n.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),l.replace(/([a-zA-Z]*)$/," $1")},t1=(n,t="USD")=>{if(isNaN(n))return t==="USD"?"$0.00":`${n}`;const{i18n:e}=bt.useI18n();return n>=.01||t!=="USD"?e.formatNumber(n,{style:"currency",currency:t}):n<1e-4?"< $0.0001":`$${Number.parseFloat(n.toPrecision(4))}`},Mh=(n,t,{isBytes1024:e=!1,currency:i="USD",translateUnit:s=r=>r}={})=>{const r=s(t,n);switch(t){case"bytes":return Fr(n,e);case"usd":return t1(n,i);case"ms":case"count/minute":case"token count":case"count":default:return isNaN(n)?`${n}`:n>=.01?`${Pa.format(Number.parseFloat(n.toFixed(2)))} ${r}`:`${Number.parseFloat(n.toPrecision(4))} ${r}`}};function e1(n){const e=`barChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:l=>({label:l.dataset.label,value:l.label})}};je.positioners[e]=function(l,c){if(!l.length||n.tooltipState.interactionMode==="interactive")return!1;const u=this.chart.canvas.getBoundingClientRect(),d=n.tooltipState.width||this.width,f=u.width/2,g=Ta(c,d,f),p=c.y,y=c.x<f?"left":"center";return{x:g-n.tooltipState.offsetX,y:p-n.tooltipState.offsetY,xAlign:y}},Zo.modes.customInteractionMode=function(l,c){const u=vn(c,l),d=[];return Zo.evaluateInteractionItems(l,l.options.indexAxis||"x",u,(f,g,p)=>{l.options.indexAxis==="y"&&f.inYRange(u.y,!0)&&l.data.datasets[g].data[p]&&d.push({element:f,datasetIndex:g,index:p}),l.options.indexAxis==="x"&&f.inXRange(u.x,!0)&&l.data.datasets[g].data[p]&&d.push({element:f,datasetIndex:g,index:p})}),d};const s=n.numLabels.value>25?Zd:Qd,r=({chart:l,index:c})=>{var d;const u=l.data;return{size:s,style:(d=u==null?void 0:u.isLabelEmpty)!=null&&d[c]?"italic":"normal"}},o=(l,c,u)=>l.chart.options.indexAxis===l.axis?(c=l.getLabelForValue(u),c&&c.length>Rr?c.slice(0,Rr)+"...":c):l.getLabelForValue(Number(c)),a=h.computed(()=>{var l,c,u,d,f,g,p,y;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:r,callback:function(x,v){return o(this,x,v)}},title:{display:n.indexAxis==="y"?!st((l=n.metricAxesTitle)==null?void 0:l.value):!st((c=n.dimensionAxesTitle)==null?void 0:c.value),text:n.indexAxis==="y"?(u=n.metricAxesTitle)==null?void 0:u.value:(d=n.dimensionAxesTitle)==null?void 0:d.value,padding:{top:10},font:{weight:"bold"}}},y:{border:{display:!1},stacked:n.stacked.value,beginAtZero:!0,grid:{display:!1,drawBorder:!1},ticks:{font:r,callback:function(x,v){return o(this,x,v)}},title:{display:n.indexAxis==="x"?!st((f=n.metricAxesTitle)==null?void 0:f.value):!st((g=n.dimensionAxesTitle)==null?void 0:g.value),text:n.indexAxis==="x"?(p=n.metricAxesTitle)==null?void 0:p.value:(y=n.dimensionAxesTitle)==null?void 0:y.value,padding:{bottom:20},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:x=>{Gd(n.tooltipState,x)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1}});return h.getCurrentInstance()&&h.onUnmounted(()=>{je.positioners[e]&&delete je.positioners[e]}),a}Se.register(...S0);const n1=(n,t)=>{const e=t.datasets.map(s=>s.label),i=n.datasets.map(s=>s.label);return n.datasets.length===t.datasets.length&&e.every((s,r)=>s===i[r])};function i1(n,t,e,i,s){const r=h.shallowRef(null),o=(a,l)=>{if(t.value)return new Se(t.value,{type:n,data:a,plugins:i,options:l})};return h.onMounted(()=>{r.value=o(e.value,s.value)}),h.onBeforeUnmount(()=>{st(r.value)||r.value.destroy()}),h.watch(e,(a,l)=>{if(n1(l,a)&&!st(r.value)){for(const[c,u]of a.datasets.entries())Object.assign(r.value.data.datasets[c],u);r.value.data.labels=a.labels,r.value.update()}else st(r.value)||r.value.destroy(),r.value=o(a,s.value)}),h.watch(t,()=>{st(r.value)||r.value.destroy(),r.value=o(e.value,s.value)}),h.watch(s,(a,l)=>{(a.indexAxis!==l.indexAxis||JSON.stringify(a.scales.x.title)!==JSON.stringify(l.scales.x.title)||JSON.stringify(a.scales.y.title)!==JSON.stringify(l.scales.y.title))&&(st(r.value)||r.value.destroy(),r.value=o(e.value,a))}),r}var be=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ja(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var kh={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(p,y){y&&y%3===0&&f.push(d),f.push(p)}),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 i=1e3,s=1e4,r=1e6,o=1e9,a=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?s:i;return c<g||u.precision&&u.precision>Math.log10(c)?d=t(e(c,1,u),u):c<r?d=e(c,i,u)+"k":c<o?d=e(c,r,u)+"m":c<a?d=t(e(c,o,u),u)+"b":d=t(e(c,a,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})()})(kh);var s1=kh.exports;const vs=ja(s1);function r1(n,t,e){const{i18n:i}=bt.useI18n(),{translateUnit:s}=bt.useTranslatedUnits();return{legendValues:h.computed(()=>n.value.datasets.reduce((o,a)=>{const l=a.total?a.total:a.data.reduce((u,d)=>u+(typeof d=="number"?Number(d)||0:Number(d&&d.y)||0),0);let c;if(e.value==="bytes")c=Fr(l);else{const u=s(e.value,l);c=i&&i.t("legend.datapointValueDisplay",{value:vs(l,{capital:!0}),unit:u})||`${vs(l,{capital:!0})} ${e.value}`}return{...o,[a.label]:{raw:l,formatted:c,isThreshold:a.isThreshold}}},{}))}}var o1=Object.defineProperty,a1=(n,t,e)=>t in n?o1(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Te=(n,t,e)=>a1(n,typeof t!="symbol"?t+"":t,e),mt=(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))(mt||{});const l1=["in","not_in","selector"],c1=["empty","not_empty"],u1=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],Ms=n=>n.filter(t=>t!=="time"),Dh=["api","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],Sh=Ms(Dh),d1=[...Dh,"application","consumer","country_code","iso_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm"],Th=Ms(d1),h1=["control_plane","control_plane_group","gateway_service","consumer","application","route","ai_provider","ai_response_model","ai_request_model","llm_cache_status","llm_embeddings_provider","llm_embeddings_model","time","realm","status_code","status_code_grouped","ai_plugin"],Ch=Ms(h1);Ms(["api","api_product","api_product_version","application","auth_type","client_ip","consumer","consumer_group","control_plane","control_plane_group","country_code","data_plane_node","data_plane_node_version","gateway_service","header_host","header_user_agent","http_method","iso_code","portal","realm","request_id","request_uri","response_header_content_type","response_source","route","service_port","service_protocol","sse","status_code_grouped","time","trace_id","upstream_uri","upstream_status_code_grouped","websocket"]),Ms(["ai_count","latencies_response_ms","latencies_upstream_ms","latencies_kong_gateway_ms","request_body_size","response_body_size","response_header_content_length","status_code","upstream_status_code"]),new Set(Sh),new Set(Th),new Set(Ch),(n=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",enum:n},operator:{type:"string",enum:l1},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",enum:n},operator:{type:"string",enum:c1}},required:["field","operator"],additionalProperties:!1}]}}))([...new Set([...Th,...Sh,...Ch])]);const Ph=6048e5,f1=864e5,g1=60,p1=3600,Oh=Symbol.for("constructDateFrom");function Ce(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&Oh in n?n[Oh](t):n instanceof Date?new n.constructor(t):new Date(t)}function de(n,t){return Ce(t||n,n)}function Eh(n,t,e){const i=de(n,void 0);return isNaN(t)?Ce(n,NaN):(i.setDate(i.getDate()+t),i)}function m1(n,t,e){const i=de(n,void 0);if(isNaN(t))return Ce(n,NaN);const s=i.getDate(),r=Ce(n,i.getTime());r.setMonth(i.getMonth()+t+1,0);const o=r.getDate();return s>=o?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}let y1={};function ks(){return y1}function rn(n,t){var e,i,s,r;const o=ks(),a=(t==null?void 0:t.weekStartsOn)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.weekStartsOn)??o.weekStartsOn??((r=(s=o.locale)==null?void 0:s.options)==null?void 0:r.weekStartsOn)??0,l=de(n,t==null?void 0:t.in),c=l.getDay(),u=(c<a?7:0)+c-a;return l.setDate(l.getDate()-u),l.setHours(0,0,0,0),l}function zr(n,t){return rn(n,{...t,weekStartsOn:1})}function Ah(n,t){const e=de(n,void 0),i=e.getFullYear(),s=Ce(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=zr(s),o=Ce(e,0);o.setFullYear(i,0,4),o.setHours(0,0,0,0);const a=zr(o);return e.getTime()>=r.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function Rh(n){const t=de(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function b1(n,...t){const e=Ce.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Br(n,t){const e=de(n,void 0);return e.setHours(0,0,0,0),e}function _1(n,t,e){const[i,s]=b1(void 0,n,t),r=Br(i),o=Br(s),a=+r-Rh(r),l=+o-Rh(o);return Math.round((a-l)/f1)}function x1(n,t){const e=Ah(n),i=Ce(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),zr(i)}function w1(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function v1(n){return!(!w1(n)&&typeof n!="number"||isNaN(+de(n)))}function xi(n,t){const e=de(n,void 0);return e.setDate(1),e.setHours(0,0,0,0),e}function M1(n,t){const e=de(n,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const k1={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"}},D1=(n,t,e)=>{let i;const s=k1[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Va(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const S1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},T1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},C1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},P1={date:Va({formats:S1,defaultWidth:"full"}),time:Va({formats:T1,defaultWidth:"full"}),dateTime:Va({formats:C1,defaultWidth:"full"})},O1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},E1=(n,t,e,i)=>O1[n];function Ds(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const o=n.defaultFormattingWidth||n.defaultWidth,a=e!=null&&e.width?String(e.width):o;s=n.formattingValues[a]||n.formattingValues[o]}else{const o=n.defaultWidth,a=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[a]||n.values[o]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const A1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},R1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},I1={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"]},L1={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"]},N1={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"}},F1={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"}},z1=(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},B1={ordinalNumber:z1,era:Ds({values:A1,defaultWidth:"wide"}),quarter:Ds({values:R1,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Ds({values:I1,defaultWidth:"wide"}),day:Ds({values:L1,defaultWidth:"wide"}),dayPeriod:Ds({values:N1,defaultWidth:"wide",formattingValues:F1,defaultFormattingWidth:"wide"})};function Ss(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(s);if(!r)return null;const o=r[0],a=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(a)?W1(a,d=>d.test(o)):H1(a,d=>d.test(o));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(o.length);return{value:c,rest:u}}}function H1(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function W1(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function Y1(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],r=t.match(n.parsePattern);if(!r)return null;let o=n.valueCallback?n.valueCallback(r[0]):r[0];o=e.valueCallback?e.valueCallback(o):o;const a=t.slice(s.length);return{value:o,rest:a}}}const j1=/^(\d+)(th|st|nd|rd)?/i,V1=/\d+/i,$1={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},U1={any:[/^b/i,/^(a|c)/i]},X1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},q1={any:[/1/i,/2/i,/3/i,/4/i]},G1={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},K1={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]},Z1={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},Q1={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]},J1={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},tv={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}},ev={ordinalNumber:Y1({matchPattern:j1,parsePattern:V1,valueCallback:n=>parseInt(n,10)}),era:Ss({matchPatterns:$1,defaultMatchWidth:"wide",parsePatterns:U1,defaultParseWidth:"any"}),quarter:Ss({matchPatterns:X1,defaultMatchWidth:"wide",parsePatterns:q1,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Ss({matchPatterns:G1,defaultMatchWidth:"wide",parsePatterns:K1,defaultParseWidth:"any"}),day:Ss({matchPatterns:Z1,defaultMatchWidth:"wide",parsePatterns:Q1,defaultParseWidth:"any"}),dayPeriod:Ss({matchPatterns:J1,defaultMatchWidth:"any",parsePatterns:tv,defaultParseWidth:"any"})},nv={code:"en-US",formatDistance:D1,formatLong:P1,formatRelative:E1,localize:B1,match:ev,options:{weekStartsOn:0,firstWeekContainsDate:1}};function iv(n,t){const e=de(n,void 0);return _1(e,M1(e))+1}function sv(n,t){const e=de(n,void 0),i=+zr(e)-+x1(e);return Math.round(i/Ph)+1}function Ih(n,t){var e,i,s,r;const o=de(n,t==null?void 0:t.in),a=o.getFullYear(),l=ks(),c=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??l.firstWeekContainsDate??((r=(s=l.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,u=Ce((t==null?void 0:t.in)||n,0);u.setFullYear(a+1,0,c),u.setHours(0,0,0,0);const d=rn(u,t),f=Ce((t==null?void 0:t.in)||n,0);f.setFullYear(a,0,c),f.setHours(0,0,0,0);const g=rn(f,t);return+o>=+d?a+1:+o>=+g?a:a-1}function rv(n,t){var e,i,s,r;const o=ks(),a=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??o.firstWeekContainsDate??((r=(s=o.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,l=Ih(n,t),c=Ce((t==null?void 0:t.in)||n,0);return c.setFullYear(l,0,a),c.setHours(0,0,0,0),rn(c,t)}function ov(n,t){const e=de(n,t==null?void 0:t.in),i=+rn(e,t)-+rv(e,t);return Math.round(i/Ph)+1}function Ct(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Sn={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Ct(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Ct(e+1,2)},d(n,t){return Ct(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Ct(n.getHours()%12||12,t.length)},H(n,t){return Ct(n.getHours(),t.length)},m(n,t){return Ct(n.getMinutes(),t.length)},s(n,t){return Ct(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return Ct(s,t.length)}},wi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Lh={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return Sn.y(n,t)},Y:function(n,t,e,i){const s=Ih(n,i),r=s>0?s:1-s;if(t==="YY"){const o=r%100;return Ct(o,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Ct(r,t.length)},R:function(n,t){const e=Ah(n);return Ct(e,t.length)},u:function(n,t){const e=n.getFullYear();return Ct(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Ct(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Ct(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return Sn.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return Ct(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=ov(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):Ct(s,t.length)},I:function(n,t,e){const i=sv(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Ct(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):Sn.d(n,t)},D:function(n,t,e){const i=iv(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Ct(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return Ct(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return Ct(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return Ct(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const i=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=wi.noon:i===0?s=wi.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let s;switch(i>=17?s=wi.evening:i>=12?s=wi.afternoon:i>=4?s=wi.morning:s=wi.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return Sn.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Sn.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Ct(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Ct(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):Sn.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Sn.s(n,t)},S:function(n,t){return Sn.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Fh(i);case"XXXX":case"XX":return Gn(i);case"XXXXX":case"XXX":default:return Gn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Fh(i);case"xxxx":case"xx":return Gn(i);case"xxxxx":case"xxx":default:return Gn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Nh(i,":");case"OOOO":default:return"GMT"+Gn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Nh(i,":");case"zzzz":default:return"GMT"+Gn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Ct(i,t.length)},T:function(n,t,e){return Ct(+n,t.length)}};function Nh(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Ct(r,2)}function Fh(n,t){return n%60===0?(n>0?"-":"+")+Ct(Math.abs(n)/60,2):Gn(n,t)}function Gn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Ct(Math.trunc(i/60),2),r=Ct(i%60,2);return e+s+t+r}const zh=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Bh=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},av=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return zh(n,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",zh(i,t)).replace("{{time}}",Bh(s,t))},lv={p:Bh,P:av},cv=/^D+$/,uv=/^Y+$/,dv=["D","DD","YY","YYYY"];function hv(n){return cv.test(n)}function fv(n){return uv.test(n)}function gv(n,t,e){const i=pv(n,t,e);if(console.warn(i),dv.includes(n))throw new RangeError(i)}function pv(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const mv=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,yv=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,bv=/^'([^]*?)'?$/,_v=/''/g,xv=/[a-zA-Z]/;function wv(n,t,e){var i,s,r,o,a,l,c,u;const d=ks(),f=(e==null?void 0:e.locale)??d.locale??nv,g=(e==null?void 0:e.firstWeekContainsDate)??((s=(i=e==null?void 0:e.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??d.firstWeekContainsDate??((o=(r=d.locale)==null?void 0:r.options)==null?void 0:o.firstWeekContainsDate)??1,p=(e==null?void 0:e.weekStartsOn)??((l=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??d.weekStartsOn??((u=(c=d.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,y=de(n,e==null?void 0:e.in);if(!v1(y))throw new RangeError("Invalid time value");let x=t.match(yv).map(M=>{const D=M[0];if(D==="p"||D==="P"){const S=lv[D];return S(M,f.formatLong)}return M}).join("").match(mv).map(M=>{if(M==="''")return{isToken:!1,value:"'"};const D=M[0];if(D==="'")return{isToken:!1,value:vv(M)};if(Lh[D])return{isToken:!0,value:M};if(D.match(xv))throw new RangeError("Format string contains an unescaped latin alphabet character `"+D+"`");return{isToken:!1,value:M}});f.localize.preprocessor&&(x=f.localize.preprocessor(y,x));const v={firstWeekContainsDate:g,weekStartsOn:p,locale:f};return x.map(M=>{if(!M.isToken)return M.value;const D=M.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&fv(D)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&hv(D))&&gv(D,t,String(n));const S=Lh[D[0]];return S(y,D,f.localize,v)}).join("")}function vv(n){const t=n.match(bv);return t?t[1].replace(_v,"'"):n}function Mv(n,t){const e=de(n,void 0),i=e.getFullYear(),s=e.getMonth(),r=Ce(e,0);return r.setFullYear(i,s+1,0),r.setHours(0,0,0,0),r.getDate()}function kv(){return Object.assign({},ks())}function Dv(n){return Math.trunc(n*p1)}function Sv(n){const t=n/g1;return Math.trunc(t)}function Hh(n,t,e){return m1(n,-1)}function Wh(n,t,e){const i=kv(),s=Pv(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?Tv(s,t):Cv(s,t)}function Tv(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function Cv(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function Pv(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function Ov(n,t){const e=Lv(t);return"formatToParts"in e?Av(e,n):Rv(e,n)}const Ev={year:0,month:1,day:2,hour:3,minute:4,second:5};function Av(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=Ev[e[s].type];r!==void 0&&(i[r]=parseInt(e[s].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function Rv(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const $a={},Yh=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),Iv=Yh==="06/25/2014, 00:00:00"||Yh==="06/25/2014 00:00:00";function Lv(n){return $a[n]||($a[n]=Iv?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"}):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"})),$a[n]}function Ua(n,t,e,i,s,r,o){const a=new Date(0);return a.setUTCFullYear(n,t,e),a.setUTCHours(i,s,r,o),a}const jh=36e5,Nv=6e4,Xa={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Ts(n,t,e){if(!n)return 0;let i=Xa.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=Xa.timezoneHH.exec(n),i)return s=parseInt(i[1],10),Vh(s)?-(s*jh):NaN;if(i=Xa.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const o=parseInt(i[3],10);return Vh(s,o)?(r=Math.abs(s)*jh+o*Nv,i[1]==="+"?-r:r):NaN}if(Bv(n)){t=new Date(t||Date.now());const o=e?t:Fv(t),a=qa(o,n);return-(e?a:zv(t,a,n))}return NaN}function Fv(n){return Ua(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function qa(n,t){const e=Ov(n,t),i=Ua(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let s=n.getTime();const r=s%1e3;return s-=r>=0?r:1e3+r,i-s}function zv(n,t,e){let i=n.getTime()-t;const s=qa(new Date(i),e);if(t===s)return t;i-=s-t;const r=qa(new Date(i),e);return s===r?s:Math.max(s,r)}function Vh(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const $h={};function Bv(n){if($h[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),$h[n]=!0,!0}catch{return!1}}const Hv=60*1e3,Wv={X:function(n,t,e){const i=Ga(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return Uh(i);case"XXXX":case"XX":return vi(i);case"XXXXX":case"XXX":default:return vi(i,":")}},x:function(n,t,e){const i=Ga(e.timeZone,n);switch(t){case"x":return Uh(i);case"xxxx":case"xx":return vi(i);case"xxxxx":case"xxx":default:return vi(i,":")}},O:function(n,t,e){const i=Ga(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Yv(i,":");case"OOOO":default:return"GMT"+vi(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return Wh("short",n,e);case"zzzz":default:return Wh("long",n,e)}}};function Ga(n,t){const e=n?Ts(n,t,!0)/Hv:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Hr(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function vi(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Hr(Math.floor(i/60),2),r=Hr(Math.floor(i%60),2);return e+s+t+r}function Uh(n,t){return n%60===0?(n>0?"-":"+")+Hr(Math.abs(n)/60,2):vi(n,t)}function Yv(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.floor(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Hr(r,2)}function Xh(n){const 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-+t}const qh=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Ka=36e5,Gh=6e4,jv=2,he={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,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:qh};function Wr(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?jv:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==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(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=Vv(n),{year:s,restDateString:r}=$v(i.date,e),o=Uv(r,s);if(o===null||isNaN(o.getTime()))return new Date(NaN);if(o){const a=o.getTime();let l=0,c;if(i.time&&(l=Xv(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Ts(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=Xh(new Date(a+l)),c=Xh(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function Vv(n){const t={};let e=he.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=he.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=he.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function $v(n,t){if(n){const e=he.YYY[t],i=he.YYYYY[t];let s=he.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=he.YY.exec(n)||e.exec(n),s){const r=s[1];return{year:parseInt(r,10)*100,restDateString:n.slice(r.length)}}}return{year:null}}function Uv(n,t){if(t===null)return null;let e,i,s;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let r=he.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,Qh(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=he.DDD.exec(n),r){e=new Date(0);const o=parseInt(r[1],10);return Kv(t,o)?(e.setUTCFullYear(t,0,o),e):new Date(NaN)}if(r=he.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const o=parseInt(r[2],10);return Qh(t,i,o)?(e.setUTCFullYear(t,i,o),e):new Date(NaN)}if(r=he.Www.exec(n),r)return s=parseInt(r[1],10)-1,Jh(s)?Kh(t,s):new Date(NaN);if(r=he.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const o=parseInt(r[2],10)-1;return Jh(s,o)?Kh(t,s,o):new Date(NaN)}return null}function Xv(n){let t,e,i=he.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Za(t)?t%24*Ka:NaN;if(i=he.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Za(t,e)?t%24*Ka+e*Gh:NaN;if(i=he.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Za(t,e,s)?t%24*Ka+e*Gh+s*1e3:NaN}return null}function Kh(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=t*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const qv=[31,28,31,30,31,30,31,31,30,31,30,31],Gv=[31,29,31,30,31,30,31,31,30,31,30,31];function Zh(n){return n%400===0||n%4===0&&n%100!==0}function Qh(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=Zh(n);if(i&&e>Gv[t]||!i&&e>qv[t])return!1}return!0}function Kv(n,t){if(t<1)return!1;const e=Zh(n);return!(e&&t>366||!e&&t>365)}function Jh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Za(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const Zv=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Qv(n,t,e={}){t=String(t);const i=t.match(Zv);if(i){const s=Wr(e.originalDate||n,e);t=i.reduce(function(r,o){if(o[0]==="'")return r;const a=r.indexOf(o),l=r[a-1]==="'",c=r.replace(o,"'"+Wv[o[0]](s,o,e)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return wv(n,t,e)}function tf(n,t,e){n=Wr(n,e);const i=Ts(t,n,!0),s=new Date(n.getTime()-i),r=new Date(0);return r.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),r.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),r}function Jv(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Qv(tf(n,t,{timeZone:i.timeZone}),e,i)}function tM(n,t,e){if(typeof n=="string"&&!n.match(qh))return Wr(n,{...e,timeZone:t});n=Wr(n,e);const i=Ua(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),s=Ts(t,new Date(i));return new Date(i+s)}function eM(n,t){return-Ts(n,t)}function Mi(n,t={}){if(!n)return n;const e=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let i="MMM dd, yyy hh:mm a";t.short&&(i="MMM dd, yyy"),t.includeTZ&&(i+=" (z)");const s=new Date(n);return Jv(s,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const nM={secondly:1e3,tenSecondly:10*1e3,thirtySecondly:30*1e3,minutely:60*1e3,fiveMinutely:5*60*1e3,tenMinutely:10*60*1e3,thirtyMinutely:30*60*1e3,hourly:60*60*1e3,twoHourly:2*60*60*1e3,twelveHourly:12*60*60*1e3,daily:60*60*24*1e3,weekly:60*60*24*7*1e3,trend:0};function Qa(n){return n&&u1.find(t=>n<=nM[t])||null}var Yr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},jr={exports:{}};jr.exports,function(n,t){var e=200,i="__lodash_hash_undefined__",s=9007199254740991,r="[object Arguments]",o="[object Array]",a="[object Boolean]",l="[object Date]",c="[object Error]",u="[object Function]",d="[object GeneratorFunction]",f="[object Map]",g="[object Number]",p="[object Object]",y="[object Promise]",x="[object RegExp]",v="[object Set]",M="[object String]",D="[object Symbol]",S="[object WeakMap]",C="[object ArrayBuffer]",R="[object DataView]",O="[object Float32Array]",b="[object Float64Array]",_="[object Int8Array]",T="[object Int16Array]",I="[object Int32Array]",P="[object Uint8Array]",F="[object Uint8ClampedArray]",U="[object Uint16Array]",X="[object Uint32Array]",Q=/[\\^$.*+?()[\]{}|]/g,$=/\w*$/,ut=/^\[object .+?Constructor\]$/,V=/^(?:0|[1-9]\d*)$/,G={};G[r]=G[o]=G[C]=G[R]=G[a]=G[l]=G[O]=G[b]=G[_]=G[T]=G[I]=G[f]=G[g]=G[p]=G[x]=G[v]=G[M]=G[D]=G[P]=G[F]=G[U]=G[X]=!0,G[c]=G[u]=G[S]=!1;var J=typeof Yr=="object"&&Yr&&Yr.Object===Object&&Yr,z=typeof self=="object"&&self&&self.Object===Object&&self,B=J||z||Function("return this")(),ft=t&&!t.nodeType&&t,yt=ft&&!0&&n&&!n.nodeType&&n,vt=yt&&yt.exports===ft;function gt(w,A){return w.set(A[0],A[1]),w}function pt(w,A){return w.add(A),w}function H(w,A){for(var N=-1,q=w?w.length:0;++N<q&&A(w[N],N,w)!==!1;);return w}function j(w,A){for(var N=-1,q=A.length,Vt=w.length;++N<q;)w[Vt+N]=A[N];return w}function Y(w,A,N,q){for(var Vt=-1,Kt=w?w.length:0;++Vt<Kt;)N=A(N,w[Vt],Vt,w);return N}function Z(w,A){for(var N=-1,q=Array(w);++N<w;)q[N]=A(N);return q}function tt(w,A){return w==null?void 0:w[A]}function et(w){var A=!1;if(w!=null&&typeof w.toString!="function")try{A=!!(w+"")}catch{}return A}function it(w){var A=-1,N=Array(w.size);return w.forEach(function(q,Vt){N[++A]=[Vt,q]}),N}function nt(w,A){return function(N){return w(A(N))}}function xt(w){var A=-1,N=Array(w.size);return w.forEach(function(q){N[++A]=q}),N}var at=Array.prototype,Pt=Function.prototype,te=Object.prototype,ae=B["__core-js_shared__"],Xt=function(){var w=/[^.]+$/.exec(ae&&ae.keys&&ae.keys.IE_PROTO||"");return w?"Symbol(src)_1."+w:""}(),Oe=Pt.toString,Mt=te.hasOwnProperty,qt=te.toString,Bt=RegExp("^"+Oe.call(Mt).replace(Q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Gt=vt?B.Buffer:void 0,ie=B.Symbol,Xe=B.Uint8Array,ei=nt(Object.getPrototypeOf,Object),Ne=Object.create,Ht=te.propertyIsEnumerable,_e=at.splice,ni=Object.getOwnPropertySymbols,io=Gt?Gt.isBuffer:void 0,so=nt(Object.keys,Object),Ls=Rn(B,"DataView"),ii=Rn(B,"Map"),Ns=Rn(B,"Promise"),si=Rn(B,"Set"),an=Rn(B,"WeakMap"),ln=Rn(Object,"create"),Fs=le(Ls),zs=le(ii),ri=le(Ns),wl=le(si),vl=le(an),ro=ie?ie.prototype:void 0,oo=ro?ro.valueOf:void 0;function cn(w){var A=-1,N=w?w.length:0;for(this.clear();++A<N;){var q=w[A];this.set(q[0],q[1])}}function Ei(){this.__data__=ln?ln(null):{}}function Bs(w){return this.has(w)&&delete this.__data__[w]}function ao(w){var A=this.__data__;if(ln){var N=A[w];return N===i?void 0:N}return Mt.call(A,w)?A[w]:void 0}function un(w){var A=this.__data__;return ln?A[w]!==void 0:Mt.call(A,w)}function Ml(w,A){var N=this.__data__;return N[w]=ln&&A===void 0?i:A,this}cn.prototype.clear=Ei,cn.prototype.delete=Bs,cn.prototype.get=ao,cn.prototype.has=un,cn.prototype.set=Ml;function Fe(w){var A=-1,N=w?w.length:0;for(this.clear();++A<N;){var q=w[A];this.set(q[0],q[1])}}function kl(){this.__data__=[]}function Dl(w){var A=this.__data__,N=Ri(A,w);if(N<0)return!1;var q=A.length-1;return N==q?A.pop():_e.call(A,N,1),!0}function Sl(w){var A=this.__data__,N=Ri(A,w);return N<0?void 0:A[N][1]}function ze(w){return Ri(this.__data__,w)>-1}function Tl(w,A){var N=this.__data__,q=Ri(N,w);return q<0?N.push([w,A]):N[q][1]=A,this}Fe.prototype.clear=kl,Fe.prototype.delete=Dl,Fe.prototype.get=Sl,Fe.prototype.has=ze,Fe.prototype.set=Tl;function En(w){var A=-1,N=w?w.length:0;for(this.clear();++A<N;){var q=w[A];this.set(q[0],q[1])}}function Cl(){this.__data__={hash:new cn,map:new(ii||Fe),string:new cn}}function Pl(w){return Ni(this,w).delete(w)}function Ol(w){return Ni(this,w).get(w)}function Be(w){return Ni(this,w).has(w)}function El(w,A){return Ni(this,w).set(w,A),this}En.prototype.clear=Cl,En.prototype.delete=Pl,En.prototype.get=Ol,En.prototype.has=Be,En.prototype.set=El;function An(w){this.__data__=new Fe(w)}function Al(){this.__data__=new Fe}function Rl(w){return this.__data__.delete(w)}function Il(w){return this.__data__.get(w)}function Ai(w){return this.__data__.has(w)}function Ll(w,A){var N=this.__data__;if(N instanceof Fe){var q=N.__data__;if(!ii||q.length<e-1)return q.push([w,A]),this;N=this.__data__=new En(q)}return N.set(w,A),this}An.prototype.clear=Al,An.prototype.delete=Rl,An.prototype.get=Il,An.prototype.has=Ai,An.prototype.set=Ll;function Nl(w,A){var N=js(w)||zi(w)?Z(w.length,String):[],q=N.length,Vt=!!q;for(var Kt in w)Mt.call(w,Kt)&&!(Vt&&(Kt=="length"||Jl(Kt,q)))&&N.push(Kt);return N}function Ee(w,A,N){var q=w[A];(!(Mt.call(w,A)&&Ys(q,N))||N===void 0&&!(A in w))&&(w[A]=N)}function Ri(w,A){for(var N=w.length;N--;)if(Ys(w[N][0],A))return N;return-1}function Fl(w,A){return w&&lo(A,oi(A),w)}function Hs(w,A,N,q,Vt,Kt,xe){var ee;if(q&&(ee=Kt?q(w,Vt,Kt,xe):q(w)),ee!==void 0)return ee;if(!hn(w))return w;var mo=js(w);if(mo){if(ee=Zl(w),!A)return ql(w,ee)}else{var In=qe(w),yo=In==u||In==d;if(fo(w))return Yl(w,A);if(In==p||In==r||yo&&!Kt){if(et(w))return Kt?w:{};if(ee=uo(yo?{}:w),!A)return Gl(w,Fl(ee,w))}else{if(!G[In])return Kt?w:{};ee=Ql(w,In,Hs,A)}}xe||(xe=new An);var bo=xe.get(w);if(bo)return bo;if(xe.set(w,ee),!mo)var ai=N?Kl(w):oi(w);return H(ai||w,function($s,Bi){ai&&(Bi=$s,$s=w[Bi]),Ee(ee,Bi,Hs($s,A,N,q,Bi,w,xe))}),ee}function zl(w){return hn(w)?Ne(w):{}}function Bl(w,A,N){var q=A(w);return js(w)?q:j(q,N(w))}function Hl(w){return qt.call(w)}function Ii(w){if(!hn(w)||tc(w))return!1;var A=Vs(w)||et(w)?Bt:ut;return A.test(le(w))}function Wl(w){if(!dn(w))return so(w);var A=[];for(var N in Object(w))Mt.call(w,N)&&N!="constructor"&&A.push(N);return A}function Yl(w,A){if(A)return w.slice();var N=new w.constructor(w.length);return w.copy(N),N}function Li(w){var A=new w.constructor(w.byteLength);return new Xe(A).set(new Xe(w)),A}function jl(w,A){var N=A?Li(w.buffer):w.buffer;return new w.constructor(N,w.byteOffset,w.byteLength)}function Vl(w,A,N){var q=A?N(it(w),!0):it(w);return Y(q,gt,new w.constructor)}function Ws(w){var A=new w.constructor(w.source,$.exec(w));return A.lastIndex=w.lastIndex,A}function $l(w,A,N){var q=A?N(xt(w),!0):xt(w);return Y(q,pt,new w.constructor)}function Ul(w){return oo?Object(oo.call(w)):{}}function Xl(w,A){var N=A?Li(w.buffer):w.buffer;return new w.constructor(N,w.byteOffset,w.length)}function ql(w,A){var N=-1,q=w.length;for(A||(A=Array(q));++N<q;)A[N]=w[N];return A}function lo(w,A,N,q){N||(N={});for(var Vt=-1,Kt=A.length;++Vt<Kt;){var xe=A[Vt],ee=void 0;Ee(N,xe,ee===void 0?w[xe]:ee)}return N}function Gl(w,A){return lo(w,co(w),A)}function Kl(w){return Bl(w,oi,co)}function Ni(w,A){var N=w.__data__;return Fi(A)?N[typeof A=="string"?"string":"hash"]:N.map}function Rn(w,A){var N=tt(w,A);return Ii(N)?N:void 0}var co=ni?nt(ni,Object):go,qe=Hl;(Ls&&qe(new Ls(new ArrayBuffer(1)))!=R||ii&&qe(new ii)!=f||Ns&&qe(Ns.resolve())!=y||si&&qe(new si)!=v||an&&qe(new an)!=S)&&(qe=function(w){var A=qt.call(w),N=A==p?w.constructor:void 0,q=N?le(N):void 0;if(q)switch(q){case Fs:return R;case zs:return f;case ri:return y;case wl:return v;case vl:return S}return A});function Zl(w){var A=w.length,N=w.constructor(A);return A&&typeof w[0]=="string"&&Mt.call(w,"index")&&(N.index=w.index,N.input=w.input),N}function uo(w){return typeof w.constructor=="function"&&!dn(w)?zl(ei(w)):{}}function Ql(w,A,N,q){var Vt=w.constructor;switch(A){case C:return Li(w);case a:case l:return new Vt(+w);case R:return jl(w,q);case O:case b:case _:case T:case I:case P:case F:case U:case X:return Xl(w,q);case f:return Vl(w,q,N);case g:case M:return new Vt(w);case x:return Ws(w);case v:return $l(w,q,N);case D:return Ul(w)}}function Jl(w,A){return A=A??s,!!A&&(typeof w=="number"||V.test(w))&&w>-1&&w%1==0&&w<A}function Fi(w){var A=typeof w;return A=="string"||A=="number"||A=="symbol"||A=="boolean"?w!=="__proto__":w===null}function tc(w){return!!Xt&&Xt in w}function dn(w){var A=w&&w.constructor,N=typeof A=="function"&&A.prototype||te;return w===N}function le(w){if(w!=null){try{return Oe.call(w)}catch{}try{return w+""}catch{}}return""}function ec(w){return Hs(w,!0,!0)}function Ys(w,A){return w===A||w!==w&&A!==A}function zi(w){return nc(w)&&Mt.call(w,"callee")&&(!Ht.call(w,"callee")||qt.call(w)==r)}var js=Array.isArray;function ho(w){return w!=null&&ic(w.length)&&!Vs(w)}function nc(w){return fn(w)&&ho(w)}var fo=io||po;function Vs(w){var A=hn(w)?qt.call(w):"";return A==u||A==d}function ic(w){return typeof w=="number"&&w>-1&&w%1==0&&w<=s}function hn(w){var A=typeof w;return!!w&&(A=="object"||A=="function")}function fn(w){return!!w&&typeof w=="object"}function oi(w){return ho(w)?Nl(w):Wl(w)}function go(){return[]}function po(){return!1}n.exports=ec}(jr,jr.exports),jr.exports;const ki=(n,t)=>new Date(n.getTime()-eM(t,n));class Le{constructor(t){Te(this,"timeframeText"),Te(this,"key"),Te(this,"display"),Te(this,"timeframeLength"),Te(this,"allowedTiers"),Te(this,"defaultResponseGranularity"),Te(this,"dataGranularity"),Te(this,"isRelative"),Te(this,"fineGrainedDefaultGranularity"),Te(this,"_startCustom"),Te(this,"_endCustom"),Te(this,"_allowedGranularitiesOverride"),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,this._allowedGranularitiesOverride=t.allowedGranularitiesOverride,this.fineGrainedDefaultGranularity=t.fineGrainedDefaultGranularity}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(t){if(this._allowedGranularitiesOverride&&t)return new Set(this._allowedGranularitiesOverride);const e=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&e.add("minutely"),i>=2&&i<=7*24&&e.add("hourly"),i>=2*24&&e.add("daily"),i>=2*24*14&&e.add("weekly"),e}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const e=tM(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return tf(e,t)}}class iM extends Le{rawStart(t){let e=rn(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=ki(e,t)),e}maximumTimeframeLength(){return 60*60*24*7}}class sM extends Le{rawStart(t){let e=xi(this.tzAdjustedDate(t));return t&&(e=ki(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class rM extends Le{rawEnd(t){let e=rn(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=ki(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=rn(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=ki(i,t)),i}}class oM extends Le{rawEnd(t){let e=xi(this.tzAdjustedDate(t));return t&&(e=ki(e,t)),e}rawStart(t){let e=xi(Hh(this.tzAdjustedDate(t)));return t&&(e=ki(e,t)),e}}mt.FIFTEEN_MIN,new Le({key:mt.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"thirtySecondly",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely"]}),mt.ONE_HOUR,new Le({key:mt.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"minutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely"]}),mt.SIX_HOUR,new Le({key:mt.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"fiveMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),mt.TWELVE_HOUR,new Le({key:mt.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"tenMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),mt.ONE_DAY,new Le({key:mt.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"thirtyMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),mt.SEVEN_DAY,new Le({key:mt.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),mt.THIRTY_DAY,new Le({key:mt.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twelveHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),mt.CURRENT_WEEK,new iM({key:mt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=rn(new Date,{weekStartsOn:1});return(Br(Eh(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),mt.CURRENT_MONTH,new sM({key:mt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=xi(new Date);return(Br(Eh(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),mt.PREVIOUS_WEEK,new rM({key:mt.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),mt.PREVIOUS_MONTH,new oM({key:mt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=xi(new Date),e=xi(Hh(new Date));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=aM(t,e)),60*60*24*Mv(new Date().setMonth(new Date().getMonth()-1))+Dv(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function aM(n,t){return Sv(n.getTimezoneOffset()-t.getTimezoneOffset())}mt.FIFTEEN_MIN,mt.ONE_HOUR,mt.SIX_HOUR,mt.TWELVE_HOUR,mt.ONE_DAY,mt.SEVEN_DAY,mt.FIFTEEN_MIN,mt.ONE_HOUR,mt.SIX_HOUR,mt.TWELVE_HOUR,mt.ONE_DAY,mt.SEVEN_DAY,mt.THIRTY_DAY,mt.CURRENT_WEEK,mt.CURRENT_MONTH,mt.PREVIOUS_WEEK,mt.PREVIOUS_MONTH;function lM(n){return h.computed(()=>{var s;if(!((s=n.value)!=null&&s.meta))return"";const e=n.value.meta.start_ms,i=n.value.meta.end_ms;return e&&i?`${Mi(e)} - ${Mi(i,{includeTZ:!0})}`:""})}function cM(n){const e=`donutChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:r=>({label:r.dataset.label,value:r.label})}};je.positioners[e]=function(r,o){if(!r.length)return!1;const a=this.chart.canvas.getBoundingClientRect(),l=n.tooltipState.width||this.width,c=a.width/2,u=Ta(o,l,c),d=o.y,f=o.x<c?"left":"center";return{x:u-n.tooltipState.offsetX,y:d,xAlign:f}};const s=h.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:r=>{Gd(n.tooltipState,r)}}}}));return h.onUnmounted(()=>{je.positioners[e]&&delete je.positioners[e]}),{options:s}}function uM(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,callback:u=>{const d=new Date(u);return vh(d,n.granularity.value,o.value)}},title:{display:!st((l=n.dimensionAxesTitle)==null?void 0:l.value),text:(c=n.dimensionAxesTitle)==null?void 0:c.value,padding:{top:2},font:{weight:"bold"}},border:{display:!1},stacked:n.stacked.value}}),e=h.computed(()=>{var l,c;return{title:{display:!st((l=n.metricAxesTitle)==null?void 0:l.value),text:(c=n.metricAxesTitle)==null?void 0:c.value,padding:{bottom:10},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1},stacked:n.stacked.value}}),s=`lineChartTooltipPosition-${n.tooltipState.chartID}`,r={enabled:!1,position:s};je.positioners[s]=function(l,c){if(!l.length||n.tooltipState.interactionMode==="interactive")return!1;const u=this.chart.canvas.getBoundingClientRect(),d=n.tooltipState.width||this.width,f=n.tooltipState.height||this.height,g=u.width/2,p=u.height/2,y=Ta(c,d,g);let x=hw(c,f,p);const v=c.y<p?"top":"bottom",M=c.x<g?"left":"center";return f>u.height&&(x=0),{x:y,y:x,xAlign:M,yAlign:v}};const o=h.computed(()=>{const l=Number(n.timeRangeMs.value),c=new Date,u=new Date(c.getTime()-l);return Vx(l)>24||u.getDate()!==c.getDate()}),a=h.computed(()=>{var l;return{hover:{mode:"index",intersect:!1},elements:{point:{radius:(l=n.pointsWithoutHover)!=null&&l.value?3:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:e.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...r,external:c=>{ow(n.tooltipState,c,n.granularity.value)}}},interaction:{mode:"index",intersect:!1}}});return h.onUnmounted(()=>{je.positioners[s]&&delete je.positioners[s]}),{options:a}}function dM(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:s,pivotRecords:r,rowLabels:o,colorPalette:a}=n,{i18n:l}=bt.useI18n();return t?i.map(u=>({label:l&&l.te(`chartLabels.${u}`)&&l.t(`chartLabels.${u}`)||u,backgroundColor:Ir(i.indexOf(u),sn),data:o.map((d,f)=>e?r[`${d.id},${u}`]||0:r[`${f},${u}`]||null)})):Array.from(s).flatMap((u,d)=>{if(!u)return[];const f=Oa(d,u.name,u.id==="empty",a);return{label:l&&l.te(`chartLabels.${u.name}`)&&l.t(`chartLabels.${u.name}`)||u.name,backgroundColor:f,data:o.map(g=>r[`${g.id},${u.id}`]||null),isSegmentEmpty:u.id==="empty"}})}function hM(n,t){const{i18n:e}=bt.useI18n();return h.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:o}=t.value.meta,a=r&&Object.keys(r),l=o&&o.length>1,c=r&&a&&a.length>0,u=c&&a.length>1;if(!s.length||!o)return{datasets:[],labels:[]};const d=c&&a||o,f=d[0],g=d.length>1?d[1]:d[0],p=Object.fromEntries(l?s.flatMap(_=>o.map((T,I)=>{const P=_.event[f],F=c?`${P},${T}`:`${I},${T}`,U=_.event[T];return[F,U]})):s.map(_=>{const T=c?`${_.event[f]},${_.event[g]}`:`${f},${g}`,I=_.event[o[0]];return[T,I]})),y=Object.keys(p).reduce((_,T)=>{const[I]=T.split(","),P=p[T];return _[I]?_[I]+=P:_[I]=P,_},{}),x=Object.entries(y).sort(([,_],[,T])=>Number(T)-Number(_)).map(([_])=>_),v=r[f],M=r[g],D=c&&v&&Object.entries(v).map(([_,T])=>({id:_,name:T.name}))||o.map(_=>({id:_,name:_})),S=c&&M&&Object.entries(M).map(([_,T])=>({id:_,name:T.name}))||o.map(_=>({id:_,name:_}));if(f!=="status_code"&&f!=="status_code_grouped"&&(D.sort((_,T)=>x.indexOf(_.id)-x.indexOf(T.id)),S.sort((_,T)=>x.indexOf(_.id)-x.indexOf(T.id))),!D||!S)return{labels:[],datasets:[]};const C=dM({isMultiMetric:l,hasDimensions:c,metricNames:o,dimensionFieldNames:d,barSegmentLabels:S,pivotRecords:p,rowLabels:D,colorPalette:n.colorPalette||sn}),R=c?D.map(_=>e&&e.te(`chartLabels.${_.name}`)&&e.t(`chartLabels.${_.name}`)||_.name):o.map(_=>e&&e.te(`chartLabels.${_}`)&&e.t(`chartLabels.${_}`)||_),O=D.map(_=>_.id==="empty");return{labels:R,datasets:C,isLabelEmpty:O,isMultiDimension:u}}}catch(s){return console.error(s),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const fM="#6c7489",ef="#6c7489",gM="#995c00",nf="16px",pM="20px",sf="24px",mM="40px",yM="48px",bM=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,s)=>i+s*e),_M=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return Xd(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},xM=(n,t,e,i,s)=>{const o=Math.max(t-6e4,Math.max(...(s||[]).map(c=>new Date(c.timestamp).valueOf()))),a=Math.floor((n-i)/e)*e+i,l=Math.floor((o-i)/e)*e+i+e;return bM(a,l,e)};function wM(n,t){const{i18n:e}=bt.useI18n();return h.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:o,start_ms:a,end_ms:l}=t.value.meta;if(!o)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const c=r&&Object.keys(r)||o,u=c&&c[0],d=r[u],f=r&&d&&Object.keys(d).map(S=>({id:S,name:d[S].name}))||o.map(S=>({id:S,name:S})),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(!s.length)return{datasets:[],labels:[]};const p=_M(a),y=xM(a,l,g,p,s),x=new Set,v=s!=null&&s.length?s.reduce((S,C)=>{const R=new Date(C.timestamp).valueOf(),O=C.event;for(const b of o)x.add(b),R in S||(S[R]={}),b in S[R]||(S[R][b]={});for(const b of o)f.forEach(_=>{O[u]===_.id||b===_.id?(S[R][b]||(S[R][b]={}),S[R][b][_.name]=Math.round(Number(O[b])*1e3)/1e3):c.length||(S[R][b]||(S[R][b]={}),S[R][b][_.name]=Math.round(Number(O[_.id])*1e3)/1e3)});return S},{}):{},D=[...o.length===1?o.flatMap(S=>f.map(C=>[S,C.name,C.id==="empty"])):f.map(S=>[S.name,S.name,S.id==="empty"])].map(([S,C,R],O)=>{const b=y.map(P=>P in v&&S in v[P]?{x:P,y:v[P][S][C]||0}:{x:P,y:0});let{colorPalette:_,fill:T}=n;st(_)&&(_=sn);const I=Oa(O,C,R,_);return{rawDimension:C,rawMetric:S,label:e&&e.te(`chartLabels.${C}`)&&e.t(`chartLabels.${C}`)||C,borderColor:I,backgroundColor:I,data:b,total:b.reduce((P,{y:F})=>P+Number(F),0),...xw,fill:T,borderWidth:T?vw:ww,isSegmentEmpty:R}});if(u==="status_code"||u==="status_code_grouped"?D.sort((S,C)=>(S.label??"")<(C.label??"")?-1:1):D.sort((S,C)=>Number(S.total)<Number(C.total)?-1:1),n.threshold)for(const S of Object.keys(n.threshold)){const C=n.threshold[S];C&&D.push({type:"line",rawMetric:S,isThreshold:!0,label:e.t("chartLabels.threshold"),borderColor:fM,borderWidth:1.25,borderDash:[12,8],fill:!1,order:-1,stack:"custom",data:y.map(R=>({x:R,y:C}))})}return{datasets:D}}}catch(s){return console.error(s),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const vM=(n,t)=>{h.watch([n,t],(e,i,s)=>{const[r,o]=e;!o||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(o,r),s(()=>{var a;(a=window._AnalyticsChartDataInternal)==null||a.delete(o)}))},{immediate:!0})};function MM(){const{i18n:n}=bt.useI18n();return{translateUnit:(e,i)=>{const s=i===1,r=`chartUnits.${e}`;return e==="usd"?"":n.te(r)?n.t(r,{plural:s?"":"s"}):e}}}const rf="analytics-query-provider",of=2;function kM(){const n=h.inject(rf);return{evaluateFeatureFlag:(e,i)=>n?n.evaluateFeatureFlagFn(e,i):i}}function Ja(n){return h.getCurrentScope()?(h.onScopeDispose(n),!0):!1}const af=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const DM=n=>n!=null,SM=Object.prototype.toString,TM=n=>SM.call(n)==="[object Object]";function Vr(n){return Array.isArray(n)?n:[n]}function CM(n){return h.getCurrentInstance()}function PM(n,t={}){if(!h.isRef(n))return h.toRefs(n);const e=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)e[i]=h.customRef(()=>({get(){return n.value[i]},set(s){var r;if((r=h.toValue(t.replaceRef))!=null?r:!0)if(Array.isArray(n.value)){const a=[...n.value];a[i]=s,n.value=a}else{const a={...n.value,[i]:s};Object.setPrototypeOf(a,Object.getPrototypeOf(n.value)),n.value=a}else n.value[i]=s}}));return e}function OM(n,t=!0,e){CM()?h.onMounted(n,e):t?n():h.nextTick(n)}function EM(n,t,e){return h.watch(n,t,{...e,immediate:!0})}const $r=af?window:void 0;function Di(n){var t;const e=h.toValue(n);return(t=e==null?void 0:e.$el)!=null?t:e}function Cs(...n){const t=[],e=()=>{t.forEach(a=>a()),t.length=0},i=(a,l,c,u)=>(a.addEventListener(l,c,u),()=>a.removeEventListener(l,c,u)),s=h.computed(()=>{const a=Vr(h.toValue(n[0])).filter(l=>l!=null);return a.every(l=>typeof l!="string")?a:void 0}),r=EM(()=>{var a,l;return[(l=(a=s.value)==null?void 0:a.map(c=>Di(c)))!=null?l:[$r].filter(c=>c!=null),Vr(h.toValue(s.value?n[1]:n[0])),Vr(h.unref(s.value?n[2]:n[1])),h.toValue(s.value?n[3]:n[2])]},([a,l,c,u])=>{if(e(),!(a!=null&&a.length)||!(l!=null&&l.length)||!(c!=null&&c.length))return;const d=TM(u)?{...u}:u;t.push(...a.flatMap(f=>l.flatMap(g=>c.map(p=>i(f,g,p,d)))))},{flush:"post"}),o=()=>{r(),e()};return Ja(e),o}function AM(){const n=h.shallowRef(!1),t=h.getCurrentInstance();return t&&h.onMounted(()=>{n.value=!0},t),n}function lf(n){const t=AM();return h.computed(()=>(t.value,!!n()))}function RM(n,t,e={}){const{window:i=$r,...s}=e;let r;const o=lf(()=>i&&"MutationObserver"in i),a=()=>{r&&(r.disconnect(),r=void 0)},l=h.computed(()=>{const f=h.toValue(n),g=Vr(f).map(Di).filter(DM);return new Set(g)}),c=h.watch(()=>l.value,f=>{a(),o.value&&f.size&&(r=new MutationObserver(t),f.forEach(g=>r.observe(g,s)))},{immediate:!0,flush:"post"}),u=()=>r==null?void 0:r.takeRecords(),d=()=>{c(),a()};return Ja(d),{isSupported:o,stop:d,takeRecords:u}}function IM(n,t={}){var e;const{pointerTypes:i,preventDefault:s,stopPropagation:r,exact:o,onMove:a,onEnd:l,onStart:c,initialValue:u,axis:d="both",draggingElement:f=$r,containerElement:g,handle:p=n,buttons:y=[0]}=t,x=h.ref((e=h.toValue(u))!=null?e:{x:0,y:0}),v=h.ref(),M=O=>i?i.includes(O.pointerType):!0,D=O=>{h.toValue(s)&&O.preventDefault(),h.toValue(r)&&O.stopPropagation()},S=O=>{var b;if(!h.toValue(y).includes(O.button)||h.toValue(t.disabled)||!M(O)||h.toValue(o)&&O.target!==h.toValue(n))return;const _=h.toValue(g),T=(b=_==null?void 0:_.getBoundingClientRect)==null?void 0:b.call(_),I=h.toValue(n).getBoundingClientRect(),P={x:O.clientX-(_?I.left-T.left+_.scrollLeft:I.left),y:O.clientY-(_?I.top-T.top+_.scrollTop:I.top)};(c==null?void 0:c(P,O))!==!1&&(v.value=P,D(O))},C=O=>{if(h.toValue(t.disabled)||!M(O)||!v.value)return;const b=h.toValue(g),_=h.toValue(n).getBoundingClientRect();let{x:T,y:I}=x.value;(d==="x"||d==="both")&&(T=O.clientX-v.value.x,b&&(T=Math.min(Math.max(0,T),b.scrollWidth-_.width))),(d==="y"||d==="both")&&(I=O.clientY-v.value.y,b&&(I=Math.min(Math.max(0,I),b.scrollHeight-_.height))),x.value={x:T,y:I},a==null||a(x.value,O),D(O)},R=O=>{h.toValue(t.disabled)||!M(O)||v.value&&(v.value=void 0,l==null||l(x.value,O),D(O))};if(af){const O=()=>{var b;return{capture:(b=t.capture)!=null?b:!0,passive:!h.toValue(s)}};Cs(p,"pointerdown",S,O),Cs(f,"pointermove",C,O),Cs(f,"pointerup",R,O)}return{...PM(x),position:x,isDragging:h.computed(()=>!!v.value),style:h.computed(()=>`left:${x.value.x}px;top:${x.value.y}px;`)}}function LM(n,t,e={}){const{window:i=$r,...s}=e;let r;const o=lf(()=>i&&"ResizeObserver"in i),a=()=>{r&&(r.disconnect(),r=void 0)},l=h.computed(()=>{const d=h.toValue(n);return Array.isArray(d)?d.map(f=>Di(f)):[Di(d)]}),c=h.watch(l,d=>{if(a(),o.value&&i){r=new ResizeObserver(t);for(const f of d)f&&r.observe(f,s)}},{immediate:!0,flush:"post"}),u=()=>{a(),c()};return Ja(u),{isSupported:o,stop:u}}function NM(n,t={}){const{reset:e=!0,windowResize:i=!0,windowScroll:s=!0,immediate:r=!0,updateTiming:o="sync"}=t,a=h.shallowRef(0),l=h.shallowRef(0),c=h.shallowRef(0),u=h.shallowRef(0),d=h.shallowRef(0),f=h.shallowRef(0),g=h.shallowRef(0),p=h.shallowRef(0);function y(){const v=Di(n);if(!v){e&&(a.value=0,l.value=0,c.value=0,u.value=0,d.value=0,f.value=0,g.value=0,p.value=0);return}const M=v.getBoundingClientRect();a.value=M.height,l.value=M.bottom,c.value=M.left,u.value=M.right,d.value=M.top,f.value=M.width,g.value=M.x,p.value=M.y}function x(){o==="sync"?y():o==="next-frame"&&requestAnimationFrame(()=>y())}return LM(n,x),h.watch(()=>Di(n),v=>!v&&x()),RM(n,x,{attributeFilter:["style","class"]}),s&&Cs("scroll",x,{capture:!0,passive:!0}),i&&Cs("resize",x,{passive:!0}),OM(()=>{r&&x()}),{height:a,bottom:l,left:c,right:u,top:d,width:f,x:g,y:p,update:x}}function FM(n,t){const{top:e,left:i}=NM(n),s=h.computed(()=>n.value?`${parseFloat(t.left)+i.value}px`:t.left),r=h.computed(()=>n.value?`${parseFloat(t.top)+e.value}px`:t.top);return{tooltipAbsoluteLeft:s,tooltipAbsoluteTop:r}}const bt={useBarChartOptions:e1,useChartJSCommon:i1,useChartLegendValues:r1,useChartSelectedRange:lM,useExploreResultToDatasets:hM,useExploreResultToTimeDataset:wM,useDonutChartOptions:cM,useLineChartOptions:uM,useI18n:vg,useReportChartDataForSynthetics:vM,useTranslatedUnits:MM,useEvaluateFeatureFlag:kM,useTooltipAbsolutePosition:FM};var Nt=(n=>(n.Hidden="hidden",n.Right="right",n.Bottom="bottom",n))(Nt||{});/*!
|
|
18
|
+
`):n}function Gb(n,t){const{element:e,datasetIndex:i,index:s}=t,r=n.getDatasetMeta(i).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:n,label:o,parsed:r.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function sd(n,t){const e=n.chart.ctx,{body:i,footer:s,title:r}=n,{boxWidth:o,boxHeight:a}=t,l=It(t.bodyFont),c=It(t.titleFont),u=It(t.footerFont),d=r.length,f=s.length,g=i.length,p=Ut(t.padding);let y=p.height,x=0,v=i.reduce((S,P)=>S+P.before.length+P.lines.length+P.after.length,0);if(v+=n.beforeBody.length+n.afterBody.length,d&&(y+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),v){const S=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;y+=g*S+(v-g)*l.lineHeight+(v-1)*t.bodySpacing}f&&(y+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let M=0;const D=function(S){x=Math.max(x,e.measureText(S).width+M)};return e.save(),e.font=c.string,St(n.title,D),e.font=l.string,St(n.beforeBody.concat(n.afterBody),D),M=t.displayColors?o+2+t.boxPadding:0,St(i,S=>{St(S.before,D),St(S.lines,D),St(S.after,D)}),M=0,e.font=u.string,St(n.footer,D),e.restore(),x+=p.width,{width:x,height:y}}function Kb(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function Zb(n,t,e,i){const{x:s,width:r}=i,o=e.caretSize+e.caretPadding;if(n==="left"&&s+r+o>t.width||n==="right"&&s-r-o<0)return!0}function Qb(n,t,e,i){const{x:s,width:r}=e,{width:o,chartArea:{left:a,right:l}}=n;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),Zb(c,n,t,e)&&(c="center"),c}function rd(n,t,e){const i=e.yAlign||t.yAlign||Kb(n,e);return{xAlign:e.xAlign||t.xAlign||Qb(n,t,e,i),yAlign:i}}function Jb(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function t0(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function od(n,t,e,i){const{caretSize:s,caretPadding:r,cornerRadius:o}=n,{xAlign:a,yAlign:l}=e,c=s+r,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:g}=xn(o);let p=Jb(t,a);const y=t0(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,f)+s:a==="right"&&(p+=Math.max(d,g)+s),{x:Qt(p,0,i.width-t.width),y:Qt(y,0,i.height-t.height)}}function kr(n,t,e){const i=Ut(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function ad(n){return Ye([],nn(n))}function e0(n,t,e){return wn(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function ld(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const cd={beforeTitle:Ke,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:Ke,beforeBody:Ke,beforeLabel:Ke,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 st(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:Ke,afterBody:Ke,beforeFooter:Ke,footer:Ke,afterFooter:Ke};function me(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?cd[t].call(e,i):s}class ca extends Jt{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,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,r=new Yo(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=e0(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=me(i,"beforeTitle",this,t),r=me(i,"title",this,t),o=me(i,"afterTitle",this,t);let a=[];return a=Ye(a,nn(s)),a=Ye(a,nn(r)),a=Ye(a,nn(o)),a}getBeforeBody(t,e){return ad(me(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return St(t,r=>{const o={before:[],lines:[],after:[]},a=ld(i,r);Ye(o.before,nn(me(a,"beforeLabel",this,r))),Ye(o.lines,me(a,"label",this,r)),Ye(o.after,nn(me(a,"afterLabel",this,r))),s.push(o)}),s}getAfterBody(t,e){return ad(me(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=me(i,"beforeFooter",this,t),r=me(i,"footer",this,t),o=me(i,"afterFooter",this,t);let a=[];return a=Ye(a,nn(s)),a=Ye(a,nn(r)),a=Ye(a,nn(o)),a}_createItems(t){const e=this._active,i=this.chart.data,s=[],r=[],o=[];let a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(Gb(this.chart,e[l]));return t.filter&&(a=a.filter((u,d,f)=>t.filter(u,d,f,i))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,i))),St(a,u=>{const d=ld(t.callbacks,u);s.push(me(d,"labelColor",this,u)),r.push(me(d,"labelPointStyle",this,u)),o.push(me(d,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let r,o=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const a=ds[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const l=this._size=sd(this,i),c=Object.assign({},a,l),u=rd(this.chart,i,c),d=od(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const r=this.getCaretPosition(t,i,s);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:r}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=xn(a),{x:f,y:g}=t,{width:p,height:y}=e;let x,v,M,D,S,P;return r==="center"?(S=g+y/2,s==="left"?(x=f,v=x-o,D=S+o,P=S-o):(x=f+p,v=x+o,D=S-o,P=S+o),M=x):(s==="left"?v=f+Math.max(l,u)+o:s==="right"?v=f+p-Math.max(c,d)-o:v=this.caretX,r==="top"?(D=g,S=D-o,x=v-o,M=v+o):(D=g+y,S=D+o,x=v+o,M=v-o),P=D),{x1:x,x2:v,x3:M,y1:D,y2:S,y3:P}}drawTitle(t,e,i){const s=this.title,r=s.length;let o,a,l;if(r){const c=gi(i.rtl,this.x,this.width);for(t.x=kr(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",o=It(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,l=0;l<r;++l)e.fillText(s[l],c.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===r&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,e,i,s,r){const o=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=r,u=It(r.bodyFont),d=kr(this,"left",r),f=s.x(d),g=l<u.lineHeight?(u.lineHeight-l)/2:0,p=e.y+g;if(r.usePointStyle){const y={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},x=s.leftForLtr(f,c)+c/2,v=p+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Lo(t,y,x,v),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Lo(t,y,x,v)}else{t.lineWidth=ht(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const y=s.leftForLtr(f,c),x=s.leftForLtr(s.xPlus(f,1),c-2),v=xn(o.borderRadius);Object.values(v).some(M=>M!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,di(t,{x:y,y:p,w:c,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),di(t,{x,y:p+1,w:c-2,h:l-2,radius:v}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(y,p,c,l),t.strokeRect(y,p,c,l),t.fillStyle=o.backgroundColor,t.fillRect(x,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=It(i.bodyFont);let f=d.lineHeight,g=0;const p=gi(i.rtl,this.x,this.width),y=function(b){e.fillText(b,p.x(t.x+g),t.y+f/2),t.y+=f+r},x=p.textAlign(o);let v,M,D,S,P,R,O;for(e.textAlign=o,e.textBaseline="middle",e.font=d.string,t.x=kr(this,x,i),e.fillStyle=i.bodyColor,St(this.beforeBody,y),g=a&&x!=="right"?o==="center"?c/2+u:c+2+u:0,S=0,R=s.length;S<R;++S){for(v=s[S],M=this.labelTextColors[S],e.fillStyle=M,St(v.before,y),D=v.lines,a&&D.length&&(this._drawColorBox(e,t,S,p,i),f=Math.max(d.lineHeight,l)),P=0,O=D.length;P<O;++P)y(D[P]),f=d.lineHeight;St(v.after,y)}g=0,f=d.lineHeight,St(this.afterBody,y),t.y-=r}drawFooter(t,e,i){const s=this.footer,r=s.length;let o,a;if(r){const l=gi(i.rtl,this.x,this.width);for(t.x=kr(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",o=It(i.footerFont),e.fillStyle=i.footerColor,e.font=o.string,a=0;a<r;++a)e.fillText(s[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:r,yAlign:o}=this,{x:a,y:l}=t,{width:c,height:u}=i,{topLeft:d,topRight:f,bottomLeft:g,bottomRight:p}=xn(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(a+d,l),o==="top"&&this.drawCaret(t,e,i,s),e.lineTo(a+c-f,l),e.quadraticCurveTo(a+c,l,a+c,l+f),o==="center"&&r==="right"&&this.drawCaret(t,e,i,s),e.lineTo(a+c,l+u-p),e.quadraticCurveTo(a+c,l+u,a+c-p,l+u),o==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(a+g,l+u),e.quadraticCurveTo(a,l+u,a,l+u-g),o==="center"&&r==="left"&&this.drawCaret(t,e,i,s),e.lineTo(a,l+d),e.quadraticCurveTo(a,l,a+d,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const o=ds[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=sd(this,t),l=Object.assign({},o,this._size),c=rd(e,t,l),u=od(t,l,c,e);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Ut(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,s,e),jc(t,e.textDirection),r.y+=o.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),Vc(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!Gs(i,s),o=this._positionChanged(s,e);(r||o)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],o=this._getActiveElements(t,r,e,i),a=this._positionChanged(o,t),l=e||!Gs(o,r)||a;return l&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:s,options:r}=this,o=ds[r.position].call(this,t,e);return o!==!1&&(i!==o.x||s!==o.y)}}E(ca,"positioners",ds);var je={id:"tooltip",_element:ca,positioners:ds,afterInit(n,t,e){e&&(n.tooltip=new ca({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:cd},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"]},n0=Object.freeze({__proto__:null,Colors:pb,Decimation:_b,Filler:Bb,Legend:$b,SubTitle:qb,Title:Xb,Tooltip:je});const i0=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function s0(n,t,e,i){const s=n.indexOf(t);if(s===-1)return i0(n,t,e,i);const r=n.lastIndexOf(t);return s!==r?e:s}const r0=(n,t)=>n===null?null:Qt(Math.round(n),0,t);function ud(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class ua extends jn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:s,label:r}of e)i[s]===r&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(st(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:s0(i,t,rt(e,t),this._addedLabels),r0(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let r=this.getLabels();r=t===0&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=t;o<=e;o++)s.push({value:o});return s}getLabelForValue(t){return ud.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}}E(ua,"id","category"),E(ua,"defaults",{ticks:{callback:ud}});function o0(n,t){const e=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=n,g=r||1,p=u-1,{min:y,max:x}=t,v=!st(o),M=!st(a),D=!st(c),S=(x-y)/(d+1);let P=pc((x-y)/p/g)*g,R,O,b,_;if(P<1e-14&&!v&&!M)return[{value:y},{value:x}];_=Math.ceil(x/P)-Math.floor(y/P),_>p&&(P=pc(_*P/p/g)*g),st(l)||(R=Math.pow(10,l),P=Math.ceil(P*R)/R),s==="ticks"?(O=Math.floor(y/P)*P,b=Math.ceil(x/P)*P):(O=y,b=x),v&&M&&r&&ep((a-o)/r,P/1e3)?(_=Math.round(Math.min((a-o)/P,u)),P=(a-o)/_,O=o,b=a):D?(O=v?o:O,b=M?a:b,_=c-1,P=(b-O)/_):(_=(b-O)/P,$i(_,Math.round(_),P/1e3)?_=Math.round(_):_=Math.ceil(_));const C=Math.max(yc(P),yc(O));R=Math.pow(10,st(l)?C:l),O=Math.round(O*R)/R,b=Math.round(b*R)/R;let I=0;for(v&&(f&&O!==o?(e.push({value:o}),O<o&&I++,$i(Math.round((O+I*P)*R)/R,o,dd(o,S,n))&&I++):O<o&&I++);I<_;++I){const T=Math.round((O+I*P)*R)/R;if(M&&T>a)break;e.push({value:T})}return M&&f&&b!==a?e.length&&$i(e[e.length-1].value,a,dd(a,S,n))?e[e.length-1].value=a:e.push({value:a}):(!M||b===a)&&e.push({value:b}),e}function dd(n,t,{horizontal:e,minRotation:i}){const s=$t(i),r=(e?Math.sin(s):Math.cos(s))||.001,o=.75*t*(""+n).length;return Math.min(t/r,o)}class Dr extends jn{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 st(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:r}=this;const o=l=>s=e?s:l,a=l=>r=i?r:l;if(t){const l=He(s),c=He(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(s===r){let l=r===0?1:Math.abs(r*.05);a(r+l),t||o(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,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},r=this._range||this,o=o0(s,r);return t.bounds==="ticks"&&mc(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return qi(t,this.chart.options.locale,this.options.ticks.format)}}class da extends Dr{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Rt(t)?t:0,this.max=Rt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=$t(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}E(da,"id","linear"),E(da,"defaults",{ticks:{callback:nr.formatters.numeric}});const hs=n=>Math.floor(bn(n)),Vn=(n,t)=>Math.pow(10,hs(n)+t);function hd(n){return n/Math.pow(10,hs(n))===1}function fd(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function a0(n,t){const e=t-n;let i=hs(e);for(;fd(n,t,i)>10;)i++;for(;fd(n,t,i)<10;)i--;return Math.min(i,hs(n))}function l0(n,{min:t,max:e}){t=Me(n.min,t);const i=[],s=hs(t);let r=a0(t,e),o=r<0?Math.pow(10,Math.abs(r)):1;const a=Math.pow(10,r),l=s>r?Math.pow(10,s):0,c=Math.round((t-l)*o)/o,u=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((c-u)/Math.pow(10,r)),f=Me(n.min,Math.round((l+u+d*Math.pow(10,r))*o)/o);for(;f<e;)i.push({value:f,major:hd(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(r++,d=2,o=r>=0?1:o),f=Math.round((l+u+d*Math.pow(10,r))*o)/o;const g=Me(n.max,f);return i.push({value:g,major:hd(g),significand:d}),i}class ha extends jn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Dr.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return Rt(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Rt(t)?Math.max(0,t):null,this.max=Rt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Rt(this._userMin)&&(this.min=t===Vn(this.min,0)?Vn(this.min,-1):Vn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const r=a=>i=t?i:a,o=a=>s=e?s:a;i===s&&(i<=0?(r(1),o(10)):(r(Vn(i,-1)),o(Vn(s,1)))),i<=0&&r(Vn(s,-1)),s<=0&&o(Vn(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=l0(e,this);return t.bounds==="ticks"&&mc(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":qi(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=bn(t),this._valueRange=bn(this.max)-bn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(bn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}E(ha,"id","logarithmic"),E(ha,"defaults",{ticks:{callback:nr.formatters.logarithmic,major:{enabled:!0}}});function fa(n){const t=n.ticks;if(t.display&&n.display){const e=Ut(t.backdropPadding);return rt(t.font&&t.font.size,At.font.size)+e.height}return 0}function c0(n,t,e){return e=kt(e)?e:[e],{w:bp(n,t.string,e),h:e.length*t.lineHeight}}function gd(n,t,e,i,s){return n===i||n===s?{start:t-e/2,end:t+e/2}:n<i||n>s?{start:t-e,end:t}:{start:t,end:t+e}}function u0(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),i=[],s=[],r=n._pointLabels.length,o=n.options.pointLabels,a=o.centerPointLabels?ct/r:0;for(let l=0;l<r;l++){const c=o.setContext(n.getPointLabelContext(l));s[l]=c.padding;const u=n.getPointPosition(l,n.drawingArea+s[l],a),d=It(c.font),f=c0(n.ctx,d,n._pointLabels[l]);i[l]=f;const g=se(n.getIndexAngle(l)+a),p=Math.round(Js(g)),y=gd(p,u.x,f.w,0,180),x=gd(p,u.y,f.h,90,270);d0(e,t,g,y,x)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=g0(n,i,s)}function d0(n,t,e,i,s){const r=Math.abs(Math.sin(e)),o=Math.abs(Math.cos(e));let a=0,l=0;i.start<t.l?(a=(t.l-i.start)/r,n.l=Math.min(n.l,t.l-a)):i.end>t.r&&(a=(i.end-t.r)/r,n.r=Math.max(n.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/o,n.t=Math.min(n.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/o,n.b=Math.max(n.b,t.b+l))}function h0(n,t,e){const i=n.drawingArea,{extra:s,additionalAngle:r,padding:o,size:a}=e,l=n.getPointPosition(t,i+s+o,r),c=Math.round(Js(se(l.angle+Et))),u=y0(l.y,a.h,c),d=p0(c),f=m0(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:f,top:u,right:f+a.w,bottom:u+a.h}}function f0(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:r}=n;return!(Je({x:e,y:i},t)||Je({x:e,y:r},t)||Je({x:s,y:i},t)||Je({x:s,y:r},t))}function g0(n,t,e){const i=[],s=n._pointLabels.length,r=n.options,{centerPointLabels:o,display:a}=r.pointLabels,l={extra:fa(r)/2,additionalAngle:o?ct/s:0};let c;for(let u=0;u<s;u++){l.padding=e[u],l.size=t[u];const d=h0(n,u,l);i.push(d),a==="auto"&&(d.visible=f0(d,c),d.visible&&(c=d))}return i}function p0(n){return n===0||n===180?"center":n<180?"left":"right"}function m0(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function y0(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function b0(n,t,e){const{left:i,top:s,right:r,bottom:o}=e,{backdropColor:a}=t;if(!st(a)){const l=xn(t.borderRadius),c=Ut(t.backdropPadding);n.fillStyle=a;const u=i-c.left,d=s-c.top,f=r-i+c.width,g=o-s+c.height;Object.values(l).some(p=>p!==0)?(n.beginPath(),di(n,{x:u,y:d,w:f,h:g,radius:l}),n.fill()):n.fillRect(u,d,f,g)}}function _0(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let s=t-1;s>=0;s--){const r=n._pointLabelItems[s];if(!r.visible)continue;const o=i.setContext(n.getPointLabelContext(s));b0(e,o,r);const a=It(o.font),{x:l,y:c,textAlign:u}=r;Bn(e,n._pointLabels[s],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function pd(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,Ot);else{let r=n.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let o=1;o<i;o++)r=n.getPointPosition(o,t),s.lineTo(r.x,r.y)}}function x0(n,t,e,i,s){const r=n.ctx,o=t.circular,{color:a,lineWidth:l}=t;!o&&!i||!a||!l||e<0||(r.save(),r.strokeStyle=a,r.lineWidth=l,r.setLineDash(s.dash||[]),r.lineDashOffset=s.dashOffset,r.beginPath(),pd(n,e,o,i),r.closePath(),r.stroke(),r.restore())}function w0(n,t,e){return wn(n,{label:e,index:t,type:"pointLabel"})}class fs extends Dr{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=Ut(fa(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=Rt(t)&&!isNaN(t)?t:0,this.max=Rt(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/fa(this.options))}generateTickLabels(t){Dr.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=Dt(this.options.pointLabels.callback,[e,i],this);return s||s===0?s:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?u0(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){const e=Ot/(this._pointLabels.length||1),i=this.options.startAngle||0;return se(t*e+$t(i))}getDistanceFromCenterForValue(t){if(st(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(st(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 i=e[t];return w0(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-Et+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}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:i,right:s,bottom:r}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:r}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),pd(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s,border:r}=e,o=this._pointLabels.length;let a,l,c;if(e.pointLabels.display&&_0(this,o),s.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(d),g=s.setContext(f),p=r.setContext(f);x0(this,g,l,o,p)}}),i.display){for(t.save(),a=o-1;a>=0;a--){const u=i.setContext(this.getPointLabelContext(a)),{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.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const c=i.setContext(this.getContext(l)),u=It(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=Ut(c.backdropPadding);t.fillRect(-o/2-d.left,-r-u.size/2-d.top,o+d.width,u.size+d.height)}Bn(t,a.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}E(fs,"id","radialLinear"),E(fs,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:nr.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),E(fs,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),E(fs,"descriptors",{angleLines:{_fallback:"grid"}});const Sr={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}},ye=Object.keys(Sr);function md(n,t){return n-t}function yd(n,t){if(st(t))return null;const e=n._adapter,{parser:i,round:s,isoWeekday:r}=n._parseOpts;let o=t;return typeof i=="function"&&(o=i(o)),Rt(o)||(o=typeof i=="string"?e.parse(o,i):e.parse(o)),o===null?null:(s&&(o=s==="week"&&(_n(r)||r===!0)?e.startOf(o,"isoWeek",r):e.startOf(o,s)),+o)}function bd(n,t,e,i){const s=ye.length;for(let r=ye.indexOf(n);r<s-1;++r){const o=Sr[ye[r]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((e-t)/(a*o.size))<=i)return ye[r]}return ye[s-1]}function v0(n,t,e,i,s){for(let r=ye.length-1;r>=ye.indexOf(e);r--){const o=ye[r];if(Sr[o].common&&n._adapter.diff(s,i,o)>=t-1)return o}return ye[e?ye.indexOf(e):0]}function M0(n){for(let t=ye.indexOf(n)+1,e=ye.length;t<e;++t)if(Sr[ye[t]].common)return ye[t]}function _d(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=Po(e,t),r=e[i]>=t?e[i]:e[s];n[r]=!0}}function k0(n,t,e,i){const s=n._adapter,r=+s.startOf(t[0].value,i),o=t[t.length-1].value;let a,l;for(a=r;a<=o;a=+s.add(a,1,i))l=e[a],l>=0&&(t[l].major=!0);return t}function xd(n,t,e){const i=[],s={},r=t.length;let o,a;for(o=0;o<r;++o)a=t[o],s[a]=o,i.push({value:a,major:!1});return r===0||!e?i:k0(n,i,s,e)}class gs extends jn{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 i=t.time||(t.time={}),s=this._adapter=new cu._date(t.adapters.date);s.init(e),Vi(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.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,i=t.time.unit||"day";let{min:s,max:r,minDefined:o,maxDefined:a}=this.getUserBounds();function l(c){!o&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(r=Math.max(r,c.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=Rt(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),r=Rt(r)&&!isNaN(r)?r:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,r-1),this.max=Math.max(s+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const r=this.min,o=this.max,a=rp(s,r,o);return this._unit=e.unit||(i.autoSkip?bd(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):v0(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:M0(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),xd(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;e=Qt(e,0,o),i=Qt(i,0,o),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,r=s.time,o=r.unit||bd(r.minUnit,e,i,this._getLabelCapacity(e)),a=rt(s.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=_n(l)||l===!0,u={};let d=e,f,g;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":o),t.diff(i,e,o)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+o);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(f=d,g=0;f<i;f=+t.add(f,a,o),g++)_d(u,f,p);return(f===i||s.bounds==="ticks"||g===1)&&_d(u,f,p),Object.keys(u).sort(md).map(y=>+y)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,r=this._unit,o=e||s[r];return this._adapter.format(t,o)}_tickFormatFunction(t,e,i,s){const r=this.options,o=r.ticks.callback;if(o)return Dt(o,[t,e,i],this);const a=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],f=i[e],g=c&&d&&f&&f.major;return this._adapter.format(t,s||(g?d:u))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=$t(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(s),o=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:i*r+a*o,h:i*o+a*r}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,r=this._tickFormatFunction(t,0,xd(this,[t],this._majorUnit),s),o=this._getLabelSize(r),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,i=s.length;e<i;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(yd(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return xc(t.sort(md))}}E(gs,"id","time"),E(gs,"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 Tr(n,t,e){let i=0,s=n.length-1,r,o,a,l;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=Qe(n,"pos",t)),{pos:r,time:a}=n[i],{pos:o,time:l}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=Qe(n,"time",t)),{time:r,pos:a}=n[i],{time:o,pos:l}=n[s]);const c=o-r;return c?a+(l-a)*(t-r)/c:a}class ga extends gs{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=Tr(e,this.min),this._tableRange=Tr(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],r=[];let o,a,l,c,u;for(o=0,a=t.length;o<a;++o)c=t[o],c>=e&&c<=i&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,a=s.length;o<a;++o)u=s[o+1],l=s[o-1],c=s[o],Math.round((u+l)/2)!==c&&r.push({time:c,pos:o/(a-1)});return r}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((s,r)=>s-r)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Tr(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Tr(this._table,i*this._tableRange+this._minPos,!0)}}E(ga,"id","timeseries"),E(ga,"defaults",gs.defaults);var D0=Object.freeze({__proto__:null,CategoryScale:ua,LinearScale:da,LogarithmicScale:ha,RadialLinearScale:fs,TimeScale:gs,TimeSeriesScale:ga});const S0=[Im,lb,n0,D0],wd=6048e5,T0=864e5,ps=6e4,mi=36e5,C0=1e3,vd=Symbol.for("constructDateFrom");function Ft(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&vd in n?n[vd](t):n instanceof Date?new n.constructor(t):new Date(t)}function lt(n,t){return Ft(t||n,n)}function Cr(n,t,e){const i=lt(n,e==null?void 0:e.in);return isNaN(t)?Ft((e==null?void 0:e.in)||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function pa(n,t,e){const i=lt(n,e==null?void 0:e.in);if(isNaN(t))return Ft(n,NaN);if(!t)return i;const s=i.getDate(),r=Ft(n,i.getTime());r.setMonth(i.getMonth()+t+1,0);const o=r.getDate();return s>=o?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}function ma(n,t,e){return Ft(n,+lt(n)+t)}function P0(n,t,e){return ma(n,t*mi)}let O0={};function $n(){return O0}function Ve(n,t){var a,l,c,u;const e=$n(),i=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,s=lt(n,t==null?void 0:t.in),r=s.getDay(),o=(r<i?7:0)+r-i;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function yi(n,t){return Ve(n,{...t,weekStartsOn:1})}function Md(n,t){const e=lt(n,t==null?void 0:t.in),i=e.getFullYear(),s=Ft(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=yi(s),o=Ft(e,0);o.setFullYear(i,0,4),o.setHours(0,0,0,0);const a=yi(o);return e.getTime()>=r.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function Pr(n){const t=lt(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function Un(n,...t){const e=Ft.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function ya(n,t){const e=lt(n,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function kd(n,t,e){const[i,s]=Un(e==null?void 0:e.in,n,t),r=ya(i),o=ya(s),a=+r-Pr(r),l=+o-Pr(o);return Math.round((a-l)/T0)}function E0(n,t){const e=Md(n,t),i=Ft(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),yi(i)}function A0(n,t,e){const i=lt(n,e==null?void 0:e.in);return i.setTime(i.getTime()+t*ps),i}function R0(n,t,e){return pa(n,t*3,e)}function I0(n,t,e){return ma(n,t*1e3)}function L0(n,t,e){return Cr(n,t*7,e)}function N0(n,t,e){return pa(n,t*12,e)}function ms(n,t){const e=+lt(n)-+lt(t);return e<0?-1:e>0?1:e}function F0(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function ba(n){return!(!F0(n)&&typeof n!="number"||isNaN(+lt(n)))}function z0(n,t,e){const[i,s]=Un(e==null?void 0:e.in,n,t),r=i.getFullYear()-s.getFullYear(),o=i.getMonth()-s.getMonth();return r*12+o}function B0(n,t,e){const[i,s]=Un(e==null?void 0:e.in,n,t);return i.getFullYear()-s.getFullYear()}function Dd(n,t,e){const[i,s]=Un(e==null?void 0:e.in,n,t),r=Sd(i,s),o=Math.abs(kd(i,s));i.setDate(i.getDate()-r*o);const a=+(Sd(i,s)===-r),l=r*(o-a);return l===0?0:l}function Sd(n,t){const 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 ys(n){return t=>{const i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function H0(n,t,e){const[i,s]=Un(e==null?void 0:e.in,n,t),r=(+i-+s)/mi;return ys(e==null?void 0:e.roundingMethod)(r)}function _a(n,t){return+lt(n)-+lt(t)}function W0(n,t,e){const i=_a(n,t)/ps;return ys(e==null?void 0:e.roundingMethod)(i)}function Td(n,t){const e=lt(n,t==null?void 0:t.in);return e.setHours(23,59,59,999),e}function Cd(n,t){const e=lt(n,t==null?void 0:t.in),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function Y0(n,t){const e=lt(n,t==null?void 0:t.in);return+Td(e,t)==+Cd(e,t)}function Pd(n,t,e){const[i,s,r]=Un(e==null?void 0:e.in,n,n,t),o=ms(s,r),a=Math.abs(z0(s,r));if(a<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-o*a);let l=ms(s,r)===-o;Y0(i)&&a===1&&ms(i,r)===1&&(l=!1);const c=o*(a-+l);return c===0?0:c}function j0(n,t,e){const i=Pd(n,t,e)/3;return ys(e==null?void 0:e.roundingMethod)(i)}function V0(n,t,e){const i=_a(n,t)/1e3;return ys(e==null?void 0:e.roundingMethod)(i)}function $0(n,t,e){const i=Dd(n,t,e)/7;return ys(e==null?void 0:e.roundingMethod)(i)}function U0(n,t,e){const[i,s]=Un(e==null?void 0:e.in,n,t),r=ms(i,s),o=Math.abs(B0(i,s));i.setFullYear(1584),s.setFullYear(1584);const a=ms(i,s)===-r,l=r*(o-+a);return l===0?0:l}function X0(n,t){const e=lt(n,t==null?void 0:t.in),i=e.getMonth(),s=i-i%3;return e.setMonth(s,1),e.setHours(0,0,0,0),e}function q0(n,t){const e=lt(n,t==null?void 0:t.in);return e.setDate(1),e.setHours(0,0,0,0),e}function G0(n,t){const e=lt(n,t==null?void 0:t.in),i=e.getFullYear();return e.setFullYear(i+1,0,0),e.setHours(23,59,59,999),e}function Od(n,t){const e=lt(n,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function K0(n,t){const e=lt(n,t==null?void 0:t.in);return e.setMinutes(59,59,999),e}function Z0(n,t){var a,l;const e=$n(),i=e.weekStartsOn??((l=(a=e.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??0,s=lt(n,t==null?void 0:t.in),r=s.getDay(),o=(r<i?-7:0)+6-(r-i);return s.setDate(s.getDate()+o),s.setHours(23,59,59,999),s}function Q0(n,t){const e=lt(n,t==null?void 0:t.in);return e.setSeconds(59,999),e}function J0(n,t){const e=lt(n,t==null?void 0:t.in),i=e.getMonth(),s=i-i%3+3;return e.setMonth(s,0),e.setHours(23,59,59,999),e}function t_(n,t){const e=lt(n,t==null?void 0:t.in);return e.setMilliseconds(999),e}const 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"}},n_=(n,t,e)=>{let i;const s=e_[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function xa(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const i_={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},s_={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},r_={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},o_={date:xa({formats:i_,defaultWidth:"full"}),time:xa({formats:s_,defaultWidth:"full"}),dateTime:xa({formats:r_,defaultWidth:"full"})},a_={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},l_=(n,t,e,i)=>a_[n];function bs(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const o=n.defaultFormattingWidth||n.defaultWidth,a=e!=null&&e.width?String(e.width):o;s=n.formattingValues[a]||n.formattingValues[o]}else{const o=n.defaultWidth,a=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[a]||n.values[o]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const c_={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},u_={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},d_={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"]},h_={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"]},f_={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"}},g_={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"}},p_={ordinalNumber:(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:bs({values:c_,defaultWidth:"wide"}),quarter:bs({values:u_,defaultWidth:"wide",argumentCallback:n=>n-1}),month:bs({values:d_,defaultWidth:"wide"}),day:bs({values:h_,defaultWidth:"wide"}),dayPeriod:bs({values:f_,defaultWidth:"wide",formattingValues:g_,defaultFormattingWidth:"wide"})};function _s(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(s);if(!r)return null;const o=r[0],a=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(a)?y_(a,d=>d.test(o)):m_(a,d=>d.test(o));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(o.length);return{value:c,rest:u}}}function m_(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function y_(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function b_(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],r=t.match(n.parsePattern);if(!r)return null;let o=n.valueCallback?n.valueCallback(r[0]):r[0];o=e.valueCallback?e.valueCallback(o):o;const a=t.slice(s.length);return{value:o,rest:a}}}const __=/^(\d+)(th|st|nd|rd)?/i,x_=/\d+/i,w_={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},v_={any:[/^b/i,/^(a|c)/i]},M_={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},k_={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},S_={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]},T_={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},C_={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]},P_={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},O_={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}},E_={ordinalNumber:b_({matchPattern:__,parsePattern:x_,valueCallback:n=>parseInt(n,10)}),era:_s({matchPatterns:w_,defaultMatchWidth:"wide",parsePatterns:v_,defaultParseWidth:"any"}),quarter:_s({matchPatterns:M_,defaultMatchWidth:"wide",parsePatterns:k_,defaultParseWidth:"any",valueCallback:n=>n+1}),month:_s({matchPatterns:D_,defaultMatchWidth:"wide",parsePatterns:S_,defaultParseWidth:"any"}),day:_s({matchPatterns:T_,defaultMatchWidth:"wide",parsePatterns:C_,defaultParseWidth:"any"}),dayPeriod:_s({matchPatterns:P_,defaultMatchWidth:"any",parsePatterns:O_,defaultParseWidth:"any"})},Ed={code:"en-US",formatDistance:n_,formatLong:o_,formatRelative:l_,localize:p_,match:E_,options:{weekStartsOn:0,firstWeekContainsDate:1}};function A_(n,t){const e=lt(n,t==null?void 0:t.in);return kd(e,Od(e))+1}function Ad(n,t){const e=lt(n,t==null?void 0:t.in),i=+yi(e)-+E0(e);return Math.round(i/wd)+1}function wa(n,t){var u,d,f,g;const e=lt(n,t==null?void 0:t.in),i=e.getFullYear(),s=$n(),r=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??s.firstWeekContainsDate??((g=(f=s.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=Ft((t==null?void 0:t.in)||n,0);o.setFullYear(i+1,0,r),o.setHours(0,0,0,0);const a=Ve(o,t),l=Ft((t==null?void 0:t.in)||n,0);l.setFullYear(i,0,r),l.setHours(0,0,0,0);const c=Ve(l,t);return+e>=+a?i+1:+e>=+c?i:i-1}function R_(n,t){var a,l,c,u;const e=$n(),i=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,s=wa(n,t),r=Ft((t==null?void 0:t.in)||n,0);return r.setFullYear(s,0,i),r.setHours(0,0,0,0),Ve(r,t)}function Rd(n,t){const e=lt(n,t==null?void 0:t.in),i=+Ve(e,t)-+R_(e,t);return Math.round(i/wd)+1}function Tt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Dn={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Tt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Tt(e+1,2)},d(n,t){return Tt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Tt(n.getHours()%12||12,t.length)},H(n,t){return Tt(n.getHours(),t.length)},m(n,t){return Tt(n.getMinutes(),t.length)},s(n,t){return Tt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return Tt(s,t.length)}},bi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Id={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return Dn.y(n,t)},Y:function(n,t,e,i){const s=wa(n,i),r=s>0?s:1-s;if(t==="YY"){const o=r%100;return Tt(o,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Tt(r,t.length)},R:function(n,t){const e=Md(n);return Tt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Tt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Tt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Tt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return Dn.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return Tt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=Rd(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):Tt(s,t.length)},I:function(n,t,e){const i=Ad(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Tt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):Dn.d(n,t)},D:function(n,t,e){const i=A_(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Tt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return Tt(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return Tt(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return Tt(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const s=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=bi.noon:i===0?s=bi.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let s;switch(i>=17?s=bi.evening:i>=12?s=bi.afternoon:i>=4?s=bi.morning:s=bi.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return Dn.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Dn.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Tt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Tt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):Dn.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Dn.s(n,t)},S:function(n,t){return Dn.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Nd(i);case"XXXX":case"XX":return Xn(i);case"XXXXX":case"XXX":default:return Xn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Nd(i);case"xxxx":case"xx":return Xn(i);case"xxxxx":case"xxx":default:return Xn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Ld(i,":");case"OOOO":default:return"GMT"+Xn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Ld(i,":");case"zzzz":default:return"GMT"+Xn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Tt(i,t.length)},T:function(n,t,e){return Tt(+n,t.length)}};function Ld(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Tt(r,2)}function Nd(n,t){return n%60===0?(n>0?"-":"+")+Tt(Math.abs(n)/60,2):Xn(n,t)}function Xn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Tt(Math.trunc(i/60),2),r=Tt(i%60,2);return e+s+t+r}const Fd=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},zd=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},va={p:zd,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Fd(n,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",Fd(i,t)).replace("{{time}}",zd(s,t))}},I_=/^D+$/,L_=/^Y+$/,N_=["D","DD","YY","YYYY"];function Bd(n){return I_.test(n)}function Hd(n){return L_.test(n)}function Ma(n,t,e){const i=F_(n,t,e);if(console.warn(i),N_.includes(n))throw new RangeError(i)}function F_(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const z_=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,B_=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,H_=/^'([^]*?)'?$/,W_=/''/g,Y_=/[a-zA-Z]/;function Wd(n,t,e){var u,d,f,g,p,y,x,v;const i=$n(),s=(e==null?void 0:e.locale)??i.locale??Ed,r=(e==null?void 0:e.firstWeekContainsDate)??((d=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??i.firstWeekContainsDate??((g=(f=i.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=(e==null?void 0:e.weekStartsOn)??((y=(p=e==null?void 0:e.locale)==null?void 0:p.options)==null?void 0:y.weekStartsOn)??i.weekStartsOn??((v=(x=i.locale)==null?void 0:x.options)==null?void 0:v.weekStartsOn)??0,a=lt(n,e==null?void 0:e.in);if(!ba(a))throw new RangeError("Invalid time value");let l=t.match(B_).map(M=>{const D=M[0];if(D==="p"||D==="P"){const S=va[D];return S(M,s.formatLong)}return M}).join("").match(z_).map(M=>{if(M==="''")return{isToken:!1,value:"'"};const D=M[0];if(D==="'")return{isToken:!1,value:j_(M)};if(Id[D])return{isToken:!0,value:M};if(D.match(Y_))throw new RangeError("Format string contains an unescaped latin alphabet character `"+D+"`");return{isToken:!1,value:M}});s.localize.preprocessor&&(l=s.localize.preprocessor(a,l));const c={firstWeekContainsDate:r,weekStartsOn:o,locale:s};return l.map(M=>{if(!M.isToken)return M.value;const D=M.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&Hd(D)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&Bd(D))&&Ma(D,t,String(n));const S=Id[D[0]];return S(a,D,s.localize,c)}).join("")}function j_(n){const t=n.match(H_);return t?t[1].replace(W_,"'"):n}function Yd(){return Object.assign({},$n())}function V_(n,t){const e=lt(n,t==null?void 0:t.in).getDay();return e===0?7:e}function $_(n,t){const e=U_(t)?new t(0):Ft(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function U_(n){var t;return typeof n=="function"&&((t=n.prototype)==null?void 0:t.constructor)===n}const X_=10;class jd{constructor(){E(this,"subPriority",0)}validate(t,e){return!0}}class q_ extends jd{constructor(t,e,i,s,r){super(),this.value=t,this.validateValue=e,this.setValue=i,this.priority=s,r&&(this.subPriority=r)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,i){return this.setValue(t,e,this.value,i)}}class G_ extends jd{constructor(e,i){super();E(this,"priority",X_);E(this,"subPriority",-1);this.context=e||(s=>Ft(i,s))}set(e,i){return i.timestampIsSet?e:Ft(e,$_(e,this.context))}}class wt{run(t,e,i,s){const r=this.parse(t,e,i,s);return r?{setter:new q_(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}validate(t,e,i){return!0}}class K_ extends wt{constructor(){super(...arguments);E(this,"priority",140);E(this,"incompatibleTokens",["R","u","t","T"])}parse(e,i,s){switch(i){case"G":case"GG":case"GGG":return s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"});case"GGGGG":return s.era(e,{width:"narrow"});case"GGGG":default:return s.era(e,{width:"wide"})||s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"})}}set(e,i,s){return i.era=s,e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}const Yt={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}/},$e={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 jt(n,t){return n&&{value:t(n.value),rest:n.rest}}function Lt(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function Ue(n,t){const e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};const i=e[1]==="+"?1:-1,s=e[2]?parseInt(e[2],10):0,r=e[3]?parseInt(e[3],10):0,o=e[5]?parseInt(e[5],10):0;return{value:i*(s*mi+r*ps+o*C0),rest:t.slice(e[0].length)}}function Vd(n){return Lt(Yt.anyDigitsSigned,n)}function zt(n,t){switch(n){case 1:return Lt(Yt.singleDigit,t);case 2:return Lt(Yt.twoDigits,t);case 3:return Lt(Yt.threeDigits,t);case 4:return Lt(Yt.fourDigits,t);default:return Lt(new RegExp("^\\d{1,"+n+"}"),t)}}function Or(n,t){switch(n){case 1:return Lt(Yt.singleDigitSigned,t);case 2:return Lt(Yt.twoDigitsSigned,t);case 3:return Lt(Yt.threeDigitsSigned,t);case 4:return Lt(Yt.fourDigitsSigned,t);default:return Lt(new RegExp("^-?\\d{1,"+n+"}"),t)}}function ka(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 $d(n,t){const e=t>0,i=e?t:1-t;let s;if(i<=50)s=n||100;else{const r=i+50,o=Math.trunc(r/100)*100,a=n>=r%100;s=n+o-(a?100:0)}return e?s:1-s}function Ud(n){return n%400===0||n%4===0&&n%100!==0}class Z_ extends wt{constructor(){super(...arguments);E(this,"priority",130);E(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,i,s){const r=o=>({year:o,isTwoDigitYear:i==="yy"});switch(i){case"y":return jt(zt(4,e),r);case"yo":return jt(s.ordinalNumber(e,{unit:"year"}),r);default:return jt(zt(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s){const r=e.getFullYear();if(s.isTwoDigitYear){const a=$d(s.year,r);return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}const o=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}}class Q_ extends wt{constructor(){super(...arguments);E(this,"priority",130);E(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,i,s){const r=o=>({year:o,isTwoDigitYear:i==="YY"});switch(i){case"Y":return jt(zt(4,e),r);case"Yo":return jt(s.ordinalNumber(e,{unit:"year"}),r);default:return jt(zt(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s,r){const o=wa(e,r);if(s.isTwoDigitYear){const l=$d(s.year,o);return e.setFullYear(l,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Ve(e,r)}const a=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(a,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Ve(e,r)}}class J_ extends wt{constructor(){super(...arguments);E(this,"priority",130);E(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,i){return Or(i==="R"?4:i.length,e)}set(e,i,s){const r=Ft(e,0);return r.setFullYear(s,0,4),r.setHours(0,0,0,0),yi(r)}}class tx extends wt{constructor(){super(...arguments);E(this,"priority",130);E(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,i){return Or(i==="u"?4:i.length,e)}set(e,i,s){return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}class ex extends wt{constructor(){super(...arguments);E(this,"priority",120);E(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"Q":case"QQ":return zt(i.length,e);case"Qo":return s.ordinalNumber(e,{unit:"quarter"});case"QQQ":return s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(e,{width:"wide",context:"formatting"})||s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class nx extends wt{constructor(){super(...arguments);E(this,"priority",120);E(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"q":case"qq":return zt(i.length,e);case"qo":return s.ordinalNumber(e,{unit:"quarter"});case"qqq":return s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(e,{width:"wide",context:"standalone"})||s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class ix extends wt{constructor(){super(...arguments);E(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);E(this,"priority",110)}parse(e,i,s){const r=o=>o-1;switch(i){case"M":return jt(Lt(Yt.month,e),r);case"MM":return jt(zt(2,e),r);case"Mo":return jt(s.ordinalNumber(e,{unit:"month"}),r);case"MMM":return s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(e,{width:"wide",context:"formatting"})||s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}}class sx extends wt{constructor(){super(...arguments);E(this,"priority",110);E(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,i,s){const r=o=>o-1;switch(i){case"L":return jt(Lt(Yt.month,e),r);case"LL":return jt(zt(2,e),r);case"Lo":return jt(s.ordinalNumber(e,{unit:"month"}),r);case"LLL":return s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(e,{width:"wide",context:"standalone"})||s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}}function rx(n,t,e){const i=lt(n,e==null?void 0:e.in),s=Rd(i,e)-t;return i.setDate(i.getDate()-s*7),lt(i,e==null?void 0:e.in)}class ox extends wt{constructor(){super(...arguments);E(this,"priority",100);E(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,i,s){switch(i){case"w":return Lt(Yt.week,e);case"wo":return s.ordinalNumber(e,{unit:"week"});default:return zt(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s,r){return Ve(rx(e,s,r),r)}}function ax(n,t,e){const i=lt(n,e==null?void 0:e.in),s=Ad(i,e)-t;return i.setDate(i.getDate()-s*7),i}class lx extends wt{constructor(){super(...arguments);E(this,"priority",100);E(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,i,s){switch(i){case"I":return Lt(Yt.week,e);case"Io":return s.ordinalNumber(e,{unit:"week"});default:return zt(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s){return yi(ax(e,s))}}const cx=[31,28,31,30,31,30,31,31,30,31,30,31],ux=[31,29,31,30,31,30,31,31,30,31,30,31];class dx extends wt{constructor(){super(...arguments);E(this,"priority",90);E(this,"subPriority",1);E(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"d":return Lt(Yt.date,e);case"do":return s.ordinalNumber(e,{unit:"date"});default:return zt(i.length,e)}}validate(e,i){const s=e.getFullYear(),r=Ud(s),o=e.getMonth();return r?i>=1&&i<=ux[o]:i>=1&&i<=cx[o]}set(e,i,s){return e.setDate(s),e.setHours(0,0,0,0),e}}class hx extends wt{constructor(){super(...arguments);E(this,"priority",90);E(this,"subpriority",1);E(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,i,s){switch(i){case"D":case"DD":return Lt(Yt.dayOfYear,e);case"Do":return s.ordinalNumber(e,{unit:"date"});default:return zt(i.length,e)}}validate(e,i){const s=e.getFullYear();return Ud(s)?i>=1&&i<=366:i>=1&&i<=365}set(e,i,s){return e.setMonth(0,s),e.setHours(0,0,0,0),e}}function Da(n,t,e){var d,f,g,p;const i=$n(),s=(e==null?void 0:e.weekStartsOn)??((f=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??i.weekStartsOn??((p=(g=i.locale)==null?void 0:g.options)==null?void 0:p.weekStartsOn)??0,r=lt(n,e==null?void 0:e.in),o=r.getDay(),l=(t%7+7)%7,c=7-s,u=t<0||t>6?t-(o+c)%7:(l+c)%7-(o+c)%7;return Cr(r,u,e)}class fx extends wt{constructor(){super(...arguments);E(this,"priority",90);E(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"E":case"EE":case"EEE":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Da(e,s,r),e.setHours(0,0,0,0),e}}class gx extends wt{constructor(){super(...arguments);E(this,"priority",90);E(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,i,s,r){const o=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(i){case"e":case"ee":return jt(zt(i.length,e),o);case"eo":return jt(s.ordinalNumber(e,{unit:"day"}),o);case"eee":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeeee":return s.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Da(e,s,r),e.setHours(0,0,0,0),e}}class px extends wt{constructor(){super(...arguments);E(this,"priority",90);E(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,i,s,r){const o=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(i){case"c":case"cc":return jt(zt(i.length,e),o);case"co":return jt(s.ordinalNumber(e,{unit:"day"}),o);case"ccc":return s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"ccccc":return s.day(e,{width:"narrow",context:"standalone"});case"cccccc":return s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(e,{width:"wide",context:"standalone"})||s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Da(e,s,r),e.setHours(0,0,0,0),e}}function mx(n,t,e){const i=lt(n,e==null?void 0:e.in),s=V_(i,e),r=t-s;return Cr(i,r,e)}class yx extends wt{constructor(){super(...arguments);E(this,"priority",90);E(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,i,s){const r=o=>o===0?7:o;switch(i){case"i":case"ii":return zt(i.length,e);case"io":return s.ordinalNumber(e,{unit:"day"});case"iii":return jt(s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiii":return jt(s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return jt(s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiii":default:return jt(s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r)}}validate(e,i){return i>=1&&i<=7}set(e,i,s){return e=mx(e,s),e.setHours(0,0,0,0),e}}class bx extends wt{constructor(){super(...arguments);E(this,"priority",80);E(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,i,s){switch(i){case"a":case"aa":case"aaa":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(ka(s),0,0,0),e}}class _x extends wt{constructor(){super(...arguments);E(this,"priority",80);E(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,i,s){switch(i){case"b":case"bb":case"bbb":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(ka(s),0,0,0),e}}class xx extends wt{constructor(){super(...arguments);E(this,"priority",80);E(this,"incompatibleTokens",["a","b","t","T"])}parse(e,i,s){switch(i){case"B":case"BB":case"BBB":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(ka(s),0,0,0),e}}class wx extends wt{constructor(){super(...arguments);E(this,"priority",70);E(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,i,s){switch(i){case"h":return Lt(Yt.hour12h,e);case"ho":return s.ordinalNumber(e,{unit:"hour"});default:return zt(i.length,e)}}validate(e,i){return i>=1&&i<=12}set(e,i,s){const r=e.getHours()>=12;return r&&s<12?e.setHours(s+12,0,0,0):!r&&s===12?e.setHours(0,0,0,0):e.setHours(s,0,0,0),e}}class vx extends wt{constructor(){super(...arguments);E(this,"priority",70);E(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,i,s){switch(i){case"H":return Lt(Yt.hour23h,e);case"Ho":return s.ordinalNumber(e,{unit:"hour"});default:return zt(i.length,e)}}validate(e,i){return i>=0&&i<=23}set(e,i,s){return e.setHours(s,0,0,0),e}}class Mx extends wt{constructor(){super(...arguments);E(this,"priority",70);E(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,i,s){switch(i){case"K":return Lt(Yt.hour11h,e);case"Ko":return s.ordinalNumber(e,{unit:"hour"});default:return zt(i.length,e)}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.getHours()>=12&&s<12?e.setHours(s+12,0,0,0):e.setHours(s,0,0,0),e}}class kx extends wt{constructor(){super(...arguments);E(this,"priority",70);E(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,i,s){switch(i){case"k":return Lt(Yt.hour24h,e);case"ko":return s.ordinalNumber(e,{unit:"hour"});default:return zt(i.length,e)}}validate(e,i){return i>=1&&i<=24}set(e,i,s){const r=s<=24?s%24:s;return e.setHours(r,0,0,0),e}}class Dx extends wt{constructor(){super(...arguments);E(this,"priority",60);E(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"m":return Lt(Yt.minute,e);case"mo":return s.ordinalNumber(e,{unit:"minute"});default:return zt(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setMinutes(s,0,0),e}}class Sx extends wt{constructor(){super(...arguments);E(this,"priority",50);E(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"s":return Lt(Yt.second,e);case"so":return s.ordinalNumber(e,{unit:"second"});default:return zt(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setSeconds(s,0),e}}class Tx extends wt{constructor(){super(...arguments);E(this,"priority",30);E(this,"incompatibleTokens",["t","T"])}parse(e,i){const s=r=>Math.trunc(r*Math.pow(10,-i.length+3));return jt(zt(i.length,e),s)}set(e,i,s){return e.setMilliseconds(s),e}}class Cx extends wt{constructor(){super(...arguments);E(this,"priority",10);E(this,"incompatibleTokens",["t","T","x"])}parse(e,i){switch(i){case"X":return Ue($e.basicOptionalMinutes,e);case"XX":return Ue($e.basic,e);case"XXXX":return Ue($e.basicOptionalSeconds,e);case"XXXXX":return Ue($e.extendedOptionalSeconds,e);case"XXX":default:return Ue($e.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Ft(e,e.getTime()-Pr(e)-s)}}class Px extends wt{constructor(){super(...arguments);E(this,"priority",10);E(this,"incompatibleTokens",["t","T","X"])}parse(e,i){switch(i){case"x":return Ue($e.basicOptionalMinutes,e);case"xx":return Ue($e.basic,e);case"xxxx":return Ue($e.basicOptionalSeconds,e);case"xxxxx":return Ue($e.extendedOptionalSeconds,e);case"xxx":default:return Ue($e.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Ft(e,e.getTime()-Pr(e)-s)}}class Ox extends wt{constructor(){super(...arguments);E(this,"priority",40);E(this,"incompatibleTokens","*")}parse(e){return Vd(e)}set(e,i,s){return[Ft(e,s*1e3),{timestampIsSet:!0}]}}class Ex extends wt{constructor(){super(...arguments);E(this,"priority",20);E(this,"incompatibleTokens","*")}parse(e){return Vd(e)}set(e,i,s){return[Ft(e,s),{timestampIsSet:!0}]}}const Ax={G:new K_,y:new Z_,Y:new Q_,R:new J_,u:new tx,Q:new ex,q:new nx,M:new ix,L:new sx,w:new ox,I:new lx,d:new dx,D:new hx,E:new fx,e:new gx,c:new px,i:new yx,a:new bx,b:new _x,B:new xx,h:new wx,H:new vx,K:new Mx,k:new kx,m:new Dx,s:new Sx,S:new Tx,X:new Cx,x:new Px,t:new Ox,T:new Ex},Rx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ix=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Lx=/^'([^]*?)'?$/,Nx=/''/g,Fx=/\S/,zx=/[a-zA-Z]/;function Bx(n,t,e,i){var x,v,M,D,S,P,R,O;const s=()=>Ft((i==null?void 0:i.in)||e,NaN),r=Yd(),o=(i==null?void 0:i.locale)??r.locale??Ed,a=(i==null?void 0:i.firstWeekContainsDate)??((v=(x=i==null?void 0:i.locale)==null?void 0:x.options)==null?void 0:v.firstWeekContainsDate)??r.firstWeekContainsDate??((D=(M=r.locale)==null?void 0:M.options)==null?void 0:D.firstWeekContainsDate)??1,l=(i==null?void 0:i.weekStartsOn)??((P=(S=i==null?void 0:i.locale)==null?void 0:S.options)==null?void 0:P.weekStartsOn)??r.weekStartsOn??((O=(R=r.locale)==null?void 0:R.options)==null?void 0:O.weekStartsOn)??0;if(!t)return n?s():lt(e,i==null?void 0:i.in);const c={firstWeekContainsDate:a,weekStartsOn:l,locale:o},u=[new G_(i==null?void 0:i.in,e)],d=t.match(Ix).map(b=>{const _=b[0];if(_ in va){const C=va[_];return C(b,o.formatLong)}return b}).join("").match(Rx),f=[];for(let b of d){!(i!=null&&i.useAdditionalWeekYearTokens)&&Hd(b)&&Ma(b,t,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&Bd(b)&&Ma(b,t,n);const _=b[0],C=Ax[_];if(C){const{incompatibleTokens:I}=C;if(Array.isArray(I)){const F=f.find(U=>I.includes(U.token)||U.token===_);if(F)throw new RangeError(`The format string mustn't contain \`${F.fullToken}\` and \`${b}\` at the same time`)}else if(C.incompatibleTokens==="*"&&f.length>0)throw new RangeError(`The format string mustn't contain \`${b}\` and any other token at the same time`);f.push({token:_,fullToken:b});const T=C.run(n,b,o.match,c);if(!T)return s();u.push(T.setter),n=T.rest}else{if(_.match(zx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");if(b==="''"?b="'":_==="'"&&(b=Hx(b)),n.indexOf(b)===0)n=n.slice(b.length);else return s()}}if(n.length>0&&Fx.test(n))return s();const g=u.map(b=>b.priority).sort((b,_)=>_-b).filter((b,_,C)=>C.indexOf(b)===_).map(b=>u.filter(_=>_.priority===b).sort((_,C)=>C.subPriority-_.subPriority)).map(b=>b[0]);let p=lt(e,i==null?void 0:i.in);if(isNaN(+p))return s();const y={};for(const b of g){if(!b.validate(p,c))return s();const _=b.set(p,y,c);Array.isArray(_)?(p=_[0],Object.assign(y,_[1])):p=_}return p}function Hx(n){return n.match(Lx)[1].replace(Nx,"'")}function Wx(n,t){const e=lt(n,t==null?void 0:t.in);return e.setMinutes(0,0,0),e}function Yx(n,t){const e=lt(n,t==null?void 0:t.in);return e.setSeconds(0,0),e}function jx(n,t){const e=lt(n,t==null?void 0:t.in);return e.setMilliseconds(0),e}function Vx(n){const t=n/mi;return Math.trunc(t)}function Xd(n,t){const e=()=>Ft(t==null?void 0:t.in,NaN),i=(t==null?void 0:t.additionalDigits)??2,s=qx(n);let r;if(s.date){const c=Gx(s.date,i);r=Kx(c.restDateString,c.year)}if(!r||isNaN(+r))return e();const o=+r;let a=0,l;if(s.time&&(a=Zx(s.time),isNaN(a)))return e();if(s.timezone){if(l=Qx(s.timezone),isNaN(l))return e()}else{const c=new Date(o+a),u=lt(0,t==null?void 0:t.in);return u.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),u.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),u}return lt(o+a+l,t==null?void 0:t.in)}const Er={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},$x=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Ux=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Xx=/^([+-])(\d{2})(?::?(\d{2}))?$/;function qx(n){const t={},e=n.split(Er.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],Er.timeZoneDelimiter.test(t.date)&&(t.date=n.split(Er.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const s=Er.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function Gx(n,t){const e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};const s=i[1]?parseInt(i[1]):null,r=i[2]?parseInt(i[2]):null;return{year:r===null?s:r*100,restDateString:n.slice((i[1]||i[2]).length)}}function Kx(n,t){if(t===null)return new Date(NaN);const e=n.match($x);if(!e)return new Date(NaN);const i=!!e[4],s=xs(e[1]),r=xs(e[2])-1,o=xs(e[3]),a=xs(e[4]),l=xs(e[5])-1;if(i)return iw(t,a,l)?Jx(t,a,l):new Date(NaN);{const c=new Date(0);return!ew(t,r,o)||!nw(t,s)?new Date(NaN):(c.setUTCFullYear(t,r,Math.max(s,o)),c)}}function xs(n){return n?parseInt(n):1}function Zx(n){const t=n.match(Ux);if(!t)return NaN;const e=Sa(t[1]),i=Sa(t[2]),s=Sa(t[3]);return sw(e,i,s)?e*mi+i*ps+s*1e3:NaN}function Sa(n){return n&&parseFloat(n.replace(",","."))||0}function Qx(n){if(n==="Z")return 0;const t=n.match(Xx);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return rw(i,s)?e*(i*mi+s*ps):NaN}function Jx(n,t,e){const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=(t-1)*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const tw=[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 ew(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(tw[t]||(qd(n)?29:28))}function nw(n,t){return t>=1&&t<=(qd(n)?366:365)}function iw(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function sw(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function rw(n,t){return t>=0&&t<=59}const Ar=n=>["interactive","zoom-interactive"].includes(n),ow=(n,t,e)=>{var r,o;const{tooltip:i}=t;if(i.opacity===0&&!Ar(n.interactionMode)){n.showTooltip=!1;return}const s=n.chartTooltipSortFn||((a,l)=>l.rawValue-a.rawValue);if(i.body&&!Ar(n.interactionMode)){const a=i.labelColors,l=((o=(r=t.chart.config)==null?void 0:r.options)==null?void 0:o.indexAxis)==="y"?"x":"y";n.tooltipContext=vh(new Date(i.dataPoints[0].parsed.x),e,!0),n.tooltipSeries=i.dataPoints.map((c,u)=>{const d=c.parsed[l],f=Mh(d,n.units,{translateUnit:n.translateUnit}),g=c.dataset.label;return{backgroundColor:a[u].backgroundColor,borderColor:a[u].borderColor,label:g,value:f,rawValue:d,isSegmentEmpty:c.dataset.isSegmentEmpty}}).sort(s),n.left=`${i.x}px`,n.top=`${i.y}px`,n.showTooltip=!0}},Gd=(n,t)=>{var s,r;const{tooltip:e}=t;if(e.opacity===0&&!Ar(n.interactionMode)){n.showTooltip=!1;return}const i=n.chartTooltipSortFn||((o,a)=>a.rawValue-o.rawValue);if(e.body&&!Ar(n.interactionMode)){const o=e.labelColors,a=((r=(s=t.chart.config)==null?void 0:s.options)==null?void 0:r.indexAxis)==="y"?"x":"y",l=["gauge","donut"].includes(n.chartType);l?n.tooltipContext=n.dimensionDisplay||e.dataPoints[0].label:e.chart.data.isMultiDimension?n.tooltipContext=e.dataPoints[0].label:n.tooltipContext=n.dimensionDisplay||"",n.tooltipSeries=e.dataPoints.map((c,u)=>{const d=l?c.parsed:c.parsed[a],f=Mh(d,n.units,{translateUnit:n.translateUnit});let g;return l?g=c.dataset.labels[c.dataIndex]:g=c.dataset.label,{backgroundColor:o[u].backgroundColor,borderColor:o[u].borderColor,label:g,value:f,rawValue:d,isSegmentEmpty:c.dataset.isSegmentEmpty}}).sort(i),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},aw=n=>n&&n.datasets&&n.datasets.length,lw=n=>aw(n)&&n.datasets.some(t=>t.data.length),cw=n=>n.datasets.some(t=>t.data[0]&&ba(t.data[0].x)),uw=n=>!!lw(n)&&n.datasets.some(t=>t.data.length==1),dw=n=>cw(n)&&n.datasets.some(t=>t.data[0]&&t.data[0].x.toString().length>=13),Ta=(n,t,e)=>{const s=Math.min(t/1150,1);return n.x<e?n.x+t*.15*(1-s):n.x-t*1.15*(1-s)},hw=(n,t,e)=>n.y<e?n.y+t*.15:n.y-t*.5;function Ca(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}const Kd=(n,t,e)=>{const i=n.data;return n.options.plugins.legend.labels.generateLabels(n).filter(s=>{var r;return!((r=t==null?void 0:t[s.text])!=null&&r.isThreshold)}).map((s,r)=>({...s,value:t&&t[s.text],isSegmentEmpty:i.datasets[r].isSegmentEmpty})).sort(e)},fw=2,Zd=10,Qd=12,Pa=new Intl.NumberFormat(((_g=document==null?void 0:document.documentElement)==null?void 0:_g.lang)||"en-US"),Rr=10,Jd={"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"}},sn=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Ir=(n,t)=>(t||sn)[n%sn.length],th=(n,t)=>{n[0]==="#"&&(n=n.slice(1));let e=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16);e=e-t,i=i-t,s=s-t,e>255?e=255:e<0&&(e=0),i>255?i=255:i<0&&(i=0),s>255?s=255:s<0&&(s=0);const r=e.toString(16).length===1?"0"+e.toString(16):e.toString(16),o=i.toString(16).length===1?"0"+i.toString(16):i.toString(16),a=s.toString(16).length===1?"0"+s.toString(16):s.toString(16);return`#${r}${o}${a}`},eh="#6f7787",nh={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"}},gw=n=>{var e;const t=Math.floor(parseInt(n,10)/100)*100;return((e=nh[t])==null?void 0:e.background)||"#fafafa"},pw={SUCCESS:"#6FCC83",FAILURE:"#FF8484"},mw={"4XX":"#FFBA81","5XX":"#FF8484"},yw={LatencyP99:"#1356cb",LatencyP95:"#1fbecd",LatencyP50:"#1df97d"},bw="#dad4c7",ih="#afb7c5",_w=n=>{const t=Object.entries(Jd).find(([e])=>new RegExp(e).test(n));return t&&t[1]||Jd.standard},Oa=(n,t,e,i)=>{let s;return e?s=ih:Array.isArray(i)?s=Ir(n,i):s=i[t],s||Ir(n)},xw={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},ww=2,vw=0,Ea=new Map,Aa=(n,t)=>t==="bytes"?Fr(n):t==="count/minute"?n.toFixed(2):Pa.format(n),sh=n=>{const e=document.createElement("canvas").getContext("2d"),i=It({});return e.font=i.string,e.measureText(n).width},Mw=()=>{const n="label_height";if(!Ea.has(n)){const t=It({});Ea.set(n,t.lineHeight)}return Ea.get(n)},kw=n=>n.datasets.reduce((t,e)=>t+e.data.reduce((i,s)=>isNaN(s)?i:i+s,0),0),rh=(n,t)=>t.datasets.reduce((e,i,s)=>n.isDatasetVisible(s)?e+i.data.reduce((r,o)=>isNaN(o)?r:r+o,0):e,0),oh=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,Ra="#e0e4ea",Dw={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"]},ws=(n,t)=>{let e=1;const i=Dw[n],s=new Map;for(const r of t)s.set(r,i[e]),e=e%(i.length-1)+1;return s.set(-1,i[0]),s},ah=new Map([[100,ws("100",[100,101,102,103])],[200,ws("200",[200,201,202,203,204,205,206,207,208,226])],[300,ws("300",[300,301,302,303,304,305,307,308])],[400,ws("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,ws("500",[500,501,502,503,504,505,506,507,508,510,511])]]),Ia=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100,i=ah.get(e);return i===void 0?Ra:i.get(t)??i.get(-1)??Ra},Sw=n=>{const t=Ia(n);return{solid:t,light:t}},Lr={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=Ia(`${t}`),n),{}),____OTHER____:"#DAD4C7","1XX":"#4DA6FF","2XX":"#6FCC83","3XX":"#FFD982","4XX":"#FFBA81","5XX":"#FF8484"};function lh(n,t,e){const i=Yd(),s=Pw(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?Tw(s,t):Cw(s,t)}function Tw(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function Cw(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function Pw(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function Ow(n,t){const e=Lw(t);return"formatToParts"in e?Aw(e,n):Rw(e,n)}const Ew={year:0,month:1,day:2,hour:3,minute:4,second:5};function Aw(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=Ew[e[s].type];r!==void 0&&(i[r]=parseInt(e[s].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function Rw(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const La={},ch=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),Iw=ch==="06/25/2014, 00:00:00"||ch==="06/25/2014 00:00:00";function Lw(n){return La[n]||(La[n]=Iw?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"}):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"})),La[n]}function uh(n,t,e,i,s,r,o){const a=new Date(0);return a.setUTCFullYear(n,t,e),a.setUTCHours(i,s,r,o),a}const dh=36e5,Nw=6e4,Na={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Fa(n,t,e){if(!n)return 0;let i=Na.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=Na.timezoneHH.exec(n),i)return s=parseInt(i[1],10),hh(s)?-(s*dh):NaN;if(i=Na.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const o=parseInt(i[3],10);return hh(s,o)?(r=Math.abs(s)*dh+o*Nw,i[1]==="+"?-r:r):NaN}if(Bw(n)){t=new Date(t||Date.now());const o=e?t:Fw(t),a=za(o,n);return-(e?a:zw(t,a,n))}return NaN}function Fw(n){return uh(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function za(n,t){const e=Ow(n,t),i=uh(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let s=n.getTime();const r=s%1e3;return s-=r>=0?r:1e3+r,i-s}function zw(n,t,e){let s=n.getTime()-t;const r=za(new Date(s),e);if(t===r)return t;s-=r-t;const o=za(new Date(s),e);return r===o?r:Math.max(r,o)}function hh(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const fh={};function Bw(n){if(fh[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),fh[n]=!0,!0}catch{return!1}}const Hw=60*1e3,Ww={X:function(n,t,e){const i=Ba(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return gh(i);case"XXXX":case"XX":return _i(i);case"XXXXX":case"XXX":default:return _i(i,":")}},x:function(n,t,e){const i=Ba(e.timeZone,n);switch(t){case"x":return gh(i);case"xxxx":case"xx":return _i(i);case"xxxxx":case"xxx":default:return _i(i,":")}},O:function(n,t,e){const i=Ba(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Yw(i,":");case"OOOO":default:return"GMT"+_i(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return lh("short",n,e);case"zzzz":default:return lh("long",n,e)}}};function Ba(n,t){const e=n?Fa(n,t,!0)/Hw:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Nr(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function _i(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Nr(Math.floor(i/60),2),r=Nr(Math.floor(i%60),2);return e+s+t+r}function gh(n,t){return n%60===0?(n>0?"-":"+")+Nr(Math.abs(n)/60,2):_i(n,t)}function Yw(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.floor(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Nr(r,2)}function ph(n){const 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-+t}const jw=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Ha=36e5,mh=6e4,Vw=2,ue={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,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:jw};function yh(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?Vw:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==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(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=$w(n),{year:s,restDateString:r}=Uw(i.date,e),o=Xw(r,s);if(o===null||isNaN(o.getTime()))return new Date(NaN);if(o){const a=o.getTime();let l=0,c;if(i.time&&(l=qw(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Fa(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=ph(new Date(a+l)),c=ph(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function $w(n){const t={};let e=ue.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=ue.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=ue.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function Uw(n,t){if(n){const e=ue.YYY[t],i=ue.YYYYY[t];let s=ue.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=ue.YY.exec(n)||e.exec(n),s){const r=s[1];return{year:parseInt(r,10)*100,restDateString:n.slice(r.length)}}}return{year:null}}function Xw(n,t){if(t===null)return null;let e,i,s;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let r=ue.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,xh(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=ue.DDD.exec(n),r){e=new Date(0);const o=parseInt(r[1],10);return Zw(t,o)?(e.setUTCFullYear(t,0,o),e):new Date(NaN)}if(r=ue.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const o=parseInt(r[2],10);return xh(t,i,o)?(e.setUTCFullYear(t,i,o),e):new Date(NaN)}if(r=ue.Www.exec(n),r)return s=parseInt(r[1],10)-1,wh(s)?bh(t,s):new Date(NaN);if(r=ue.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const o=parseInt(r[2],10)-1;return wh(s,o)?bh(t,s,o):new Date(NaN)}return null}function qw(n){let t,e,i=ue.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Wa(t)?t%24*Ha:NaN;if(i=ue.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Wa(t,e)?t%24*Ha+e*mh:NaN;if(i=ue.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Wa(t,e,s)?t%24*Ha+e*mh+s*1e3:NaN}return null}function bh(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=t*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const Gw=[31,28,31,30,31,30,31,31,30,31,30,31],Kw=[31,29,31,30,31,30,31,31,30,31,30,31];function _h(n){return n%400===0||n%4===0&&n%100!==0}function xh(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=_h(n);if(i&&e>Kw[t]||!i&&e>Gw[t])return!1}return!0}function Zw(n,t){if(t<1)return!1;const e=_h(n);return!(e&&t>366||!e&&t>365)}function wh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Wa(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const Qw=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Ya(n,t,e={}){t=String(t);const i=t.match(Qw);if(i){const s=yh(e.originalDate||n,e);t=i.reduce(function(r,o){if(o[0]==="'")return r;const a=r.indexOf(o),l=r[a-1]==="'",c=r.replace(o,"'"+Ww[o[0]](s,o,e)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return Wd(n,t,e)}function Jw(n,t,e){n=yh(n,e);const i=Fa(t,n,!0),s=new Date(n.getTime()-i),r=new Date(0);return r.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),r.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),r}function qn(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Ya(Jw(n,t,{timeZone:i.timeZone}),e,i)}const vh=(n,t,e,i)=>{const s=Intl.DateTimeFormat().resolvedOptions().timeZone;switch(t){case"secondly":case"tenSecondly":case"thirtySecondly":return qn(n,s,e?"yyyy-MM-dd h:mm:ss a":"h:mm:ss a");case"minutely":case"fiveMinutely":case"tenMinutely":case"thirtyMinutely":case"hourly":case"twoHourly":return qn(n,s,e?"yyyy-MM-dd h:mm a":"h:mm a");case"twelveHourly":return qn(n,s,"yyyy-MM-dd h:mm a");case"daily":return qn(n,s,"yyyy-MM-dd");case"weekly":return`${qn(n,s,"yyyy")} W${qn(n,s,"II")}`;default:return qn(n,s,"yyyy-MM-dd h:mm:ss a")}},Fr=(n,t)=>{if(isNaN(n))return"0 B";const{i18n:e}=bt.useI18n(),i=t?0x4000000000000:1e15,s=t?1099511627776:1e12,r=t?1073741824:1e9,o=t?1048576:1e6,a=t?1024:1e3;let l;return n>=i?l=e.formatNumber(Number.parseFloat((n/i).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):n>=s?l=e.formatNumber(Number.parseFloat((n/s).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):n>=r?l=e.formatNumber(Number.parseFloat((n/r).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):n>=o?l=e.formatNumber(Number.parseFloat((n/o).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):n>=a?l=e.formatNumber(Number.parseFloat((n/a).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):l=e.formatNumber(Number.parseFloat(n.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),l.replace(/([a-zA-Z]*)$/," $1")},t1=(n,t="USD")=>{if(isNaN(n))return t==="USD"?"$0.00":`${n}`;const{i18n:e}=bt.useI18n();return n>=.01||t!=="USD"?e.formatNumber(n,{style:"currency",currency:t}):n<1e-4?"< $0.0001":`$${Number.parseFloat(n.toPrecision(4))}`},Mh=(n,t,{isBytes1024:e=!1,currency:i="USD",translateUnit:s=r=>r}={})=>{const r=s(t,n);switch(t){case"bytes":return Fr(n,e);case"usd":return t1(n,i);case"ms":case"count/minute":case"token count":case"count":default:return isNaN(n)?`${n}`:n>=.01?`${Pa.format(Number.parseFloat(n.toFixed(2)))} ${r}`:`${Number.parseFloat(n.toPrecision(4))} ${r}`}};function e1(n){const e=`barChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:l=>({label:l.dataset.label,value:l.label})}};je.positioners[e]=function(l,c){if(!l.length||n.tooltipState.interactionMode==="interactive")return!1;const u=this.chart.canvas.getBoundingClientRect(),d=n.tooltipState.width||this.width,f=u.width/2,g=Ta(c,d,f),p=c.y,y=c.x<f?"left":"center";return{x:g-n.tooltipState.offsetX,y:p-n.tooltipState.offsetY,xAlign:y}},Zo.modes.customInteractionMode=function(l,c){const u=vn(c,l),d=[];return Zo.evaluateInteractionItems(l,l.options.indexAxis||"x",u,(f,g,p)=>{l.options.indexAxis==="y"&&f.inYRange(u.y,!0)&&l.data.datasets[g].data[p]&&d.push({element:f,datasetIndex:g,index:p}),l.options.indexAxis==="x"&&f.inXRange(u.x,!0)&&l.data.datasets[g].data[p]&&d.push({element:f,datasetIndex:g,index:p})}),d};const s=n.numLabels.value>25?Zd:Qd,r=({chart:l,index:c})=>{var d;const u=l.data;return{size:s,style:(d=u==null?void 0:u.isLabelEmpty)!=null&&d[c]?"italic":"normal"}},o=(l,c,u)=>l.chart.options.indexAxis===l.axis?(c=l.getLabelForValue(u),c&&c.length>Rr?c.slice(0,Rr)+"...":c):l.getLabelForValue(Number(c)),a=h.computed(()=>{var l,c,u,d,f,g,p,y;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:r,callback:function(x,v){return o(this,x,v)}},title:{display:n.indexAxis==="y"?!st((l=n.metricAxesTitle)==null?void 0:l.value):!st((c=n.dimensionAxesTitle)==null?void 0:c.value),text:n.indexAxis==="y"?(u=n.metricAxesTitle)==null?void 0:u.value:(d=n.dimensionAxesTitle)==null?void 0:d.value,padding:{top:10},font:{weight:"bold"}}},y:{border:{display:!1},stacked:n.stacked.value,beginAtZero:!0,grid:{display:!1,drawBorder:!1},ticks:{font:r,callback:function(x,v){return o(this,x,v)}},title:{display:n.indexAxis==="x"?!st((f=n.metricAxesTitle)==null?void 0:f.value):!st((g=n.dimensionAxesTitle)==null?void 0:g.value),text:n.indexAxis==="x"?(p=n.metricAxesTitle)==null?void 0:p.value:(y=n.dimensionAxesTitle)==null?void 0:y.value,padding:{bottom:20},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:x=>{Gd(n.tooltipState,x)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1}});return h.getCurrentInstance()&&h.onUnmounted(()=>{je.positioners[e]&&delete je.positioners[e]}),a}Se.register(...S0);const n1=(n,t)=>{const e=t.datasets.map(s=>s.label),i=n.datasets.map(s=>s.label);return n.datasets.length===t.datasets.length&&e.every((s,r)=>s===i[r])};function i1(n,t,e,i,s){const r=h.shallowRef(null),o=(a,l)=>{if(t.value)return new Se(t.value,{type:n,data:a,plugins:i,options:l})};return h.onMounted(()=>{r.value=o(e.value,s.value)}),h.onBeforeUnmount(()=>{st(r.value)||r.value.destroy()}),h.watch(e,(a,l)=>{if(n1(l,a)&&!st(r.value)){for(const[c,u]of a.datasets.entries())Object.assign(r.value.data.datasets[c],u);r.value.data.labels=a.labels,r.value.update()}else st(r.value)||r.value.destroy(),r.value=o(a,s.value)}),h.watch(t,()=>{st(r.value)||r.value.destroy(),r.value=o(e.value,s.value)}),h.watch(s,(a,l)=>{(a.indexAxis!==l.indexAxis||JSON.stringify(a.scales.x.title)!==JSON.stringify(l.scales.x.title)||JSON.stringify(a.scales.y.title)!==JSON.stringify(l.scales.y.title))&&(st(r.value)||r.value.destroy(),r.value=o(e.value,a))}),r}var be=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ja(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var kh={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(p,y){y&&y%3===0&&f.push(d),f.push(p)}),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 i=1e3,s=1e4,r=1e6,o=1e9,a=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?s:i;return c<g||u.precision&&u.precision>Math.log10(c)?d=t(e(c,1,u),u):c<r?d=e(c,i,u)+"k":c<o?d=e(c,r,u)+"m":c<a?d=t(e(c,o,u),u)+"b":d=t(e(c,a,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})()})(kh);var s1=kh.exports;const vs=ja(s1);function r1(n,t,e){const{i18n:i}=bt.useI18n(),{translateUnit:s}=bt.useTranslatedUnits();return{legendValues:h.computed(()=>n.value.datasets.reduce((o,a)=>{const l=a.total?a.total:a.data.reduce((u,d)=>u+(typeof d=="number"?Number(d)||0:Number(d&&d.y)||0),0);let c;if(e.value==="bytes")c=Fr(l);else{const u=s(e.value,l);c=i&&i.t("legend.datapointValueDisplay",{value:vs(l,{capital:!0}),unit:u})||`${vs(l,{capital:!0})} ${e.value}`}return{...o,[a.label]:{raw:l,formatted:c,isThreshold:a.isThreshold}}},{}))}}var o1=Object.defineProperty,a1=(n,t,e)=>t in n?o1(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Te=(n,t,e)=>a1(n,typeof t!="symbol"?t+"":t,e),mt=(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))(mt||{});const l1=["in","not_in","selector"],c1=["empty","not_empty"],u1=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],Ms=n=>n.filter(t=>t!=="time"),Dh=["api","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],Sh=Ms(Dh),d1=[...Dh,"application","consumer","country_code","iso_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm"],Th=Ms(d1),h1=["control_plane","control_plane_group","gateway_service","consumer","application","route","ai_provider","ai_response_model","ai_request_model","llm_cache_status","llm_embeddings_provider","llm_embeddings_model","time","realm","status_code","status_code_grouped","ai_plugin"],Ch=Ms(h1);Ms(["api","api_product","api_product_version","application","auth_type","client_ip","consumer","consumer_group","control_plane","control_plane_group","country_code","data_plane_node","data_plane_node_version","gateway_service","header_host","header_user_agent","http_method","iso_code","portal","realm","request_id","request_uri","response_header_content_type","response_source","route","service_port","service_protocol","sse","status_code_grouped","time","trace_id","upstream_uri","upstream_status_code_grouped","websocket"]),Ms(["ai_count","latencies_response_ms","latencies_upstream_ms","latencies_kong_gateway_ms","request_body_size","response_body_size","response_header_content_length","status_code","upstream_status_code"]),new Set(Sh),new Set(Th),new Set(Ch),(n=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",enum:n},operator:{type:"string",enum:l1},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",enum:n},operator:{type:"string",enum:c1}},required:["field","operator"],additionalProperties:!1}]}}))([...new Set([...Th,...Sh,...Ch])]);const Ph=6048e5,f1=864e5,g1=60,p1=3600,Oh=Symbol.for("constructDateFrom");function Ce(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&Oh in n?n[Oh](t):n instanceof Date?new n.constructor(t):new Date(t)}function de(n,t){return Ce(t||n,n)}function Eh(n,t,e){const i=de(n,void 0);return isNaN(t)?Ce(n,NaN):(i.setDate(i.getDate()+t),i)}function m1(n,t,e){const i=de(n,void 0);if(isNaN(t))return Ce(n,NaN);const s=i.getDate(),r=Ce(n,i.getTime());r.setMonth(i.getMonth()+t+1,0);const o=r.getDate();return s>=o?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}let y1={};function ks(){return y1}function rn(n,t){var e,i,s,r;const o=ks(),a=(t==null?void 0:t.weekStartsOn)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.weekStartsOn)??o.weekStartsOn??((r=(s=o.locale)==null?void 0:s.options)==null?void 0:r.weekStartsOn)??0,l=de(n,t==null?void 0:t.in),c=l.getDay(),u=(c<a?7:0)+c-a;return l.setDate(l.getDate()-u),l.setHours(0,0,0,0),l}function zr(n,t){return rn(n,{...t,weekStartsOn:1})}function Ah(n,t){const e=de(n,void 0),i=e.getFullYear(),s=Ce(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=zr(s),o=Ce(e,0);o.setFullYear(i,0,4),o.setHours(0,0,0,0);const a=zr(o);return e.getTime()>=r.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function Rh(n){const t=de(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function b1(n,...t){const e=Ce.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Br(n,t){const e=de(n,void 0);return e.setHours(0,0,0,0),e}function _1(n,t,e){const[i,s]=b1(void 0,n,t),r=Br(i),o=Br(s),a=+r-Rh(r),l=+o-Rh(o);return Math.round((a-l)/f1)}function x1(n,t){const e=Ah(n),i=Ce(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),zr(i)}function w1(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function v1(n){return!(!w1(n)&&typeof n!="number"||isNaN(+de(n)))}function xi(n,t){const e=de(n,void 0);return e.setDate(1),e.setHours(0,0,0,0),e}function M1(n,t){const e=de(n,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const k1={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"}},D1=(n,t,e)=>{let i;const s=k1[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Va(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const S1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},T1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},C1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},P1={date:Va({formats:S1,defaultWidth:"full"}),time:Va({formats:T1,defaultWidth:"full"}),dateTime:Va({formats:C1,defaultWidth:"full"})},O1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},E1=(n,t,e,i)=>O1[n];function Ds(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const o=n.defaultFormattingWidth||n.defaultWidth,a=e!=null&&e.width?String(e.width):o;s=n.formattingValues[a]||n.formattingValues[o]}else{const o=n.defaultWidth,a=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[a]||n.values[o]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const A1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},R1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},I1={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"]},L1={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"]},N1={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"}},F1={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"}},z1=(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},B1={ordinalNumber:z1,era:Ds({values:A1,defaultWidth:"wide"}),quarter:Ds({values:R1,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Ds({values:I1,defaultWidth:"wide"}),day:Ds({values:L1,defaultWidth:"wide"}),dayPeriod:Ds({values:N1,defaultWidth:"wide",formattingValues:F1,defaultFormattingWidth:"wide"})};function Ss(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(s);if(!r)return null;const o=r[0],a=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(a)?W1(a,d=>d.test(o)):H1(a,d=>d.test(o));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(o.length);return{value:c,rest:u}}}function H1(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function W1(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function Y1(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],r=t.match(n.parsePattern);if(!r)return null;let o=n.valueCallback?n.valueCallback(r[0]):r[0];o=e.valueCallback?e.valueCallback(o):o;const a=t.slice(s.length);return{value:o,rest:a}}}const j1=/^(\d+)(th|st|nd|rd)?/i,V1=/\d+/i,$1={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},U1={any:[/^b/i,/^(a|c)/i]},X1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},q1={any:[/1/i,/2/i,/3/i,/4/i]},G1={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},K1={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]},Z1={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},Q1={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]},J1={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},tv={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}},ev={ordinalNumber:Y1({matchPattern:j1,parsePattern:V1,valueCallback:n=>parseInt(n,10)}),era:Ss({matchPatterns:$1,defaultMatchWidth:"wide",parsePatterns:U1,defaultParseWidth:"any"}),quarter:Ss({matchPatterns:X1,defaultMatchWidth:"wide",parsePatterns:q1,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Ss({matchPatterns:G1,defaultMatchWidth:"wide",parsePatterns:K1,defaultParseWidth:"any"}),day:Ss({matchPatterns:Z1,defaultMatchWidth:"wide",parsePatterns:Q1,defaultParseWidth:"any"}),dayPeriod:Ss({matchPatterns:J1,defaultMatchWidth:"any",parsePatterns:tv,defaultParseWidth:"any"})},nv={code:"en-US",formatDistance:D1,formatLong:P1,formatRelative:E1,localize:B1,match:ev,options:{weekStartsOn:0,firstWeekContainsDate:1}};function iv(n,t){const e=de(n,void 0);return _1(e,M1(e))+1}function sv(n,t){const e=de(n,void 0),i=+zr(e)-+x1(e);return Math.round(i/Ph)+1}function Ih(n,t){var e,i,s,r;const o=de(n,t==null?void 0:t.in),a=o.getFullYear(),l=ks(),c=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??l.firstWeekContainsDate??((r=(s=l.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,u=Ce((t==null?void 0:t.in)||n,0);u.setFullYear(a+1,0,c),u.setHours(0,0,0,0);const d=rn(u,t),f=Ce((t==null?void 0:t.in)||n,0);f.setFullYear(a,0,c),f.setHours(0,0,0,0);const g=rn(f,t);return+o>=+d?a+1:+o>=+g?a:a-1}function rv(n,t){var e,i,s,r;const o=ks(),a=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??o.firstWeekContainsDate??((r=(s=o.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,l=Ih(n,t),c=Ce((t==null?void 0:t.in)||n,0);return c.setFullYear(l,0,a),c.setHours(0,0,0,0),rn(c,t)}function ov(n,t){const e=de(n,t==null?void 0:t.in),i=+rn(e,t)-+rv(e,t);return Math.round(i/Ph)+1}function Ct(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Sn={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Ct(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Ct(e+1,2)},d(n,t){return Ct(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Ct(n.getHours()%12||12,t.length)},H(n,t){return Ct(n.getHours(),t.length)},m(n,t){return Ct(n.getMinutes(),t.length)},s(n,t){return Ct(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return Ct(s,t.length)}},wi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Lh={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return Sn.y(n,t)},Y:function(n,t,e,i){const s=Ih(n,i),r=s>0?s:1-s;if(t==="YY"){const o=r%100;return Ct(o,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Ct(r,t.length)},R:function(n,t){const e=Ah(n);return Ct(e,t.length)},u:function(n,t){const e=n.getFullYear();return Ct(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Ct(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Ct(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return Sn.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return Ct(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=ov(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):Ct(s,t.length)},I:function(n,t,e){const i=sv(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Ct(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):Sn.d(n,t)},D:function(n,t,e){const i=iv(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Ct(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return Ct(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return Ct(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return Ct(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const i=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=wi.noon:i===0?s=wi.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let s;switch(i>=17?s=wi.evening:i>=12?s=wi.afternoon:i>=4?s=wi.morning:s=wi.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return Sn.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Sn.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Ct(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Ct(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):Sn.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Sn.s(n,t)},S:function(n,t){return Sn.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Fh(i);case"XXXX":case"XX":return Gn(i);case"XXXXX":case"XXX":default:return Gn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Fh(i);case"xxxx":case"xx":return Gn(i);case"xxxxx":case"xxx":default:return Gn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Nh(i,":");case"OOOO":default:return"GMT"+Gn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Nh(i,":");case"zzzz":default:return"GMT"+Gn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Ct(i,t.length)},T:function(n,t,e){return Ct(+n,t.length)}};function Nh(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Ct(r,2)}function Fh(n,t){return n%60===0?(n>0?"-":"+")+Ct(Math.abs(n)/60,2):Gn(n,t)}function Gn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Ct(Math.trunc(i/60),2),r=Ct(i%60,2);return e+s+t+r}const zh=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Bh=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},av=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return zh(n,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",zh(i,t)).replace("{{time}}",Bh(s,t))},lv={p:Bh,P:av},cv=/^D+$/,uv=/^Y+$/,dv=["D","DD","YY","YYYY"];function hv(n){return cv.test(n)}function fv(n){return uv.test(n)}function gv(n,t,e){const i=pv(n,t,e);if(console.warn(i),dv.includes(n))throw new RangeError(i)}function pv(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const mv=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,yv=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,bv=/^'([^]*?)'?$/,_v=/''/g,xv=/[a-zA-Z]/;function wv(n,t,e){var i,s,r,o,a,l,c,u;const d=ks(),f=(e==null?void 0:e.locale)??d.locale??nv,g=(e==null?void 0:e.firstWeekContainsDate)??((s=(i=e==null?void 0:e.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??d.firstWeekContainsDate??((o=(r=d.locale)==null?void 0:r.options)==null?void 0:o.firstWeekContainsDate)??1,p=(e==null?void 0:e.weekStartsOn)??((l=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??d.weekStartsOn??((u=(c=d.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,y=de(n,e==null?void 0:e.in);if(!v1(y))throw new RangeError("Invalid time value");let x=t.match(yv).map(M=>{const D=M[0];if(D==="p"||D==="P"){const S=lv[D];return S(M,f.formatLong)}return M}).join("").match(mv).map(M=>{if(M==="''")return{isToken:!1,value:"'"};const D=M[0];if(D==="'")return{isToken:!1,value:vv(M)};if(Lh[D])return{isToken:!0,value:M};if(D.match(xv))throw new RangeError("Format string contains an unescaped latin alphabet character `"+D+"`");return{isToken:!1,value:M}});f.localize.preprocessor&&(x=f.localize.preprocessor(y,x));const v={firstWeekContainsDate:g,weekStartsOn:p,locale:f};return x.map(M=>{if(!M.isToken)return M.value;const D=M.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&fv(D)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&hv(D))&&gv(D,t,String(n));const S=Lh[D[0]];return S(y,D,f.localize,v)}).join("")}function vv(n){const t=n.match(bv);return t?t[1].replace(_v,"'"):n}function Mv(n,t){const e=de(n,void 0),i=e.getFullYear(),s=e.getMonth(),r=Ce(e,0);return r.setFullYear(i,s+1,0),r.setHours(0,0,0,0),r.getDate()}function kv(){return Object.assign({},ks())}function Dv(n){return Math.trunc(n*p1)}function Sv(n){const t=n/g1;return Math.trunc(t)}function Hh(n,t,e){return m1(n,-1)}function Wh(n,t,e){const i=kv(),s=Pv(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?Tv(s,t):Cv(s,t)}function Tv(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function Cv(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function Pv(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function Ov(n,t){const e=Lv(t);return"formatToParts"in e?Av(e,n):Rv(e,n)}const Ev={year:0,month:1,day:2,hour:3,minute:4,second:5};function Av(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=Ev[e[s].type];r!==void 0&&(i[r]=parseInt(e[s].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function Rv(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const $a={},Yh=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),Iv=Yh==="06/25/2014, 00:00:00"||Yh==="06/25/2014 00:00:00";function Lv(n){return $a[n]||($a[n]=Iv?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"}):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"})),$a[n]}function Ua(n,t,e,i,s,r,o){const a=new Date(0);return a.setUTCFullYear(n,t,e),a.setUTCHours(i,s,r,o),a}const jh=36e5,Nv=6e4,Xa={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Ts(n,t,e){if(!n)return 0;let i=Xa.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=Xa.timezoneHH.exec(n),i)return s=parseInt(i[1],10),Vh(s)?-(s*jh):NaN;if(i=Xa.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const o=parseInt(i[3],10);return Vh(s,o)?(r=Math.abs(s)*jh+o*Nv,i[1]==="+"?-r:r):NaN}if(Bv(n)){t=new Date(t||Date.now());const o=e?t:Fv(t),a=qa(o,n);return-(e?a:zv(t,a,n))}return NaN}function Fv(n){return Ua(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function qa(n,t){const e=Ov(n,t),i=Ua(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let s=n.getTime();const r=s%1e3;return s-=r>=0?r:1e3+r,i-s}function zv(n,t,e){let i=n.getTime()-t;const s=qa(new Date(i),e);if(t===s)return t;i-=s-t;const r=qa(new Date(i),e);return s===r?s:Math.max(s,r)}function Vh(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const $h={};function Bv(n){if($h[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),$h[n]=!0,!0}catch{return!1}}const Hv=60*1e3,Wv={X:function(n,t,e){const i=Ga(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return Uh(i);case"XXXX":case"XX":return vi(i);case"XXXXX":case"XXX":default:return vi(i,":")}},x:function(n,t,e){const i=Ga(e.timeZone,n);switch(t){case"x":return Uh(i);case"xxxx":case"xx":return vi(i);case"xxxxx":case"xxx":default:return vi(i,":")}},O:function(n,t,e){const i=Ga(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Yv(i,":");case"OOOO":default:return"GMT"+vi(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return Wh("short",n,e);case"zzzz":default:return Wh("long",n,e)}}};function Ga(n,t){const e=n?Ts(n,t,!0)/Hv:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Hr(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function vi(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Hr(Math.floor(i/60),2),r=Hr(Math.floor(i%60),2);return e+s+t+r}function Uh(n,t){return n%60===0?(n>0?"-":"+")+Hr(Math.abs(n)/60,2):vi(n,t)}function Yv(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.floor(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Hr(r,2)}function Xh(n){const 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-+t}const qh=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Ka=36e5,Gh=6e4,jv=2,he={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,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:qh};function Wr(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?jv:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==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(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=Vv(n),{year:s,restDateString:r}=$v(i.date,e),o=Uv(r,s);if(o===null||isNaN(o.getTime()))return new Date(NaN);if(o){const a=o.getTime();let l=0,c;if(i.time&&(l=Xv(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Ts(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=Xh(new Date(a+l)),c=Xh(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function Vv(n){const t={};let e=he.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=he.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=he.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function $v(n,t){if(n){const e=he.YYY[t],i=he.YYYYY[t];let s=he.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=he.YY.exec(n)||e.exec(n),s){const r=s[1];return{year:parseInt(r,10)*100,restDateString:n.slice(r.length)}}}return{year:null}}function Uv(n,t){if(t===null)return null;let e,i,s;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let r=he.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,Qh(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=he.DDD.exec(n),r){e=new Date(0);const o=parseInt(r[1],10);return Kv(t,o)?(e.setUTCFullYear(t,0,o),e):new Date(NaN)}if(r=he.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const o=parseInt(r[2],10);return Qh(t,i,o)?(e.setUTCFullYear(t,i,o),e):new Date(NaN)}if(r=he.Www.exec(n),r)return s=parseInt(r[1],10)-1,Jh(s)?Kh(t,s):new Date(NaN);if(r=he.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const o=parseInt(r[2],10)-1;return Jh(s,o)?Kh(t,s,o):new Date(NaN)}return null}function Xv(n){let t,e,i=he.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Za(t)?t%24*Ka:NaN;if(i=he.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Za(t,e)?t%24*Ka+e*Gh:NaN;if(i=he.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Za(t,e,s)?t%24*Ka+e*Gh+s*1e3:NaN}return null}function Kh(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=t*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const qv=[31,28,31,30,31,30,31,31,30,31,30,31],Gv=[31,29,31,30,31,30,31,31,30,31,30,31];function Zh(n){return n%400===0||n%4===0&&n%100!==0}function Qh(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=Zh(n);if(i&&e>Gv[t]||!i&&e>qv[t])return!1}return!0}function Kv(n,t){if(t<1)return!1;const e=Zh(n);return!(e&&t>366||!e&&t>365)}function Jh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Za(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const Zv=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Qv(n,t,e={}){t=String(t);const i=t.match(Zv);if(i){const s=Wr(e.originalDate||n,e);t=i.reduce(function(r,o){if(o[0]==="'")return r;const a=r.indexOf(o),l=r[a-1]==="'",c=r.replace(o,"'"+Wv[o[0]](s,o,e)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return wv(n,t,e)}function tf(n,t,e){n=Wr(n,e);const i=Ts(t,n,!0),s=new Date(n.getTime()-i),r=new Date(0);return r.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),r.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),r}function Jv(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Qv(tf(n,t,{timeZone:i.timeZone}),e,i)}function tM(n,t,e){if(typeof n=="string"&&!n.match(qh))return Wr(n,{...e,timeZone:t});n=Wr(n,e);const i=Ua(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),s=Ts(t,new Date(i));return new Date(i+s)}function eM(n,t){return-Ts(n,t)}function Mi(n,t={}){if(!n)return n;const e=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let i="MMM dd, yyy hh:mm a";t.short&&(i="MMM dd, yyy"),t.includeTZ&&(i+=" (z)");const s=new Date(n);return Jv(s,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const nM={secondly:1e3,tenSecondly:10*1e3,thirtySecondly:30*1e3,minutely:60*1e3,fiveMinutely:5*60*1e3,tenMinutely:10*60*1e3,thirtyMinutely:30*60*1e3,hourly:60*60*1e3,twoHourly:2*60*60*1e3,twelveHourly:12*60*60*1e3,daily:60*60*24*1e3,weekly:60*60*24*7*1e3,trend:0};function Qa(n){return n&&u1.find(t=>n<=nM[t])||null}var Yr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},jr={exports:{}};jr.exports,function(n,t){var e=200,i="__lodash_hash_undefined__",s=9007199254740991,r="[object Arguments]",o="[object Array]",a="[object Boolean]",l="[object Date]",c="[object Error]",u="[object Function]",d="[object GeneratorFunction]",f="[object Map]",g="[object Number]",p="[object Object]",y="[object Promise]",x="[object RegExp]",v="[object Set]",M="[object String]",D="[object Symbol]",S="[object WeakMap]",P="[object ArrayBuffer]",R="[object DataView]",O="[object Float32Array]",b="[object Float64Array]",_="[object Int8Array]",C="[object Int16Array]",I="[object Int32Array]",T="[object Uint8Array]",F="[object Uint8ClampedArray]",U="[object Uint16Array]",X="[object Uint32Array]",Q=/[\\^$.*+?()[\]{}|]/g,V=/\w*$/,ut=/^\[object .+?Constructor\]$/,$=/^(?:0|[1-9]\d*)$/,G={};G[r]=G[o]=G[P]=G[R]=G[a]=G[l]=G[O]=G[b]=G[_]=G[C]=G[I]=G[f]=G[g]=G[p]=G[x]=G[v]=G[M]=G[D]=G[T]=G[F]=G[U]=G[X]=!0,G[c]=G[u]=G[S]=!1;var J=typeof Yr=="object"&&Yr&&Yr.Object===Object&&Yr,z=typeof self=="object"&&self&&self.Object===Object&&self,B=J||z||Function("return this")(),ft=t&&!t.nodeType&&t,yt=ft&&!0&&n&&!n.nodeType&&n,vt=yt&&yt.exports===ft;function gt(w,A){return w.set(A[0],A[1]),w}function pt(w,A){return w.add(A),w}function H(w,A){for(var N=-1,q=w?w.length:0;++N<q&&A(w[N],N,w)!==!1;);return w}function j(w,A){for(var N=-1,q=A.length,Vt=w.length;++N<q;)w[Vt+N]=A[N];return w}function Y(w,A,N,q){for(var Vt=-1,Kt=w?w.length:0;++Vt<Kt;)N=A(N,w[Vt],Vt,w);return N}function Z(w,A){for(var N=-1,q=Array(w);++N<w;)q[N]=A(N);return q}function tt(w,A){return w==null?void 0:w[A]}function et(w){var A=!1;if(w!=null&&typeof w.toString!="function")try{A=!!(w+"")}catch{}return A}function it(w){var A=-1,N=Array(w.size);return w.forEach(function(q,Vt){N[++A]=[Vt,q]}),N}function nt(w,A){return function(N){return w(A(N))}}function xt(w){var A=-1,N=Array(w.size);return w.forEach(function(q){N[++A]=q}),N}var at=Array.prototype,Pt=Function.prototype,te=Object.prototype,ae=B["__core-js_shared__"],Xt=function(){var w=/[^.]+$/.exec(ae&&ae.keys&&ae.keys.IE_PROTO||"");return w?"Symbol(src)_1."+w:""}(),Oe=Pt.toString,Mt=te.hasOwnProperty,qt=te.toString,Bt=RegExp("^"+Oe.call(Mt).replace(Q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Gt=vt?B.Buffer:void 0,ie=B.Symbol,Xe=B.Uint8Array,ei=nt(Object.getPrototypeOf,Object),Ne=Object.create,Ht=te.propertyIsEnumerable,_e=at.splice,ni=Object.getOwnPropertySymbols,io=Gt?Gt.isBuffer:void 0,so=nt(Object.keys,Object),Ls=Rn(B,"DataView"),ii=Rn(B,"Map"),Ns=Rn(B,"Promise"),si=Rn(B,"Set"),an=Rn(B,"WeakMap"),ln=Rn(Object,"create"),Fs=le(Ls),zs=le(ii),ri=le(Ns),wl=le(si),vl=le(an),ro=ie?ie.prototype:void 0,oo=ro?ro.valueOf:void 0;function cn(w){var A=-1,N=w?w.length:0;for(this.clear();++A<N;){var q=w[A];this.set(q[0],q[1])}}function Ei(){this.__data__=ln?ln(null):{}}function Bs(w){return this.has(w)&&delete this.__data__[w]}function ao(w){var A=this.__data__;if(ln){var N=A[w];return N===i?void 0:N}return Mt.call(A,w)?A[w]:void 0}function un(w){var A=this.__data__;return ln?A[w]!==void 0:Mt.call(A,w)}function Ml(w,A){var N=this.__data__;return N[w]=ln&&A===void 0?i:A,this}cn.prototype.clear=Ei,cn.prototype.delete=Bs,cn.prototype.get=ao,cn.prototype.has=un,cn.prototype.set=Ml;function Fe(w){var A=-1,N=w?w.length:0;for(this.clear();++A<N;){var q=w[A];this.set(q[0],q[1])}}function kl(){this.__data__=[]}function Dl(w){var A=this.__data__,N=Ri(A,w);if(N<0)return!1;var q=A.length-1;return N==q?A.pop():_e.call(A,N,1),!0}function Sl(w){var A=this.__data__,N=Ri(A,w);return N<0?void 0:A[N][1]}function ze(w){return Ri(this.__data__,w)>-1}function Tl(w,A){var N=this.__data__,q=Ri(N,w);return q<0?N.push([w,A]):N[q][1]=A,this}Fe.prototype.clear=kl,Fe.prototype.delete=Dl,Fe.prototype.get=Sl,Fe.prototype.has=ze,Fe.prototype.set=Tl;function En(w){var A=-1,N=w?w.length:0;for(this.clear();++A<N;){var q=w[A];this.set(q[0],q[1])}}function Cl(){this.__data__={hash:new cn,map:new(ii||Fe),string:new cn}}function Pl(w){return Ni(this,w).delete(w)}function Ol(w){return Ni(this,w).get(w)}function Be(w){return Ni(this,w).has(w)}function El(w,A){return Ni(this,w).set(w,A),this}En.prototype.clear=Cl,En.prototype.delete=Pl,En.prototype.get=Ol,En.prototype.has=Be,En.prototype.set=El;function An(w){this.__data__=new Fe(w)}function Al(){this.__data__=new Fe}function Rl(w){return this.__data__.delete(w)}function Il(w){return this.__data__.get(w)}function Ai(w){return this.__data__.has(w)}function Ll(w,A){var N=this.__data__;if(N instanceof Fe){var q=N.__data__;if(!ii||q.length<e-1)return q.push([w,A]),this;N=this.__data__=new En(q)}return N.set(w,A),this}An.prototype.clear=Al,An.prototype.delete=Rl,An.prototype.get=Il,An.prototype.has=Ai,An.prototype.set=Ll;function Nl(w,A){var N=js(w)||zi(w)?Z(w.length,String):[],q=N.length,Vt=!!q;for(var Kt in w)Mt.call(w,Kt)&&!(Vt&&(Kt=="length"||Jl(Kt,q)))&&N.push(Kt);return N}function Ee(w,A,N){var q=w[A];(!(Mt.call(w,A)&&Ys(q,N))||N===void 0&&!(A in w))&&(w[A]=N)}function Ri(w,A){for(var N=w.length;N--;)if(Ys(w[N][0],A))return N;return-1}function Fl(w,A){return w&&lo(A,oi(A),w)}function Hs(w,A,N,q,Vt,Kt,xe){var ee;if(q&&(ee=Kt?q(w,Vt,Kt,xe):q(w)),ee!==void 0)return ee;if(!hn(w))return w;var mo=js(w);if(mo){if(ee=Zl(w),!A)return ql(w,ee)}else{var In=qe(w),yo=In==u||In==d;if(fo(w))return Yl(w,A);if(In==p||In==r||yo&&!Kt){if(et(w))return Kt?w:{};if(ee=uo(yo?{}:w),!A)return Gl(w,Fl(ee,w))}else{if(!G[In])return Kt?w:{};ee=Ql(w,In,Hs,A)}}xe||(xe=new An);var bo=xe.get(w);if(bo)return bo;if(xe.set(w,ee),!mo)var ai=N?Kl(w):oi(w);return H(ai||w,function($s,Bi){ai&&(Bi=$s,$s=w[Bi]),Ee(ee,Bi,Hs($s,A,N,q,Bi,w,xe))}),ee}function zl(w){return hn(w)?Ne(w):{}}function Bl(w,A,N){var q=A(w);return js(w)?q:j(q,N(w))}function Hl(w){return qt.call(w)}function Ii(w){if(!hn(w)||tc(w))return!1;var A=Vs(w)||et(w)?Bt:ut;return A.test(le(w))}function Wl(w){if(!dn(w))return so(w);var A=[];for(var N in Object(w))Mt.call(w,N)&&N!="constructor"&&A.push(N);return A}function Yl(w,A){if(A)return w.slice();var N=new w.constructor(w.length);return w.copy(N),N}function Li(w){var A=new w.constructor(w.byteLength);return new Xe(A).set(new Xe(w)),A}function jl(w,A){var N=A?Li(w.buffer):w.buffer;return new w.constructor(N,w.byteOffset,w.byteLength)}function Vl(w,A,N){var q=A?N(it(w),!0):it(w);return Y(q,gt,new w.constructor)}function Ws(w){var A=new w.constructor(w.source,V.exec(w));return A.lastIndex=w.lastIndex,A}function $l(w,A,N){var q=A?N(xt(w),!0):xt(w);return Y(q,pt,new w.constructor)}function Ul(w){return oo?Object(oo.call(w)):{}}function Xl(w,A){var N=A?Li(w.buffer):w.buffer;return new w.constructor(N,w.byteOffset,w.length)}function ql(w,A){var N=-1,q=w.length;for(A||(A=Array(q));++N<q;)A[N]=w[N];return A}function lo(w,A,N,q){N||(N={});for(var Vt=-1,Kt=A.length;++Vt<Kt;){var xe=A[Vt],ee=void 0;Ee(N,xe,ee===void 0?w[xe]:ee)}return N}function Gl(w,A){return lo(w,co(w),A)}function Kl(w){return Bl(w,oi,co)}function Ni(w,A){var N=w.__data__;return Fi(A)?N[typeof A=="string"?"string":"hash"]:N.map}function Rn(w,A){var N=tt(w,A);return Ii(N)?N:void 0}var co=ni?nt(ni,Object):go,qe=Hl;(Ls&&qe(new Ls(new ArrayBuffer(1)))!=R||ii&&qe(new ii)!=f||Ns&&qe(Ns.resolve())!=y||si&&qe(new si)!=v||an&&qe(new an)!=S)&&(qe=function(w){var A=qt.call(w),N=A==p?w.constructor:void 0,q=N?le(N):void 0;if(q)switch(q){case Fs:return R;case zs:return f;case ri:return y;case wl:return v;case vl:return S}return A});function Zl(w){var A=w.length,N=w.constructor(A);return A&&typeof w[0]=="string"&&Mt.call(w,"index")&&(N.index=w.index,N.input=w.input),N}function uo(w){return typeof w.constructor=="function"&&!dn(w)?zl(ei(w)):{}}function Ql(w,A,N,q){var Vt=w.constructor;switch(A){case P:return Li(w);case a:case l:return new Vt(+w);case R:return jl(w,q);case O:case b:case _:case C:case I:case T:case F:case U:case X:return Xl(w,q);case f:return Vl(w,q,N);case g:case M:return new Vt(w);case x:return Ws(w);case v:return $l(w,q,N);case D:return Ul(w)}}function Jl(w,A){return A=A??s,!!A&&(typeof w=="number"||$.test(w))&&w>-1&&w%1==0&&w<A}function Fi(w){var A=typeof w;return A=="string"||A=="number"||A=="symbol"||A=="boolean"?w!=="__proto__":w===null}function tc(w){return!!Xt&&Xt in w}function dn(w){var A=w&&w.constructor,N=typeof A=="function"&&A.prototype||te;return w===N}function le(w){if(w!=null){try{return Oe.call(w)}catch{}try{return w+""}catch{}}return""}function ec(w){return Hs(w,!0,!0)}function Ys(w,A){return w===A||w!==w&&A!==A}function zi(w){return nc(w)&&Mt.call(w,"callee")&&(!Ht.call(w,"callee")||qt.call(w)==r)}var js=Array.isArray;function ho(w){return w!=null&&ic(w.length)&&!Vs(w)}function nc(w){return fn(w)&&ho(w)}var fo=io||po;function Vs(w){var A=hn(w)?qt.call(w):"";return A==u||A==d}function ic(w){return typeof w=="number"&&w>-1&&w%1==0&&w<=s}function hn(w){var A=typeof w;return!!w&&(A=="object"||A=="function")}function fn(w){return!!w&&typeof w=="object"}function oi(w){return ho(w)?Nl(w):Wl(w)}function go(){return[]}function po(){return!1}n.exports=ec}(jr,jr.exports),jr.exports;const ki=(n,t)=>new Date(n.getTime()-eM(t,n));class Le{constructor(t){Te(this,"timeframeText"),Te(this,"key"),Te(this,"display"),Te(this,"timeframeLength"),Te(this,"allowedTiers"),Te(this,"defaultResponseGranularity"),Te(this,"dataGranularity"),Te(this,"isRelative"),Te(this,"fineGrainedDefaultGranularity"),Te(this,"_startCustom"),Te(this,"_endCustom"),Te(this,"_allowedGranularitiesOverride"),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,this._allowedGranularitiesOverride=t.allowedGranularitiesOverride,this.fineGrainedDefaultGranularity=t.fineGrainedDefaultGranularity}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(t){if(this._allowedGranularitiesOverride&&t)return new Set(this._allowedGranularitiesOverride);const e=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&e.add("minutely"),i>=2&&i<=7*24&&e.add("hourly"),i>=2*24&&e.add("daily"),i>=2*24*14&&e.add("weekly"),e}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const e=tM(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return tf(e,t)}}class iM extends Le{rawStart(t){let e=rn(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=ki(e,t)),e}maximumTimeframeLength(){return 60*60*24*7}}class sM extends Le{rawStart(t){let e=xi(this.tzAdjustedDate(t));return t&&(e=ki(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class rM extends Le{rawEnd(t){let e=rn(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=ki(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=rn(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=ki(i,t)),i}}class oM extends Le{rawEnd(t){let e=xi(this.tzAdjustedDate(t));return t&&(e=ki(e,t)),e}rawStart(t){let e=xi(Hh(this.tzAdjustedDate(t)));return t&&(e=ki(e,t)),e}}mt.FIFTEEN_MIN,new Le({key:mt.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"thirtySecondly",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely"]}),mt.ONE_HOUR,new Le({key:mt.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"minutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely"]}),mt.SIX_HOUR,new Le({key:mt.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"fiveMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),mt.TWELVE_HOUR,new Le({key:mt.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"tenMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),mt.ONE_DAY,new Le({key:mt.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"thirtyMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),mt.SEVEN_DAY,new Le({key:mt.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),mt.THIRTY_DAY,new Le({key:mt.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twelveHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),mt.CURRENT_WEEK,new iM({key:mt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=rn(new Date,{weekStartsOn:1});return(Br(Eh(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),mt.CURRENT_MONTH,new sM({key:mt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=xi(new Date);return(Br(Eh(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),mt.PREVIOUS_WEEK,new rM({key:mt.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),mt.PREVIOUS_MONTH,new oM({key:mt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=xi(new Date),e=xi(Hh(new Date));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=aM(t,e)),60*60*24*Mv(new Date().setMonth(new Date().getMonth()-1))+Dv(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function aM(n,t){return Sv(n.getTimezoneOffset()-t.getTimezoneOffset())}mt.FIFTEEN_MIN,mt.ONE_HOUR,mt.SIX_HOUR,mt.TWELVE_HOUR,mt.ONE_DAY,mt.SEVEN_DAY,mt.FIFTEEN_MIN,mt.ONE_HOUR,mt.SIX_HOUR,mt.TWELVE_HOUR,mt.ONE_DAY,mt.SEVEN_DAY,mt.THIRTY_DAY,mt.CURRENT_WEEK,mt.CURRENT_MONTH,mt.PREVIOUS_WEEK,mt.PREVIOUS_MONTH;function lM(n){return h.computed(()=>{var s;if(!((s=n.value)!=null&&s.meta))return"";const e=n.value.meta.start_ms,i=n.value.meta.end_ms;return e&&i?`${Mi(e)} - ${Mi(i,{includeTZ:!0})}`:""})}function cM(n){const e=`donutChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:r=>({label:r.dataset.label,value:r.label})}};je.positioners[e]=function(r,o){if(!r.length)return!1;const a=this.chart.canvas.getBoundingClientRect(),l=n.tooltipState.width||this.width,c=a.width/2,u=Ta(o,l,c),d=o.y,f=o.x<c?"left":"center";return{x:u-n.tooltipState.offsetX,y:d,xAlign:f}};const s=h.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:r=>{Gd(n.tooltipState,r)}}}}));return h.onUnmounted(()=>{je.positioners[e]&&delete je.positioners[e]}),{options:s}}function uM(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,callback:u=>{const d=new Date(u);return vh(d,n.granularity.value,o.value)}},title:{display:!st((l=n.dimensionAxesTitle)==null?void 0:l.value),text:(c=n.dimensionAxesTitle)==null?void 0:c.value,padding:{top:2},font:{weight:"bold"}},border:{display:!1},stacked:n.stacked.value}}),e=h.computed(()=>{var l,c;return{title:{display:!st((l=n.metricAxesTitle)==null?void 0:l.value),text:(c=n.metricAxesTitle)==null?void 0:c.value,padding:{bottom:10},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1},stacked:n.stacked.value}}),s=`lineChartTooltipPosition-${n.tooltipState.chartID}`,r={enabled:!1,position:s};je.positioners[s]=function(l,c){if(!l.length||n.tooltipState.interactionMode==="interactive")return!1;const u=this.chart.canvas.getBoundingClientRect(),d=n.tooltipState.width||this.width,f=n.tooltipState.height||this.height,g=u.width/2,p=u.height/2,y=Ta(c,d,g);let x=hw(c,f,p);const v=c.y<p?"top":"bottom",M=c.x<g?"left":"center";return f>u.height&&(x=0),{x:y,y:x,xAlign:M,yAlign:v}};const o=h.computed(()=>{const l=Number(n.timeRangeMs.value),c=new Date,u=new Date(c.getTime()-l);return Vx(l)>24||u.getDate()!==c.getDate()}),a=h.computed(()=>{var l;return{hover:{mode:"index",intersect:!1},elements:{point:{radius:(l=n.pointsWithoutHover)!=null&&l.value?3:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:e.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...r,external:c=>{ow(n.tooltipState,c,n.granularity.value)}}},interaction:{mode:"index",intersect:!1}}});return h.onUnmounted(()=>{je.positioners[s]&&delete je.positioners[s]}),{options:a}}function dM(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:s,pivotRecords:r,rowLabels:o,colorPalette:a}=n,{i18n:l}=bt.useI18n();return t?i.map(u=>({label:l&&l.te(`chartLabels.${u}`)&&l.t(`chartLabels.${u}`)||u,backgroundColor:Ir(i.indexOf(u),sn),data:o.map((d,f)=>e?r[`${d.id},${u}`]||0:r[`${f},${u}`]||null)})):Array.from(s).flatMap((u,d)=>{if(!u)return[];const f=Oa(d,u.name,u.id==="empty",a);return{label:l&&l.te(`chartLabels.${u.name}`)&&l.t(`chartLabels.${u.name}`)||u.name,backgroundColor:f,data:o.map(g=>r[`${g.id},${u.id}`]||null),isSegmentEmpty:u.id==="empty"}})}function hM(n,t){const{i18n:e}=bt.useI18n();return h.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:o}=t.value.meta,a=r&&Object.keys(r),l=o&&o.length>1,c=r&&a&&a.length>0,u=c&&a.length>1;if(!s.length||!o)return{datasets:[],labels:[]};const d=c&&a||o,f=d[0],g=d.length>1?d[1]:d[0],p=Object.fromEntries(l?s.flatMap(_=>o.map((C,I)=>{const T=_.event[f],F=c?`${T},${C}`:`${I},${C}`,U=_.event[C];return[F,U]})):s.map(_=>{const C=c?`${_.event[f]},${_.event[g]}`:`${f},${g}`,I=_.event[o[0]];return[C,I]})),y=Object.keys(p).reduce((_,C)=>{const[I]=C.split(","),T=p[C];return _[I]?_[I]+=T:_[I]=T,_},{}),x=Object.entries(y).sort(([,_],[,C])=>Number(C)-Number(_)).map(([_])=>_),v=r[f],M=r[g],D=c&&v&&Object.entries(v).map(([_,C])=>({id:_,name:C.name}))||o.map(_=>({id:_,name:_})),S=c&&M&&Object.entries(M).map(([_,C])=>({id:_,name:C.name}))||o.map(_=>({id:_,name:_}));if(f!=="status_code"&&f!=="status_code_grouped"&&(D.sort((_,C)=>x.indexOf(_.id)-x.indexOf(C.id)),S.sort((_,C)=>x.indexOf(_.id)-x.indexOf(C.id))),!D||!S)return{labels:[],datasets:[]};const P=dM({isMultiMetric:l,hasDimensions:c,metricNames:o,dimensionFieldNames:d,barSegmentLabels:S,pivotRecords:p,rowLabels:D,colorPalette:n.colorPalette||sn}),R=c?D.map(_=>e&&e.te(`chartLabels.${_.name}`)&&e.t(`chartLabels.${_.name}`)||_.name):o.map(_=>e&&e.te(`chartLabels.${_}`)&&e.t(`chartLabels.${_}`)||_),O=D.map(_=>_.id==="empty");return{labels:R,datasets:P,isLabelEmpty:O,isMultiDimension:u}}}catch(s){return console.error(s),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const fM="#6c7489",ef="#6c7489",gM="#995c00",nf="16px",pM="20px",sf="24px",mM="40px",yM="48px",bM=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,s)=>i+s*e),_M=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return Xd(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},xM=(n,t,e,i,s)=>{const o=Math.max(t-6e4,Math.max(...(s||[]).map(c=>new Date(c.timestamp).valueOf()))),a=Math.floor((n-i)/e)*e+i,l=Math.floor((o-i)/e)*e+i+e;return bM(a,l,e)};function wM(n,t){const{i18n:e}=bt.useI18n();return h.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:o,start_ms:a,end_ms:l}=t.value.meta;if(!o)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const c=r&&Object.keys(r)||o,u=c&&c[0],d=r[u],f=r&&d&&Object.keys(d).map(S=>({id:S,name:d[S].name}))||o.map(S=>({id:S,name:S})),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(!s.length)return{datasets:[],labels:[]};const p=_M(a),y=xM(a,l,g,p,s),x=new Set,v=s!=null&&s.length?s.reduce((S,P)=>{const R=new Date(P.timestamp).valueOf(),O=P.event;for(const b of o)x.add(b),R in S||(S[R]={}),b in S[R]||(S[R][b]={});for(const b of o)f.forEach(_=>{O[u]===_.id||b===_.id?(S[R][b]||(S[R][b]={}),S[R][b][_.name]=Math.round(Number(O[b])*1e3)/1e3):c.length||(S[R][b]||(S[R][b]={}),S[R][b][_.name]=Math.round(Number(O[_.id])*1e3)/1e3)});return S},{}):{},D=[...o.length===1?o.flatMap(S=>f.map(P=>[S,P.name,P.id==="empty"])):f.map(S=>[S.name,S.name,S.id==="empty"])].map(([S,P,R],O)=>{const b=y.map(T=>T in v&&S in v[T]?{x:T,y:v[T][S][P]||0}:{x:T,y:0});let{colorPalette:_,fill:C}=n;st(_)&&(_=sn);const I=Oa(O,P,R,_);return{rawDimension:P,rawMetric:S,label:e&&e.te(`chartLabels.${P}`)&&e.t(`chartLabels.${P}`)||P,borderColor:I,backgroundColor:I,data:b,total:b.reduce((T,{y:F})=>T+Number(F),0),...xw,fill:C,borderWidth:C?vw:ww,isSegmentEmpty:R}});if(u==="status_code"||u==="status_code_grouped"?D.sort((S,P)=>(S.label??"")<(P.label??"")?-1:1):D.sort((S,P)=>Number(S.total)<Number(P.total)?-1:1),n.threshold)for(const S of Object.keys(n.threshold)){const P=n.threshold[S];P&&D.push({type:"line",rawMetric:S,isThreshold:!0,label:e.t("chartLabels.threshold"),borderColor:fM,borderWidth:1.25,borderDash:[12,8],fill:!1,order:-1,stack:"custom",data:y.map(R=>({x:R,y:P}))})}return{datasets:D}}}catch(s){return console.error(s),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const vM=(n,t)=>{h.watch([n,t],(e,i,s)=>{const[r,o]=e;!o||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(o,r),s(()=>{var a;(a=window._AnalyticsChartDataInternal)==null||a.delete(o)}))},{immediate:!0})};function MM(){const{i18n:n}=bt.useI18n();return{translateUnit:(e,i)=>{const s=i===1,r=`chartUnits.${e}`;return e==="usd"?"":n.te(r)?n.t(r,{plural:s?"":"s"}):e}}}const rf="analytics-query-provider",of=2;function kM(){const n=h.inject(rf);return{evaluateFeatureFlag:(e,i)=>n?n.evaluateFeatureFlagFn(e,i):i}}function Ja(n){return h.getCurrentScope()?(h.onScopeDispose(n),!0):!1}const af=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const DM=n=>n!=null,SM=Object.prototype.toString,TM=n=>SM.call(n)==="[object Object]";function Vr(n){return Array.isArray(n)?n:[n]}function CM(n){return h.getCurrentInstance()}function PM(n,t={}){if(!h.isRef(n))return h.toRefs(n);const e=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)e[i]=h.customRef(()=>({get(){return n.value[i]},set(s){var r;if((r=h.toValue(t.replaceRef))!=null?r:!0)if(Array.isArray(n.value)){const a=[...n.value];a[i]=s,n.value=a}else{const a={...n.value,[i]:s};Object.setPrototypeOf(a,Object.getPrototypeOf(n.value)),n.value=a}else n.value[i]=s}}));return e}function OM(n,t=!0,e){CM()?h.onMounted(n,e):t?n():h.nextTick(n)}function EM(n,t,e){return h.watch(n,t,{...e,immediate:!0})}const $r=af?window:void 0;function Di(n){var t;const e=h.toValue(n);return(t=e==null?void 0:e.$el)!=null?t:e}function Cs(...n){const t=[],e=()=>{t.forEach(a=>a()),t.length=0},i=(a,l,c,u)=>(a.addEventListener(l,c,u),()=>a.removeEventListener(l,c,u)),s=h.computed(()=>{const a=Vr(h.toValue(n[0])).filter(l=>l!=null);return a.every(l=>typeof l!="string")?a:void 0}),r=EM(()=>{var a,l;return[(l=(a=s.value)==null?void 0:a.map(c=>Di(c)))!=null?l:[$r].filter(c=>c!=null),Vr(h.toValue(s.value?n[1]:n[0])),Vr(h.unref(s.value?n[2]:n[1])),h.toValue(s.value?n[3]:n[2])]},([a,l,c,u])=>{if(e(),!(a!=null&&a.length)||!(l!=null&&l.length)||!(c!=null&&c.length))return;const d=TM(u)?{...u}:u;t.push(...a.flatMap(f=>l.flatMap(g=>c.map(p=>i(f,g,p,d)))))},{flush:"post"}),o=()=>{r(),e()};return Ja(e),o}function AM(){const n=h.shallowRef(!1),t=h.getCurrentInstance();return t&&h.onMounted(()=>{n.value=!0},t),n}function lf(n){const t=AM();return h.computed(()=>(t.value,!!n()))}function RM(n,t,e={}){const{window:i=$r,...s}=e;let r;const o=lf(()=>i&&"MutationObserver"in i),a=()=>{r&&(r.disconnect(),r=void 0)},l=h.computed(()=>{const f=h.toValue(n),g=Vr(f).map(Di).filter(DM);return new Set(g)}),c=h.watch(()=>l.value,f=>{a(),o.value&&f.size&&(r=new MutationObserver(t),f.forEach(g=>r.observe(g,s)))},{immediate:!0,flush:"post"}),u=()=>r==null?void 0:r.takeRecords(),d=()=>{c(),a()};return Ja(d),{isSupported:o,stop:d,takeRecords:u}}function IM(n,t={}){var e;const{pointerTypes:i,preventDefault:s,stopPropagation:r,exact:o,onMove:a,onEnd:l,onStart:c,initialValue:u,axis:d="both",draggingElement:f=$r,containerElement:g,handle:p=n,buttons:y=[0]}=t,x=h.ref((e=h.toValue(u))!=null?e:{x:0,y:0}),v=h.ref(),M=O=>i?i.includes(O.pointerType):!0,D=O=>{h.toValue(s)&&O.preventDefault(),h.toValue(r)&&O.stopPropagation()},S=O=>{var b;if(!h.toValue(y).includes(O.button)||h.toValue(t.disabled)||!M(O)||h.toValue(o)&&O.target!==h.toValue(n))return;const _=h.toValue(g),C=(b=_==null?void 0:_.getBoundingClientRect)==null?void 0:b.call(_),I=h.toValue(n).getBoundingClientRect(),T={x:O.clientX-(_?I.left-C.left+_.scrollLeft:I.left),y:O.clientY-(_?I.top-C.top+_.scrollTop:I.top)};(c==null?void 0:c(T,O))!==!1&&(v.value=T,D(O))},P=O=>{if(h.toValue(t.disabled)||!M(O)||!v.value)return;const b=h.toValue(g),_=h.toValue(n).getBoundingClientRect();let{x:C,y:I}=x.value;(d==="x"||d==="both")&&(C=O.clientX-v.value.x,b&&(C=Math.min(Math.max(0,C),b.scrollWidth-_.width))),(d==="y"||d==="both")&&(I=O.clientY-v.value.y,b&&(I=Math.min(Math.max(0,I),b.scrollHeight-_.height))),x.value={x:C,y:I},a==null||a(x.value,O),D(O)},R=O=>{h.toValue(t.disabled)||!M(O)||v.value&&(v.value=void 0,l==null||l(x.value,O),D(O))};if(af){const O=()=>{var b;return{capture:(b=t.capture)!=null?b:!0,passive:!h.toValue(s)}};Cs(p,"pointerdown",S,O),Cs(f,"pointermove",P,O),Cs(f,"pointerup",R,O)}return{...PM(x),position:x,isDragging:h.computed(()=>!!v.value),style:h.computed(()=>`left:${x.value.x}px;top:${x.value.y}px;`)}}function LM(n,t,e={}){const{window:i=$r,...s}=e;let r;const o=lf(()=>i&&"ResizeObserver"in i),a=()=>{r&&(r.disconnect(),r=void 0)},l=h.computed(()=>{const d=h.toValue(n);return Array.isArray(d)?d.map(f=>Di(f)):[Di(d)]}),c=h.watch(l,d=>{if(a(),o.value&&i){r=new ResizeObserver(t);for(const f of d)f&&r.observe(f,s)}},{immediate:!0,flush:"post"}),u=()=>{a(),c()};return Ja(u),{isSupported:o,stop:u}}function NM(n,t={}){const{reset:e=!0,windowResize:i=!0,windowScroll:s=!0,immediate:r=!0,updateTiming:o="sync"}=t,a=h.shallowRef(0),l=h.shallowRef(0),c=h.shallowRef(0),u=h.shallowRef(0),d=h.shallowRef(0),f=h.shallowRef(0),g=h.shallowRef(0),p=h.shallowRef(0);function y(){const v=Di(n);if(!v){e&&(a.value=0,l.value=0,c.value=0,u.value=0,d.value=0,f.value=0,g.value=0,p.value=0);return}const M=v.getBoundingClientRect();a.value=M.height,l.value=M.bottom,c.value=M.left,u.value=M.right,d.value=M.top,f.value=M.width,g.value=M.x,p.value=M.y}function x(){o==="sync"?y():o==="next-frame"&&requestAnimationFrame(()=>y())}return LM(n,x),h.watch(()=>Di(n),v=>!v&&x()),RM(n,x,{attributeFilter:["style","class"]}),s&&Cs("scroll",x,{capture:!0,passive:!0}),i&&Cs("resize",x,{passive:!0}),OM(()=>{r&&x()}),{height:a,bottom:l,left:c,right:u,top:d,width:f,x:g,y:p,update:x}}function FM(n,t){const{top:e,left:i}=NM(n),s=h.computed(()=>n.value?`${parseFloat(t.left)+i.value}px`:t.left),r=h.computed(()=>n.value?`${parseFloat(t.top)+e.value}px`:t.top);return{tooltipAbsoluteLeft:s,tooltipAbsoluteTop:r}}const bt={useBarChartOptions:e1,useChartJSCommon:i1,useChartLegendValues:r1,useChartSelectedRange:lM,useExploreResultToDatasets:hM,useExploreResultToTimeDataset:wM,useDonutChartOptions:cM,useLineChartOptions:uM,useI18n:vg,useReportChartDataForSynthetics:vM,useTranslatedUnits:MM,useEvaluateFeatureFlag:kM,useTooltipAbsolutePosition:FM};var Nt=(n=>(n.Hidden="hidden",n.Right="right",n.Bottom="bottom",n))(Nt||{});/*!
|
|
19
19
|
* chartjs-plugin-annotation v3.1.0
|
|
20
20
|
* https://www.chartjs.org/chartjs-plugin-annotation/index
|
|
21
21
|
* (c) 2024 chartjs-plugin-annotation Contributors
|
|
22
22
|
* Released under the MIT License
|
|
23
|
-
*/const cf={modes:{point(n,t){return Ur(n,t,{intersect:!0})},nearest(n,t,e){return HM(n,t,e)},x(n,t,e){return Ur(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return Ur(n,t,{intersect:e.intersect,axis:"y"})}}};function tl(n,t,e){return(cf.modes[e.mode]||cf.modes.nearest)(n,t,e)}function zM(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 BM(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function Ur(n,t,e){return n.filter(i=>e.intersect?i.inRange(t.x,t.y):zM(i,t,e.axis))}function HM(n,t,e){let i=Number.POSITIVE_INFINITY;return Ur(n,t,e).reduce((s,r)=>{const o=r.getCenterPoint(),a=BM(t,o,e.axis),l=ui(t,a);return l<i?(s=[r],i=l):l===i&&s.push(r),s},[]).sort((s,r)=>s._index-r._index).slice(0,1)}function Kn(n,t,e){const i=Math.cos(e),s=Math.sin(e),r=t.x,o=t.y;return{x:r+i*(n.x-r)-s*(n.y-o),y:o+s*(n.x-r)+i*(n.y-o)}}const WM=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,Zn=.001,Xr=(n,t,e)=>Math.min(e,Math.max(t,n)),uf=(n,t)=>n.value>=n.start-t&&n.value<=n.end+t;function YM(n,t,e){for(const i of Object.keys(n))n[i]=Xr(n[i],t,e);return n}function jM(n,t,e,i){return!n||!t||e<=0?!1:Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2)<=Math.pow(e+i,2)}function df(n,{x:t,y:e,x2:i,y2:s},r,{borderWidth:o,hitTolerance:a}){const l=(o+a)/2,c=n.x>=t-l-Zn&&n.x<=i+l+Zn,u=n.y>=e-l-Zn&&n.y<=s+l+Zn;return r==="x"?c:(r==="y"||c)&&u}function hf(n,{rect:t,center:e},i,{rotation:s,borderWidth:r,hitTolerance:o}){const a=Kn(n,e,$t(-s));return df(a,t,i,{borderWidth:r,hitTolerance:o})}function Qn(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function VM(n,t,e,i=!0){const s=e.split(".");let r=0;for(const o of t.split(".")){const a=s[r++];if(parseInt(o,10)<parseInt(a,10))break;if(WM(a,o)){if(i)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const ff=n=>typeof n=="string"&&n.endsWith("%"),gf=n=>parseFloat(n)/100,pf=n=>Xr(gf(n),0,1),Ps=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),$M={box:n=>Ps(n.centerX,n.centerY),doughnutLabel:n=>Ps(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>Ps(n.centerX,n.centerY),line:n=>Ps(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>Ps(n.centerX,n.centerY)};function el(n,t){return t==="start"?0:t==="end"?n:ff(t)?pf(t)*n:n/2}function Tn(n,t,e=!0){return typeof t=="number"?t:ff(t)?(e?pf(t):gf(t))*n:n}function UM(n,t){const{x:e,width:i}=n,s=t.textAlign;return s==="center"?e+i/2:s==="end"||s==="right"?e+i:e}function mf(n,t,{borderWidth:e,position:i,xAdjust:s,yAdjust:r},o){const a=ht(o),l=t.width+(a?o.width:0)+e,c=t.height+(a?o.height:0)+e,u=nl(i),d=xf(n.x,l,s,u.x),f=xf(n.y,c,r,u.y);return{x:d,y:f,x2:d+l,y2:f+c,width:l,height:c,centerX:d+l/2,centerY:f+c/2}}function nl(n,t="center"){return ht(n)?{x:rt(n.x,t),y:rt(n.y,t)}:(n=rt(n,t),{x:n,y:n})}const yf=(n,t)=>n&&n.autoFit&&t<1;function bf(n,t){const e=n.font,i=kt(e)?e:[e];return yf(n,t)?i.map(function(s){const r=It(s);return r.size=Math.floor(s.size*t),r.lineHeight=s.lineHeight,It(r)}):i.map(s=>It(s))}function _f(n){return n&&(ge(n.xValue)||ge(n.yValue))}function xf(n,t,e=0,i){return n-el(t,i)+e}function Si(n,t,e){const i=e.init;if(i){if(i===!0)return vf(t,e)}else return;return XM(n,t,e)}function wf(n,t,e){let i=!1;return t.forEach(s=>{pe(n[s])?(i=!0,e[s]=n[s]):ge(e[s])&&delete e[s]}),i}function vf(n,t){const e=t.type||"line";return $M[e](n)}function XM(n,t,e){const i=Dt(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return vf(t,e);if(ht(i))return i}const il=new Map,qM=n=>isNaN(n)||n<=0,GM=n=>n.reduce(function(t,e){return t+=e.string,t},"");function qr(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function Gr(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate($t(i)),n.translate(-t,-e))}function on(n,t){if(t&&t.borderWidth)return n.lineCap=t.borderCapStyle||"butt",n.setLineDash(t.borderDash),n.lineDashOffset=t.borderDashOffset,n.lineJoin=t.borderJoinStyle||"miter",n.lineWidth=t.borderWidth,n.strokeStyle=t.borderColor,!0}function Ti(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function Kr(n,t){const e=t.content;if(qr(e))return{width:Tn(e.width,t.width),height:Tn(e.height,t.height)};const i=bf(t),s=t.textStrokeWidth,r=kt(e)?e:[e],o=r.join()+GM(i)+s+(n._measureText?"-spriting":"");return il.has(o)||il.set(o,JM(n,r,i,s)),il.get(o)}function Mf(n,t,e){const{x:i,y:s,width:r,height:o}=t;n.save(),Ti(n,e);const a=on(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),di(n,{x:i,y:s,w:r,h:o,radius:YM(xn(e.borderRadius),0,Math.min(r,o)/2)}),n.closePath(),n.fill(),a&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function kf(n,t,e,i){const s=e.content;if(qr(s)){n.save(),n.globalAlpha=nk(e.opacity,s.style.opacity),n.drawImage(s,t.x,t.y,t.width,t.height),n.restore();return}const r=kt(s)?s:[s],o=bf(e,i),a=e.color,l=kt(a)?a:[a],c=UM(t,e),u=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,KM(n,e)&&tk(n,{x:c,y:u},r,o),ek(n,{x:c,y:u},r,{fonts:o,colors:l}),n.restore()}function KM(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function ZM(n,t,e,i){const{radius:s,options:r}=t,o=r.pointStyle,a=r.rotation;let l=(a||0)*Co;if(qr(o)){n.save(),n.translate(e,i),n.rotate(l),n.drawImage(o,-o.width/2,-o.height/2,o.width,o.height),n.restore();return}qM(s)||QM(n,{x:e,y:i,radius:s,rotation:a,style:o,rad:l})}function QM(n,{x:t,y:e,radius:i,rotation:s,style:r,rad:o}){let a,l,c,u;switch(n.beginPath(),r){default:n.arc(t,e,i,0,Ot),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(o)*i,e-Math.cos(o)*i),o+=Qs,n.lineTo(t+Math.sin(o)*i,e-Math.cos(o)*i),o+=Qs,n.lineTo(t+Math.sin(o)*i,e-Math.cos(o)*i),n.closePath();break;case"rectRounded":u=i*.516,c=i-u,a=Math.cos(o+De)*c,l=Math.sin(o+De)*c,n.arc(t-a,e-l,u,o-ct,o-Et),n.arc(t+l,e-a,u,o-Et,o),n.arc(t+a,e+l,u,o,o+Et),n.arc(t-l,e+a,u,o+Et,o+ct),n.closePath();break;case"rect":if(!s){c=Math.SQRT1_2*i,n.rect(t-c,e-c,2*c,2*c);break}o+=De;case"rectRot":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+l,e-a),n.lineTo(t+a,e+l),n.lineTo(t-l,e+a),n.closePath();break;case"crossRot":o+=De;case"cross":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a);break;case"star":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a),o+=De,a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a);break;case"line":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l);break;case"dash":n.moveTo(t,e),n.lineTo(t+Math.cos(o)*i,e+Math.sin(o)*i);break}n.fill()}function JM(n,t,e,i){n.save();const s=t.length;let r=0,o=i;for(let a=0;a<s;a++){const l=e[Math.min(a,e.length-1)];n.font=l.string;const c=t[a];r=Math.max(r,n.measureText(c).width+i),o+=l.lineHeight}return n.restore(),{width:r,height:o}}function tk(n,{x:t,y:e},i,s){n.beginPath();let r=0;i.forEach(function(o,a){const l=s[Math.min(a,s.length-1)],c=l.lineHeight;n.font=l.string,n.strokeText(o,t,e+c/2+r),r+=c}),n.stroke()}function ek(n,{x:t,y:e},i,{fonts:s,colors:r}){let o=0;i.forEach(function(a,l){const c=r[Math.min(l,r.length-1)],u=s[Math.min(l,s.length-1)],d=u.lineHeight;n.beginPath(),n.font=u.string,n.fillStyle=c,n.fillText(a,t,e+d/2+o),o+=d,n.fill()})}function nk(n,t){const e=_n(n)?n:t;return _n(e)?Xr(e,0,1):1}const Df=["left","bottom","top","right"];function ik(n,t){const{pointX:e,pointY:i,options:s}=t,r=s.callout,o=r&&r.display&&lk(t,r);if(!o||uk(t,r,o))return;if(n.save(),n.beginPath(),!on(n,r))return n.restore();const{separatorStart:l,separatorEnd:c}=sk(t,o),{sideStart:u,sideEnd:d}=ok(t,o,l);(r.margin>0||s.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=Kn({x:e,y:i},t.getCenterPoint(),$t(-t.rotation));n.lineTo(f.x,f.y),n.stroke(),n.restore()}function sk(n,t){const{x:e,y:i,x2:s,y2:r}=n,o=rk(n,t);let a,l;return t==="left"||t==="right"?(a={x:e+o,y:i},l={x:a.x,y:r}):(a={x:e,y:i+o},l={x:s,y:a.y}),{separatorStart:a,separatorEnd:l}}function rk(n,t){const{width:e,height:i,options:s}=n,r=s.callout.margin+s.borderWidth/2;return t==="right"?e+r:t==="bottom"?i+r:-r}function ok(n,t,e){const{y:i,width:s,height:r,options:o}=n,a=o.callout.start,l=ak(t,o.callout);let c,u;return t==="left"||t==="right"?(c={x:e.x,y:i+Tn(r,a)},u={x:c.x+l,y:c.y}):(c={x:e.x+Tn(s,a),y:e.y},u={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:u}}function ak(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function lk(n,t){const e=t.position;return Df.includes(e)?e:ck(n,t)}function ck(n,t){const{x:e,y:i,x2:s,y2:r,width:o,height:a,pointX:l,pointY:c,centerX:u,centerY:d,rotation:f}=n,g={x:u,y:d},p=t.start,y=Tn(o,p),x=Tn(a,p),v=[e,e+y,e+y,s],M=[i+x,r,i,r],D=[];for(let S=0;S<4;S++){const C=Kn({x:v[S],y:M[S]},g,$t(f));D.push({position:Df[S],distance:ui(C,{x:l,y:c})})}return D.sort((S,C)=>S.distance-C.distance)[0].position}function uk(n,t,e){const{pointX:i,pointY:s}=n,r=t.margin;let o=i,a=s;return e==="left"?o+=r:e==="right"?o-=r:e==="top"?a+=r:e==="bottom"&&(a-=r),n.inRange(o,a)}const Sf={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 Ci(n,t,e){return t=typeof t=="number"?t:n.parse(t),Rt(t)?n.getPixelForValue(t):e}function Jn(n,t,e){const i=t[e];if(i||e==="scaleID")return i;const s=e.charAt(0),r=Object.values(n).filter(o=>o.axis&&o.axis===s);return r.length?r[0].id:s}function Tf(n,t){if(n){const e=n.options.reverse,i=Ci(n,t.min,e?t.end:t.start),s=Ci(n,t.max,e?t.start:t.end);return{start:i,end:s}}}function Cf(n,t){const{chartArea:e,scales:i}=n,s=i[Jn(i,t,"xScaleID")],r=i[Jn(i,t,"yScaleID")];let o=e.width/2,a=e.height/2;return s&&(o=Ci(s,t.xValue,s.left+s.width/2)),r&&(a=Ci(r,t.yValue,r.top+r.height/2)),{x:o,y:a}}function sl(n,t){const e=n.scales,i=e[Jn(e,t,"xScaleID")],s=e[Jn(e,t,"yScaleID")];if(!i&&!s)return{};let{left:r,right:o}=i||n.chartArea,{top:a,bottom:l}=s||n.chartArea;const c=Ef(i,{min:t.xMin,max:t.xMax,start:r,end:o});r=c.start,o=c.end;const u=Ef(s,{min:t.yMin,max:t.yMax,start:l,end:a});return a=u.start,l=u.end,{x:r,y:a,x2:o,y2:l,width:o-r,height:l-a,centerX:r+(o-r)/2,centerY:a+(l-a)/2}}function Pf(n,t){if(!_f(t)){const e=sl(n,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(e.width,e.height)/2,t.radius=i);const s=i*2,r=e.centerX+t.xAdjust,o=e.centerY+t.yAdjust;return{x:r-i,y:o-i,x2:r+i,y2:o+i,centerX:r,centerY:o,width:s,height:s,radius:i}}return hk(n,t)}function dk(n,t){const{scales:e,chartArea:i}=n,s=e[t.scaleID],r={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return s?fk(s,r,t):gk(e,r,t),r}function Of(n,t){const e=sl(n,t);return e.initProperties=Si(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:yk(n,e,t),initProperties:e.initProperties}],e}function hk(n,t){const e=Cf(n,t),i=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:i,height:i}}function Ef(n,t){const e=Tf(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function fk(n,t,e){const i=Ci(n,e.value,NaN),s=Ci(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=s):(t.y=i,t.y2=s)}function gk(n,t,e){for(const i of Object.keys(Sf)){const s=n[Jn(n,e,i)];if(s){const{min:r,max:o,start:a,end:l,startProp:c,endProp:u}=Sf[i],d=Tf(s,{min:e[r],max:e[o],start:s[a],end:s[l]});t[c]=d.start,t[u]=d.end}}}function pk({properties:n,options:t},e,i,s){const{x:r,x2:o,width:a}=n;return Af({start:r,end:o,borderWidth:t.borderWidth},{position:i.x,padding:{start:s.left,end:s.right},adjust:t.label.xAdjust,size:e.width})}function mk({properties:n,options:t},e,i,s){const{y:r,y2:o,height:a}=n;return Af({start:r,end:o,borderWidth:t.borderWidth},{position:i.y,padding:{start:s.top,end:s.bottom},adjust:t.label.yAdjust,size:e.height})}function Af(n,t){const{start:e,end:i,borderWidth:s}=n,{position:r,padding:{start:o,end:a},adjust:l}=t,c=i-s-e-o-a-t.size;return e+s/2+l+el(c,r)}function yk(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const s=nl(i.position),r=Ut(i.padding),o=Kr(n.ctx,i),a=pk({properties:t,options:e},o,s,r),l=mk({properties:t,options:e},o,s,r),c=o.width+r.width,u=o.height+r.height;return{x:a,y:l,x2:a+c,y2:l+u,width:c,height:u,centerX:a+c/2,centerY:l+u/2,rotation:i.rotation}}const rl=["enter","leave"],ol=rl.concat("click");function bk(n,t,e){t.listened=wf(e,ol,t.listeners),t.moveListened=!1,rl.forEach(i=>{pe(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&pe(i.click)&&(t.listened=!0),t.moveListened||rl.forEach(s=>{pe(i[s])&&(t.listened=!0,t.moveListened=!0)})})}function _k(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return xk(n,t,e);case"click":return wk(n,t,e)}}function xk(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=tl(n.visibleElements,t,e.interaction):i=[];const s=n.hovered;n.hovered=i;const r={state:n,event:t};let o=Rf(r,"leave",s,i);return Rf(r,"enter",i,s)||o}function Rf({state:n,event:t},e,i,s){let r;for(const o of i)s.indexOf(o)<0&&(r=If(o.options[e]||n.listeners[e],o,t)||r);return r}function wk(n,t,e){const i=n.listeners,s=tl(n.visibleElements,t,e.interaction);let r;for(const o of s)r=If(o.options.click||i.click,o,t)||r;return r}function If(n,t,e){return Dt(n,[t.$context,e])===!0}const Zr=["afterDraw","beforeDraw"];function vk(n,t,e){const i=t.visibleElements;t.hooked=wf(e,Zr,t.hooks),t.hooked||i.forEach(s=>{t.hooked||Zr.forEach(r=>{pe(s.options[r])&&(t.hooked=!0)})})}function Lf(n,t,e){if(n.hooked){const i=t.options[e]||n.hooks[e];return Dt(i,[t.$context])}}function Mk(n,t,e){const i=Ck(n.scales,t,e);let s=Nf(t,i,"min","suggestedMin");s=Nf(t,i,"max","suggestedMax")||s,s&&pe(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function kk(n,t){for(const e of n)Sk(e,t)}function Nf(n,t,e,i){if(Rt(t[e])&&!Dk(n.options,e,i)){const s=n[e]!==t[e];return n[e]=t[e],s}}function Dk(n,t,e){return ge(n[t])||ge(n[e])}function Sk(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=Jn(t,n,e);i&&!t[i]&&Tk(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function Tk(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(ge(n[e+i]))return!0;return!1}function Ck(n,t,e){const i=t.axis,s=t.id,r=i+"ScaleID",o={min:rt(t.min,Number.NEGATIVE_INFINITY),max:rt(t.max,Number.POSITIVE_INFINITY)};for(const a of e)a.scaleID===s?Ff(a,t,["value","endValue"],o):Jn(n,a,r)===s&&Ff(a,t,[i+"Min",i+"Max",i+"Value"],o);return o}function Ff(n,t,e,i){for(const s of e){const r=n[s];if(ge(r)){const o=t.parse(r);i.min=Math.min(i.min,o),i.max=Math.max(i.max,o)}}}class Pi extends Jt{inRange(t,e,i,s){const{x:r,y:o}=Kn({x:t,y:e},this.getCenterPoint(s),$t(-this.options.rotation));return df({x:r,y:o},this.getProps(["x","y","x2","y2"],s),i,this.options)}getCenterPoint(t){return Qn(this,t)}draw(t){t.save(),Gr(t,this.getCenterPoint(),this.options.rotation),Mf(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Of(t,e)}}Pi.id="boxAnnotation",Pi.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,hitTolerance: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,hitTolerance: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},Pi.defaultRoutes={borderColor:"color",backgroundColor:"color"},Pi.descriptors={label:{_fallback:!0}};class Qr extends Jt{inRange(t,e,i,s){return hf({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],s),center:this.getCenterPoint(s)},i,{rotation:this.rotation,borderWidth:0,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return Qn(this,t)}draw(t){const e=this.options;!e.display||!e.content||(Ik(t,this),t.save(),Gr(t,this.getCenterPoint(),this.rotation),kf(t,this,e,this._fitRatio),t.restore())}resolveElementProperties(t,e){const i=Pk(t,e);if(!i)return{};const{controllerMeta:s,point:r,radius:o}=Ek(t,e,i);let a=Kr(t.ctx,e);const l=Ak(a,o);yf(e,l)&&(a={width:a.width*l,height:a.height*l});const{position:c,xAdjust:u,yAdjust:d}=e,f=mf(r,a,{borderWidth:0,position:c,xAdjust:u,yAdjust:d});return{initProperties:Si(t,f,e),...f,...s,rotation:e.rotation,_fitRatio:l}}}Qr.id="doughnutLabelAnnotation",Qr.defaults={autoFit:!0,autoHide:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderColor:"transparent",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:0,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,hitTolerance:0,init:void 0,opacity:void 0,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,spacing:1,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0},Qr.defaultRoutes={};function Pk(n,t){return n.getSortedVisibleDatasetMetas().reduce(function(e,i){const s=i.controller;return s instanceof en&&Ok(n,t,i.data)&&(!e||s.innerRadius<e.controller.innerRadius)&&s.options.circumference>=90?i:e},void 0)}function Ok(n,t,e){if(!t.autoHide)return!0;for(let i=0;i<e.length;i++)if(!e[i].hidden&&n.getDataVisibility(i))return!0}function Ek({chartArea:n},t,e){const{left:i,top:s,right:r,bottom:o}=n,{innerRadius:a,offsetX:l,offsetY:c}=e.controller,u=(i+r)/2+l,d=(s+o)/2+c,f={left:Math.max(u-a,i),right:Math.min(u+a,r),top:Math.max(d-a,s),bottom:Math.min(d+a,o)},g={x:(f.left+f.right)/2,y:(f.top+f.bottom)/2},p=t.spacing+t.borderWidth/2,y=a-p,x=g.y>d,v=x?s+p:o-p,M=Rk(v,u,d,y);return{controllerMeta:{_centerX:u,_centerY:d,_radius:y,_counterclockwise:x,...M},point:g,radius:Math.min(a,Math.min(f.right-f.left,f.bottom-f.top)/2)}}function Ak({width:n,height:t},e){const i=Math.sqrt(Math.pow(n,2)+Math.pow(t,2));return e*2/i}function Rk(n,t,e,i){const s=Math.pow(e-n,2),r=Math.pow(i,2),o=t*-2,a=Math.pow(t,2)+s-r,l=Math.pow(o,2)-4*a;if(l<=0)return{_startAngle:0,_endAngle:Ot};const c=(-o-Math.sqrt(l))/2,u=(-o+Math.sqrt(l))/2;return{_startAngle:tr({x:t,y:e},{x:c,y:n}).angle,_endAngle:tr({x:t,y:e},{x:u,y:n}).angle}}function Ik(n,t){const{_centerX:e,_centerY:i,_radius:s,_startAngle:r,_endAngle:o,_counterclockwise:a,options:l}=t;n.save();const c=on(n,l);n.fillStyle=l.backgroundColor,n.beginPath(),n.arc(e,i,s,r,o,a),n.closePath(),n.fill(),c&&n.stroke(),n.restore()}class Os extends Jt{inRange(t,e,i,s){return hf({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],s),center:this.getCenterPoint(s)},i,{rotation:this.rotation,borderWidth:this.options.borderWidth,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return Qn(this,t)}draw(t){const e=this.options,i=!ge(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),Gr(t,this.getCenterPoint(),this.rotation),ik(t,this),Mf(t,this,e),kf(t,Lk(this),e),t.restore())}resolveElementProperties(t,e){let i;if(_f(e))i=Cf(t,e);else{const{centerX:a,centerY:l}=sl(t,e);i={x:a,y:l}}const s=Ut(e.padding),r=Kr(t.ctx,e),o=mf(i,r,e,s);return{initProperties:Si(t,o,e),pointX:i.x,pointY:i.y,...o,rotation:e.rotation}}}Os.id="labelAnnotation",Os.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,hitTolerance: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},Os.defaultRoutes={borderColor:"color"};function Lk({x:n,y:t,width:e,height:i,options:s}){const r=s.borderWidth/2,o=Ut(s.padding);return{x:n+o.left+r,y:t+o.top+r,width:e-o.left-o.right-s.borderWidth,height:i-o.top-o.bottom-s.borderWidth}}const al=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),ll=(n,t,e)=>al(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,zf=(n,t,e)=>al(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,Es=n=>n*n,Nk=(n,t,{x:e,y:i,x2:s,y2:r},o)=>o==="y"?{start:Math.min(i,r),end:Math.max(i,r),value:t}:{start:Math.min(e,s),end:Math.max(e,s),value:n},Bf=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,cl=(n,t,e,i)=>({x:Bf(n.x,t.x,e.x,i),y:Bf(n.y,t.y,e.y,i)}),Hf=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),Wf=(n,t,e,i)=>-Math.atan2(Hf(n.x,t.x,e.x,i),Hf(n.y,t.y,e.y,i))+.5*ct;class As extends Jt{inRange(t,e,i,s){const r=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y"){const o={mouseX:t,mouseY:e},{path:a,ctx:l}=this;if(a){on(l,this.options),l.lineWidth+=this.options.hitTolerance;const{chart:u}=this.$context,d=t*u.currentDevicePixelRatio,f=e*u.currentDevicePixelRatio,g=l.isPointInStroke(a,d,f)||ul(this,o,s);return l.restore(),g}const c=Es(r);return Hk(this,o,c,s)||ul(this,o,s)}return Fk(this,{mouseX:t,mouseY:e},i,{hitSize:r,useFinalPosition:s})}getCenterPoint(t){return Qn(this,t)}draw(t){const{x:e,y:i,x2:s,y2:r,cp:o,options:a}=this;if(t.save(),!on(t,a))return t.restore();Ti(t,a);const l=Math.sqrt(Math.pow(s-e,2)+Math.pow(r-i,2));if(a.curve&&o)return qk(t,this,o,l),t.restore();const{startOpts:c,endOpts:u,startAdjust:d,endAdjust:f}=Uf(this),g=Math.atan2(r-i,s-e);t.translate(e,i),t.rotate(g),t.beginPath(),t.moveTo(0+d,0),t.lineTo(l-f,0),t.shadowColor=a.borderShadowColor,t.stroke(),dl(t,0,d,c),dl(t,l,-f,u),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=dk(t,e),{x:s,y:r,x2:o,y2:a}=i,l=zk(i,t.chartArea),c=l?Bk({x:s,y:r},{x:o,y:a},t.chartArea):{x:s,y:r,x2:o,y2:a,width:Math.abs(o-s),height:Math.abs(a-r)};if(c.centerX=(o+s)/2,c.centerY=(a+r)/2,c.initProperties=Si(t,c,e),e.curve){const d={x:c.x,y:c.y},f={x:c.x2,y:c.y2};c.cp=Xk(c,e,ui(d,f))}const u=Wk(t,c,e.label);return u._visible=l,c.elements=[{type:"label",optionScope:"label",properties:u,initProperties:c.initProperties}],c}}As.id="lineAnnotation";const Yf={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};As.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},Yf),fill:!1,length:12,start:Object.assign({},Yf),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,hitTolerance: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({},Os.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,hitTolerance: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},As.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},As.defaultRoutes={borderColor:"color"};function Fk(n,{mouseX:t,mouseY:e},i,{hitSize:s,useFinalPosition:r}){const o=Nk(t,e,n.getProps(["x","y","x2","y2"],r),i);return uf(o,s)||ul(n,{mouseX:t,mouseY:e},r,i)}function zk({x:n,y:t,x2:e,y2:i},{top:s,right:r,bottom:o,left:a}){return!(n<a&&e<a||n>r&&e>r||t<s&&i<s||t>o&&i>o)}function jf({x:n,y:t},e,{top:i,right:s,bottom:r,left:o}){return n<o&&(t=zf(o,{x:n,y:t},e),n=o),n>s&&(t=zf(s,{x:n,y:t},e),n=s),t<i&&(n=ll(i,{x:n,y:t},e),t=i),t>r&&(n=ll(r,{x:n,y:t},e),t=r),{x:n,y:t}}function Bk(n,t,e){const{x:i,y:s}=jf(n,t,e),{x:r,y:o}=jf(t,n,e);return{x:i,y:s,x2:r,y2:o,width:Math.abs(r-i),height:Math.abs(o-s)}}function Hk(n,{mouseX:t,mouseY:e},i=Zn,s){const{x:r,y:o,x2:a,y2:l}=n.getProps(["x","y","x2","y2"],s),c=a-r,u=l-o,d=Es(c)+Es(u),f=d===0?-1:((t-r)*c+(e-o)*u)/d;let g,p;return f<0?(g=r,p=o):f>1?(g=a,p=l):(g=r+f*c,p=o+f*u),Es(t-g)+Es(e-p)<=i}function ul(n,{mouseX:t,mouseY:e},i,s){const r=n.label;return r.options.display&&r.inRange(t,e,s,i)}function Wk(n,t,e){const i=e.borderWidth,s=Ut(e.padding),r=Kr(n.ctx,e),o=r.width+s.width+i,a=r.height+s.height+i;return jk(t,e,{width:o,height:a,padding:s},n.chartArea)}function Yk(n){const{x:t,y:e,x2:i,y2:s}=n,r=Math.atan2(s-e,i-t);return r>ct/2?r-ct:r<ct/-2?r+ct:r}function jk(n,t,e,i){const{width:s,height:r,padding:o}=e,{xAdjust:a,yAdjust:l}=t,c={x:n.x,y:n.y},u={x:n.x2,y:n.y2},d=t.rotation==="auto"?Yk(n):$t(t.rotation),f=Vk(s,r,d),g=$k(n,t,{labelSize:f,padding:o},i),p=n.cp?cl(c,n.cp,u,g):al(c,u,g),y={size:f.w,min:i.left,max:i.right,padding:o.left},x={size:f.h,min:i.top,max:i.bottom,padding:o.top},v=$f(p.x,y)+a,M=$f(p.y,x)+l;return{x:v-s/2,y:M-r/2,x2:v+s/2,y2:M+r/2,centerX:v,centerY:M,pointX:p.x,pointY:p.y,width:s,height:r,rotation:Js(d)}}function Vk(n,t,e){const i=Math.cos(e),s=Math.sin(e);return{w:Math.abs(n*i)+Math.abs(t*s),h:Math.abs(n*s)+Math.abs(t*i)}}function $k(n,t,e,i){let s;const r=Uk(n,i);return t.position==="start"?s=Vf({w:n.x2-n.x,h:n.y2-n.y},e,t,r):t.position==="end"?s=1-Vf({w:n.x-n.x2,h:n.y-n.y2},e,t,r):s=el(1,t.position),s}function Vf(n,t,e,i){const{labelSize:s,padding:r}=t,o=n.w*i.dx,a=n.h*i.dy,l=o>0&&(s.w/2+r.left-i.x)/o,c=a>0&&(s.h/2+r.top-i.y)/a;return Xr(Math.max(l,c),0,.25)}function Uk(n,t){const{x:e,x2:i,y:s,y2:r}=n,o=Math.min(s,r)-t.top,a=Math.min(e,i)-t.left,l=t.bottom-Math.max(s,r),c=t.right-Math.max(e,i);return{x:Math.min(a,c),y:Math.min(o,l),dx:a<=c?1:-1,dy:o<=l?1:-1}}function $f(n,t){const{size:e,min:i,max:s,padding:r}=t,o=e/2;return e>s-i?(s+i)/2:(i>=n-r-o&&(n=i+r+o),s<=n+r+o&&(n=s-r-o),n)}function Uf(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:Xf(n,e),endAdjust:Xf(n,i)}}function Xf(n,t){if(!t||!t.display)return 0;const{length:e,width:i}=t,s=n.options.borderWidth/2,r={x:e,y:i+s};return Math.abs(ll(0,r,{x:0,y:s}))}function dl(n,t,e,i){if(!i||!i.display)return;const{length:s,width:r,fill:o,backgroundColor:a,borderColor:l}=i,c=Math.abs(t-s)+e;n.beginPath(),Ti(n,i),on(n,i),n.moveTo(c,-r),n.lineTo(t+e,0),n.lineTo(c,r),o===!0?(n.fillStyle=a||l,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=i.borderShadowColor,n.stroke()}function Xk(n,t,e){const{x:i,y:s,x2:r,y2:o,centerX:a,centerY:l}=n,c=Math.atan2(o-s,r-i),u=nl(t.controlPoint,0),d={x:a+Tn(e,u.x,!1),y:l+Tn(e,u.y,!1)};return Kn(d,{x:a,y:l},c)}function qf(n,{x:t,y:e},{angle:i,adjust:s},r){!r||!r.display||(n.save(),n.translate(t,e),n.rotate(i),dl(n,0,-s,r),n.restore())}function qk(n,t,e,i){const{x:s,y:r,x2:o,y2:a,options:l}=t,{startOpts:c,endOpts:u,startAdjust:d,endAdjust:f}=Uf(t),g={x:s,y:r},p={x:o,y:a},y=Wf(g,e,p,0),x=Wf(g,e,p,1)-ct,v=cl(g,e,p,d/i),M=cl(g,e,p,1-f/i),D=new Path2D;n.beginPath(),D.moveTo(v.x,v.y),D.quadraticCurveTo(e.x,e.y,M.x,M.y),n.shadowColor=l.borderShadowColor,n.stroke(D),t.path=D,t.ctx=n,qf(n,v,{angle:y,adjust:d},c),qf(n,M,{angle:x,adjust:f},u)}class Rs extends Jt{inRange(t,e,i,s){const r=this.options.rotation,o=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return Gk({x:t,y:e},this.getProps(["width","height","centerX","centerY"],s),r,o);const{x:a,y:l,x2:c,y2:u}=this.getProps(["x","y","x2","y2"],s),d=i==="y"?{start:l,end:u}:{start:a,end:c},f=Kn({x:t,y:e},this.getCenterPoint(s),$t(-r));return f[i]>=d.start-o-Zn&&f[i]<=d.end+o+Zn}getCenterPoint(t){return Qn(this,t)}draw(t){const{width:e,height:i,centerX:s,centerY:r,options:o}=this;t.save(),Gr(t,this.getCenterPoint(),o.rotation),Ti(t,this.options),t.beginPath(),t.fillStyle=o.backgroundColor;const a=on(t,o);t.ellipse(s,r,i/2,e/2,ct/2,0,2*ct),t.fill(),a&&(t.shadowColor=o.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Of(t,e)}}Rs.id="ellipseAnnotation",Rs.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},Pi.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},Rs.defaultRoutes={borderColor:"color",backgroundColor:"color"},Rs.descriptors={label:{_fallback:!0}};function Gk(n,t,e,i){const{width:s,height:r,centerX:o,centerY:a}=t,l=s/2,c=r/2;if(l<=0||c<=0)return!1;const u=$t(e||0),d=Math.cos(u),f=Math.sin(u),g=Math.pow(d*(n.x-o)+f*(n.y-a),2),p=Math.pow(f*(n.x-o)-d*(n.y-a),2);return g/Math.pow(l+i,2)+p/Math.pow(c+i,2)<=1.0001}class Jr extends Jt{inRange(t,e,i,s){const{x:r,y:o,x2:a,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],s),u=(this.options.borderWidth+this.options.hitTolerance)/2;return i!=="x"&&i!=="y"?jM({x:t,y:e},this.getCenterPoint(s),c/2,u):uf(i==="y"?{start:o,end:l,value:e}:{start:r,end:a,value:t},u)}getCenterPoint(t){return Qn(this,t)}draw(t){const e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,Ti(t,e);const s=on(t,e);ZM(t,this,this.centerX,this.centerY),s&&!qr(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=Pf(t,e);return i.initProperties=Si(t,i,e),i}}Jr.id="pointAnnotation",Jr.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance: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},Jr.defaultRoutes={borderColor:"color",backgroundColor:"color"};class to extends Jt{inRange(t,e,i,s){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&Zk(this.elements,t,e,s);const r=Kn({x:t,y:e},this.getCenterPoint(s),$t(-this.options.rotation)),o=this.elements.map(c=>i==="y"?c.bY:c.bX),a=Math.min(...o),l=Math.max(...o);return r[i]>=a&&r[i]<=l}getCenterPoint(t){return Qn(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Ti(t,i);const s=on(t,i);let r=!0;for(const o of e)r?(t.moveTo(o.x,o.y),r=!1):t.lineTo(o.x,o.y);t.closePath(),t.fill(),s&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,e){const i=Pf(t,e),{sides:s,rotation:r}=e,o=[],a=2*ct/s;let l=r*Co;for(let c=0;c<s;c++,l+=a){const u=Kk(i,e,l);u.initProperties=Si(t,i,e),o.push(u)}return i.elements=o,i}}to.id="polygonAnnotation",to.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance: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},to.defaultRoutes={borderColor:"color",backgroundColor:"color"};function Kk({centerX:n,centerY:t},{radius:e,borderWidth:i,hitTolerance:s},r){const o=(i+s)/2,a=Math.sin(r),l=Math.cos(r),c={x:n+a*e,y:t-l*e};return{type:"point",optionScope:"point",properties:{x:c.x,y:c.y,centerX:c.x,centerY:c.y,bX:n+a*(e+o),bY:t-l*(e+o)}}}function Zk(n,t,e,i){let s=!1,r=n[n.length-1].getProps(["bX","bY"],i);for(const o of n){const a=o.getProps(["bX","bY"],i);a.bY>e!=r.bY>e&&t<(r.bX-a.bX)*(e-a.bY)/(r.bY-a.bY)+a.bX&&(s=!s),r=a}return s}const Cn={box:Pi,doughnutLabel:Qr,ellipse:Rs,label:Os,line:As,point:Jr,polygon:to};Object.keys(Cn).forEach(n=>{At.describe(`elements.${Cn[n].id}`,{_fallback:"plugins.annotation.common"})});const Qk={update:Object.assign},Jk=ol.concat(Zr),Gf=(n,t)=>ht(t)?gl(n,t):n,hl=n=>n==="color"||n==="font";function fl(n="line"){return Cn[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function tD(n,t,e,i){const s=nD(n,e.animations,i),r=t.annotations,o=rD(t.elements,r);for(let a=0;a<r.length;a++){const l=r[a],c=Kf(o,a,l.type),u=l.setContext(sD(n,c,o,l)),d=c.resolveElementProperties(n,u);d.skip=eD(d),"elements"in d&&(iD(c,d.elements,u,s),delete d.elements),ge(c.x)||Object.assign(c,d),Object.assign(c,d.initProperties),d.options=Zf(u),s.update(c,d)}}function eD(n){return isNaN(n.x)||isNaN(n.y)}function nD(n,t,e){return e==="reset"||e==="none"||e==="resize"?Qk:new Yo(n,t)}function iD(n,t,e,i){const s=n.elements||(n.elements=[]);s.length=t.length;for(let r=0;r<t.length;r++){const o=t[r],a=o.properties,l=Kf(s,r,o.type,o.initProperties),c=e[o.optionScope].override(o);a.options=Zf(c),i.update(l,a)}}function Kf(n,t,e,i){const s=Cn[fl(e)];let r=n[t];return(!r||!(r instanceof s))&&(r=n[t]=new s,Object.assign(r,i)),r}function Zf(n){const t=Cn[fl(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,gl(n,t.defaults),gl(n,t.defaultRoutes));for(const i of Jk)e[i]=n[i];return e}function gl(n,t){const e={};for(const i of Object.keys(t)){const s=t[i],r=n[i];hl(i)&&kt(r)?e[i]=r.map(o=>Gf(o,s)):e[i]=Gf(r,s)}return e}function sD(n,t,e,i){return t.$context||(t.$context=Object.assign(Object.create(n.getContext()),{element:t,get elements(){return e.filter(s=>s&&s.options)},id:i.id,type:"annotation"}))}function rD(n,t){const e=t.length,i=n.length;if(i<e){const s=e-i;n.splice(i,0,...new Array(s))}else i>e&&n.splice(e,i-e);return n}var oD="3.1.0";const Pn=new Map,Qf=n=>n.type!=="doughnutLabel",aD=ol.concat(Zr);var Jf={id:"annotation",version:oD,beforeRegister(){VM("chart.js","4.0",Se.version)},afterRegister(){Se.register(Cn)},afterUnregister(){Se.unregister(Cn)},beforeInit(n){Pn.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=Pn.get(n),s=i.annotations=[];let r=e.annotations;ht(r)?Object.keys(r).forEach(o=>{const a=r[o];ht(a)&&(a.id=o,s.push(a))}):kt(r)&&s.push(...r),kk(s.filter(Qf),n.scales)},afterDataLimits(n,t){const e=Pn.get(n);Mk(n,t.scale,e.annotations.filter(Qf).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=Pn.get(n);bk(n,i,e),tD(n,i,e,t.mode),i.visibleElements=i.elements.filter(s=>!s.skip&&s.options.display),vk(n,i,e)},beforeDatasetsDraw(n,t,e){Is(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){Is(n,"afterDatasetsDraw",e.clip)},beforeDatasetDraw(n,t,e){Is(n,t.index,e.clip)},beforeDraw(n,t,e){Is(n,"beforeDraw",e.clip)},afterDraw(n,t,e){Is(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const i=Pn.get(n);_k(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){Pn.delete(n)},getAnnotations(n){const t=Pn.get(n);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(n,t,e){return tl(n,t,e)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"},colors:{properties:["backgroundColor","borderColor"],type:"color"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:n=>!aD.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${Cn[fl(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:hl,_fallback:!0},_indexable:hl}},additionalOptionScopes:[""]};function Is(n,t,e){const{ctx:i,chartArea:s}=n,r=Pn.get(n);e&&Ki(i,s);const o=lD(r.visibleElements,t).sort((a,l)=>a.element.options.z-l.element.options.z);for(const a of o)cD(i,s,r,a);e&&Zi(i)}function lD(n,t){const e=[];for(const i of n)if(i.options.drawTime===t&&e.push({element:i,main:!0}),i.elements&&i.elements.length)for(const s of i.elements)s.options.display&&s.options.drawTime===t&&e.push({element:s});return e}function cD(n,t,e,i){const s=i.element;i.main?(Lf(e,s,"beforeDraw"),s.draw(n,t),Lf(e,s,"afterDraw")):s.draw(n,t)}const uD={class:"zoom-timerange-container"},dD={class:"zoom-timerange-details"},hD={class:"label"},fD={class:"label"},gD=h.defineComponent({__name:"ZoomTimerange",props:{start:{},end:{}},setup(n){const t=n,{i18n:e}=bt.useI18n(),i=h.ref(Mi(t.start.getTime())),s=h.ref(Mi(t.end.getTime())),r=(o,a)=>{Ca(()=>{i.value=Mi(o.getTime()),s.value=Mi(a.getTime())},100)()};return h.watch(()=>[t.start,t.end],([o,a])=>{r(o,a)},{immediate:!0}),(o,a)=>(h.openBlock(),h.createElementBlock("div",uD,[h.createElementVNode("div",dD,[h.createElementVNode("div",hD,h.toDisplayString(h.unref(e).t("zoom_time_range.from")),1),h.createElementVNode("div",null,h.toDisplayString(i.value),1),h.createElementVNode("div",fD,h.toDisplayString(h.unref(e).t("zoom_time_range.to")),1),h.createElementVNode("div",null,h.toDisplayString(s.value),1)])]))}}),Pe=(n,t)=>{const e=n.__vccOpts||n;for(const[i,s]of t)e[i]=s;return e},tg=Pe(gD,[["__scopeId","data-v-6557612f"]]),pD={class:"zoom-actions-container"},mD={class:"zoom-actions-heading"},yD=["aria-disabled","href"],bD=["onClick"],_D=Pe(h.defineComponent({__name:"ZoomActions",props:{zoomActionItems:{},newTimeRange:{}},emits:["onAction"],setup(n,{emit:t}){const e=n,i=t,s=r=>{r.action&&(r.action(e.newTimeRange),i("onAction"))};return(r,o)=>(h.openBlock(),h.createElementBlock("div",pD,[h.createElementVNode("div",mD,[h.createVNode(tg,{end:r.newTimeRange.end,start:r.newTimeRange.start},null,8,["end","start"]),h.createVNode(h.unref(wo.CloseIcon),{class:"zoom-actions-close-icon",color:h.unref(ef),size:h.unref(nf),onClick:o[0]||(o[0]=a=>r.$emit("onAction"))},null,8,["color","size"])]),o[2]||(o[2]=h.createElementVNode("div",{class:"zoom-actions-heading-divider"},null,-1)),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(r.zoomActionItems,a=>(h.openBlock(),h.createElementBlock("div",{key:a.label,class:h.normalizeClass(["zoom-action-item",{disabled:a.disabled}])},[a.href?(h.openBlock(),h.createElementBlock("a",{key:0,"aria-disabled":a.disabled,class:"zoom-action-link",href:a.href,onClick:o[1]||(o[1]=l=>r.$emit("onAction"))},h.toDisplayString(a.label),9,yD)):(h.openBlock(),h.createElementBlock("div",{key:1,onClick:l=>s(a)},h.toDisplayString(a.label),9,bD))],2))),128))]))}}),[["__scopeId","data-v-966b2a05"]]),xD={key:2},wD={class:"tooltip-title"},vD={class:"title"},MD={key:0,class:"subtitle"},kD={class:"context"},DD={class:"metric"},SD={class:"tooltip"},TD={key:0},CD={class:"display-value"},pl=Pe(h.defineComponent({__name:"ChartTooltip",props:{state:{},tooltipTitle:{default:""},absoluteLeft:{default:"0px"},absoluteTop:{default:"0px"},zoomTimeRange:{default:void 0},zoomActionItems:{default:void 0}},emits:["dimensions","onAction"],setup(n,{emit:t}){const e=t,i=n,s=h.ref(null),{x:r,y:o,isDragging:a}=IM(s,{initialValue:{x:parseFloat(i.absoluteLeft),y:parseFloat(i.absoluteTop)}}),l=h.computed(()=>`${o.value}px`),c=h.computed(()=>`${r.value}px`),u=h.computed(()=>i.state.tooltipContext),d=h.computed(()=>i.state.metricDisplay),f=h.computed(()=>["interactive","zoom-interactive"].includes(i.state.interactionMode));return h.watch(()=>[i.absoluteLeft,i.absoluteTop],([g,p])=>{a.value||(r.value=parseFloat(g),o.value=parseFloat(p))}),h.watch(a,g=>{g?document.body.classList.add("no-select"):document.body.classList.remove("no-select")}),h.watch(s,g=>{if(g){const{width:p,height:y}=g.getBoundingClientRect();e("dimensions",{width:p,height:y})}}),(g,p)=>{var y,x;return g.state.showTooltip?(h.openBlock(),h.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:s,class:h.normalizeClass(["tooltip-container",{locked:g.state.interactionMode==="interactive"}]),style:h.normalizeStyle({transform:f.value?`translate(${c.value}, ${l.value})`:`translate(${g.absoluteLeft}, ${g.absoluteTop})`,left:"0",top:"0",pointerEvents:f.value?"all":"none"})},[g.state.interactionMode==="selecting-chart-area"?(h.openBlock(),h.createBlock(tg,{key:0,end:(y=g.zoomTimeRange)==null?void 0:y.end,start:(x=g.zoomTimeRange)==null?void 0:x.start},null,8,["end","start"])):g.state.interactionMode==="zoom-interactive"&&g.zoomTimeRange&&g.zoomActionItems?(h.openBlock(),h.createBlock(_D,{key:1,"new-time-range":g.zoomTimeRange,"zoom-action-items":g.zoomActionItems,onOnAction:p[0]||(p[0]=v=>e("onAction"))},null,8,["new-time-range","zoom-action-items"])):(h.openBlock(),h.createElementBlock("div",xD,[h.createElementVNode("div",wD,[h.createElementVNode("div",vD,[h.createElementVNode("div",null,h.toDisplayString(g.tooltipTitle),1),f.value?(h.openBlock(),h.createBlock(h.unref(wo.DragIcon),{key:0,class:"drag-icon",color:h.unref(ef),size:h.unref(nf)},null,8,["color","size"])):h.createCommentVNode("",!0)]),u.value||d.value?(h.openBlock(),h.createElementBlock("div",MD,[h.createElementVNode("div",kD,h.toDisplayString(u.value),1),h.createElementVNode("div",DD,h.toDisplayString(d.value),1)])):h.createCommentVNode("",!0)]),h.createElementVNode("ul",SD,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(g.state.tooltipSeries,({backgroundColor:v,borderColor:M,label:D,value:S,isSegmentEmpty:C})=>(h.openBlock(),h.createElementBlock(h.Fragment,{key:D},[g.state.tooltipSeries.length?(h.openBlock(),h.createElementBlock("li",TD,[h.createElementVNode("div",{class:"square-marker",style:h.normalizeStyle({background:v,"border-color":M})},null,4),h.createElementVNode("span",{class:h.normalizeClass(["display-label",{empty:C}])},h.toDisplayString(D),3),h.createElementVNode("span",CD,h.toDisplayString(S),1)])):h.createCommentVNode("",!0)],64))),128))])]))],6)):h.createCommentVNode("",!0)}}}),[["__scopeId","data-v-bee6dd5b"]]),PD=["onClick"],OD={key:0,class:"sub-label"},ED={class:"tooltip-content"},ml=Pe(h.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){h.useCssVars(S=>({"6d3f1170":l.value}));const t=n,{i18n:e}=bt.useI18n(),i=h.ref(),s=h.ref([]),r=h.inject("showLegendValues",!0),o=h.inject("legendPosition",h.ref(Nt.Right)),a=h.ref([]),l=h.ref(sf),c=()=>{const S=i.value;if(!S||!s.value||S.children.length===0)return 0;const C=S.children[0].getBoundingClientRect().top;for(const R of s.value)if(R.getBoundingClientRect().top>C)return!0;return!1},u=h.computed(()=>t.items.length>2||o.value===Nt.Right),d=()=>{i.value&&o.value===Nt.Bottom&&(c()?l.value=yM:l.value=sf)},f=()=>{if(i.value&&o.value===Nt.Bottom){let S=0;s.value.forEach(R=>{const O=Array.from(R.children).reduce((b,_)=>b+_.offsetWidth,0);O>S&&(S=O)});const C=parseInt(mM,10);i.value.style.gridTemplateColumns=`repeat(auto-fit, ${S+C}px)`}d()},g=()=>{if(t.items.length!==a.value.length)return a.value=t.items,!0;for(let S=0;S<t.items.length;S++)if(t.items[S].text!==a.value[S].text)return a.value=t.items,!0;return!1};h.watch(()=>t.items,()=>{g()&&f()},{immediate:!0,flush:"post"});const p=h.ref(0),y=h.ref(0),x=new ResizeObserver(Ca(S=>{const C=S[0],R=C.contentRect.width,O=C.contentRect.height;R!==p.value&&O===y.value&&f(),p.value=R,y.value=O},100));h.watch(()=>o.value,()=>{f()}),h.onMounted(()=>{a.value=t.items,i.value&&x.observe(i.value),window.requestAnimationFrame(()=>{f()})}),h.onBeforeUnmount(()=>{i.value&&x.unobserve(i.value)});const v=(S=0,C)=>{if(t.chartInstance===null)return;const R=t.chartInstance instanceof Se?t.chartInstance:t.chartInstance.chart;M(S,C)?R.hide(S,C):R.show(S,C),R.update()},M=(S=0,C)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const R=t.chartInstance instanceof Se?t.chartInstance:t.chartInstance.chart,O=R.getDatasetMeta(S);return O.dataset||C===void 0?R.isDatasetVisible(S):!(O.data.length&&O.data[C].hidden)},D=S=>({[Nt.Right]:"vertical",[Nt.Bottom]:"horizontal",[Nt.Hidden]:"hidden"})[S];return(S,C)=>{const R=h.resolveComponent("KTooltip");return h.unref(o)!==h.unref(Nt).Hidden?(h.openBlock(),h.createElementBlock("ul",{key:0,ref_key:"legendContainerRef",ref:i,class:h.normalizeClass(["legend-container",D(h.unref(o))]),"data-testid":"legend"},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.items,({fillStyle:O,strokeStyle:b,text:_,datasetIndex:T,index:I,value:P,isSegmentEmpty:F})=>(h.openBlock(),h.createElementBlock("li",{key:_,ref_for:!0,ref_key:"legendItemsRef",ref:s,onClick:U=>v(T,I)},[h.createElementVNode("div",{class:"square-marker",style:h.normalizeStyle({background:O,"border-color":b})},null,4),h.createVNode(R,null,h.createSlots({default:h.withCtx(()=>[h.createElementVNode("div",{class:h.normalizeClass(["label-container",{"strike-through":!M(T,I)}])},[h.createElementVNode("div",{class:h.normalizeClass(["label",{"truncate-label":u.value,empty:F}])},h.toDisplayString(_),3),P&&h.unref(r)?(h.openBlock(),h.createElementBlock("div",OD,h.toDisplayString(P.formatted),1)):h.createCommentVNode("",!0)],2)]),_:2},[F?{name:"content",fn:h.withCtx(()=>[h.createElementVNode("div",ED,h.toDisplayString(h.unref(e).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],8,PD))),128))],2)):h.createCommentVNode("",!0)}}}),[["__scopeId","data-v-2e13ddb3"]]),ne=[];for(let n=0;n<256;++n)ne.push((n+256).toString(16).slice(1));function AD(n,t=0){return(ne[n[t+0]]+ne[n[t+1]]+ne[n[t+2]]+ne[n[t+3]]+"-"+ne[n[t+4]]+ne[n[t+5]]+"-"+ne[n[t+6]]+ne[n[t+7]]+"-"+ne[n[t+8]]+ne[n[t+9]]+"-"+ne[n[t+10]]+ne[n[t+11]]+ne[n[t+12]]+ne[n[t+13]]+ne[n[t+14]]+ne[n[t+15]]).toLowerCase()}let yl;const RD=new Uint8Array(16);function ID(){if(!yl){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");yl=crypto.getRandomValues.bind(crypto)}return yl(RD)}const eg={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function eo(n,t,e){var s;if(eg.randomUUID&&!n)return eg.randomUUID();n=n||{};const i=n.random??((s=n.rng)==null?void 0:s.call(n))??ID();if(i.length<16)throw new Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,AD(i)}const ng=(n,t)=>{const e=n.ctx,i=n.scales.y,s=n.scales.x,r=t[t.length-1].element;e.save(),e.strokeStyle="rgba(100, 100, 100, 1)",e.lineWidth=3,n.options.indexAxis==="x"?e.strokeRect(r.x-r.width/2,r.y,r.width,i.bottom-r.y):e.strokeRect(s.left,r.y-r.height/2,r.x-s.left,r.height),e.restore()};class ig{constructor(){E(this,"id","highlightPlugin");E(this,"_clickedElements");E(this,"_previousHoverOption");E(this,"_clicked",!1);E(this,"_pause",!1);E(this,"_suppressNextClick",!1)}afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&ng(t,this._clickedElements)}afterEvent(t,{event:e}){var r;if(e.type==="click"&&this._suppressNextClick){this._suppressNextClick=!1;return}if(e.type!=="click"||!e.native||this._pause)return;this._clicked=!this._clicked;const i=((r=t.options.interaction)==null?void 0:r.mode)||"index",s=t.getElementsAtEventForMode(e.native,i,{intersect:!1},!0);s.length&&this._clicked?(this._clickedElements=s,ng(t,this._clickedElements),this._previousHoverOption=t.options.hover,t.options.hover={mode:null}):(delete this._clickedElements,t.options.hover=this._previousHoverOption||t.options.hover,this._clicked=!1)}beforeDestroy(t){delete this._clickedElements,t.options.hover=this._previousHoverOption||t.options.hover,this._clicked=!1}pause(){this._pause=!0}get isPaused(){return this._pause}resume(t=!1){this._pause=!1,t&&(this._suppressNextClick=!0)}}const LD=["id"],ND=["id"],FD={class:"axis-tooltip-content"},sg=6,zD="100%",BD="100%",HD=20,WD=20,rg=6,YD=0,jD=10,VD=10,$D=1,UD=Pe(h.defineComponent({__name:"StackedBarChart",props:{chartData:{},tooltipTitle:{default:""},legendValues:{default:void 0},metricUnit:{default:""},orientation:{default:"horizontal"},annotations:{type:Boolean,default:!0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},stacked:{type:Boolean,default:!0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},tooltipMetricDisplay:{default:""}},setup(n){const t=n,{i18n:e}=bt.useI18n(),{translateUnit:i}=bt.useTranslatedUnits(),s=crypto.randomUUID(),r=crypto.randomUUID(),o=new ig,a=h.useTemplateRef("chartContainer"),l=h.useTemplateRef("chartParent"),c=({chart:H},j)=>{var tt;const Y=H.data,Z=(tt=Y.labels)==null?void 0:tt.indexOf(j);return Y.datasets.reduce((et,it,nt)=>{if(H.isDatasetVisible(nt)){const xt=it.data[Z];return isNaN(xt)?et:et+xt}else return et},0)},u=(H,j,Y,Z)=>{const tt=Z==="horizontal";j===null&&(j=e.t("entityNoName"));const et={type:"label",yValue:xt=>tt?j:c(xt,j),xValue:xt=>tt?c(xt,j):j},it={...et,position:tt?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>tt?0:-Math.abs(Mw()),content:xt=>Aa(c(xt,j),Y)},nt={...et,content:xt=>oh(c(xt,j),rh(xt.chart,H)),position:tt?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:xt=>tt?sh(Aa(c(xt,j),Y)):0,color:eh};return{[`${j}-value`]:it,[`${j}-percent`]:nt}},d=h.useTemplateRef("canvas"),f=h.useTemplateRef("axis"),g=eo(),p=eo(),y=eo(),x=h.ref([]),v=h.inject("legendPosition",Nt.Right),M=h.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),D=h.toRef(t,"metricUnit"),S=h.computed(()=>t.orientation==="horizontal"),C=h.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:t.tooltipMetricDisplay,dimensionDisplay:t.dimensionAxesTitle,tooltipSeries:[],left:"",top:"",units:t.metricUnit,translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,interactionMode:"idle",chartType:S.value?"horizontal_bar":"vertical_bar",chartID:r,chartTooltipSortFn:t.chartTooltipSortFn}),{tooltipAbsoluteLeft:R,tooltipAbsoluteTop:O}=bt.useTooltipAbsolutePosition(l,C),b=h.ref(0),_=()=>{var H;return t.annotations&&((H=t.chartData.labels)==null?void 0:H.reduce((j,Y)=>Object.assign(j,u(t.chartData,Y,D.value,t.orientation)),{}))},T={id:g,afterUpdate(H){b.value+=1,x.value=Kd(H,t.legendValues,t.chartLegendSortFn)}},I={id:p,afterUpdate(H){H.options.plugins.annotation.annotations=t.annotations?_():{}}},U=[T,{id:"axisHover",afterEvent(H,j){var Y;if(M.show=!1,j.event.type==="mousemove"){const Z=j.event,tt=H.options.indexAxis,et=H.scales,it=H.scales[tt].getLabelForValue(Number(H.scales[tt].getValueForPixel(Z[tt]))),xt=H.scales[tt].getLabels().indexOf(it),at=(Y=t.chartData.isLabelEmpty)==null?void 0:Y[xt];if((te=>te==="x"?Z.y>et.x.top:Z.x<et.y.right)(tt)){C.interactionMode!=="interactive"&&(C.showTooltip=!1);const ae=H.canvas.getContext("2d").measureText(it).width,Xt=Math.abs(Math.round(Z.x-ae*.5)),Oe=Math.round(Z.x+ae*.5),Mt=H.canvas.getBoundingClientRect(),qt=40;M.left=tt==="x"?`${(Xt>0?Xt:Oe)-M.offset+Mt.left}px`:`${Z.x-ae*.5-M.offset+Mt.left}px`,M.top=`${Z.y-qt+Mt.top}px`,it.length>Rr?(M.show=!0,M.text=it):at?(M.text=e.t("emptyEntityInfo"),M.show=!0):M.show=!1}else M.show=!1}}},{id:y,afterUpdate(H){H.options.layout.padding.right=S.value?B.value:0}},o,...t.annotations?[I]:[]],X=h.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),Q=h.ref(0),$=h.ref(0),ut=new ResizeObserver(Ca(H=>{Q.value=H[0].contentRect.width,$.value=H[0].contentRect.height},100)),V=h.computed(()=>{var j,Y;const H=(Y=(j=t.chartData)==null?void 0:j.labels)==null?void 0:Y.length;return d.value&&H&&!S.value?`${Math.max(H*(HD+rg),Q.value)}px`:zD}),G=h.computed(()=>{var j,Y;const H=(Y=(j=t.chartData)==null?void 0:j.labels)==null?void 0:Y.length;return d.value&&H&&S.value?`${Math.max(H*(WD+rg),$.value)}px`:BD});bt.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey")),h.onMounted(()=>{t.annotations&&Se.register(Jf),a.value&&(Q.value=a.value.offsetWidth,$.value=a.value.offsetHeight,ut.observe(a.value))}),h.onUnmounted(()=>{a.value&&ut.unobserve(a.value)});const J=h.computed(()=>{const H=bt.useBarChartOptions({tooltipState:C,legendID:g,stacked:h.toRef(t,"stacked"),metricAxesTitle:h.toRef(t,"metricAxesTitle"),dimensionAxesTitle:h.toRef(t,"dimensionAxesTitle"),indexAxis:S.value?"y":"x",numLabels:X});return{...H.value,plugins:{...H.value.plugins,annotation:{annotations:_(),clip:!1}},layout:{autoPadding:!1,padding:{right:0,top:6*sg}}}}),z=bt.useChartJSCommon("bar",d,h.toRef(t,"chartData"),U,J),B=h.computed(()=>{b.value;const H=t.chartData.labels,j=t.chartData.datasets,Y=H.map((et,it)=>j.reduce((nt,xt)=>isNaN(Number(xt.data[it]))?nt:nt+Number(xt.data[it]),0)),Z=z.value?rh(z.value,t.chartData):kw(t.chartData);return Y.map(et=>sh(Aa(et,D.value)+oh(et,Z))).reduce((et,it)=>Math.max(et,it),0)+sg});h.onBeforeUnmount(()=>{Se.unregister(Jf)});const ft={[Nt.Right]:"legend-row",[Nt.Bottom]:"column"},yt=h.computed(()=>{if(f.value&&z.value){const H=window.devicePixelRatio,j=z.value,Y=j.scales.y.width*H+$D,Z=(j.scales.y.height+j.scales.y.top+j.scales.x.height)*H,tt=f.value.getContext("2d");return tt.scale(H,H),tt.canvas.width=Y,tt.canvas.height=Z,tt.canvas.style.width=`${Y/H}px`,tt.canvas.style.height=`${Z/H}px`,{scale:H,width:Y*H,height:Z*H,targetCtx:tt}}return null}),vt=H=>{const j=H.target;if(yt.value&&z.value&&!S.value){const Y=yt.value.scale,Z=yt.value.targetCtx,tt=yt.value.width,et=yt.value.height,it=z.value,nt=it.canvas;Z.fillStyle="white",j.scrollLeft>=YD&&j.scrollLeft<=jD?(Z.globalCompositeOperation="source-over",Z.clearRect(0,0,tt,et),Z.drawImage(nt,0,0,tt,et,0,0,tt,et),Z.globalCompositeOperation="destination-over",Z.fillRect(0,0,tt,et)):(Z.globalCompositeOperation="source-over",Z.fillRect(0,(it.scales.y.height+it.scales.y.top+VD)*Y,tt,it.scales.x.height*Y))}C.offsetY=j.scrollTop,C.offsetX=j.scrollLeft,M.offset=j.scrollLeft},gt=({width:H,height:j})=>{C.width=H,C.height=j};h.watch(()=>t.orientation,()=>{var H;if(f.value&&yt.value){const j=yt.value.width,Y=yt.value.height;((H=f.value)==null?void 0:H.getContext("2d")).clearRect(0,0,j,Y)}C.showTooltip=!1,C.interactionMode="idle"}),h.watch(()=>t.annotations,H=>{z.value&&(H?z.value.options.plugins.annotation.annotations=_(t.chartData):delete z.value.options.plugins.annotation.annotations)});const pt=()=>{C.showTooltip&&(C.interactionMode!=="idle"?C.interactionMode="idle":C.interactionMode="interactive")};return(H,j)=>(h.openBlock(),h.createElementBlock("div",{ref:"chartParent",class:h.normalizeClass(["chart-parent",ft[h.unref(v)]])},[h.createElementVNode("canvas",{id:h.unref(s),ref:"axis",class:"axis"},null,8,LD),h.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:j[0]||(j[0]=Y=>pt()),onScroll:vt},[h.createElementVNode("div",{class:"chart-body",style:h.normalizeStyle({width:V.value,height:G.value})},[h.createElementVNode("canvas",{id:h.unref(r),ref:"canvas",class:"chart-canvas"},null,8,ND)],4)],544),(h.openBlock(),h.createBlock(h.Teleport,{to:"body"},[M.show?(h.openBlock(),h.createElementBlock("div",{key:0,class:"axis-tooltip",style:h.normalizeStyle({top:M.top,left:M.left}),width:"auto"},[h.createElementVNode("div",FD,h.toDisplayString(M.text),1)],4)):h.createCommentVNode("",!0),h.createVNode(pl,{"absolute-left":h.unref(R),"absolute-top":h.unref(O),"chart-parent-ref":l.value,state:C,"tooltip-title":H.tooltipTitle,onDimensions:gt},null,8,["absolute-left","absolute-top","chart-parent-ref","state","tooltip-title"])])),h.createVNode(ml,{id:h.unref(g),"chart-instance":h.unref(z),items:x.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-acf2a980"]]);/*!
|
|
23
|
+
*/const cf={modes:{point(n,t){return Ur(n,t,{intersect:!0})},nearest(n,t,e){return HM(n,t,e)},x(n,t,e){return Ur(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return Ur(n,t,{intersect:e.intersect,axis:"y"})}}};function tl(n,t,e){return(cf.modes[e.mode]||cf.modes.nearest)(n,t,e)}function zM(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 BM(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function Ur(n,t,e){return n.filter(i=>e.intersect?i.inRange(t.x,t.y):zM(i,t,e.axis))}function HM(n,t,e){let i=Number.POSITIVE_INFINITY;return Ur(n,t,e).reduce((s,r)=>{const o=r.getCenterPoint(),a=BM(t,o,e.axis),l=ui(t,a);return l<i?(s=[r],i=l):l===i&&s.push(r),s},[]).sort((s,r)=>s._index-r._index).slice(0,1)}function Kn(n,t,e){const i=Math.cos(e),s=Math.sin(e),r=t.x,o=t.y;return{x:r+i*(n.x-r)-s*(n.y-o),y:o+s*(n.x-r)+i*(n.y-o)}}const WM=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,Zn=.001,Xr=(n,t,e)=>Math.min(e,Math.max(t,n)),uf=(n,t)=>n.value>=n.start-t&&n.value<=n.end+t;function YM(n,t,e){for(const i of Object.keys(n))n[i]=Xr(n[i],t,e);return n}function jM(n,t,e,i){return!n||!t||e<=0?!1:Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2)<=Math.pow(e+i,2)}function df(n,{x:t,y:e,x2:i,y2:s},r,{borderWidth:o,hitTolerance:a}){const l=(o+a)/2,c=n.x>=t-l-Zn&&n.x<=i+l+Zn,u=n.y>=e-l-Zn&&n.y<=s+l+Zn;return r==="x"?c:(r==="y"||c)&&u}function hf(n,{rect:t,center:e},i,{rotation:s,borderWidth:r,hitTolerance:o}){const a=Kn(n,e,$t(-s));return df(a,t,i,{borderWidth:r,hitTolerance:o})}function Qn(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function VM(n,t,e,i=!0){const s=e.split(".");let r=0;for(const o of t.split(".")){const a=s[r++];if(parseInt(o,10)<parseInt(a,10))break;if(WM(a,o)){if(i)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const ff=n=>typeof n=="string"&&n.endsWith("%"),gf=n=>parseFloat(n)/100,pf=n=>Xr(gf(n),0,1),Ps=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),$M={box:n=>Ps(n.centerX,n.centerY),doughnutLabel:n=>Ps(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>Ps(n.centerX,n.centerY),line:n=>Ps(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>Ps(n.centerX,n.centerY)};function el(n,t){return t==="start"?0:t==="end"?n:ff(t)?pf(t)*n:n/2}function Tn(n,t,e=!0){return typeof t=="number"?t:ff(t)?(e?pf(t):gf(t))*n:n}function UM(n,t){const{x:e,width:i}=n,s=t.textAlign;return s==="center"?e+i/2:s==="end"||s==="right"?e+i:e}function mf(n,t,{borderWidth:e,position:i,xAdjust:s,yAdjust:r},o){const a=ht(o),l=t.width+(a?o.width:0)+e,c=t.height+(a?o.height:0)+e,u=nl(i),d=xf(n.x,l,s,u.x),f=xf(n.y,c,r,u.y);return{x:d,y:f,x2:d+l,y2:f+c,width:l,height:c,centerX:d+l/2,centerY:f+c/2}}function nl(n,t="center"){return ht(n)?{x:rt(n.x,t),y:rt(n.y,t)}:(n=rt(n,t),{x:n,y:n})}const yf=(n,t)=>n&&n.autoFit&&t<1;function bf(n,t){const e=n.font,i=kt(e)?e:[e];return yf(n,t)?i.map(function(s){const r=It(s);return r.size=Math.floor(s.size*t),r.lineHeight=s.lineHeight,It(r)}):i.map(s=>It(s))}function _f(n){return n&&(ge(n.xValue)||ge(n.yValue))}function xf(n,t,e=0,i){return n-el(t,i)+e}function Si(n,t,e){const i=e.init;if(i){if(i===!0)return vf(t,e)}else return;return XM(n,t,e)}function wf(n,t,e){let i=!1;return t.forEach(s=>{pe(n[s])?(i=!0,e[s]=n[s]):ge(e[s])&&delete e[s]}),i}function vf(n,t){const e=t.type||"line";return $M[e](n)}function XM(n,t,e){const i=Dt(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return vf(t,e);if(ht(i))return i}const il=new Map,qM=n=>isNaN(n)||n<=0,GM=n=>n.reduce(function(t,e){return t+=e.string,t},"");function qr(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function Gr(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate($t(i)),n.translate(-t,-e))}function on(n,t){if(t&&t.borderWidth)return n.lineCap=t.borderCapStyle||"butt",n.setLineDash(t.borderDash),n.lineDashOffset=t.borderDashOffset,n.lineJoin=t.borderJoinStyle||"miter",n.lineWidth=t.borderWidth,n.strokeStyle=t.borderColor,!0}function Ti(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function Kr(n,t){const e=t.content;if(qr(e))return{width:Tn(e.width,t.width),height:Tn(e.height,t.height)};const i=bf(t),s=t.textStrokeWidth,r=kt(e)?e:[e],o=r.join()+GM(i)+s+(n._measureText?"-spriting":"");return il.has(o)||il.set(o,JM(n,r,i,s)),il.get(o)}function Mf(n,t,e){const{x:i,y:s,width:r,height:o}=t;n.save(),Ti(n,e);const a=on(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),di(n,{x:i,y:s,w:r,h:o,radius:YM(xn(e.borderRadius),0,Math.min(r,o)/2)}),n.closePath(),n.fill(),a&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function kf(n,t,e,i){const s=e.content;if(qr(s)){n.save(),n.globalAlpha=nk(e.opacity,s.style.opacity),n.drawImage(s,t.x,t.y,t.width,t.height),n.restore();return}const r=kt(s)?s:[s],o=bf(e,i),a=e.color,l=kt(a)?a:[a],c=UM(t,e),u=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,KM(n,e)&&tk(n,{x:c,y:u},r,o),ek(n,{x:c,y:u},r,{fonts:o,colors:l}),n.restore()}function KM(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function ZM(n,t,e,i){const{radius:s,options:r}=t,o=r.pointStyle,a=r.rotation;let l=(a||0)*Co;if(qr(o)){n.save(),n.translate(e,i),n.rotate(l),n.drawImage(o,-o.width/2,-o.height/2,o.width,o.height),n.restore();return}qM(s)||QM(n,{x:e,y:i,radius:s,rotation:a,style:o,rad:l})}function QM(n,{x:t,y:e,radius:i,rotation:s,style:r,rad:o}){let a,l,c,u;switch(n.beginPath(),r){default:n.arc(t,e,i,0,Ot),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(o)*i,e-Math.cos(o)*i),o+=Qs,n.lineTo(t+Math.sin(o)*i,e-Math.cos(o)*i),o+=Qs,n.lineTo(t+Math.sin(o)*i,e-Math.cos(o)*i),n.closePath();break;case"rectRounded":u=i*.516,c=i-u,a=Math.cos(o+De)*c,l=Math.sin(o+De)*c,n.arc(t-a,e-l,u,o-ct,o-Et),n.arc(t+l,e-a,u,o-Et,o),n.arc(t+a,e+l,u,o,o+Et),n.arc(t-l,e+a,u,o+Et,o+ct),n.closePath();break;case"rect":if(!s){c=Math.SQRT1_2*i,n.rect(t-c,e-c,2*c,2*c);break}o+=De;case"rectRot":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+l,e-a),n.lineTo(t+a,e+l),n.lineTo(t-l,e+a),n.closePath();break;case"crossRot":o+=De;case"cross":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a);break;case"star":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a),o+=De,a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a);break;case"line":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l);break;case"dash":n.moveTo(t,e),n.lineTo(t+Math.cos(o)*i,e+Math.sin(o)*i);break}n.fill()}function JM(n,t,e,i){n.save();const s=t.length;let r=0,o=i;for(let a=0;a<s;a++){const l=e[Math.min(a,e.length-1)];n.font=l.string;const c=t[a];r=Math.max(r,n.measureText(c).width+i),o+=l.lineHeight}return n.restore(),{width:r,height:o}}function tk(n,{x:t,y:e},i,s){n.beginPath();let r=0;i.forEach(function(o,a){const l=s[Math.min(a,s.length-1)],c=l.lineHeight;n.font=l.string,n.strokeText(o,t,e+c/2+r),r+=c}),n.stroke()}function ek(n,{x:t,y:e},i,{fonts:s,colors:r}){let o=0;i.forEach(function(a,l){const c=r[Math.min(l,r.length-1)],u=s[Math.min(l,s.length-1)],d=u.lineHeight;n.beginPath(),n.font=u.string,n.fillStyle=c,n.fillText(a,t,e+d/2+o),o+=d,n.fill()})}function nk(n,t){const e=_n(n)?n:t;return _n(e)?Xr(e,0,1):1}const Df=["left","bottom","top","right"];function ik(n,t){const{pointX:e,pointY:i,options:s}=t,r=s.callout,o=r&&r.display&&lk(t,r);if(!o||uk(t,r,o))return;if(n.save(),n.beginPath(),!on(n,r))return n.restore();const{separatorStart:l,separatorEnd:c}=sk(t,o),{sideStart:u,sideEnd:d}=ok(t,o,l);(r.margin>0||s.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=Kn({x:e,y:i},t.getCenterPoint(),$t(-t.rotation));n.lineTo(f.x,f.y),n.stroke(),n.restore()}function sk(n,t){const{x:e,y:i,x2:s,y2:r}=n,o=rk(n,t);let a,l;return t==="left"||t==="right"?(a={x:e+o,y:i},l={x:a.x,y:r}):(a={x:e,y:i+o},l={x:s,y:a.y}),{separatorStart:a,separatorEnd:l}}function rk(n,t){const{width:e,height:i,options:s}=n,r=s.callout.margin+s.borderWidth/2;return t==="right"?e+r:t==="bottom"?i+r:-r}function ok(n,t,e){const{y:i,width:s,height:r,options:o}=n,a=o.callout.start,l=ak(t,o.callout);let c,u;return t==="left"||t==="right"?(c={x:e.x,y:i+Tn(r,a)},u={x:c.x+l,y:c.y}):(c={x:e.x+Tn(s,a),y:e.y},u={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:u}}function ak(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function lk(n,t){const e=t.position;return Df.includes(e)?e:ck(n,t)}function ck(n,t){const{x:e,y:i,x2:s,y2:r,width:o,height:a,pointX:l,pointY:c,centerX:u,centerY:d,rotation:f}=n,g={x:u,y:d},p=t.start,y=Tn(o,p),x=Tn(a,p),v=[e,e+y,e+y,s],M=[i+x,r,i,r],D=[];for(let S=0;S<4;S++){const P=Kn({x:v[S],y:M[S]},g,$t(f));D.push({position:Df[S],distance:ui(P,{x:l,y:c})})}return D.sort((S,P)=>S.distance-P.distance)[0].position}function uk(n,t,e){const{pointX:i,pointY:s}=n,r=t.margin;let o=i,a=s;return e==="left"?o+=r:e==="right"?o-=r:e==="top"?a+=r:e==="bottom"&&(a-=r),n.inRange(o,a)}const Sf={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 Ci(n,t,e){return t=typeof t=="number"?t:n.parse(t),Rt(t)?n.getPixelForValue(t):e}function Jn(n,t,e){const i=t[e];if(i||e==="scaleID")return i;const s=e.charAt(0),r=Object.values(n).filter(o=>o.axis&&o.axis===s);return r.length?r[0].id:s}function Tf(n,t){if(n){const e=n.options.reverse,i=Ci(n,t.min,e?t.end:t.start),s=Ci(n,t.max,e?t.start:t.end);return{start:i,end:s}}}function Cf(n,t){const{chartArea:e,scales:i}=n,s=i[Jn(i,t,"xScaleID")],r=i[Jn(i,t,"yScaleID")];let o=e.width/2,a=e.height/2;return s&&(o=Ci(s,t.xValue,s.left+s.width/2)),r&&(a=Ci(r,t.yValue,r.top+r.height/2)),{x:o,y:a}}function sl(n,t){const e=n.scales,i=e[Jn(e,t,"xScaleID")],s=e[Jn(e,t,"yScaleID")];if(!i&&!s)return{};let{left:r,right:o}=i||n.chartArea,{top:a,bottom:l}=s||n.chartArea;const c=Ef(i,{min:t.xMin,max:t.xMax,start:r,end:o});r=c.start,o=c.end;const u=Ef(s,{min:t.yMin,max:t.yMax,start:l,end:a});return a=u.start,l=u.end,{x:r,y:a,x2:o,y2:l,width:o-r,height:l-a,centerX:r+(o-r)/2,centerY:a+(l-a)/2}}function Pf(n,t){if(!_f(t)){const e=sl(n,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(e.width,e.height)/2,t.radius=i);const s=i*2,r=e.centerX+t.xAdjust,o=e.centerY+t.yAdjust;return{x:r-i,y:o-i,x2:r+i,y2:o+i,centerX:r,centerY:o,width:s,height:s,radius:i}}return hk(n,t)}function dk(n,t){const{scales:e,chartArea:i}=n,s=e[t.scaleID],r={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return s?fk(s,r,t):gk(e,r,t),r}function Of(n,t){const e=sl(n,t);return e.initProperties=Si(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:yk(n,e,t),initProperties:e.initProperties}],e}function hk(n,t){const e=Cf(n,t),i=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:i,height:i}}function Ef(n,t){const e=Tf(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function fk(n,t,e){const i=Ci(n,e.value,NaN),s=Ci(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=s):(t.y=i,t.y2=s)}function gk(n,t,e){for(const i of Object.keys(Sf)){const s=n[Jn(n,e,i)];if(s){const{min:r,max:o,start:a,end:l,startProp:c,endProp:u}=Sf[i],d=Tf(s,{min:e[r],max:e[o],start:s[a],end:s[l]});t[c]=d.start,t[u]=d.end}}}function pk({properties:n,options:t},e,i,s){const{x:r,x2:o,width:a}=n;return Af({start:r,end:o,borderWidth:t.borderWidth},{position:i.x,padding:{start:s.left,end:s.right},adjust:t.label.xAdjust,size:e.width})}function mk({properties:n,options:t},e,i,s){const{y:r,y2:o,height:a}=n;return Af({start:r,end:o,borderWidth:t.borderWidth},{position:i.y,padding:{start:s.top,end:s.bottom},adjust:t.label.yAdjust,size:e.height})}function Af(n,t){const{start:e,end:i,borderWidth:s}=n,{position:r,padding:{start:o,end:a},adjust:l}=t,c=i-s-e-o-a-t.size;return e+s/2+l+el(c,r)}function yk(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const s=nl(i.position),r=Ut(i.padding),o=Kr(n.ctx,i),a=pk({properties:t,options:e},o,s,r),l=mk({properties:t,options:e},o,s,r),c=o.width+r.width,u=o.height+r.height;return{x:a,y:l,x2:a+c,y2:l+u,width:c,height:u,centerX:a+c/2,centerY:l+u/2,rotation:i.rotation}}const rl=["enter","leave"],ol=rl.concat("click");function bk(n,t,e){t.listened=wf(e,ol,t.listeners),t.moveListened=!1,rl.forEach(i=>{pe(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&pe(i.click)&&(t.listened=!0),t.moveListened||rl.forEach(s=>{pe(i[s])&&(t.listened=!0,t.moveListened=!0)})})}function _k(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return xk(n,t,e);case"click":return wk(n,t,e)}}function xk(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=tl(n.visibleElements,t,e.interaction):i=[];const s=n.hovered;n.hovered=i;const r={state:n,event:t};let o=Rf(r,"leave",s,i);return Rf(r,"enter",i,s)||o}function Rf({state:n,event:t},e,i,s){let r;for(const o of i)s.indexOf(o)<0&&(r=If(o.options[e]||n.listeners[e],o,t)||r);return r}function wk(n,t,e){const i=n.listeners,s=tl(n.visibleElements,t,e.interaction);let r;for(const o of s)r=If(o.options.click||i.click,o,t)||r;return r}function If(n,t,e){return Dt(n,[t.$context,e])===!0}const Zr=["afterDraw","beforeDraw"];function vk(n,t,e){const i=t.visibleElements;t.hooked=wf(e,Zr,t.hooks),t.hooked||i.forEach(s=>{t.hooked||Zr.forEach(r=>{pe(s.options[r])&&(t.hooked=!0)})})}function Lf(n,t,e){if(n.hooked){const i=t.options[e]||n.hooks[e];return Dt(i,[t.$context])}}function Mk(n,t,e){const i=Ck(n.scales,t,e);let s=Nf(t,i,"min","suggestedMin");s=Nf(t,i,"max","suggestedMax")||s,s&&pe(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function kk(n,t){for(const e of n)Sk(e,t)}function Nf(n,t,e,i){if(Rt(t[e])&&!Dk(n.options,e,i)){const s=n[e]!==t[e];return n[e]=t[e],s}}function Dk(n,t,e){return ge(n[t])||ge(n[e])}function Sk(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=Jn(t,n,e);i&&!t[i]&&Tk(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function Tk(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(ge(n[e+i]))return!0;return!1}function Ck(n,t,e){const i=t.axis,s=t.id,r=i+"ScaleID",o={min:rt(t.min,Number.NEGATIVE_INFINITY),max:rt(t.max,Number.POSITIVE_INFINITY)};for(const a of e)a.scaleID===s?Ff(a,t,["value","endValue"],o):Jn(n,a,r)===s&&Ff(a,t,[i+"Min",i+"Max",i+"Value"],o);return o}function Ff(n,t,e,i){for(const s of e){const r=n[s];if(ge(r)){const o=t.parse(r);i.min=Math.min(i.min,o),i.max=Math.max(i.max,o)}}}class Pi extends Jt{inRange(t,e,i,s){const{x:r,y:o}=Kn({x:t,y:e},this.getCenterPoint(s),$t(-this.options.rotation));return df({x:r,y:o},this.getProps(["x","y","x2","y2"],s),i,this.options)}getCenterPoint(t){return Qn(this,t)}draw(t){t.save(),Gr(t,this.getCenterPoint(),this.options.rotation),Mf(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Of(t,e)}}Pi.id="boxAnnotation",Pi.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,hitTolerance: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,hitTolerance: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},Pi.defaultRoutes={borderColor:"color",backgroundColor:"color"},Pi.descriptors={label:{_fallback:!0}};class Qr extends Jt{inRange(t,e,i,s){return hf({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],s),center:this.getCenterPoint(s)},i,{rotation:this.rotation,borderWidth:0,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return Qn(this,t)}draw(t){const e=this.options;!e.display||!e.content||(Ik(t,this),t.save(),Gr(t,this.getCenterPoint(),this.rotation),kf(t,this,e,this._fitRatio),t.restore())}resolveElementProperties(t,e){const i=Pk(t,e);if(!i)return{};const{controllerMeta:s,point:r,radius:o}=Ek(t,e,i);let a=Kr(t.ctx,e);const l=Ak(a,o);yf(e,l)&&(a={width:a.width*l,height:a.height*l});const{position:c,xAdjust:u,yAdjust:d}=e,f=mf(r,a,{borderWidth:0,position:c,xAdjust:u,yAdjust:d});return{initProperties:Si(t,f,e),...f,...s,rotation:e.rotation,_fitRatio:l}}}Qr.id="doughnutLabelAnnotation",Qr.defaults={autoFit:!0,autoHide:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderColor:"transparent",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:0,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,hitTolerance:0,init:void 0,opacity:void 0,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,spacing:1,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0},Qr.defaultRoutes={};function Pk(n,t){return n.getSortedVisibleDatasetMetas().reduce(function(e,i){const s=i.controller;return s instanceof en&&Ok(n,t,i.data)&&(!e||s.innerRadius<e.controller.innerRadius)&&s.options.circumference>=90?i:e},void 0)}function Ok(n,t,e){if(!t.autoHide)return!0;for(let i=0;i<e.length;i++)if(!e[i].hidden&&n.getDataVisibility(i))return!0}function Ek({chartArea:n},t,e){const{left:i,top:s,right:r,bottom:o}=n,{innerRadius:a,offsetX:l,offsetY:c}=e.controller,u=(i+r)/2+l,d=(s+o)/2+c,f={left:Math.max(u-a,i),right:Math.min(u+a,r),top:Math.max(d-a,s),bottom:Math.min(d+a,o)},g={x:(f.left+f.right)/2,y:(f.top+f.bottom)/2},p=t.spacing+t.borderWidth/2,y=a-p,x=g.y>d,v=x?s+p:o-p,M=Rk(v,u,d,y);return{controllerMeta:{_centerX:u,_centerY:d,_radius:y,_counterclockwise:x,...M},point:g,radius:Math.min(a,Math.min(f.right-f.left,f.bottom-f.top)/2)}}function Ak({width:n,height:t},e){const i=Math.sqrt(Math.pow(n,2)+Math.pow(t,2));return e*2/i}function Rk(n,t,e,i){const s=Math.pow(e-n,2),r=Math.pow(i,2),o=t*-2,a=Math.pow(t,2)+s-r,l=Math.pow(o,2)-4*a;if(l<=0)return{_startAngle:0,_endAngle:Ot};const c=(-o-Math.sqrt(l))/2,u=(-o+Math.sqrt(l))/2;return{_startAngle:tr({x:t,y:e},{x:c,y:n}).angle,_endAngle:tr({x:t,y:e},{x:u,y:n}).angle}}function Ik(n,t){const{_centerX:e,_centerY:i,_radius:s,_startAngle:r,_endAngle:o,_counterclockwise:a,options:l}=t;n.save();const c=on(n,l);n.fillStyle=l.backgroundColor,n.beginPath(),n.arc(e,i,s,r,o,a),n.closePath(),n.fill(),c&&n.stroke(),n.restore()}class Os extends Jt{inRange(t,e,i,s){return hf({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],s),center:this.getCenterPoint(s)},i,{rotation:this.rotation,borderWidth:this.options.borderWidth,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return Qn(this,t)}draw(t){const e=this.options,i=!ge(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),Gr(t,this.getCenterPoint(),this.rotation),ik(t,this),Mf(t,this,e),kf(t,Lk(this),e),t.restore())}resolveElementProperties(t,e){let i;if(_f(e))i=Cf(t,e);else{const{centerX:a,centerY:l}=sl(t,e);i={x:a,y:l}}const s=Ut(e.padding),r=Kr(t.ctx,e),o=mf(i,r,e,s);return{initProperties:Si(t,o,e),pointX:i.x,pointY:i.y,...o,rotation:e.rotation}}}Os.id="labelAnnotation",Os.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,hitTolerance: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},Os.defaultRoutes={borderColor:"color"};function Lk({x:n,y:t,width:e,height:i,options:s}){const r=s.borderWidth/2,o=Ut(s.padding);return{x:n+o.left+r,y:t+o.top+r,width:e-o.left-o.right-s.borderWidth,height:i-o.top-o.bottom-s.borderWidth}}const al=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),ll=(n,t,e)=>al(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,zf=(n,t,e)=>al(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,Es=n=>n*n,Nk=(n,t,{x:e,y:i,x2:s,y2:r},o)=>o==="y"?{start:Math.min(i,r),end:Math.max(i,r),value:t}:{start:Math.min(e,s),end:Math.max(e,s),value:n},Bf=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,cl=(n,t,e,i)=>({x:Bf(n.x,t.x,e.x,i),y:Bf(n.y,t.y,e.y,i)}),Hf=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),Wf=(n,t,e,i)=>-Math.atan2(Hf(n.x,t.x,e.x,i),Hf(n.y,t.y,e.y,i))+.5*ct;class As extends Jt{inRange(t,e,i,s){const r=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y"){const o={mouseX:t,mouseY:e},{path:a,ctx:l}=this;if(a){on(l,this.options),l.lineWidth+=this.options.hitTolerance;const{chart:u}=this.$context,d=t*u.currentDevicePixelRatio,f=e*u.currentDevicePixelRatio,g=l.isPointInStroke(a,d,f)||ul(this,o,s);return l.restore(),g}const c=Es(r);return Hk(this,o,c,s)||ul(this,o,s)}return Fk(this,{mouseX:t,mouseY:e},i,{hitSize:r,useFinalPosition:s})}getCenterPoint(t){return Qn(this,t)}draw(t){const{x:e,y:i,x2:s,y2:r,cp:o,options:a}=this;if(t.save(),!on(t,a))return t.restore();Ti(t,a);const l=Math.sqrt(Math.pow(s-e,2)+Math.pow(r-i,2));if(a.curve&&o)return qk(t,this,o,l),t.restore();const{startOpts:c,endOpts:u,startAdjust:d,endAdjust:f}=Uf(this),g=Math.atan2(r-i,s-e);t.translate(e,i),t.rotate(g),t.beginPath(),t.moveTo(0+d,0),t.lineTo(l-f,0),t.shadowColor=a.borderShadowColor,t.stroke(),dl(t,0,d,c),dl(t,l,-f,u),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=dk(t,e),{x:s,y:r,x2:o,y2:a}=i,l=zk(i,t.chartArea),c=l?Bk({x:s,y:r},{x:o,y:a},t.chartArea):{x:s,y:r,x2:o,y2:a,width:Math.abs(o-s),height:Math.abs(a-r)};if(c.centerX=(o+s)/2,c.centerY=(a+r)/2,c.initProperties=Si(t,c,e),e.curve){const d={x:c.x,y:c.y},f={x:c.x2,y:c.y2};c.cp=Xk(c,e,ui(d,f))}const u=Wk(t,c,e.label);return u._visible=l,c.elements=[{type:"label",optionScope:"label",properties:u,initProperties:c.initProperties}],c}}As.id="lineAnnotation";const Yf={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};As.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},Yf),fill:!1,length:12,start:Object.assign({},Yf),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,hitTolerance: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({},Os.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,hitTolerance: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},As.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},As.defaultRoutes={borderColor:"color"};function Fk(n,{mouseX:t,mouseY:e},i,{hitSize:s,useFinalPosition:r}){const o=Nk(t,e,n.getProps(["x","y","x2","y2"],r),i);return uf(o,s)||ul(n,{mouseX:t,mouseY:e},r,i)}function zk({x:n,y:t,x2:e,y2:i},{top:s,right:r,bottom:o,left:a}){return!(n<a&&e<a||n>r&&e>r||t<s&&i<s||t>o&&i>o)}function jf({x:n,y:t},e,{top:i,right:s,bottom:r,left:o}){return n<o&&(t=zf(o,{x:n,y:t},e),n=o),n>s&&(t=zf(s,{x:n,y:t},e),n=s),t<i&&(n=ll(i,{x:n,y:t},e),t=i),t>r&&(n=ll(r,{x:n,y:t},e),t=r),{x:n,y:t}}function Bk(n,t,e){const{x:i,y:s}=jf(n,t,e),{x:r,y:o}=jf(t,n,e);return{x:i,y:s,x2:r,y2:o,width:Math.abs(r-i),height:Math.abs(o-s)}}function Hk(n,{mouseX:t,mouseY:e},i=Zn,s){const{x:r,y:o,x2:a,y2:l}=n.getProps(["x","y","x2","y2"],s),c=a-r,u=l-o,d=Es(c)+Es(u),f=d===0?-1:((t-r)*c+(e-o)*u)/d;let g,p;return f<0?(g=r,p=o):f>1?(g=a,p=l):(g=r+f*c,p=o+f*u),Es(t-g)+Es(e-p)<=i}function ul(n,{mouseX:t,mouseY:e},i,s){const r=n.label;return r.options.display&&r.inRange(t,e,s,i)}function Wk(n,t,e){const i=e.borderWidth,s=Ut(e.padding),r=Kr(n.ctx,e),o=r.width+s.width+i,a=r.height+s.height+i;return jk(t,e,{width:o,height:a,padding:s},n.chartArea)}function Yk(n){const{x:t,y:e,x2:i,y2:s}=n,r=Math.atan2(s-e,i-t);return r>ct/2?r-ct:r<ct/-2?r+ct:r}function jk(n,t,e,i){const{width:s,height:r,padding:o}=e,{xAdjust:a,yAdjust:l}=t,c={x:n.x,y:n.y},u={x:n.x2,y:n.y2},d=t.rotation==="auto"?Yk(n):$t(t.rotation),f=Vk(s,r,d),g=$k(n,t,{labelSize:f,padding:o},i),p=n.cp?cl(c,n.cp,u,g):al(c,u,g),y={size:f.w,min:i.left,max:i.right,padding:o.left},x={size:f.h,min:i.top,max:i.bottom,padding:o.top},v=$f(p.x,y)+a,M=$f(p.y,x)+l;return{x:v-s/2,y:M-r/2,x2:v+s/2,y2:M+r/2,centerX:v,centerY:M,pointX:p.x,pointY:p.y,width:s,height:r,rotation:Js(d)}}function Vk(n,t,e){const i=Math.cos(e),s=Math.sin(e);return{w:Math.abs(n*i)+Math.abs(t*s),h:Math.abs(n*s)+Math.abs(t*i)}}function $k(n,t,e,i){let s;const r=Uk(n,i);return t.position==="start"?s=Vf({w:n.x2-n.x,h:n.y2-n.y},e,t,r):t.position==="end"?s=1-Vf({w:n.x-n.x2,h:n.y-n.y2},e,t,r):s=el(1,t.position),s}function Vf(n,t,e,i){const{labelSize:s,padding:r}=t,o=n.w*i.dx,a=n.h*i.dy,l=o>0&&(s.w/2+r.left-i.x)/o,c=a>0&&(s.h/2+r.top-i.y)/a;return Xr(Math.max(l,c),0,.25)}function Uk(n,t){const{x:e,x2:i,y:s,y2:r}=n,o=Math.min(s,r)-t.top,a=Math.min(e,i)-t.left,l=t.bottom-Math.max(s,r),c=t.right-Math.max(e,i);return{x:Math.min(a,c),y:Math.min(o,l),dx:a<=c?1:-1,dy:o<=l?1:-1}}function $f(n,t){const{size:e,min:i,max:s,padding:r}=t,o=e/2;return e>s-i?(s+i)/2:(i>=n-r-o&&(n=i+r+o),s<=n+r+o&&(n=s-r-o),n)}function Uf(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:Xf(n,e),endAdjust:Xf(n,i)}}function Xf(n,t){if(!t||!t.display)return 0;const{length:e,width:i}=t,s=n.options.borderWidth/2,r={x:e,y:i+s};return Math.abs(ll(0,r,{x:0,y:s}))}function dl(n,t,e,i){if(!i||!i.display)return;const{length:s,width:r,fill:o,backgroundColor:a,borderColor:l}=i,c=Math.abs(t-s)+e;n.beginPath(),Ti(n,i),on(n,i),n.moveTo(c,-r),n.lineTo(t+e,0),n.lineTo(c,r),o===!0?(n.fillStyle=a||l,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=i.borderShadowColor,n.stroke()}function Xk(n,t,e){const{x:i,y:s,x2:r,y2:o,centerX:a,centerY:l}=n,c=Math.atan2(o-s,r-i),u=nl(t.controlPoint,0),d={x:a+Tn(e,u.x,!1),y:l+Tn(e,u.y,!1)};return Kn(d,{x:a,y:l},c)}function qf(n,{x:t,y:e},{angle:i,adjust:s},r){!r||!r.display||(n.save(),n.translate(t,e),n.rotate(i),dl(n,0,-s,r),n.restore())}function qk(n,t,e,i){const{x:s,y:r,x2:o,y2:a,options:l}=t,{startOpts:c,endOpts:u,startAdjust:d,endAdjust:f}=Uf(t),g={x:s,y:r},p={x:o,y:a},y=Wf(g,e,p,0),x=Wf(g,e,p,1)-ct,v=cl(g,e,p,d/i),M=cl(g,e,p,1-f/i),D=new Path2D;n.beginPath(),D.moveTo(v.x,v.y),D.quadraticCurveTo(e.x,e.y,M.x,M.y),n.shadowColor=l.borderShadowColor,n.stroke(D),t.path=D,t.ctx=n,qf(n,v,{angle:y,adjust:d},c),qf(n,M,{angle:x,adjust:f},u)}class Rs extends Jt{inRange(t,e,i,s){const r=this.options.rotation,o=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return Gk({x:t,y:e},this.getProps(["width","height","centerX","centerY"],s),r,o);const{x:a,y:l,x2:c,y2:u}=this.getProps(["x","y","x2","y2"],s),d=i==="y"?{start:l,end:u}:{start:a,end:c},f=Kn({x:t,y:e},this.getCenterPoint(s),$t(-r));return f[i]>=d.start-o-Zn&&f[i]<=d.end+o+Zn}getCenterPoint(t){return Qn(this,t)}draw(t){const{width:e,height:i,centerX:s,centerY:r,options:o}=this;t.save(),Gr(t,this.getCenterPoint(),o.rotation),Ti(t,this.options),t.beginPath(),t.fillStyle=o.backgroundColor;const a=on(t,o);t.ellipse(s,r,i/2,e/2,ct/2,0,2*ct),t.fill(),a&&(t.shadowColor=o.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Of(t,e)}}Rs.id="ellipseAnnotation",Rs.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},Pi.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},Rs.defaultRoutes={borderColor:"color",backgroundColor:"color"},Rs.descriptors={label:{_fallback:!0}};function Gk(n,t,e,i){const{width:s,height:r,centerX:o,centerY:a}=t,l=s/2,c=r/2;if(l<=0||c<=0)return!1;const u=$t(e||0),d=Math.cos(u),f=Math.sin(u),g=Math.pow(d*(n.x-o)+f*(n.y-a),2),p=Math.pow(f*(n.x-o)-d*(n.y-a),2);return g/Math.pow(l+i,2)+p/Math.pow(c+i,2)<=1.0001}class Jr extends Jt{inRange(t,e,i,s){const{x:r,y:o,x2:a,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],s),u=(this.options.borderWidth+this.options.hitTolerance)/2;return i!=="x"&&i!=="y"?jM({x:t,y:e},this.getCenterPoint(s),c/2,u):uf(i==="y"?{start:o,end:l,value:e}:{start:r,end:a,value:t},u)}getCenterPoint(t){return Qn(this,t)}draw(t){const e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,Ti(t,e);const s=on(t,e);ZM(t,this,this.centerX,this.centerY),s&&!qr(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=Pf(t,e);return i.initProperties=Si(t,i,e),i}}Jr.id="pointAnnotation",Jr.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance: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},Jr.defaultRoutes={borderColor:"color",backgroundColor:"color"};class to extends Jt{inRange(t,e,i,s){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&Zk(this.elements,t,e,s);const r=Kn({x:t,y:e},this.getCenterPoint(s),$t(-this.options.rotation)),o=this.elements.map(c=>i==="y"?c.bY:c.bX),a=Math.min(...o),l=Math.max(...o);return r[i]>=a&&r[i]<=l}getCenterPoint(t){return Qn(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Ti(t,i);const s=on(t,i);let r=!0;for(const o of e)r?(t.moveTo(o.x,o.y),r=!1):t.lineTo(o.x,o.y);t.closePath(),t.fill(),s&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,e){const i=Pf(t,e),{sides:s,rotation:r}=e,o=[],a=2*ct/s;let l=r*Co;for(let c=0;c<s;c++,l+=a){const u=Kk(i,e,l);u.initProperties=Si(t,i,e),o.push(u)}return i.elements=o,i}}to.id="polygonAnnotation",to.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance: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},to.defaultRoutes={borderColor:"color",backgroundColor:"color"};function Kk({centerX:n,centerY:t},{radius:e,borderWidth:i,hitTolerance:s},r){const o=(i+s)/2,a=Math.sin(r),l=Math.cos(r),c={x:n+a*e,y:t-l*e};return{type:"point",optionScope:"point",properties:{x:c.x,y:c.y,centerX:c.x,centerY:c.y,bX:n+a*(e+o),bY:t-l*(e+o)}}}function Zk(n,t,e,i){let s=!1,r=n[n.length-1].getProps(["bX","bY"],i);for(const o of n){const a=o.getProps(["bX","bY"],i);a.bY>e!=r.bY>e&&t<(r.bX-a.bX)*(e-a.bY)/(r.bY-a.bY)+a.bX&&(s=!s),r=a}return s}const Cn={box:Pi,doughnutLabel:Qr,ellipse:Rs,label:Os,line:As,point:Jr,polygon:to};Object.keys(Cn).forEach(n=>{At.describe(`elements.${Cn[n].id}`,{_fallback:"plugins.annotation.common"})});const Qk={update:Object.assign},Jk=ol.concat(Zr),Gf=(n,t)=>ht(t)?gl(n,t):n,hl=n=>n==="color"||n==="font";function fl(n="line"){return Cn[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function tD(n,t,e,i){const s=nD(n,e.animations,i),r=t.annotations,o=rD(t.elements,r);for(let a=0;a<r.length;a++){const l=r[a],c=Kf(o,a,l.type),u=l.setContext(sD(n,c,o,l)),d=c.resolveElementProperties(n,u);d.skip=eD(d),"elements"in d&&(iD(c,d.elements,u,s),delete d.elements),ge(c.x)||Object.assign(c,d),Object.assign(c,d.initProperties),d.options=Zf(u),s.update(c,d)}}function eD(n){return isNaN(n.x)||isNaN(n.y)}function nD(n,t,e){return e==="reset"||e==="none"||e==="resize"?Qk:new Yo(n,t)}function iD(n,t,e,i){const s=n.elements||(n.elements=[]);s.length=t.length;for(let r=0;r<t.length;r++){const o=t[r],a=o.properties,l=Kf(s,r,o.type,o.initProperties),c=e[o.optionScope].override(o);a.options=Zf(c),i.update(l,a)}}function Kf(n,t,e,i){const s=Cn[fl(e)];let r=n[t];return(!r||!(r instanceof s))&&(r=n[t]=new s,Object.assign(r,i)),r}function Zf(n){const t=Cn[fl(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,gl(n,t.defaults),gl(n,t.defaultRoutes));for(const i of Jk)e[i]=n[i];return e}function gl(n,t){const e={};for(const i of Object.keys(t)){const s=t[i],r=n[i];hl(i)&&kt(r)?e[i]=r.map(o=>Gf(o,s)):e[i]=Gf(r,s)}return e}function sD(n,t,e,i){return t.$context||(t.$context=Object.assign(Object.create(n.getContext()),{element:t,get elements(){return e.filter(s=>s&&s.options)},id:i.id,type:"annotation"}))}function rD(n,t){const e=t.length,i=n.length;if(i<e){const s=e-i;n.splice(i,0,...new Array(s))}else i>e&&n.splice(e,i-e);return n}var oD="3.1.0";const Pn=new Map,Qf=n=>n.type!=="doughnutLabel",aD=ol.concat(Zr);var Jf={id:"annotation",version:oD,beforeRegister(){VM("chart.js","4.0",Se.version)},afterRegister(){Se.register(Cn)},afterUnregister(){Se.unregister(Cn)},beforeInit(n){Pn.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=Pn.get(n),s=i.annotations=[];let r=e.annotations;ht(r)?Object.keys(r).forEach(o=>{const a=r[o];ht(a)&&(a.id=o,s.push(a))}):kt(r)&&s.push(...r),kk(s.filter(Qf),n.scales)},afterDataLimits(n,t){const e=Pn.get(n);Mk(n,t.scale,e.annotations.filter(Qf).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=Pn.get(n);bk(n,i,e),tD(n,i,e,t.mode),i.visibleElements=i.elements.filter(s=>!s.skip&&s.options.display),vk(n,i,e)},beforeDatasetsDraw(n,t,e){Is(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){Is(n,"afterDatasetsDraw",e.clip)},beforeDatasetDraw(n,t,e){Is(n,t.index,e.clip)},beforeDraw(n,t,e){Is(n,"beforeDraw",e.clip)},afterDraw(n,t,e){Is(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const i=Pn.get(n);_k(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){Pn.delete(n)},getAnnotations(n){const t=Pn.get(n);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(n,t,e){return tl(n,t,e)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"},colors:{properties:["backgroundColor","borderColor"],type:"color"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:n=>!aD.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${Cn[fl(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:hl,_fallback:!0},_indexable:hl}},additionalOptionScopes:[""]};function Is(n,t,e){const{ctx:i,chartArea:s}=n,r=Pn.get(n);e&&Ki(i,s);const o=lD(r.visibleElements,t).sort((a,l)=>a.element.options.z-l.element.options.z);for(const a of o)cD(i,s,r,a);e&&Zi(i)}function lD(n,t){const e=[];for(const i of n)if(i.options.drawTime===t&&e.push({element:i,main:!0}),i.elements&&i.elements.length)for(const s of i.elements)s.options.display&&s.options.drawTime===t&&e.push({element:s});return e}function cD(n,t,e,i){const s=i.element;i.main?(Lf(e,s,"beforeDraw"),s.draw(n,t),Lf(e,s,"afterDraw")):s.draw(n,t)}const uD={class:"zoom-timerange-container"},dD={class:"zoom-timerange-details"},hD={class:"label"},fD={class:"label"},gD=h.defineComponent({__name:"ZoomTimerange",props:{start:{},end:{}},setup(n){const t=n,{i18n:e}=bt.useI18n(),i=h.ref(Mi(t.start.getTime())),s=h.ref(Mi(t.end.getTime())),r=(o,a)=>{Ca(()=>{i.value=Mi(o.getTime()),s.value=Mi(a.getTime())},100)()};return h.watch(()=>[t.start,t.end],([o,a])=>{r(o,a)},{immediate:!0}),(o,a)=>(h.openBlock(),h.createElementBlock("div",uD,[h.createElementVNode("div",dD,[h.createElementVNode("div",hD,h.toDisplayString(h.unref(e).t("zoom_time_range.from")),1),h.createElementVNode("div",null,h.toDisplayString(i.value),1),h.createElementVNode("div",fD,h.toDisplayString(h.unref(e).t("zoom_time_range.to")),1),h.createElementVNode("div",null,h.toDisplayString(s.value),1)])]))}}),Pe=(n,t)=>{const e=n.__vccOpts||n;for(const[i,s]of t)e[i]=s;return e},tg=Pe(gD,[["__scopeId","data-v-6557612f"]]),pD={class:"zoom-actions-container"},mD={class:"zoom-actions-heading"},yD=["aria-disabled","href"],bD=["onClick"],_D=Pe(h.defineComponent({__name:"ZoomActions",props:{zoomActionItems:{},newTimeRange:{}},emits:["onAction"],setup(n,{emit:t}){const e=n,i=t,s=r=>{r.action&&(r.action(e.newTimeRange),i("onAction"))};return(r,o)=>(h.openBlock(),h.createElementBlock("div",pD,[h.createElementVNode("div",mD,[h.createVNode(tg,{end:r.newTimeRange.end,start:r.newTimeRange.start},null,8,["end","start"]),h.createVNode(h.unref(wo.CloseIcon),{class:"zoom-actions-close-icon",color:h.unref(ef),size:h.unref(nf),onClick:o[0]||(o[0]=a=>r.$emit("onAction"))},null,8,["color","size"])]),o[2]||(o[2]=h.createElementVNode("div",{class:"zoom-actions-heading-divider"},null,-1)),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(r.zoomActionItems,a=>(h.openBlock(),h.createElementBlock("div",{key:a.label,class:h.normalizeClass(["zoom-action-item",{disabled:a.disabled}])},[a.href?(h.openBlock(),h.createElementBlock("a",{key:0,"aria-disabled":a.disabled,class:"zoom-action-link",href:a.href,onClick:o[1]||(o[1]=l=>r.$emit("onAction"))},h.toDisplayString(a.label),9,yD)):(h.openBlock(),h.createElementBlock("div",{key:1,onClick:l=>s(a)},h.toDisplayString(a.label),9,bD))],2))),128))]))}}),[["__scopeId","data-v-966b2a05"]]),xD={key:2},wD={class:"tooltip-title"},vD={class:"title"},MD={key:0,class:"subtitle"},kD={class:"context"},DD={class:"metric"},SD={class:"tooltip"},TD={key:0},CD={class:"display-value"},pl=Pe(h.defineComponent({__name:"ChartTooltip",props:{state:{},tooltipTitle:{default:""},absoluteLeft:{default:"0px"},absoluteTop:{default:"0px"},zoomTimeRange:{default:void 0},zoomActionItems:{default:void 0}},emits:["dimensions","onAction"],setup(n,{emit:t}){const e=t,i=n,s=h.ref(null),{x:r,y:o,isDragging:a}=IM(s,{initialValue:{x:parseFloat(i.absoluteLeft),y:parseFloat(i.absoluteTop)}}),l=h.computed(()=>`${o.value}px`),c=h.computed(()=>`${r.value}px`),u=h.computed(()=>i.state.tooltipContext),d=h.computed(()=>i.state.metricDisplay),f=h.computed(()=>["interactive","zoom-interactive"].includes(i.state.interactionMode));return h.watch(()=>[i.absoluteLeft,i.absoluteTop],([g,p])=>{a.value||(r.value=parseFloat(g),o.value=parseFloat(p))}),h.watch(a,g=>{g?document.body.classList.add("no-select"):document.body.classList.remove("no-select")}),h.watch(s,g=>{if(g){const{width:p,height:y}=g.getBoundingClientRect();e("dimensions",{width:p,height:y})}}),(g,p)=>{var y,x;return g.state.showTooltip?(h.openBlock(),h.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:s,class:h.normalizeClass(["tooltip-container",{locked:g.state.interactionMode==="interactive"}]),style:h.normalizeStyle({transform:f.value?`translate(${c.value}, ${l.value})`:`translate(${g.absoluteLeft}, ${g.absoluteTop})`,left:"0",top:"0",pointerEvents:f.value?"all":"none"})},[g.state.interactionMode==="selecting-chart-area"?(h.openBlock(),h.createBlock(tg,{key:0,end:(y=g.zoomTimeRange)==null?void 0:y.end,start:(x=g.zoomTimeRange)==null?void 0:x.start},null,8,["end","start"])):g.state.interactionMode==="zoom-interactive"&&g.zoomTimeRange&&g.zoomActionItems?(h.openBlock(),h.createBlock(_D,{key:1,"new-time-range":g.zoomTimeRange,"zoom-action-items":g.zoomActionItems,onOnAction:p[0]||(p[0]=v=>e("onAction"))},null,8,["new-time-range","zoom-action-items"])):(h.openBlock(),h.createElementBlock("div",xD,[h.createElementVNode("div",wD,[h.createElementVNode("div",vD,[h.createElementVNode("div",null,h.toDisplayString(g.tooltipTitle),1),f.value?(h.openBlock(),h.createBlock(h.unref(wo.DragIcon),{key:0,class:"drag-icon",color:h.unref(ef),size:h.unref(nf)},null,8,["color","size"])):h.createCommentVNode("",!0)]),u.value||d.value?(h.openBlock(),h.createElementBlock("div",MD,[h.createElementVNode("div",kD,h.toDisplayString(u.value),1),h.createElementVNode("div",DD,h.toDisplayString(d.value),1)])):h.createCommentVNode("",!0)]),h.createElementVNode("ul",SD,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(g.state.tooltipSeries,({backgroundColor:v,borderColor:M,label:D,value:S,isSegmentEmpty:P})=>(h.openBlock(),h.createElementBlock(h.Fragment,{key:D},[g.state.tooltipSeries.length?(h.openBlock(),h.createElementBlock("li",TD,[h.createElementVNode("div",{class:"square-marker",style:h.normalizeStyle({background:v,"border-color":M})},null,4),h.createElementVNode("span",{class:h.normalizeClass(["display-label",{empty:P}])},h.toDisplayString(D),3),h.createElementVNode("span",CD,h.toDisplayString(S),1)])):h.createCommentVNode("",!0)],64))),128))])]))],6)):h.createCommentVNode("",!0)}}}),[["__scopeId","data-v-bee6dd5b"]]),PD=["onClick"],OD={key:0,class:"sub-label"},ED={class:"tooltip-content"},ml=Pe(h.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){h.useCssVars(S=>({"6d3f1170":l.value}));const t=n,{i18n:e}=bt.useI18n(),i=h.ref(),s=h.ref([]),r=h.inject("showLegendValues",!0),o=h.inject("legendPosition",h.ref(Nt.Right)),a=h.ref([]),l=h.ref(sf),c=()=>{const S=i.value;if(!S||!s.value||S.children.length===0)return 0;const P=S.children[0].getBoundingClientRect().top;for(const R of s.value)if(R.getBoundingClientRect().top>P)return!0;return!1},u=h.computed(()=>t.items.length>2||o.value===Nt.Right),d=()=>{i.value&&o.value===Nt.Bottom&&(c()?l.value=yM:l.value=sf)},f=()=>{if(i.value&&o.value===Nt.Bottom){let S=0;s.value.forEach(R=>{const O=Array.from(R.children).reduce((b,_)=>b+_.offsetWidth,0);O>S&&(S=O)});const P=parseInt(mM,10);i.value.style.gridTemplateColumns=`repeat(auto-fit, ${S+P}px)`}d()},g=()=>{if(t.items.length!==a.value.length)return a.value=t.items,!0;for(let S=0;S<t.items.length;S++)if(t.items[S].text!==a.value[S].text)return a.value=t.items,!0;return!1};h.watch(()=>t.items,()=>{g()&&f()},{immediate:!0,flush:"post"});const p=h.ref(0),y=h.ref(0),x=new ResizeObserver(Ca(S=>{const P=S[0],R=P.contentRect.width,O=P.contentRect.height;R!==p.value&&O===y.value&&f(),p.value=R,y.value=O},100));h.watch(()=>o.value,()=>{f()}),h.onMounted(()=>{a.value=t.items,i.value&&x.observe(i.value),window.requestAnimationFrame(()=>{f()})}),h.onBeforeUnmount(()=>{i.value&&x.unobserve(i.value)});const v=(S=0,P)=>{if(t.chartInstance===null)return;const R=t.chartInstance instanceof Se?t.chartInstance:t.chartInstance.chart;M(S,P)?R.hide(S,P):R.show(S,P),R.update()},M=(S=0,P)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const R=t.chartInstance instanceof Se?t.chartInstance:t.chartInstance.chart,O=R.getDatasetMeta(S);return O.dataset||P===void 0?R.isDatasetVisible(S):!(O.data.length&&O.data[P].hidden)},D=S=>({[Nt.Right]:"vertical",[Nt.Bottom]:"horizontal",[Nt.Hidden]:"hidden"})[S];return(S,P)=>{const R=h.resolveComponent("KTooltip");return h.unref(o)!==h.unref(Nt).Hidden?(h.openBlock(),h.createElementBlock("ul",{key:0,ref_key:"legendContainerRef",ref:i,class:h.normalizeClass(["legend-container",D(h.unref(o))]),"data-testid":"legend"},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.items,({fillStyle:O,strokeStyle:b,text:_,datasetIndex:C,index:I,value:T,isSegmentEmpty:F})=>(h.openBlock(),h.createElementBlock("li",{key:_,ref_for:!0,ref_key:"legendItemsRef",ref:s,onClick:U=>v(C,I)},[h.createElementVNode("div",{class:"square-marker",style:h.normalizeStyle({background:O,"border-color":b})},null,4),h.createVNode(R,null,h.createSlots({default:h.withCtx(()=>[h.createElementVNode("div",{class:h.normalizeClass(["label-container",{"strike-through":!M(C,I)}])},[h.createElementVNode("div",{class:h.normalizeClass(["label",{"truncate-label":u.value,empty:F}])},h.toDisplayString(_),3),T&&h.unref(r)?(h.openBlock(),h.createElementBlock("div",OD,h.toDisplayString(T.formatted),1)):h.createCommentVNode("",!0)],2)]),_:2},[F?{name:"content",fn:h.withCtx(()=>[h.createElementVNode("div",ED,h.toDisplayString(h.unref(e).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],8,PD))),128))],2)):h.createCommentVNode("",!0)}}}),[["__scopeId","data-v-2e13ddb3"]]),ne=[];for(let n=0;n<256;++n)ne.push((n+256).toString(16).slice(1));function AD(n,t=0){return(ne[n[t+0]]+ne[n[t+1]]+ne[n[t+2]]+ne[n[t+3]]+"-"+ne[n[t+4]]+ne[n[t+5]]+"-"+ne[n[t+6]]+ne[n[t+7]]+"-"+ne[n[t+8]]+ne[n[t+9]]+"-"+ne[n[t+10]]+ne[n[t+11]]+ne[n[t+12]]+ne[n[t+13]]+ne[n[t+14]]+ne[n[t+15]]).toLowerCase()}let yl;const RD=new Uint8Array(16);function ID(){if(!yl){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");yl=crypto.getRandomValues.bind(crypto)}return yl(RD)}const eg={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function eo(n,t,e){var s;if(eg.randomUUID&&!n)return eg.randomUUID();n=n||{};const i=n.random??((s=n.rng)==null?void 0:s.call(n))??ID();if(i.length<16)throw new Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,AD(i)}const ng=(n,t)=>{const e=n.ctx,i=n.scales.y,s=n.scales.x,r=t[t.length-1].element;e.save(),e.strokeStyle="rgba(100, 100, 100, 1)",e.lineWidth=3,n.options.indexAxis==="x"?e.strokeRect(r.x-r.width/2,r.y,r.width,i.bottom-r.y):e.strokeRect(s.left,r.y-r.height/2,r.x-s.left,r.height),e.restore()};class ig{constructor(){E(this,"id","highlightPlugin");E(this,"_clickedElements");E(this,"_previousHoverOption");E(this,"_clicked",!1);E(this,"_pause",!1);E(this,"_suppressNextClick",!1)}afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&ng(t,this._clickedElements)}afterEvent(t,{event:e}){var r;if(e.type==="click"&&this._suppressNextClick){this._suppressNextClick=!1;return}if(e.type!=="click"||!e.native||this._pause)return;this._clicked=!this._clicked;const i=((r=t.options.interaction)==null?void 0:r.mode)||"index",s=t.getElementsAtEventForMode(e.native,i,{intersect:!1},!0);s.length&&this._clicked?(this._clickedElements=s,ng(t,this._clickedElements),this._previousHoverOption=t.options.hover,t.options.hover={mode:null}):(delete this._clickedElements,t.options.hover=this._previousHoverOption||t.options.hover,this._clicked=!1)}beforeDestroy(t){delete this._clickedElements,t.options.hover=this._previousHoverOption||t.options.hover,this._clicked=!1}pause(){this._pause=!0}get isPaused(){return this._pause}resume(t=!1){this._pause=!1,t&&(this._suppressNextClick=!0)}}const LD=["id"],ND=["id"],FD={class:"axis-tooltip-content"},sg=6,zD="100%",BD="100%",HD=20,WD=20,rg=6,YD=0,jD=10,VD=10,$D=1,UD=Pe(h.defineComponent({__name:"StackedBarChart",props:{chartData:{},tooltipTitle:{default:""},legendValues:{default:void 0},metricUnit:{default:""},orientation:{default:"horizontal"},annotations:{type:Boolean,default:!0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},stacked:{type:Boolean,default:!0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},tooltipMetricDisplay:{default:""}},setup(n){const t=n,{i18n:e}=bt.useI18n(),{translateUnit:i}=bt.useTranslatedUnits(),s=crypto.randomUUID(),r=crypto.randomUUID(),o=new ig,a=h.useTemplateRef("chartContainer"),l=h.useTemplateRef("chartParent"),c=({chart:H},j)=>{var tt;const Y=H.data,Z=(tt=Y.labels)==null?void 0:tt.indexOf(j);return Y.datasets.reduce((et,it,nt)=>{if(H.isDatasetVisible(nt)){const xt=it.data[Z];return isNaN(xt)?et:et+xt}else return et},0)},u=(H,j,Y,Z)=>{const tt=Z==="horizontal";j===null&&(j=e.t("entityNoName"));const et={type:"label",yValue:xt=>tt?j:c(xt,j),xValue:xt=>tt?c(xt,j):j},it={...et,position:tt?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>tt?0:-Math.abs(Mw()),content:xt=>Aa(c(xt,j),Y)},nt={...et,content:xt=>oh(c(xt,j),rh(xt.chart,H)),position:tt?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:xt=>tt?sh(Aa(c(xt,j),Y)):0,color:eh};return{[`${j}-value`]:it,[`${j}-percent`]:nt}},d=h.useTemplateRef("canvas"),f=h.useTemplateRef("axis"),g=eo(),p=eo(),y=eo(),x=h.ref([]),v=h.inject("legendPosition",Nt.Right),M=h.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),D=h.toRef(t,"metricUnit"),S=h.computed(()=>t.orientation==="horizontal"),P=h.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:t.tooltipMetricDisplay,dimensionDisplay:t.dimensionAxesTitle,tooltipSeries:[],left:"",top:"",units:t.metricUnit,translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,interactionMode:"idle",chartType:S.value?"horizontal_bar":"vertical_bar",chartID:r,chartTooltipSortFn:t.chartTooltipSortFn}),{tooltipAbsoluteLeft:R,tooltipAbsoluteTop:O}=bt.useTooltipAbsolutePosition(l,P),b=h.ref(0),_=()=>{var H;return t.annotations&&((H=t.chartData.labels)==null?void 0:H.reduce((j,Y)=>Object.assign(j,u(t.chartData,Y,D.value,t.orientation)),{}))},C={id:g,afterUpdate(H){b.value+=1,x.value=Kd(H,t.legendValues,t.chartLegendSortFn)}},I={id:p,afterUpdate(H){H.options.plugins.annotation.annotations=t.annotations?_():{}}},U=[C,{id:"axisHover",afterEvent(H,j){var Y;if(M.show=!1,j.event.type==="mousemove"){const Z=j.event,tt=H.options.indexAxis,et=H.scales,it=H.scales[tt].getLabelForValue(Number(H.scales[tt].getValueForPixel(Z[tt]))),xt=H.scales[tt].getLabels().indexOf(it),at=(Y=t.chartData.isLabelEmpty)==null?void 0:Y[xt];if((te=>te==="x"?Z.y>et.x.top:Z.x<et.y.right)(tt)){P.interactionMode!=="interactive"&&(P.showTooltip=!1);const ae=H.canvas.getContext("2d").measureText(it).width,Xt=Math.abs(Math.round(Z.x-ae*.5)),Oe=Math.round(Z.x+ae*.5),Mt=H.canvas.getBoundingClientRect(),qt=40;M.left=tt==="x"?`${(Xt>0?Xt:Oe)-M.offset+Mt.left}px`:`${Z.x-ae*.5-M.offset+Mt.left}px`,M.top=`${Z.y-qt+Mt.top}px`,it.length>Rr?(M.show=!0,M.text=it):at?(M.text=e.t("emptyEntityInfo"),M.show=!0):M.show=!1}else M.show=!1}}},{id:y,afterUpdate(H){H.options.layout.padding.right=S.value?B.value:0}},o,...t.annotations?[I]:[]],X=h.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),Q=h.ref(0),V=h.ref(0),ut=new ResizeObserver(Ca(H=>{Q.value=H[0].contentRect.width,V.value=H[0].contentRect.height},100)),$=h.computed(()=>{var j,Y;const H=(Y=(j=t.chartData)==null?void 0:j.labels)==null?void 0:Y.length;return d.value&&H&&!S.value?`${Math.max(H*(HD+rg),Q.value)}px`:zD}),G=h.computed(()=>{var j,Y;const H=(Y=(j=t.chartData)==null?void 0:j.labels)==null?void 0:Y.length;return d.value&&H&&S.value?`${Math.max(H*(WD+rg),V.value)}px`:BD});bt.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey")),h.onMounted(()=>{t.annotations&&Se.register(Jf),a.value&&(Q.value=a.value.offsetWidth,V.value=a.value.offsetHeight,ut.observe(a.value))}),h.onUnmounted(()=>{a.value&&ut.unobserve(a.value)});const J=h.computed(()=>{const H=bt.useBarChartOptions({tooltipState:P,legendID:g,stacked:h.toRef(t,"stacked"),metricAxesTitle:h.toRef(t,"metricAxesTitle"),dimensionAxesTitle:h.toRef(t,"dimensionAxesTitle"),indexAxis:S.value?"y":"x",numLabels:X});return{...H.value,plugins:{...H.value.plugins,annotation:{annotations:_(),clip:!1}},layout:{autoPadding:!1,padding:{right:0,top:6*sg}}}}),z=bt.useChartJSCommon("bar",d,h.toRef(t,"chartData"),U,J),B=h.computed(()=>{b.value;const H=t.chartData.labels,j=t.chartData.datasets,Y=H.map((et,it)=>j.reduce((nt,xt)=>isNaN(Number(xt.data[it]))?nt:nt+Number(xt.data[it]),0)),Z=z.value?rh(z.value,t.chartData):kw(t.chartData);return Y.map(et=>sh(Aa(et,D.value)+oh(et,Z))).reduce((et,it)=>Math.max(et,it),0)+sg});h.onBeforeUnmount(()=>{Se.unregister(Jf)});const ft={[Nt.Right]:"legend-row",[Nt.Bottom]:"column"},yt=h.computed(()=>{if(f.value&&z.value){const H=window.devicePixelRatio,j=z.value,Y=j.scales.y.width*H+$D,Z=(j.scales.y.height+j.scales.y.top+j.scales.x.height)*H,tt=f.value.getContext("2d");return tt.scale(H,H),tt.canvas.width=Y,tt.canvas.height=Z,tt.canvas.style.width=`${Y/H}px`,tt.canvas.style.height=`${Z/H}px`,{scale:H,width:Y*H,height:Z*H,targetCtx:tt}}return null}),vt=H=>{const j=H.target;if(yt.value&&z.value&&!S.value){const Y=yt.value.scale,Z=yt.value.targetCtx,tt=yt.value.width,et=yt.value.height,it=z.value,nt=it.canvas;Z.fillStyle="white",j.scrollLeft>=YD&&j.scrollLeft<=jD?(Z.globalCompositeOperation="source-over",Z.clearRect(0,0,tt,et),Z.drawImage(nt,0,0,tt,et,0,0,tt,et),Z.globalCompositeOperation="destination-over",Z.fillRect(0,0,tt,et)):(Z.globalCompositeOperation="source-over",Z.fillRect(0,(it.scales.y.height+it.scales.y.top+VD)*Y,tt,it.scales.x.height*Y))}P.offsetY=j.scrollTop,P.offsetX=j.scrollLeft,M.offset=j.scrollLeft},gt=({width:H,height:j})=>{P.width=H,P.height=j};h.watch(()=>t.orientation,()=>{var H;if(f.value&&yt.value){const j=yt.value.width,Y=yt.value.height;((H=f.value)==null?void 0:H.getContext("2d")).clearRect(0,0,j,Y)}P.showTooltip=!1,P.interactionMode="idle"}),h.watch(()=>t.annotations,H=>{z.value&&(H?z.value.options.plugins.annotation.annotations=_(t.chartData):delete z.value.options.plugins.annotation.annotations)});const pt=()=>{P.showTooltip&&(P.interactionMode!=="idle"?P.interactionMode="idle":P.interactionMode="interactive")};return(H,j)=>(h.openBlock(),h.createElementBlock("div",{ref:"chartParent",class:h.normalizeClass(["chart-parent",ft[h.unref(v)]])},[h.createElementVNode("canvas",{id:h.unref(s),ref:"axis",class:"axis"},null,8,LD),h.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:j[0]||(j[0]=Y=>pt()),onScroll:vt},[h.createElementVNode("div",{class:"chart-body",style:h.normalizeStyle({width:$.value,height:G.value})},[h.createElementVNode("canvas",{id:h.unref(r),ref:"canvas",class:"chart-canvas"},null,8,ND)],4)],544),(h.openBlock(),h.createBlock(h.Teleport,{to:"body"},[M.show?(h.openBlock(),h.createElementBlock("div",{key:0,class:"axis-tooltip",style:h.normalizeStyle({top:M.top,left:M.left}),width:"auto"},[h.createElementVNode("div",FD,h.toDisplayString(M.text),1)],4)):h.createCommentVNode("",!0),h.createVNode(pl,{"absolute-left":h.unref(R),"absolute-top":h.unref(O),"chart-parent-ref":l.value,state:P,"tooltip-title":H.tooltipTitle,onDimensions:gt},null,8,["absolute-left","absolute-top","chart-parent-ref","state","tooltip-title"])])),h.createVNode(ml,{id:h.unref(g),"chart-instance":h.unref(z),items:x.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-acf2a980"]]);/*!
|
|
24
24
|
* chartjs-adapter-date-fns v3.0.0
|
|
25
25
|
* https://www.chartjs.org
|
|
26
26
|
* (c) 2022 chartjs-adapter-date-fns Contributors
|
|
27
27
|
* Released under the MIT license
|
|
28
|
-
*/const XD={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"};cu._date.override({_id:"date-fns",formats:function(){return XD},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=lt(n):e==="string"&&(typeof t=="string"?n=Bx(n,t,new Date,this.options):n=Xd(n,this.options)),ba(n)?n.getTime():null},format:function(n,t){return Wd(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return ma(n,t);case"second":return I0(n,t);case"minute":return A0(n,t);case"hour":return P0(n,t);case"day":return Cr(n,t);case"week":return L0(n,t);case"month":return pa(n,t);case"quarter":return R0(n,t);case"year":return N0(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return _a(n,t);case"second":return V0(n,t);case"minute":return W0(n,t);case"hour":return H0(n,t);case"day":return Dd(n,t);case"week":return $0(n,t);case"month":return Pd(n,t);case"quarter":return j0(n,t);case"year":return U0(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return jx(n);case"minute":return Yx(n);case"hour":return Wx(n);case"day":return ya(n);case"week":return Ve(n);case"isoWeek":return Ve(n,{weekStartsOn:+e});case"month":return q0(n);case"quarter":return X0(n);case"year":return Od(n);default:return n}},endOf:function(n,t){switch(t){case"second":return t_(n);case"minute":return Q0(n);case"hour":return K0(n);case"day":return Td(n);case"week":return Z0(n);case"month":return Cd(n);case"quarter":return J0(n);case"year":return G0(n);default:return n}}});const og={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},qD={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...og,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},GD=h.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function Oi(n){return h.isProxy(n)?h.toRaw(n):n}function KD(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 ag(n,t){n.labels=t}function lg(n,t,e){const i=[];n.datasets=t.map(s=>{const r=n.datasets.find(o=>o[e]===s[e]);return!r||!s.data||i.includes(r)?{...s}:(i.push(r),Object.assign(r,s),r)})}function QD(n,t){const e={labels:[],datasets:[]};return ag(e,n.labels),lg(e,n.datasets,t),e}const JD=h.defineComponent({props:qD,setup(n,t){let{expose:e,slots:i}=t;const s=h.ref(null),r=h.shallowRef(null);e({chart:r});const o=()=>{if(!s.value)return;const{type:c,data:u,options:d,plugins:f,datasetIdKey:g}=n,p=QD(u,g),y=KD(p,u);r.value=new Se(s.value,{type:c,data:y,options:{...d},plugins:f})},a=()=>{const c=h.toRaw(r.value);c&&(n.destroyDelay>0?setTimeout(()=>{c.destroy(),r.value=null},n.destroyDelay):(c.destroy(),r.value=null))},l=c=>{c.update(n.updateMode)};return h.onMounted(o),h.onUnmounted(a),h.watch([()=>n.options,()=>n.data],(c,u)=>{let[d,f]=c,[g,p]=u;const y=h.toRaw(r.value);if(!y)return;let x=!1;if(d){const v=Oi(d),M=Oi(g);v&&v!==M&&(ZD(y,v),x=!0)}if(f){const v=Oi(f.labels),M=Oi(p.labels),D=Oi(f.datasets),S=Oi(p.datasets);v!==M&&(ag(y.config.data,v),x=!0),D&&D!==S&&(lg(y.config.data,D,n.datasetIdKey),x=!0)}x&&h.nextTick(()=>{l(y)})},{deep:!0}),()=>h.h("canvas",{role:"img",ariaLabel:n.ariaLabel,ariaDescribedby:n.ariaDescribedby,ref:s},[h.h("p",{},[i.default?i.default():""])])}});function bl(n,t){return Se.register(t),h.defineComponent({props:og,setup(e,i){let{expose:s}=i;const r=h.shallowRef(null),o=a=>{r.value=a==null?void 0:a.chart};return s({chart:r}),()=>h.h(JD,GD({ref:o},{type:n,...e}))}})}const tS=bl("bar",ts),cg=bl("doughnut",en),eS=bl("line",es),nS={class:"chart-container"},iS=h.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},legendPosition:{default:Nt.Right},legendValues:{default:void 0},syntheticsDataKey:{default:""},datasetColors:{default:()=>sn},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""}},setup(n){const t=n,{translateUnit:e}=bt.useTranslatedUnits(),i=crypto.randomUUID(),s=crypto.randomUUID(),r=h.ref([]),o=h.useTemplateRef("chartParent"),a=h.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:t.tooltipMetricDisplay,dimensionDisplay:t.tooltipDimensionDisplay,tooltipSeries:[],left:"",top:"",units:h.toRef(t,"metricUnit"),translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartID:s,chartType:"donut",interactionMode:"idle"}),{tooltipAbsoluteLeft:l,tooltipAbsoluteTop:c}=bt.useTooltipAbsolutePosition(o,a),u={id:i,afterUpdate(M){r.value=M.options.plugins.legend.labels.generateLabels(M).map(D=>({...D,value:t.legendValues&&t.legendValues[D.text],hidden:!1}))}},d=h.computed(()=>[u]),f=h.computed(()=>[t.chartData.datasets.reduce((D,S)=>(D.labels.push(S.label),D.backgroundColor.push(S.backgroundColor),D.borderColor.push(th(S.backgroundColor,50)),D.data.push(S.data.reduce((C,R)=>C+R,0)),D),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),g=h.computed(()=>({...t.chartData,datasets:f.value}));bt.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const{options:p}=bt.useDonutChartOptions({tooltipState:a,legendID:i}),y=h.ref(),x=M=>({[Nt.Right]:"legend-row",[Nt.Bottom]:"column",[Nt.Hidden]:"hidden"})[M],v=({width:M,height:D})=>{a.width=M,a.height=D};return(M,D)=>(h.openBlock(),h.createElementBlock("div",{ref:"chartParent",class:h.normalizeClass(["chart-parent",x(M.legendPosition)]),"data-testid":"donut-chart-parent"},[h.createElementVNode("div",nS,[h.createVNode(h.unref(cg),{ref_key:"chartInstance",ref:y,"chart-id":h.unref(s),data:g.value,options:h.unref(p),plugins:d.value},null,8,["chart-id","data","options","plugins"]),(h.openBlock(),h.createBlock(h.Teleport,{to:"body"},[h.createVNode(pl,{"absolute-left":h.unref(l),"absolute-top":h.unref(c),state:a,"tooltip-title":M.tooltipTitle,unit:M.metricUnit,onDimensions:v},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),h.createVNode(ml,{id:h.unref(i),"chart-instance":y.value,items:r.value,position:M.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),sS=Pe(iS,[["__scopeId","data-v-f3942f91"]]),ug=(n,t,e,i)=>{n.save(),n.beginPath(),n.moveTo(t,e),n.lineTo(t,i),n.lineWidth=1,n.strokeStyle="#0275d8",n.stroke(),n.restore()};class rS{constructor(){E(this,"id","verticalLinePlugin");E(this,"_clickedSegment");E(this,"_pause",!1)}afterDatasetsDraw(t){if(!this._pause&&t.tooltip&&t.tooltip.getActiveElements()&&t.tooltip.getActiveElements().length&&!this.clickedSegment){const{x:e}=t.tooltip.dataPoints[0].element,i=t.ctx;ug(i,e,t.scales.y.top,t.scales.y.bottom)}if(!this._pause&&this._clickedSegment){const{x:e}=this._clickedSegment.element,i=t.ctx;ug(i,e,t.scales.y.top,t.scales.y.bottom)}}pause(){this._pause=!0}resume(){this._pause=!1}get isPaused(){return this._pause}set clickedSegment(t){this._clickedSegment=t}get clickedSegment(){return this._clickedSegment}destroyClickedSegment(){delete this._clickedSegment}beforeDestroy(){this._clickedSegment&&this.destroyClickedSegment()}}const oS=(n,t,e)=>{const i=n.ctx;i.save(),i.strokeStyle="rgba(95, 154, 255, 1)",i.lineWidth=2,i.beginPath(),i.moveTo(t,n.chartArea.top),i.lineTo(t,n.chartArea.bottom),i.moveTo(e,n.chartArea.top),i.lineTo(e,n.chartArea.bottom),i.stroke(),i.restore()},aS=(n,t,e)=>{const i=n.ctx;i.save(),i.fillStyle="rgba(143, 193, 255, 0.3)",i.fillRect(t,n.chartArea.top,e-t,n.chartArea.bottom-n.chartArea.top),i.restore()},dg=(n,t,e)=>{const i=t.scales.x.getValueForPixel(e.startX),s=t.scales.x.getValueForPixel(e.endX);i&&s&&t.canvas.dispatchEvent(new CustomEvent(n,{detail:{xStart:Math.min(i,s),xEnd:Math.max(i,s)}}))};class lS{constructor(){E(this,"id","dragSelectPlugin");E(this,"_isDragging",!1);E(this,"_startX",0);E(this,"_endX",0);E(this,"_dragTimeout");E(this,"_clearSelectionArea",!0);E(this,"_chart",null);E(this,"_dragSelectHandlers")}get startX(){return this._startX}get endX(){return this._endX}beforeInit(t){this._chart=t;const e=t.canvas;let i=!1;const s=a=>{this._dragTimeout=window.setTimeout(()=>{const l=e.getBoundingClientRect();this._isDragging=!0,this._clearSelectionArea=!1,i=!0,this._startX=a.clientX-l.left},150)},r=a=>{const l=e.getBoundingClientRect();i&&this._isDragging&&(this._endX=a.clientX-l.left,dg("dragSelectMove",t,this),t.update())},o=a=>{const l=e.getBoundingClientRect();clearTimeout(this._dragTimeout),i&&this._isDragging&&(this._endX=a.clientX-l.left,dg("dragSelect",t,this),t.update(),i=!1,this._isDragging=!1)};e.addEventListener("mousedown",s),e.addEventListener("mousemove",r),e.addEventListener("mouseup",o),this._dragSelectHandlers={onMouseDown:s,onMouseMove:r,onMouseUp:o}}beforeDestroy(t){const e=t.canvas;if(this._dragSelectHandlers){const{onMouseDown:i,onMouseMove:s,onMouseUp:r}=this._dragSelectHandlers;e.removeEventListener("mousedown",i),e.removeEventListener("mousemove",s),e.removeEventListener("mouseup",r)}this._isDragging=!1,this._dragTimeout&&clearTimeout(this._dragTimeout)}afterDatasetsDraw(t){(this._isDragging||!this._clearSelectionArea)&&(aS(t,this._startX,this._endX),oS(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const cS=["hidden","single","full"];var ti=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(ti||{});const uS=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar"],dS=["gauge","top_n","single_value"],hS=Pe(h.defineComponent({__name:"TimeSeriesChart",props:{chartData:{default:void 0},type:{default:"timeseries_line"},fill:{type:Boolean,default:!1},tooltipTitle:{},metricUnit:{default:""},timeRangeMs:{default:void 0},granularity:{},stacked:{type:Boolean,default:!0},legendValues:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},zoom:{type:Boolean,default:!1},zoomActionItems:{default:void 0},tooltipMetricDisplay:{default:""}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:t}){const e=n,i=t,s=new rS,r=new ig,o=new lS,{translateUnit:a}=bt.useTranslatedUnits(),l=h.ref(),c=crypto.randomUUID(),u=crypto.randomUUID(),d=h.ref([]),f=h.ref(),g=h.inject("legendPosition",Nt.Right),p=h.useTemplateRef("chartParent"),y=h.ref(void 0),x=h.ref(!1),v=h.inject(rf),M=v==null?void 0:v.evaluateFeatureFlagFn("analytics-chart-zoom-actions",!1),D=h.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:e.tooltipMetricDisplay,tooltipSeries:[],left:"",top:"",units:e.metricUnit,translateUnit:a,offsetX:0,offsetY:0,width:0,height:0,chartType:e.type,chartID:u,chartTooltipSortFn:e.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:S,tooltipAbsoluteTop:C}=bt.useTooltipAbsolutePosition(p,D),R={id:c,afterUpdate(z){d.value=Kd(z,e.legendValues,e.chartLegendSortFn)}},O=h.computed(()=>[R,r,...e.zoom?[o]:[],...e.type==="timeseries_line"?[s]:[]]),b=h.computed(()=>`line-${O.value.map(z=>z.id).join("-")}`),_=h.computed(()=>`bar-${O.value.map(z=>z.id).join("-")}`),T=h.computed(()=>e.chartData&&uw(e.chartData)),I=h.computed(()=>M?!1:x.value),{options:P}=bt.useLineChartOptions({tooltipState:D,timeRangeMs:h.toRef(e,"timeRangeMs"),granularity:h.toRef(e,"granularity"),legendID:c,stacked:h.toRef(e,"stacked"),metricAxesTitle:h.toRef(e,"metricAxesTitle"),dimensionAxesTitle:h.toRef(e,"dimensionAxesTitle"),pointsWithoutHover:T});bt.useReportChartDataForSynthetics(h.toRef(e,"chartData"),h.toRef(e,"syntheticsDataKey"));const F=z=>({[Nt.Right]:"legend-row",[Nt.Bottom]:"column",[Nt.Hidden]:"hidden"})[z],U=({width:z,height:B})=>{D.width=z,D.height=B},X=(z=!0)=>{D.interactionMode="idle",D.showTooltip=!1,o.clearSelectionArea(),r.isPaused&&r.resume(z),s.isPaused&&s.resume()},Q=()=>{D.interactionMode="interactive"},$=()=>{var z,B;!l.value||!((B=(z=l.value.chart.tooltip)==null?void 0:z.dataPoints)!=null&&B.length)||(D.interactionMode==="interactive"?s.clickedSegment=l.value.chart.tooltip.dataPoints[0]:s.destroyClickedSegment())},ut=()=>{if(x.value){x.value=!1;return}D.interactionMode!=="idle"?X():Q(),$()};h.watch(()=>e.type,()=>{D.interactionMode="idle",D.showTooltip=!1,s.destroyClickedSegment()});const V=z=>{z.preventDefault(),z.stopPropagation();const{xStart:B,xEnd:ft}=z.detail;B&&ft&&(y.value={start:new Date(B),end:new Date(ft),type:"absolute"},M?D.interactionMode="zoom-interactive":(i("zoom-time-range",{start:new Date(B),end:new Date(ft),type:"absolute"}),X()),i("select-chart-range",y.value))},G=z=>{M&&(D.interactionMode="selecting-chart-area"),x.value=!0,s.pause(),r.pause();const{xStart:B,xEnd:ft}=z.detail;B&&ft&&(y.value={start:new Date(B),end:new Date(ft),type:"absolute"})},J=z=>{if(!p.value||D.interactionMode==="idle")return;const B=z.target;B&&p.value.contains(B)||x.value||X(!1)};return h.watch(()=>{var z;return(z=l.value)==null?void 0:z.chart},()=>{var z;(z=l.value)!=null&&z.chart&&(l.value.chart.canvas.removeEventListener("dragSelect",V),l.value.chart.canvas.removeEventListener("dragSelectMove",G),l.value.chart.canvas.addEventListener("dragSelect",V),l.value.chart.canvas.addEventListener("dragSelectMove",G))}),h.onMounted(()=>{document.addEventListener("click",J,!0)}),h.onUnmounted(()=>{var z;(z=l.value)!=null&&z.chart&&(l.value.chart.canvas.removeEventListener("dragSelect",V),l.value.chart.canvas.removeEventListener("dragSelectMove",G)),document.removeEventListener("click",J,!0)}),(z,B)=>(h.openBlock(),h.createElementBlock("div",{ref:"chartParent",class:h.normalizeClass(["chart-parent",F(h.unref(g))]),"data-testid":"line-chart-parent"},[h.createElementVNode("div",{class:"chart-container",onClick:B[0]||(B[0]=ft=>ut())},[z.type==="timeseries_line"?(h.openBlock(),h.createBlock(h.unref(eS),{key:b.value,ref_key:"chartInstance",ref:l,"chart-id":h.unref(u),class:"chart-canvas",data:z.chartData,"data-testid":"time-series-line-chart",options:h.unref(P),plugins:O.value},null,8,["chart-id","data","options","plugins"])):z.type==="timeseries_bar"?(h.openBlock(),h.createBlock(h.unref(tS),{key:_.value,ref_key:"chartInstance",ref:l,"chart-id":h.unref(u),class:"chart-canvas",data:z.chartData,"data-testid":"time-series-bar-chart",options:h.unref(P),plugins:O.value},null,8,["chart-id","data","options","plugins"])):h.createCommentVNode("",!0)]),I.value?h.createCommentVNode("",!0):(h.openBlock(),h.createBlock(pl,{key:0,ref_key:"tooltipElement",ref:f,"absolute-left":h.unref(S),"absolute-top":h.unref(C),"data-testid":"tooltip",state:D,"tooltip-title":z.tooltipTitle,"zoom-action-items":z.zoomActionItems,"zoom-time-range":y.value,onDimensions:U,onOnAction:B[1]||(B[1]=()=>X(!1))},null,8,["absolute-left","absolute-top","state","tooltip-title","zoom-action-items","zoom-time-range"])),h.createVNode(ml,{id:h.unref(c),"chart-instance":l.value,"data-testid":"legend",items:d.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-07b8c4d8"]]),fS={class:"analytics-chart-shell"},gS={key:0,class:"chart-header"},pS={class:"tooltip-content"},mS={key:2,class:"analytics-chart-parent"},yS=h.defineComponent({__name:"AnalyticsChart",props:{chartData:{},chartOptions:{},tooltipTitle:{default:""},emptyStateTitle:{default:""},emptyStateDescription:{default:""},legendPosition:{default:Nt.Right},syntheticsDataKey:{default:""},showLegendValues:{type:Boolean,default:!0},showAnnotations:{type:Boolean,default:!0},timeseriesZoom:{type:Boolean,default:!1},requestsLink:{default:void 0},exploreLink:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:t}){const e=t,i=n,{i18n:s}=bt.useI18n(),r=h.computed(()=>p.value?bt.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Lr,threshold:i.chartOptions.threshold||void 0},h.toRef(i,"chartData")).value:bt.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Lr},h.toRef(i,"chartData")).value),o=h.computed(()=>{var P;return(P=i.chartData)!=null&&P.meta?"start_ms"in i.chartData.meta?i.chartData.meta.end_ms-i.chartData.meta.start_ms:void 0:0}),a=h.computed(()=>{var P;return(P=i.chartData.meta)!=null&&P.metric_units?Object.values(i.chartData.meta.metric_units)[0]:""}),l=h.computed(()=>i.showLegendValues&&i.legendPosition!==Nt.Bottom),{legendValues:c}=bt.useChartLegendValues(r,i.chartOptions.type,a),u=h.computed(()=>{var P,F,U;return((U=(F=(P=i.chartData)==null?void 0:P.meta)==null?void 0:F.limit)==null?void 0:U.toString())||null}),d=h.computed(()=>{var P,F;return((F=(P=i.chartData)==null?void 0:P.meta)==null?void 0:F.truncated)||!1}),f=s.t("limitedResultsShown",{maxReturned:u.value}),g=h.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),p=h.computed(()=>["timeseries_bar","timeseries_line"].some(P=>P===i.chartOptions.type)),y=h.computed(()=>i.chartOptions.type==="donut"),x=h.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),v=h.computed(()=>{var U,X;if(!((U=i.chartData)!=null&&U.meta.metric_names)||!((X=i.chartData)!=null&&X.meta.metric_units))return;const P=i.chartData.meta.metric_names[0],F=i.chartData.meta.metric_units[P];if(i.chartData.meta.metric_names.length>1){if(P.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${F}`,{plural:"s"})});if(P.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${F}`,{plural:"s"})})}return s.t(`chartLabels.${P}`)}),M=h.computed(()=>{var U,X,Q;if(!((U=i.chartData)!=null&&U.meta.metric_names)||!((X=i.chartData)!=null&&X.meta.metric_units))return;const P=i.chartData.meta.metric_names[0],F=i.chartData.meta.metric_units[P];if(i.chartData.meta.metric_names.length>1){if(P.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${F}`,{plural:"s"})});if(P.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${F}`,{plural:"s"})})}return((Q=i.chartOptions)==null?void 0:Q.metricAxesTitle)||s.te(`metricAxisTitles.${P}`)&&s.te(`chartUnits.${F}`)&&s.t(`metricAxisTitles.${P}`,{unit:s.t(`chartUnits.${F}`,{plural:"s"})})||void 0}),D=h.computed(()=>{const F=`chartLabels.${p.value?"Time":Object.keys(i.chartData.meta.display||i.chartData.meta.metric_names)[0]}`;return i.chartOptions.dimensionAxesTitle||s.te(F)&&s.t(F)||void 0}),S=h.computed(()=>{const P=Qa(Number(i.chartData.meta.granularity_ms));return s.t(`granularityAxisTitles.${P}`)}),C=h.computed(()=>i.emptyStateTitle||s.t("noDataAvailableTitle")),R=h.computed(()=>i.emptyStateDescription||s.t("noDataAvailableDescription")),O=h.computed(()=>p.value?dw(r.value):i.chartData&&i.chartData.meta&&i.chartData.data.length),b=h.computed(()=>i.chartData.meta.granularity_ms?Qa(i.chartData.meta.granularity_ms)||"hourly":Qa(new Date(i.chartData.data[1].timestamp).getTime()-new Date(i.chartData.data[0].timestamp).getTime())||"hourly"),_=h.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(P,F)=>P.text===s.t("chartLabels.____OTHER____")?1:F.text===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(P.text,10))&&!isNaN(parseInt(F.text,10))?P.text<F.text?-1:1:P.value&&F.value?F.value.raw-P.value.raw:0),T=h.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(P,F)=>P.label===s.t("chartLabels.____OTHER____")?1:F.label===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(P.label,10))&&!isNaN(parseInt(F.label,10))?P.label<F.label?-1:1:P.value&&F.value?F.rawValue-P.rawValue:0),I=h.computed(()=>[{label:s.t("zoom_action_items.zoom"),action:P=>e("zoom-time-range",P)},...i.exploreLink?[{label:s.t("zoom_action_items.explore"),href:i.exploreLink.href}]:[],...i.requestsLink?[{label:s.t("zoom_action_items.view_requests"),href:i.requestsLink.href}]:[]]);return h.provide("showLegendValues",l),h.provide("legendPosition",h.toRef(i,"legendPosition")),(P,F)=>{const U=h.resolveComponent("KTooltip"),X=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",fS,[O.value&&d.value&&u.value?(h.openBlock(),h.createElementBlock("div",gS,[h.createVNode(U,{class:"tooltip","max-width":"500",placement:"right"},{content:h.withCtx(()=>[h.createElementVNode("div",pS,h.toDisplayString(h.unref(f)),1)]),default:h.withCtx(()=>[h.createVNode(h.unref(wo.WarningIcon),{color:`var(--kui-color-text-warning, ${h.unref(gM)})`,size:h.unref(pM)},null,8,["color","size"])]),_:1})])):h.createCommentVNode("",!0),O.value?(h.openBlock(),h.createElementBlock("div",mS,[p.value?(h.openBlock(),h.createBlock(hS,{key:0,"chart-data":r.value,"chart-legend-sort-fn":_.value,"chart-tooltip-sort-fn":T.value,"dimension-axes-title":S.value,fill:P.chartOptions.stacked,granularity:b.value,"legend-values":h.unref(c),"metric-axes-title":M.value,"metric-unit":a.value,stacked:P.chartOptions.stacked,"synthetics-data-key":P.syntheticsDataKey,"time-range-ms":o.value,"tooltip-metric-display":v.value,"tooltip-title":P.tooltipTitle,type:P.chartOptions.type,zoom:P.timeseriesZoom,"zoom-action-items":I.value,onSelectChartRange:F[0]||(F[0]=Q=>e("select-chart-range",Q)),onZoomTimeRange:F[1]||(F[1]=Q=>e("zoom-time-range",Q))},null,8,["chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","fill","granularity","legend-values","metric-axes-title","metric-unit","stacked","synthetics-data-key","time-range-ms","tooltip-metric-display","tooltip-title","type","zoom","zoom-action-items"])):g.value?(h.openBlock(),h.createBlock(UD,{key:1,annotations:P.showAnnotations,"chart-data":r.value,"chart-legend-sort-fn":_.value,"chart-tooltip-sort-fn":T.value,"data-testid":"bar-chart-container","dimension-axes-title":D.value,"legend-values":h.unref(c),"metric-axes-title":M.value,"metric-unit":a.value,orientation:x.value,stacked:P.chartOptions.stacked,"synthetics-data-key":P.syntheticsDataKey,"tooltip-metric-display":v.value,"tooltip-title":P.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-metric-display","tooltip-title"])):y.value?(h.openBlock(),h.createBlock(sS,{key:2,"chart-data":r.value,"dataset-colors":P.chartOptions.chartDatasetColors||h.unref(Lr),"legend-position":P.legendPosition,"legend-values":h.unref(c),"metric-unit":a.value,"synthetics-data-key":P.syntheticsDataKey,"tooltip-dimension-display":D.value,"tooltip-metric-display":v.value,"tooltip-title":P.tooltipTitle},null,8,["chart-data","dataset-colors","legend-position","legend-values","metric-unit","synthetics-data-key","tooltip-dimension-display","tooltip-metric-display","tooltip-title"])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(X,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(C.value),1)]),default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(R.value),1)]),_:1}))])}}}),bS=Pe(yS,[["__scopeId","data-v-a4f0a292"]]),_S={class:"chart-parent","data-testid":"gauge-chart-parent"},xS={class:"chart-totals-flex"},wS={key:1,class:"metric-small","data-testid":"gauge-chart-total"},vS=Pe(h.defineComponent({__name:"GaugeChart",props:{chartData:{type:Object,required:!1,default:null},metricDisplay:{type:String,required:!1,default:"hidden"},numerator:{type:Number,required:!1,default:0},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:sn},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}=bt.useI18n(),i=h.ref(eo()),s=h.computed(()=>[t.chartData.datasets.reduce((p,y)=>(p.labels.push(y.label),p.borderColor.push(y.backgroundColor),p.backgroundColor.push(y.backgroundColor),p.data.push(y.data.reduce((x,v)=>x+v,0)),p),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),r=h.computed(()=>({...t.chartData,datasets:s.value}));bt.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const o={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},a=h.ref(),l=h.computed(()=>{var g;return vs((g=s==null?void 0:s.value[0])==null?void 0:g.data[t.numerator],{capital:!0})}),c=h.computed(()=>{var g,p;return vs(((g=s==null?void 0:s.value[0])==null?void 0:g.data[0])+((p=s==null?void 0:s.value[0])==null?void 0:p.data[1]),{capital:!0})}),u=h.computed(()=>{var g;return`color: ${(g=s==null?void 0:s.value[0])==null?void 0:g.backgroundColor[t.numerator]}`}),d=h.computed(()=>["full","single"].includes(t.metricDisplay)),f=h.computed(()=>t.metricDisplay==="full");return(g,p)=>(h.openBlock(),h.createElementBlock("div",_S,[h.createElementVNode("div",xS,[d.value?(h.openBlock(),h.createElementBlock("div",{key:0,class:"metric-large","data-testid":"gauge-chart-metric",style:h.normalizeStyle(u.value)},h.toDisplayString(l.value),5)):h.createCommentVNode("",!0),f.value?(h.openBlock(),h.createElementBlock("div",wS,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(cg),{ref_key:"chartInstance",ref:a,"chart-id":i.value,data:r.value,options:o},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-32e7f9e0"]]),MS={class:"chart-parent","data-testid":"single-value-parent"},kS={key:1,class:"single-value-wrapper"},DS={class:"single-value","data-testid":"single-value-chart"},SS={key:0,class:"single-value-unit"},TS=Pe(h.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:of}},setup(n){const{i18n:{t}}=bt.useI18n(),e=n,i=h.computed(()=>e.data.data[0]),s=h.computed(()=>{var c,u;return(u=(c=e.data.meta)==null?void 0:c.metric_names)==null?void 0:u[0]}),r=h.computed(()=>{var u,d;const c=s.value?(d=(u=e.data.meta)==null?void 0:u.metric_units)==null?void 0:d[s.value]:void 0;if(c)return t(`chartUnits.${c}`,{plural:""})}),o=h.computed(()=>{var c;return s.value==="request_per_minute"||!!((c=s.value)!=null&&c.includes("_latency_"))}),a=h.computed(()=>!i.value||!s.value||typeof i.value.event[s.value]!="number"?null:i.value.event[s.value]),l=h.computed(()=>{var d;const c=a.value;if(c===null)return"";if((d=s.value)!=null&&d.includes("_size_"))return Fr(c);if(c>=1e9){const f=(c/1e9).toFixed(1);return f.endsWith(".0")?`${Math.floor(c/1e9)}B`:`${f}B`}if(c>=1e7){const f=(c/1e6).toFixed(1);return f.endsWith(".0")?`${Math.floor(c/1e6)}M`:`${f}M`}const u=e.decimalPoints&&typeof e.decimalPoints=="number"?e.decimalPoints:of;return c.toLocaleString("en-US",{maximumFractionDigits:u})});return h.onMounted(()=>{var c,u;((u=(c=e.data)==null?void 0:c.data)==null?void 0:u.length)>1&&console.warn("SingleValue chart should only be used with a single data point. Data length:",e.data.data.length)}),(c,u)=>{const d=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",MS,[a.value===null?(h.openBlock(),h.createBlock(d,{key:0,class:"single-value-error","data-testid":"single-value-error","icon-variant":"error",title:h.unref(t)("singleValue.valueError")},null,8,["title"])):(h.openBlock(),h.createElementBlock("div",kS,[h.createElementVNode("span",DS,h.toDisplayString(l.value),1),o.value?(h.openBlock(),h.createElementBlock("span",SS," "+h.toDisplayString(r.value),1)):h.createCommentVNode("",!0)]))])}}}),[["__scopeId","data-v-c25764ee"]]),CS={class:"simple-chart-shell"},PS={key:1,class:"analytics-chart-parent"},OS=Pe(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}=bt.useI18n(),i=h.computed(()=>{var u;const c=bt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||sn},h.toRef(t,"chartData")).value;return(u=t.chartOptions)!=null&&u.reverseDataset&&(c==null||c.datasets.reverse()),c}),s=h.computed(()=>{var c;return(c=t.chartData.meta)!=null&&c.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""}),r=h.computed(()=>t.chartOptions.type==="gauge"),o=h.computed(()=>t.chartOptions.type==="single_value"),a=h.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),l=h.computed(()=>{var u,d;const c=t.chartData&&t.chartData.meta&&t.chartData.data.length;if(o.value){const f=(d=(u=t.chartData.meta)==null?void 0:u.metric_names)==null?void 0:d[0];return c&&t.chartData.data[0].event[f]!==null}return c});return(c,u)=>{const d=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",CS,[l.value?(h.openBlock(),h.createElementBlock("div",PS,[r.value?(h.openBlock(),h.createBlock(vS,{key:0,"chart-data":i.value,"dataset-colors":n.chartOptions.chartDatasetColors,"is-simple":"","metric-display":n.chartOptions.metricDisplay,"metric-unit":s.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),o.value?(h.openBlock(),h.createBlock(TS,{key:1,data:n.chartData,"decimal-points":n.chartOptions.decimalPoints},null,8,["data","decimal-points"])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(d,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(a.value),1)]),_:1}))])}}}),[["__scopeId","data-v-471652c8"]]),ES={class:"top-n-card-title","data-testid":"top-n-card-title"},AS={class:"top-n-card-description","data-testid":"top-n-card-description"},RS={key:3,class:"top-n-table","data-testid":"top-n-table"},IS={class:"table-headings"},LS={class:"table-row"},NS={class:"column-1"},FS={class:"column-2"},zS={class:"table-body","data-testid":"top-n-data"},BS=["data-testid"],HS={class:"column-1"},WS={class:"column-2"},YS=Pe(h.defineComponent({__name:"TopNTable",props:{title:{default:""},description:{default:""},data:{},emptyStateTitle:{default:""},isLoading:{type:Boolean,default:!1},titleTag:{default:"h2"}},setup(n){const t=n,{i18n:e}=bt.useI18n(),i=h.computed(()=>t.data.data),s=h.computed(()=>{var p;return!!((p=i.value)!=null&&p.length)}),r=h.computed(()=>{var p,y;return(p=t.data.meta)!=null&&p.display&&((y=Object.keys(t.data.meta.display))==null?void 0:y[0])||""}),o=h.computed(()=>r.value?t.data.meta.display[r.value]:{}),a=h.computed(()=>{var p,y;return(y=(p=t.data.meta)==null?void 0:p.metric_names)!=null&&y.length?t.data.meta.metric_names[0]:""}),l=h.computed(()=>a.value?e.t(`chartLabels.${a.value}`)||a.value:""),c=h.computed(()=>{if(!s.value)return"";if(t.data.meta){if(o.value&&!Object.keys(o.value).length)return e.t("topNTable.errors.display");if(!a.value)return e.t("topNTable.errors.metricNames")}else return e.t("topNTable.errors.meta");return""}),u=p=>{const y=p.event;return String(y[r.value])},d=p=>{const y=u(p),x=o.value&&o.value[y];return x?x.name:"-"},f=p=>{const y=u(p),x=o.value&&o.value[y];return x?!!x.deleted:!1},g=p=>{if(!a.value)return"–";const x=p.event[a.value];return x?vs(x,{capital:!0,round:!0}):"–"};return(p,y)=>{const x=h.resolveComponent("KEmptyState"),v=h.resolveComponent("KSkeleton"),M=h.resolveComponent("KCard");return h.openBlock(),h.createBlock(M,{class:"kong-ui-public-top-n-table","title-tag":p.titleTag},h.createSlots({default:h.withCtx(()=>[c.value?(h.openBlock(),h.createBlock(x,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(c.value),1)]),_:1})):p.isLoading?(h.openBlock(),h.createBlock(v,{key:1,"table-columns":2,type:"table"})):s.value?(h.openBlock(),h.createElementBlock("div",RS,[h.createElementVNode("div",IS,[h.createElementVNode("div",LS,[h.createElementVNode("div",NS,h.toDisplayString(h.unref(e).t("topNTable.nameLabel")),1),h.createElementVNode("div",FS,h.toDisplayString(l.value),1)])]),h.createElementVNode("div",zS,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(i.value,(D,S)=>(h.openBlock(),h.createElementBlock("div",{key:`entry-${S}`,class:"table-row","data-testid":`row-${u(D)}`},[h.createElementVNode("div",HS,[h.renderSlot(p.$slots,"name",{record:{id:u(D),name:d(D),deleted:f(D),dimension:r.value}},()=>[h.createTextVNode(h.toDisplayString(d(D)),1)],!0)]),h.createElementVNode("div",WS," "+h.toDisplayString(g(D)),1)],8,BS))),128))])])):(h.openBlock(),h.createBlock(x,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(p.emptyStateTitle||h.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[p.title?{name:"title",fn:h.withCtx(()=>[h.createElementVNode("span",ES,h.toDisplayString(p.title),1)]),key:"0"}:void 0,p.description?{name:"actions",fn:h.withCtx(()=>[h.createElementVNode("div",AS,h.toDisplayString(p.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-665e7735"]]);var no={exports:{}};no.exports,function(n,t){var e=200,i="Expected a function",s="__lodash_hash_undefined__",r=1,o=2,a=9007199254740991,l="[object Arguments]",c="[object Array]",u="[object Boolean]",d="[object Date]",f="[object Error]",g="[object Function]",p="[object GeneratorFunction]",y="[object Map]",x="[object Number]",v="[object Object]",M="[object Promise]",D="[object RegExp]",S="[object Set]",C="[object String]",R="[object Symbol]",O="[object WeakMap]",b="[object ArrayBuffer]",_="[object DataView]",T="[object Float32Array]",I="[object Float64Array]",P="[object Int8Array]",F="[object Int16Array]",U="[object Int32Array]",X="[object Uint8Array]",Q="[object Uint8ClampedArray]",$="[object Uint16Array]",ut="[object Uint32Array]",V=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,G=/^\w*$/,J=/^\./,z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,B=/[\\^$.*+?()[\]{}|]/g,ft=/\\(\\)?/g,yt=/^\[object .+?Constructor\]$/,vt=/^(?:0|[1-9]\d*)$/,gt={};gt[T]=gt[I]=gt[P]=gt[F]=gt[U]=gt[X]=gt[Q]=gt[$]=gt[ut]=!0,gt[l]=gt[c]=gt[b]=gt[u]=gt[_]=gt[d]=gt[f]=gt[g]=gt[y]=gt[x]=gt[v]=gt[D]=gt[S]=gt[C]=gt[O]=!1;var pt=typeof be=="object"&&be&&be.Object===Object&&be,H=typeof self=="object"&&self&&self.Object===Object&&self,j=pt||H||Function("return this")(),Y=t&&!t.nodeType&&t,Z=Y&&!0&&n&&!n.nodeType&&n,tt=Z&&Z.exports===Y,et=tt&&pt.process,it=function(){try{return et&&et.binding("util")}catch{}}(),nt=it&&it.isTypedArray;function xt(m,k){for(var L=-1,W=m?m.length:0;++L<W;)if(k(m[L],L,m))return!0;return!1}function at(m){return function(k){return k==null?void 0:k[m]}}function Pt(m,k){for(var L=-1,W=Array(m);++L<m;)W[L]=k(L);return W}function te(m){return function(k){return m(k)}}function ae(m,k){return m==null?void 0:m[k]}function Xt(m){var k=!1;if(m!=null&&typeof m.toString!="function")try{k=!!(m+"")}catch{}return k}function Oe(m){var k=-1,L=Array(m.size);return m.forEach(function(W,dt){L[++k]=[dt,W]}),L}function Mt(m,k){return function(L){return m(k(L))}}function qt(m){var k=-1,L=Array(m.size);return m.forEach(function(W){L[++k]=W}),L}var Bt=Array.prototype,Gt=Function.prototype,ie=Object.prototype,Xe=j["__core-js_shared__"],ei=function(){var m=/[^.]+$/.exec(Xe&&Xe.keys&&Xe.keys.IE_PROTO||"");return m?"Symbol(src)_1."+m:""}(),Ne=Gt.toString,Ht=ie.hasOwnProperty,_e=ie.toString,ni=RegExp("^"+Ne.call(Ht).replace(B,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),io=j.Symbol,so=j.Uint8Array,Ls=ie.propertyIsEnumerable,ii=Bt.splice,Ns=Mt(Object.keys,Object),si=dn(j,"DataView"),an=dn(j,"Map"),ln=dn(j,"Promise"),Fs=dn(j,"Set"),zs=dn(j,"WeakMap"),ri=dn(Object,"create"),wl=fn(si),vl=fn(an),ro=fn(ln),oo=fn(Fs),cn=fn(zs),Ei=io?io.prototype:void 0,Bs=Ei?Ei.valueOf:void 0,ao=Ei?Ei.toString:void 0;function un(m){var k=-1,L=m?m.length:0;for(this.clear();++k<L;){var W=m[k];this.set(W[0],W[1])}}function Ml(){this.__data__=ri?ri(null):{}}function Fe(m){return this.has(m)&&delete this.__data__[m]}function kl(m){var k=this.__data__;if(ri){var L=k[m];return L===s?void 0:L}return Ht.call(k,m)?k[m]:void 0}function Dl(m){var k=this.__data__;return ri?k[m]!==void 0:Ht.call(k,m)}function Sl(m,k){var L=this.__data__;return L[m]=ri&&k===void 0?s:k,this}un.prototype.clear=Ml,un.prototype.delete=Fe,un.prototype.get=kl,un.prototype.has=Dl,un.prototype.set=Sl;function ze(m){var k=-1,L=m?m.length:0;for(this.clear();++k<L;){var W=m[k];this.set(W[0],W[1])}}function Tl(){this.__data__=[]}function En(m){var k=this.__data__,L=Ii(k,m);if(L<0)return!1;var W=k.length-1;return L==W?k.pop():ii.call(k,L,1),!0}function Cl(m){var k=this.__data__,L=Ii(k,m);return L<0?void 0:k[L][1]}function Pl(m){return Ii(this.__data__,m)>-1}function Ol(m,k){var L=this.__data__,W=Ii(L,m);return W<0?L.push([m,k]):L[W][1]=k,this}ze.prototype.clear=Tl,ze.prototype.delete=En,ze.prototype.get=Cl,ze.prototype.has=Pl,ze.prototype.set=Ol;function Be(m){var k=-1,L=m?m.length:0;for(this.clear();++k<L;){var W=m[k];this.set(W[0],W[1])}}function El(){this.__data__={hash:new un,map:new(an||ze),string:new un}}function An(m){return Fi(this,m).delete(m)}function Al(m){return Fi(this,m).get(m)}function Rl(m){return Fi(this,m).has(m)}function Il(m,k){return Fi(this,m).set(m,k),this}Be.prototype.clear=El,Be.prototype.delete=An,Be.prototype.get=Al,Be.prototype.has=Rl,Be.prototype.set=Il;function Ai(m){var k=-1,L=m?m.length:0;for(this.__data__=new Be;++k<L;)this.add(m[k])}function Ll(m){return this.__data__.set(m,s),this}function Nl(m){return this.__data__.has(m)}Ai.prototype.add=Ai.prototype.push=Ll,Ai.prototype.has=Nl;function Ee(m){this.__data__=new ze(m)}function Ri(){this.__data__=new ze}function Fl(m){return this.__data__.delete(m)}function Hs(m){return this.__data__.get(m)}function zl(m){return this.__data__.has(m)}function Bl(m,k){var L=this.__data__;if(L instanceof ze){var W=L.__data__;if(!an||W.length<e-1)return W.push([m,k]),this;L=this.__data__=new Be(W)}return L.set(m,k),this}Ee.prototype.clear=Ri,Ee.prototype.delete=Fl,Ee.prototype.get=Hs,Ee.prototype.has=zl,Ee.prototype.set=Bl;function Hl(m,k){var L=w(m)||po(m)?Pt(m.length,String):[],W=L.length,dt=!!W;for(var K in m)Ht.call(m,K)&&!(dt&&(K=="length"||Ys(K,W)))&&L.push(K);return L}function Ii(m,k){for(var L=m.length;L--;)if(go(m[L][0],k))return L;return-1}var Wl=Zl();function Yl(m,k){return m&&Wl(m,k,ai)}function Li(m,k){k=zi(k,m)?[k]:qe(k);for(var L=0,W=k.length;m!=null&&L<W;)m=m[hn(k[L++])];return L&&L==W?m:void 0}function jl(m){return _e.call(m)}function Vl(m,k){return m!=null&&k in Object(m)}function Ws(m,k,L,W,dt){return m===k?!0:m==null||k==null||!Kt(m)&&!xe(k)?m!==m&&k!==k:$l(m,k,Ws,L,W,dt)}function $l(m,k,L,W,dt,K){var _t=w(m),Zt=w(k),Wt=c,ce=c;_t||(Wt=le(m),Wt=Wt==l?v:Wt),Zt||(ce=le(k),ce=ce==l?v:ce);var we=Wt==v&&!Xt(m),ve=ce==v&&!Xt(k),fe=Wt==ce;if(fe&&!we)return K||(K=new Ee),_t||mo(m)?uo(m,k,L,W,dt,K):Ql(m,k,Wt,L,W,dt,K);if(!(dt&o)){var Ae=we&&Ht.call(m,"__wrapped__"),Re=ve&&Ht.call(k,"__wrapped__");if(Ae||Re){var Ln=Ae?m.value():m,gn=Re?k.value():k;return K||(K=new Ee),L(Ln,gn,W,dt,K)}}return fe?(K||(K=new Ee),Jl(m,k,L,W,dt,K)):!1}function Ul(m,k,L,W){var dt=L.length,K=dt;if(m==null)return!K;for(m=Object(m);dt--;){var _t=L[dt];if(_t[2]?_t[1]!==m[_t[0]]:!(_t[0]in m))return!1}for(;++dt<K;){_t=L[dt];var Zt=_t[0],Wt=m[Zt],ce=_t[1];if(_t[2]){if(Wt===void 0&&!(Zt in m))return!1}else{var we=new Ee,ve;if(!(ve===void 0?Ws(ce,Wt,W,r|o,we):ve))return!1}}return!0}function Xl(m){if(!Kt(m)||ho(m))return!1;var k=q(m)||Xt(m)?ni:yt;return k.test(fn(m))}function ql(m){return xe(m)&&Vt(m.length)&&!!gt[_e.call(m)]}function lo(m){return typeof m=="function"?m:m==null?Bi:typeof m=="object"?w(m)?Ni(m[0],m[1]):Kl(m):OT(m)}function Gl(m){if(!nc(m))return Ns(m);var k=[];for(var L in Object(m))Ht.call(m,L)&&L!="constructor"&&k.push(L);return k}function Kl(m){var k=tc(m);return k.length==1&&k[0][2]?Vs(k[0][0],k[0][1]):function(L){return L===m||Ul(L,m,k)}}function Ni(m,k){return zi(m)&&fo(k)?Vs(hn(m),k):function(L){var W=yo(L,m);return W===void 0&&W===k?bo(L,m):Ws(k,W,void 0,r|o)}}function Rn(m){return function(k){return Li(k,m)}}function co(m){if(typeof m=="string")return m;if(ee(m))return ao?ao.call(m):"";var k=m+"";return k=="0"&&1/m==-1/0?"-0":k}function qe(m){return w(m)?m:ic(m)}function Zl(m){return function(k,L,W){for(var dt=-1,K=Object(k),_t=W(k),Zt=_t.length;Zt--;){var Wt=_t[++dt];if(L(K[Wt],Wt,K)===!1)break}return k}}function uo(m,k,L,W,dt,K){var _t=dt&o,Zt=m.length,Wt=k.length;if(Zt!=Wt&&!(_t&&Wt>Zt))return!1;var ce=K.get(m);if(ce&&K.get(k))return ce==k;var we=-1,ve=!0,fe=dt&r?new Ai:void 0;for(K.set(m,k),K.set(k,m);++we<Zt;){var Ae=m[we],Re=k[we];if(W)var Ln=_t?W(Re,Ae,we,k,m,K):W(Ae,Re,we,m,k,K);if(Ln!==void 0){if(Ln)continue;ve=!1;break}if(fe){if(!xt(k,function(gn,li){if(!fe.has(li)&&(Ae===gn||L(Ae,gn,W,dt,K)))return fe.add(li)})){ve=!1;break}}else if(!(Ae===Re||L(Ae,Re,W,dt,K))){ve=!1;break}}return K.delete(m),K.delete(k),ve}function Ql(m,k,L,W,dt,K,_t){switch(L){case _:if(m.byteLength!=k.byteLength||m.byteOffset!=k.byteOffset)return!1;m=m.buffer,k=k.buffer;case b:return!(m.byteLength!=k.byteLength||!W(new so(m),new so(k)));case u:case d:case x:return go(+m,+k);case f:return m.name==k.name&&m.message==k.message;case D:case C:return m==k+"";case y:var Zt=Oe;case S:var Wt=K&o;if(Zt||(Zt=qt),m.size!=k.size&&!Wt)return!1;var ce=_t.get(m);if(ce)return ce==k;K|=r,_t.set(m,k);var we=uo(Zt(m),Zt(k),W,dt,K,_t);return _t.delete(m),we;case R:if(Bs)return Bs.call(m)==Bs.call(k)}return!1}function Jl(m,k,L,W,dt,K){var _t=dt&o,Zt=ai(m),Wt=Zt.length,ce=ai(k),we=ce.length;if(Wt!=we&&!_t)return!1;for(var ve=Wt;ve--;){var fe=Zt[ve];if(!(_t?fe in k:Ht.call(k,fe)))return!1}var Ae=K.get(m);if(Ae&&K.get(k))return Ae==k;var Re=!0;K.set(m,k),K.set(k,m);for(var Ln=_t;++ve<Wt;){fe=Zt[ve];var gn=m[fe],li=k[fe];if(W)var xg=_t?W(li,gn,fe,k,m,K):W(gn,li,fe,m,k,K);if(!(xg===void 0?gn===li||L(gn,li,W,dt,K):xg)){Re=!1;break}Ln||(Ln=fe=="constructor")}if(Re&&!Ln){var _o=m.constructor,xo=k.constructor;_o!=xo&&"constructor"in m&&"constructor"in k&&!(typeof _o=="function"&&_o instanceof _o&&typeof xo=="function"&&xo instanceof xo)&&(Re=!1)}return K.delete(m),K.delete(k),Re}function Fi(m,k){var L=m.__data__;return js(k)?L[typeof k=="string"?"string":"hash"]:L.map}function tc(m){for(var k=ai(m),L=k.length;L--;){var W=k[L],dt=m[W];k[L]=[W,dt,fo(dt)]}return k}function dn(m,k){var L=ae(m,k);return Xl(L)?L:void 0}var le=jl;(si&&le(new si(new ArrayBuffer(1)))!=_||an&&le(new an)!=y||ln&&le(ln.resolve())!=M||Fs&&le(new Fs)!=S||zs&&le(new zs)!=O)&&(le=function(m){var k=_e.call(m),L=k==v?m.constructor:void 0,W=L?fn(L):void 0;if(W)switch(W){case wl:return _;case vl:return y;case ro:return M;case oo:return S;case cn:return O}return k});function ec(m,k,L){k=zi(k,m)?[k]:qe(k);for(var W,dt=-1,_t=k.length;++dt<_t;){var K=hn(k[dt]);if(!(W=m!=null&&L(m,K)))break;m=m[K]}if(W)return W;var _t=m?m.length:0;return!!_t&&Vt(_t)&&Ys(K,_t)&&(w(m)||po(m))}function Ys(m,k){return k=k??a,!!k&&(typeof m=="number"||vt.test(m))&&m>-1&&m%1==0&&m<k}function zi(m,k){if(w(m))return!1;var L=typeof m;return L=="number"||L=="symbol"||L=="boolean"||m==null||ee(m)?!0:G.test(m)||!V.test(m)||k!=null&&m in Object(k)}function js(m){var k=typeof m;return k=="string"||k=="number"||k=="symbol"||k=="boolean"?m!=="__proto__":m===null}function ho(m){return!!ei&&ei in m}function nc(m){var k=m&&m.constructor,L=typeof k=="function"&&k.prototype||ie;return m===L}function fo(m){return m===m&&!Kt(m)}function Vs(m,k){return function(L){return L==null?!1:L[m]===k&&(k!==void 0||m in Object(L))}}var ic=oi(function(m){m=In(m);var k=[];return J.test(m)&&k.push(""),m.replace(z,function(L,W,dt,K){k.push(dt?K.replace(ft,"$1"):W||L)}),k});function hn(m){if(typeof m=="string"||ee(m))return m;var k=m+"";return k=="0"&&1/m==-1/0?"-0":k}function fn(m){if(m!=null){try{return Ne.call(m)}catch{}try{return m+""}catch{}}return""}function oi(m,k){if(typeof m!="function"||k&&typeof k!="function")throw new TypeError(i);var L=function(){var W=arguments,dt=k?k.apply(this,W):W[0],K=L.cache;if(K.has(dt))return K.get(dt);var _t=m.apply(this,W);return L.cache=K.set(dt,_t),_t};return L.cache=new(oi.Cache||Be),L}oi.Cache=Be;function go(m,k){return m===k||m!==m&&k!==k}function po(m){return N(m)&&Ht.call(m,"callee")&&(!Ls.call(m,"callee")||_e.call(m)==l)}var w=Array.isArray;function A(m){return m!=null&&Vt(m.length)&&!q(m)}function N(m){return xe(m)&&A(m)}function q(m){var k=Kt(m)?_e.call(m):"";return k==g||k==p}function Vt(m){return typeof m=="number"&&m>-1&&m%1==0&&m<=a}function Kt(m){var k=typeof m;return!!m&&(k=="object"||k=="function")}function xe(m){return!!m&&typeof m=="object"}function ee(m){return typeof m=="symbol"||xe(m)&&_e.call(m)==R}var mo=nt?te(nt):ql;function In(m){return m==null?"":co(m)}function yo(m,k,L){var W=m==null?void 0:Li(m,k);return W===void 0?L:W}function bo(m,k){return m!=null&&ec(m,k,Vl)}function ai(m){return A(m)?Hl(m):Gl(m)}function $s(m,k){var L={};return k=lo(k),Yl(m,function(W,dt,K){L[k(W,dt,K)]=W}),L}function Bi(m){return m}function OT(m){return zi(m)?at(hn(m)):Rn(m)}n.exports=$s}(no,no.exports);var jS=no.exports;const VS=ja(jS);var $S=9007199254740991,US="[object Arguments]",XS="[object Function]",qS="[object GeneratorFunction]",GS="[object Symbol]",KS=typeof be=="object"&&be&&be.Object===Object&&be,ZS=typeof self=="object"&&self&&self.Object===Object&&self,QS=KS||ZS||Function("return this")();function JS(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 tT(n,t){for(var e=-1,i=n?n.length:0,s=Array(i);++e<i;)s[e]=t(n[e],e,n);return s}function eT(n,t){for(var e=-1,i=t.length,s=n.length;++e<i;)n[s+e]=t[e];return n}var _l=Object.prototype,nT=_l.hasOwnProperty,xl=_l.toString,hg=QS.Symbol,iT=_l.propertyIsEnumerable,fg=hg?hg.isConcatSpreadable:void 0,gg=Math.max;function sT(n,t,e,i,s){var r=-1,o=n.length;for(e||(e=lT),s||(s=[]);++r<o;){var a=n[r];e(a)?eT(s,a):s[s.length]=a}return s}function rT(n,t){return n=Object(n),oT(n,t,function(e,i){return i in n})}function oT(n,t,e){for(var i=-1,s=t.length,r={};++i<s;){var o=t[i],a=n[o];e(a,o)&&(r[o]=a)}return r}function aT(n,t){return t=gg(t===void 0?n.length-1:t,0),function(){for(var e=arguments,i=-1,s=gg(e.length-t,0),r=Array(s);++i<s;)r[i]=e[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=e[i];return o[t]=r,JS(n,this,o)}}function lT(n){return dT(n)||uT(n)||!!(fg&&n&&n[fg])}function cT(n){if(typeof n=="string"||yT(n))return n;var t=n+"";return t=="0"&&1/n==-1/0?"-0":t}function uT(n){return fT(n)&&nT.call(n,"callee")&&(!iT.call(n,"callee")||xl.call(n)==US)}var dT=Array.isArray;function hT(n){return n!=null&&pT(n.length)&&!gT(n)}function fT(n){return pg(n)&&hT(n)}function gT(n){var t=mT(n)?xl.call(n):"";return t==XS||t==qS}function pT(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=$S}function mT(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function pg(n){return!!n&&typeof n=="object"}function yT(n){return typeof n=="symbol"||pg(n)&&xl.call(n)==GS}var bT=aT(function(n,t){return n==null?{}:rT(n,tT(sT(t),cT))}),_T=bT;const xT=ja(_T);var mg={exports:{}};(function(n,t){(function(e,i){i()})(be,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 i(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 s(c){var u=new XMLHttpRequest;u.open("HEAD",c,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function r(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 o=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof be=="object"&&be.global===be?be:void 0,a=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=o.saveAs||(typeof window!="object"||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(c,u,d){var f=o.URL||o.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?r(g):s(g.href)?i(c,u,d):r(g,g.target="_blank")):(g.href=f.createObjectURL(c),setTimeout(function(){f.revokeObjectURL(g.href)},4e4),setTimeout(function(){r(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(s(c))i(c,u,d);else{var f=document.createElement("a");f.href=c,f.target="_blank",setTimeout(function(){r(f)})}}:function(c,u,d,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof c=="string")return i(c,u,d);var g=c.type==="application/octet-stream",p=/constructor/i.test(o.HTMLElement)||o.safari,y=/CriOS\/[\d]+/.test(navigator.userAgent);if((y||g&&p||a)&&typeof FileReader<"u"){var x=new FileReader;x.onloadend=function(){var D=x.result;D=y?D:D.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=D:location=D,f=null},x.readAsDataURL(c)}else{var v=o.URL||o.webkitURL,M=v.createObjectURL(c);f?f.location=M:location.href=M,f=null,setTimeout(function(){v.revokeObjectURL(M)},4e4)}});o.saveAs=l.saveAs=l,n.exports=l})})(mg);var wT=mg.exports,yg={exports:{}};/* @license
|
|
28
|
+
*/const XD={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"};cu._date.override({_id:"date-fns",formats:function(){return XD},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=lt(n):e==="string"&&(typeof t=="string"?n=Bx(n,t,new Date,this.options):n=Xd(n,this.options)),ba(n)?n.getTime():null},format:function(n,t){return Wd(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return ma(n,t);case"second":return I0(n,t);case"minute":return A0(n,t);case"hour":return P0(n,t);case"day":return Cr(n,t);case"week":return L0(n,t);case"month":return pa(n,t);case"quarter":return R0(n,t);case"year":return N0(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return _a(n,t);case"second":return V0(n,t);case"minute":return W0(n,t);case"hour":return H0(n,t);case"day":return Dd(n,t);case"week":return $0(n,t);case"month":return Pd(n,t);case"quarter":return j0(n,t);case"year":return U0(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return jx(n);case"minute":return Yx(n);case"hour":return Wx(n);case"day":return ya(n);case"week":return Ve(n);case"isoWeek":return Ve(n,{weekStartsOn:+e});case"month":return q0(n);case"quarter":return X0(n);case"year":return Od(n);default:return n}},endOf:function(n,t){switch(t){case"second":return t_(n);case"minute":return Q0(n);case"hour":return K0(n);case"day":return Td(n);case"week":return Z0(n);case"month":return Cd(n);case"quarter":return J0(n);case"year":return G0(n);default:return n}}});const og={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},qD={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...og,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},GD=h.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function Oi(n){return h.isProxy(n)?h.toRaw(n):n}function KD(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 ag(n,t){n.labels=t}function lg(n,t,e){const i=[];n.datasets=t.map(s=>{const r=n.datasets.find(o=>o[e]===s[e]);return!r||!s.data||i.includes(r)?{...s}:(i.push(r),Object.assign(r,s),r)})}function QD(n,t){const e={labels:[],datasets:[]};return ag(e,n.labels),lg(e,n.datasets,t),e}const JD=h.defineComponent({props:qD,setup(n,t){let{expose:e,slots:i}=t;const s=h.ref(null),r=h.shallowRef(null);e({chart:r});const o=()=>{if(!s.value)return;const{type:c,data:u,options:d,plugins:f,datasetIdKey:g}=n,p=QD(u,g),y=KD(p,u);r.value=new Se(s.value,{type:c,data:y,options:{...d},plugins:f})},a=()=>{const c=h.toRaw(r.value);c&&(n.destroyDelay>0?setTimeout(()=>{c.destroy(),r.value=null},n.destroyDelay):(c.destroy(),r.value=null))},l=c=>{c.update(n.updateMode)};return h.onMounted(o),h.onUnmounted(a),h.watch([()=>n.options,()=>n.data],(c,u)=>{let[d,f]=c,[g,p]=u;const y=h.toRaw(r.value);if(!y)return;let x=!1;if(d){const v=Oi(d),M=Oi(g);v&&v!==M&&(ZD(y,v),x=!0)}if(f){const v=Oi(f.labels),M=Oi(p.labels),D=Oi(f.datasets),S=Oi(p.datasets);v!==M&&(ag(y.config.data,v),x=!0),D&&D!==S&&(lg(y.config.data,D,n.datasetIdKey),x=!0)}x&&h.nextTick(()=>{l(y)})},{deep:!0}),()=>h.h("canvas",{role:"img",ariaLabel:n.ariaLabel,ariaDescribedby:n.ariaDescribedby,ref:s},[h.h("p",{},[i.default?i.default():""])])}});function bl(n,t){return Se.register(t),h.defineComponent({props:og,setup(e,i){let{expose:s}=i;const r=h.shallowRef(null),o=a=>{r.value=a==null?void 0:a.chart};return s({chart:r}),()=>h.h(JD,GD({ref:o},{type:n,...e}))}})}const tS=bl("bar",ts),cg=bl("doughnut",en),eS=bl("line",es),nS={class:"chart-container"},iS=h.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},legendPosition:{default:Nt.Right},legendValues:{default:void 0},syntheticsDataKey:{default:""},datasetColors:{default:()=>sn},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""}},setup(n){const t=n,{translateUnit:e}=bt.useTranslatedUnits(),i=crypto.randomUUID(),s=crypto.randomUUID(),r=h.ref([]),o=h.useTemplateRef("chartParent"),a=h.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:t.tooltipMetricDisplay,dimensionDisplay:t.tooltipDimensionDisplay,tooltipSeries:[],left:"",top:"",units:h.toRef(t,"metricUnit"),translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartID:s,chartType:"donut",interactionMode:"idle"}),{tooltipAbsoluteLeft:l,tooltipAbsoluteTop:c}=bt.useTooltipAbsolutePosition(o,a),u={id:i,afterUpdate(M){r.value=M.options.plugins.legend.labels.generateLabels(M).map(D=>({...D,value:t.legendValues&&t.legendValues[D.text],hidden:!1}))}},d=h.computed(()=>[u]),f=h.computed(()=>[t.chartData.datasets.reduce((D,S)=>(D.labels.push(S.label),D.backgroundColor.push(S.backgroundColor),D.borderColor.push(th(S.backgroundColor,50)),D.data.push(S.data.reduce((P,R)=>P+R,0)),D),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),g=h.computed(()=>({...t.chartData,datasets:f.value}));bt.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const{options:p}=bt.useDonutChartOptions({tooltipState:a,legendID:i}),y=h.ref(),x=M=>({[Nt.Right]:"legend-row",[Nt.Bottom]:"column",[Nt.Hidden]:"hidden"})[M],v=({width:M,height:D})=>{a.width=M,a.height=D};return(M,D)=>(h.openBlock(),h.createElementBlock("div",{ref:"chartParent",class:h.normalizeClass(["chart-parent",x(M.legendPosition)]),"data-testid":"donut-chart-parent"},[h.createElementVNode("div",nS,[h.createVNode(h.unref(cg),{ref_key:"chartInstance",ref:y,"chart-id":h.unref(s),data:g.value,options:h.unref(p),plugins:d.value},null,8,["chart-id","data","options","plugins"]),(h.openBlock(),h.createBlock(h.Teleport,{to:"body"},[h.createVNode(pl,{"absolute-left":h.unref(l),"absolute-top":h.unref(c),state:a,"tooltip-title":M.tooltipTitle,unit:M.metricUnit,onDimensions:v},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),h.createVNode(ml,{id:h.unref(i),"chart-instance":y.value,items:r.value,position:M.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),sS=Pe(iS,[["__scopeId","data-v-f3942f91"]]),ug=(n,t,e,i)=>{n.save(),n.beginPath(),n.moveTo(t,e),n.lineTo(t,i),n.lineWidth=1,n.strokeStyle="#0275d8",n.stroke(),n.restore()};class rS{constructor(){E(this,"id","verticalLinePlugin");E(this,"_clickedSegment");E(this,"_pause",!1)}afterDatasetsDraw(t){if(!this._pause&&t.tooltip&&t.tooltip.getActiveElements()&&t.tooltip.getActiveElements().length&&!this.clickedSegment){const{x:e}=t.tooltip.dataPoints[0].element,i=t.ctx;ug(i,e,t.scales.y.top,t.scales.y.bottom)}if(!this._pause&&this._clickedSegment){const{x:e}=this._clickedSegment.element,i=t.ctx;ug(i,e,t.scales.y.top,t.scales.y.bottom)}}pause(){this._pause=!0}resume(){this._pause=!1}get isPaused(){return this._pause}set clickedSegment(t){this._clickedSegment=t}get clickedSegment(){return this._clickedSegment}destroyClickedSegment(){delete this._clickedSegment}beforeDestroy(){this._clickedSegment&&this.destroyClickedSegment()}}const oS=(n,t,e)=>{const i=n.ctx;i.save(),i.strokeStyle="rgba(95, 154, 255, 1)",i.lineWidth=2,i.beginPath(),i.moveTo(t,n.chartArea.top),i.lineTo(t,n.chartArea.bottom),i.moveTo(e,n.chartArea.top),i.lineTo(e,n.chartArea.bottom),i.stroke(),i.restore()},aS=(n,t,e)=>{const i=n.ctx;i.save(),i.fillStyle="rgba(143, 193, 255, 0.3)",i.fillRect(t,n.chartArea.top,e-t,n.chartArea.bottom-n.chartArea.top),i.restore()},dg=(n,t,e)=>{const i=t.scales.x.getValueForPixel(e.startX),s=t.scales.x.getValueForPixel(e.endX);i&&s&&t.canvas.dispatchEvent(new CustomEvent(n,{detail:{xStart:Math.min(i,s),xEnd:Math.max(i,s)}}))};class lS{constructor(){E(this,"id","dragSelectPlugin");E(this,"_isDragging",!1);E(this,"_startX",0);E(this,"_endX",0);E(this,"_dragTimeout");E(this,"_clearSelectionArea",!0);E(this,"_chart",null);E(this,"_dragSelectHandlers")}get startX(){return this._startX}get endX(){return this._endX}beforeInit(t){this._chart=t;const e=t.canvas;let i=!1;const s=a=>{this._dragTimeout=window.setTimeout(()=>{const l=e.getBoundingClientRect();this._isDragging=!0,this._clearSelectionArea=!1,i=!0,this._startX=a.clientX-l.left},150)},r=a=>{const l=e.getBoundingClientRect();i&&this._isDragging&&(this._endX=a.clientX-l.left,dg("dragSelectMove",t,this),t.update())},o=a=>{const l=e.getBoundingClientRect();clearTimeout(this._dragTimeout),i&&this._isDragging&&(this._endX=a.clientX-l.left,dg("dragSelect",t,this),t.update(),i=!1,this._isDragging=!1)};e.addEventListener("mousedown",s),e.addEventListener("mousemove",r),e.addEventListener("mouseup",o),this._dragSelectHandlers={onMouseDown:s,onMouseMove:r,onMouseUp:o}}beforeDestroy(t){const e=t.canvas;if(this._dragSelectHandlers){const{onMouseDown:i,onMouseMove:s,onMouseUp:r}=this._dragSelectHandlers;e.removeEventListener("mousedown",i),e.removeEventListener("mousemove",s),e.removeEventListener("mouseup",r)}this._isDragging=!1,this._dragTimeout&&clearTimeout(this._dragTimeout)}afterDatasetsDraw(t){(this._isDragging||!this._clearSelectionArea)&&(aS(t,this._startX,this._endX),oS(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const cS=["hidden","single","full"];var ti=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(ti||{});const uS=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar"],dS=["gauge","top_n","single_value"],hS=Pe(h.defineComponent({__name:"TimeSeriesChart",props:{chartData:{default:void 0},type:{default:"timeseries_line"},fill:{type:Boolean,default:!1},tooltipTitle:{},metricUnit:{default:""},timeRangeMs:{default:void 0},granularity:{},stacked:{type:Boolean,default:!0},legendValues:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},zoom:{type:Boolean,default:!1},zoomActionItems:{default:void 0},tooltipMetricDisplay:{default:""}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:t}){const e=n,i=t,s=new rS,r=new ig,o=new lS,{translateUnit:a}=bt.useTranslatedUnits(),l=h.ref(),c=crypto.randomUUID(),u=crypto.randomUUID(),d=h.ref([]),f=h.ref(),g=h.inject("legendPosition",Nt.Right),p=h.useTemplateRef("chartParent"),y=h.ref(void 0),x=h.ref(!1),v=h.inject(rf),M=v==null?void 0:v.evaluateFeatureFlagFn("analytics-chart-zoom-actions",!1),D=h.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:e.tooltipMetricDisplay,tooltipSeries:[],left:"",top:"",units:e.metricUnit,translateUnit:a,offsetX:0,offsetY:0,width:0,height:0,chartType:e.type,chartID:u,chartTooltipSortFn:e.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:S,tooltipAbsoluteTop:P}=bt.useTooltipAbsolutePosition(p,D),R={id:c,afterUpdate(z){d.value=Kd(z,e.legendValues,e.chartLegendSortFn)}},O=h.computed(()=>[R,r,...e.zoom?[o]:[],...e.type==="timeseries_line"?[s]:[]]),b=h.computed(()=>`line-${O.value.map(z=>z.id).join("-")}`),_=h.computed(()=>`bar-${O.value.map(z=>z.id).join("-")}`),C=h.computed(()=>e.chartData&&uw(e.chartData)),I=h.computed(()=>M?!1:x.value),{options:T}=bt.useLineChartOptions({tooltipState:D,timeRangeMs:h.toRef(e,"timeRangeMs"),granularity:h.toRef(e,"granularity"),legendID:c,stacked:h.toRef(e,"stacked"),metricAxesTitle:h.toRef(e,"metricAxesTitle"),dimensionAxesTitle:h.toRef(e,"dimensionAxesTitle"),pointsWithoutHover:C});bt.useReportChartDataForSynthetics(h.toRef(e,"chartData"),h.toRef(e,"syntheticsDataKey"));const F=z=>({[Nt.Right]:"legend-row",[Nt.Bottom]:"column",[Nt.Hidden]:"hidden"})[z],U=({width:z,height:B})=>{D.width=z,D.height=B},X=(z=!0)=>{D.interactionMode="idle",D.showTooltip=!1,o.clearSelectionArea(),r.isPaused&&r.resume(z),s.isPaused&&s.resume()},Q=()=>{D.interactionMode="interactive"},V=()=>{var z,B;!l.value||!((B=(z=l.value.chart.tooltip)==null?void 0:z.dataPoints)!=null&&B.length)||(D.interactionMode==="interactive"?s.clickedSegment=l.value.chart.tooltip.dataPoints[0]:s.destroyClickedSegment())},ut=()=>{if(x.value){x.value=!1;return}D.interactionMode!=="idle"?X():Q(),V()};h.watch(()=>e.type,()=>{D.interactionMode="idle",D.showTooltip=!1,s.destroyClickedSegment()});const $=z=>{z.preventDefault(),z.stopPropagation();const{xStart:B,xEnd:ft}=z.detail;B&&ft&&(y.value={start:new Date(B),end:new Date(ft),type:"absolute"},M?D.interactionMode="zoom-interactive":(i("zoom-time-range",{start:new Date(B),end:new Date(ft),type:"absolute"}),X()),i("select-chart-range",y.value))},G=z=>{M&&(D.interactionMode="selecting-chart-area"),x.value=!0,s.pause(),r.pause();const{xStart:B,xEnd:ft}=z.detail;B&&ft&&(y.value={start:new Date(B),end:new Date(ft),type:"absolute"})},J=z=>{if(!p.value||D.interactionMode==="idle")return;const B=z.target;B&&p.value.contains(B)||x.value||X(!1)};return h.watch(()=>{var z;return(z=l.value)==null?void 0:z.chart},()=>{var z;(z=l.value)!=null&&z.chart&&(l.value.chart.canvas.removeEventListener("dragSelect",$),l.value.chart.canvas.removeEventListener("dragSelectMove",G),l.value.chart.canvas.addEventListener("dragSelect",$),l.value.chart.canvas.addEventListener("dragSelectMove",G))}),h.onMounted(()=>{document.addEventListener("click",J,!0)}),h.onUnmounted(()=>{var z;(z=l.value)!=null&&z.chart&&(l.value.chart.canvas.removeEventListener("dragSelect",$),l.value.chart.canvas.removeEventListener("dragSelectMove",G)),document.removeEventListener("click",J,!0)}),(z,B)=>(h.openBlock(),h.createElementBlock("div",{ref:"chartParent",class:h.normalizeClass(["chart-parent",F(h.unref(g))]),"data-testid":"line-chart-parent"},[h.createElementVNode("div",{class:"chart-container",onClick:B[0]||(B[0]=ft=>ut())},[z.type==="timeseries_line"?(h.openBlock(),h.createBlock(h.unref(eS),{key:b.value,ref_key:"chartInstance",ref:l,"chart-id":h.unref(u),class:"chart-canvas",data:z.chartData,"data-testid":"time-series-line-chart",options:h.unref(T),plugins:O.value},null,8,["chart-id","data","options","plugins"])):z.type==="timeseries_bar"?(h.openBlock(),h.createBlock(h.unref(tS),{key:_.value,ref_key:"chartInstance",ref:l,"chart-id":h.unref(u),class:"chart-canvas",data:z.chartData,"data-testid":"time-series-bar-chart",options:h.unref(T),plugins:O.value},null,8,["chart-id","data","options","plugins"])):h.createCommentVNode("",!0)]),I.value?h.createCommentVNode("",!0):(h.openBlock(),h.createBlock(pl,{key:0,ref_key:"tooltipElement",ref:f,"absolute-left":h.unref(S),"absolute-top":h.unref(P),"data-testid":"tooltip",state:D,"tooltip-title":z.tooltipTitle,"zoom-action-items":z.zoomActionItems,"zoom-time-range":y.value,onDimensions:U,onOnAction:B[1]||(B[1]=()=>X(!1))},null,8,["absolute-left","absolute-top","state","tooltip-title","zoom-action-items","zoom-time-range"])),h.createVNode(ml,{id:h.unref(c),"chart-instance":l.value,"data-testid":"legend",items:d.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-07b8c4d8"]]),fS={class:"analytics-chart-shell"},gS={key:0,class:"chart-header"},pS={class:"tooltip-content"},mS={key:2,class:"analytics-chart-parent"},yS=h.defineComponent({__name:"AnalyticsChart",props:{chartData:{},chartOptions:{},tooltipTitle:{default:""},emptyStateTitle:{default:""},emptyStateDescription:{default:""},legendPosition:{default:Nt.Right},syntheticsDataKey:{default:""},showLegendValues:{type:Boolean,default:!0},showAnnotations:{type:Boolean,default:!0},timeseriesZoom:{type:Boolean,default:!1},requestsLink:{default:void 0},exploreLink:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:t}){const e=t,i=n,{i18n:s}=bt.useI18n(),r=h.computed(()=>p.value?bt.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Lr,threshold:i.chartOptions.threshold||void 0},h.toRef(i,"chartData")).value:bt.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Lr},h.toRef(i,"chartData")).value),o=h.computed(()=>{var T;return(T=i.chartData)!=null&&T.meta?"start_ms"in i.chartData.meta?i.chartData.meta.end_ms-i.chartData.meta.start_ms:void 0:0}),a=h.computed(()=>{var T;return(T=i.chartData.meta)!=null&&T.metric_units?Object.values(i.chartData.meta.metric_units)[0]:""}),l=h.computed(()=>i.showLegendValues&&i.legendPosition!==Nt.Bottom),{legendValues:c}=bt.useChartLegendValues(r,i.chartOptions.type,a),u=h.computed(()=>{var T,F,U;return((U=(F=(T=i.chartData)==null?void 0:T.meta)==null?void 0:F.limit)==null?void 0:U.toString())||null}),d=h.computed(()=>{var T,F;return((F=(T=i.chartData)==null?void 0:T.meta)==null?void 0:F.truncated)||!1}),f=s.t("limitedResultsShown",{maxReturned:u.value}),g=h.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),p=h.computed(()=>["timeseries_bar","timeseries_line"].some(T=>T===i.chartOptions.type)),y=h.computed(()=>i.chartOptions.type==="donut"),x=h.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),v=h.computed(()=>{var U,X;if(!((U=i.chartData)!=null&&U.meta.metric_names)||!((X=i.chartData)!=null&&X.meta.metric_units))return;const T=i.chartData.meta.metric_names[0],F=i.chartData.meta.metric_units[T];if(i.chartData.meta.metric_names.length>1){if(T.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${F}`,{plural:"s"})});if(T.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${F}`,{plural:"s"})})}if(T)return s.te(`chartLabels.${T}`)?s.t(`chartLabels.${T}`):T}),M=h.computed(()=>{var U,X,Q,V;if((U=i.chartOptions)!=null&&U.metricAxesTitle)return(X=i.chartOptions)==null?void 0:X.metricAxesTitle;if(!((Q=i.chartData)!=null&&Q.meta.metric_names)||!((V=i.chartData)!=null&&V.meta.metric_units))return;const T=i.chartData.meta.metric_names[0],F=i.chartData.meta.metric_units[T];if(i.chartData.meta.metric_names.length>1){if(T.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${F}`,{plural:"s"})});if(T.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${F}`,{plural:"s"})})}return s.te(`metricAxisTitles.${T}`)&&s.te(`chartUnits.${F}`)?s.t(`metricAxisTitles.${T}`,{unit:s.t(`chartUnits.${F}`,{plural:"s"})})||void 0:T||void 0}),D=h.computed(()=>{var F;if((F=i.chartOptions)!=null&&F.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const T=p.value?"Time":Object.keys(i.chartData.meta.display||i.chartData.meta.metric_names)[0];if(T)return s.te(`chartLabels.${T}`)?s.t(`chartLabels.${T}`):T}),S=h.computed(()=>{const T=Qa(Number(i.chartData.meta.granularity_ms));if(T)return s.te(`granularityAxisTitles.${T}`)?s.t(`granularityAxisTitles.${T}`):T}),P=h.computed(()=>i.emptyStateTitle||s.t("noDataAvailableTitle")),R=h.computed(()=>i.emptyStateDescription||s.t("noDataAvailableDescription")),O=h.computed(()=>p.value?dw(r.value):i.chartData&&i.chartData.meta&&i.chartData.data.length),b=h.computed(()=>i.chartData.meta.granularity_ms?Qa(i.chartData.meta.granularity_ms)||"hourly":Qa(new Date(i.chartData.data[1].timestamp).getTime()-new Date(i.chartData.data[0].timestamp).getTime())||"hourly"),_=h.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(T,F)=>T.text===s.t("chartLabels.____OTHER____")?1:F.text===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(T.text,10))&&!isNaN(parseInt(F.text,10))?T.text<F.text?-1:1:T.value&&F.value?F.value.raw-T.value.raw:0),C=h.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(T,F)=>T.label===s.t("chartLabels.____OTHER____")?1:F.label===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(T.label,10))&&!isNaN(parseInt(F.label,10))?T.label<F.label?-1:1:T.value&&F.value?F.rawValue-T.rawValue:0),I=h.computed(()=>[{label:s.t("zoom_action_items.zoom"),action:T=>e("zoom-time-range",T)},...i.exploreLink?[{label:s.t("zoom_action_items.explore"),href:i.exploreLink.href}]:[],...i.requestsLink?[{label:s.t("zoom_action_items.view_requests"),href:i.requestsLink.href}]:[]]);return h.provide("showLegendValues",l),h.provide("legendPosition",h.toRef(i,"legendPosition")),(T,F)=>{const U=h.resolveComponent("KTooltip"),X=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",fS,[O.value&&d.value&&u.value?(h.openBlock(),h.createElementBlock("div",gS,[h.createVNode(U,{class:"tooltip","max-width":"500",placement:"right"},{content:h.withCtx(()=>[h.createElementVNode("div",pS,h.toDisplayString(h.unref(f)),1)]),default:h.withCtx(()=>[h.createVNode(h.unref(wo.WarningIcon),{color:`var(--kui-color-text-warning, ${h.unref(gM)})`,size:h.unref(pM)},null,8,["color","size"])]),_:1})])):h.createCommentVNode("",!0),O.value?(h.openBlock(),h.createElementBlock("div",mS,[p.value?(h.openBlock(),h.createBlock(hS,{key:0,"chart-data":r.value,"chart-legend-sort-fn":_.value,"chart-tooltip-sort-fn":C.value,"dimension-axes-title":S.value,fill:T.chartOptions.stacked,granularity:b.value,"legend-values":h.unref(c),"metric-axes-title":M.value,"metric-unit":a.value,stacked:T.chartOptions.stacked,"synthetics-data-key":T.syntheticsDataKey,"time-range-ms":o.value,"tooltip-metric-display":v.value,"tooltip-title":T.tooltipTitle,type:T.chartOptions.type,zoom:T.timeseriesZoom,"zoom-action-items":I.value,onSelectChartRange:F[0]||(F[0]=Q=>e("select-chart-range",Q)),onZoomTimeRange:F[1]||(F[1]=Q=>e("zoom-time-range",Q))},null,8,["chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","fill","granularity","legend-values","metric-axes-title","metric-unit","stacked","synthetics-data-key","time-range-ms","tooltip-metric-display","tooltip-title","type","zoom","zoom-action-items"])):g.value?(h.openBlock(),h.createBlock(UD,{key:1,annotations:T.showAnnotations,"chart-data":r.value,"chart-legend-sort-fn":_.value,"chart-tooltip-sort-fn":C.value,"data-testid":"bar-chart-container","dimension-axes-title":D.value,"legend-values":h.unref(c),"metric-axes-title":M.value,"metric-unit":a.value,orientation:x.value,stacked:T.chartOptions.stacked,"synthetics-data-key":T.syntheticsDataKey,"tooltip-metric-display":v.value,"tooltip-title":T.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-metric-display","tooltip-title"])):y.value?(h.openBlock(),h.createBlock(sS,{key:2,"chart-data":r.value,"dataset-colors":T.chartOptions.chartDatasetColors||h.unref(Lr),"legend-position":T.legendPosition,"legend-values":h.unref(c),"metric-unit":a.value,"synthetics-data-key":T.syntheticsDataKey,"tooltip-dimension-display":D.value,"tooltip-metric-display":v.value,"tooltip-title":T.tooltipTitle},null,8,["chart-data","dataset-colors","legend-position","legend-values","metric-unit","synthetics-data-key","tooltip-dimension-display","tooltip-metric-display","tooltip-title"])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(X,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(P.value),1)]),default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(R.value),1)]),_:1}))])}}}),bS=Pe(yS,[["__scopeId","data-v-802bf38b"]]),_S={class:"chart-parent","data-testid":"gauge-chart-parent"},xS={class:"chart-totals-flex"},wS={key:1,class:"metric-small","data-testid":"gauge-chart-total"},vS=Pe(h.defineComponent({__name:"GaugeChart",props:{chartData:{type:Object,required:!1,default:null},metricDisplay:{type:String,required:!1,default:"hidden"},numerator:{type:Number,required:!1,default:0},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:sn},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}=bt.useI18n(),i=h.ref(eo()),s=h.computed(()=>[t.chartData.datasets.reduce((p,y)=>(p.labels.push(y.label),p.borderColor.push(y.backgroundColor),p.backgroundColor.push(y.backgroundColor),p.data.push(y.data.reduce((x,v)=>x+v,0)),p),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),r=h.computed(()=>({...t.chartData,datasets:s.value}));bt.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const o={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},a=h.ref(),l=h.computed(()=>{var g;return vs((g=s==null?void 0:s.value[0])==null?void 0:g.data[t.numerator],{capital:!0})}),c=h.computed(()=>{var g,p;return vs(((g=s==null?void 0:s.value[0])==null?void 0:g.data[0])+((p=s==null?void 0:s.value[0])==null?void 0:p.data[1]),{capital:!0})}),u=h.computed(()=>{var g;return`color: ${(g=s==null?void 0:s.value[0])==null?void 0:g.backgroundColor[t.numerator]}`}),d=h.computed(()=>["full","single"].includes(t.metricDisplay)),f=h.computed(()=>t.metricDisplay==="full");return(g,p)=>(h.openBlock(),h.createElementBlock("div",_S,[h.createElementVNode("div",xS,[d.value?(h.openBlock(),h.createElementBlock("div",{key:0,class:"metric-large","data-testid":"gauge-chart-metric",style:h.normalizeStyle(u.value)},h.toDisplayString(l.value),5)):h.createCommentVNode("",!0),f.value?(h.openBlock(),h.createElementBlock("div",wS,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(cg),{ref_key:"chartInstance",ref:a,"chart-id":i.value,data:r.value,options:o},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-32e7f9e0"]]),MS={class:"chart-parent","data-testid":"single-value-parent"},kS={key:1,class:"single-value-wrapper"},DS={class:"single-value","data-testid":"single-value-chart"},SS={key:0,class:"single-value-unit"},TS=Pe(h.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:of}},setup(n){const{i18n:{t}}=bt.useI18n(),e=n,i=h.computed(()=>e.data.data[0]),s=h.computed(()=>{var c,u;return(u=(c=e.data.meta)==null?void 0:c.metric_names)==null?void 0:u[0]}),r=h.computed(()=>{var u,d;const c=s.value?(d=(u=e.data.meta)==null?void 0:u.metric_units)==null?void 0:d[s.value]:void 0;if(c)return t(`chartUnits.${c}`,{plural:""})}),o=h.computed(()=>{var c;return s.value==="request_per_minute"||!!((c=s.value)!=null&&c.includes("_latency_"))}),a=h.computed(()=>!i.value||!s.value||typeof i.value.event[s.value]!="number"?null:i.value.event[s.value]),l=h.computed(()=>{var d;const c=a.value;if(c===null)return"";if((d=s.value)!=null&&d.includes("_size_"))return Fr(c);if(c>=1e9){const f=(c/1e9).toFixed(1);return f.endsWith(".0")?`${Math.floor(c/1e9)}B`:`${f}B`}if(c>=1e7){const f=(c/1e6).toFixed(1);return f.endsWith(".0")?`${Math.floor(c/1e6)}M`:`${f}M`}const u=e.decimalPoints&&typeof e.decimalPoints=="number"?e.decimalPoints:of;return c.toLocaleString("en-US",{maximumFractionDigits:u})});return h.onMounted(()=>{var c,u;((u=(c=e.data)==null?void 0:c.data)==null?void 0:u.length)>1&&console.warn("SingleValue chart should only be used with a single data point. Data length:",e.data.data.length)}),(c,u)=>{const d=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",MS,[a.value===null?(h.openBlock(),h.createBlock(d,{key:0,class:"single-value-error","data-testid":"single-value-error","icon-variant":"error",title:h.unref(t)("singleValue.valueError")},null,8,["title"])):(h.openBlock(),h.createElementBlock("div",kS,[h.createElementVNode("span",DS,h.toDisplayString(l.value),1),o.value?(h.openBlock(),h.createElementBlock("span",SS," "+h.toDisplayString(r.value),1)):h.createCommentVNode("",!0)]))])}}}),[["__scopeId","data-v-c25764ee"]]),CS={class:"simple-chart-shell"},PS={key:1,class:"analytics-chart-parent"},OS=Pe(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}=bt.useI18n(),i=h.computed(()=>{var u;const c=bt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||sn},h.toRef(t,"chartData")).value;return(u=t.chartOptions)!=null&&u.reverseDataset&&(c==null||c.datasets.reverse()),c}),s=h.computed(()=>{var c;return(c=t.chartData.meta)!=null&&c.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""}),r=h.computed(()=>t.chartOptions.type==="gauge"),o=h.computed(()=>t.chartOptions.type==="single_value"),a=h.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),l=h.computed(()=>{var u,d;const c=t.chartData&&t.chartData.meta&&t.chartData.data.length;if(o.value){const f=(d=(u=t.chartData.meta)==null?void 0:u.metric_names)==null?void 0:d[0];return c&&t.chartData.data[0].event[f]!==null}return c});return(c,u)=>{const d=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",CS,[l.value?(h.openBlock(),h.createElementBlock("div",PS,[r.value?(h.openBlock(),h.createBlock(vS,{key:0,"chart-data":i.value,"dataset-colors":n.chartOptions.chartDatasetColors,"is-simple":"","metric-display":n.chartOptions.metricDisplay,"metric-unit":s.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),o.value?(h.openBlock(),h.createBlock(TS,{key:1,data:n.chartData,"decimal-points":n.chartOptions.decimalPoints},null,8,["data","decimal-points"])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(d,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(a.value),1)]),_:1}))])}}}),[["__scopeId","data-v-471652c8"]]),ES={class:"top-n-card-title","data-testid":"top-n-card-title"},AS={class:"top-n-card-description","data-testid":"top-n-card-description"},RS={key:3,class:"top-n-table","data-testid":"top-n-table"},IS={class:"table-headings"},LS={class:"table-row"},NS={class:"column-1"},FS={class:"column-2"},zS={class:"table-body","data-testid":"top-n-data"},BS=["data-testid"],HS={class:"column-1"},WS={class:"column-2"},YS=Pe(h.defineComponent({__name:"TopNTable",props:{title:{default:""},description:{default:""},data:{},emptyStateTitle:{default:""},isLoading:{type:Boolean,default:!1},titleTag:{default:"h2"}},setup(n){const t=n,{i18n:e}=bt.useI18n(),i=h.computed(()=>t.data.data),s=h.computed(()=>{var p;return!!((p=i.value)!=null&&p.length)}),r=h.computed(()=>{var p,y;return(p=t.data.meta)!=null&&p.display&&((y=Object.keys(t.data.meta.display))==null?void 0:y[0])||""}),o=h.computed(()=>r.value?t.data.meta.display[r.value]:{}),a=h.computed(()=>{var p,y;return(y=(p=t.data.meta)==null?void 0:p.metric_names)!=null&&y.length?t.data.meta.metric_names[0]:""}),l=h.computed(()=>a.value?e.t(`chartLabels.${a.value}`)||a.value:""),c=h.computed(()=>{if(!s.value)return"";if(t.data.meta){if(o.value&&!Object.keys(o.value).length)return e.t("topNTable.errors.display");if(!a.value)return e.t("topNTable.errors.metricNames")}else return e.t("topNTable.errors.meta");return""}),u=p=>{const y=p.event;return String(y[r.value])},d=p=>{const y=u(p),x=o.value&&o.value[y];return x?x.name:"-"},f=p=>{const y=u(p),x=o.value&&o.value[y];return x?!!x.deleted:!1},g=p=>{if(!a.value)return"–";const x=p.event[a.value];return x?vs(x,{capital:!0,round:!0}):"–"};return(p,y)=>{const x=h.resolveComponent("KEmptyState"),v=h.resolveComponent("KSkeleton"),M=h.resolveComponent("KCard");return h.openBlock(),h.createBlock(M,{class:"kong-ui-public-top-n-table","title-tag":p.titleTag},h.createSlots({default:h.withCtx(()=>[c.value?(h.openBlock(),h.createBlock(x,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(c.value),1)]),_:1})):p.isLoading?(h.openBlock(),h.createBlock(v,{key:1,"table-columns":2,type:"table"})):s.value?(h.openBlock(),h.createElementBlock("div",RS,[h.createElementVNode("div",IS,[h.createElementVNode("div",LS,[h.createElementVNode("div",NS,h.toDisplayString(h.unref(e).t("topNTable.nameLabel")),1),h.createElementVNode("div",FS,h.toDisplayString(l.value),1)])]),h.createElementVNode("div",zS,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(i.value,(D,S)=>(h.openBlock(),h.createElementBlock("div",{key:`entry-${S}`,class:"table-row","data-testid":`row-${u(D)}`},[h.createElementVNode("div",HS,[h.renderSlot(p.$slots,"name",{record:{id:u(D),name:d(D),deleted:f(D),dimension:r.value}},()=>[h.createTextVNode(h.toDisplayString(d(D)),1)],!0)]),h.createElementVNode("div",WS," "+h.toDisplayString(g(D)),1)],8,BS))),128))])])):(h.openBlock(),h.createBlock(x,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(p.emptyStateTitle||h.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[p.title?{name:"title",fn:h.withCtx(()=>[h.createElementVNode("span",ES,h.toDisplayString(p.title),1)]),key:"0"}:void 0,p.description?{name:"actions",fn:h.withCtx(()=>[h.createElementVNode("div",AS,h.toDisplayString(p.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-665e7735"]]);var no={exports:{}};no.exports,function(n,t){var e=200,i="Expected a function",s="__lodash_hash_undefined__",r=1,o=2,a=9007199254740991,l="[object Arguments]",c="[object Array]",u="[object Boolean]",d="[object Date]",f="[object Error]",g="[object Function]",p="[object GeneratorFunction]",y="[object Map]",x="[object Number]",v="[object Object]",M="[object Promise]",D="[object RegExp]",S="[object Set]",P="[object String]",R="[object Symbol]",O="[object WeakMap]",b="[object ArrayBuffer]",_="[object DataView]",C="[object Float32Array]",I="[object Float64Array]",T="[object Int8Array]",F="[object Int16Array]",U="[object Int32Array]",X="[object Uint8Array]",Q="[object Uint8ClampedArray]",V="[object Uint16Array]",ut="[object Uint32Array]",$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,G=/^\w*$/,J=/^\./,z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,B=/[\\^$.*+?()[\]{}|]/g,ft=/\\(\\)?/g,yt=/^\[object .+?Constructor\]$/,vt=/^(?:0|[1-9]\d*)$/,gt={};gt[C]=gt[I]=gt[T]=gt[F]=gt[U]=gt[X]=gt[Q]=gt[V]=gt[ut]=!0,gt[l]=gt[c]=gt[b]=gt[u]=gt[_]=gt[d]=gt[f]=gt[g]=gt[y]=gt[x]=gt[v]=gt[D]=gt[S]=gt[P]=gt[O]=!1;var pt=typeof be=="object"&&be&&be.Object===Object&&be,H=typeof self=="object"&&self&&self.Object===Object&&self,j=pt||H||Function("return this")(),Y=t&&!t.nodeType&&t,Z=Y&&!0&&n&&!n.nodeType&&n,tt=Z&&Z.exports===Y,et=tt&&pt.process,it=function(){try{return et&&et.binding("util")}catch{}}(),nt=it&&it.isTypedArray;function xt(m,k){for(var L=-1,W=m?m.length:0;++L<W;)if(k(m[L],L,m))return!0;return!1}function at(m){return function(k){return k==null?void 0:k[m]}}function Pt(m,k){for(var L=-1,W=Array(m);++L<m;)W[L]=k(L);return W}function te(m){return function(k){return m(k)}}function ae(m,k){return m==null?void 0:m[k]}function Xt(m){var k=!1;if(m!=null&&typeof m.toString!="function")try{k=!!(m+"")}catch{}return k}function Oe(m){var k=-1,L=Array(m.size);return m.forEach(function(W,dt){L[++k]=[dt,W]}),L}function Mt(m,k){return function(L){return m(k(L))}}function qt(m){var k=-1,L=Array(m.size);return m.forEach(function(W){L[++k]=W}),L}var Bt=Array.prototype,Gt=Function.prototype,ie=Object.prototype,Xe=j["__core-js_shared__"],ei=function(){var m=/[^.]+$/.exec(Xe&&Xe.keys&&Xe.keys.IE_PROTO||"");return m?"Symbol(src)_1."+m:""}(),Ne=Gt.toString,Ht=ie.hasOwnProperty,_e=ie.toString,ni=RegExp("^"+Ne.call(Ht).replace(B,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),io=j.Symbol,so=j.Uint8Array,Ls=ie.propertyIsEnumerable,ii=Bt.splice,Ns=Mt(Object.keys,Object),si=dn(j,"DataView"),an=dn(j,"Map"),ln=dn(j,"Promise"),Fs=dn(j,"Set"),zs=dn(j,"WeakMap"),ri=dn(Object,"create"),wl=fn(si),vl=fn(an),ro=fn(ln),oo=fn(Fs),cn=fn(zs),Ei=io?io.prototype:void 0,Bs=Ei?Ei.valueOf:void 0,ao=Ei?Ei.toString:void 0;function un(m){var k=-1,L=m?m.length:0;for(this.clear();++k<L;){var W=m[k];this.set(W[0],W[1])}}function Ml(){this.__data__=ri?ri(null):{}}function Fe(m){return this.has(m)&&delete this.__data__[m]}function kl(m){var k=this.__data__;if(ri){var L=k[m];return L===s?void 0:L}return Ht.call(k,m)?k[m]:void 0}function Dl(m){var k=this.__data__;return ri?k[m]!==void 0:Ht.call(k,m)}function Sl(m,k){var L=this.__data__;return L[m]=ri&&k===void 0?s:k,this}un.prototype.clear=Ml,un.prototype.delete=Fe,un.prototype.get=kl,un.prototype.has=Dl,un.prototype.set=Sl;function ze(m){var k=-1,L=m?m.length:0;for(this.clear();++k<L;){var W=m[k];this.set(W[0],W[1])}}function Tl(){this.__data__=[]}function En(m){var k=this.__data__,L=Ii(k,m);if(L<0)return!1;var W=k.length-1;return L==W?k.pop():ii.call(k,L,1),!0}function Cl(m){var k=this.__data__,L=Ii(k,m);return L<0?void 0:k[L][1]}function Pl(m){return Ii(this.__data__,m)>-1}function Ol(m,k){var L=this.__data__,W=Ii(L,m);return W<0?L.push([m,k]):L[W][1]=k,this}ze.prototype.clear=Tl,ze.prototype.delete=En,ze.prototype.get=Cl,ze.prototype.has=Pl,ze.prototype.set=Ol;function Be(m){var k=-1,L=m?m.length:0;for(this.clear();++k<L;){var W=m[k];this.set(W[0],W[1])}}function El(){this.__data__={hash:new un,map:new(an||ze),string:new un}}function An(m){return Fi(this,m).delete(m)}function Al(m){return Fi(this,m).get(m)}function Rl(m){return Fi(this,m).has(m)}function Il(m,k){return Fi(this,m).set(m,k),this}Be.prototype.clear=El,Be.prototype.delete=An,Be.prototype.get=Al,Be.prototype.has=Rl,Be.prototype.set=Il;function Ai(m){var k=-1,L=m?m.length:0;for(this.__data__=new Be;++k<L;)this.add(m[k])}function Ll(m){return this.__data__.set(m,s),this}function Nl(m){return this.__data__.has(m)}Ai.prototype.add=Ai.prototype.push=Ll,Ai.prototype.has=Nl;function Ee(m){this.__data__=new ze(m)}function Ri(){this.__data__=new ze}function Fl(m){return this.__data__.delete(m)}function Hs(m){return this.__data__.get(m)}function zl(m){return this.__data__.has(m)}function Bl(m,k){var L=this.__data__;if(L instanceof ze){var W=L.__data__;if(!an||W.length<e-1)return W.push([m,k]),this;L=this.__data__=new Be(W)}return L.set(m,k),this}Ee.prototype.clear=Ri,Ee.prototype.delete=Fl,Ee.prototype.get=Hs,Ee.prototype.has=zl,Ee.prototype.set=Bl;function Hl(m,k){var L=w(m)||po(m)?Pt(m.length,String):[],W=L.length,dt=!!W;for(var K in m)Ht.call(m,K)&&!(dt&&(K=="length"||Ys(K,W)))&&L.push(K);return L}function Ii(m,k){for(var L=m.length;L--;)if(go(m[L][0],k))return L;return-1}var Wl=Zl();function Yl(m,k){return m&&Wl(m,k,ai)}function Li(m,k){k=zi(k,m)?[k]:qe(k);for(var L=0,W=k.length;m!=null&&L<W;)m=m[hn(k[L++])];return L&&L==W?m:void 0}function jl(m){return _e.call(m)}function Vl(m,k){return m!=null&&k in Object(m)}function Ws(m,k,L,W,dt){return m===k?!0:m==null||k==null||!Kt(m)&&!xe(k)?m!==m&&k!==k:$l(m,k,Ws,L,W,dt)}function $l(m,k,L,W,dt,K){var _t=w(m),Zt=w(k),Wt=c,ce=c;_t||(Wt=le(m),Wt=Wt==l?v:Wt),Zt||(ce=le(k),ce=ce==l?v:ce);var we=Wt==v&&!Xt(m),ve=ce==v&&!Xt(k),fe=Wt==ce;if(fe&&!we)return K||(K=new Ee),_t||mo(m)?uo(m,k,L,W,dt,K):Ql(m,k,Wt,L,W,dt,K);if(!(dt&o)){var Ae=we&&Ht.call(m,"__wrapped__"),Re=ve&&Ht.call(k,"__wrapped__");if(Ae||Re){var Ln=Ae?m.value():m,gn=Re?k.value():k;return K||(K=new Ee),L(Ln,gn,W,dt,K)}}return fe?(K||(K=new Ee),Jl(m,k,L,W,dt,K)):!1}function Ul(m,k,L,W){var dt=L.length,K=dt;if(m==null)return!K;for(m=Object(m);dt--;){var _t=L[dt];if(_t[2]?_t[1]!==m[_t[0]]:!(_t[0]in m))return!1}for(;++dt<K;){_t=L[dt];var Zt=_t[0],Wt=m[Zt],ce=_t[1];if(_t[2]){if(Wt===void 0&&!(Zt in m))return!1}else{var we=new Ee,ve;if(!(ve===void 0?Ws(ce,Wt,W,r|o,we):ve))return!1}}return!0}function Xl(m){if(!Kt(m)||ho(m))return!1;var k=q(m)||Xt(m)?ni:yt;return k.test(fn(m))}function ql(m){return xe(m)&&Vt(m.length)&&!!gt[_e.call(m)]}function lo(m){return typeof m=="function"?m:m==null?Bi:typeof m=="object"?w(m)?Ni(m[0],m[1]):Kl(m):OT(m)}function Gl(m){if(!nc(m))return Ns(m);var k=[];for(var L in Object(m))Ht.call(m,L)&&L!="constructor"&&k.push(L);return k}function Kl(m){var k=tc(m);return k.length==1&&k[0][2]?Vs(k[0][0],k[0][1]):function(L){return L===m||Ul(L,m,k)}}function Ni(m,k){return zi(m)&&fo(k)?Vs(hn(m),k):function(L){var W=yo(L,m);return W===void 0&&W===k?bo(L,m):Ws(k,W,void 0,r|o)}}function Rn(m){return function(k){return Li(k,m)}}function co(m){if(typeof m=="string")return m;if(ee(m))return ao?ao.call(m):"";var k=m+"";return k=="0"&&1/m==-1/0?"-0":k}function qe(m){return w(m)?m:ic(m)}function Zl(m){return function(k,L,W){for(var dt=-1,K=Object(k),_t=W(k),Zt=_t.length;Zt--;){var Wt=_t[++dt];if(L(K[Wt],Wt,K)===!1)break}return k}}function uo(m,k,L,W,dt,K){var _t=dt&o,Zt=m.length,Wt=k.length;if(Zt!=Wt&&!(_t&&Wt>Zt))return!1;var ce=K.get(m);if(ce&&K.get(k))return ce==k;var we=-1,ve=!0,fe=dt&r?new Ai:void 0;for(K.set(m,k),K.set(k,m);++we<Zt;){var Ae=m[we],Re=k[we];if(W)var Ln=_t?W(Re,Ae,we,k,m,K):W(Ae,Re,we,m,k,K);if(Ln!==void 0){if(Ln)continue;ve=!1;break}if(fe){if(!xt(k,function(gn,li){if(!fe.has(li)&&(Ae===gn||L(Ae,gn,W,dt,K)))return fe.add(li)})){ve=!1;break}}else if(!(Ae===Re||L(Ae,Re,W,dt,K))){ve=!1;break}}return K.delete(m),K.delete(k),ve}function Ql(m,k,L,W,dt,K,_t){switch(L){case _:if(m.byteLength!=k.byteLength||m.byteOffset!=k.byteOffset)return!1;m=m.buffer,k=k.buffer;case b:return!(m.byteLength!=k.byteLength||!W(new so(m),new so(k)));case u:case d:case x:return go(+m,+k);case f:return m.name==k.name&&m.message==k.message;case D:case P:return m==k+"";case y:var Zt=Oe;case S:var Wt=K&o;if(Zt||(Zt=qt),m.size!=k.size&&!Wt)return!1;var ce=_t.get(m);if(ce)return ce==k;K|=r,_t.set(m,k);var we=uo(Zt(m),Zt(k),W,dt,K,_t);return _t.delete(m),we;case R:if(Bs)return Bs.call(m)==Bs.call(k)}return!1}function Jl(m,k,L,W,dt,K){var _t=dt&o,Zt=ai(m),Wt=Zt.length,ce=ai(k),we=ce.length;if(Wt!=we&&!_t)return!1;for(var ve=Wt;ve--;){var fe=Zt[ve];if(!(_t?fe in k:Ht.call(k,fe)))return!1}var Ae=K.get(m);if(Ae&&K.get(k))return Ae==k;var Re=!0;K.set(m,k),K.set(k,m);for(var Ln=_t;++ve<Wt;){fe=Zt[ve];var gn=m[fe],li=k[fe];if(W)var xg=_t?W(li,gn,fe,k,m,K):W(gn,li,fe,m,k,K);if(!(xg===void 0?gn===li||L(gn,li,W,dt,K):xg)){Re=!1;break}Ln||(Ln=fe=="constructor")}if(Re&&!Ln){var _o=m.constructor,xo=k.constructor;_o!=xo&&"constructor"in m&&"constructor"in k&&!(typeof _o=="function"&&_o instanceof _o&&typeof xo=="function"&&xo instanceof xo)&&(Re=!1)}return K.delete(m),K.delete(k),Re}function Fi(m,k){var L=m.__data__;return js(k)?L[typeof k=="string"?"string":"hash"]:L.map}function tc(m){for(var k=ai(m),L=k.length;L--;){var W=k[L],dt=m[W];k[L]=[W,dt,fo(dt)]}return k}function dn(m,k){var L=ae(m,k);return Xl(L)?L:void 0}var le=jl;(si&&le(new si(new ArrayBuffer(1)))!=_||an&&le(new an)!=y||ln&&le(ln.resolve())!=M||Fs&&le(new Fs)!=S||zs&&le(new zs)!=O)&&(le=function(m){var k=_e.call(m),L=k==v?m.constructor:void 0,W=L?fn(L):void 0;if(W)switch(W){case wl:return _;case vl:return y;case ro:return M;case oo:return S;case cn:return O}return k});function ec(m,k,L){k=zi(k,m)?[k]:qe(k);for(var W,dt=-1,_t=k.length;++dt<_t;){var K=hn(k[dt]);if(!(W=m!=null&&L(m,K)))break;m=m[K]}if(W)return W;var _t=m?m.length:0;return!!_t&&Vt(_t)&&Ys(K,_t)&&(w(m)||po(m))}function Ys(m,k){return k=k??a,!!k&&(typeof m=="number"||vt.test(m))&&m>-1&&m%1==0&&m<k}function zi(m,k){if(w(m))return!1;var L=typeof m;return L=="number"||L=="symbol"||L=="boolean"||m==null||ee(m)?!0:G.test(m)||!$.test(m)||k!=null&&m in Object(k)}function js(m){var k=typeof m;return k=="string"||k=="number"||k=="symbol"||k=="boolean"?m!=="__proto__":m===null}function ho(m){return!!ei&&ei in m}function nc(m){var k=m&&m.constructor,L=typeof k=="function"&&k.prototype||ie;return m===L}function fo(m){return m===m&&!Kt(m)}function Vs(m,k){return function(L){return L==null?!1:L[m]===k&&(k!==void 0||m in Object(L))}}var ic=oi(function(m){m=In(m);var k=[];return J.test(m)&&k.push(""),m.replace(z,function(L,W,dt,K){k.push(dt?K.replace(ft,"$1"):W||L)}),k});function hn(m){if(typeof m=="string"||ee(m))return m;var k=m+"";return k=="0"&&1/m==-1/0?"-0":k}function fn(m){if(m!=null){try{return Ne.call(m)}catch{}try{return m+""}catch{}}return""}function oi(m,k){if(typeof m!="function"||k&&typeof k!="function")throw new TypeError(i);var L=function(){var W=arguments,dt=k?k.apply(this,W):W[0],K=L.cache;if(K.has(dt))return K.get(dt);var _t=m.apply(this,W);return L.cache=K.set(dt,_t),_t};return L.cache=new(oi.Cache||Be),L}oi.Cache=Be;function go(m,k){return m===k||m!==m&&k!==k}function po(m){return N(m)&&Ht.call(m,"callee")&&(!Ls.call(m,"callee")||_e.call(m)==l)}var w=Array.isArray;function A(m){return m!=null&&Vt(m.length)&&!q(m)}function N(m){return xe(m)&&A(m)}function q(m){var k=Kt(m)?_e.call(m):"";return k==g||k==p}function Vt(m){return typeof m=="number"&&m>-1&&m%1==0&&m<=a}function Kt(m){var k=typeof m;return!!m&&(k=="object"||k=="function")}function xe(m){return!!m&&typeof m=="object"}function ee(m){return typeof m=="symbol"||xe(m)&&_e.call(m)==R}var mo=nt?te(nt):ql;function In(m){return m==null?"":co(m)}function yo(m,k,L){var W=m==null?void 0:Li(m,k);return W===void 0?L:W}function bo(m,k){return m!=null&&ec(m,k,Vl)}function ai(m){return A(m)?Hl(m):Gl(m)}function $s(m,k){var L={};return k=lo(k),Yl(m,function(W,dt,K){L[k(W,dt,K)]=W}),L}function Bi(m){return m}function OT(m){return zi(m)?at(hn(m)):Rn(m)}n.exports=$s}(no,no.exports);var jS=no.exports;const VS=ja(jS);var $S=9007199254740991,US="[object Arguments]",XS="[object Function]",qS="[object GeneratorFunction]",GS="[object Symbol]",KS=typeof be=="object"&&be&&be.Object===Object&&be,ZS=typeof self=="object"&&self&&self.Object===Object&&self,QS=KS||ZS||Function("return this")();function JS(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 tT(n,t){for(var e=-1,i=n?n.length:0,s=Array(i);++e<i;)s[e]=t(n[e],e,n);return s}function eT(n,t){for(var e=-1,i=t.length,s=n.length;++e<i;)n[s+e]=t[e];return n}var _l=Object.prototype,nT=_l.hasOwnProperty,xl=_l.toString,hg=QS.Symbol,iT=_l.propertyIsEnumerable,fg=hg?hg.isConcatSpreadable:void 0,gg=Math.max;function sT(n,t,e,i,s){var r=-1,o=n.length;for(e||(e=lT),s||(s=[]);++r<o;){var a=n[r];e(a)?eT(s,a):s[s.length]=a}return s}function rT(n,t){return n=Object(n),oT(n,t,function(e,i){return i in n})}function oT(n,t,e){for(var i=-1,s=t.length,r={};++i<s;){var o=t[i],a=n[o];e(a,o)&&(r[o]=a)}return r}function aT(n,t){return t=gg(t===void 0?n.length-1:t,0),function(){for(var e=arguments,i=-1,s=gg(e.length-t,0),r=Array(s);++i<s;)r[i]=e[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=e[i];return o[t]=r,JS(n,this,o)}}function lT(n){return dT(n)||uT(n)||!!(fg&&n&&n[fg])}function cT(n){if(typeof n=="string"||yT(n))return n;var t=n+"";return t=="0"&&1/n==-1/0?"-0":t}function uT(n){return fT(n)&&nT.call(n,"callee")&&(!iT.call(n,"callee")||xl.call(n)==US)}var dT=Array.isArray;function hT(n){return n!=null&&pT(n.length)&&!gT(n)}function fT(n){return pg(n)&&hT(n)}function gT(n){var t=mT(n)?xl.call(n):"";return t==XS||t==qS}function pT(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=$S}function mT(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function pg(n){return!!n&&typeof n=="object"}function yT(n){return typeof n=="symbol"||pg(n)&&xl.call(n)==GS}var bT=aT(function(n,t){return n==null?{}:rT(n,tT(sT(t),cT))}),_T=bT;const xT=ja(_T);var mg={exports:{}};(function(n,t){(function(e,i){i()})(be,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 i(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 s(c){var u=new XMLHttpRequest;u.open("HEAD",c,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function r(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 o=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof be=="object"&&be.global===be?be:void 0,a=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=o.saveAs||(typeof window!="object"||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(c,u,d){var f=o.URL||o.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?r(g):s(g.href)?i(c,u,d):r(g,g.target="_blank")):(g.href=f.createObjectURL(c),setTimeout(function(){f.revokeObjectURL(g.href)},4e4),setTimeout(function(){r(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(s(c))i(c,u,d);else{var f=document.createElement("a");f.href=c,f.target="_blank",setTimeout(function(){r(f)})}}:function(c,u,d,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof c=="string")return i(c,u,d);var g=c.type==="application/octet-stream",p=/constructor/i.test(o.HTMLElement)||o.safari,y=/CriOS\/[\d]+/.test(navigator.userAgent);if((y||g&&p||a)&&typeof FileReader<"u"){var x=new FileReader;x.onloadend=function(){var D=x.result;D=y?D:D.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=D:location=D,f=null},x.readAsDataURL(c)}else{var v=o.URL||o.webkitURL,M=v.createObjectURL(c);f?f.location=M:location.href=M,f=null,setTimeout(function(){v.revokeObjectURL(M)},4e4)}});o.saveAs=l.saveAs=l,n.exports=l})})(mg);var wT=mg.exports,yg={exports:{}};/* @license
|
|
29
29
|
Papa Parse
|
|
30
30
|
v5.5.3
|
|
31
31
|
https://github.com/mholt/PapaParse
|
|
32
32
|
License: MIT
|
|
33
|
-
*/(function(n,t){((e,i)=>{n.exports=i()})(be,function e(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},s,r=!i.document&&!!i.postMessage,o=i.IS_PAPA_WORKER||!1,a={},l=0,c={};function u(b){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(_){var
|
|
33
|
+
*/(function(n,t){((e,i)=>{n.exports=i()})(be,function e(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},s,r=!i.document&&!!i.postMessage,o=i.IS_PAPA_WORKER||!1,a={},l=0,c={};function u(b){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(_){var C=P(_);C.chunkSize=parseInt(C.chunkSize),_.step||_.chunk||(C.chunkSize=null),this._handle=new y(C),(this._handle.streamer=this)._config=C}).call(this,b),this.parseChunk=function(_,C){var I=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<I){let F=this._config.newline;F||(T=this._config.quoteChar||'"',F=this._handle.guessLineEndings(_,T)),_=[..._.split(F).slice(I)].join(F)}this.isFirstChunk&&O(this._config.beforeFirstChunk)&&(T=this._config.beforeFirstChunk(_))!==void 0&&(_=T),this.isFirstChunk=!1,this._halted=!1;var I=this._partialLine+_,T=(this._partialLine="",this._handle.parse(I,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(_=T.meta.cursor,I=(this._finished||(this._partialLine=I.substring(_-this._baseIndex),this._baseIndex=_),T&&T.data&&(this._rowCount+=T.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),o)i.postMessage({results:T,workerId:c.WORKER_ID,finished:I});else if(O(this._config.chunk)&&!C){if(this._config.chunk(T,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=T=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(T.data),this._completeResults.errors=this._completeResults.errors.concat(T.errors),this._completeResults.meta=T.meta),this._completed||!I||!O(this._config.complete)||T&&T.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),I||T&&T.meta.paused||this._nextChunk(),T}this._halted=!0},this._sendError=function(_){O(this._config.error)?this._config.error(_):o&&this._config.error&&i.postMessage({workerId:c.WORKER_ID,error:_,finished:!1})}}function d(b){var _;(b=b||{}).chunkSize||(b.chunkSize=c.RemoteChunkSize),u.call(this,b),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(C){this._input=C,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(_=new XMLHttpRequest,this._config.withCredentials&&(_.withCredentials=this._config.withCredentials),r||(_.onload=R(this._chunkLoaded,this),_.onerror=R(this._chunkError,this)),_.open(this._config.downloadRequestBody?"POST":"GET",this._input,!r),this._config.downloadRequestHeaders){var C,I=this._config.downloadRequestHeaders;for(C in I)_.setRequestHeader(C,I[C])}var T;this._config.chunkSize&&(T=this._start+this._config.chunkSize-1,_.setRequestHeader("Range","bytes="+this._start+"-"+T));try{_.send(this._config.downloadRequestBody)}catch(F){this._chunkError(F.message)}r&&_.status===0&&this._chunkError()}},this._chunkLoaded=function(){_.readyState===4&&(_.status<200||400<=_.status?this._chunkError():(this._start+=this._config.chunkSize||_.responseText.length,this._finished=!this._config.chunkSize||this._start>=(C=>(C=C.getResponseHeader("Content-Range"))!==null?parseInt(C.substring(C.lastIndexOf("/")+1)):-1)(_),this.parseChunk(_.responseText)))},this._chunkError=function(C){C=_.statusText||C,this._sendError(new Error(C))}}function f(b){(b=b||{}).chunkSize||(b.chunkSize=c.LocalChunkSize),u.call(this,b);var _,C,I=typeof FileReader<"u";this.stream=function(T){this._input=T,C=T.slice||T.webkitSlice||T.mozSlice,I?((_=new FileReader).onload=R(this._chunkLoaded,this),_.onerror=R(this._chunkError,this)):_=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var T=this._input,F=(this._config.chunkSize&&(F=Math.min(this._start+this._config.chunkSize,this._input.size),T=C.call(T,this._start,F)),_.readAsText(T,this._config.encoding));I||this._chunkLoaded({target:{result:F}})},this._chunkLoaded=function(T){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(T.target.result)},this._chunkError=function(){this._sendError(_.error)}}function g(b){var _;u.call(this,b=b||{}),this.stream=function(C){return _=C,this._nextChunk()},this._nextChunk=function(){var C,I;if(!this._finished)return C=this._config.chunkSize,_=C?(I=_.substring(0,C),_.substring(C)):(I=_,""),this._finished=!_,this.parseChunk(I)}}function p(b){u.call(this,b=b||{});var _=[],C=!0,I=!1;this.pause=function(){u.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){u.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(T){this._input=T,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){I&&_.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),_.length?this.parseChunk(_.shift()):C=!0},this._streamData=R(function(T){try{_.push(typeof T=="string"?T:T.toString(this._config.encoding)),C&&(C=!1,this._checkIsFinished(),this.parseChunk(_.shift()))}catch(F){this._streamError(F)}},this),this._streamError=R(function(T){this._streamCleanUp(),this._sendError(T)},this),this._streamEnd=R(function(){this._streamCleanUp(),I=!0,this._streamData("")},this),this._streamCleanUp=R(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function y(b){var _,C,I,T,F=Math.pow(2,53),U=-F,X=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,Q=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,V=this,ut=0,$=0,G=!1,J=!1,z=[],B={data:[],errors:[],meta:{}};function ft(pt){return b.skipEmptyLines==="greedy"?pt.join("").trim()==="":pt.length===1&&pt[0].length===0}function yt(){if(B&&I&&(gt("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+c.DefaultDelimiter+"'"),I=!1),b.skipEmptyLines&&(B.data=B.data.filter(function(Y){return!ft(Y)})),vt()){let Y=function(Z,tt){O(b.transformHeader)&&(Z=b.transformHeader(Z,tt)),z.push(Z)};if(B)if(Array.isArray(B.data[0])){for(var pt=0;vt()&&pt<B.data.length;pt++)B.data[pt].forEach(Y);B.data.splice(0,1)}else B.data.forEach(Y)}function H(Y,Z){for(var tt=b.header?{}:[],et=0;et<Y.length;et++){var it=et,nt=Y[et],nt=((xt,at)=>(Pt=>(b.dynamicTypingFunction&&b.dynamicTyping[Pt]===void 0&&(b.dynamicTyping[Pt]=b.dynamicTypingFunction(Pt)),(b.dynamicTyping[Pt]||b.dynamicTyping)===!0))(xt)?at==="true"||at==="TRUE"||at!=="false"&&at!=="FALSE"&&((Pt=>{if(X.test(Pt)&&(Pt=parseFloat(Pt),U<Pt&&Pt<F))return 1})(at)?parseFloat(at):Q.test(at)?new Date(at):at===""?null:at):at)(it=b.header?et>=z.length?"__parsed_extra":z[et]:it,nt=b.transform?b.transform(nt,it):nt);it==="__parsed_extra"?(tt[it]=tt[it]||[],tt[it].push(nt)):tt[it]=nt}return b.header&&(et>z.length?gt("FieldMismatch","TooManyFields","Too many fields: expected "+z.length+" fields but parsed "+et,$+Z):et<z.length&>("FieldMismatch","TooFewFields","Too few fields: expected "+z.length+" fields but parsed "+et,$+Z)),tt}var j;B&&(b.header||b.dynamicTyping||b.transform)&&(j=1,!B.data.length||Array.isArray(B.data[0])?(B.data=B.data.map(H),j=B.data.length):B.data=H(B.data,0),b.header&&B.meta&&(B.meta.fields=z),$+=j)}function vt(){return b.header&&z.length===0}function gt(pt,H,j,Y){pt={type:pt,code:H,message:j},Y!==void 0&&(pt.row=Y),B.errors.push(pt)}O(b.step)&&(T=b.step,b.step=function(pt){B=pt,vt()?yt():(yt(),B.data.length!==0&&(ut+=pt.data.length,b.preview&&ut>b.preview?C.abort():(B.data=B.data[0],T(B,V))))}),this.parse=function(pt,H,j){var Y=b.quoteChar||'"',Y=(b.newline||(b.newline=this.guessLineEndings(pt,Y)),I=!1,b.delimiter?O(b.delimiter)&&(b.delimiter=b.delimiter(pt),B.meta.delimiter=b.delimiter):((Y=((Z,tt,et,it,nt)=>{var xt,at,Pt,te;nt=nt||[","," ","|",";",c.RECORD_SEP,c.UNIT_SEP];for(var ae=0;ae<nt.length;ae++){for(var Xt,Oe=nt[ae],Mt=0,qt=0,Bt=0,Gt=(Pt=void 0,new v({comments:it,delimiter:Oe,newline:tt,preview:10}).parse(Z)),ie=0;ie<Gt.data.length;ie++)et&&ft(Gt.data[ie])?Bt++:(Xt=Gt.data[ie].length,qt+=Xt,Pt===void 0?Pt=Xt:0<Xt&&(Mt+=Math.abs(Xt-Pt),Pt=Xt));0<Gt.data.length&&(qt/=Gt.data.length-Bt),(at===void 0||Mt<=at)&&(te===void 0||te<qt)&&1.99<qt&&(at=Mt,xt=Oe,te=qt)}return{successful:!!(b.delimiter=xt),bestDelimiter:xt}})(pt,b.newline,b.skipEmptyLines,b.comments,b.delimitersToGuess)).successful?b.delimiter=Y.bestDelimiter:(I=!0,b.delimiter=c.DefaultDelimiter),B.meta.delimiter=b.delimiter),P(b));return b.preview&&b.header&&Y.preview++,_=pt,C=new v(Y),B=C.parse(_,H,j),yt(),G?{meta:{paused:!0}}:B||{meta:{paused:!1}}},this.paused=function(){return G},this.pause=function(){G=!0,C.abort(),_=O(b.chunk)?"":_.substring(C.getCharIndex())},this.resume=function(){V.streamer._halted?(G=!1,V.streamer.parseChunk(_,!0)):setTimeout(V.resume,3)},this.aborted=function(){return J},this.abort=function(){J=!0,C.abort(),B.meta.aborted=!0,O(b.complete)&&b.complete(B),_=""},this.guessLineEndings=function(Z,Y){Z=Z.substring(0,1048576);var Y=new RegExp(x(Y)+"([^]*?)"+x(Y),"gm"),j=(Z=Z.replace(Y,"")).split("\r"),Y=Z.split(`
|
|
34
34
|
`),Z=1<Y.length&&Y[0].length<j[0].length;if(j.length===1||Z)return`
|
|
35
35
|
`;for(var tt=0,et=0;et<j.length;et++)j[et][0]===`
|
|
36
36
|
`&&tt++;return tt>=j.length/2?`\r
|
|
37
|
-
`:"\r"}}function x(b){return b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function v(b){var _=(b=b||{}).delimiter,
|
|
38
|
-
`&&
|
|
39
|
-
`&&(
|
|
40
|
-
`);var
|
|
41
|
-
`,U='"',X=U+U,Q=!1
|
|
42
|
-
`,'"',c.BYTE_ORDER_MARK],c.WORKERS_SUPPORTED=!r&&!!i.Worker,c.NODE_STREAM_INPUT=1,c.LocalChunkSize=10485760,c.RemoteChunkSize=5242880,c.DefaultDelimiter=",",c.Parser=v,c.ParserHandle=y,c.NetworkStreamer=d,c.FileStreamer=f,c.StringStreamer=g,c.ReadableStreamStreamer=p,i.jQuery&&((s=i.jQuery).fn.parse=function(b){var _=b.config||{},
|
|
43
|
-
`+u),i.encoding==="utf-8"&&(u="\uFEFF"+u),e("export-finished",i.filename),!i.testing){const d=new Blob([u],{type:"text/csv;charset="+i.encoding});wT.saveAs(d,i.filename)}};return(u,d)=>(h.openBlock(),h.createElementBlock("div",{id:s.value,"data-testid":"export-csv",onClick:c},[h.renderSlot(u.$slots,"default",{},()=>[h.createTextVNode("Download "+h.toDisplayString(n.filename),1)])],8,MT))}}),DT=h.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(n){const t=n,e=h.computed(()=>Object.keys(t.headers));return(i,s)=>(h.openBlock(),h.createElementBlock("div",null,[h.createVNode(kT,{data:i.rows,fields:e.value,filename:i.filename,labels:i.headers},{default:h.withCtx(()=>[h.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),ST={class:"kong-ui-public-csv-export-modal"},TT={key:0,class:"selected-range"},CT={key:1,class:"text-muted",tag:"span"},bg=3,PT=h.defineComponent({__name:"CsvExportModal",props:{filename:{},modalDescription:{default:void 0},chartData:{}},emits:["toggleModal"],setup(n,{emit:t}){const{i18n:e}=bt.useI18n(),i=n,s=t,r=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,o=h.ref(!0),a=h.computed(()=>{var y,x;return!!((x=(y=i.chartData)==null?void 0:y.data)!=null&&x.length)}),l=h.ref(1),c=h.computed(()=>g.value.rows.length),u=bt.useChartSelectedRange(h.toRef(i,"chartData")),d=h.computed(()=>e.t("csvExport.previewRows",{rowsMax:Math.min(bg,c.value),rowsTotal:c.value,plural:c.value===1?"":"s"})),f=()=>{s("toggleModal",!1)},g=h.computed(()=>{var
|
|
37
|
+
`:"\r"}}function x(b){return b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function v(b){var _=(b=b||{}).delimiter,C=b.newline,I=b.comments,T=b.step,F=b.preview,U=b.fastMode,X=null,Q=!1,V=b.quoteChar==null?'"':b.quoteChar,ut=V;if(b.escapeChar!==void 0&&(ut=b.escapeChar),(typeof _!="string"||-1<c.BAD_DELIMITERS.indexOf(_))&&(_=","),I===_)throw new Error("Comment character same as delimiter");I===!0?I="#":(typeof I!="string"||-1<c.BAD_DELIMITERS.indexOf(I))&&(I=!1),C!==`
|
|
38
|
+
`&&C!=="\r"&&C!==`\r
|
|
39
|
+
`&&(C=`
|
|
40
|
+
`);var $=0,G=!1;this.parse=function(J,z,B){if(typeof J!="string")throw new Error("Input must be a string");var ft=J.length,yt=_.length,vt=C.length,gt=I.length,pt=O(T),H=[],j=[],Y=[],Z=$=0;if(!J)return Mt();if(U||U!==!1&&J.indexOf(V)===-1){for(var tt=J.split(C),et=0;et<tt.length;et++){if(Y=tt[et],$+=Y.length,et!==tt.length-1)$+=C.length;else if(B)return Mt();if(!I||Y.substring(0,gt)!==I){if(pt){if(H=[],te(Y.split(_)),qt(),G)return Mt()}else te(Y.split(_));if(F&&F<=et)return H=H.slice(0,F),Mt(!0)}}return Mt()}for(var it=J.indexOf(_,$),nt=J.indexOf(C,$),xt=new RegExp(x(ut)+x(V),"g"),at=J.indexOf(V,$);;)if(J[$]===V)for(at=$,$++;;){if((at=J.indexOf(V,at+1))===-1)return B||j.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:H.length,index:$}),Xt();if(at===ft-1)return Xt(J.substring($,at).replace(xt,V));if(V===ut&&J[at+1]===ut)at++;else if(V===ut||at===0||J[at-1]!==ut){it!==-1&&it<at+1&&(it=J.indexOf(_,at+1));var Pt=ae((nt=nt!==-1&&nt<at+1?J.indexOf(C,at+1):nt)===-1?it:Math.min(it,nt));if(J.substr(at+1+Pt,yt)===_){Y.push(J.substring($,at).replace(xt,V)),J[$=at+1+Pt+yt]!==V&&(at=J.indexOf(V,$)),it=J.indexOf(_,$),nt=J.indexOf(C,$);break}if(Pt=ae(nt),J.substring(at+1+Pt,at+1+Pt+vt)===C){if(Y.push(J.substring($,at).replace(xt,V)),Oe(at+1+Pt+vt),it=J.indexOf(_,$),at=J.indexOf(V,$),pt&&(qt(),G))return Mt();if(F&&H.length>=F)return Mt(!0);break}j.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:H.length,index:$}),at++}}else if(I&&Y.length===0&&J.substring($,$+gt)===I){if(nt===-1)return Mt();$=nt+vt,nt=J.indexOf(C,$),it=J.indexOf(_,$)}else if(it!==-1&&(it<nt||nt===-1))Y.push(J.substring($,it)),$=it+yt,it=J.indexOf(_,$);else{if(nt===-1)break;if(Y.push(J.substring($,nt)),Oe(nt+vt),pt&&(qt(),G))return Mt();if(F&&H.length>=F)return Mt(!0)}return Xt();function te(Bt){H.push(Bt),Z=$}function ae(Bt){var Gt=0;return Gt=Bt!==-1&&(Bt=J.substring(at+1,Bt))&&Bt.trim()===""?Bt.length:Gt}function Xt(Bt){return B||(Bt===void 0&&(Bt=J.substring($)),Y.push(Bt),$=ft,te(Y),pt&&qt()),Mt()}function Oe(Bt){$=Bt,te(Y),Y=[],nt=J.indexOf(C,$)}function Mt(Bt){if(b.header&&!z&&H.length&&!Q){var Gt=H[0],ie=Object.create(null),Xe=new Set(Gt);let ei=!1;for(let Ne=0;Ne<Gt.length;Ne++){let Ht=Gt[Ne];if(ie[Ht=O(b.transformHeader)?b.transformHeader(Ht,Ne):Ht]){let _e,ni=ie[Ht];for(;_e=Ht+"_"+ni,ni++,Xe.has(_e););Xe.add(_e),Gt[Ne]=_e,ie[Ht]++,ei=!0,(X=X===null?{}:X)[_e]=Ht}else ie[Ht]=1,Gt[Ne]=Ht;Xe.add(Ht)}ei&&console.warn("Duplicate headers found and renamed."),Q=!0}return{data:H,errors:j,meta:{delimiter:_,linebreak:C,aborted:G,truncated:!!Bt,cursor:Z+(z||0),renamedHeaders:X}}}function qt(){T(Mt()),H=[],j=[]}},this.abort=function(){G=!0},this.getCharIndex=function(){return $}}function M(b){var _=b.data,C=a[_.workerId],I=!1;if(_.error)C.userError(_.error,_.file);else if(_.results&&_.results.data){var T={abort:function(){I=!0,D(_.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:S,resume:S};if(O(C.userStep)){for(var F=0;F<_.results.data.length&&(C.userStep({data:_.results.data[F],errors:_.results.errors,meta:_.results.meta},T),!I);F++);delete _.results}else O(C.userChunk)&&(C.userChunk(_.results,T,_.file),delete _.results)}_.finished&&!I&&D(_.workerId,_.results)}function D(b,_){var C=a[b];O(C.userComplete)&&C.userComplete(_),C.terminate(),delete a[b]}function S(){throw new Error("Not implemented.")}function P(b){if(typeof b!="object"||b===null)return b;var _,C=Array.isArray(b)?[]:{};for(_ in b)C[_]=P(b[_]);return C}function R(b,_){return function(){b.apply(_,arguments)}}function O(b){return typeof b=="function"}return c.parse=function(b,_){var C=(_=_||{}).dynamicTyping||!1;if(O(C)&&(_.dynamicTypingFunction=C,C={}),_.dynamicTyping=C,_.transform=!!O(_.transform)&&_.transform,!_.worker||!c.WORKERS_SUPPORTED)return C=null,c.NODE_STREAM_INPUT,typeof b=="string"?(b=(I=>I.charCodeAt(0)!==65279?I:I.slice(1))(b),C=new(_.download?d:g)(_)):b.readable===!0&&O(b.read)&&O(b.on)?C=new p(_):(i.File&&b instanceof File||b instanceof Object)&&(C=new f(_)),C.stream(b);(C=(()=>{var I;return!!c.WORKERS_SUPPORTED&&(I=(()=>{var T=i.URL||i.webkitURL||null,F=e.toString();return c.BLOB_URL||(c.BLOB_URL=T.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",F,")();"],{type:"text/javascript"})))})(),(I=new i.Worker(I)).onmessage=M,I.id=l++,a[I.id]=I)})()).userStep=_.step,C.userChunk=_.chunk,C.userComplete=_.complete,C.userError=_.error,_.step=O(_.step),_.chunk=O(_.chunk),_.complete=O(_.complete),_.error=O(_.error),delete _.worker,C.postMessage({input:b,config:_,workerId:C.id})},c.unparse=function(b,_){var C=!1,I=!0,T=",",F=`\r
|
|
41
|
+
`,U='"',X=U+U,Q=!1,V=null,ut=!1,$=((()=>{if(typeof _=="object"){if(typeof _.delimiter!="string"||c.BAD_DELIMITERS.filter(function(z){return _.delimiter.indexOf(z)!==-1}).length||(T=_.delimiter),typeof _.quotes!="boolean"&&typeof _.quotes!="function"&&!Array.isArray(_.quotes)||(C=_.quotes),typeof _.skipEmptyLines!="boolean"&&typeof _.skipEmptyLines!="string"||(Q=_.skipEmptyLines),typeof _.newline=="string"&&(F=_.newline),typeof _.quoteChar=="string"&&(U=_.quoteChar),typeof _.header=="boolean"&&(I=_.header),Array.isArray(_.columns)){if(_.columns.length===0)throw new Error("Option columns is empty");V=_.columns}_.escapeChar!==void 0&&(X=_.escapeChar+U),_.escapeFormulae instanceof RegExp?ut=_.escapeFormulae:typeof _.escapeFormulae=="boolean"&&_.escapeFormulae&&(ut=/^[=+\-@\t\r].*$/)}})(),new RegExp(x(U),"g"));if(typeof b=="string"&&(b=JSON.parse(b)),Array.isArray(b)){if(!b.length||Array.isArray(b[0]))return G(null,b,Q);if(typeof b[0]=="object")return G(V||Object.keys(b[0]),b,Q)}else if(typeof b=="object")return typeof b.data=="string"&&(b.data=JSON.parse(b.data)),Array.isArray(b.data)&&(b.fields||(b.fields=b.meta&&b.meta.fields||V),b.fields||(b.fields=Array.isArray(b.data[0])?b.fields:typeof b.data[0]=="object"?Object.keys(b.data[0]):[]),Array.isArray(b.data[0])||typeof b.data[0]=="object"||(b.data=[b.data])),G(b.fields||[],b.data||[],Q);throw new Error("Unable to serialize unrecognized input");function G(z,B,ft){var yt="",vt=(typeof z=="string"&&(z=JSON.parse(z)),typeof B=="string"&&(B=JSON.parse(B)),Array.isArray(z)&&0<z.length),gt=!Array.isArray(B[0]);if(vt&&I){for(var pt=0;pt<z.length;pt++)0<pt&&(yt+=T),yt+=J(z[pt],pt);0<B.length&&(yt+=F)}for(var H=0;H<B.length;H++){var j=(vt?z:B[H]).length,Y=!1,Z=vt?Object.keys(B[H]).length===0:B[H].length===0;if(ft&&!vt&&(Y=ft==="greedy"?B[H].join("").trim()==="":B[H].length===1&&B[H][0].length===0),ft==="greedy"&&vt){for(var tt=[],et=0;et<j;et++){var it=gt?z[et]:et;tt.push(B[H][it])}Y=tt.join("").trim()===""}if(!Y){for(var nt=0;nt<j;nt++){0<nt&&!Z&&(yt+=T);var xt=vt&>?z[nt]:nt;yt+=J(B[H][xt],nt)}H<B.length-1&&(!ft||0<j&&!Z)&&(yt+=F)}}return yt}function J(z,B){var ft,yt;return z==null?"":z.constructor===Date?JSON.stringify(z).slice(1,25):(yt=!1,ut&&typeof z=="string"&&ut.test(z)&&(z="'"+z,yt=!0),ft=z.toString().replace($,X),(yt=yt||C===!0||typeof C=="function"&&C(z,B)||Array.isArray(C)&&C[B]||((vt,gt)=>{for(var pt=0;pt<gt.length;pt++)if(-1<vt.indexOf(gt[pt]))return!0;return!1})(ft,c.BAD_DELIMITERS)||-1<ft.indexOf(T)||ft.charAt(0)===" "||ft.charAt(ft.length-1)===" ")?U+ft+U:ft)}},c.RECORD_SEP="",c.UNIT_SEP="",c.BYTE_ORDER_MARK="\uFEFF",c.BAD_DELIMITERS=["\r",`
|
|
42
|
+
`,'"',c.BYTE_ORDER_MARK],c.WORKERS_SUPPORTED=!r&&!!i.Worker,c.NODE_STREAM_INPUT=1,c.LocalChunkSize=10485760,c.RemoteChunkSize=5242880,c.DefaultDelimiter=",",c.Parser=v,c.ParserHandle=y,c.NetworkStreamer=d,c.FileStreamer=f,c.StringStreamer=g,c.ReadableStreamStreamer=p,i.jQuery&&((s=i.jQuery).fn.parse=function(b){var _=b.config||{},C=[];return this.each(function(F){if(!(s(this).prop("tagName").toUpperCase()==="INPUT"&&s(this).attr("type").toLowerCase()==="file"&&i.FileReader)||!this.files||this.files.length===0)return!0;for(var U=0;U<this.files.length;U++)C.push({file:this.files[U],inputElem:this,instanceConfig:s.extend({},_)})}),I(),this;function I(){if(C.length===0)O(b.complete)&&b.complete();else{var F,U,X,Q,V=C[0];if(O(b.before)){var ut=b.before(V.file,V.inputElem);if(typeof ut=="object"){if(ut.action==="abort")return F="AbortError",U=V.file,X=V.inputElem,Q=ut.reason,void(O(b.error)&&b.error({name:F},U,X,Q));if(ut.action==="skip")return void T();typeof ut.config=="object"&&(V.instanceConfig=s.extend(V.instanceConfig,ut.config))}else if(ut==="skip")return void T()}var $=V.instanceConfig.complete;V.instanceConfig.complete=function(G){O($)&&$(G,V.file,V.inputElem),T()},c.parse(V.file,V.instanceConfig)}}function T(){C.splice(0,1),I()}}),o&&(i.onmessage=function(b){b=b.data,c.WORKER_ID===void 0&&b&&(c.WORKER_ID=b.workerId),typeof b.input=="string"?i.postMessage({workerId:c.WORKER_ID,results:c.parse(b.input,b.config),finished:!0}):(i.File&&b.input instanceof File||b.input instanceof Object)&&(b=c.parse(b.input,b.config))&&i.postMessage({workerId:c.WORKER_ID,results:b,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,(p.prototype=Object.create(u.prototype)).constructor=p,c})})(yg);var vT=yg.exports;const MT=["id"],kT=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,i=n,s=h.computed(()=>`export_${new Date().getTime()}`),r=h.computed(()=>{const u=l();return u.length?u:null}),o=()=>{const u=i.labels;if(typeof i.fields!==ti.Object)throw new Error("Labels needs to be a object containing key / value pairs.");return typeof u===ti.Object?d=>VS(d,(f,g)=>u[g]||g):d=>d},a=()=>{const u=i.fields;if(typeof i.fields!==ti.Object&&!Array.isArray(u))throw new Error("Fields needs to be an array of strings.");return Array.isArray(u)?d=>xT(d,u):d=>d},l=()=>{if(typeof i.fields===ti.Undefined&&typeof i.labels===ti.Undefined)return i.data;const u=o(),d=a();return i.data.map(f=>u(d(f)))},c=()=>{if(!(r!=null&&r.value)){console.warn("No data to export");return}e("export-started",r.value);let u=vT.unparse(r.value,Object.assign({delimiter:i.delimiter,encoding:i.encoding}));if(i.separatorExcel&&(u="SEP="+i.delimiter+`\r
|
|
43
|
+
`+u),i.encoding==="utf-8"&&(u="\uFEFF"+u),e("export-finished",i.filename),!i.testing){const d=new Blob([u],{type:"text/csv;charset="+i.encoding});wT.saveAs(d,i.filename)}};return(u,d)=>(h.openBlock(),h.createElementBlock("div",{id:s.value,"data-testid":"export-csv",onClick:c},[h.renderSlot(u.$slots,"default",{},()=>[h.createTextVNode("Download "+h.toDisplayString(n.filename),1)])],8,MT))}}),DT=h.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(n){const t=n,e=h.computed(()=>Object.keys(t.headers));return(i,s)=>(h.openBlock(),h.createElementBlock("div",null,[h.createVNode(kT,{data:i.rows,fields:e.value,filename:i.filename,labels:i.headers},{default:h.withCtx(()=>[h.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),ST={class:"kong-ui-public-csv-export-modal"},TT={key:0,class:"selected-range"},CT={key:1,class:"text-muted",tag:"span"},bg=3,PT=h.defineComponent({__name:"CsvExportModal",props:{filename:{},modalDescription:{default:void 0},chartData:{}},emits:["toggleModal"],setup(n,{emit:t}){const{i18n:e}=bt.useI18n(),i=n,s=t,r=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,o=h.ref(!0),a=h.computed(()=>{var y,x;return!!((x=(y=i.chartData)==null?void 0:y.data)!=null&&x.length)}),l=h.ref(1),c=h.computed(()=>g.value.rows.length),u=bt.useChartSelectedRange(h.toRef(i,"chartData")),d=h.computed(()=>e.t("csvExport.previewRows",{rowsMax:Math.min(bg,c.value),rowsTotal:c.value,plural:c.value===1?"":"s"})),f=()=>{s("toggleModal",!1)},g=h.computed(()=>{var P,R,O;if(!a.value||!((P=i.chartData)!=null&&P.meta.metric_names))return{headers:[],rows:[],csvHeaders:{}};const y=i.chartData.data.some(b=>b.timestamp!==i.chartData.data[0].timestamp),x=i.chartData.data.map(b=>{const _=new Date(b.timestamp);return{...Object.keys(b.event).reduce((I,T)=>{if(T in i.chartData.meta.display){const F=b.event[T],U=i.chartData.meta.display[T];I[T]=F&&U&&U[F].name||b.event[T]}else I[T]=b.event[T];return I},{}),...y?{timestamp:Ya(_,"yyyy-MM-dd HH:mm:ss"),tzOffset:Ya(_,"XXX")}:{}}});let v=[];y&&(v=[{label:e.t("csvExport.Timestamp"),key:"timestamp"},{label:e.t("csvExport.UtcOffset"),key:"tzOffset"}]);const M="display"in i.chartData.meta&&((R=i.chartData.meta)!=null&&R.display)?(O=i.chartData.meta)==null?void 0:O.display:{},D=[...v,...Object.keys(M).map(b=>({label:e.t(`chartLabels.${b}`),key:b})),...i.chartData.meta.metric_names.map(b=>({label:e.t(`chartLabels.${b}`),key:b}))],S=D.reduce((b,_)=>(b[_.key]=_.label,b),{});return{headers:D,csvHeaders:S,rows:x}}),p=async()=>{const{rows:y}=g.value;return o.value=!1,{total:Number(y.length)||0,data:y.slice(0,bg)}};return h.watch(g,()=>{l.value++}),(y,x)=>{const v=h.resolveComponent("KEmptyState"),M=h.resolveComponent("KTableData"),D=h.resolveComponent("KButton"),S=h.resolveComponent("KModal");return h.openBlock(),h.createElementBlock("div",ST,[h.createVNode(S,{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 P;return[h.createElementVNode("div",null,[a.value?(h.openBlock(),h.createElementBlock("div",TT,[h.createElementVNode("p",null,h.toDisplayString(y.modalDescription?y.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",fetcher:p,"fetcher-cache-key":String(l.value),headers:((P=g.value)==null?void 0:P.headers)||[],"hide-pagination":"","row-hover":!1,sortable:!1},{"empty-state":h.withCtx(()=>[h.createVNode(v,{"action-button-visible":!1},{title:h.withCtx(()=>[h.createElementVNode("h5",null,h.toDisplayString(h.unref(e).t("csvExport.noDataRange")),1)]),default:h.withCtx(()=>[h.createElementVNode("p",null,h.toDisplayString(h.unref(e).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"]),!o.value&&a.value?(h.openBlock(),h.createElementBlock("div",CT,h.toDisplayString(d.value),1)):h.createCommentVNode("",!0)])]}),"footer-actions":h.withCtx(()=>[h.createVNode(D,{appearance:"tertiary",class:"cancel-btn",onClick:f},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("csvExport.cancelButton")),1)]),_:1}),h.createVNode(DT,{class:"vitals-report-export-button",filename:r,headers:g.value.csvHeaders,rows:g.value.rows},{default:h.withCtx(()=>[h.createVNode(D,{appearance:"primary","data-testid":"csv-download-button",disabled:o.value||!a.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"])])}}});ot.AnalyticsChart=bS,ot.ChartLegendPosition=Nt,ot.CsvExportModal=PT,ot.DECIMAL_DISPLAY=fw,ot.EMPTY_COLOR=ih,ot.FONT_SIZE_REGULAR=Qd,ot.FONT_SIZE_SMALL=Zd,ot.MAX_LABEL_LENGTH=Rr,ot.OTHERS_COLOR=bw,ot.SimpleChart=OS,ot.TopNTable=YS,ot.ValidType=ti,ot.accessibleGrey=eh,ot.apiRequestStatusCodeColors=nh,ot.chartTypes=uS,ot.codesInSpec=ah,ot.darkenColor=th,ot.datavisPalette=sn,ot.defaultStatusCodeColors=Lr,ot.determineBaseColor=Oa,ot.errorRateColors=mw,ot.latencyColors=yw,ot.lightGrey=Ra,ot.lookupColor=_w,ot.lookupDatavisColor=Ir,ot.lookupStatusCodeCategoryColor=Sw,ot.lookupStatusCodeColor=Ia,ot.numberFormatter=Pa,ot.simpleChartMetricDisplay=cS,ot.simpleChartTypes=dS,ot.statusCodeBadgeBackgroundColor=gw,ot.trafficColors=pw,Object.defineProperty(ot,Symbol.toStringTag,{value:"Module"})});
|