@kong-ui-public/analytics-chart 6.2.4 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,17 +15,17 @@
15
15
  * Released under the MIT License
16
16
  */class Xp{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=pc.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 nn=new Xp;const $c="transparent",Gp={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=wc(n||$c),s=i.valid&&wc(t||$c);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class Kp{constructor(t,e,i,s){const r=e[i];s=Zi([t.to,s,r,t.from]);const o=Zi([t.from,r,s]);this._active=!0,this._fn=t.fn||Gp[t.type||typeof o],this._easing=Ui[t.easing]||Ui.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=Zi([t.to,e,s,t.from]),this._from=Zi([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 Ho{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!lt(t))return;const e=Object.keys(Pt.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const r=t[s];if(!lt(r))return;const o={};for(const a of e)o[a]=r[a];(_t(r.properties)&&r.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,o)})})}_animateOptions(t,e){const i=e.options,s=Qp(t,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&Zp(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 h=i.get(c);if(d)if(h&&d.active()){d.update(h,u,a);continue}else d.cancel();if(!h||!h.duration){t[c]=u;continue}r[c]=d=new Kp(h,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 nn.add(this._chart,i),!0}}function Zp(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 Qp(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 Uc(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 Jp(n,t,e){if(e===!1)return!1;const i=Uc(n,e),s=Uc(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function tm(n){let t,e,i,s;return lt(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 qc(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 Xc(n,t,e,i={}){const s=n.keys,r=i.mode==="single";let o,a,l,c;if(t!==null){for(o=0,a=s.length;o<a;++o){if(l=+s[o],l===e){if(i.all)continue;break}c=n.values[l],Et(c)&&(r||t===0||je(t)===je(c))&&(t+=c)}return t}}function em(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 Wo(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function nm(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function im(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 sm(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function Gc(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 Kc(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=nm(r,o,i),d=t.length;let h;for(let g=0;g<d;++g){const p=t[g],{[l]:b,[c]:w}=p,v=p._stacks||(p._stacks={});h=v[c]=sm(s,u,b),h[a]=w,h._top=Gc(h,o,!0,i.type),h._bottom=Gc(h,o,!1,i.type);const S=h._visualValues||(h._visualValues={});S[a]=w}}function Yo(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function rm(n,t){return xn(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function om(n,t,e){return xn(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Qi(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 jo=n=>n==="reset"||n==="none",Zc=(n,t)=>t?n:Object.assign({},n),am=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:qc(e,!0),values:null};class Ne{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=Wo(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&&Qi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(d,h,g,p)=>d==="x"?h:d==="r"?p:g,r=e.xAxisID=it(i.xAxisID,Yo(t,"x")),o=e.yAxisID=it(i.yAxisID,Yo(t,"y")),a=e.rAxisID=it(i.rAxisID,Yo(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&&fc(this._data,this),t._stacked&&Qi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(lt(e)){const s=this._cachedMeta;this._data=em(e,s)}else if(i!==e){if(i){fc(i,this);const s=this._cachedMeta;Qi(s),s._parsed=[]}e&&Object.isExtensible(e)&&Ug(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=Wo(e.vScale,e),e.stack!==i.stack&&(s=!0,Qi(e),e.stack=i.stack),this._resyncElements(t),(s||r!==e._stacked)&&(Kc(this,e._parsed),e._stacked=Wo(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,h;if(this._parsing===!1)i._parsed=s,i._sorted=!0,h=s;else{_t(s[t])?h=this.parseArrayData(i,s,t,e):lt(s[t])?h=this.parseObjectData(i,s,t,e):h=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=h[u],l&&(g()&&(l=!1),c=d);i._sorted=l}o&&Kc(this,h)}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 h,g,p;for(h=0,g=s;h<g;++h)p=h+i,d[h]={[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,h,g;for(u=0,d=s;u<d;++u)h=u+i,g=e[h],c[u]={x:r.parse(mn(g,a),h),y:o.parse(mn(g,l),h)};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:qc(s,!0),values:e._stacks[t.axis]._visualValues};return Xc(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=Xc(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=am(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=im(a);let h,g;function p(){g=s[h];const b=g[a.axis];return!Et(g[t.axis])||u>b||d<b}for(h=0;h<o&&!(!p()&&(this.updateRangeFromParsed(c,t,g,l),r));++h);if(r){for(h=o-1;h>=0;--h)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],Et(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=tm(it(this.options.clip,Jp(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=om(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=rm(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&&he(i);if(a)return Zc(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=s?[`${t}Hover`,"hover",t,""]:[t,""],h=c.getOptionScopes(this.getDataset(),u),g=Object.keys(Pt.elements[t]),p=()=>this.getContext(i,s,e),b=c.resolveNamedOptions(h,g,p,d);return b.$shared&&(b.$shared=l,r[o]=Object.freeze(Zc(b,l))),b}_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),h=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(h,this.getContext(t,i,e))}const c=new Ho(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||jo(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){jo(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!jo(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&&Qi(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])}}P(Ne,"defaults",{}),P(Ne,"datasetElementType",null),P(Ne,"dataElementType",null);function lm(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=gc(i.sort((s,r)=>s-r))}return n._cache.$bar}function cm(n){const t=n.iScale,e=lm(t,n.type);let i=t._length,s,r,o,a;const l=()=>{o===32767||o===-32768||(he(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 um(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 dm(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 hm(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 Qc(n,t,e,i){return _t(n)?hm(n,t,e,i):t[e.axis]=e.parse(n,i),t}function Jc(n,t,e,i){const s=n.iScale,r=n.vScale,o=s.getLabels(),a=s===r,l=[];let c,u,d,h;for(c=e,u=e+i;c<u;++c)h=t[c],d={},d[s.axis]=a||s.parse(o[c],c),l.push(Qc(h,d,r,c));return l}function Vo(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function fm(n,t,e){return n!==0?je(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function gm(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 pm(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}=gm(n);s==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=c:(e._bottom||0)===i?s=u:(r[tu(u,o,a,l)]=!0,s=c)),r[tu(s,o,a,l)]=!0,n.borderSkipped=r}function tu(n,t,e,i){return i?(n=mm(n,t,e),n=eu(n,e,t)):n=eu(n,t,e),n}function mm(n,t,e){return n===t?e:n===e?t:n}function eu(n,t,e){return n==="start"?t:n==="end"?e:n}function ym(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class Ji extends Ne{parsePrimitiveData(t,e,i,s){return Jc(t,e,i,s)}parseArrayData(t,e,i,s){return Jc(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 h,g,p,b;for(h=i,g=i+s;h<g;++h)b=e[h],p={},p[r.axis]=r.parse(mn(b,c),h),d.push(Qc(mn(b,u),p,o,h));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=Vo(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:h}=this._getSharedOptions(e,s);for(let g=e;g<e+i;g++){const p=this.getParsed(g),b=r||st(p[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(g),w=this._calculateBarIndexPixels(g,u),v=(p._stacks||{})[a.axis],S={horizontal:c,base:b.base,enableBorderRadius:!v||Vo(p._custom)||o===v._top||o===v._bottom,x:c?b.head:w.center,y:c?w.center:b.head,height:c?w.size:Math.abs(b.size),width:c?Math.abs(b.size):w.size};h&&(S.options=d||this.resolveDataElementOptions(g,t[g].active?"active":s));const D=S.options||t[g].options;pm(S,D,v,o),ym(S,D,u.ratio),this.updateElement(t[g],g,S,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),h=d&&d[u.vScale.axis];if(st(h)||isNaN(h))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}_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||cm(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=Vo(c);let d=l[e.axis],h=0,g=i?this.applyStack(e,l,i):d,p,b;g!==d&&(h=g-d,g=d),u&&(d=c.barStart,g=c.barEnd-c.barStart,d!==0&&je(d)!==je(c.barEnd)&&(h=0),h+=d);const w=!st(r)&&!u?r:h;let v=e.getPixelForValue(w);if(this.chart.getDataVisibility(t)?p=e.getPixelForValue(h+g):p=v,b=p-v,Math.abs(b)<o){b=fm(b,e,a)*o,d===a&&(v-=b/2);const S=e.getPixelForDecimal(0),D=e.getPixelForDecimal(1),k=Math.min(S,D),C=Math.max(S,D);v=Math.max(Math.min(v,C),k),p=v+b,i&&!u&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(p)-e.getValueForPixel(v))}if(v===e.getPixelForValue(a)){const S=je(b)*e.getLineWidthForValue(a)/2;v+=S,b-=S}return{size:b,base:v,head:p,center:p+b/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,r=s.skipNull,o=it(s.maxBarThickness,1/0);let a,l;if(e.grouped){const c=r?this._getStackCount(t):e.stackCount,u=s.barThickness==="flex"?dm(t,e,s,c):um(t,e,s,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0);a=u.start+u.chunk*d+u.chunk/2,l=Math.min(o,u.chunk*u.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)}}P(Ji,"id","bar"),P(Ji,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),P(Ji,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class ar extends Ne{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=it(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=it(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 h=e;h<e+i;h++){const g=t[h],p=!r&&this.getParsed(h),b={},w=b[u]=r?o.getPixelForDecimal(.5):o.getPixelForValue(p[u]),v=b[d]=r?a.getBasePixel():a.getPixelForValue(p[d]);b.skip=isNaN(w)||isNaN(v),c&&(b.options=l||this.resolveDataElementOptions(h,g.active?"active":s),r&&(b.options.radius=0)),this.updateElement(g,h,b,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+=it(i&&i._custom,r),s}}P(ar,"id","bubble"),P(ar,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),P(ar,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function bm(n,t,e){let i=1,s=1,r=0,o=0;if(t<kt){const a=n,l=a+t,c=Math.cos(a),u=Math.sin(a),d=Math.cos(l),h=Math.sin(l),g=(D,k,C)=>$i(D,a,l,!0)?1:Math.max(k,k*e,C,C*e),p=(D,k,C)=>$i(D,a,l,!0)?-1:Math.min(k,k*e,C,C*e),b=g(0,c,d),w=g(Ot,u,h),v=p(dt,c,d),S=p(dt+Ot,u,h);i=(b-v)/2,s=(w-S)/2,r=-(b+v)/2,o=-(w+S)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:o}}class sn extends Ne{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(lt(i[t])){const{key:l="value"}=this._parsing;r=c=>+mn(i[c],l)}let o,a;for(o=t,a=t+e;o<a;++o)s._parsed[o]=r(o)}}_getRotation(){return Yt(this.options.rotation-90)}_getCircumference(){return Yt(this.options.circumference)}_getRotationExtents(){let t=kt,e=-kt;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(Rg(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:h,ratioY:g,offsetX:p,offsetY:b}=bm(d,u,l),w=(i.width-o)/h,v=(i.height-o)/g,S=Math.max(Math.min(w,v)/2,0),D=rc(this.options.radius,S),k=Math.max(D*l,0),C=(D-k)/this._getVisibleDatasetWeightTotal();this.offsetX=p*D,this.offsetY=b*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/kt)}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,h=r&&c.animateScale,g=h?0:this.innerRadius,p=h?0:this.outerRadius,{sharedOptions:b,includeOptions:w}=this._getSharedOptions(e,s);let v=this._getRotation(),S;for(S=0;S<e;++S)v+=this._circumference(S,r);for(S=e;S<e+i;++S){const D=this._circumference(S,r),k=t[S],C={x:u+this.offsetX,y:d+this.offsetY,startAngle:v,endAngle:v+D,circumference:D,outerRadius:p,innerRadius:g};w&&(C.options=b||this.resolveDataElementOptions(S,k.active?"active":s)),v+=D,this.updateElement(k,S,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)?kt*(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(it(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}P(sn,"id","doughnut"),P(sn,"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"}),P(sn,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),P(sn,"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 ts extends Ne{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}=yc(e,s,o);this._drawStart=a,this._drawCount=l,bc(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),h=o.axis,g=a.axis,{spanGaps:p,segment:b}=this.options,w=bn(p)?p:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||r||s==="none",S=e+i,D=t.length;let k=e>0&&this.getParsed(e-1);for(let C=0;C<D;++C){const R=t[C],E=v?R:{};if(C<e||C>=S){E.skip=!0;continue}const m=this.getParsed(C),_=st(m[g]),T=E[h]=o.getPixelForValue(m[h],C),A=E[g]=r||_?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,m,l):m[g],C);E.skip=isNaN(T)||isNaN(A)||_,E.stop=C>0&&Math.abs(m[h]-k[h])>w,b&&(E.parsed=m,E.raw=c.data[C]),d&&(E.options=u||this.resolveDataElementOptions(C,R.active?"active":s)),v||this.updateElement(R,C,E,s),k=m}}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()}}P(ts,"id","line"),P(ts,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),P(ts,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class es extends Ne{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 Rc.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,h=c.getIndexAngle(0)-.5*dt;let g=h,p;const b=360/this.countVisibleElements();for(p=0;p<e;++p)g+=this._computeAngle(p,s,b);for(p=e;p<e+i;p++){const w=t[p];let v=g,S=g+this._computeAngle(p,s,b),D=o.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;g=S,r&&(l.animateScale&&(D=0),l.animateRotate&&(v=S=h));const k={x:u,y:d,innerRadius:0,outerRadius:D,startAngle:v,endAngle:S,options:this.resolveDataElementOptions(p,w.active?"active":s)};this.updateElement(w,p,k,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)?Yt(this.resolveDataElementOptions(t,e).angle||i):0}}P(es,"id","polarArea"),P(es,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),P(es,"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 $o extends sn{}P($o,"id","pie"),P($o,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class lr extends Ne{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 Rc.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,h=o?r.yCenter:u.y,g={x:d,y:h,angle:u.angle,skip:isNaN(d)||isNaN(h),options:c};this.updateElement(l,a,g,s)}}}P(lr,"id","radar"),P(lr,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),P(lr,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class cr extends Ne{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}=yc(e,i,s);if(this._drawStart=r,this._drawCount=o,bc(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),h=this.includeOptions(s,d),g=o.axis,p=a.axis,{spanGaps:b,segment:w}=this.options,v=bn(b)?b:Number.POSITIVE_INFINITY,S=this.chart._animationsDisabled||r||s==="none";let D=e>0&&this.getParsed(e-1);for(let k=e;k<e+i;++k){const C=t[k],R=this.getParsed(k),E=S?C:{},m=st(R[p]),_=E[g]=o.getPixelForValue(R[g],k),T=E[p]=r||m?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,R,l):R[p],k);E.skip=isNaN(_)||isNaN(T)||m,E.stop=k>0&&Math.abs(R[g]-D[g])>v,w&&(E.parsed=R,E.raw=c.data[k]),h&&(E.options=d||this.resolveDataElementOptions(k,C.active?"active":s)),S||this.updateElement(C,k,E,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}}P(cr,"id","scatter"),P(cr,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),P(cr,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var _m=Object.freeze({__proto__:null,BarController:Ji,BubbleController:ar,DoughnutController:sn,LineController:ts,PieController:$o,PolarAreaController:es,RadarController:lr,ScatterController:cr});function $n(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Uo{constructor(t){P(this,"options");this.options=t||{}}static override(t){Object.assign(Uo.prototype,t)}init(){}formats(){return $n()}parse(){return $n()}format(){return $n()}add(){return $n()}diff(){return $n()}startOf(){return $n()}endOf(){return $n()}}var nu={_date:Uo};function xm(n,t,e,i){const{controller:s,data:r,_sorted:o}=n,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&o&&r.length){const l=a._reversePixels?Vg:tn;if(i){if(s._sharedOptions){const c=r[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(r,t,e-u),h=l(r,t,e+u);return{lo:d.lo,hi:h.hi}}}}else return l(r,t,e)}return{lo:0,hi:r.length-1}}function ns(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:h}=xm(r[a],t,o,s);for(let g=d;g<=h;++g){const p=u[g];p.skip||i(p,c,g)}}}function wm(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 qo(n,t,e,i,s){const r=[];return!s&&!n.isPointInArea(t)||ns(n,e,t,function(a,l,c){!s&&!en(a,n.chartArea,0)||a.inRange(t.x,t.y,i)&&r.push({element:a,datasetIndex:l,index:c})},!0),r}function vm(n,t,e,i){let s=[];function r(o,a,l){const{startAngle:c,endAngle:u}=o.getProps(["startAngle","endAngle"],i),{angle:d}=Js(o,{x:t.x,y:t.y});$i(d,c,u)&&s.push({element:o,datasetIndex:a,index:l})}return ns(n,e,t,r),s}function Mm(n,t,e,i,s,r){let o=[];const a=wm(e);let l=Number.POSITIVE_INFINITY;function c(u,d,h){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 w=a(t,p);w<l?(o=[{element:u,datasetIndex:d,index:h}],l=w):w===l&&o.push({element:u,datasetIndex:d,index:h})}return ns(n,e,t,c),o}function Xo(n,t,e,i,s,r){return!r&&!n.isPointInArea(t)?[]:e==="r"&&!i?vm(n,t,e,s):Mm(n,t,e,i,s,r)}function iu(n,t,e,i,s){const r=[],o=e==="x"?"inXRange":"inYRange";let a=!1;return ns(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 Go={evaluateInteractionItems:ns,modes:{index(n,t,e,i){const s=wn(t,n),r=e.axis||"x",o=e.includeInvisible||!1,a=e.intersect?qo(n,s,r,i,o):Xo(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=wn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;let a=e.intersect?qo(n,s,r,i,o):Xo(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=wn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;return qo(n,s,r,i,o)},nearest(n,t,e,i){const s=wn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;return Xo(n,s,r,e.intersect,i,o)},x(n,t,e,i){const s=wn(t,n);return iu(n,s,"x",e.intersect,i)},y(n,t,e,i){const s=wn(t,n);return iu(n,s,"y",e.intersect,i)}}};const su=["left","top","right","bottom"];function is(n,t){return n.filter(e=>e.pos===t)}function ru(n,t){return n.filter(e=>su.indexOf(e.pos)===-1&&e.box.axis===t)}function ss(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 Sm(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 km(n){const t={};for(const e of n){const{stack:i,pos:s,stackWeight:r}=e;if(!i||!su.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 Dm(n,t){const e=km(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 Tm(n){const t=Sm(n),e=ss(t.filter(c=>c.box.fullSize),!0),i=ss(is(t,"left"),!0),s=ss(is(t,"right")),r=ss(is(t,"top"),!0),o=ss(is(t,"bottom")),a=ru(t,"x"),l=ru(t,"y");return{fullSize:e,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:is(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}function ou(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function au(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 Cm(n,t,e,i){const{pos:s,box:r}=e,o=n.maxPadding;if(!lt(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&&au(o,r.getPadding());const a=Math.max(0,t.outerWidth-ou(o,n,"left","right")),l=Math.max(0,t.outerHeight-ou(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 Om(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 Pm(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 rs(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,Pm(a.horizontal,t));const{same:d,other:h}=Cm(t,e,a,i);c|=d&&s.length,u=u||h,l.fullSize||s.push(a)}return c&&rs(s,t,e,i)||u}function ur(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 lu(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]||{count:1,placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*u,h=c.size||l.height;he(c.start)&&(o=c.start),l.fullSize?ur(l,s.left,o,e.outerWidth-s.right-s.left,h):ur(l,t.left+c.placed,o,d,h),c.start=o,c.placed+=d,o=l.bottom}else{const d=t.h*u,h=c.size||l.width;he(c.start)&&(r=c.start),l.fullSize?ur(l,r,s.top,h,e.outerHeight-s.bottom-s.top):ur(l,r,t.top+c.placed,h,d),c.start=r,c.placed+=d,r=l.right}}t.x=r,t.y=o}var ne={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=jt(n.options.layout.padding),r=Math.max(t-s.width,0),o=Math.max(e-s.height,0),a=Tm(n.boxes),l=a.vertical,c=a.horizontal;wt(n.boxes,b=>{typeof b.beforeLayout=="function"&&b.beforeLayout()});const u=l.reduce((b,w)=>w.box.options&&w.box.options.display===!1?b:b+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/u,hBoxMaxHeight:o/2}),h=Object.assign({},s);au(h,jt(i));const g=Object.assign({maxPadding:h,w:r,h:o,x:s.left,y:s.top},s),p=Dm(l.concat(c),d);rs(a.fullSize,g,d,p),rs(l,g,d,p),rs(c,g,d,p)&&rs(l,g,d,p),Om(g),lu(a.leftAndTop,g,d,p),g.x+=g.w,g.y+=g.h,lu(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},wt(a.chartArea,b=>{const w=b.box;Object.assign(w,n.chartArea),w.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class cu{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 Em extends cu{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const dr="$chartjs",Am={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},uu=n=>n===null||n==="";function Rm(n,t){const e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[dr]={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",uu(s)){const r=Nc(n,"width");r!==void 0&&(n.width=r)}if(uu(i))if(n.style.height==="")n.height=n.width/(t||2);else{const r=Nc(n,"height");r!==void 0&&(n.height=r)}return n}const du=Fp?{passive:!0}:!1;function Lm(n,t,e){n&&n.addEventListener(t,e,du)}function Im(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,du)}function Nm(n,t){const e=Am[n.type]||n.type,{x:i,y:s}=wn(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function hr(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function Fm(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||hr(a.addedNodes,i),o=o&&!hr(a.removedNodes,i);o&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function zm(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||hr(a.removedNodes,i),o=o&&!hr(a.addedNodes,i);o&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const os=new Map;let hu=0;function fu(){const n=window.devicePixelRatio;n!==hu&&(hu=n,os.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function Bm(n,t){os.size||window.addEventListener("resize",fu),os.set(n,t)}function Hm(n){os.delete(n),os.size||window.removeEventListener("resize",fu)}function Wm(n,t,e){const i=n.canvas,s=i&&Bo(i);if(!s)return;const r=mc((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),Bm(n,r),o}function Ko(n,t,e){e&&e.disconnect(),t==="resize"&&Hm(n)}function Ym(n,t,e){const i=n.canvas,s=mc(r=>{n.ctx!==null&&e(Nm(r,n))},n);return Lm(i,t,s),s}class jm extends cu{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Rm(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[dr])return!1;const i=e[dr].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[dr],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),o={attach:Fm,detach:zm,resize:Wm}[e]||Ym;s[e]=o(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:Ko,detach:Ko,resize:Ko}[e]||Im)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return Np(t,e,i,s)}isAttached(t){const e=t&&Bo(t);return!!(e&&e.isConnected)}}function Vm(n){return!zo()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Em:jm}class Gt{constructor(){P(this,"x");P(this,"y");P(this,"active",!1);P(this,"options");P(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return bn(this.x)&&bn(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}}P(Gt,"defaults",{}),P(Gt,"defaultRoutes");function $m(n,t){const e=n.options.ticks,i=Um(n),s=Math.min(e.maxTicksLimit||i,i),r=e.major.enabled?Xm(t):[],o=r.length,a=r[0],l=r[o-1],c=[];if(o>s)return Gm(t,c,r,o/s),c;const u=qm(r,t,s);if(o>0){let d,h;const g=o>1?Math.round((l-a)/(o-1)):null;for(fr(t,c,u,st(g)?0:a-g,a),d=0,h=o-1;d<h;d++)fr(t,c,u,r[d],r[d+1]);return fr(t,c,u,l,st(g)?t.length:l+g),c}return fr(t,c,u),c}function Um(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 qm(n,t,e){const i=Km(n),s=t.length/e;if(!i)return Math.max(s,1);const r=Hg(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 Xm(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function Gm(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 fr(n,t,e,i,s){const r=it(i,0),o=Math.min(it(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 Km(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 Zm=n=>n==="left"?"right":n==="right"?"left":n,gu=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,pu=(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 Qm(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 Jm(n,t){wt(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 as(n){return n.drawTicks?n.tickLength:0}function yu(n,t){if(!n.display)return 0;const e=At(n.font,t),i=jt(n.padding);return(_t(n.text)?n.text.length:1)*e.lineHeight+i.height}function ty(n,t){return xn(n,{scale:t,type:"scale"})}function ey(n,t,e){return xn(n,{tick:e,index:t,type:"tick"})}function ny(n,t,e){let i=Co(n);return(e&&t!=="right"||!e&&t==="right")&&(i=Zm(i)),i}function iy(n,t,e,i){const{top:s,left:r,bottom:o,right:a,chart:l}=n,{chartArea:c,scales:u}=l;let d=0,h,g,p;const b=o-s,w=a-r;if(n.isHorizontal()){if(g=ee(i,r,a),lt(e)){const v=Object.keys(e)[0],S=e[v];p=u[v].getPixelForValue(S)+b-t}else e==="center"?p=(c.bottom+c.top)/2+b-t:p=gu(n,e,t);h=a-r}else{if(lt(e)){const v=Object.keys(e)[0],S=e[v];g=u[v].getPixelForValue(S)-w+t}else e==="center"?g=(c.left+c.right)/2-w+t:g=gu(n,e,t);p=ee(i,o,s),d=e==="left"?-Ot:Ot}return{titleX:g,titleY:p,maxWidth:h,rotation:d}}class Un extends Gt{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=ke(t,Number.POSITIVE_INFINITY),e=ke(e,Number.NEGATIVE_INFINITY),i=ke(i,Number.POSITIVE_INFINITY),s=ke(s,Number.NEGATIVE_INFINITY),{min:ke(t,i),max:ke(e,s),minDefined:Et(t),maxDefined:Et(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:ke(e,ke(i,e)),max:ke(i,ke(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(){xt(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=gp(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=$m(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(){xt(this.options.afterUpdate,[this])}beforeSetDimensions(){xt(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(){xt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),xt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){xt(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=xt(e.callback,[r.value,i,t],this)}afterTickToLabelConversion(){xt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){xt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=pu(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,h=u.highest.height,g=Xt(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-as(t.grid)-e.padding-yu(t.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),o=Qs(Math.min(Math.asin(Xt((u.highest.height+6)/a,-1,1)),Math.asin(Xt(l/c,-1,1))-Math.asin(Xt(h/c,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){xt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){xt(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=yu(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=as(r)+l):(t.height=this.maxHeight,t.width=as(r)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),g=i.padding*2,p=Yt(this.labelRotation),b=Math.cos(p),w=Math.sin(p);if(a){const v=i.mirror?0:w*d.width+b*h.height;t.height=Math.min(this.maxHeight,t.height+v+g)}else{const v=i.mirror?0:b*d.width+w*h.height;t.width=Math.min(this.maxWidth,t.width+v+g)}this._calculatePadding(c,u,w,b)}}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 h=0,g=0;l?c?(h=s*t.width,g=i*e.height):(h=i*t.height,g=s*e.width):r==="start"?g=e.width:r==="end"?h=t.width:r!=="inner"&&(h=t.width/2,g=e.width/2),this.paddingLeft=Math.max((h-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(){xt(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/pu(e,i));let c=0,u=0,d,h,g,p,b,w,v,S,D,k,C;for(d=0;d<e;d+=l){if(p=t[d].label,b=this._resolveTickFontOptions(d),s.font=w=b.string,v=r[w]=r[w]||{data:{},gc:[]},S=b.lineHeight,D=k=0,!st(p)&&!_t(p))D=nr(s,v.data,v.gc,D,p),k=S;else if(_t(p))for(h=0,g=p.length;h<g;++h)C=p[h],!st(C)&&!_t(C)&&(D=nr(s,v.data,v.gc,D,C),k+=S);o.push(D),a.push(k),c=Math.max(D,c),u=Math.max(k,u)}Jm(r,e);const R=o.indexOf(c),E=a.indexOf(u),m=_=>({width:o[_]||0,height:a[_]||0});return{first:m(0),last:m(e-1),widest:m(R),highest:m(E),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 jg(this._alignToPixels?Wn(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=ey(this.getContext(),t,i))}return this.$context||(this.$context=ty(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Yt(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),h=as(r),g=[],p=a.setContext(this.getContext()),b=p.display?p.width:0,w=b/2,v=function(U){return Wn(i,U,b)};let S,D,k,C,R,E,m,_,T,A,L,N;if(o==="top")S=v(this.bottom),E=this.bottom-h,_=S-w,A=v(t.top)+w,N=t.bottom;else if(o==="bottom")S=v(this.top),A=t.top,N=v(t.bottom)-w,E=S+w,_=this.top+h;else if(o==="left")S=v(this.right),R=this.right-h,m=S-w,T=v(t.left)+w,L=t.right;else if(o==="right")S=v(this.left),T=t.left,L=v(t.right)-w,R=S+w,m=this.left+h;else if(e==="x"){if(o==="center")S=v((t.top+t.bottom)/2+.5);else if(lt(o)){const U=Object.keys(o)[0],H=o[U];S=v(this.chart.scales[U].getPixelForValue(H))}A=t.top,N=t.bottom,E=S+w,_=E+h}else if(e==="y"){if(o==="center")S=v((t.left+t.right)/2);else if(lt(o)){const U=Object.keys(o)[0],H=o[U];S=v(this.chart.scales[U].getPixelForValue(H))}R=S-w,m=R-h,T=t.left,L=t.right}const B=it(s.ticks.maxTicksLimit,d),G=Math.max(1,Math.ceil(d/B));for(D=0;D<d;D+=G){const U=this.getContext(D),H=r.setContext(U),ut=a.setContext(U),Y=H.lineWidth,et=H.color,Dt=ut.dash||[],$=ut.dashOffset,z=H.tickWidth,j=H.tickColor,X=H.tickBorderDash||[],Z=H.tickBorderDashOffset;k=Qm(this,D,l),k!==void 0&&(C=Wn(i,k,Y),c?R=m=T=L=C:E=_=A=N=C,g.push({tx1:R,ty1:E,tx2:m,ty2:_,x1:T,y1:A,x2:L,y2:N,width:Y,color:et,borderDash:Dt,borderDashOffset:$,tickWidth:z,tickColor:j,tickBorderDash:X,tickBorderDashOffset:Z}))}return this._ticksLength=d,this._borderValue=S,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,h=as(i.grid),g=h+u,p=d?-u:g,b=-Yt(this.labelRotation),w=[];let v,S,D,k,C,R,E,m,_,T,A,L,N="middle";if(s==="top")R=this.bottom-p,E=this._getXAxisLabelAlignment();else if(s==="bottom")R=this.top+p,E=this._getXAxisLabelAlignment();else if(s==="left"){const G=this._getYAxisLabelAlignment(h);E=G.textAlign,C=G.x}else if(s==="right"){const G=this._getYAxisLabelAlignment(h);E=G.textAlign,C=G.x}else if(e==="x"){if(s==="center")R=(t.top+t.bottom)/2+g;else if(lt(s)){const G=Object.keys(s)[0],U=s[G];R=this.chart.scales[G].getPixelForValue(U)+g}E=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")C=(t.left+t.right)/2-g;else if(lt(s)){const G=Object.keys(s)[0],U=s[G];C=this.chart.scales[G].getPixelForValue(U)}E=this._getYAxisLabelAlignment(h).textAlign}e==="y"&&(l==="start"?N="top":l==="end"&&(N="bottom"));const B=this._getLabelSizes();for(v=0,S=a.length;v<S;++v){D=a[v],k=D.label;const G=r.setContext(this.getContext(v));m=this.getPixelForTick(v)+r.labelOffset,_=this._resolveTickFontOptions(v),T=_.lineHeight,A=_t(k)?k.length:1;const U=A/2,H=G.color,ut=G.textStrokeColor,Y=G.textStrokeWidth;let et=E;o?(C=m,E==="inner"&&(v===S-1?et=this.options.reverse?"left":"right":v===0?et=this.options.reverse?"right":"left":et="center"),s==="top"?c==="near"||b!==0?L=-A*T+T/2:c==="center"?L=-B.highest.height/2-U*T+T:L=-B.highest.height+T/2:c==="near"||b!==0?L=T/2:c==="center"?L=B.highest.height/2-U*T:L=B.highest.height-A*T,d&&(L*=-1),b!==0&&!G.showLabelBackdrop&&(C+=T/2*Math.sin(b))):(R=m,L=(1-A)*T/2);let Dt;if(G.showLabelBackdrop){const $=jt(G.backdropPadding),z=B.heights[v],j=B.widths[v];let X=L-$.top,Z=0-$.left;switch(N){case"middle":X-=z/2;break;case"bottom":X-=z;break}switch(E){case"center":Z-=j/2;break;case"right":Z-=j;break;case"inner":v===S-1?Z-=j:v>0&&(Z-=j/2);break}Dt={left:Z,top:X,width:j+$.width,height:z+$.height,color:G.backdropColor}}w.push({label:k,font:_,textOffset:L,options:{rotation:b,color:H,strokeColor:ut,strokeWidth:Y,textAlign:et,textBaseline:N,translation:[C,R],backdrop:Dt}})}return w}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Yt(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,h;this.isHorizontal()?(c=Wn(t,this.left,o)-o/2,u=Wn(t,this.right,a)+a/2,d=h=l):(d=Wn(t,this.top,o)-o/2,h=Wn(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,h),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&Gi(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;Yn(i,c,0,u,l,a)}s&&Ki(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const r=At(i.font),o=jt(i.padding),a=i.align;let l=r.lineHeight/2;e==="bottom"||e==="center"||lt(e)?(l+=o.bottom,_t(i.text)&&(l+=r.lineHeight*(i.text.length-1))):l+=o.top;const{titleX:c,titleY:u,maxWidth:d,rotation:h}=iy(this,l,e,a);Yn(t,i.text,0,0,r,{color:i.color,maxWidth:d,rotation:h,textAlign:ny(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=it(t.grid&&t.grid.z,-1),s=it(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Un.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 At(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class gr{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;oy(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,sy(t,o,i),this.override&&Pt.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 Pt[s]&&(delete Pt[s][i],this.override&&delete Hn[i])}}function sy(n,t,e){const i=Yi(Object.create(null),[e?Pt.get(e):{},Pt.get(t),n.defaults]);Pt.set(t,i),n.defaultRoutes&&ry(t,n.defaultRoutes),n.descriptors&&Pt.describe(t,n.descriptors)}function ry(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(".");Pt.route(r,s,l,a)})}function oy(n){return"id"in n&&"defaults"in n}class ay{constructor(){this.controllers=new gr(Ne,"datasets",!0),this.elements=new gr(Gt,"elements"),this.plugins=new gr(Object,"plugins"),this.scales=new gr(Un,"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):wt(s,o=>{const a=i||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,e,i){const s=ko(t);xt(i["before"+s],[],i),e[t](i),xt(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 Ve=new ay;class ly{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(xt(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=it(i.options&&i.options.plugins,{}),r=cy(i);return s===!1&&!e?[]:dy(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 cy(n){const t={},e=[],i=Object.keys(Ve.plugins.items);for(let r=0;r<i.length;r++)e.push(Ve.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 uy(n,t){return!t&&n===!1?null:n===!0?{}:n}function dy(n,{plugins:t,localIds:e},i,s){const r=[],o=n.getContext();for(const a of t){const l=a.id,c=uy(i[l],s);c!==null&&r.push({plugin:a,options:hy(n.config,{plugin:a,local:e[l]},c,o)})}return r}function hy(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 Zo(n,t){const e=Pt.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function fy(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function gy(n,t){return n===t?"_index_":"_value_"}function bu(n){if(n==="x"||n==="y"||n==="r")return n}function py(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function Qo(n,...t){if(bu(n))return n;for(const e of t){const i=e.axis||py(e.position)||n.length>1&&bu(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function _u(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function my(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 _u(n,"x",e[0])||_u(n,"y",e[0])}return{}}function yy(n,t){const e=Hn[n.type]||{scales:{}},i=t.scales||{},s=Zo(n.type,t),r=Object.create(null);return Object.keys(i).forEach(o=>{const a=i[o];if(!lt(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=Qo(o,a,my(o,n),Pt.scales[a.type]),c=gy(l,s),u=e.scales||{};r[o]=ji(Object.create(null),[{axis:l},a,u[l],u[c]])}),n.data.datasets.forEach(o=>{const a=o.type||n.type,l=o.indexAxis||Zo(a,t),u=(Hn[a]||{}).scales||{};Object.keys(u).forEach(d=>{const h=fy(d,l),g=o[h+"AxisID"]||h;r[g]=r[g]||Object.create(null),ji(r[g],[{axis:h},i[g],u[d]])})}),Object.keys(r).forEach(o=>{const a=r[o];ji(a,[Pt.scales[a.type],Pt.scale])}),r}function xu(n){const t=n.options||(n.options={});t.plugins=it(t.plugins,{}),t.scales=yy(n,t)}function wu(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function by(n){return n=n||{},n.data=wu(n.data),xu(n),n}const vu=new Map,Mu=new Set;function pr(n,t){let e=vu.get(n);return e||(e=t(),vu.set(n,e),Mu.add(e)),e}const ls=(n,t,e)=>{const i=mn(t,e);i!==void 0&&n.add(i)};class _y{constructor(t){this._config=by(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=wu(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(),xu(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return pr(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return pr(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return pr(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return pr(`${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=>ls(l,t,d))),u.forEach(d=>ls(l,s,d)),u.forEach(d=>ls(l,Hn[r]||{},d)),u.forEach(d=>ls(l,Pt,d)),u.forEach(d=>ls(l,Eo,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Mu.has(e)&&o.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Hn[e]||{},Pt.datasets[e]||{},{type:e},Pt,Eo]}resolveNamedOptions(t,e,i,s=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=Su(this._resolverCache,t,s);let l=o;if(wy(o,e)){r.$shared=!1,i=fe(i)?i():i;const c=this.createResolver(t,i,a);l=di(o,i,c)}for(const c of e)r[c]=l[c];return r}createResolver(t,e,i=[""],s){const{resolver:r}=Su(this._resolverCache,t,i);return lt(e)?di(r,e,void 0,s):r}}function Su(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:Io(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,r)),r}const xy=n=>lt(n)&&Object.getOwnPropertyNames(n).some(t=>fe(n[t]));function wy(n,t){const{isScriptable:e,isIndexable:i}=Tc(n);for(const s of t){const r=e(s),o=i(s),a=(o||r)&&n[s];if(r&&(fe(a)||xy(a))||o&&_t(a))return!0}return!1}var vy="4.4.5";const My=["top","bottom","left","right","chartArea"];function ku(n,t){return n==="top"||n==="bottom"||My.indexOf(n)===-1&&t==="x"}function Du(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function Tu(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),xt(e&&e.onComplete,[n],t)}function Sy(n){const t=n.chart,e=t.options.animation;xt(e&&e.onProgress,[n],t)}function Cu(n){return zo()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const mr={},Ou=n=>{const t=Cu(n);return Object.values(mr).filter(e=>e.canvas===t).pop()};function ky(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 Dy(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}function yr(n,t,e){return n.options.clip?n[e]:t[e]}function Ty(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:yr(e,t,"left"),right:yr(e,t,"right"),top:yr(i,t,"top"),bottom:yr(i,t,"bottom")}:t}let Pe=(Pn=class{static register(...t){Ve.add(...t),Pu()}static unregister(...t){Ve.remove(...t),Pu()}constructor(t,e){const i=this.config=new _y(e),s=Cu(t),r=Ou(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||Vm(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=Ag(),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 ly,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=qg(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],mr[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}nn.listen(this,"complete",Tu),nn.listen(this,"progress",Sy),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 Ve}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ic(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Sc(this.canvas,this.ctx),this}stop(){return nn.stop(this),this}resize(t,e){nn.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,Ic(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),xt(i.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};wt(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=Qo(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),wt(r,o=>{const a=o.options,l=a.id,c=Qo(l,a),u=it(a.type,o.dtype);(a.position===void 0||ku(a.position,c)!==ku(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 h=Ve.getScale(u);d=new h({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),wt(s,(o,a)=>{o||delete i[a]}),wt(i,o=>{ne.configure(this,o,o.options),ne.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(Du("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||Zo(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=Ve.getController(a),{datasetElementType:c,dataElementType:u}=Pt.datasets[a];Object.assign(l,{dataElementType:Ve.getElement(u),datasetElementType:c&&Ve.getElement(c)}),o.controller=new l(this,i),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){wt(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),h=!s&&r.indexOf(d)===-1;d.buildOrUpdateElements(h),o=Math.max(+d.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),s||wt(r,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Du("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){wt(this.scales,t=>{ne.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!lc(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;ky(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(!lc(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;ne.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],wt(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,fe(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&&(nn.has(this)?this.attached&&!nn.running(this)&&nn.start(this):(this.draw(),Tu({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=t._clip,s=!i.disabled,r=Ty(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&Gi(e,{left:i.left===!1?0:r.left-i.left,right:i.right===!1?this.width:r.right+i.right,top:i.top===!1?0:r.top-i.top,bottom:i.bottom===!1?this.height:r.bottom+i.bottom}),t.controller.draw(),s&&Ki(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return en(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const r=Go.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=xn(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);he(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(),nn.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(),Sc(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete mr[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)};wt(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(){wt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},wt(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}});!Xs(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=Dy(t,this._lastEvent,i,l);i&&(this._lastEvent=null,xt(r.onHover,[t,a,this],this),l&&xt(r.onClick,[t,a,this],this));const u=!Xs(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)}},P(Pn,"defaults",Pt),P(Pn,"instances",mr),P(Pn,"overrides",Hn),P(Pn,"registry",Ve),P(Pn,"version",vy),P(Pn,"getChart",Ou),Pn);function Pu(){return wt(Pe.instances,n=>n._plugins.invalidate())}function Cy(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+Ot,i-Ot),n.closePath(),n.clip()}function Oy(n){return Lo(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Py(n,t,e,i){const s=Oy(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 Xt(l,0,Math.min(r,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:Xt(s.innerStart,0,o),innerEnd:Xt(s.innerEnd,0,o)}}function gi(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function br(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),h=u>0?u+i+e+c:0;let g=0;const p=s-l;if(i){const G=u>0?u-i:0,U=d>0?d-i:0,H=(G+U)/2,ut=H!==0?p*H/(H+i):p;g=(p-ut)/2}const b=Math.max(.001,p*d-e/dt)/d,w=(p-b)/2,v=l+w+g,S=s-w-g,{outerStart:D,outerEnd:k,innerStart:C,innerEnd:R}=Py(t,h,d,S-v),E=d-D,m=d-k,_=v+D/E,T=S-k/m,A=h+C,L=h+R,N=v+C/A,B=S-R/L;if(n.beginPath(),r){const G=(_+T)/2;if(n.arc(o,a,d,_,G),n.arc(o,a,d,G,T),k>0){const Y=gi(m,T,o,a);n.arc(Y.x,Y.y,k,T,S+Ot)}const U=gi(L,S,o,a);if(n.lineTo(U.x,U.y),R>0){const Y=gi(L,B,o,a);n.arc(Y.x,Y.y,R,S+Ot,B+Math.PI)}const H=(S-R/h+(v+C/h))/2;if(n.arc(o,a,h,S-R/h,H,!0),n.arc(o,a,h,H,v+C/h,!0),C>0){const Y=gi(A,N,o,a);n.arc(Y.x,Y.y,C,N+Math.PI,v-Ot)}const ut=gi(E,v,o,a);if(n.lineTo(ut.x,ut.y),D>0){const Y=gi(E,_,o,a);n.arc(Y.x,Y.y,D,v-Ot,_)}}else{n.moveTo(o,a);const G=Math.cos(_)*d+o,U=Math.sin(_)*d+a;n.lineTo(G,U);const H=Math.cos(T)*d+o,ut=Math.sin(T)*d+a;n.lineTo(H,ut)}n.closePath()}function Ey(n,t,e,i,s){const{fullCircles:r,startAngle:o,circumference:a}=t;let l=t.endAngle;if(r){br(n,t,e,i,l,s);for(let c=0;c<r;++c)n.fill();isNaN(a)||(l=o+(a%kt||kt))}return br(n,t,e,i,l,s),n.fill(),l}function Ay(n,t,e,i,s){const{fullCircles:r,startAngle:o,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:h}=l,g=l.borderAlign==="inner";if(!c)return;n.setLineDash(d||[]),n.lineDashOffset=h,g?(n.lineWidth=c*2,n.lineJoin=u||"round"):(n.lineWidth=c,n.lineJoin=u||"bevel");let p=t.endAngle;if(r){br(n,t,e,i,p,s);for(let b=0;b<r;++b)n.stroke();isNaN(a)||(p=o+(a%kt||kt))}g&&Cy(n,t,p),r||(br(n,t,e,i,p,s),n.stroke())}class cs extends Gt{constructor(e){super();P(this,"circumference");P(this,"endAngle");P(this,"fullCircles");P(this,"innerRadius");P(this,"outerRadius");P(this,"pixelMargin");P(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}=Js(r,{x:e,y:i}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),g=(this.options.spacing+this.options.borderWidth)/2,p=it(h,c-l),b=$i(o,l,c)&&l!==c,w=p>=kt||b,v=Je(a,u+g,d+g);return w&&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,h=(a+l+u+c)/2;return{x:i+Math.cos(d)*h,y:s+Math.sin(d)*h}}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>kt?Math.floor(s/kt):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(dt,s||0)),u=r*c;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,Ey(e,this,u,o,a),Ay(e,this,u,o,a),e.restore()}}P(cs,"id","arc"),P(cs,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),P(cs,"defaultRoutes",{backgroundColor:"backgroundColor"}),P(cs,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Eu(n,t,e=t){n.lineCap=it(e.borderCapStyle,t.borderCapStyle),n.setLineDash(it(e.borderDash,t.borderDash)),n.lineDashOffset=it(e.borderDashOffset,t.borderDashOffset),n.lineJoin=it(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=it(e.borderWidth,t.borderWidth),n.strokeStyle=it(e.borderColor,t.borderColor)}function Ry(n,t,e){n.lineTo(e.x,e.y)}function Ly(n){return n.stepped?rp:n.tension||n.cubicInterpolationMode==="monotone"?op:Ry}function Au(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 Iy(n,t,e,i){const{points:s,options:r}=t,{count:o,start:a,loop:l,ilen:c}=Au(s,e,i),u=Ly(r);let{move:d=!0,reverse:h}=i||{},g,p,b;for(g=0;g<=c;++g)p=s[(a+(h?c-g:g))%o],!p.skip&&(d?(n.moveTo(p.x,p.y),d=!1):u(n,b,p,h,r.stepped),b=p);return l&&(p=s[(a+(h?c:0))%o],u(n,b,p,h,r.stepped)),!!l}function Ny(n,t,e,i){const s=t.points,{count:r,start:o,ilen:a}=Au(s,e,i),{move:l=!0,reverse:c}=i||{};let u=0,d=0,h,g,p,b,w,v;const S=k=>(o+(c?a-k:k))%r,D=()=>{b!==w&&(n.lineTo(u,w),n.lineTo(u,b),n.lineTo(u,v))};for(l&&(g=s[S(0)],n.moveTo(g.x,g.y)),h=0;h<=a;++h){if(g=s[S(h)],g.skip)continue;const k=g.x,C=g.y,R=k|0;R===p?(C<b?b=C:C>w&&(w=C),u=(d*u+k)/++d):(D(),n.lineTo(k,C),p=R,d=0,b=w=C),v=C}D()}function Jo(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Ny:Iy}function Fy(n){return n.stepped?zp:n.tension||n.cubicInterpolationMode==="monotone"?Bp:Vn}function zy(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),Eu(n,t.options),n.stroke(s)}function By(n,t,e,i){const{segments:s,options:r}=t,o=Jo(t);for(const a of s)Eu(n,r,a.style),n.beginPath(),o(n,t,a,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const Hy=typeof Path2D=="function";function Wy(n,t,e,i){Hy&&!t.options.segment?zy(n,t,e,i):By(n,t,e,i)}class vn extends Gt{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;Pp(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=$p(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=Yc(this,{property:e,start:s,end:s});if(!o.length)return;const a=[],l=Fy(i);let c,u;for(c=0,u=o.length;c<u;++c){const{start:d,end:h}=o[c],g=r[d],p=r[h];if(g===p){a.push(g);continue}const b=Math.abs((s-g[e])/(p[e]-g[e])),w=l(g,p,b,i.stepped);w[e]=t[e],a.push(w)}return a.length===1?a[0]:a}pathSegment(t,e,i){return Jo(this)(t,this,e,i)}path(t,e,i){const s=this.segments,r=Jo(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(),Wy(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}P(vn,"id","line"),P(vn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),P(vn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),P(vn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Ru(n,t,e,i){const s=n.options,{[e]:r}=n.getProps([e],i);return Math.abs(t-r)<s.radius+s.hitRadius}class _r extends Gt{constructor(e){super();P(this,"parsed");P(this,"skip");P(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 Ru(this,e,"x",i)}inYRange(e,i){return Ru(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||!en(this,i,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,Ro(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}P(_r,"id","point"),P(_r,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),P(_r,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Lu(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 Mn(n,t,e,i){return n?0:Xt(t,e,i)}function Yy(n,t,e){const i=n.options.borderWidth,s=n.borderSkipped,r=Dc(i);return{t:Mn(s.top,r.top,0,e),r:Mn(s.right,r.right,0,t),b:Mn(s.bottom,r.bottom,0,e),l:Mn(s.left,r.left,0,t)}}function jy(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,r=_n(s),o=Math.min(t,e),a=n.borderSkipped,l=i||lt(s);return{topLeft:Mn(!l||a.top||a.left,r.topLeft,0,o),topRight:Mn(!l||a.top||a.right,r.topRight,0,o),bottomLeft:Mn(!l||a.bottom||a.left,r.bottomLeft,0,o),bottomRight:Mn(!l||a.bottom||a.right,r.bottomRight,0,o)}}function Vy(n){const t=Lu(n),e=t.right-t.left,i=t.bottom-t.top,s=Yy(n,e/2,i/2),r=jy(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 ta(n,t,e,i){const s=t===null,r=e===null,a=n&&!(s&&r)&&Lu(n,i);return a&&(s||Je(t,a.left,a.right))&&(r||Je(e,a.top,a.bottom))}function $y(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function Uy(n,t){n.rect(t.x,t.y,t.w,t.h)}function ea(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 xr extends Gt{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}=Vy(this),a=$y(o.radius)?ui:Uy;t.save(),(o.w!==r.w||o.h!==r.h)&&(t.beginPath(),a(t,ea(o,e,r)),t.clip(),a(t,ea(r,-e,o)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,ea(r,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return ta(this,t,e,i)}inXRange(t,e){return ta(this,t,null,e)}inYRange(t,e){return ta(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}}P(xr,"id","bar"),P(xr,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),P(xr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var qy=Object.freeze({__proto__:null,ArcElement:cs,BarElement:xr,LineElement:vn,PointElement:_r});const na=["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)"],Iu=na.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function Nu(n){return na[n%na.length]}function Fu(n){return Iu[n%Iu.length]}function Xy(n,t){return n.borderColor=Nu(t),n.backgroundColor=Fu(t),++t}function Gy(n,t){return n.backgroundColor=n.data.map(()=>Nu(t++)),t}function Ky(n,t){return n.backgroundColor=n.data.map(()=>Fu(t++)),t}function Zy(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof sn?t=Gy(e,t):s instanceof es?t=Ky(e,t):s&&(t=Xy(e,t))}}function zu(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function Qy(n){return n&&(n.borderColor||n.backgroundColor)}function Jy(){return Pt.borderColor!=="rgba(0,0,0,0.1)"||Pt.backgroundColor!=="rgba(0,0,0,0.1)"}var tb={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=zu(i)||Qy(s)||r&&zu(r)||Jy();if(!e.forceOverride&&o)return;const a=Zy(n);i.forEach(a)}};function eb(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,h,g,p,b;for(o[l++]=n[u],d=0;d<r-2;d++){let w=0,v=0,S;const D=Math.floor((d+1)*a)+1+t,k=Math.min(Math.floor((d+2)*a)+1,e)+t,C=k-D;for(S=D;S<k;S++)w+=n[S].x,v+=n[S].y;w/=C,v/=C;const R=Math.floor(d*a)+1+t,E=Math.min(Math.floor((d+1)*a)+1,e)+t,{x:m,y:_}=n[u];for(g=p=-1,S=R;S<E;S++)p=.5*Math.abs((m-w)*(n[S].y-_)-(m-n[S].x)*(v-_)),p>g&&(g=p,h=n[S],b=S);o[l++]=h,u=b}return o[l++]=n[c],o}function nb(n,t,e,i){let s=0,r=0,o,a,l,c,u,d,h,g,p,b;const w=[],v=t+e-1,S=n[t].x,k=n[v].x-S;for(o=t;o<t+e;++o){a=n[o],l=(a.x-S)/k*i,c=a.y;const C=l|0;if(C===u)c<p?(p=c,d=o):c>b&&(b=c,h=o),s=(r*s+a.x)/++r;else{const R=o-1;if(!st(d)&&!st(h)){const E=Math.min(d,h),m=Math.max(d,h);E!==g&&E!==R&&w.push({...n[E],x:s}),m!==g&&m!==R&&w.push({...n[m],x:s})}o>0&&R!==g&&w.push(n[R]),w.push(a),u=C,r=0,p=b=c,d=h=g=o}}return w}function Bu(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 Hu(n){n.data.datasets.forEach(t=>{Bu(t)})}function ib(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=Xt(tn(t,r.axis,o).lo,0,e-1)),c?s=Xt(tn(t,r.axis,a).hi+1,i,e)-i:s=e-i,{start:i,count:s}}var sb={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){Hu(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(Zi([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:h}=ib(l,c);const g=e.threshold||4*i;if(h<=g){Bu(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(b){this._data=b}}));let p;switch(e.algorithm){case"lttb":p=eb(c,d,h,i,e);break;case"min-max":p=nb(c,d,h,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=p})},destroy(n){Hu(n)}};function rb(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=sa(l,c,s);const u=ia(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=Yc(t,u);for(const h of d){const g=ia(e,r[h.start],r[h.end],h.loop),p=Wc(a,s,g);for(const b of p)o.push({source:b,target:h,start:{[e]:Wu(u,g,"start",Math.max)},end:{[e]:Wu(u,g,"end",Math.min)}})}}return o}function ia(n,t,e,i){if(i)return;let s=t[n],r=e[n];return n==="angle"&&(s=De(s),r=De(r)),{property:n,start:s,end:r}}function ob(n,t){const{x:e=null,y:i=null}=n||{},s=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=sa(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 sa(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Wu(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function Yu(n,t){let e=[],i=!1;return _t(n)?(i=!0,e=n):e=ob(n,t),e.length?new vn({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function ju(n){return n&&n.fill!==!1}function ab(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(!Et(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;r.push(s),s=o.fill}return!1}function lb(n,t,e){const i=hb(n);if(lt(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Et(s)&&Math.floor(s)===s?cb(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function cb(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function ub(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:lt(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function db(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:lt(n)?i=n.value:i=t.getBaseValue(),i}function hb(n){const t=n.options,e=t.fill;let i=it(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function fb(n){const{scale:t,index:e,line:i}=n,s=[],r=i.segments,o=i.points,a=gb(t,e);a.push(Yu({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++)pb(s,o[u],a)}return new vn({points:s,options:{}})}function gb(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 pb(n,t,e){const i=[];for(let s=0;s<e.length;s++){const r=e[s],{first:o,last:a,point:l}=mb(r,t,"x");if(!(!l||o&&a)){if(o)i.unshift(l);else if(n.push(l),!a)break}}n.push(...i)}function mb(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],h=o[u.end][e];if(Je(s,d,h)){a=s===d,l=s===h;break}}return{first:a,last:l,point:i}}class Vu{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:kt},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 yb(n){const{chart:t,fill:e,line:i}=n;if(Et(e))return bb(t,e);if(e==="stack")return fb(n);if(e==="shape")return!0;const s=_b(n);return s instanceof Vu?s:Yu(s,i)}function bb(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function _b(n){return(n.scale||{}).getPointPositionForValue?wb(n):xb(n)}function xb(n){const{scale:t={},fill:e}=n,i=ub(e,t);if(Et(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function wb(n){const{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,r=i.reverse?t.max:t.min,o=db(e,t,r),a=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,r);return new Vu({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 ra(n,t,e){const i=yb(t),{line:s,scale:r,axis:o}=t,a=s.options,l=a.fill,c=a.backgroundColor,{above:u=c,below:d=c}=l||{};i&&s.points.length&&(Gi(n,e),vb(n,{line:s,target:i,above:u,below:d,area:e,scale:r,axis:o}),Ki(n))}function vb(n,t){const{line:e,target:i,above:s,below:r,area:o,scale:a}=t,l=e._loop?"angle":t.axis;n.save(),l==="x"&&r!==s&&($u(n,i,o.top),Uu(n,{line:e,target:i,color:s,scale:a,property:l}),n.restore(),n.save(),$u(n,i,o.bottom)),Uu(n,{line:e,target:i,color:r,scale:a,property:l}),n.restore()}function $u(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[sa(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 Uu(n,t){const{line:e,target:i,property:s,color:r,scale:o}=t,a=rb(e,i,s);for(const{source:l,target:c,start:u,end:d}of a){const{style:{backgroundColor:h=r}={}}=l,g=i!==!0;n.save(),n.fillStyle=h,Mb(n,o,g&&ia(s,u,d)),n.beginPath();const p=!!e.pathSegment(n,l);let b;if(g){p?n.closePath():qu(n,i,d,s);const w=!!i.pathSegment(n,c,{move:p,reverse:!0});b=p&&w,b||qu(n,i,u,s)}n.closePath(),n.fill(b?"evenodd":"nonzero"),n.restore()}}function Mb(n,t,e){const{top:i,bottom:s}=t.chart.chartArea,{property:r,start:o,end:a}=e||{};r==="x"&&(n.beginPath(),n.rect(o,i,a-o,s-i),n.clip())}function qu(n,t,e,i){const s=t.interpolate(e,i);s&&n.lineTo(s.x,s.y)}var Sb={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 vn&&(l={visible:n.isDatasetVisible(o),index:o,fill:lb(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=ab(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&&ra(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;ju(r)&&ra(n.ctx,r,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!ju(i)||e.drawTime!=="beforeDatasetDraw"||ra(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Xu=(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)}},kb=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class Gu extends Gt{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=xt(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=At(i.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Xu(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 h=-1,g=-u;return this.legendItems.forEach((p,b)=>{const w=i+e/2+r.measureText(p.text).width;(b===0||c[c.length-1]+w+2*a>o)&&(d+=u,c[c.length-(b>0?0:1)]=0,g+=u,h++),l[b]={left:0,top:g,row:h,width:w,height:s},c[c.length-1]+=w+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,h=0,g=0,p=0,b=0;return this.legendItems.forEach((w,v)=>{const{itemWidth:S,itemHeight:D}=Db(i,e,r,w,s);v>0&&g+D+2*a>u&&(d+=h+a,c.push({width:h,height:g}),p+=h+a,b++,h=g=0),l[v]={left:p,top:g,col:b,width:S,height:D},h=Math.max(h,S),g+=D+a}),d+=h,c.push({width:h,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=fi(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=ee(i,this.left+s,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=ee(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=ee(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=ee(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;Gi(t,this),this._draw(),Ki(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:r,labels:o}=t,a=Pt.color,l=fi(t.rtl,this.left,this.width),c=At(o.font),{padding:u}=o,d=c.size,h=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:b,itemHeight:w}=Xu(o,d),v=function(R,E,m){if(isNaN(p)||p<=0||isNaN(b)||b<0)return;s.save();const _=it(m.lineWidth,1);if(s.fillStyle=it(m.fillStyle,a),s.lineCap=it(m.lineCap,"butt"),s.lineDashOffset=it(m.lineDashOffset,0),s.lineJoin=it(m.lineJoin,"miter"),s.lineWidth=_,s.strokeStyle=it(m.strokeStyle,a),s.setLineDash(it(m.lineDash,[])),o.usePointStyle){const T={radius:b*Math.SQRT2/2,pointStyle:m.pointStyle,rotation:m.rotation,borderWidth:_},A=l.xPlus(R,p/2),L=E+h;kc(s,T,A,L,o.pointStyleWidth&&p)}else{const T=E+Math.max((d-b)/2,0),A=l.leftForLtr(R,p),L=_n(m.borderRadius);s.beginPath(),Object.values(L).some(N=>N!==0)?ui(s,{x:A,y:T,w:p,h:b,radius:L}):s.rect(A,T,p,b),s.fill(),_!==0&&s.stroke()}s.restore()},S=function(R,E,m){Yn(s,m.text,R,E+w/2,c,{strikethrough:m.hidden,textAlign:l.textAlign(m.textAlign)})},D=this.isHorizontal(),k=this._computeTitleHeight();D?g={x:ee(r,this.left+u,this.right-i[0]),y:this.top+u+k,line:0}:g={x:this.left+u,y:ee(r,this.top+k+u,this.bottom-e[0].height),line:0},Fc(this.ctx,t.textDirection);const C=w+u;this.legendItems.forEach((R,E)=>{s.strokeStyle=R.fontColor,s.fillStyle=R.fontColor;const m=s.measureText(R.text).width,_=l.textAlign(R.textAlign||(R.textAlign=o.textAlign)),T=p+h+m;let A=g.x,L=g.y;l.setWidth(this.width),D?E>0&&A+T+u>this.right&&(L=g.y+=C,g.line++,A=g.x=ee(r,this.left+u,this.right-i[g.line])):E>0&&L+C>this.bottom&&(A=g.x=A+e[g.line].width+u,g.line++,L=g.y=ee(r,this.top+k+u,this.bottom-e[g.line].height));const N=l.x(A);if(v(N,L,R),A=Xg(_,A+p+h,D?A+T:this.right,t.rtl),S(l.x(A),L,R),D)g.x+=T+u;else if(typeof R.text!="string"){const B=c.lineHeight;g.y+=Ku(R,B)+u}else g.y+=C}),zc(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=At(e.font),s=jt(e.padding);if(!e.display)return;const r=fi(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,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,d=ee(t.align,d,this.right-h);else{const p=this.columnSizes.reduce((b,w)=>Math.max(b,w.height),0);u=c+ee(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const g=ee(a,d,d+h);o.textAlign=r.textAlign(Co(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,Yn(o,e.text,g,u,i)}_computeTitleHeight(){const t=this.options.title,e=At(t.font),i=jt(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,r;if(Je(t,this.left,this.right)&&Je(e,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(s=r[i],Je(t,s.left,s.left+s.width)&&Je(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!Ob(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,r=kb(s,i);s&&!r&&xt(e.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!r&&xt(e.onHover,[t,i,this],this)}else i&&xt(e.onClick,[t,i,this],this)}}function Db(n,t,e,i,s){const r=Tb(i,n,t,e),o=Cb(s,i,t.lineHeight);return{itemWidth:r,itemHeight:o}}function Tb(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 Cb(n,t,e){let i=n;return typeof t.text!="string"&&(i=Ku(t,e)),i}function Ku(n,t){const e=n.text?n.text.length:0;return t*e}function Ob(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var Pb={id:"legend",_element:Gu,start(n,t,e){const i=n.legend=new Gu({ctx:n.ctx,options:e,chart:n});ne.configure(n,i,e),ne.addBox(n,i)},stop(n){ne.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;ne.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=jt(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 oa extends Gt{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=_t(i.text)?i.text.length:1;this._padding=jt(i.padding);const r=s*At(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=ee(a,i,r),d=e+t,c=r-i):(o.position==="left"?(u=i+t,d=ee(a,s,e),l=dt*-.5):(u=r-t,d=ee(a,e,s),l=dt*.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=At(e.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);Yn(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:Co(e.align),textBaseline:"middle",translation:[o,a]})}}function Eb(n,t){const e=new oa({ctx:n.ctx,options:t,chart:n});ne.configure(n,e,t),ne.addBox(n,e),n.titleBlock=e}var Ab={id:"title",_element:oa,start(n,t,e){Eb(n,e)},stop(n){const t=n.titleBlock;ne.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;ne.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 wr=new WeakMap;var Rb={id:"subtitle",start(n,t,e){const i=new oa({ctx:n.ctx,options:e,chart:n});ne.configure(n,i,e),ne.addBox(n,i),wr.set(n,i)},stop(n){ne.removeBox(n,wr.get(n)),wr.delete(n)},beforeUpdate(n,t,e){const i=wr.get(n);ne.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 us={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=ci(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 $e(n,t){return t&&(_t(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function rn(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
17
17
  `)>-1?n.split(`
18
- `):n}function Lb(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 Zu(n,t){const e=n.chart.ctx,{body:i,footer:s,title:r}=n,{boxWidth:o,boxHeight:a}=t,l=At(t.bodyFont),c=At(t.titleFont),u=At(t.footerFont),d=r.length,h=s.length,g=i.length,p=jt(t.padding);let b=p.height,w=0,v=i.reduce((k,C)=>k+C.before.length+C.lines.length+C.after.length,0);if(v+=n.beforeBody.length+n.afterBody.length,d&&(b+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),v){const k=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;b+=g*k+(v-g)*l.lineHeight+(v-1)*t.bodySpacing}h&&(b+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let S=0;const D=function(k){w=Math.max(w,e.measureText(k).width+S)};return e.save(),e.font=c.string,wt(n.title,D),e.font=l.string,wt(n.beforeBody.concat(n.afterBody),D),S=t.displayColors?o+2+t.boxPadding:0,wt(i,k=>{wt(k.before,D),wt(k.lines,D),wt(k.after,D)}),S=0,e.font=u.string,wt(n.footer,D),e.restore(),w+=p.width,{width:w,height:b}}function Ib(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function Nb(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 Fb(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"),Nb(c,n,t,e)&&(c="center"),c}function Qu(n,t,e){const i=e.yAlign||t.yAlign||Ib(n,e);return{xAlign:e.xAlign||t.xAlign||Fb(n,t,e,i),yAlign:i}}function zb(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function Bb(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function Ju(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:h,bottomRight:g}=_n(o);let p=zb(t,a);const b=Bb(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,h)+s:a==="right"&&(p+=Math.max(d,g)+s),{x:Xt(p,0,i.width-t.width),y:Xt(b,0,i.height-t.height)}}function vr(n,t,e){const i=jt(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function td(n){return $e([],rn(n))}function Hb(n,t,e){return xn(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function ed(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const nd={beforeTitle:Qe,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:Qe,beforeBody:Qe,beforeLabel:Qe,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:Qe,afterBody:Qe,beforeFooter:Qe,footer:Qe,afterFooter:Qe};function ge(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?nd[t].call(e,i):s}class aa extends Gt{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 Ho(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=Hb(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=ge(i,"beforeTitle",this,t),r=ge(i,"title",this,t),o=ge(i,"afterTitle",this,t);let a=[];return a=$e(a,rn(s)),a=$e(a,rn(r)),a=$e(a,rn(o)),a}getBeforeBody(t,e){return td(ge(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return wt(t,r=>{const o={before:[],lines:[],after:[]},a=ed(i,r);$e(o.before,rn(ge(a,"beforeLabel",this,r))),$e(o.lines,ge(a,"label",this,r)),$e(o.after,rn(ge(a,"afterLabel",this,r))),s.push(o)}),s}getAfterBody(t,e){return td(ge(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=ge(i,"beforeFooter",this,t),r=ge(i,"footer",this,t),o=ge(i,"afterFooter",this,t);let a=[];return a=$e(a,rn(s)),a=$e(a,rn(r)),a=$e(a,rn(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(Lb(this.chart,e[l]));return t.filter&&(a=a.filter((u,d,h)=>t.filter(u,d,h,i))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,i))),wt(a,u=>{const d=ed(t.callbacks,u);s.push(ge(d,"labelColor",this,u)),r.push(ge(d,"labelPointStyle",this,u)),o.push(ge(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=us[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=Zu(this,i),c=Object.assign({},a,l),u=Qu(this.chart,i,c),d=Ju(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}=_n(a),{x:h,y:g}=t,{width:p,height:b}=e;let w,v,S,D,k,C;return r==="center"?(k=g+b/2,s==="left"?(w=h,v=w-o,D=k+o,C=k-o):(w=h+p,v=w+o,D=k-o,C=k+o),S=w):(s==="left"?v=h+Math.max(l,u)+o:s==="right"?v=h+p-Math.max(c,d)-o:v=this.caretX,r==="top"?(D=g,k=D-o,w=v-o,S=v+o):(D=g+b,k=D+o,w=v+o,S=v-o),C=D),{x1:w,x2:v,x3:S,y1:D,y2:k,y3:C}}drawTitle(t,e,i){const s=this.title,r=s.length;let o,a,l;if(r){const c=fi(i.rtl,this.x,this.width);for(t.x=vr(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",o=At(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=At(r.bodyFont),d=vr(this,"left",r),h=s.x(d),g=l<u.lineHeight?(u.lineHeight-l)/2:0,p=e.y+g;if(r.usePointStyle){const b={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},w=s.leftForLtr(h,c)+c/2,v=p+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Ro(t,b,w,v),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Ro(t,b,w,v)}else{t.lineWidth=lt(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 b=s.leftForLtr(h,c),w=s.leftForLtr(s.xPlus(h,1),c-2),v=_n(o.borderRadius);Object.values(v).some(S=>S!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,ui(t,{x:b,y:p,w:c,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),ui(t,{x:w,y:p+1,w:c-2,h:l-2,radius:v}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(b,p,c,l),t.strokeRect(b,p,c,l),t.fillStyle=o.backgroundColor,t.fillRect(w,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=At(i.bodyFont);let h=d.lineHeight,g=0;const p=fi(i.rtl,this.x,this.width),b=function(m){e.fillText(m,p.x(t.x+g),t.y+h/2),t.y+=h+r},w=p.textAlign(o);let v,S,D,k,C,R,E;for(e.textAlign=o,e.textBaseline="middle",e.font=d.string,t.x=vr(this,w,i),e.fillStyle=i.bodyColor,wt(this.beforeBody,b),g=a&&w!=="right"?o==="center"?c/2+u:c+2+u:0,k=0,R=s.length;k<R;++k){for(v=s[k],S=this.labelTextColors[k],e.fillStyle=S,wt(v.before,b),D=v.lines,a&&D.length&&(this._drawColorBox(e,t,k,p,i),h=Math.max(d.lineHeight,l)),C=0,E=D.length;C<E;++C)b(D[C]),h=d.lineHeight;wt(v.after,b)}g=0,h=d.lineHeight,wt(this.afterBody,b),t.y-=r}drawFooter(t,e,i){const s=this.footer,r=s.length;let o,a;if(r){const l=fi(i.rtl,this.x,this.width);for(t.x=vr(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",o=At(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:h,bottomLeft:g,bottomRight:p}=_n(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-h,l),e.quadraticCurveTo(a+c,l,a+c,l+h),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=us[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=Zu(this,t),l=Object.assign({},o,this._size),c=Qu(e,t,l),u=Ju(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=jt(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),Fc(t,e.textDirection),r.y+=o.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),zc(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=!Xs(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||!Xs(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=us[r.position].call(this,t,e);return o!==!1&&(i!==o.x||s!==o.y)}}P(aa,"positioners",us);var Mr={id:"tooltip",_element:aa,positioners:us,afterInit(n,t,e){e&&(n.tooltip=new aa({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:nd},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"]},Wb=Object.freeze({__proto__:null,Colors:tb,Decimation:sb,Filler:Sb,Legend:Pb,SubTitle:Rb,Title:Ab,Tooltip:Mr});const Yb=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function jb(n,t,e,i){const s=n.indexOf(t);if(s===-1)return Yb(n,t,e,i);const r=n.lastIndexOf(t);return s!==r?e:s}const Vb=(n,t)=>n===null?null:Xt(Math.round(n),0,t);function id(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class la extends Un{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:jb(i,t,it(e,t),this._addedLabels),Vb(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 id.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}}P(la,"id","category"),P(la,"defaults",{ticks:{callback:id}});function $b(n,t){const e=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=n,g=r||1,p=u-1,{min:b,max:w}=t,v=!st(o),S=!st(a),D=!st(c),k=(w-b)/(d+1);let C=cc((w-b)/p/g)*g,R,E,m,_;if(C<1e-14&&!v&&!S)return[{value:b},{value:w}];_=Math.ceil(w/C)-Math.floor(b/C),_>p&&(C=cc(_*C/p/g)*g),st(l)||(R=Math.pow(10,l),C=Math.ceil(C*R)/R),s==="ticks"?(E=Math.floor(b/C)*C,m=Math.ceil(w/C)*C):(E=b,m=w),v&&S&&r&&Wg((a-o)/r,C/1e3)?(_=Math.round(Math.min((a-o)/C,u)),C=(a-o)/_,E=o,m=a):D?(E=v?o:E,m=S?a:m,_=c-1,C=(m-E)/_):(_=(m-E)/C,Vi(_,Math.round(_),C/1e3)?_=Math.round(_):_=Math.ceil(_));const T=Math.max(dc(C),dc(E));R=Math.pow(10,st(l)?T:l),E=Math.round(E*R)/R,m=Math.round(m*R)/R;let A=0;for(v&&(h&&E!==o?(e.push({value:o}),E<o&&A++,Vi(Math.round((E+A*C)*R)/R,o,sd(o,k,n))&&A++):E<o&&A++);A<_;++A){const L=Math.round((E+A*C)*R)/R;if(S&&L>a)break;e.push({value:L})}return S&&h&&m!==a?e.length&&Vi(e[e.length-1].value,a,sd(a,k,n))?e[e.length-1].value=a:e.push({value:a}):(!S||m===a)&&e.push({value:m}),e}function sd(n,t,{horizontal:e,minRotation:i}){const s=Yt(i),r=(e?Math.sin(s):Math.cos(s))||.001,o=.75*t*(""+n).length;return Math.min(t/r,o)}class Sr extends Un{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=je(s),c=je(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=$b(s,r);return t.bounds==="ticks"&&uc(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 ca extends Sr{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Et(t)?t:0,this.max=Et(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Yt(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}}P(ca,"id","linear"),P(ca,"defaults",{ticks:{callback:er.formatters.numeric}});const ds=n=>Math.floor(yn(n)),qn=(n,t)=>Math.pow(10,ds(n)+t);function rd(n){return n/Math.pow(10,ds(n))===1}function od(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function Ub(n,t){const e=t-n;let i=ds(e);for(;od(n,t,i)>10;)i++;for(;od(n,t,i)<10;)i--;return Math.min(i,ds(n))}function qb(n,{min:t,max:e}){t=ke(n.min,t);const i=[],s=ds(t);let r=Ub(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)),h=ke(n.min,Math.round((l+u+d*Math.pow(10,r))*o)/o);for(;h<e;)i.push({value:h,major:rd(h),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(r++,d=2,o=r>=0?1:o),h=Math.round((l+u+d*Math.pow(10,r))*o)/o;const g=ke(n.max,h);return i.push({value:g,major:rd(g),significand:d}),i}class ua extends Un{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Sr.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return Et(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Et(t)?Math.max(0,t):null,this.max=Et(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Et(this._userMin)&&(this.min=t===qn(this.min,0)?qn(this.min,-1):qn(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(qn(i,-1)),o(qn(s,1)))),i<=0&&r(qn(s,-1)),s<=0&&o(qn(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=qb(e,this);return t.bounds==="ticks"&&uc(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=yn(t),this._valueRange=yn(this.max)-yn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(yn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}P(ua,"id","logarithmic"),P(ua,"defaults",{ticks:{callback:er.formatters.logarithmic,major:{enabled:!0}}});function da(n){const t=n.ticks;if(t.display&&n.display){const e=jt(t.backdropPadding);return it(t.font&&t.font.size,Pt.font.size)+e.height}return 0}function Xb(n,t,e){return e=_t(e)?e:[e],{w:sp(n,t.string,e),h:e.length*t.lineHeight}}function ad(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 Gb(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?dt/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=At(c.font),h=Xb(n.ctx,d,n._pointLabels[l]);i[l]=h;const g=De(n.getIndexAngle(l)+a),p=Math.round(Qs(g)),b=ad(p,u.x,h.w,0,180),w=ad(p,u.y,h.h,90,270);Kb(e,t,g,b,w)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=Jb(n,i,s)}function Kb(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 Zb(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(Qs(De(l.angle+Ot))),u=n0(l.y,a.h,c),d=t0(c),h=e0(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+a.w,bottom:u+a.h}}function Qb(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:r}=n;return!(en({x:e,y:i},t)||en({x:e,y:r},t)||en({x:s,y:i},t)||en({x:s,y:r},t))}function Jb(n,t,e){const i=[],s=n._pointLabels.length,r=n.options,{centerPointLabels:o,display:a}=r.pointLabels,l={extra:da(r)/2,additionalAngle:o?dt/s:0};let c;for(let u=0;u<s;u++){l.padding=e[u],l.size=t[u];const d=Zb(n,u,l);i.push(d),a==="auto"&&(d.visible=Qb(d,c),d.visible&&(c=d))}return i}function t0(n){return n===0||n===180?"center":n<180?"left":"right"}function e0(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function n0(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function i0(n,t,e){const{left:i,top:s,right:r,bottom:o}=e,{backdropColor:a}=t;if(!st(a)){const l=_n(t.borderRadius),c=jt(t.backdropPadding);n.fillStyle=a;const u=i-c.left,d=s-c.top,h=r-i+c.width,g=o-s+c.height;Object.values(l).some(p=>p!==0)?(n.beginPath(),ui(n,{x:u,y:d,w:h,h:g,radius:l}),n.fill()):n.fillRect(u,d,h,g)}}function s0(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));i0(e,o,r);const a=At(o.font),{x:l,y:c,textAlign:u}=r;Yn(e,n._pointLabels[s],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function ld(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,kt);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 r0(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(),ld(n,e,o,i),r.closePath(),r.stroke(),r.restore())}function o0(n,t,e){return xn(n,{label:e,index:t,type:"pointLabel"})}class hs extends Sr{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=jt(da(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=Et(t)&&!isNaN(t)?t:0,this.max=Et(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/da(this.options))}generateTickLabels(t){Sr.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=xt(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?Gb(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=kt/(this._pointLabels.length||1),i=this.options.startAngle||0;return De(t*e+Yt(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 o0(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-Ot+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(),ld(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&&s0(this,o),s.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(d),g=s.setContext(h),p=r.setContext(h);r0(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:h}=u;!h||!d||(t.lineWidth=h,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=At(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=jt(c.backdropPadding);t.fillRect(-o/2-d.left,-r-u.size/2-d.top,o+d.width,u.size+d.height)}Yn(t,a.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}P(hs,"id","radialLinear"),P(hs,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:er.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),P(hs,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),P(hs,"descriptors",{angleLines:{_fallback:"grid"}});const kr={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},pe=Object.keys(kr);function cd(n,t){return n-t}function ud(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)),Et(o)||(o=typeof i=="string"?e.parse(o,i):e.parse(o)),o===null?null:(s&&(o=s==="week"&&(bn(r)||r===!0)?e.startOf(o,"isoWeek",r):e.startOf(o,s)),+o)}function dd(n,t,e,i){const s=pe.length;for(let r=pe.indexOf(n);r<s-1;++r){const o=kr[pe[r]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((e-t)/(a*o.size))<=i)return pe[r]}return pe[s-1]}function a0(n,t,e,i,s){for(let r=pe.length-1;r>=pe.indexOf(e);r--){const o=pe[r];if(kr[o].common&&n._adapter.diff(s,i,o)>=t-1)return o}return pe[e?pe.indexOf(e):0]}function l0(n){for(let t=pe.indexOf(n)+1,e=pe.length;t<e;++t)if(kr[pe[t]].common)return pe[t]}function hd(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=To(e,t),r=e[i]>=t?e[i]:e[s];n[r]=!0}}function c0(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 fd(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:c0(n,i,s,e)}class fs extends Un{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 nu._date(t.adapters.date);s.init(e),ji(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:ud(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=Et(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),r=Et(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=$g(s,r,o);return this._unit=e.unit||(i.autoSkip?dd(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):a0(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:l0(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),fd(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=Xt(e,0,o),i=Xt(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||dd(r.minUnit,e,i,this._getLabelCapacity(e)),a=it(s.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=bn(l)||l===!0,u={};let d=e,h,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(h=d,g=0;h<i;h=+t.add(h,a,o),g++)hd(u,h,p);return(h===i||s.bounds==="ticks"||g===1)&&hd(u,h,p),Object.keys(u).sort(cd).map(b=>+b)}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 xt(o,[t,e,i],this);const a=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],h=i[e],g=c&&d&&h&&h.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=Yt(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,fd(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(ud(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return gc(t.sort(cd))}}P(fs,"id","time"),P(fs,"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 Dr(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}=tn(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}=tn(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 ha extends fs{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=Dr(e,this.min),this._tableRange=Dr(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(Dr(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Dr(this._table,i*this._tableRange+this._minPos,!0)}}P(ha,"id","timeseries"),P(ha,"defaults",fs.defaults);var u0=Object.freeze({__proto__:null,CategoryScale:la,LinearScale:ca,LogarithmicScale:ua,RadialLinearScale:hs,TimeScale:fs,TimeSeriesScale:ha});const d0=[_m,qy,Wb,u0],h0=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],f0=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],g0=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],p0=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],gd=(n,t,e)=>{let i=n;return typeof t=="string"||Array.isArray(t)?i=n.toLocaleString(t,e):(t===!0||e!==void 0)&&(i=n.toLocaleString(void 0,e)),i};function fa(n,t){if(!Number.isFinite(n))throw new TypeError(`Expected a finite number, got ${typeof n}: ${n}`);t={bits:!1,binary:!1,space:!0,...t};const e=t.bits?t.binary?p0:g0:t.binary?f0:h0,i=t.space?" ":"";if(t.signed&&n===0)return` 0${i}${e[0]}`;const s=n<0,r=s?"-":t.signed?"+":"";s&&(n=-n);let o;if(t.minimumFractionDigits!==void 0&&(o={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(o={maximumFractionDigits:t.maximumFractionDigits,...o}),n<1){const u=gd(n,t.locale,o);return r+u+i+e[0]}const a=Math.min(Math.floor(t.binary?Math.log(n)/Math.log(1024):Math.log10(n)/3),e.length-1);n/=(t.binary?1024:1e3)**a,o||(n=n.toPrecision(3));const l=gd(Number(n),t.locale,o),c=e[a];return r+l+i+c}const pd=6048e5,m0=864e5,gs=6e4,pi=36e5,y0=1e3,md=Symbol.for("constructDateFrom");function Nt(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&md in n?n[md](t):n instanceof Date?new n.constructor(t):new Date(t)}function rt(n,t){return Nt(t||n,n)}function Tr(n,t,e){const i=rt(n,e==null?void 0:e.in);return isNaN(t)?Nt((e==null?void 0:e.in)||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function ga(n,t,e){const i=rt(n,e==null?void 0:e.in);if(isNaN(t))return Nt(n,NaN);if(!t)return i;const s=i.getDate(),r=Nt(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 pa(n,t,e){return Nt(n,+rt(n)+t)}function b0(n,t,e){return pa(n,t*pi)}let _0={};function Xn(){return _0}function Ue(n,t){var a,l,c,u;const e=Xn(),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=rt(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 mi(n,t){return Ue(n,{...t,weekStartsOn:1})}function yd(n,t){const e=rt(n,t==null?void 0:t.in),i=e.getFullYear(),s=Nt(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=mi(s),o=Nt(e,0);o.setFullYear(i,0,4),o.setHours(0,0,0,0);const a=mi(o);return e.getTime()>=r.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function Cr(n){const t=rt(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 Gn(n,...t){const e=Nt.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function ma(n,t){const e=rt(n,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function bd(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=ma(i),o=ma(s),a=+r-Cr(r),l=+o-Cr(o);return Math.round((a-l)/m0)}function x0(n,t){const e=yd(n,t),i=Nt(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),mi(i)}function w0(n,t,e){const i=rt(n,e==null?void 0:e.in);return i.setTime(i.getTime()+t*gs),i}function v0(n,t,e){return ga(n,t*3,e)}function M0(n,t,e){return pa(n,t*1e3)}function S0(n,t,e){return Tr(n,t*7,e)}function k0(n,t,e){return ga(n,t*12,e)}function ps(n,t){const e=+rt(n)-+rt(t);return e<0?-1:e>0?1:e}function D0(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function ya(n){return!(!D0(n)&&typeof n!="number"||isNaN(+rt(n)))}function T0(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=i.getFullYear()-s.getFullYear(),o=i.getMonth()-s.getMonth();return r*12+o}function C0(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t);return i.getFullYear()-s.getFullYear()}function _d(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=xd(i,s),o=Math.abs(bd(i,s));i.setDate(i.getDate()-r*o);const a=+(xd(i,s)===-r),l=r*(o-a);return l===0?0:l}function xd(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 ms(n){return t=>{const i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function O0(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=(+i-+s)/pi;return ms(e==null?void 0:e.roundingMethod)(r)}function ba(n,t){return+rt(n)-+rt(t)}function P0(n,t,e){const i=ba(n,t)/gs;return ms(e==null?void 0:e.roundingMethod)(i)}function wd(n,t){const e=rt(n,t==null?void 0:t.in);return e.setHours(23,59,59,999),e}function vd(n,t){const e=rt(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 E0(n,t){const e=rt(n,t==null?void 0:t.in);return+wd(e,t)==+vd(e,t)}function Md(n,t,e){const[i,s,r]=Gn(e==null?void 0:e.in,n,n,t),o=ps(s,r),a=Math.abs(T0(s,r));if(a<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-o*a);let l=ps(s,r)===-o;E0(i)&&a===1&&ps(i,r)===1&&(l=!1);const c=o*(a-+l);return c===0?0:c}function A0(n,t,e){const i=Md(n,t,e)/3;return ms(e==null?void 0:e.roundingMethod)(i)}function R0(n,t,e){const i=ba(n,t)/1e3;return ms(e==null?void 0:e.roundingMethod)(i)}function L0(n,t,e){const i=_d(n,t,e)/7;return ms(e==null?void 0:e.roundingMethod)(i)}function I0(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=ps(i,s),o=Math.abs(C0(i,s));i.setFullYear(1584),s.setFullYear(1584);const a=ps(i,s)===-r,l=r*(o-+a);return l===0?0:l}function N0(n,t){const e=rt(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 F0(n,t){const e=rt(n,t==null?void 0:t.in);return e.setDate(1),e.setHours(0,0,0,0),e}function z0(n,t){const e=rt(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 Sd(n,t){const e=rt(n,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function B0(n,t){const e=rt(n,t==null?void 0:t.in);return e.setMinutes(59,59,999),e}function H0(n,t){var a,l;const e=Xn(),i=e.weekStartsOn??((l=(a=e.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??0,s=rt(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 W0(n,t){const e=rt(n,t==null?void 0:t.in);return e.setSeconds(59,999),e}function Y0(n,t){const e=rt(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 j0(n,t){const e=rt(n,t==null?void 0:t.in);return e.setMilliseconds(999),e}const V0={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"}},$0=(n,t,e)=>{let i;const s=V0[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 _a(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const U0={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},q0={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},X0={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},G0={date:_a({formats:U0,defaultWidth:"full"}),time:_a({formats:q0,defaultWidth:"full"}),dateTime:_a({formats:X0,defaultWidth:"full"})},K0={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Z0=(n,t,e,i)=>K0[n];function ys(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 Q0={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},J0={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},t_={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"]},e_={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"]},n_={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"}},i_={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"}},s_={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:ys({values:Q0,defaultWidth:"wide"}),quarter:ys({values:J0,defaultWidth:"wide",argumentCallback:n=>n-1}),month:ys({values:t_,defaultWidth:"wide"}),day:ys({values:e_,defaultWidth:"wide"}),dayPeriod:ys({values:n_,defaultWidth:"wide",formattingValues:i_,defaultFormattingWidth:"wide"})};function bs(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)?o_(a,d=>d.test(o)):r_(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 r_(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function o_(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function a_(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 l_=/^(\d+)(th|st|nd|rd)?/i,c_=/\d+/i,u_={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},d_={any:[/^b/i,/^(a|c)/i]},h_={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},f_={any:[/1/i,/2/i,/3/i,/4/i]},g_={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},p_={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]},m_={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},y_={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]},b_={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},__={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}},x_={ordinalNumber:a_({matchPattern:l_,parsePattern:c_,valueCallback:n=>parseInt(n,10)}),era:bs({matchPatterns:u_,defaultMatchWidth:"wide",parsePatterns:d_,defaultParseWidth:"any"}),quarter:bs({matchPatterns:h_,defaultMatchWidth:"wide",parsePatterns:f_,defaultParseWidth:"any",valueCallback:n=>n+1}),month:bs({matchPatterns:g_,defaultMatchWidth:"wide",parsePatterns:p_,defaultParseWidth:"any"}),day:bs({matchPatterns:m_,defaultMatchWidth:"wide",parsePatterns:y_,defaultParseWidth:"any"}),dayPeriod:bs({matchPatterns:b_,defaultMatchWidth:"any",parsePatterns:__,defaultParseWidth:"any"})},kd={code:"en-US",formatDistance:$0,formatLong:G0,formatRelative:Z0,localize:s_,match:x_,options:{weekStartsOn:0,firstWeekContainsDate:1}};function w_(n,t){const e=rt(n,t==null?void 0:t.in);return bd(e,Sd(e))+1}function Dd(n,t){const e=rt(n,t==null?void 0:t.in),i=+mi(e)-+x0(e);return Math.round(i/pd)+1}function xa(n,t){var u,d,h,g;const e=rt(n,t==null?void 0:t.in),i=e.getFullYear(),s=Xn(),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=(h=s.locale)==null?void 0:h.options)==null?void 0:g.firstWeekContainsDate)??1,o=Nt((t==null?void 0:t.in)||n,0);o.setFullYear(i+1,0,r),o.setHours(0,0,0,0);const a=Ue(o,t),l=Nt((t==null?void 0:t.in)||n,0);l.setFullYear(i,0,r),l.setHours(0,0,0,0);const c=Ue(l,t);return+e>=+a?i+1:+e>=+c?i:i-1}function v_(n,t){var a,l,c,u;const e=Xn(),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=xa(n,t),r=Nt((t==null?void 0:t.in)||n,0);return r.setFullYear(s,0,i),r.setHours(0,0,0,0),Ue(r,t)}function Td(n,t){const e=rt(n,t==null?void 0:t.in),i=+Ue(e,t)-+v_(e,t);return Math.round(i/pd)+1}function vt(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 vt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):vt(e+1,2)},d(n,t){return vt(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 vt(n.getHours()%12||12,t.length)},H(n,t){return vt(n.getHours(),t.length)},m(n,t){return vt(n.getMinutes(),t.length)},s(n,t){return vt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return vt(s,t.length)}},yi={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Cd={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=xa(n,i),r=s>0?s:1-s;if(t==="YY"){const o=r%100;return vt(o,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):vt(r,t.length)},R:function(n,t){const e=yd(n);return vt(e,t.length)},u:function(n,t){const e=n.getFullYear();return vt(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 vt(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 vt(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 vt(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=Td(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):vt(s,t.length)},I:function(n,t,e){const i=Dd(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):vt(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=w_(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):vt(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 vt(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 vt(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 vt(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=yi.noon:i===0?s=yi.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=yi.evening:i>=12?s=yi.afternoon:i>=4?s=yi.morning:s=yi.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"}):vt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):vt(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 Pd(i);case"XXXX":case"XX":return Kn(i);case"XXXXX":case"XXX":default:return Kn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Pd(i);case"xxxx":case"xx":return Kn(i);case"xxxxx":case"xxx":default:return Kn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Od(i,":");case"OOOO":default:return"GMT"+Kn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Od(i,":");case"zzzz":default:return"GMT"+Kn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return vt(i,t.length)},T:function(n,t,e){return vt(+n,t.length)}};function Od(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+vt(r,2)}function Pd(n,t){return n%60===0?(n>0?"-":"+")+vt(Math.abs(n)/60,2):Kn(n,t)}function Kn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=vt(Math.trunc(i/60),2),r=vt(i%60,2);return e+s+t+r}const Ed=(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"})}},Ad=(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"})}},wa={p:Ad,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Ed(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}}",Ed(i,t)).replace("{{time}}",Ad(s,t))}},M_=/^D+$/,S_=/^Y+$/,k_=["D","DD","YY","YYYY"];function Rd(n){return M_.test(n)}function Ld(n){return S_.test(n)}function va(n,t,e){const i=D_(n,t,e);if(console.warn(i),k_.includes(n))throw new RangeError(i)}function D_(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 T_=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,C_=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,O_=/^'([^]*?)'?$/,P_=/''/g,E_=/[a-zA-Z]/;function Id(n,t,e){var u,d,h,g,p,b,w,v;const i=Xn(),s=(e==null?void 0:e.locale)??i.locale??kd,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=(h=i.locale)==null?void 0:h.options)==null?void 0:g.firstWeekContainsDate)??1,o=(e==null?void 0:e.weekStartsOn)??((b=(p=e==null?void 0:e.locale)==null?void 0:p.options)==null?void 0:b.weekStartsOn)??i.weekStartsOn??((v=(w=i.locale)==null?void 0:w.options)==null?void 0:v.weekStartsOn)??0,a=rt(n,e==null?void 0:e.in);if(!ya(a))throw new RangeError("Invalid time value");let l=t.match(C_).map(S=>{const D=S[0];if(D==="p"||D==="P"){const k=wa[D];return k(S,s.formatLong)}return S}).join("").match(T_).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const D=S[0];if(D==="'")return{isToken:!1,value:A_(S)};if(Cd[D])return{isToken:!0,value:S};if(D.match(E_))throw new RangeError("Format string contains an unescaped latin alphabet character `"+D+"`");return{isToken:!1,value:S}});s.localize.preprocessor&&(l=s.localize.preprocessor(a,l));const c={firstWeekContainsDate:r,weekStartsOn:o,locale:s};return l.map(S=>{if(!S.isToken)return S.value;const D=S.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&Ld(D)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&Rd(D))&&va(D,t,String(n));const k=Cd[D[0]];return k(a,D,s.localize,c)}).join("")}function A_(n){const t=n.match(O_);return t?t[1].replace(P_,"'"):n}function Nd(){return Object.assign({},Xn())}function R_(n,t){const e=rt(n,t==null?void 0:t.in).getDay();return e===0?7:e}function L_(n,t){const e=I_(t)?new t(0):Nt(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function I_(n){var t;return typeof n=="function"&&((t=n.prototype)==null?void 0:t.constructor)===n}const N_=10;class Fd{constructor(){P(this,"subPriority",0)}validate(t,e){return!0}}class F_ extends Fd{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 z_ extends Fd{constructor(e,i){super();P(this,"priority",N_);P(this,"subPriority",-1);this.context=e||(s=>Nt(i,s))}set(e,i){return i.timestampIsSet?e:Nt(e,L_(e,this.context))}}class mt{run(t,e,i,s){const r=this.parse(t,e,i,s);return r?{setter:new F_(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}validate(t,e,i){return!0}}class B_ extends mt{constructor(){super(...arguments);P(this,"priority",140);P(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 Ht={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}/},qe={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 Wt(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 Xe(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*pi+r*gs+o*y0),rest:t.slice(e[0].length)}}function zd(n){return Lt(Ht.anyDigitsSigned,n)}function Ft(n,t){switch(n){case 1:return Lt(Ht.singleDigit,t);case 2:return Lt(Ht.twoDigits,t);case 3:return Lt(Ht.threeDigits,t);case 4:return Lt(Ht.fourDigits,t);default:return Lt(new RegExp("^\\d{1,"+n+"}"),t)}}function Or(n,t){switch(n){case 1:return Lt(Ht.singleDigitSigned,t);case 2:return Lt(Ht.twoDigitsSigned,t);case 3:return Lt(Ht.threeDigitsSigned,t);case 4:return Lt(Ht.fourDigitsSigned,t);default:return Lt(new RegExp("^-?\\d{1,"+n+"}"),t)}}function Ma(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 Bd(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 Hd(n){return n%400===0||n%4===0&&n%100!==0}class H_ extends mt{constructor(){super(...arguments);P(this,"priority",130);P(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 Wt(Ft(4,e),r);case"yo":return Wt(s.ordinalNumber(e,{unit:"year"}),r);default:return Wt(Ft(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=Bd(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 W_ extends mt{constructor(){super(...arguments);P(this,"priority",130);P(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 Wt(Ft(4,e),r);case"Yo":return Wt(s.ordinalNumber(e,{unit:"year"}),r);default:return Wt(Ft(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s,r){const o=xa(e,r);if(s.isTwoDigitYear){const l=Bd(s.year,o);return e.setFullYear(l,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Ue(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),Ue(e,r)}}class Y_ extends mt{constructor(){super(...arguments);P(this,"priority",130);P(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=Nt(e,0);return r.setFullYear(s,0,4),r.setHours(0,0,0,0),mi(r)}}class j_ extends mt{constructor(){super(...arguments);P(this,"priority",130);P(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 V_ extends mt{constructor(){super(...arguments);P(this,"priority",120);P(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 Ft(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 $_ extends mt{constructor(){super(...arguments);P(this,"priority",120);P(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 Ft(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 U_ extends mt{constructor(){super(...arguments);P(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);P(this,"priority",110)}parse(e,i,s){const r=o=>o-1;switch(i){case"M":return Wt(Lt(Ht.month,e),r);case"MM":return Wt(Ft(2,e),r);case"Mo":return Wt(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 q_ extends mt{constructor(){super(...arguments);P(this,"priority",110);P(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 Wt(Lt(Ht.month,e),r);case"LL":return Wt(Ft(2,e),r);case"Lo":return Wt(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 X_(n,t,e){const i=rt(n,e==null?void 0:e.in),s=Td(i,e)-t;return i.setDate(i.getDate()-s*7),rt(i,e==null?void 0:e.in)}class G_ extends mt{constructor(){super(...arguments);P(this,"priority",100);P(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(Ht.week,e);case"wo":return s.ordinalNumber(e,{unit:"week"});default:return Ft(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s,r){return Ue(X_(e,s,r),r)}}function K_(n,t,e){const i=rt(n,e==null?void 0:e.in),s=Dd(i,e)-t;return i.setDate(i.getDate()-s*7),i}class Z_ extends mt{constructor(){super(...arguments);P(this,"priority",100);P(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(Ht.week,e);case"Io":return s.ordinalNumber(e,{unit:"week"});default:return Ft(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s){return mi(K_(e,s))}}const Q_=[31,28,31,30,31,30,31,31,30,31,30,31],J_=[31,29,31,30,31,30,31,31,30,31,30,31];class tx extends mt{constructor(){super(...arguments);P(this,"priority",90);P(this,"subPriority",1);P(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"d":return Lt(Ht.date,e);case"do":return s.ordinalNumber(e,{unit:"date"});default:return Ft(i.length,e)}}validate(e,i){const s=e.getFullYear(),r=Hd(s),o=e.getMonth();return r?i>=1&&i<=J_[o]:i>=1&&i<=Q_[o]}set(e,i,s){return e.setDate(s),e.setHours(0,0,0,0),e}}class ex extends mt{constructor(){super(...arguments);P(this,"priority",90);P(this,"subpriority",1);P(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(Ht.dayOfYear,e);case"Do":return s.ordinalNumber(e,{unit:"date"});default:return Ft(i.length,e)}}validate(e,i){const s=e.getFullYear();return Hd(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 Sa(n,t,e){var d,h,g,p;const i=Xn(),s=(e==null?void 0:e.weekStartsOn)??((h=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:h.weekStartsOn)??i.weekStartsOn??((p=(g=i.locale)==null?void 0:g.options)==null?void 0:p.weekStartsOn)??0,r=rt(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 Tr(r,u,e)}class nx extends mt{constructor(){super(...arguments);P(this,"priority",90);P(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=Sa(e,s,r),e.setHours(0,0,0,0),e}}class ix extends mt{constructor(){super(...arguments);P(this,"priority",90);P(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 Wt(Ft(i.length,e),o);case"eo":return Wt(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=Sa(e,s,r),e.setHours(0,0,0,0),e}}class sx extends mt{constructor(){super(...arguments);P(this,"priority",90);P(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 Wt(Ft(i.length,e),o);case"co":return Wt(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=Sa(e,s,r),e.setHours(0,0,0,0),e}}function rx(n,t,e){const i=rt(n,e==null?void 0:e.in),s=R_(i,e),r=t-s;return Tr(i,r,e)}class ox extends mt{constructor(){super(...arguments);P(this,"priority",90);P(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 Ft(i.length,e);case"io":return s.ordinalNumber(e,{unit:"day"});case"iii":return Wt(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 Wt(s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return Wt(s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiii":default:return Wt(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=rx(e,s),e.setHours(0,0,0,0),e}}class ax extends mt{constructor(){super(...arguments);P(this,"priority",80);P(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(Ma(s),0,0,0),e}}class lx extends mt{constructor(){super(...arguments);P(this,"priority",80);P(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(Ma(s),0,0,0),e}}class cx extends mt{constructor(){super(...arguments);P(this,"priority",80);P(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(Ma(s),0,0,0),e}}class ux extends mt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,i,s){switch(i){case"h":return Lt(Ht.hour12h,e);case"ho":return s.ordinalNumber(e,{unit:"hour"});default:return Ft(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 dx extends mt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,i,s){switch(i){case"H":return Lt(Ht.hour23h,e);case"Ho":return s.ordinalNumber(e,{unit:"hour"});default:return Ft(i.length,e)}}validate(e,i){return i>=0&&i<=23}set(e,i,s){return e.setHours(s,0,0,0),e}}class hx extends mt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,i,s){switch(i){case"K":return Lt(Ht.hour11h,e);case"Ko":return s.ordinalNumber(e,{unit:"hour"});default:return Ft(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 fx extends mt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,i,s){switch(i){case"k":return Lt(Ht.hour24h,e);case"ko":return s.ordinalNumber(e,{unit:"hour"});default:return Ft(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 gx extends mt{constructor(){super(...arguments);P(this,"priority",60);P(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"m":return Lt(Ht.minute,e);case"mo":return s.ordinalNumber(e,{unit:"minute"});default:return Ft(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setMinutes(s,0,0),e}}class px extends mt{constructor(){super(...arguments);P(this,"priority",50);P(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"s":return Lt(Ht.second,e);case"so":return s.ordinalNumber(e,{unit:"second"});default:return Ft(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setSeconds(s,0),e}}class mx extends mt{constructor(){super(...arguments);P(this,"priority",30);P(this,"incompatibleTokens",["t","T"])}parse(e,i){const s=r=>Math.trunc(r*Math.pow(10,-i.length+3));return Wt(Ft(i.length,e),s)}set(e,i,s){return e.setMilliseconds(s),e}}class yx extends mt{constructor(){super(...arguments);P(this,"priority",10);P(this,"incompatibleTokens",["t","T","x"])}parse(e,i){switch(i){case"X":return Xe(qe.basicOptionalMinutes,e);case"XX":return Xe(qe.basic,e);case"XXXX":return Xe(qe.basicOptionalSeconds,e);case"XXXXX":return Xe(qe.extendedOptionalSeconds,e);case"XXX":default:return Xe(qe.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Nt(e,e.getTime()-Cr(e)-s)}}class bx extends mt{constructor(){super(...arguments);P(this,"priority",10);P(this,"incompatibleTokens",["t","T","X"])}parse(e,i){switch(i){case"x":return Xe(qe.basicOptionalMinutes,e);case"xx":return Xe(qe.basic,e);case"xxxx":return Xe(qe.basicOptionalSeconds,e);case"xxxxx":return Xe(qe.extendedOptionalSeconds,e);case"xxx":default:return Xe(qe.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Nt(e,e.getTime()-Cr(e)-s)}}class _x extends mt{constructor(){super(...arguments);P(this,"priority",40);P(this,"incompatibleTokens","*")}parse(e){return zd(e)}set(e,i,s){return[Nt(e,s*1e3),{timestampIsSet:!0}]}}class xx extends mt{constructor(){super(...arguments);P(this,"priority",20);P(this,"incompatibleTokens","*")}parse(e){return zd(e)}set(e,i,s){return[Nt(e,s),{timestampIsSet:!0}]}}const wx={G:new B_,y:new H_,Y:new W_,R:new Y_,u:new j_,Q:new V_,q:new $_,M:new U_,L:new q_,w:new G_,I:new Z_,d:new tx,D:new ex,E:new nx,e:new ix,c:new sx,i:new ox,a:new ax,b:new lx,B:new cx,h:new ux,H:new dx,K:new hx,k:new fx,m:new gx,s:new px,S:new mx,X:new yx,x:new bx,t:new _x,T:new xx},vx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Mx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Sx=/^'([^]*?)'?$/,kx=/''/g,Dx=/\S/,Tx=/[a-zA-Z]/;function Cx(n,t,e,i){var w,v,S,D,k,C,R,E;const s=()=>Nt((i==null?void 0:i.in)||e,NaN),r=Nd(),o=(i==null?void 0:i.locale)??r.locale??kd,a=(i==null?void 0:i.firstWeekContainsDate)??((v=(w=i==null?void 0:i.locale)==null?void 0:w.options)==null?void 0:v.firstWeekContainsDate)??r.firstWeekContainsDate??((D=(S=r.locale)==null?void 0:S.options)==null?void 0:D.firstWeekContainsDate)??1,l=(i==null?void 0:i.weekStartsOn)??((C=(k=i==null?void 0:i.locale)==null?void 0:k.options)==null?void 0:C.weekStartsOn)??r.weekStartsOn??((E=(R=r.locale)==null?void 0:R.options)==null?void 0:E.weekStartsOn)??0;if(!t)return n?s():rt(e,i==null?void 0:i.in);const c={firstWeekContainsDate:a,weekStartsOn:l,locale:o},u=[new z_(i==null?void 0:i.in,e)],d=t.match(Mx).map(m=>{const _=m[0];if(_ in wa){const T=wa[_];return T(m,o.formatLong)}return m}).join("").match(vx),h=[];for(let m of d){!(i!=null&&i.useAdditionalWeekYearTokens)&&Ld(m)&&va(m,t,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&Rd(m)&&va(m,t,n);const _=m[0],T=wx[_];if(T){const{incompatibleTokens:A}=T;if(Array.isArray(A)){const N=h.find(B=>A.includes(B.token)||B.token===_);if(N)throw new RangeError(`The format string mustn't contain \`${N.fullToken}\` and \`${m}\` at the same time`)}else if(T.incompatibleTokens==="*"&&h.length>0)throw new RangeError(`The format string mustn't contain \`${m}\` and any other token at the same time`);h.push({token:_,fullToken:m});const L=T.run(n,m,o.match,c);if(!L)return s();u.push(L.setter),n=L.rest}else{if(_.match(Tx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");if(m==="''"?m="'":_==="'"&&(m=Ox(m)),n.indexOf(m)===0)n=n.slice(m.length);else return s()}}if(n.length>0&&Dx.test(n))return s();const g=u.map(m=>m.priority).sort((m,_)=>_-m).filter((m,_,T)=>T.indexOf(m)===_).map(m=>u.filter(_=>_.priority===m).sort((_,T)=>T.subPriority-_.subPriority)).map(m=>m[0]);let p=rt(e,i==null?void 0:i.in);if(isNaN(+p))return s();const b={};for(const m of g){if(!m.validate(p,c))return s();const _=m.set(p,b,c);Array.isArray(_)?(p=_[0],Object.assign(b,_[1])):p=_}return p}function Ox(n){return n.match(Sx)[1].replace(kx,"'")}function Px(n,t){const e=rt(n,t==null?void 0:t.in);return e.setMinutes(0,0,0),e}function Ex(n,t){const e=rt(n,t==null?void 0:t.in);return e.setSeconds(0,0),e}function Ax(n,t){const e=rt(n,t==null?void 0:t.in);return e.setMilliseconds(0),e}function Rx(n){const t=n/pi;return Math.trunc(t)}function Wd(n,t){const e=()=>Nt(t==null?void 0:t.in,NaN),i=(t==null?void 0:t.additionalDigits)??2,s=Fx(n);let r;if(s.date){const c=zx(s.date,i);r=Bx(c.restDateString,c.year)}if(!r||isNaN(+r))return e();const o=+r;let a=0,l;if(s.time&&(a=Hx(s.time),isNaN(a)))return e();if(s.timezone){if(l=Wx(s.timezone),isNaN(l))return e()}else{const c=new Date(o+a),u=rt(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 rt(o+a+l,t==null?void 0:t.in)}const Pr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Lx=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Ix=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Nx=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Fx(n){const t={},e=n.split(Pr.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],Pr.timeZoneDelimiter.test(t.date)&&(t.date=n.split(Pr.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const s=Pr.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function zx(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 Bx(n,t){if(t===null)return new Date(NaN);const e=n.match(Lx);if(!e)return new Date(NaN);const i=!!e[4],s=_s(e[1]),r=_s(e[2])-1,o=_s(e[3]),a=_s(e[4]),l=_s(e[5])-1;if(i)return Ux(t,a,l)?Yx(t,a,l):new Date(NaN);{const c=new Date(0);return!Vx(t,r,o)||!$x(t,s)?new Date(NaN):(c.setUTCFullYear(t,r,Math.max(s,o)),c)}}function _s(n){return n?parseInt(n):1}function Hx(n){const t=n.match(Ix);if(!t)return NaN;const e=ka(t[1]),i=ka(t[2]),s=ka(t[3]);return qx(e,i,s)?e*pi+i*gs+s*1e3:NaN}function ka(n){return n&&parseFloat(n.replace(",","."))||0}function Wx(n){if(n==="Z")return 0;const t=n.match(Nx);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return Xx(i,s)?e*(i*pi+s*gs):NaN}function Yx(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 jx=[31,null,31,30,31,30,31,31,30,31,30,31];function Yd(n){return n%400===0||n%4===0&&n%100!==0}function Vx(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(jx[t]||(Yd(n)?29:28))}function $x(n,t){return t>=1&&t<=(Yd(n)?366:365)}function Ux(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function qx(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function Xx(n,t){return t>=0&&t<=59}const Da=(n,t)=>{var s,r;const{tooltip:e}=t;if(e.opacity===0&&!n.locked){n.showTooltip=!1;return}const i=n.chartTooltipSortFn||((o,a)=>a.rawValue-o.rawValue);if(e.body&&!n.locked){const o=e.labelColors,a=((r=(s=t.chart.config)==null?void 0:s.options)==null?void 0:r.indexAxis)==="y"?"x":"y",l=["horizontal_bar","vertical_bar"].includes(n.chartType),c=["gauge","doughnut"].includes(n.chartType);n.tooltipContext=l?e.dataPoints.length>1?e.dataPoints[0].label:"":e.dataPoints[0].parsed.x,n.tooltipSeries=e.dataPoints.map((u,d)=>{const h=c?u.parsed:u.parsed[a];let g;if(n.units==="bytes")g=isNaN(h)?h:fa(h);else{const b=n.translateUnit(n.units,h);g=`${n.units==="usd"?"$":""}${h%1===0?Er.format(h):Er.format(Number(h.toFixed($d)))} ${b}`}let p;return l&&u.dataset.label!==u.label?p=u.dataset.label:c?p=u.dataset.labels[u.dataIndex]:p=u.dataset.label,{backgroundColor:o[d].backgroundColor,borderColor:o[d].borderColor,label:p,value:g,rawValue:h,isSegmentEmpty:u.dataset.isSegmentEmpty}}).sort(i),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},Gx=n=>n&&n.datasets&&n.datasets.length,Kx=n=>Gx(n)&&n.datasets.some(t=>t.data.length),Zx=n=>n.datasets.some(t=>t.data[0]&&ya(t.data[0].x)),Qx=n=>!!Kx(n)&&n.datasets.some(t=>t.data.length==1),Jx=n=>Zx(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)},tw=(n,t,e)=>n.y<e?n.y+t*.15:n.y-t*.5;function jd(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}const Vd=(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)},$d=2,Ud=10,qd=12,Er=new Intl.NumberFormat(((og=document==null?void 0:document.documentElement)==null?void 0:og.lang)||"en-US"),Ar=10,Xd={"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"}},on=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Rr=(n,t)=>(t||on)[n%on.length],Gd=(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}`},Kd="#6f7787",Zd={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"}},ew=n=>{var e;const t=Math.floor(parseInt(n,10)/100)*100;return((e=Zd[t])==null?void 0:e.background)||"#fafafa"},nw={SUCCESS:"#6FCC83",FAILURE:"#FF8484"},iw={"4XX":"#FFBA81","5XX":"#FF8484"},sw={LatencyP99:"#1356cb",LatencyP95:"#1fbecd",LatencyP50:"#1df97d"},rw="#dad4c7",Qd="#afb7c5",ow=n=>{const t=Object.entries(Xd).find(([e])=>new RegExp(e).test(n));return t&&t[1]||Xd.standard},Ca=(n,t,e,i)=>{let s;return e?s=Qd:Array.isArray(i)?s=Rr(n,i):s=i[t],s||Rr(n)},aw={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},lw=2,cw=0,Oa=new Map,Pa=(n,t)=>t==="bytes"?fa(n):t==="count/minute"?n.toFixed(2):Er.format(n),Jd=n=>{const e=document.createElement("canvas").getContext("2d"),i=At({});return e.font=i.string,e.measureText(n).width},uw=()=>{const n="label_height";if(!Oa.has(n)){const t=At({});Oa.set(n,t.lineHeight)}return Oa.get(n)},dw=n=>n.datasets.reduce((t,e)=>t+e.data.reduce((i,s)=>isNaN(s)?i:i+s,0),0),th=(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),eh=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,Ea="#e0e4ea",hw={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"]},xs=(n,t)=>{let e=1;const i=hw[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},nh=new Map([[100,xs("100",[100,101,102,103])],[200,xs("200",[200,201,202,203,204,205,206,207,208,226])],[300,xs("300",[300,301,302,303,304,305,307,308])],[400,xs("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,xs("500",[500,501,502,503,504,505,506,507,508,510,511])]]),Aa=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100,i=nh.get(e);return i===void 0?Ea:i.get(t)??i.get(-1)??Ea},fw=n=>{const t=Aa(n);return{solid:t,light:t}},Lr={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=Aa(`${t}`),n),{}),____OTHER____:"#DAD4C7","1XX":"#4DA6FF","2XX":"#6FCC83","3XX":"#FFD982","4XX":"#FFBA81","5XX":"#FF8484"};function ih(n,t,e){const i=Nd(),s=mw(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?gw(s,t):pw(s,t)}function gw(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 pw(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function mw(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function yw(n,t){const e=vw(t);return"formatToParts"in e?_w(e,n):xw(e,n)}const bw={year:0,month:1,day:2,hour:3,minute:4,second:5};function _w(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=bw[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 xw(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 Ra={},sh=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")),ww=sh==="06/25/2014, 00:00:00"||sh==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function vw(n){return Ra[n]||(Ra[n]=ww?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"})),Ra[n]}function rh(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 oh=36e5,Mw=6e4,La={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Ia(n,t,e){if(!n)return 0;let i=La.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=La.timezoneHH.exec(n),i)return s=parseInt(i[1],10),ah(s)?-(s*oh):NaN;if(i=La.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const o=parseInt(i[3],10);return ah(s,o)?(r=Math.abs(s)*oh+o*Mw,i[1]==="+"?-r:r):NaN}if(Dw(n)){t=new Date(t||Date.now());const o=e?t:Sw(t),a=Na(o,n);return-(e?a:kw(t,a,n))}return NaN}function Sw(n){return rh(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Na(n,t){const e=yw(n,t),i=rh(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 kw(n,t,e){let s=n.getTime()-t;const r=Na(new Date(s),e);if(t===r)return t;s-=r-t;const o=Na(new Date(s),e);return r===o?r:Math.max(r,o)}function ah(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const lh={};function Dw(n){if(lh[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),lh[n]=!0,!0}catch{return!1}}const Tw=60*1e3,Cw={X:function(n,t,e){const i=Fa(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return ch(i);case"XXXX":case"XX":return bi(i);case"XXXXX":case"XXX":default:return bi(i,":")}},x:function(n,t,e){const i=Fa(e.timeZone,n);switch(t){case"x":return ch(i);case"xxxx":case"xx":return bi(i);case"xxxxx":case"xxx":default:return bi(i,":")}},O:function(n,t,e){const i=Fa(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Ow(i,":");case"OOOO":default:return"GMT"+bi(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return ih("short",n,e);case"zzzz":default:return ih("long",n,e)}}};function Fa(n,t){const e=n?Ia(n,t,!0)/Tw:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Ir(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function bi(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Ir(Math.floor(i/60),2),r=Ir(Math.floor(i%60),2);return e+s+t+r}function ch(n,t){return n%60===0?(n>0?"-":"+")+Ir(Math.abs(n)/60,2):bi(n,t)}function Ow(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+Ir(r,2)}function uh(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 Pw=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,za=36e5,dh=6e4,Ew=2,le={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:Pw};function hh(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?Ew: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=Aw(n),{year:s,restDateString:r}=Rw(i.date,e),o=Lw(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=Iw(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Ia(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=uh(new Date(a+l)),c=uh(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function Aw(n){const t={};let e=le.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=le.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=le.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function Rw(n,t){if(n){const e=le.YYY[t],i=le.YYYYY[t];let s=le.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=le.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 Lw(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=le.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,ph(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=le.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=le.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const o=parseInt(r[2],10);return ph(t,i,o)?(e.setUTCFullYear(t,i,o),e):new Date(NaN)}if(r=le.Www.exec(n),r)return s=parseInt(r[1],10)-1,mh(s)?fh(t,s):new Date(NaN);if(r=le.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const o=parseInt(r[2],10)-1;return mh(s,o)?fh(t,s,o):new Date(NaN)}return null}function Iw(n){let t,e,i=le.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Ba(t)?t%24*za:NaN;if(i=le.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Ba(t,e)?t%24*za+e*dh:NaN;if(i=le.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Ba(t,e,s)?t%24*za+e*dh+s*1e3:NaN}return null}function fh(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 Nw=[31,28,31,30,31,30,31,31,30,31,30,31],Fw=[31,29,31,30,31,30,31,31,30,31,30,31];function gh(n){return n%400===0||n%4===0&&n%100!==0}function ph(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=gh(n);if(i&&e>Fw[t]||!i&&e>Nw[t])return!1}return!0}function zw(n,t){if(t<1)return!1;const e=gh(n);return!(e&&t>366||!e&&t>365)}function mh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Ba(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const Bw=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Ha(n,t,e={}){t=String(t);const i=t.match(Bw);if(i){const s=hh(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,"'"+Cw[o[0]](s,o,e)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return Id(n,t,e)}function Hw(n,t,e){n=hh(n,e);const i=Ia(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 Zn(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Ha(Hw(n,t,{timeZone:i.timeZone}),e,i)}const Ww=Intl.DateTimeFormat().resolvedOptions().timeZone,yh=(n,t,e,i=Ww)=>["secondly","tenSecondly","thirtySecondly"].includes(t)?Zn(n,i,e?"yyyy-MM-dd h:mm:ss a":"h:mm:ss a"):["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly"].includes(t)?Zn(n,i,e?"yyyy-MM-dd h:mm a":"h:mm a"):t==="twelveHourly"?Zn(n,i,"yyyy-MM-dd h:mm a"):t==="daily"?Zn(n,i,"yyyy-MM-dd"):t==="weekly"?`${Zn(n,i,"yyyy")} W${Zn(n,i,"II")}`:Zn(n,i,"yyyy-MM-dd h:mm:ss a");function Yw(n){const t={enabled:!1,position:"barChartTooltipPosition",callbacks:{label:o=>({label:o.dataset.label,value:o.label})}};Mr.positioners.barChartTooltipPosition=function(o,a){if(!o.length)return!1;const l=this.chart.canvas.getBoundingClientRect(),c=n.tooltipState.width||this.width,u=l.width/2,d=Ta(a,c,u),h=a.y,g=a.x<u?"left":"center";return{x:d-n.tooltipState.offsetX,y:h-n.tooltipState.offsetY,xAlign:g}},Go.modes.customInteractionMode=function(o,a){const l=wn(a,o),c=[];return Go.evaluateInteractionItems(o,o.options.indexAxis||"x",l,(u,d,h)=>{o.options.indexAxis==="y"&&u.inYRange(l.y,!0)&&o.data.datasets[d].data[h]&&c.push({element:u,datasetIndex:d,index:h}),o.options.indexAxis==="x"&&u.inXRange(l.x,!0)&&o.data.datasets[d].data[h]&&c.push({element:u,datasetIndex:d,index:h})}),c};const e=n.numLabels.value>25?Ud:qd,i=({chart:o,index:a})=>{var c;const l=o.data;return{size:e,style:(c=l==null?void 0:l.isLabelEmpty)!=null&&c[a]?"italic":"normal"}},s=(o,a,l)=>o.chart.options.indexAxis===o.axis?(a=o.getLabelForValue(l),a&&a.length>Ar?a.slice(0,Ar)+"...":a):o.getLabelForValue(Number(a));return f.computed(()=>{var o,a,l,c,u,d,h,g;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:i,callback:function(p,b){return s(this,p,b)}},title:{display:n.indexAxis==="y"?!st((o=n.metricAxesTitle)==null?void 0:o.value):!st((a=n.dimensionAxesTitle)==null?void 0:a.value),text:n.indexAxis==="y"?(l=n.metricAxesTitle)==null?void 0:l.value:(c=n.dimensionAxesTitle)==null?void 0:c.value,padding:{top:10},font:{weight:"bold"}}},y:{border:{display:!1},stacked:n.stacked.value,beginAtZero:!0,grid:{display:!1,drawBorder:!1},ticks:{font:i,callback:function(p,b){return s(this,p,b)}},title:{display:n.indexAxis==="x"?!st((u=n.metricAxesTitle)==null?void 0:u.value):!st((d=n.dimensionAxesTitle)==null?void 0:d.value),text:n.indexAxis==="x"?(h=n.metricAxesTitle)==null?void 0:h.value:(g=n.dimensionAxesTitle)==null?void 0:g.value,padding:{bottom:20},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:p=>{Da(n.tooltipState,p)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1}})}Pe.register(...d0);const jw=(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 Vw(n,t,e,i,s){const r=f.shallowRef(null),o=(a,l)=>{if(t.value)return new Pe(t.value,{type:n,data:a,plugins:i,options:l})};return f.onMounted(()=>{r.value=o(e.value,s.value)}),f.onBeforeUnmount(()=>{st(r.value)||r.value.destroy()}),f.watch(e,(a,l)=>{if(jw(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)}),f.watch(t,()=>{st(r.value)||r.value.destroy(),r.value=o(e.value,s.value)}),f.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 me=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Wa(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var bh={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:",",h=[],g=Math.round(c).toString().split("");return g.reverse().forEach(function(p,b){b&&b%3===0&&h.push(d),h.push(p)}),h.reverse().join("")}function e(c,u,d){var h=c/u,g=d.round?"round":"floor";return d.decimal===!1?(c=Math[g](h),c.toString()):(d.precision?c=h:c=h<10?Math[g](h*10)/10:Math[g](h),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 h=c<0;h&&(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",h&&(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})()})(bh);var $w=bh.exports;const ws=Wa($w);function Uw(n,t,e){const{i18n:i}=yt.useI18n(),{translateUnit:s}=yt.useTranslatedUnits();return{legendValues:f.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=isNaN(l)?"0":fa(l);else{const u=s(e.value,l);c=i&&i.t("legend.datapointValueDisplay",{value:ws(l,{capital:!0,...e.value==="usd"&&{prefix:"$"}}),unit:u})||`${ws(l,{capital:!0,...e.value==="usd"&&{prefix:"$"}})} ${e.value}`}return{...o,[a.label]:{raw:l,formatted:c,isThreshold:a.isThreshold}}},{}))}}var qw=Object.defineProperty,Xw=(n,t,e)=>t in n?qw(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Ee=(n,t,e)=>Xw(n,typeof t!="symbol"?t+"":t,e),ct=(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))(ct||{});const Gw=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],vs=n=>n.filter(t=>t!=="time"),_h=["api","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],Kw=vs(_h),Zw=[..._h,"application","consumer","country_code","iso_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","regional_consumer"],Qw=vs(Zw),Jw=["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"],t1=vs(Jw);vs(["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","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"]),vs(["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(Kw),new Set(Qw),new Set(t1);const xh=6048e5,e1=864e5,n1=60,i1=3600,wh=Symbol.for("constructDateFrom");function Ae(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&wh in n?n[wh](t):n instanceof Date?new n.constructor(t):new Date(t)}function ce(n,t){return Ae(t||n,n)}function vh(n,t,e){const i=ce(n,void 0);return isNaN(t)?Ae(n,NaN):(i.setDate(i.getDate()+t),i)}function s1(n,t,e){const i=ce(n,void 0);if(isNaN(t))return Ae(n,NaN);const s=i.getDate(),r=Ae(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 r1={};function Ms(){return r1}function an(n,t){var e,i,s,r;const o=Ms(),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=ce(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 Nr(n,t){return an(n,{...t,weekStartsOn:1})}function Mh(n,t){const e=ce(n,void 0),i=e.getFullYear(),s=Ae(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=Nr(s),o=Ae(e,0);o.setFullYear(i,0,4),o.setHours(0,0,0,0);const a=Nr(o);return e.getTime()>=r.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function Sh(n){const t=ce(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 o1(n,...t){const e=Ae.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Fr(n,t){const e=ce(n,void 0);return e.setHours(0,0,0,0),e}function a1(n,t,e){const[i,s]=o1(void 0,n,t),r=Fr(i),o=Fr(s),a=+r-Sh(r),l=+o-Sh(o);return Math.round((a-l)/e1)}function l1(n,t){const e=Mh(n),i=Ae(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Nr(i)}function c1(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function u1(n){return!(!c1(n)&&typeof n!="number"||isNaN(+ce(n)))}function _i(n,t){const e=ce(n,void 0);return e.setDate(1),e.setHours(0,0,0,0),e}function d1(n,t){const e=ce(n,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const h1={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"}},f1=(n,t,e)=>{let i;const s=h1[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 Ya(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const g1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},p1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},m1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},y1={date:Ya({formats:g1,defaultWidth:"full"}),time:Ya({formats:p1,defaultWidth:"full"}),dateTime:Ya({formats:m1,defaultWidth:"full"})},b1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},_1=(n,t,e,i)=>b1[n];function Ss(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 x1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},w1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},v1={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"]},M1={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"]},S1={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"}},k1={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"}},D1=(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"},T1={ordinalNumber:D1,era:Ss({values:x1,defaultWidth:"wide"}),quarter:Ss({values:w1,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Ss({values:v1,defaultWidth:"wide"}),day:Ss({values:M1,defaultWidth:"wide"}),dayPeriod:Ss({values:S1,defaultWidth:"wide",formattingValues:k1,defaultFormattingWidth:"wide"})};function ks(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)?O1(a,d=>d.test(o)):C1(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 C1(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function O1(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function P1(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 E1=/^(\d+)(th|st|nd|rd)?/i,A1=/\d+/i,R1={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},L1={any:[/^b/i,/^(a|c)/i]},I1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},N1={any:[/1/i,/2/i,/3/i,/4/i]},F1={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},z1={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]},B1={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},H1={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]},W1={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},Y1={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}},j1={ordinalNumber:P1({matchPattern:E1,parsePattern:A1,valueCallback:n=>parseInt(n,10)}),era:ks({matchPatterns:R1,defaultMatchWidth:"wide",parsePatterns:L1,defaultParseWidth:"any"}),quarter:ks({matchPatterns:I1,defaultMatchWidth:"wide",parsePatterns:N1,defaultParseWidth:"any",valueCallback:n=>n+1}),month:ks({matchPatterns:F1,defaultMatchWidth:"wide",parsePatterns:z1,defaultParseWidth:"any"}),day:ks({matchPatterns:B1,defaultMatchWidth:"wide",parsePatterns:H1,defaultParseWidth:"any"}),dayPeriod:ks({matchPatterns:W1,defaultMatchWidth:"any",parsePatterns:Y1,defaultParseWidth:"any"})},V1={code:"en-US",formatDistance:f1,formatLong:y1,formatRelative:_1,localize:T1,match:j1,options:{weekStartsOn:0,firstWeekContainsDate:1}};function $1(n,t){const e=ce(n,void 0);return a1(e,d1(e))+1}function U1(n,t){const e=ce(n,void 0),i=+Nr(e)-+l1(e);return Math.round(i/xh)+1}function kh(n,t){var e,i,s,r;const o=ce(n,t==null?void 0:t.in),a=o.getFullYear(),l=Ms(),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=Ae((t==null?void 0:t.in)||n,0);u.setFullYear(a+1,0,c),u.setHours(0,0,0,0);const d=an(u,t),h=Ae((t==null?void 0:t.in)||n,0);h.setFullYear(a,0,c),h.setHours(0,0,0,0);const g=an(h,t);return+o>=+d?a+1:+o>=+g?a:a-1}function q1(n,t){var e,i,s,r;const o=Ms(),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=kh(n,t),c=Ae((t==null?void 0:t.in)||n,0);return c.setFullYear(l,0,a),c.setHours(0,0,0,0),an(c,t)}function X1(n,t){const e=ce(n,t==null?void 0:t.in),i=+an(e,t)-+q1(e,t);return Math.round(i/xh)+1}function Mt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const kn={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Mt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Mt(e+1,2)},d(n,t){return Mt(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 Mt(n.getHours()%12||12,t.length)},H(n,t){return Mt(n.getHours(),t.length)},m(n,t){return Mt(n.getMinutes(),t.length)},s(n,t){return Mt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return Mt(s,t.length)}},xi={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Dh={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 kn.y(n,t)},Y:function(n,t,e,i){const s=kh(n,i),r=s>0?s:1-s;if(t==="YY"){const o=r%100;return Mt(o,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Mt(r,t.length)},R:function(n,t){const e=Mh(n);return Mt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Mt(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 Mt(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 Mt(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 kn.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 Mt(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=X1(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):Mt(s,t.length)},I:function(n,t,e){const i=U1(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Mt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):kn.d(n,t)},D:function(n,t,e){const i=$1(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Mt(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 Mt(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 Mt(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 Mt(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=xi.noon:i===0?s=xi.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=xi.evening:i>=12?s=xi.afternoon:i>=4?s=xi.morning:s=xi.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 kn.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):kn.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Mt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Mt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):kn.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):kn.s(n,t)},S:function(n,t){return kn.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Ch(i);case"XXXX":case"XX":return Qn(i);case"XXXXX":case"XXX":default:return Qn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Ch(i);case"xxxx":case"xx":return Qn(i);case"xxxxx":case"xxx":default:return Qn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Th(i,":");case"OOOO":default:return"GMT"+Qn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Th(i,":");case"zzzz":default:return"GMT"+Qn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Mt(i,t.length)},T:function(n,t,e){return Mt(+n,t.length)}};function Th(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+Mt(r,2)}function Ch(n,t){return n%60===0?(n>0?"-":"+")+Mt(Math.abs(n)/60,2):Qn(n,t)}function Qn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Mt(Math.trunc(i/60),2),r=Mt(i%60,2);return e+s+t+r}const Oh=(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"})}},Ph=(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"})}},G1=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Oh(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}}",Oh(i,t)).replace("{{time}}",Ph(s,t))},K1={p:Ph,P:G1},Z1=/^D+$/,Q1=/^Y+$/,J1=["D","DD","YY","YYYY"];function tv(n){return Z1.test(n)}function ev(n){return Q1.test(n)}function nv(n,t,e){const i=iv(n,t,e);if(console.warn(i),J1.includes(n))throw new RangeError(i)}function iv(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 sv=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,rv=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ov=/^'([^]*?)'?$/,av=/''/g,lv=/[a-zA-Z]/;function cv(n,t,e){var i,s,r,o,a,l,c,u;const d=Ms(),h=(e==null?void 0:e.locale)??d.locale??V1,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,b=ce(n,e==null?void 0:e.in);if(!u1(b))throw new RangeError("Invalid time value");let w=t.match(rv).map(S=>{const D=S[0];if(D==="p"||D==="P"){const k=K1[D];return k(S,h.formatLong)}return S}).join("").match(sv).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const D=S[0];if(D==="'")return{isToken:!1,value:uv(S)};if(Dh[D])return{isToken:!0,value:S};if(D.match(lv))throw new RangeError("Format string contains an unescaped latin alphabet character `"+D+"`");return{isToken:!1,value:S}});h.localize.preprocessor&&(w=h.localize.preprocessor(b,w));const v={firstWeekContainsDate:g,weekStartsOn:p,locale:h};return w.map(S=>{if(!S.isToken)return S.value;const D=S.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&ev(D)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&tv(D))&&nv(D,t,String(n));const k=Dh[D[0]];return k(b,D,h.localize,v)}).join("")}function uv(n){const t=n.match(ov);return t?t[1].replace(av,"'"):n}function dv(n,t){const e=ce(n,void 0),i=e.getFullYear(),s=e.getMonth(),r=Ae(e,0);return r.setFullYear(i,s+1,0),r.setHours(0,0,0,0),r.getDate()}function hv(){return Object.assign({},Ms())}function fv(n){return Math.trunc(n*i1)}function gv(n){const t=n/n1;return Math.trunc(t)}function Eh(n,t,e){return s1(n,-t)}function Ah(n,t,e){const i=hv(),s=yv(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?pv(s,t):mv(s,t)}function pv(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 mv(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function yv(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function bv(n,t){const e=Mv(t);return"formatToParts"in e?xv(e,n):wv(e,n)}const _v={year:0,month:1,day:2,hour:3,minute:4,second:5};function xv(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=_v[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 wv(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 ja={},Rh=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")),vv=Rh==="06/25/2014, 00:00:00"||Rh==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function Mv(n){return ja[n]||(ja[n]=vv?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"})),ja[n]}function Va(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 Lh=36e5,Sv=6e4,$a={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Ds(n,t,e){if(!n)return 0;let i=$a.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=$a.timezoneHH.exec(n),i)return s=parseInt(i[1],10),Ih(s)?-(s*Lh):NaN;if(i=$a.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const o=parseInt(i[3],10);return Ih(s,o)?(r=Math.abs(s)*Lh+o*Sv,i[1]==="+"?-r:r):NaN}if(Tv(n)){t=new Date(t||Date.now());const o=e?t:kv(t),a=Ua(o,n);return-(e?a:Dv(t,a,n))}return NaN}function kv(n){return Va(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Ua(n,t){const e=bv(n,t),i=Va(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 Dv(n,t,e){let i=n.getTime()-t;const s=Ua(new Date(i),e);if(t===s)return t;i-=s-t;const r=Ua(new Date(i),e);return s===r?s:Math.max(s,r)}function Ih(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const Nh={};function Tv(n){if(Nh[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Nh[n]=!0,!0}catch{return!1}}const Cv=60*1e3,Ov={X:function(n,t,e){const i=qa(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return Fh(i);case"XXXX":case"XX":return wi(i);case"XXXXX":case"XXX":default:return wi(i,":")}},x:function(n,t,e){const i=qa(e.timeZone,n);switch(t){case"x":return Fh(i);case"xxxx":case"xx":return wi(i);case"xxxxx":case"xxx":default:return wi(i,":")}},O:function(n,t,e){const i=qa(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Pv(i,":");case"OOOO":default:return"GMT"+wi(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return Ah("short",n,e);case"zzzz":default:return Ah("long",n,e)}}};function qa(n,t){const e=n?Ds(n,t,!0)/Cv:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function zr(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function wi(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=zr(Math.floor(i/60),2),r=zr(Math.floor(i%60),2);return e+s+t+r}function Fh(n,t){return n%60===0?(n>0?"-":"+")+zr(Math.abs(n)/60,2):wi(n,t)}function Pv(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+zr(r,2)}function zh(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 Bh=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Xa=36e5,Hh=6e4,Ev=2,ue={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:Bh};function Br(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?Ev: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=Av(n),{year:s,restDateString:r}=Rv(i.date,e),o=Lv(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=Iv(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Ds(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=zh(new Date(a+l)),c=zh(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function Av(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 Rv(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 Lv(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,jh(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 zv(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 jh(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,Vh(s)?Wh(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 Vh(s,o)?Wh(t,s,o):new Date(NaN)}return null}function Iv(n){let t,e,i=ue.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Ga(t)?t%24*Xa:NaN;if(i=ue.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Ga(t,e)?t%24*Xa+e*Hh: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 Ga(t,e,s)?t%24*Xa+e*Hh+s*1e3:NaN}return null}function Wh(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 Nv=[31,28,31,30,31,30,31,31,30,31,30,31],Fv=[31,29,31,30,31,30,31,31,30,31,30,31];function Yh(n){return n%400===0||n%4===0&&n%100!==0}function jh(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=Yh(n);if(i&&e>Fv[t]||!i&&e>Nv[t])return!1}return!0}function zv(n,t){if(t<1)return!1;const e=Yh(n);return!(e&&t>366||!e&&t>365)}function Vh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Ga(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const Bv=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Hv(n,t,e={}){t=String(t);const i=t.match(Bv);if(i){const s=Br(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,"'"+Ov[o[0]](s,o,e)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return cv(n,t,e)}function $h(n,t,e){n=Br(n,e);const i=Ds(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 Wv(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Hv($h(n,t,{timeZone:i.timeZone}),e,i)}function Yv(n,t,e){if(typeof n=="string"&&!n.match(Bh))return Br(n,{...e,timeZone:t});n=Br(n,e);const i=Va(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),s=Ds(t,new Date(i));return new Date(i+s)}function jv(n,t){return-Ds(n,t)}function Uh(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 Wv(s,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const Vv={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 Ka(n){return n&&Gw.find(t=>n<=Vv[t])||null}var Hr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Wr={exports:{}};Wr.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]",h="[object Map]",g="[object Number]",p="[object Object]",b="[object Promise]",w="[object RegExp]",v="[object Set]",S="[object String]",D="[object Symbol]",k="[object WeakMap]",C="[object ArrayBuffer]",R="[object DataView]",E="[object Float32Array]",m="[object Float64Array]",_="[object Int8Array]",T="[object Int16Array]",A="[object Int32Array]",L="[object Uint8Array]",N="[object Uint8ClampedArray]",B="[object Uint16Array]",G="[object Uint32Array]",U=/[\\^$.*+?()[\]{}|]/g,H=/\w*$/,ut=/^\[object .+?Constructor\]$/,Y=/^(?:0|[1-9]\d*)$/,et={};et[r]=et[o]=et[C]=et[R]=et[a]=et[l]=et[E]=et[m]=et[_]=et[T]=et[A]=et[h]=et[g]=et[p]=et[w]=et[v]=et[S]=et[D]=et[L]=et[N]=et[B]=et[G]=!0,et[c]=et[u]=et[k]=!1;var Dt=typeof Hr=="object"&&Hr&&Hr.Object===Object&&Hr,$=typeof self=="object"&&self&&self.Object===Object&&self,z=Dt||$||Function("return this")(),j=t&&!t.nodeType&&t,X=j&&!0&&n&&!n.nodeType&&n,Z=X&&X.exports===j;function tt(x,O){return x.set(O[0],O[1]),x}function q(x,O){return x.add(O),x}function V(x,O){for(var F=-1,K=x?x.length:0;++F<K&&O(x[F],F,x)!==!1;);return x}function ot(x,O){for(var F=-1,K=O.length,Vt=x.length;++F<K;)x[Vt+F]=O[F];return x}function J(x,O,F,K){for(var Vt=-1,Qt=x?x.length:0;++Vt<Qt;)F=O(F,x[Vt],Vt,x);return F}function Ct(x,O){for(var F=-1,K=Array(x);++F<x;)K[F]=O(F);return K}function pt(x,O){return x==null?void 0:x[O]}function Rt(x){var O=!1;if(x!=null&&typeof x.toString!="function")try{O=!!(x+"")}catch{}return O}function bt(x){var O=-1,F=Array(x.size);return x.forEach(function(K,Vt){F[++O]=[Vt,K]}),F}function ft(x,O){return function(F){return x(O(F))}}function $t(x){var O=-1,F=Array(x.size);return x.forEach(function(K){F[++O]=K}),F}var ie=Array.prototype,ye=Function.prototype,se=Object.prototype,Kt=z["__core-js_shared__"],St=function(){var x=/[^.]+$/.exec(Kt&&Kt.keys&&Kt.keys.IE_PROTO||"");return x?"Symbol(src)_1."+x:""}(),Tt=ye.toString,Zt=se.hasOwnProperty,gt=se.toString,Ge=RegExp("^"+Tt.call(Zt).replace(U,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),be=Z?z.Buffer:void 0,Re=z.Symbol,re=z.Uint8Array,_e=ft(Object.getPrototypeOf,Object),Te=Object.create,te=se.propertyIsEnumerable,oe=ie.splice,zt=Object.getOwnPropertySymbols,Ci=be?be.isBuffer:void 0,En=ft(Object.keys,Object),Oi=Ln(z,"DataView"),si=Ln(z,"Map"),Ls=Ln(z,"Promise"),Is=Ln(z,"Set"),ri=Ln(z,"WeakMap"),ze=Ln(Object,"create"),Ns=we(Oi),Fs=we(si),zs=we(Ls),oi=we(Is),bl=we(ri),Jr=Re?Re.prototype:void 0,to=Jr?Jr.valueOf:void 0;function un(x){var O=-1,F=x?x.length:0;for(this.clear();++O<F;){var K=x[O];this.set(K[0],K[1])}}function _l(){this.__data__=ze?ze(null):{}}function Pi(x){return this.has(x)&&delete this.__data__[x]}function Bs(x){var O=this.__data__;if(ze){var F=O[x];return F===i?void 0:F}return Zt.call(O,x)?O[x]:void 0}function eo(x){var O=this.__data__;return ze?O[x]!==void 0:Zt.call(O,x)}function dn(x,O){var F=this.__data__;return F[x]=ze&&O===void 0?i:O,this}un.prototype.clear=_l,un.prototype.delete=Pi,un.prototype.get=Bs,un.prototype.has=eo,un.prototype.set=dn;function Be(x){var O=-1,F=x?x.length:0;for(this.clear();++O<F;){var K=x[O];this.set(K[0],K[1])}}function xl(){this.__data__=[]}function wl(x){var O=this.__data__,F=xe(O,x);if(F<0)return!1;var K=O.length-1;return F==K?O.pop():oe.call(O,F,1),!0}function vl(x){var O=this.__data__,F=xe(O,x);return F<0?void 0:O[F][1]}function Ml(x){return xe(this.__data__,x)>-1}function He(x,O){var F=this.__data__,K=xe(F,x);return K<0?F.push([x,O]):F[K][1]=O,this}Be.prototype.clear=xl,Be.prototype.delete=wl,Be.prototype.get=vl,Be.prototype.has=Ml,Be.prototype.set=He;function An(x){var O=-1,F=x?x.length:0;for(this.clear();++O<F;){var K=x[O];this.set(K[0],K[1])}}function Sl(){this.__data__={hash:new un,map:new(si||Be),string:new un}}function kl(x){return Ri(this,x).delete(x)}function Dl(x){return Ri(this,x).get(x)}function Tl(x){return Ri(this,x).has(x)}function We(x,O){return Ri(this,x).set(x,O),this}An.prototype.clear=Sl,An.prototype.delete=kl,An.prototype.get=Dl,An.prototype.has=Tl,An.prototype.set=We;function Rn(x){this.__data__=new Be(x)}function Cl(){this.__data__=new Be}function Ol(x){return this.__data__.delete(x)}function Pl(x){return this.__data__.get(x)}function El(x){return this.__data__.has(x)}function Ei(x,O){var F=this.__data__;if(F instanceof Be){var K=F.__data__;if(!si||K.length<e-1)return K.push([x,O]),this;F=this.__data__=new An(K)}return F.set(x,O),this}Rn.prototype.clear=Cl,Rn.prototype.delete=Ol,Rn.prototype.get=Pl,Rn.prototype.has=El,Rn.prototype.set=Ei;function Al(x,O){var F=In(x)||uo(x)?Ct(x.length,String):[],K=F.length,Vt=!!K;for(var Qt in x)Zt.call(x,Qt)&&!(Vt&&(Qt=="length"||ql(Qt,K)))&&F.push(Qt);return F}function no(x,O,F){var K=x[O];(!(Zt.call(x,O)&&co(K,F))||F===void 0&&!(O in x))&&(x[O]=F)}function xe(x,O){for(var F=x.length;F--;)if(co(x[F][0],O))return F;return-1}function Rl(x,O){return x&&so(O,Ye(O),x)}function Hs(x,O,F,K,Vt,Qt,ve){var Ut;if(K&&(Ut=Qt?K(x,Vt,Qt,ve):K(x)),Ut!==void 0)return Ut;if(!Ii(x))return x;var Fi=In(x);if(Fi){if(Ut=oo(x),!O)return jl(x,Ut)}else{var Nn=hn(x),po=Nn==u||Nn==d;if(Kl(x))return zl(x,O);if(Nn==p||Nn==r||po&&!Qt){if(Rt(x))return Qt?x:{};if(Ut=Ul(po?{}:x),!O)return Vl(x,Rl(Ut,x))}else{if(!et[Nn])return Qt?x:{};Ut=ao(x,Nn,Hs,O)}}ve||(ve=new Rn);var mo=ve.get(x);if(mo)return mo;if(ve.set(x,Ut),!Fi)var yo=F?$l(x):Ye(x);return V(yo||x,function(Fn,zi){yo&&(zi=Fn,Fn=x[zi]),no(Ut,zi,Hs(Fn,O,F,K,zi,x,ve))}),Ut}function Ll(x){return Ii(x)?Te(x):{}}function Il(x,O,F){var K=O(x);return In(x)?K:ot(K,F(x))}function Nl(x){return gt.call(x)}function Fl(x){if(!Ii(x)||Li(x))return!1;var O=js(x)||Rt(x)?Ge:ut;return O.test(we(x))}function Ai(x){if(!lo(x))return En(x);var O=[];for(var F in Object(x))Zt.call(x,F)&&F!="constructor"&&O.push(F);return O}function zl(x,O){if(O)return x.slice();var F=new x.constructor(x.length);return x.copy(F),F}function Ws(x){var O=new x.constructor(x.byteLength);return new re(O).set(new re(x)),O}function io(x,O){var F=O?Ws(x.buffer):x.buffer;return new x.constructor(F,x.byteOffset,x.byteLength)}function Bl(x,O,F){var K=O?F(bt(x),!0):bt(x);return J(K,tt,new x.constructor)}function Hl(x){var O=new x.constructor(x.source,H.exec(x));return O.lastIndex=x.lastIndex,O}function Ys(x,O,F){var K=O?F($t(x),!0):$t(x);return J(K,q,new x.constructor)}function Wl(x){return to?Object(to.call(x)):{}}function Yl(x,O){var F=O?Ws(x.buffer):x.buffer;return new x.constructor(F,x.byteOffset,x.length)}function jl(x,O){var F=-1,K=x.length;for(O||(O=Array(K));++F<K;)O[F]=x[F];return O}function so(x,O,F,K){F||(F={});for(var Vt=-1,Qt=O.length;++Vt<Qt;){var ve=O[Vt],Ut=void 0;no(F,ve,Ut===void 0?x[ve]:Ut)}return F}function Vl(x,O){return so(x,ro(x),O)}function $l(x){return Il(x,Ye,ro)}function Ri(x,O){var F=x.__data__;return Xl(O)?F[typeof O=="string"?"string":"hash"]:F.map}function Ln(x,O){var F=pt(x,O);return Fl(F)?F:void 0}var ro=zt?ft(zt,Object):Vs,hn=Nl;(Oi&&hn(new Oi(new ArrayBuffer(1)))!=R||si&&hn(new si)!=h||Ls&&hn(Ls.resolve())!=b||Is&&hn(new Is)!=v||ri&&hn(new ri)!=k)&&(hn=function(x){var O=gt.call(x),F=O==p?x.constructor:void 0,K=F?we(F):void 0;if(K)switch(K){case Ns:return R;case Fs:return h;case zs:return b;case oi:return v;case bl:return k}return O});function oo(x){var O=x.length,F=x.constructor(O);return O&&typeof x[0]=="string"&&Zt.call(x,"index")&&(F.index=x.index,F.input=x.input),F}function Ul(x){return typeof x.constructor=="function"&&!lo(x)?Ll(_e(x)):{}}function ao(x,O,F,K){var Vt=x.constructor;switch(O){case C:return Ws(x);case a:case l:return new Vt(+x);case R:return io(x,K);case E:case m:case _:case T:case A:case L:case N:case B:case G:return Yl(x,K);case h:return Bl(x,K,F);case g:case S:return new Vt(x);case w:return Hl(x);case v:return Ys(x,K,F);case D:return Wl(x)}}function ql(x,O){return O=O??s,!!O&&(typeof x=="number"||Y.test(x))&&x>-1&&x%1==0&&x<O}function Xl(x){var O=typeof x;return O=="string"||O=="number"||O=="symbol"||O=="boolean"?x!=="__proto__":x===null}function Li(x){return!!St&&St in x}function lo(x){var O=x&&x.constructor,F=typeof O=="function"&&O.prototype||se;return x===F}function we(x){if(x!=null){try{return Tt.call(x)}catch{}try{return x+""}catch{}}return""}function Ke(x){return Hs(x,!0,!0)}function co(x,O){return x===O||x!==x&&O!==O}function uo(x){return Gl(x)&&Zt.call(x,"callee")&&(!te.call(x,"callee")||gt.call(x)==r)}var In=Array.isArray;function ho(x){return x!=null&&fo(x.length)&&!js(x)}function Gl(x){return Ni(x)&&ho(x)}var Kl=Ci||go;function js(x){var O=Ii(x)?gt.call(x):"";return O==u||O==d}function fo(x){return typeof x=="number"&&x>-1&&x%1==0&&x<=s}function Ii(x){var O=typeof x;return!!x&&(O=="object"||O=="function")}function Ni(x){return!!x&&typeof x=="object"}function Ye(x){return ho(x)?Al(x):Ai(x)}function Vs(){return[]}function go(){return!1}n.exports=Ke}(Wr,Wr.exports),Wr.exports;const vi=(n,t)=>new Date(n.getTime()-jv(t,n));class Fe{constructor(t){Ee(this,"timeframeText"),Ee(this,"key"),Ee(this,"display"),Ee(this,"timeframeLength"),Ee(this,"allowedTiers"),Ee(this,"defaultResponseGranularity"),Ee(this,"dataGranularity"),Ee(this,"isRelative"),Ee(this,"fineGrainedDefaultGranularity"),Ee(this,"_startCustom"),Ee(this,"_endCustom"),Ee(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=Yv(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return $h(e,t)}}class $v extends Fe{rawStart(t){let e=an(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=vi(e,t)),e}maximumTimeframeLength(){return 60*60*24*7}}class Uv extends Fe{rawStart(t){let e=_i(this.tzAdjustedDate(t));return t&&(e=vi(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class qv extends Fe{rawEnd(t){let e=an(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=vi(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=an(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=vi(i,t)),i}}class Xv extends Fe{rawEnd(t){let e=_i(this.tzAdjustedDate(t));return t&&(e=vi(e,t)),e}rawStart(t){let e=_i(Eh(this.tzAdjustedDate(t),1));return t&&(e=vi(e,t)),e}}ct.FIFTEEN_MIN,new Fe({key:ct.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"]}),ct.ONE_HOUR,new Fe({key:ct.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"]}),ct.SIX_HOUR,new Fe({key:ct.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"]}),ct.TWELVE_HOUR,new Fe({key:ct.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"]}),ct.ONE_DAY,new Fe({key:ct.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"]}),ct.SEVEN_DAY,new Fe({key:ct.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"]}),ct.THIRTY_DAY,new Fe({key:ct.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"]}),ct.CURRENT_WEEK,new $v({key:ct.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=an(new Date,{weekStartsOn:1});return(Fr(vh(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),ct.CURRENT_MONTH,new Uv({key:ct.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=_i(new Date);return(Fr(vh(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),ct.PREVIOUS_WEEK,new qv({key:ct.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"]}),ct.PREVIOUS_MONTH,new Xv({key:ct.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=_i(new Date),e=_i(Eh(new Date,1));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=Gv(t,e)),60*60*24*dv(new Date().setMonth(new Date().getMonth()-1))+fv(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function Gv(n,t){return gv(n.getTimezoneOffset()-t.getTimezoneOffset())}ct.FIFTEEN_MIN,ct.ONE_HOUR,ct.SIX_HOUR,ct.TWELVE_HOUR,ct.ONE_DAY,ct.SEVEN_DAY,ct.FIFTEEN_MIN,ct.ONE_HOUR,ct.SIX_HOUR,ct.TWELVE_HOUR,ct.ONE_DAY,ct.SEVEN_DAY,ct.THIRTY_DAY,ct.CURRENT_WEEK,ct.CURRENT_MONTH,ct.PREVIOUS_WEEK,ct.PREVIOUS_MONTH;function Kv(n){return f.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?`${Uh(e)} - ${Uh(i,{includeTZ:!0})}`:""})}function Zv(n){const t={enabled:!1,position:"doughnutChartTooltipPosition",callbacks:{label:i=>({label:i.dataset.label,value:i.label})}};return Mr.positioners.doughnutChartTooltipPosition=function(i,s){if(!i.length)return!1;const r=this.chart.canvas.getBoundingClientRect(),o=n.tooltipState.width||this.width,a=r.width/2,l=Ta(s,o,a),c=s.y,u=s.x<a?"left":"center";return{x:l-n.tooltipState.offsetX,y:c,xAlign:u}},{options:f.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:i=>{Da(n.tooltipState,i)}}}}))}}function Qv(n){const t=f.computed(()=>{var o,a;return{type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:10,autoSkipPadding:100,source:"auto",maxRotation:0,callback:l=>{const c=new Date(l);return yh(c,n.granularity.value,s.value)}},title:{display:!st((o=n.dimensionAxesTitle)==null?void 0:o.value),text:(a=n.dimensionAxesTitle)==null?void 0:a.value,padding:{top:2},font:{weight:"bold"}},border:{display:!1},stacked:n.stacked.value}}),e=f.computed(()=>{var o,a;return{title:{display:!st((o=n.metricAxesTitle)==null?void 0:o.value),text:(a=n.metricAxesTitle)==null?void 0:a.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}}),i={enabled:!1,position:"lineChartTooltipPosition"};Mr.positioners.lineChartTooltipPosition=function(o,a){if(!o.length||n.tooltipState.locked)return!1;const l=this.chart.canvas.getBoundingClientRect(),c=n.tooltipState.width||this.width,u=n.tooltipState.height||this.height,d=l.width/2,h=l.height/2,g=Ta(a,c,d);let p=tw(a,u,h);const b=a.y<h?"top":"bottom",w=a.x<d?"left":"center";return u>l.height&&(p=0),{x:g,y:p,xAlign:w,yAlign:b}};const s=f.computed(()=>{const o=Number(n.timeRangeMs.value),a=new Date,l=new Date(a.getTime()-o);return Rx(o)>24||l.getDate()!==a.getDate()});return{options:f.computed(()=>{var o;return{hover:{mode:"index",intersect:!1},elements:{point:{radius:(o=n.pointsWithoutHover)!=null&&o.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:{...i,external:a=>{Da(n.tooltipState,a)}}},interaction:{mode:"index",intersect:!1}}})}}function Jv(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:s,pivotRecords:r,rowLabels:o,colorPalette:a}=n,{i18n:l}=yt.useI18n();return t?i.map(u=>({label:l&&l.te(`chartLabels.${u}`)&&l.t(`chartLabels.${u}`)||u,backgroundColor:Rr(i.indexOf(u),on),data:o.map((d,h)=>e?r[`${d.id},${u}`]||0:r[`${h},${u}`]||null)})):Array.from(s).flatMap((u,d)=>{if(!u)return[];const h=Ca(d,u.name,u.id==="empty",a);return{label:l&&l.te(`chartLabels.${u.name}`)&&l.t(`chartLabels.${u.name}`)||u.name,backgroundColor:h,data:o.map(g=>r[`${g.id},${u.id}`]||null),isSegmentEmpty:u.id==="empty"}})}function tM(n,t){const{i18n:e}=yt.useI18n();return f.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;if(!s.length||!o)return{datasets:[],labels:[]};const u=c&&a||o,d=u[0],h=u.length>1?u[1]:u[0],g=Object.fromEntries(l?s.flatMap(m=>o.map((_,T)=>{const A=m.event[d],L=c?`${A},${_}`:`${T},${_}`,N=m.event[_];return[L,N]})):s.map(m=>{const _=c?`${m.event[d]},${m.event[h]}`:`${d},${h}`,T=m.event[o[0]];return[_,T]})),p=Object.keys(g).reduce((m,_)=>{const[T]=_.split(","),A=g[_];return m[T]?m[T]+=A:m[T]=A,m},{}),b=Object.entries(p).sort(([,m],[,_])=>Number(_)-Number(m)).map(([m])=>m),w=r[d],v=r[h],S=c&&w&&Object.entries(w).map(([m,_])=>({id:m,name:_.name}))||o.map(m=>({id:m,name:m})),D=c&&v&&Object.entries(v).map(([m,_])=>({id:m,name:_.name}))||o.map(m=>({id:m,name:m}));if(d!=="status_code"&&d!=="status_code_grouped"&&(S.sort((m,_)=>b.indexOf(m.id)-b.indexOf(_.id)),D.sort((m,_)=>b.indexOf(m.id)-b.indexOf(_.id))),!S||!D)return{labels:[],datasets:[]};const k=Jv({isMultiMetric:l,hasDimensions:c,metricNames:o,dimensionFieldNames:u,barSegmentLabels:D,pivotRecords:g,rowLabels:S,colorPalette:n.colorPalette||on}),C=c?S.map(m=>e&&e.te(`chartLabels.${m.name}`)&&e.t(`chartLabels.${m.name}`)||m.name):o.map(m=>e&&e.te(`chartLabels.${m}`)&&e.t(`chartLabels.${m}`)||m),R=S.map(m=>m.id==="empty");return{labels:C,datasets:k,isLabelEmpty:R}}}catch(s){return console.error(s),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const eM="#6c7489",nM="#6c7489",iM="#995c00",sM="20px",qh="24px",rM="40px",oM="48px",aM=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,s)=>i+s*e),lM=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return Wd(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},cM=(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 aM(a,l,e)};function uM(n,t){const{i18n:e}=yt.useI18n();return f.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],h=r&&d&&Object.keys(d).map(k=>({id:k,name:d[k].name}))||o.map(k=>({id:k,name:k})),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=lM(a),b=cM(a,l,g,p,s),w=new Set,v=s!=null&&s.length?s.reduce((k,C)=>{const R=new Date(C.timestamp).valueOf(),E=C.event;for(const m of o)w.add(m),R in k||(k[R]={}),m in k[R]||(k[R][m]={});for(const m of o)h.forEach(_=>{E[u]===_.id||m===_.id?(k[R][m]||(k[R][m]={}),k[R][m][_.name]=Math.round(Number(E[m])*1e3)/1e3):c.length||(k[R][m]||(k[R][m]={}),k[R][m][_.name]=Math.round(Number(E[_.id])*1e3)/1e3)});return k},{}):{},D=[...o.length===1?o.flatMap(k=>h.map(C=>[k,C.name,C.id==="empty"])):h.map(k=>[k.name,k.name,k.id==="empty"])].map(([k,C,R],E)=>{const m=b.map(L=>L in v&&k in v[L]?{x:L,y:v[L][k][C]||0}:{x:L,y:0});let{colorPalette:_,fill:T}=n;st(_)&&(_=on);const A=Ca(E,C,R,_);return{rawDimension:C,rawMetric:k,label:e&&e.te(`chartLabels.${C}`)&&e.t(`chartLabels.${C}`)||C,borderColor:A,backgroundColor:A,data:m,total:m.reduce((L,{y:N})=>L+Number(N),0),...aw,fill:T,borderWidth:T?cw:lw,isSegmentEmpty:R}});if(u==="status_code"||u==="status_code_grouped"?D.sort((k,C)=>(k.label??"")<(C.label??"")?-1:1):D.sort((k,C)=>Number(k.total)<Number(C.total)?-1:1),n.threshold)for(const k of Object.keys(n.threshold)){const C=n.threshold[k];C&&D.push({type:"line",rawMetric:k,isThreshold:!0,label:e.t("chartLabels.threshold"),borderColor:eM,borderWidth:1.25,borderDash:[12,8],fill:!1,order:-1,stack:"custom",data:b.map(R=>({x:R,y:C}))})}return{datasets:D}}}catch(s){return console.error(s),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const dM=(n,t)=>{f.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 hM(){const{i18n:n}=yt.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 fM="analytics-query-provider";function gM(){const n=f.inject(fM);return{evaluateFeatureFlag:(e,i)=>n?n.evaluateFeatureFlagFn(e,i):i}}const yt={useBarChartOptions:Yw,useChartJSCommon:Vw,useChartLegendValues:Uw,useChartSelectedRange:Kv,useExploreResultToDatasets:tM,useExploreResultToTimeDataset:uM,useDoughnutChartOptions:Zv,useLinechartOptions:Qv,useI18n:cg,useReportChartDataForSynthetics:dM,useTranslatedUnits:hM,useEvaluateFeatureFlag:gM};var It=(n=>(n.Hidden="hidden",n.Right="right",n.Bottom="bottom",n))(It||{});/*!
18
+ `):n}function Lb(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 Zu(n,t){const e=n.chart.ctx,{body:i,footer:s,title:r}=n,{boxWidth:o,boxHeight:a}=t,l=At(t.bodyFont),c=At(t.titleFont),u=At(t.footerFont),d=r.length,h=s.length,g=i.length,p=jt(t.padding);let b=p.height,w=0,v=i.reduce((k,C)=>k+C.before.length+C.lines.length+C.after.length,0);if(v+=n.beforeBody.length+n.afterBody.length,d&&(b+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),v){const k=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;b+=g*k+(v-g)*l.lineHeight+(v-1)*t.bodySpacing}h&&(b+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let S=0;const D=function(k){w=Math.max(w,e.measureText(k).width+S)};return e.save(),e.font=c.string,wt(n.title,D),e.font=l.string,wt(n.beforeBody.concat(n.afterBody),D),S=t.displayColors?o+2+t.boxPadding:0,wt(i,k=>{wt(k.before,D),wt(k.lines,D),wt(k.after,D)}),S=0,e.font=u.string,wt(n.footer,D),e.restore(),w+=p.width,{width:w,height:b}}function Ib(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function Nb(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 Fb(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"),Nb(c,n,t,e)&&(c="center"),c}function Qu(n,t,e){const i=e.yAlign||t.yAlign||Ib(n,e);return{xAlign:e.xAlign||t.xAlign||Fb(n,t,e,i),yAlign:i}}function zb(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function Bb(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function Ju(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:h,bottomRight:g}=_n(o);let p=zb(t,a);const b=Bb(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,h)+s:a==="right"&&(p+=Math.max(d,g)+s),{x:Xt(p,0,i.width-t.width),y:Xt(b,0,i.height-t.height)}}function vr(n,t,e){const i=jt(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function td(n){return $e([],rn(n))}function Hb(n,t,e){return xn(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function ed(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const nd={beforeTitle:Qe,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:Qe,beforeBody:Qe,beforeLabel:Qe,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:Qe,afterBody:Qe,beforeFooter:Qe,footer:Qe,afterFooter:Qe};function ge(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?nd[t].call(e,i):s}class aa extends Gt{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 Ho(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=Hb(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=ge(i,"beforeTitle",this,t),r=ge(i,"title",this,t),o=ge(i,"afterTitle",this,t);let a=[];return a=$e(a,rn(s)),a=$e(a,rn(r)),a=$e(a,rn(o)),a}getBeforeBody(t,e){return td(ge(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return wt(t,r=>{const o={before:[],lines:[],after:[]},a=ed(i,r);$e(o.before,rn(ge(a,"beforeLabel",this,r))),$e(o.lines,ge(a,"label",this,r)),$e(o.after,rn(ge(a,"afterLabel",this,r))),s.push(o)}),s}getAfterBody(t,e){return td(ge(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=ge(i,"beforeFooter",this,t),r=ge(i,"footer",this,t),o=ge(i,"afterFooter",this,t);let a=[];return a=$e(a,rn(s)),a=$e(a,rn(r)),a=$e(a,rn(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(Lb(this.chart,e[l]));return t.filter&&(a=a.filter((u,d,h)=>t.filter(u,d,h,i))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,i))),wt(a,u=>{const d=ed(t.callbacks,u);s.push(ge(d,"labelColor",this,u)),r.push(ge(d,"labelPointStyle",this,u)),o.push(ge(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=us[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=Zu(this,i),c=Object.assign({},a,l),u=Qu(this.chart,i,c),d=Ju(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}=_n(a),{x:h,y:g}=t,{width:p,height:b}=e;let w,v,S,D,k,C;return r==="center"?(k=g+b/2,s==="left"?(w=h,v=w-o,D=k+o,C=k-o):(w=h+p,v=w+o,D=k-o,C=k+o),S=w):(s==="left"?v=h+Math.max(l,u)+o:s==="right"?v=h+p-Math.max(c,d)-o:v=this.caretX,r==="top"?(D=g,k=D-o,w=v-o,S=v+o):(D=g+b,k=D+o,w=v+o,S=v-o),C=D),{x1:w,x2:v,x3:S,y1:D,y2:k,y3:C}}drawTitle(t,e,i){const s=this.title,r=s.length;let o,a,l;if(r){const c=fi(i.rtl,this.x,this.width);for(t.x=vr(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",o=At(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=At(r.bodyFont),d=vr(this,"left",r),h=s.x(d),g=l<u.lineHeight?(u.lineHeight-l)/2:0,p=e.y+g;if(r.usePointStyle){const b={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},w=s.leftForLtr(h,c)+c/2,v=p+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Ro(t,b,w,v),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Ro(t,b,w,v)}else{t.lineWidth=lt(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 b=s.leftForLtr(h,c),w=s.leftForLtr(s.xPlus(h,1),c-2),v=_n(o.borderRadius);Object.values(v).some(S=>S!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,ui(t,{x:b,y:p,w:c,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),ui(t,{x:w,y:p+1,w:c-2,h:l-2,radius:v}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(b,p,c,l),t.strokeRect(b,p,c,l),t.fillStyle=o.backgroundColor,t.fillRect(w,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=At(i.bodyFont);let h=d.lineHeight,g=0;const p=fi(i.rtl,this.x,this.width),b=function(m){e.fillText(m,p.x(t.x+g),t.y+h/2),t.y+=h+r},w=p.textAlign(o);let v,S,D,k,C,R,E;for(e.textAlign=o,e.textBaseline="middle",e.font=d.string,t.x=vr(this,w,i),e.fillStyle=i.bodyColor,wt(this.beforeBody,b),g=a&&w!=="right"?o==="center"?c/2+u:c+2+u:0,k=0,R=s.length;k<R;++k){for(v=s[k],S=this.labelTextColors[k],e.fillStyle=S,wt(v.before,b),D=v.lines,a&&D.length&&(this._drawColorBox(e,t,k,p,i),h=Math.max(d.lineHeight,l)),C=0,E=D.length;C<E;++C)b(D[C]),h=d.lineHeight;wt(v.after,b)}g=0,h=d.lineHeight,wt(this.afterBody,b),t.y-=r}drawFooter(t,e,i){const s=this.footer,r=s.length;let o,a;if(r){const l=fi(i.rtl,this.x,this.width);for(t.x=vr(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",o=At(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:h,bottomLeft:g,bottomRight:p}=_n(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-h,l),e.quadraticCurveTo(a+c,l,a+c,l+h),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=us[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=Zu(this,t),l=Object.assign({},o,this._size),c=Qu(e,t,l),u=Ju(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=jt(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),Fc(t,e.textDirection),r.y+=o.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),zc(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=!Xs(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||!Xs(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=us[r.position].call(this,t,e);return o!==!1&&(i!==o.x||s!==o.y)}}P(aa,"positioners",us);var Mr={id:"tooltip",_element:aa,positioners:us,afterInit(n,t,e){e&&(n.tooltip=new aa({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:nd},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"]},Wb=Object.freeze({__proto__:null,Colors:tb,Decimation:sb,Filler:Sb,Legend:Pb,SubTitle:Rb,Title:Ab,Tooltip:Mr});const Yb=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function jb(n,t,e,i){const s=n.indexOf(t);if(s===-1)return Yb(n,t,e,i);const r=n.lastIndexOf(t);return s!==r?e:s}const Vb=(n,t)=>n===null?null:Xt(Math.round(n),0,t);function id(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class la extends Un{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:jb(i,t,it(e,t),this._addedLabels),Vb(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 id.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}}P(la,"id","category"),P(la,"defaults",{ticks:{callback:id}});function $b(n,t){const e=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=n,g=r||1,p=u-1,{min:b,max:w}=t,v=!st(o),S=!st(a),D=!st(c),k=(w-b)/(d+1);let C=cc((w-b)/p/g)*g,R,E,m,_;if(C<1e-14&&!v&&!S)return[{value:b},{value:w}];_=Math.ceil(w/C)-Math.floor(b/C),_>p&&(C=cc(_*C/p/g)*g),st(l)||(R=Math.pow(10,l),C=Math.ceil(C*R)/R),s==="ticks"?(E=Math.floor(b/C)*C,m=Math.ceil(w/C)*C):(E=b,m=w),v&&S&&r&&Wg((a-o)/r,C/1e3)?(_=Math.round(Math.min((a-o)/C,u)),C=(a-o)/_,E=o,m=a):D?(E=v?o:E,m=S?a:m,_=c-1,C=(m-E)/_):(_=(m-E)/C,Vi(_,Math.round(_),C/1e3)?_=Math.round(_):_=Math.ceil(_));const T=Math.max(dc(C),dc(E));R=Math.pow(10,st(l)?T:l),E=Math.round(E*R)/R,m=Math.round(m*R)/R;let A=0;for(v&&(h&&E!==o?(e.push({value:o}),E<o&&A++,Vi(Math.round((E+A*C)*R)/R,o,sd(o,k,n))&&A++):E<o&&A++);A<_;++A){const L=Math.round((E+A*C)*R)/R;if(S&&L>a)break;e.push({value:L})}return S&&h&&m!==a?e.length&&Vi(e[e.length-1].value,a,sd(a,k,n))?e[e.length-1].value=a:e.push({value:a}):(!S||m===a)&&e.push({value:m}),e}function sd(n,t,{horizontal:e,minRotation:i}){const s=Yt(i),r=(e?Math.sin(s):Math.cos(s))||.001,o=.75*t*(""+n).length;return Math.min(t/r,o)}class Sr extends Un{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=je(s),c=je(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=$b(s,r);return t.bounds==="ticks"&&uc(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 ca extends Sr{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Et(t)?t:0,this.max=Et(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Yt(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}}P(ca,"id","linear"),P(ca,"defaults",{ticks:{callback:er.formatters.numeric}});const ds=n=>Math.floor(yn(n)),qn=(n,t)=>Math.pow(10,ds(n)+t);function rd(n){return n/Math.pow(10,ds(n))===1}function od(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function Ub(n,t){const e=t-n;let i=ds(e);for(;od(n,t,i)>10;)i++;for(;od(n,t,i)<10;)i--;return Math.min(i,ds(n))}function qb(n,{min:t,max:e}){t=ke(n.min,t);const i=[],s=ds(t);let r=Ub(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)),h=ke(n.min,Math.round((l+u+d*Math.pow(10,r))*o)/o);for(;h<e;)i.push({value:h,major:rd(h),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(r++,d=2,o=r>=0?1:o),h=Math.round((l+u+d*Math.pow(10,r))*o)/o;const g=ke(n.max,h);return i.push({value:g,major:rd(g),significand:d}),i}class ua extends Un{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Sr.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return Et(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Et(t)?Math.max(0,t):null,this.max=Et(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Et(this._userMin)&&(this.min=t===qn(this.min,0)?qn(this.min,-1):qn(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(qn(i,-1)),o(qn(s,1)))),i<=0&&r(qn(s,-1)),s<=0&&o(qn(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=qb(e,this);return t.bounds==="ticks"&&uc(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=yn(t),this._valueRange=yn(this.max)-yn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(yn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}P(ua,"id","logarithmic"),P(ua,"defaults",{ticks:{callback:er.formatters.logarithmic,major:{enabled:!0}}});function da(n){const t=n.ticks;if(t.display&&n.display){const e=jt(t.backdropPadding);return it(t.font&&t.font.size,Pt.font.size)+e.height}return 0}function Xb(n,t,e){return e=_t(e)?e:[e],{w:sp(n,t.string,e),h:e.length*t.lineHeight}}function ad(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 Gb(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?dt/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=At(c.font),h=Xb(n.ctx,d,n._pointLabels[l]);i[l]=h;const g=De(n.getIndexAngle(l)+a),p=Math.round(Qs(g)),b=ad(p,u.x,h.w,0,180),w=ad(p,u.y,h.h,90,270);Kb(e,t,g,b,w)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=Jb(n,i,s)}function Kb(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 Zb(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(Qs(De(l.angle+Ot))),u=n0(l.y,a.h,c),d=t0(c),h=e0(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+a.w,bottom:u+a.h}}function Qb(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:r}=n;return!(en({x:e,y:i},t)||en({x:e,y:r},t)||en({x:s,y:i},t)||en({x:s,y:r},t))}function Jb(n,t,e){const i=[],s=n._pointLabels.length,r=n.options,{centerPointLabels:o,display:a}=r.pointLabels,l={extra:da(r)/2,additionalAngle:o?dt/s:0};let c;for(let u=0;u<s;u++){l.padding=e[u],l.size=t[u];const d=Zb(n,u,l);i.push(d),a==="auto"&&(d.visible=Qb(d,c),d.visible&&(c=d))}return i}function t0(n){return n===0||n===180?"center":n<180?"left":"right"}function e0(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function n0(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function i0(n,t,e){const{left:i,top:s,right:r,bottom:o}=e,{backdropColor:a}=t;if(!st(a)){const l=_n(t.borderRadius),c=jt(t.backdropPadding);n.fillStyle=a;const u=i-c.left,d=s-c.top,h=r-i+c.width,g=o-s+c.height;Object.values(l).some(p=>p!==0)?(n.beginPath(),ui(n,{x:u,y:d,w:h,h:g,radius:l}),n.fill()):n.fillRect(u,d,h,g)}}function s0(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));i0(e,o,r);const a=At(o.font),{x:l,y:c,textAlign:u}=r;Yn(e,n._pointLabels[s],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function ld(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,kt);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 r0(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(),ld(n,e,o,i),r.closePath(),r.stroke(),r.restore())}function o0(n,t,e){return xn(n,{label:e,index:t,type:"pointLabel"})}class hs extends Sr{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=jt(da(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=Et(t)&&!isNaN(t)?t:0,this.max=Et(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/da(this.options))}generateTickLabels(t){Sr.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=xt(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?Gb(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=kt/(this._pointLabels.length||1),i=this.options.startAngle||0;return De(t*e+Yt(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 o0(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-Ot+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(),ld(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&&s0(this,o),s.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(d),g=s.setContext(h),p=r.setContext(h);r0(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:h}=u;!h||!d||(t.lineWidth=h,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=At(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=jt(c.backdropPadding);t.fillRect(-o/2-d.left,-r-u.size/2-d.top,o+d.width,u.size+d.height)}Yn(t,a.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}P(hs,"id","radialLinear"),P(hs,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:er.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),P(hs,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),P(hs,"descriptors",{angleLines:{_fallback:"grid"}});const kr={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},pe=Object.keys(kr);function cd(n,t){return n-t}function ud(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)),Et(o)||(o=typeof i=="string"?e.parse(o,i):e.parse(o)),o===null?null:(s&&(o=s==="week"&&(bn(r)||r===!0)?e.startOf(o,"isoWeek",r):e.startOf(o,s)),+o)}function dd(n,t,e,i){const s=pe.length;for(let r=pe.indexOf(n);r<s-1;++r){const o=kr[pe[r]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((e-t)/(a*o.size))<=i)return pe[r]}return pe[s-1]}function a0(n,t,e,i,s){for(let r=pe.length-1;r>=pe.indexOf(e);r--){const o=pe[r];if(kr[o].common&&n._adapter.diff(s,i,o)>=t-1)return o}return pe[e?pe.indexOf(e):0]}function l0(n){for(let t=pe.indexOf(n)+1,e=pe.length;t<e;++t)if(kr[pe[t]].common)return pe[t]}function hd(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=To(e,t),r=e[i]>=t?e[i]:e[s];n[r]=!0}}function c0(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 fd(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:c0(n,i,s,e)}class fs extends Un{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 nu._date(t.adapters.date);s.init(e),ji(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:ud(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=Et(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),r=Et(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=$g(s,r,o);return this._unit=e.unit||(i.autoSkip?dd(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):a0(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:l0(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),fd(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=Xt(e,0,o),i=Xt(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||dd(r.minUnit,e,i,this._getLabelCapacity(e)),a=it(s.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=bn(l)||l===!0,u={};let d=e,h,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(h=d,g=0;h<i;h=+t.add(h,a,o),g++)hd(u,h,p);return(h===i||s.bounds==="ticks"||g===1)&&hd(u,h,p),Object.keys(u).sort(cd).map(b=>+b)}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 xt(o,[t,e,i],this);const a=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],h=i[e],g=c&&d&&h&&h.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=Yt(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,fd(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(ud(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return gc(t.sort(cd))}}P(fs,"id","time"),P(fs,"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 Dr(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}=tn(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}=tn(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 ha extends fs{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=Dr(e,this.min),this._tableRange=Dr(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(Dr(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Dr(this._table,i*this._tableRange+this._minPos,!0)}}P(ha,"id","timeseries"),P(ha,"defaults",fs.defaults);var u0=Object.freeze({__proto__:null,CategoryScale:la,LinearScale:ca,LogarithmicScale:ua,RadialLinearScale:hs,TimeScale:fs,TimeSeriesScale:ha});const d0=[_m,qy,Wb,u0],h0=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],f0=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],g0=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],p0=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],gd=(n,t,e)=>{let i=n;return typeof t=="string"||Array.isArray(t)?i=n.toLocaleString(t,e):(t===!0||e!==void 0)&&(i=n.toLocaleString(void 0,e)),i};function fa(n,t){if(!Number.isFinite(n))throw new TypeError(`Expected a finite number, got ${typeof n}: ${n}`);t={bits:!1,binary:!1,space:!0,...t};const e=t.bits?t.binary?p0:g0:t.binary?f0:h0,i=t.space?" ":"";if(t.signed&&n===0)return` 0${i}${e[0]}`;const s=n<0,r=s?"-":t.signed?"+":"";s&&(n=-n);let o;if(t.minimumFractionDigits!==void 0&&(o={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(o={maximumFractionDigits:t.maximumFractionDigits,...o}),n<1){const u=gd(n,t.locale,o);return r+u+i+e[0]}const a=Math.min(Math.floor(t.binary?Math.log(n)/Math.log(1024):Math.log10(n)/3),e.length-1);n/=(t.binary?1024:1e3)**a,o||(n=n.toPrecision(3));const l=gd(Number(n),t.locale,o),c=e[a];return r+l+i+c}const pd=6048e5,m0=864e5,gs=6e4,pi=36e5,y0=1e3,md=Symbol.for("constructDateFrom");function Nt(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&md in n?n[md](t):n instanceof Date?new n.constructor(t):new Date(t)}function rt(n,t){return Nt(t||n,n)}function Tr(n,t,e){const i=rt(n,e==null?void 0:e.in);return isNaN(t)?Nt((e==null?void 0:e.in)||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function ga(n,t,e){const i=rt(n,e==null?void 0:e.in);if(isNaN(t))return Nt(n,NaN);if(!t)return i;const s=i.getDate(),r=Nt(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 pa(n,t,e){return Nt(n,+rt(n)+t)}function b0(n,t,e){return pa(n,t*pi)}let _0={};function Xn(){return _0}function Ue(n,t){var a,l,c,u;const e=Xn(),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=rt(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 mi(n,t){return Ue(n,{...t,weekStartsOn:1})}function yd(n,t){const e=rt(n,t==null?void 0:t.in),i=e.getFullYear(),s=Nt(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=mi(s),o=Nt(e,0);o.setFullYear(i,0,4),o.setHours(0,0,0,0);const a=mi(o);return e.getTime()>=r.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function Cr(n){const t=rt(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 Gn(n,...t){const e=Nt.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function ma(n,t){const e=rt(n,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function bd(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=ma(i),o=ma(s),a=+r-Cr(r),l=+o-Cr(o);return Math.round((a-l)/m0)}function x0(n,t){const e=yd(n,t),i=Nt(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),mi(i)}function w0(n,t,e){const i=rt(n,e==null?void 0:e.in);return i.setTime(i.getTime()+t*gs),i}function v0(n,t,e){return ga(n,t*3,e)}function M0(n,t,e){return pa(n,t*1e3)}function S0(n,t,e){return Tr(n,t*7,e)}function k0(n,t,e){return ga(n,t*12,e)}function ps(n,t){const e=+rt(n)-+rt(t);return e<0?-1:e>0?1:e}function D0(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function ya(n){return!(!D0(n)&&typeof n!="number"||isNaN(+rt(n)))}function T0(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=i.getFullYear()-s.getFullYear(),o=i.getMonth()-s.getMonth();return r*12+o}function C0(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t);return i.getFullYear()-s.getFullYear()}function _d(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=xd(i,s),o=Math.abs(bd(i,s));i.setDate(i.getDate()-r*o);const a=+(xd(i,s)===-r),l=r*(o-a);return l===0?0:l}function xd(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 ms(n){return t=>{const i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function O0(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=(+i-+s)/pi;return ms(e==null?void 0:e.roundingMethod)(r)}function ba(n,t){return+rt(n)-+rt(t)}function P0(n,t,e){const i=ba(n,t)/gs;return ms(e==null?void 0:e.roundingMethod)(i)}function wd(n,t){const e=rt(n,t==null?void 0:t.in);return e.setHours(23,59,59,999),e}function vd(n,t){const e=rt(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 E0(n,t){const e=rt(n,t==null?void 0:t.in);return+wd(e,t)==+vd(e,t)}function Md(n,t,e){const[i,s,r]=Gn(e==null?void 0:e.in,n,n,t),o=ps(s,r),a=Math.abs(T0(s,r));if(a<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-o*a);let l=ps(s,r)===-o;E0(i)&&a===1&&ps(i,r)===1&&(l=!1);const c=o*(a-+l);return c===0?0:c}function A0(n,t,e){const i=Md(n,t,e)/3;return ms(e==null?void 0:e.roundingMethod)(i)}function R0(n,t,e){const i=ba(n,t)/1e3;return ms(e==null?void 0:e.roundingMethod)(i)}function L0(n,t,e){const i=_d(n,t,e)/7;return ms(e==null?void 0:e.roundingMethod)(i)}function I0(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=ps(i,s),o=Math.abs(C0(i,s));i.setFullYear(1584),s.setFullYear(1584);const a=ps(i,s)===-r,l=r*(o-+a);return l===0?0:l}function N0(n,t){const e=rt(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 F0(n,t){const e=rt(n,t==null?void 0:t.in);return e.setDate(1),e.setHours(0,0,0,0),e}function z0(n,t){const e=rt(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 Sd(n,t){const e=rt(n,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function B0(n,t){const e=rt(n,t==null?void 0:t.in);return e.setMinutes(59,59,999),e}function H0(n,t){var a,l;const e=Xn(),i=e.weekStartsOn??((l=(a=e.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??0,s=rt(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 W0(n,t){const e=rt(n,t==null?void 0:t.in);return e.setSeconds(59,999),e}function Y0(n,t){const e=rt(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 j0(n,t){const e=rt(n,t==null?void 0:t.in);return e.setMilliseconds(999),e}const V0={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"}},$0=(n,t,e)=>{let i;const s=V0[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 _a(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const U0={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},q0={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},X0={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},G0={date:_a({formats:U0,defaultWidth:"full"}),time:_a({formats:q0,defaultWidth:"full"}),dateTime:_a({formats:X0,defaultWidth:"full"})},K0={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Z0=(n,t,e,i)=>K0[n];function ys(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 Q0={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},J0={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},t_={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"]},e_={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"]},n_={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"}},i_={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"}},s_={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:ys({values:Q0,defaultWidth:"wide"}),quarter:ys({values:J0,defaultWidth:"wide",argumentCallback:n=>n-1}),month:ys({values:t_,defaultWidth:"wide"}),day:ys({values:e_,defaultWidth:"wide"}),dayPeriod:ys({values:n_,defaultWidth:"wide",formattingValues:i_,defaultFormattingWidth:"wide"})};function bs(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)?o_(a,d=>d.test(o)):r_(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 r_(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function o_(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function a_(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 l_=/^(\d+)(th|st|nd|rd)?/i,c_=/\d+/i,u_={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},d_={any:[/^b/i,/^(a|c)/i]},h_={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},f_={any:[/1/i,/2/i,/3/i,/4/i]},g_={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},p_={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]},m_={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},y_={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]},b_={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},__={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}},x_={ordinalNumber:a_({matchPattern:l_,parsePattern:c_,valueCallback:n=>parseInt(n,10)}),era:bs({matchPatterns:u_,defaultMatchWidth:"wide",parsePatterns:d_,defaultParseWidth:"any"}),quarter:bs({matchPatterns:h_,defaultMatchWidth:"wide",parsePatterns:f_,defaultParseWidth:"any",valueCallback:n=>n+1}),month:bs({matchPatterns:g_,defaultMatchWidth:"wide",parsePatterns:p_,defaultParseWidth:"any"}),day:bs({matchPatterns:m_,defaultMatchWidth:"wide",parsePatterns:y_,defaultParseWidth:"any"}),dayPeriod:bs({matchPatterns:b_,defaultMatchWidth:"any",parsePatterns:__,defaultParseWidth:"any"})},kd={code:"en-US",formatDistance:$0,formatLong:G0,formatRelative:Z0,localize:s_,match:x_,options:{weekStartsOn:0,firstWeekContainsDate:1}};function w_(n,t){const e=rt(n,t==null?void 0:t.in);return bd(e,Sd(e))+1}function Dd(n,t){const e=rt(n,t==null?void 0:t.in),i=+mi(e)-+x0(e);return Math.round(i/pd)+1}function xa(n,t){var u,d,h,g;const e=rt(n,t==null?void 0:t.in),i=e.getFullYear(),s=Xn(),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=(h=s.locale)==null?void 0:h.options)==null?void 0:g.firstWeekContainsDate)??1,o=Nt((t==null?void 0:t.in)||n,0);o.setFullYear(i+1,0,r),o.setHours(0,0,0,0);const a=Ue(o,t),l=Nt((t==null?void 0:t.in)||n,0);l.setFullYear(i,0,r),l.setHours(0,0,0,0);const c=Ue(l,t);return+e>=+a?i+1:+e>=+c?i:i-1}function v_(n,t){var a,l,c,u;const e=Xn(),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=xa(n,t),r=Nt((t==null?void 0:t.in)||n,0);return r.setFullYear(s,0,i),r.setHours(0,0,0,0),Ue(r,t)}function Td(n,t){const e=rt(n,t==null?void 0:t.in),i=+Ue(e,t)-+v_(e,t);return Math.round(i/pd)+1}function vt(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 vt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):vt(e+1,2)},d(n,t){return vt(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 vt(n.getHours()%12||12,t.length)},H(n,t){return vt(n.getHours(),t.length)},m(n,t){return vt(n.getMinutes(),t.length)},s(n,t){return vt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return vt(s,t.length)}},yi={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Cd={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=xa(n,i),r=s>0?s:1-s;if(t==="YY"){const o=r%100;return vt(o,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):vt(r,t.length)},R:function(n,t){const e=yd(n);return vt(e,t.length)},u:function(n,t){const e=n.getFullYear();return vt(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 vt(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 vt(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 vt(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=Td(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):vt(s,t.length)},I:function(n,t,e){const i=Dd(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):vt(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=w_(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):vt(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 vt(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 vt(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 vt(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=yi.noon:i===0?s=yi.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=yi.evening:i>=12?s=yi.afternoon:i>=4?s=yi.morning:s=yi.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"}):vt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):vt(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 Pd(i);case"XXXX":case"XX":return Kn(i);case"XXXXX":case"XXX":default:return Kn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Pd(i);case"xxxx":case"xx":return Kn(i);case"xxxxx":case"xxx":default:return Kn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Od(i,":");case"OOOO":default:return"GMT"+Kn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Od(i,":");case"zzzz":default:return"GMT"+Kn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return vt(i,t.length)},T:function(n,t,e){return vt(+n,t.length)}};function Od(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+vt(r,2)}function Pd(n,t){return n%60===0?(n>0?"-":"+")+vt(Math.abs(n)/60,2):Kn(n,t)}function Kn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=vt(Math.trunc(i/60),2),r=vt(i%60,2);return e+s+t+r}const Ed=(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"})}},Ad=(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"})}},wa={p:Ad,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Ed(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}}",Ed(i,t)).replace("{{time}}",Ad(s,t))}},M_=/^D+$/,S_=/^Y+$/,k_=["D","DD","YY","YYYY"];function Rd(n){return M_.test(n)}function Ld(n){return S_.test(n)}function va(n,t,e){const i=D_(n,t,e);if(console.warn(i),k_.includes(n))throw new RangeError(i)}function D_(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 T_=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,C_=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,O_=/^'([^]*?)'?$/,P_=/''/g,E_=/[a-zA-Z]/;function Id(n,t,e){var u,d,h,g,p,b,w,v;const i=Xn(),s=(e==null?void 0:e.locale)??i.locale??kd,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=(h=i.locale)==null?void 0:h.options)==null?void 0:g.firstWeekContainsDate)??1,o=(e==null?void 0:e.weekStartsOn)??((b=(p=e==null?void 0:e.locale)==null?void 0:p.options)==null?void 0:b.weekStartsOn)??i.weekStartsOn??((v=(w=i.locale)==null?void 0:w.options)==null?void 0:v.weekStartsOn)??0,a=rt(n,e==null?void 0:e.in);if(!ya(a))throw new RangeError("Invalid time value");let l=t.match(C_).map(S=>{const D=S[0];if(D==="p"||D==="P"){const k=wa[D];return k(S,s.formatLong)}return S}).join("").match(T_).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const D=S[0];if(D==="'")return{isToken:!1,value:A_(S)};if(Cd[D])return{isToken:!0,value:S};if(D.match(E_))throw new RangeError("Format string contains an unescaped latin alphabet character `"+D+"`");return{isToken:!1,value:S}});s.localize.preprocessor&&(l=s.localize.preprocessor(a,l));const c={firstWeekContainsDate:r,weekStartsOn:o,locale:s};return l.map(S=>{if(!S.isToken)return S.value;const D=S.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&Ld(D)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&Rd(D))&&va(D,t,String(n));const k=Cd[D[0]];return k(a,D,s.localize,c)}).join("")}function A_(n){const t=n.match(O_);return t?t[1].replace(P_,"'"):n}function Nd(){return Object.assign({},Xn())}function R_(n,t){const e=rt(n,t==null?void 0:t.in).getDay();return e===0?7:e}function L_(n,t){const e=I_(t)?new t(0):Nt(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function I_(n){var t;return typeof n=="function"&&((t=n.prototype)==null?void 0:t.constructor)===n}const N_=10;class Fd{constructor(){P(this,"subPriority",0)}validate(t,e){return!0}}class F_ extends Fd{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 z_ extends Fd{constructor(e,i){super();P(this,"priority",N_);P(this,"subPriority",-1);this.context=e||(s=>Nt(i,s))}set(e,i){return i.timestampIsSet?e:Nt(e,L_(e,this.context))}}class mt{run(t,e,i,s){const r=this.parse(t,e,i,s);return r?{setter:new F_(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}validate(t,e,i){return!0}}class B_ extends mt{constructor(){super(...arguments);P(this,"priority",140);P(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 Ht={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}/},qe={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 Wt(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 Xe(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*pi+r*gs+o*y0),rest:t.slice(e[0].length)}}function zd(n){return Lt(Ht.anyDigitsSigned,n)}function Ft(n,t){switch(n){case 1:return Lt(Ht.singleDigit,t);case 2:return Lt(Ht.twoDigits,t);case 3:return Lt(Ht.threeDigits,t);case 4:return Lt(Ht.fourDigits,t);default:return Lt(new RegExp("^\\d{1,"+n+"}"),t)}}function Or(n,t){switch(n){case 1:return Lt(Ht.singleDigitSigned,t);case 2:return Lt(Ht.twoDigitsSigned,t);case 3:return Lt(Ht.threeDigitsSigned,t);case 4:return Lt(Ht.fourDigitsSigned,t);default:return Lt(new RegExp("^-?\\d{1,"+n+"}"),t)}}function Ma(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 Bd(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 Hd(n){return n%400===0||n%4===0&&n%100!==0}class H_ extends mt{constructor(){super(...arguments);P(this,"priority",130);P(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 Wt(Ft(4,e),r);case"yo":return Wt(s.ordinalNumber(e,{unit:"year"}),r);default:return Wt(Ft(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=Bd(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 W_ extends mt{constructor(){super(...arguments);P(this,"priority",130);P(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 Wt(Ft(4,e),r);case"Yo":return Wt(s.ordinalNumber(e,{unit:"year"}),r);default:return Wt(Ft(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s,r){const o=xa(e,r);if(s.isTwoDigitYear){const l=Bd(s.year,o);return e.setFullYear(l,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Ue(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),Ue(e,r)}}class Y_ extends mt{constructor(){super(...arguments);P(this,"priority",130);P(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=Nt(e,0);return r.setFullYear(s,0,4),r.setHours(0,0,0,0),mi(r)}}class j_ extends mt{constructor(){super(...arguments);P(this,"priority",130);P(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 V_ extends mt{constructor(){super(...arguments);P(this,"priority",120);P(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 Ft(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 $_ extends mt{constructor(){super(...arguments);P(this,"priority",120);P(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 Ft(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 U_ extends mt{constructor(){super(...arguments);P(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);P(this,"priority",110)}parse(e,i,s){const r=o=>o-1;switch(i){case"M":return Wt(Lt(Ht.month,e),r);case"MM":return Wt(Ft(2,e),r);case"Mo":return Wt(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 q_ extends mt{constructor(){super(...arguments);P(this,"priority",110);P(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 Wt(Lt(Ht.month,e),r);case"LL":return Wt(Ft(2,e),r);case"Lo":return Wt(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 X_(n,t,e){const i=rt(n,e==null?void 0:e.in),s=Td(i,e)-t;return i.setDate(i.getDate()-s*7),rt(i,e==null?void 0:e.in)}class G_ extends mt{constructor(){super(...arguments);P(this,"priority",100);P(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(Ht.week,e);case"wo":return s.ordinalNumber(e,{unit:"week"});default:return Ft(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s,r){return Ue(X_(e,s,r),r)}}function K_(n,t,e){const i=rt(n,e==null?void 0:e.in),s=Dd(i,e)-t;return i.setDate(i.getDate()-s*7),i}class Z_ extends mt{constructor(){super(...arguments);P(this,"priority",100);P(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(Ht.week,e);case"Io":return s.ordinalNumber(e,{unit:"week"});default:return Ft(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s){return mi(K_(e,s))}}const Q_=[31,28,31,30,31,30,31,31,30,31,30,31],J_=[31,29,31,30,31,30,31,31,30,31,30,31];class tx extends mt{constructor(){super(...arguments);P(this,"priority",90);P(this,"subPriority",1);P(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"d":return Lt(Ht.date,e);case"do":return s.ordinalNumber(e,{unit:"date"});default:return Ft(i.length,e)}}validate(e,i){const s=e.getFullYear(),r=Hd(s),o=e.getMonth();return r?i>=1&&i<=J_[o]:i>=1&&i<=Q_[o]}set(e,i,s){return e.setDate(s),e.setHours(0,0,0,0),e}}class ex extends mt{constructor(){super(...arguments);P(this,"priority",90);P(this,"subpriority",1);P(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(Ht.dayOfYear,e);case"Do":return s.ordinalNumber(e,{unit:"date"});default:return Ft(i.length,e)}}validate(e,i){const s=e.getFullYear();return Hd(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 Sa(n,t,e){var d,h,g,p;const i=Xn(),s=(e==null?void 0:e.weekStartsOn)??((h=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:h.weekStartsOn)??i.weekStartsOn??((p=(g=i.locale)==null?void 0:g.options)==null?void 0:p.weekStartsOn)??0,r=rt(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 Tr(r,u,e)}class nx extends mt{constructor(){super(...arguments);P(this,"priority",90);P(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=Sa(e,s,r),e.setHours(0,0,0,0),e}}class ix extends mt{constructor(){super(...arguments);P(this,"priority",90);P(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 Wt(Ft(i.length,e),o);case"eo":return Wt(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=Sa(e,s,r),e.setHours(0,0,0,0),e}}class sx extends mt{constructor(){super(...arguments);P(this,"priority",90);P(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 Wt(Ft(i.length,e),o);case"co":return Wt(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=Sa(e,s,r),e.setHours(0,0,0,0),e}}function rx(n,t,e){const i=rt(n,e==null?void 0:e.in),s=R_(i,e),r=t-s;return Tr(i,r,e)}class ox extends mt{constructor(){super(...arguments);P(this,"priority",90);P(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 Ft(i.length,e);case"io":return s.ordinalNumber(e,{unit:"day"});case"iii":return Wt(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 Wt(s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return Wt(s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiii":default:return Wt(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=rx(e,s),e.setHours(0,0,0,0),e}}class ax extends mt{constructor(){super(...arguments);P(this,"priority",80);P(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(Ma(s),0,0,0),e}}class lx extends mt{constructor(){super(...arguments);P(this,"priority",80);P(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(Ma(s),0,0,0),e}}class cx extends mt{constructor(){super(...arguments);P(this,"priority",80);P(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(Ma(s),0,0,0),e}}class ux extends mt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,i,s){switch(i){case"h":return Lt(Ht.hour12h,e);case"ho":return s.ordinalNumber(e,{unit:"hour"});default:return Ft(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 dx extends mt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,i,s){switch(i){case"H":return Lt(Ht.hour23h,e);case"Ho":return s.ordinalNumber(e,{unit:"hour"});default:return Ft(i.length,e)}}validate(e,i){return i>=0&&i<=23}set(e,i,s){return e.setHours(s,0,0,0),e}}class hx extends mt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,i,s){switch(i){case"K":return Lt(Ht.hour11h,e);case"Ko":return s.ordinalNumber(e,{unit:"hour"});default:return Ft(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 fx extends mt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,i,s){switch(i){case"k":return Lt(Ht.hour24h,e);case"ko":return s.ordinalNumber(e,{unit:"hour"});default:return Ft(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 gx extends mt{constructor(){super(...arguments);P(this,"priority",60);P(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"m":return Lt(Ht.minute,e);case"mo":return s.ordinalNumber(e,{unit:"minute"});default:return Ft(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setMinutes(s,0,0),e}}class px extends mt{constructor(){super(...arguments);P(this,"priority",50);P(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"s":return Lt(Ht.second,e);case"so":return s.ordinalNumber(e,{unit:"second"});default:return Ft(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setSeconds(s,0),e}}class mx extends mt{constructor(){super(...arguments);P(this,"priority",30);P(this,"incompatibleTokens",["t","T"])}parse(e,i){const s=r=>Math.trunc(r*Math.pow(10,-i.length+3));return Wt(Ft(i.length,e),s)}set(e,i,s){return e.setMilliseconds(s),e}}class yx extends mt{constructor(){super(...arguments);P(this,"priority",10);P(this,"incompatibleTokens",["t","T","x"])}parse(e,i){switch(i){case"X":return Xe(qe.basicOptionalMinutes,e);case"XX":return Xe(qe.basic,e);case"XXXX":return Xe(qe.basicOptionalSeconds,e);case"XXXXX":return Xe(qe.extendedOptionalSeconds,e);case"XXX":default:return Xe(qe.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Nt(e,e.getTime()-Cr(e)-s)}}class bx extends mt{constructor(){super(...arguments);P(this,"priority",10);P(this,"incompatibleTokens",["t","T","X"])}parse(e,i){switch(i){case"x":return Xe(qe.basicOptionalMinutes,e);case"xx":return Xe(qe.basic,e);case"xxxx":return Xe(qe.basicOptionalSeconds,e);case"xxxxx":return Xe(qe.extendedOptionalSeconds,e);case"xxx":default:return Xe(qe.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Nt(e,e.getTime()-Cr(e)-s)}}class _x extends mt{constructor(){super(...arguments);P(this,"priority",40);P(this,"incompatibleTokens","*")}parse(e){return zd(e)}set(e,i,s){return[Nt(e,s*1e3),{timestampIsSet:!0}]}}class xx extends mt{constructor(){super(...arguments);P(this,"priority",20);P(this,"incompatibleTokens","*")}parse(e){return zd(e)}set(e,i,s){return[Nt(e,s),{timestampIsSet:!0}]}}const wx={G:new B_,y:new H_,Y:new W_,R:new Y_,u:new j_,Q:new V_,q:new $_,M:new U_,L:new q_,w:new G_,I:new Z_,d:new tx,D:new ex,E:new nx,e:new ix,c:new sx,i:new ox,a:new ax,b:new lx,B:new cx,h:new ux,H:new dx,K:new hx,k:new fx,m:new gx,s:new px,S:new mx,X:new yx,x:new bx,t:new _x,T:new xx},vx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Mx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Sx=/^'([^]*?)'?$/,kx=/''/g,Dx=/\S/,Tx=/[a-zA-Z]/;function Cx(n,t,e,i){var w,v,S,D,k,C,R,E;const s=()=>Nt((i==null?void 0:i.in)||e,NaN),r=Nd(),o=(i==null?void 0:i.locale)??r.locale??kd,a=(i==null?void 0:i.firstWeekContainsDate)??((v=(w=i==null?void 0:i.locale)==null?void 0:w.options)==null?void 0:v.firstWeekContainsDate)??r.firstWeekContainsDate??((D=(S=r.locale)==null?void 0:S.options)==null?void 0:D.firstWeekContainsDate)??1,l=(i==null?void 0:i.weekStartsOn)??((C=(k=i==null?void 0:i.locale)==null?void 0:k.options)==null?void 0:C.weekStartsOn)??r.weekStartsOn??((E=(R=r.locale)==null?void 0:R.options)==null?void 0:E.weekStartsOn)??0;if(!t)return n?s():rt(e,i==null?void 0:i.in);const c={firstWeekContainsDate:a,weekStartsOn:l,locale:o},u=[new z_(i==null?void 0:i.in,e)],d=t.match(Mx).map(m=>{const _=m[0];if(_ in wa){const T=wa[_];return T(m,o.formatLong)}return m}).join("").match(vx),h=[];for(let m of d){!(i!=null&&i.useAdditionalWeekYearTokens)&&Ld(m)&&va(m,t,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&Rd(m)&&va(m,t,n);const _=m[0],T=wx[_];if(T){const{incompatibleTokens:A}=T;if(Array.isArray(A)){const N=h.find(B=>A.includes(B.token)||B.token===_);if(N)throw new RangeError(`The format string mustn't contain \`${N.fullToken}\` and \`${m}\` at the same time`)}else if(T.incompatibleTokens==="*"&&h.length>0)throw new RangeError(`The format string mustn't contain \`${m}\` and any other token at the same time`);h.push({token:_,fullToken:m});const L=T.run(n,m,o.match,c);if(!L)return s();u.push(L.setter),n=L.rest}else{if(_.match(Tx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");if(m==="''"?m="'":_==="'"&&(m=Ox(m)),n.indexOf(m)===0)n=n.slice(m.length);else return s()}}if(n.length>0&&Dx.test(n))return s();const g=u.map(m=>m.priority).sort((m,_)=>_-m).filter((m,_,T)=>T.indexOf(m)===_).map(m=>u.filter(_=>_.priority===m).sort((_,T)=>T.subPriority-_.subPriority)).map(m=>m[0]);let p=rt(e,i==null?void 0:i.in);if(isNaN(+p))return s();const b={};for(const m of g){if(!m.validate(p,c))return s();const _=m.set(p,b,c);Array.isArray(_)?(p=_[0],Object.assign(b,_[1])):p=_}return p}function Ox(n){return n.match(Sx)[1].replace(kx,"'")}function Px(n,t){const e=rt(n,t==null?void 0:t.in);return e.setMinutes(0,0,0),e}function Ex(n,t){const e=rt(n,t==null?void 0:t.in);return e.setSeconds(0,0),e}function Ax(n,t){const e=rt(n,t==null?void 0:t.in);return e.setMilliseconds(0),e}function Rx(n){const t=n/pi;return Math.trunc(t)}function Wd(n,t){const e=()=>Nt(t==null?void 0:t.in,NaN),i=(t==null?void 0:t.additionalDigits)??2,s=Fx(n);let r;if(s.date){const c=zx(s.date,i);r=Bx(c.restDateString,c.year)}if(!r||isNaN(+r))return e();const o=+r;let a=0,l;if(s.time&&(a=Hx(s.time),isNaN(a)))return e();if(s.timezone){if(l=Wx(s.timezone),isNaN(l))return e()}else{const c=new Date(o+a),u=rt(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 rt(o+a+l,t==null?void 0:t.in)}const Pr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Lx=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Ix=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Nx=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Fx(n){const t={},e=n.split(Pr.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],Pr.timeZoneDelimiter.test(t.date)&&(t.date=n.split(Pr.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const s=Pr.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function zx(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 Bx(n,t){if(t===null)return new Date(NaN);const e=n.match(Lx);if(!e)return new Date(NaN);const i=!!e[4],s=_s(e[1]),r=_s(e[2])-1,o=_s(e[3]),a=_s(e[4]),l=_s(e[5])-1;if(i)return Ux(t,a,l)?Yx(t,a,l):new Date(NaN);{const c=new Date(0);return!Vx(t,r,o)||!$x(t,s)?new Date(NaN):(c.setUTCFullYear(t,r,Math.max(s,o)),c)}}function _s(n){return n?parseInt(n):1}function Hx(n){const t=n.match(Ix);if(!t)return NaN;const e=ka(t[1]),i=ka(t[2]),s=ka(t[3]);return qx(e,i,s)?e*pi+i*gs+s*1e3:NaN}function ka(n){return n&&parseFloat(n.replace(",","."))||0}function Wx(n){if(n==="Z")return 0;const t=n.match(Nx);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return Xx(i,s)?e*(i*pi+s*gs):NaN}function Yx(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 jx=[31,null,31,30,31,30,31,31,30,31,30,31];function Yd(n){return n%400===0||n%4===0&&n%100!==0}function Vx(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(jx[t]||(Yd(n)?29:28))}function $x(n,t){return t>=1&&t<=(Yd(n)?366:365)}function Ux(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function qx(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function Xx(n,t){return t>=0&&t<=59}const Da=(n,t)=>{var s,r;const{tooltip:e}=t;if(e.opacity===0&&!n.locked){n.showTooltip=!1;return}const i=n.chartTooltipSortFn||((o,a)=>a.rawValue-o.rawValue);if(e.body&&!n.locked){const o=e.labelColors,a=((r=(s=t.chart.config)==null?void 0:s.options)==null?void 0:r.indexAxis)==="y"?"x":"y",l=["horizontal_bar","vertical_bar"].includes(n.chartType),c=["gauge","donut"].includes(n.chartType);n.tooltipContext=l?e.dataPoints.length>1?e.dataPoints[0].label:"":e.dataPoints[0].parsed.x,n.tooltipSeries=e.dataPoints.map((u,d)=>{const h=c?u.parsed:u.parsed[a];let g;if(n.units==="bytes")g=isNaN(h)?h:fa(h);else{const b=n.translateUnit(n.units,h);g=`${n.units==="usd"?"$":""}${h%1===0?Er.format(h):Er.format(Number(h.toFixed($d)))} ${b}`}let p;return l&&u.dataset.label!==u.label?p=u.dataset.label:c?p=u.dataset.labels[u.dataIndex]:p=u.dataset.label,{backgroundColor:o[d].backgroundColor,borderColor:o[d].borderColor,label:p,value:g,rawValue:h,isSegmentEmpty:u.dataset.isSegmentEmpty}}).sort(i),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},Gx=n=>n&&n.datasets&&n.datasets.length,Kx=n=>Gx(n)&&n.datasets.some(t=>t.data.length),Zx=n=>n.datasets.some(t=>t.data[0]&&ya(t.data[0].x)),Qx=n=>!!Kx(n)&&n.datasets.some(t=>t.data.length==1),Jx=n=>Zx(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)},tw=(n,t,e)=>n.y<e?n.y+t*.15:n.y-t*.5;function jd(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}const Vd=(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)},$d=2,Ud=10,qd=12,Er=new Intl.NumberFormat(((og=document==null?void 0:document.documentElement)==null?void 0:og.lang)||"en-US"),Ar=10,Xd={"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"}},on=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Rr=(n,t)=>(t||on)[n%on.length],Gd=(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}`},Kd="#6f7787",Zd={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"}},ew=n=>{var e;const t=Math.floor(parseInt(n,10)/100)*100;return((e=Zd[t])==null?void 0:e.background)||"#fafafa"},nw={SUCCESS:"#6FCC83",FAILURE:"#FF8484"},iw={"4XX":"#FFBA81","5XX":"#FF8484"},sw={LatencyP99:"#1356cb",LatencyP95:"#1fbecd",LatencyP50:"#1df97d"},rw="#dad4c7",Qd="#afb7c5",ow=n=>{const t=Object.entries(Xd).find(([e])=>new RegExp(e).test(n));return t&&t[1]||Xd.standard},Ca=(n,t,e,i)=>{let s;return e?s=Qd:Array.isArray(i)?s=Rr(n,i):s=i[t],s||Rr(n)},aw={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},lw=2,cw=0,Oa=new Map,Pa=(n,t)=>t==="bytes"?fa(n):t==="count/minute"?n.toFixed(2):Er.format(n),Jd=n=>{const e=document.createElement("canvas").getContext("2d"),i=At({});return e.font=i.string,e.measureText(n).width},uw=()=>{const n="label_height";if(!Oa.has(n)){const t=At({});Oa.set(n,t.lineHeight)}return Oa.get(n)},dw=n=>n.datasets.reduce((t,e)=>t+e.data.reduce((i,s)=>isNaN(s)?i:i+s,0),0),th=(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),eh=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,Ea="#e0e4ea",hw={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"]},xs=(n,t)=>{let e=1;const i=hw[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},nh=new Map([[100,xs("100",[100,101,102,103])],[200,xs("200",[200,201,202,203,204,205,206,207,208,226])],[300,xs("300",[300,301,302,303,304,305,307,308])],[400,xs("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,xs("500",[500,501,502,503,504,505,506,507,508,510,511])]]),Aa=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100,i=nh.get(e);return i===void 0?Ea:i.get(t)??i.get(-1)??Ea},fw=n=>{const t=Aa(n);return{solid:t,light:t}},Lr={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=Aa(`${t}`),n),{}),____OTHER____:"#DAD4C7","1XX":"#4DA6FF","2XX":"#6FCC83","3XX":"#FFD982","4XX":"#FFBA81","5XX":"#FF8484"};function ih(n,t,e){const i=Nd(),s=mw(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?gw(s,t):pw(s,t)}function gw(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 pw(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function mw(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function yw(n,t){const e=vw(t);return"formatToParts"in e?_w(e,n):xw(e,n)}const bw={year:0,month:1,day:2,hour:3,minute:4,second:5};function _w(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=bw[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 xw(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 Ra={},sh=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")),ww=sh==="06/25/2014, 00:00:00"||sh==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function vw(n){return Ra[n]||(Ra[n]=ww?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"})),Ra[n]}function rh(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 oh=36e5,Mw=6e4,La={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Ia(n,t,e){if(!n)return 0;let i=La.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=La.timezoneHH.exec(n),i)return s=parseInt(i[1],10),ah(s)?-(s*oh):NaN;if(i=La.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const o=parseInt(i[3],10);return ah(s,o)?(r=Math.abs(s)*oh+o*Mw,i[1]==="+"?-r:r):NaN}if(Dw(n)){t=new Date(t||Date.now());const o=e?t:Sw(t),a=Na(o,n);return-(e?a:kw(t,a,n))}return NaN}function Sw(n){return rh(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Na(n,t){const e=yw(n,t),i=rh(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 kw(n,t,e){let s=n.getTime()-t;const r=Na(new Date(s),e);if(t===r)return t;s-=r-t;const o=Na(new Date(s),e);return r===o?r:Math.max(r,o)}function ah(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const lh={};function Dw(n){if(lh[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),lh[n]=!0,!0}catch{return!1}}const Tw=60*1e3,Cw={X:function(n,t,e){const i=Fa(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return ch(i);case"XXXX":case"XX":return bi(i);case"XXXXX":case"XXX":default:return bi(i,":")}},x:function(n,t,e){const i=Fa(e.timeZone,n);switch(t){case"x":return ch(i);case"xxxx":case"xx":return bi(i);case"xxxxx":case"xxx":default:return bi(i,":")}},O:function(n,t,e){const i=Fa(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Ow(i,":");case"OOOO":default:return"GMT"+bi(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return ih("short",n,e);case"zzzz":default:return ih("long",n,e)}}};function Fa(n,t){const e=n?Ia(n,t,!0)/Tw:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Ir(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function bi(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Ir(Math.floor(i/60),2),r=Ir(Math.floor(i%60),2);return e+s+t+r}function ch(n,t){return n%60===0?(n>0?"-":"+")+Ir(Math.abs(n)/60,2):bi(n,t)}function Ow(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+Ir(r,2)}function uh(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 Pw=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,za=36e5,dh=6e4,Ew=2,le={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:Pw};function hh(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?Ew: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=Aw(n),{year:s,restDateString:r}=Rw(i.date,e),o=Lw(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=Iw(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Ia(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=uh(new Date(a+l)),c=uh(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function Aw(n){const t={};let e=le.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=le.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=le.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function Rw(n,t){if(n){const e=le.YYY[t],i=le.YYYYY[t];let s=le.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=le.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 Lw(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=le.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,ph(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=le.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=le.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const o=parseInt(r[2],10);return ph(t,i,o)?(e.setUTCFullYear(t,i,o),e):new Date(NaN)}if(r=le.Www.exec(n),r)return s=parseInt(r[1],10)-1,mh(s)?fh(t,s):new Date(NaN);if(r=le.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const o=parseInt(r[2],10)-1;return mh(s,o)?fh(t,s,o):new Date(NaN)}return null}function Iw(n){let t,e,i=le.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Ba(t)?t%24*za:NaN;if(i=le.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Ba(t,e)?t%24*za+e*dh:NaN;if(i=le.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Ba(t,e,s)?t%24*za+e*dh+s*1e3:NaN}return null}function fh(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 Nw=[31,28,31,30,31,30,31,31,30,31,30,31],Fw=[31,29,31,30,31,30,31,31,30,31,30,31];function gh(n){return n%400===0||n%4===0&&n%100!==0}function ph(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=gh(n);if(i&&e>Fw[t]||!i&&e>Nw[t])return!1}return!0}function zw(n,t){if(t<1)return!1;const e=gh(n);return!(e&&t>366||!e&&t>365)}function mh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Ba(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const Bw=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Ha(n,t,e={}){t=String(t);const i=t.match(Bw);if(i){const s=hh(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,"'"+Cw[o[0]](s,o,e)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return Id(n,t,e)}function Hw(n,t,e){n=hh(n,e);const i=Ia(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 Zn(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Ha(Hw(n,t,{timeZone:i.timeZone}),e,i)}const Ww=Intl.DateTimeFormat().resolvedOptions().timeZone,yh=(n,t,e,i=Ww)=>["secondly","tenSecondly","thirtySecondly"].includes(t)?Zn(n,i,e?"yyyy-MM-dd h:mm:ss a":"h:mm:ss a"):["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly"].includes(t)?Zn(n,i,e?"yyyy-MM-dd h:mm a":"h:mm a"):t==="twelveHourly"?Zn(n,i,"yyyy-MM-dd h:mm a"):t==="daily"?Zn(n,i,"yyyy-MM-dd"):t==="weekly"?`${Zn(n,i,"yyyy")} W${Zn(n,i,"II")}`:Zn(n,i,"yyyy-MM-dd h:mm:ss a");function Yw(n){const t={enabled:!1,position:"barChartTooltipPosition",callbacks:{label:o=>({label:o.dataset.label,value:o.label})}};Mr.positioners.barChartTooltipPosition=function(o,a){if(!o.length)return!1;const l=this.chart.canvas.getBoundingClientRect(),c=n.tooltipState.width||this.width,u=l.width/2,d=Ta(a,c,u),h=a.y,g=a.x<u?"left":"center";return{x:d-n.tooltipState.offsetX,y:h-n.tooltipState.offsetY,xAlign:g}},Go.modes.customInteractionMode=function(o,a){const l=wn(a,o),c=[];return Go.evaluateInteractionItems(o,o.options.indexAxis||"x",l,(u,d,h)=>{o.options.indexAxis==="y"&&u.inYRange(l.y,!0)&&o.data.datasets[d].data[h]&&c.push({element:u,datasetIndex:d,index:h}),o.options.indexAxis==="x"&&u.inXRange(l.x,!0)&&o.data.datasets[d].data[h]&&c.push({element:u,datasetIndex:d,index:h})}),c};const e=n.numLabels.value>25?Ud:qd,i=({chart:o,index:a})=>{var c;const l=o.data;return{size:e,style:(c=l==null?void 0:l.isLabelEmpty)!=null&&c[a]?"italic":"normal"}},s=(o,a,l)=>o.chart.options.indexAxis===o.axis?(a=o.getLabelForValue(l),a&&a.length>Ar?a.slice(0,Ar)+"...":a):o.getLabelForValue(Number(a));return f.computed(()=>{var o,a,l,c,u,d,h,g;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:i,callback:function(p,b){return s(this,p,b)}},title:{display:n.indexAxis==="y"?!st((o=n.metricAxesTitle)==null?void 0:o.value):!st((a=n.dimensionAxesTitle)==null?void 0:a.value),text:n.indexAxis==="y"?(l=n.metricAxesTitle)==null?void 0:l.value:(c=n.dimensionAxesTitle)==null?void 0:c.value,padding:{top:10},font:{weight:"bold"}}},y:{border:{display:!1},stacked:n.stacked.value,beginAtZero:!0,grid:{display:!1,drawBorder:!1},ticks:{font:i,callback:function(p,b){return s(this,p,b)}},title:{display:n.indexAxis==="x"?!st((u=n.metricAxesTitle)==null?void 0:u.value):!st((d=n.dimensionAxesTitle)==null?void 0:d.value),text:n.indexAxis==="x"?(h=n.metricAxesTitle)==null?void 0:h.value:(g=n.dimensionAxesTitle)==null?void 0:g.value,padding:{bottom:20},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:p=>{Da(n.tooltipState,p)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1}})}Pe.register(...d0);const jw=(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 Vw(n,t,e,i,s){const r=f.shallowRef(null),o=(a,l)=>{if(t.value)return new Pe(t.value,{type:n,data:a,plugins:i,options:l})};return f.onMounted(()=>{r.value=o(e.value,s.value)}),f.onBeforeUnmount(()=>{st(r.value)||r.value.destroy()}),f.watch(e,(a,l)=>{if(jw(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)}),f.watch(t,()=>{st(r.value)||r.value.destroy(),r.value=o(e.value,s.value)}),f.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 me=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Wa(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var bh={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:",",h=[],g=Math.round(c).toString().split("");return g.reverse().forEach(function(p,b){b&&b%3===0&&h.push(d),h.push(p)}),h.reverse().join("")}function e(c,u,d){var h=c/u,g=d.round?"round":"floor";return d.decimal===!1?(c=Math[g](h),c.toString()):(d.precision?c=h:c=h<10?Math[g](h*10)/10:Math[g](h),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 h=c<0;h&&(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",h&&(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})()})(bh);var $w=bh.exports;const ws=Wa($w);function Uw(n,t,e){const{i18n:i}=yt.useI18n(),{translateUnit:s}=yt.useTranslatedUnits();return{legendValues:f.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=isNaN(l)?"0":fa(l);else{const u=s(e.value,l);c=i&&i.t("legend.datapointValueDisplay",{value:ws(l,{capital:!0,...e.value==="usd"&&{prefix:"$"}}),unit:u})||`${ws(l,{capital:!0,...e.value==="usd"&&{prefix:"$"}})} ${e.value}`}return{...o,[a.label]:{raw:l,formatted:c,isThreshold:a.isThreshold}}},{}))}}var qw=Object.defineProperty,Xw=(n,t,e)=>t in n?qw(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Ee=(n,t,e)=>Xw(n,typeof t!="symbol"?t+"":t,e),ct=(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))(ct||{});const Gw=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],vs=n=>n.filter(t=>t!=="time"),_h=["api","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],Kw=vs(_h),Zw=[..._h,"application","consumer","country_code","iso_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","regional_consumer"],Qw=vs(Zw),Jw=["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"],t1=vs(Jw);vs(["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","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"]),vs(["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(Kw),new Set(Qw),new Set(t1);const xh=6048e5,e1=864e5,n1=60,i1=3600,wh=Symbol.for("constructDateFrom");function Ae(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&wh in n?n[wh](t):n instanceof Date?new n.constructor(t):new Date(t)}function ce(n,t){return Ae(t||n,n)}function vh(n,t,e){const i=ce(n,void 0);return isNaN(t)?Ae(n,NaN):(i.setDate(i.getDate()+t),i)}function s1(n,t,e){const i=ce(n,void 0);if(isNaN(t))return Ae(n,NaN);const s=i.getDate(),r=Ae(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 r1={};function Ms(){return r1}function an(n,t){var e,i,s,r;const o=Ms(),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=ce(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 Nr(n,t){return an(n,{...t,weekStartsOn:1})}function Mh(n,t){const e=ce(n,void 0),i=e.getFullYear(),s=Ae(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=Nr(s),o=Ae(e,0);o.setFullYear(i,0,4),o.setHours(0,0,0,0);const a=Nr(o);return e.getTime()>=r.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function Sh(n){const t=ce(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 o1(n,...t){const e=Ae.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Fr(n,t){const e=ce(n,void 0);return e.setHours(0,0,0,0),e}function a1(n,t,e){const[i,s]=o1(void 0,n,t),r=Fr(i),o=Fr(s),a=+r-Sh(r),l=+o-Sh(o);return Math.round((a-l)/e1)}function l1(n,t){const e=Mh(n),i=Ae(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Nr(i)}function c1(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function u1(n){return!(!c1(n)&&typeof n!="number"||isNaN(+ce(n)))}function _i(n,t){const e=ce(n,void 0);return e.setDate(1),e.setHours(0,0,0,0),e}function d1(n,t){const e=ce(n,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const h1={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"}},f1=(n,t,e)=>{let i;const s=h1[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 Ya(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const g1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},p1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},m1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},y1={date:Ya({formats:g1,defaultWidth:"full"}),time:Ya({formats:p1,defaultWidth:"full"}),dateTime:Ya({formats:m1,defaultWidth:"full"})},b1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},_1=(n,t,e,i)=>b1[n];function Ss(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 x1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},w1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},v1={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"]},M1={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"]},S1={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"}},k1={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"}},D1=(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"},T1={ordinalNumber:D1,era:Ss({values:x1,defaultWidth:"wide"}),quarter:Ss({values:w1,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Ss({values:v1,defaultWidth:"wide"}),day:Ss({values:M1,defaultWidth:"wide"}),dayPeriod:Ss({values:S1,defaultWidth:"wide",formattingValues:k1,defaultFormattingWidth:"wide"})};function ks(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)?O1(a,d=>d.test(o)):C1(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 C1(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function O1(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function P1(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 E1=/^(\d+)(th|st|nd|rd)?/i,A1=/\d+/i,R1={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},L1={any:[/^b/i,/^(a|c)/i]},I1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},N1={any:[/1/i,/2/i,/3/i,/4/i]},F1={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},z1={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]},B1={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},H1={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]},W1={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},Y1={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}},j1={ordinalNumber:P1({matchPattern:E1,parsePattern:A1,valueCallback:n=>parseInt(n,10)}),era:ks({matchPatterns:R1,defaultMatchWidth:"wide",parsePatterns:L1,defaultParseWidth:"any"}),quarter:ks({matchPatterns:I1,defaultMatchWidth:"wide",parsePatterns:N1,defaultParseWidth:"any",valueCallback:n=>n+1}),month:ks({matchPatterns:F1,defaultMatchWidth:"wide",parsePatterns:z1,defaultParseWidth:"any"}),day:ks({matchPatterns:B1,defaultMatchWidth:"wide",parsePatterns:H1,defaultParseWidth:"any"}),dayPeriod:ks({matchPatterns:W1,defaultMatchWidth:"any",parsePatterns:Y1,defaultParseWidth:"any"})},V1={code:"en-US",formatDistance:f1,formatLong:y1,formatRelative:_1,localize:T1,match:j1,options:{weekStartsOn:0,firstWeekContainsDate:1}};function $1(n,t){const e=ce(n,void 0);return a1(e,d1(e))+1}function U1(n,t){const e=ce(n,void 0),i=+Nr(e)-+l1(e);return Math.round(i/xh)+1}function kh(n,t){var e,i,s,r;const o=ce(n,t==null?void 0:t.in),a=o.getFullYear(),l=Ms(),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=Ae((t==null?void 0:t.in)||n,0);u.setFullYear(a+1,0,c),u.setHours(0,0,0,0);const d=an(u,t),h=Ae((t==null?void 0:t.in)||n,0);h.setFullYear(a,0,c),h.setHours(0,0,0,0);const g=an(h,t);return+o>=+d?a+1:+o>=+g?a:a-1}function q1(n,t){var e,i,s,r;const o=Ms(),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=kh(n,t),c=Ae((t==null?void 0:t.in)||n,0);return c.setFullYear(l,0,a),c.setHours(0,0,0,0),an(c,t)}function X1(n,t){const e=ce(n,t==null?void 0:t.in),i=+an(e,t)-+q1(e,t);return Math.round(i/xh)+1}function Mt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const kn={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Mt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Mt(e+1,2)},d(n,t){return Mt(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 Mt(n.getHours()%12||12,t.length)},H(n,t){return Mt(n.getHours(),t.length)},m(n,t){return Mt(n.getMinutes(),t.length)},s(n,t){return Mt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return Mt(s,t.length)}},xi={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Dh={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 kn.y(n,t)},Y:function(n,t,e,i){const s=kh(n,i),r=s>0?s:1-s;if(t==="YY"){const o=r%100;return Mt(o,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Mt(r,t.length)},R:function(n,t){const e=Mh(n);return Mt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Mt(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 Mt(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 Mt(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 kn.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 Mt(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=X1(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):Mt(s,t.length)},I:function(n,t,e){const i=U1(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Mt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):kn.d(n,t)},D:function(n,t,e){const i=$1(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Mt(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 Mt(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 Mt(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 Mt(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=xi.noon:i===0?s=xi.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=xi.evening:i>=12?s=xi.afternoon:i>=4?s=xi.morning:s=xi.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 kn.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):kn.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Mt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Mt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):kn.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):kn.s(n,t)},S:function(n,t){return kn.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Ch(i);case"XXXX":case"XX":return Qn(i);case"XXXXX":case"XXX":default:return Qn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Ch(i);case"xxxx":case"xx":return Qn(i);case"xxxxx":case"xxx":default:return Qn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Th(i,":");case"OOOO":default:return"GMT"+Qn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Th(i,":");case"zzzz":default:return"GMT"+Qn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Mt(i,t.length)},T:function(n,t,e){return Mt(+n,t.length)}};function Th(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+Mt(r,2)}function Ch(n,t){return n%60===0?(n>0?"-":"+")+Mt(Math.abs(n)/60,2):Qn(n,t)}function Qn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Mt(Math.trunc(i/60),2),r=Mt(i%60,2);return e+s+t+r}const Oh=(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"})}},Ph=(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"})}},G1=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Oh(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}}",Oh(i,t)).replace("{{time}}",Ph(s,t))},K1={p:Ph,P:G1},Z1=/^D+$/,Q1=/^Y+$/,J1=["D","DD","YY","YYYY"];function tv(n){return Z1.test(n)}function ev(n){return Q1.test(n)}function nv(n,t,e){const i=iv(n,t,e);if(console.warn(i),J1.includes(n))throw new RangeError(i)}function iv(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 sv=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,rv=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ov=/^'([^]*?)'?$/,av=/''/g,lv=/[a-zA-Z]/;function cv(n,t,e){var i,s,r,o,a,l,c,u;const d=Ms(),h=(e==null?void 0:e.locale)??d.locale??V1,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,b=ce(n,e==null?void 0:e.in);if(!u1(b))throw new RangeError("Invalid time value");let w=t.match(rv).map(S=>{const D=S[0];if(D==="p"||D==="P"){const k=K1[D];return k(S,h.formatLong)}return S}).join("").match(sv).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const D=S[0];if(D==="'")return{isToken:!1,value:uv(S)};if(Dh[D])return{isToken:!0,value:S};if(D.match(lv))throw new RangeError("Format string contains an unescaped latin alphabet character `"+D+"`");return{isToken:!1,value:S}});h.localize.preprocessor&&(w=h.localize.preprocessor(b,w));const v={firstWeekContainsDate:g,weekStartsOn:p,locale:h};return w.map(S=>{if(!S.isToken)return S.value;const D=S.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&ev(D)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&tv(D))&&nv(D,t,String(n));const k=Dh[D[0]];return k(b,D,h.localize,v)}).join("")}function uv(n){const t=n.match(ov);return t?t[1].replace(av,"'"):n}function dv(n,t){const e=ce(n,void 0),i=e.getFullYear(),s=e.getMonth(),r=Ae(e,0);return r.setFullYear(i,s+1,0),r.setHours(0,0,0,0),r.getDate()}function hv(){return Object.assign({},Ms())}function fv(n){return Math.trunc(n*i1)}function gv(n){const t=n/n1;return Math.trunc(t)}function Eh(n,t,e){return s1(n,-t)}function Ah(n,t,e){const i=hv(),s=yv(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?pv(s,t):mv(s,t)}function pv(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 mv(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function yv(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function bv(n,t){const e=Mv(t);return"formatToParts"in e?xv(e,n):wv(e,n)}const _v={year:0,month:1,day:2,hour:3,minute:4,second:5};function xv(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=_v[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 wv(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 ja={},Rh=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")),vv=Rh==="06/25/2014, 00:00:00"||Rh==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function Mv(n){return ja[n]||(ja[n]=vv?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"})),ja[n]}function Va(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 Lh=36e5,Sv=6e4,$a={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Ds(n,t,e){if(!n)return 0;let i=$a.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=$a.timezoneHH.exec(n),i)return s=parseInt(i[1],10),Ih(s)?-(s*Lh):NaN;if(i=$a.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const o=parseInt(i[3],10);return Ih(s,o)?(r=Math.abs(s)*Lh+o*Sv,i[1]==="+"?-r:r):NaN}if(Tv(n)){t=new Date(t||Date.now());const o=e?t:kv(t),a=Ua(o,n);return-(e?a:Dv(t,a,n))}return NaN}function kv(n){return Va(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Ua(n,t){const e=bv(n,t),i=Va(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 Dv(n,t,e){let i=n.getTime()-t;const s=Ua(new Date(i),e);if(t===s)return t;i-=s-t;const r=Ua(new Date(i),e);return s===r?s:Math.max(s,r)}function Ih(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const Nh={};function Tv(n){if(Nh[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Nh[n]=!0,!0}catch{return!1}}const Cv=60*1e3,Ov={X:function(n,t,e){const i=qa(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return Fh(i);case"XXXX":case"XX":return wi(i);case"XXXXX":case"XXX":default:return wi(i,":")}},x:function(n,t,e){const i=qa(e.timeZone,n);switch(t){case"x":return Fh(i);case"xxxx":case"xx":return wi(i);case"xxxxx":case"xxx":default:return wi(i,":")}},O:function(n,t,e){const i=qa(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Pv(i,":");case"OOOO":default:return"GMT"+wi(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return Ah("short",n,e);case"zzzz":default:return Ah("long",n,e)}}};function qa(n,t){const e=n?Ds(n,t,!0)/Cv:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function zr(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function wi(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=zr(Math.floor(i/60),2),r=zr(Math.floor(i%60),2);return e+s+t+r}function Fh(n,t){return n%60===0?(n>0?"-":"+")+zr(Math.abs(n)/60,2):wi(n,t)}function Pv(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+zr(r,2)}function zh(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 Bh=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Xa=36e5,Hh=6e4,Ev=2,ue={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:Bh};function Br(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?Ev: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=Av(n),{year:s,restDateString:r}=Rv(i.date,e),o=Lv(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=Iv(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Ds(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=zh(new Date(a+l)),c=zh(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function Av(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 Rv(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 Lv(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,jh(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 zv(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 jh(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,Vh(s)?Wh(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 Vh(s,o)?Wh(t,s,o):new Date(NaN)}return null}function Iv(n){let t,e,i=ue.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Ga(t)?t%24*Xa:NaN;if(i=ue.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Ga(t,e)?t%24*Xa+e*Hh: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 Ga(t,e,s)?t%24*Xa+e*Hh+s*1e3:NaN}return null}function Wh(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 Nv=[31,28,31,30,31,30,31,31,30,31,30,31],Fv=[31,29,31,30,31,30,31,31,30,31,30,31];function Yh(n){return n%400===0||n%4===0&&n%100!==0}function jh(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=Yh(n);if(i&&e>Fv[t]||!i&&e>Nv[t])return!1}return!0}function zv(n,t){if(t<1)return!1;const e=Yh(n);return!(e&&t>366||!e&&t>365)}function Vh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Ga(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const Bv=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Hv(n,t,e={}){t=String(t);const i=t.match(Bv);if(i){const s=Br(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,"'"+Ov[o[0]](s,o,e)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return cv(n,t,e)}function $h(n,t,e){n=Br(n,e);const i=Ds(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 Wv(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Hv($h(n,t,{timeZone:i.timeZone}),e,i)}function Yv(n,t,e){if(typeof n=="string"&&!n.match(Bh))return Br(n,{...e,timeZone:t});n=Br(n,e);const i=Va(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),s=Ds(t,new Date(i));return new Date(i+s)}function jv(n,t){return-Ds(n,t)}function Uh(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 Wv(s,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const Vv={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 Ka(n){return n&&Gw.find(t=>n<=Vv[t])||null}var Hr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Wr={exports:{}};Wr.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]",h="[object Map]",g="[object Number]",p="[object Object]",b="[object Promise]",w="[object RegExp]",v="[object Set]",S="[object String]",D="[object Symbol]",k="[object WeakMap]",C="[object ArrayBuffer]",R="[object DataView]",E="[object Float32Array]",m="[object Float64Array]",_="[object Int8Array]",T="[object Int16Array]",A="[object Int32Array]",L="[object Uint8Array]",N="[object Uint8ClampedArray]",B="[object Uint16Array]",G="[object Uint32Array]",U=/[\\^$.*+?()[\]{}|]/g,H=/\w*$/,ut=/^\[object .+?Constructor\]$/,Y=/^(?:0|[1-9]\d*)$/,et={};et[r]=et[o]=et[C]=et[R]=et[a]=et[l]=et[E]=et[m]=et[_]=et[T]=et[A]=et[h]=et[g]=et[p]=et[w]=et[v]=et[S]=et[D]=et[L]=et[N]=et[B]=et[G]=!0,et[c]=et[u]=et[k]=!1;var Dt=typeof Hr=="object"&&Hr&&Hr.Object===Object&&Hr,$=typeof self=="object"&&self&&self.Object===Object&&self,z=Dt||$||Function("return this")(),j=t&&!t.nodeType&&t,X=j&&!0&&n&&!n.nodeType&&n,Z=X&&X.exports===j;function tt(x,O){return x.set(O[0],O[1]),x}function q(x,O){return x.add(O),x}function V(x,O){for(var F=-1,K=x?x.length:0;++F<K&&O(x[F],F,x)!==!1;);return x}function ot(x,O){for(var F=-1,K=O.length,Vt=x.length;++F<K;)x[Vt+F]=O[F];return x}function J(x,O,F,K){for(var Vt=-1,Qt=x?x.length:0;++Vt<Qt;)F=O(F,x[Vt],Vt,x);return F}function Ct(x,O){for(var F=-1,K=Array(x);++F<x;)K[F]=O(F);return K}function pt(x,O){return x==null?void 0:x[O]}function Rt(x){var O=!1;if(x!=null&&typeof x.toString!="function")try{O=!!(x+"")}catch{}return O}function bt(x){var O=-1,F=Array(x.size);return x.forEach(function(K,Vt){F[++O]=[Vt,K]}),F}function ft(x,O){return function(F){return x(O(F))}}function $t(x){var O=-1,F=Array(x.size);return x.forEach(function(K){F[++O]=K}),F}var ie=Array.prototype,ye=Function.prototype,se=Object.prototype,Kt=z["__core-js_shared__"],St=function(){var x=/[^.]+$/.exec(Kt&&Kt.keys&&Kt.keys.IE_PROTO||"");return x?"Symbol(src)_1."+x:""}(),Tt=ye.toString,Zt=se.hasOwnProperty,gt=se.toString,Ge=RegExp("^"+Tt.call(Zt).replace(U,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),be=Z?z.Buffer:void 0,Re=z.Symbol,re=z.Uint8Array,_e=ft(Object.getPrototypeOf,Object),Te=Object.create,te=se.propertyIsEnumerable,oe=ie.splice,zt=Object.getOwnPropertySymbols,Ci=be?be.isBuffer:void 0,En=ft(Object.keys,Object),Oi=Ln(z,"DataView"),si=Ln(z,"Map"),Ls=Ln(z,"Promise"),Is=Ln(z,"Set"),ri=Ln(z,"WeakMap"),ze=Ln(Object,"create"),Ns=we(Oi),Fs=we(si),zs=we(Ls),oi=we(Is),bl=we(ri),Jr=Re?Re.prototype:void 0,to=Jr?Jr.valueOf:void 0;function un(x){var O=-1,F=x?x.length:0;for(this.clear();++O<F;){var K=x[O];this.set(K[0],K[1])}}function _l(){this.__data__=ze?ze(null):{}}function Pi(x){return this.has(x)&&delete this.__data__[x]}function Bs(x){var O=this.__data__;if(ze){var F=O[x];return F===i?void 0:F}return Zt.call(O,x)?O[x]:void 0}function eo(x){var O=this.__data__;return ze?O[x]!==void 0:Zt.call(O,x)}function dn(x,O){var F=this.__data__;return F[x]=ze&&O===void 0?i:O,this}un.prototype.clear=_l,un.prototype.delete=Pi,un.prototype.get=Bs,un.prototype.has=eo,un.prototype.set=dn;function Be(x){var O=-1,F=x?x.length:0;for(this.clear();++O<F;){var K=x[O];this.set(K[0],K[1])}}function xl(){this.__data__=[]}function wl(x){var O=this.__data__,F=xe(O,x);if(F<0)return!1;var K=O.length-1;return F==K?O.pop():oe.call(O,F,1),!0}function vl(x){var O=this.__data__,F=xe(O,x);return F<0?void 0:O[F][1]}function Ml(x){return xe(this.__data__,x)>-1}function He(x,O){var F=this.__data__,K=xe(F,x);return K<0?F.push([x,O]):F[K][1]=O,this}Be.prototype.clear=xl,Be.prototype.delete=wl,Be.prototype.get=vl,Be.prototype.has=Ml,Be.prototype.set=He;function An(x){var O=-1,F=x?x.length:0;for(this.clear();++O<F;){var K=x[O];this.set(K[0],K[1])}}function Sl(){this.__data__={hash:new un,map:new(si||Be),string:new un}}function kl(x){return Ri(this,x).delete(x)}function Dl(x){return Ri(this,x).get(x)}function Tl(x){return Ri(this,x).has(x)}function We(x,O){return Ri(this,x).set(x,O),this}An.prototype.clear=Sl,An.prototype.delete=kl,An.prototype.get=Dl,An.prototype.has=Tl,An.prototype.set=We;function Rn(x){this.__data__=new Be(x)}function Cl(){this.__data__=new Be}function Ol(x){return this.__data__.delete(x)}function Pl(x){return this.__data__.get(x)}function El(x){return this.__data__.has(x)}function Ei(x,O){var F=this.__data__;if(F instanceof Be){var K=F.__data__;if(!si||K.length<e-1)return K.push([x,O]),this;F=this.__data__=new An(K)}return F.set(x,O),this}Rn.prototype.clear=Cl,Rn.prototype.delete=Ol,Rn.prototype.get=Pl,Rn.prototype.has=El,Rn.prototype.set=Ei;function Al(x,O){var F=In(x)||uo(x)?Ct(x.length,String):[],K=F.length,Vt=!!K;for(var Qt in x)Zt.call(x,Qt)&&!(Vt&&(Qt=="length"||ql(Qt,K)))&&F.push(Qt);return F}function no(x,O,F){var K=x[O];(!(Zt.call(x,O)&&co(K,F))||F===void 0&&!(O in x))&&(x[O]=F)}function xe(x,O){for(var F=x.length;F--;)if(co(x[F][0],O))return F;return-1}function Rl(x,O){return x&&so(O,Ye(O),x)}function Hs(x,O,F,K,Vt,Qt,ve){var Ut;if(K&&(Ut=Qt?K(x,Vt,Qt,ve):K(x)),Ut!==void 0)return Ut;if(!Ii(x))return x;var Fi=In(x);if(Fi){if(Ut=oo(x),!O)return jl(x,Ut)}else{var Nn=hn(x),po=Nn==u||Nn==d;if(Kl(x))return zl(x,O);if(Nn==p||Nn==r||po&&!Qt){if(Rt(x))return Qt?x:{};if(Ut=Ul(po?{}:x),!O)return Vl(x,Rl(Ut,x))}else{if(!et[Nn])return Qt?x:{};Ut=ao(x,Nn,Hs,O)}}ve||(ve=new Rn);var mo=ve.get(x);if(mo)return mo;if(ve.set(x,Ut),!Fi)var yo=F?$l(x):Ye(x);return V(yo||x,function(Fn,zi){yo&&(zi=Fn,Fn=x[zi]),no(Ut,zi,Hs(Fn,O,F,K,zi,x,ve))}),Ut}function Ll(x){return Ii(x)?Te(x):{}}function Il(x,O,F){var K=O(x);return In(x)?K:ot(K,F(x))}function Nl(x){return gt.call(x)}function Fl(x){if(!Ii(x)||Li(x))return!1;var O=js(x)||Rt(x)?Ge:ut;return O.test(we(x))}function Ai(x){if(!lo(x))return En(x);var O=[];for(var F in Object(x))Zt.call(x,F)&&F!="constructor"&&O.push(F);return O}function zl(x,O){if(O)return x.slice();var F=new x.constructor(x.length);return x.copy(F),F}function Ws(x){var O=new x.constructor(x.byteLength);return new re(O).set(new re(x)),O}function io(x,O){var F=O?Ws(x.buffer):x.buffer;return new x.constructor(F,x.byteOffset,x.byteLength)}function Bl(x,O,F){var K=O?F(bt(x),!0):bt(x);return J(K,tt,new x.constructor)}function Hl(x){var O=new x.constructor(x.source,H.exec(x));return O.lastIndex=x.lastIndex,O}function Ys(x,O,F){var K=O?F($t(x),!0):$t(x);return J(K,q,new x.constructor)}function Wl(x){return to?Object(to.call(x)):{}}function Yl(x,O){var F=O?Ws(x.buffer):x.buffer;return new x.constructor(F,x.byteOffset,x.length)}function jl(x,O){var F=-1,K=x.length;for(O||(O=Array(K));++F<K;)O[F]=x[F];return O}function so(x,O,F,K){F||(F={});for(var Vt=-1,Qt=O.length;++Vt<Qt;){var ve=O[Vt],Ut=void 0;no(F,ve,Ut===void 0?x[ve]:Ut)}return F}function Vl(x,O){return so(x,ro(x),O)}function $l(x){return Il(x,Ye,ro)}function Ri(x,O){var F=x.__data__;return Xl(O)?F[typeof O=="string"?"string":"hash"]:F.map}function Ln(x,O){var F=pt(x,O);return Fl(F)?F:void 0}var ro=zt?ft(zt,Object):Vs,hn=Nl;(Oi&&hn(new Oi(new ArrayBuffer(1)))!=R||si&&hn(new si)!=h||Ls&&hn(Ls.resolve())!=b||Is&&hn(new Is)!=v||ri&&hn(new ri)!=k)&&(hn=function(x){var O=gt.call(x),F=O==p?x.constructor:void 0,K=F?we(F):void 0;if(K)switch(K){case Ns:return R;case Fs:return h;case zs:return b;case oi:return v;case bl:return k}return O});function oo(x){var O=x.length,F=x.constructor(O);return O&&typeof x[0]=="string"&&Zt.call(x,"index")&&(F.index=x.index,F.input=x.input),F}function Ul(x){return typeof x.constructor=="function"&&!lo(x)?Ll(_e(x)):{}}function ao(x,O,F,K){var Vt=x.constructor;switch(O){case C:return Ws(x);case a:case l:return new Vt(+x);case R:return io(x,K);case E:case m:case _:case T:case A:case L:case N:case B:case G:return Yl(x,K);case h:return Bl(x,K,F);case g:case S:return new Vt(x);case w:return Hl(x);case v:return Ys(x,K,F);case D:return Wl(x)}}function ql(x,O){return O=O??s,!!O&&(typeof x=="number"||Y.test(x))&&x>-1&&x%1==0&&x<O}function Xl(x){var O=typeof x;return O=="string"||O=="number"||O=="symbol"||O=="boolean"?x!=="__proto__":x===null}function Li(x){return!!St&&St in x}function lo(x){var O=x&&x.constructor,F=typeof O=="function"&&O.prototype||se;return x===F}function we(x){if(x!=null){try{return Tt.call(x)}catch{}try{return x+""}catch{}}return""}function Ke(x){return Hs(x,!0,!0)}function co(x,O){return x===O||x!==x&&O!==O}function uo(x){return Gl(x)&&Zt.call(x,"callee")&&(!te.call(x,"callee")||gt.call(x)==r)}var In=Array.isArray;function ho(x){return x!=null&&fo(x.length)&&!js(x)}function Gl(x){return Ni(x)&&ho(x)}var Kl=Ci||go;function js(x){var O=Ii(x)?gt.call(x):"";return O==u||O==d}function fo(x){return typeof x=="number"&&x>-1&&x%1==0&&x<=s}function Ii(x){var O=typeof x;return!!x&&(O=="object"||O=="function")}function Ni(x){return!!x&&typeof x=="object"}function Ye(x){return ho(x)?Al(x):Ai(x)}function Vs(){return[]}function go(){return!1}n.exports=Ke}(Wr,Wr.exports),Wr.exports;const vi=(n,t)=>new Date(n.getTime()-jv(t,n));class Fe{constructor(t){Ee(this,"timeframeText"),Ee(this,"key"),Ee(this,"display"),Ee(this,"timeframeLength"),Ee(this,"allowedTiers"),Ee(this,"defaultResponseGranularity"),Ee(this,"dataGranularity"),Ee(this,"isRelative"),Ee(this,"fineGrainedDefaultGranularity"),Ee(this,"_startCustom"),Ee(this,"_endCustom"),Ee(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=Yv(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return $h(e,t)}}class $v extends Fe{rawStart(t){let e=an(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=vi(e,t)),e}maximumTimeframeLength(){return 60*60*24*7}}class Uv extends Fe{rawStart(t){let e=_i(this.tzAdjustedDate(t));return t&&(e=vi(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class qv extends Fe{rawEnd(t){let e=an(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=vi(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=an(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=vi(i,t)),i}}class Xv extends Fe{rawEnd(t){let e=_i(this.tzAdjustedDate(t));return t&&(e=vi(e,t)),e}rawStart(t){let e=_i(Eh(this.tzAdjustedDate(t),1));return t&&(e=vi(e,t)),e}}ct.FIFTEEN_MIN,new Fe({key:ct.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"]}),ct.ONE_HOUR,new Fe({key:ct.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"]}),ct.SIX_HOUR,new Fe({key:ct.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"]}),ct.TWELVE_HOUR,new Fe({key:ct.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"]}),ct.ONE_DAY,new Fe({key:ct.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"]}),ct.SEVEN_DAY,new Fe({key:ct.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"]}),ct.THIRTY_DAY,new Fe({key:ct.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"]}),ct.CURRENT_WEEK,new $v({key:ct.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=an(new Date,{weekStartsOn:1});return(Fr(vh(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),ct.CURRENT_MONTH,new Uv({key:ct.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=_i(new Date);return(Fr(vh(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),ct.PREVIOUS_WEEK,new qv({key:ct.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"]}),ct.PREVIOUS_MONTH,new Xv({key:ct.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=_i(new Date),e=_i(Eh(new Date,1));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=Gv(t,e)),60*60*24*dv(new Date().setMonth(new Date().getMonth()-1))+fv(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function Gv(n,t){return gv(n.getTimezoneOffset()-t.getTimezoneOffset())}ct.FIFTEEN_MIN,ct.ONE_HOUR,ct.SIX_HOUR,ct.TWELVE_HOUR,ct.ONE_DAY,ct.SEVEN_DAY,ct.FIFTEEN_MIN,ct.ONE_HOUR,ct.SIX_HOUR,ct.TWELVE_HOUR,ct.ONE_DAY,ct.SEVEN_DAY,ct.THIRTY_DAY,ct.CURRENT_WEEK,ct.CURRENT_MONTH,ct.PREVIOUS_WEEK,ct.PREVIOUS_MONTH;function Kv(n){return f.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?`${Uh(e)} - ${Uh(i,{includeTZ:!0})}`:""})}function Zv(n){const t={enabled:!1,position:"donutChartTooltipPosition",callbacks:{label:i=>({label:i.dataset.label,value:i.label})}};return Mr.positioners.donutChartTooltipPosition=function(i,s){if(!i.length)return!1;const r=this.chart.canvas.getBoundingClientRect(),o=n.tooltipState.width||this.width,a=r.width/2,l=Ta(s,o,a),c=s.y,u=s.x<a?"left":"center";return{x:l-n.tooltipState.offsetX,y:c,xAlign:u}},{options:f.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:i=>{Da(n.tooltipState,i)}}}}))}}function Qv(n){const t=f.computed(()=>{var o,a;return{type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:10,autoSkipPadding:100,source:"auto",maxRotation:0,callback:l=>{const c=new Date(l);return yh(c,n.granularity.value,s.value)}},title:{display:!st((o=n.dimensionAxesTitle)==null?void 0:o.value),text:(a=n.dimensionAxesTitle)==null?void 0:a.value,padding:{top:2},font:{weight:"bold"}},border:{display:!1},stacked:n.stacked.value}}),e=f.computed(()=>{var o,a;return{title:{display:!st((o=n.metricAxesTitle)==null?void 0:o.value),text:(a=n.metricAxesTitle)==null?void 0:a.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}}),i={enabled:!1,position:"lineChartTooltipPosition"};Mr.positioners.lineChartTooltipPosition=function(o,a){if(!o.length||n.tooltipState.locked)return!1;const l=this.chart.canvas.getBoundingClientRect(),c=n.tooltipState.width||this.width,u=n.tooltipState.height||this.height,d=l.width/2,h=l.height/2,g=Ta(a,c,d);let p=tw(a,u,h);const b=a.y<h?"top":"bottom",w=a.x<d?"left":"center";return u>l.height&&(p=0),{x:g,y:p,xAlign:w,yAlign:b}};const s=f.computed(()=>{const o=Number(n.timeRangeMs.value),a=new Date,l=new Date(a.getTime()-o);return Rx(o)>24||l.getDate()!==a.getDate()});return{options:f.computed(()=>{var o;return{hover:{mode:"index",intersect:!1},elements:{point:{radius:(o=n.pointsWithoutHover)!=null&&o.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:{...i,external:a=>{Da(n.tooltipState,a)}}},interaction:{mode:"index",intersect:!1}}})}}function Jv(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:s,pivotRecords:r,rowLabels:o,colorPalette:a}=n,{i18n:l}=yt.useI18n();return t?i.map(u=>({label:l&&l.te(`chartLabels.${u}`)&&l.t(`chartLabels.${u}`)||u,backgroundColor:Rr(i.indexOf(u),on),data:o.map((d,h)=>e?r[`${d.id},${u}`]||0:r[`${h},${u}`]||null)})):Array.from(s).flatMap((u,d)=>{if(!u)return[];const h=Ca(d,u.name,u.id==="empty",a);return{label:l&&l.te(`chartLabels.${u.name}`)&&l.t(`chartLabels.${u.name}`)||u.name,backgroundColor:h,data:o.map(g=>r[`${g.id},${u.id}`]||null),isSegmentEmpty:u.id==="empty"}})}function tM(n,t){const{i18n:e}=yt.useI18n();return f.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;if(!s.length||!o)return{datasets:[],labels:[]};const u=c&&a||o,d=u[0],h=u.length>1?u[1]:u[0],g=Object.fromEntries(l?s.flatMap(m=>o.map((_,T)=>{const A=m.event[d],L=c?`${A},${_}`:`${T},${_}`,N=m.event[_];return[L,N]})):s.map(m=>{const _=c?`${m.event[d]},${m.event[h]}`:`${d},${h}`,T=m.event[o[0]];return[_,T]})),p=Object.keys(g).reduce((m,_)=>{const[T]=_.split(","),A=g[_];return m[T]?m[T]+=A:m[T]=A,m},{}),b=Object.entries(p).sort(([,m],[,_])=>Number(_)-Number(m)).map(([m])=>m),w=r[d],v=r[h],S=c&&w&&Object.entries(w).map(([m,_])=>({id:m,name:_.name}))||o.map(m=>({id:m,name:m})),D=c&&v&&Object.entries(v).map(([m,_])=>({id:m,name:_.name}))||o.map(m=>({id:m,name:m}));if(d!=="status_code"&&d!=="status_code_grouped"&&(S.sort((m,_)=>b.indexOf(m.id)-b.indexOf(_.id)),D.sort((m,_)=>b.indexOf(m.id)-b.indexOf(_.id))),!S||!D)return{labels:[],datasets:[]};const k=Jv({isMultiMetric:l,hasDimensions:c,metricNames:o,dimensionFieldNames:u,barSegmentLabels:D,pivotRecords:g,rowLabels:S,colorPalette:n.colorPalette||on}),C=c?S.map(m=>e&&e.te(`chartLabels.${m.name}`)&&e.t(`chartLabels.${m.name}`)||m.name):o.map(m=>e&&e.te(`chartLabels.${m}`)&&e.t(`chartLabels.${m}`)||m),R=S.map(m=>m.id==="empty");return{labels:C,datasets:k,isLabelEmpty:R}}}catch(s){return console.error(s),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const eM="#6c7489",nM="#6c7489",iM="#995c00",sM="20px",qh="24px",rM="40px",oM="48px",aM=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,s)=>i+s*e),lM=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return Wd(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},cM=(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 aM(a,l,e)};function uM(n,t){const{i18n:e}=yt.useI18n();return f.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],h=r&&d&&Object.keys(d).map(k=>({id:k,name:d[k].name}))||o.map(k=>({id:k,name:k})),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=lM(a),b=cM(a,l,g,p,s),w=new Set,v=s!=null&&s.length?s.reduce((k,C)=>{const R=new Date(C.timestamp).valueOf(),E=C.event;for(const m of o)w.add(m),R in k||(k[R]={}),m in k[R]||(k[R][m]={});for(const m of o)h.forEach(_=>{E[u]===_.id||m===_.id?(k[R][m]||(k[R][m]={}),k[R][m][_.name]=Math.round(Number(E[m])*1e3)/1e3):c.length||(k[R][m]||(k[R][m]={}),k[R][m][_.name]=Math.round(Number(E[_.id])*1e3)/1e3)});return k},{}):{},D=[...o.length===1?o.flatMap(k=>h.map(C=>[k,C.name,C.id==="empty"])):h.map(k=>[k.name,k.name,k.id==="empty"])].map(([k,C,R],E)=>{const m=b.map(L=>L in v&&k in v[L]?{x:L,y:v[L][k][C]||0}:{x:L,y:0});let{colorPalette:_,fill:T}=n;st(_)&&(_=on);const A=Ca(E,C,R,_);return{rawDimension:C,rawMetric:k,label:e&&e.te(`chartLabels.${C}`)&&e.t(`chartLabels.${C}`)||C,borderColor:A,backgroundColor:A,data:m,total:m.reduce((L,{y:N})=>L+Number(N),0),...aw,fill:T,borderWidth:T?cw:lw,isSegmentEmpty:R}});if(u==="status_code"||u==="status_code_grouped"?D.sort((k,C)=>(k.label??"")<(C.label??"")?-1:1):D.sort((k,C)=>Number(k.total)<Number(C.total)?-1:1),n.threshold)for(const k of Object.keys(n.threshold)){const C=n.threshold[k];C&&D.push({type:"line",rawMetric:k,isThreshold:!0,label:e.t("chartLabels.threshold"),borderColor:eM,borderWidth:1.25,borderDash:[12,8],fill:!1,order:-1,stack:"custom",data:b.map(R=>({x:R,y:C}))})}return{datasets:D}}}catch(s){return console.error(s),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const dM=(n,t)=>{f.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 hM(){const{i18n:n}=yt.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 fM="analytics-query-provider";function gM(){const n=f.inject(fM);return{evaluateFeatureFlag:(e,i)=>n?n.evaluateFeatureFlagFn(e,i):i}}const yt={useBarChartOptions:Yw,useChartJSCommon:Vw,useChartLegendValues:Uw,useChartSelectedRange:Kv,useExploreResultToDatasets:tM,useExploreResultToTimeDataset:uM,useDonutChartOptions:Zv,useLinechartOptions:Qv,useI18n:cg,useReportChartDataForSynthetics:dM,useTranslatedUnits:hM,useEvaluateFeatureFlag:gM};var It=(n=>(n.Hidden="hidden",n.Right="right",n.Bottom="bottom",n))(It||{});/*!
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 Xh={modes:{point(n,t){return Yr(n,t,{intersect:!0})},nearest(n,t,e){return yM(n,t,e)},x(n,t,e){return Yr(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return Yr(n,t,{intersect:e.intersect,axis:"y"})}}};function Za(n,t,e){return(Xh.modes[e.mode]||Xh.modes.nearest)(n,t,e)}function pM(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 mM(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function Yr(n,t,e){return n.filter(i=>e.intersect?i.inRange(t.x,t.y):pM(i,t,e.axis))}function yM(n,t,e){let i=Number.POSITIVE_INFINITY;return Yr(n,t,e).reduce((s,r)=>{const o=r.getCenterPoint(),a=mM(t,o,e.axis),l=ci(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 Jn(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 bM=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,ti=.001,jr=(n,t,e)=>Math.min(e,Math.max(t,n)),Gh=(n,t)=>n.value>=n.start-t&&n.value<=n.end+t;function _M(n,t,e){for(const i of Object.keys(n))n[i]=jr(n[i],t,e);return n}function xM(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 Kh(n,{x:t,y:e,x2:i,y2:s},r,{borderWidth:o,hitTolerance:a}){const l=(o+a)/2,c=n.x>=t-l-ti&&n.x<=i+l+ti,u=n.y>=e-l-ti&&n.y<=s+l+ti;return r==="x"?c:(r==="y"||c)&&u}function Zh(n,{rect:t,center:e},i,{rotation:s,borderWidth:r,hitTolerance:o}){const a=Jn(n,e,Yt(-s));return Kh(a,t,i,{borderWidth:r,hitTolerance:o})}function ei(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function wM(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(bM(a,o)){if(i)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const Qh=n=>typeof n=="string"&&n.endsWith("%"),Jh=n=>parseFloat(n)/100,tf=n=>jr(Jh(n),0,1),Ts=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),vM={box:n=>Ts(n.centerX,n.centerY),doughnutLabel:n=>Ts(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>Ts(n.centerX,n.centerY),line:n=>Ts(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>Ts(n.centerX,n.centerY)};function Qa(n,t){return t==="start"?0:t==="end"?n:Qh(t)?tf(t)*n:n/2}function Dn(n,t,e=!0){return typeof t=="number"?t:Qh(t)?(e?tf(t):Jh(t))*n:n}function MM(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 ef(n,t,{borderWidth:e,position:i,xAdjust:s,yAdjust:r},o){const a=lt(o),l=t.width+(a?o.width:0)+e,c=t.height+(a?o.height:0)+e,u=Ja(i),d=of(n.x,l,s,u.x),h=of(n.y,c,r,u.y);return{x:d,y:h,x2:d+l,y2:h+c,width:l,height:c,centerX:d+l/2,centerY:h+c/2}}function Ja(n,t="center"){return lt(n)?{x:it(n.x,t),y:it(n.y,t)}:(n=it(n,t),{x:n,y:n})}const nf=(n,t)=>n&&n.autoFit&&t<1;function sf(n,t){const e=n.font,i=_t(e)?e:[e];return nf(n,t)?i.map(function(s){const r=At(s);return r.size=Math.floor(s.size*t),r.lineHeight=s.lineHeight,At(r)}):i.map(s=>At(s))}function rf(n){return n&&(he(n.xValue)||he(n.yValue))}function of(n,t,e=0,i){return n-Qa(t,i)+e}function Mi(n,t,e){const i=e.init;if(i){if(i===!0)return lf(t,e)}else return;return SM(n,t,e)}function af(n,t,e){let i=!1;return t.forEach(s=>{fe(n[s])?(i=!0,e[s]=n[s]):he(e[s])&&delete e[s]}),i}function lf(n,t){const e=t.type||"line";return vM[e](n)}function SM(n,t,e){const i=xt(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return lf(t,e);if(lt(i))return i}const tl=new Map,kM=n=>isNaN(n)||n<=0,DM=n=>n.reduce(function(t,e){return t+=e.string,t},"");function Vr(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function $r(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate(Yt(i)),n.translate(-t,-e))}function ln(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 Si(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function Ur(n,t){const e=t.content;if(Vr(e))return{width:Dn(e.width,t.width),height:Dn(e.height,t.height)};const i=sf(t),s=t.textStrokeWidth,r=_t(e)?e:[e],o=r.join()+DM(i)+s+(n._measureText?"-spriting":"");return tl.has(o)||tl.set(o,PM(n,r,i,s)),tl.get(o)}function cf(n,t,e){const{x:i,y:s,width:r,height:o}=t;n.save(),Si(n,e);const a=ln(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),ui(n,{x:i,y:s,w:r,h:o,radius:_M(_n(e.borderRadius),0,Math.min(r,o)/2)}),n.closePath(),n.fill(),a&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function uf(n,t,e,i){const s=e.content;if(Vr(s)){n.save(),n.globalAlpha=RM(e.opacity,s.style.opacity),n.drawImage(s,t.x,t.y,t.width,t.height),n.restore();return}const r=_t(s)?s:[s],o=sf(e,i),a=e.color,l=_t(a)?a:[a],c=MM(t,e),u=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,TM(n,e)&&EM(n,{x:c,y:u},r,o),AM(n,{x:c,y:u},r,{fonts:o,colors:l}),n.restore()}function TM(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function CM(n,t,e,i){const{radius:s,options:r}=t,o=r.pointStyle,a=r.rotation;let l=(a||0)*Do;if(Vr(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}kM(s)||OM(n,{x:e,y:i,radius:s,rotation:a,style:o,rad:l})}function OM(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,kt),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(o)*i,e-Math.cos(o)*i),o+=Zs,n.lineTo(t+Math.sin(o)*i,e-Math.cos(o)*i),o+=Zs,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+Oe)*c,l=Math.sin(o+Oe)*c,n.arc(t-a,e-l,u,o-dt,o-Ot),n.arc(t+l,e-a,u,o-Ot,o),n.arc(t+a,e+l,u,o,o+Ot),n.arc(t-l,e+a,u,o+Ot,o+dt),n.closePath();break;case"rect":if(!s){c=Math.SQRT1_2*i,n.rect(t-c,e-c,2*c,2*c);break}o+=Oe;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+=Oe;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+=Oe,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 PM(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 EM(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 AM(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 RM(n,t){const e=bn(n)?n:t;return bn(e)?jr(e,0,1):1}const df=["left","bottom","top","right"];function LM(n,t){const{pointX:e,pointY:i,options:s}=t,r=s.callout,o=r&&r.display&&BM(t,r);if(!o||WM(t,r,o))return;if(n.save(),n.beginPath(),!ln(n,r))return n.restore();const{separatorStart:l,separatorEnd:c}=IM(t,o),{sideStart:u,sideEnd:d}=FM(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 h=Jn({x:e,y:i},t.getCenterPoint(),Yt(-t.rotation));n.lineTo(h.x,h.y),n.stroke(),n.restore()}function IM(n,t){const{x:e,y:i,x2:s,y2:r}=n,o=NM(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 NM(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 FM(n,t,e){const{y:i,width:s,height:r,options:o}=n,a=o.callout.start,l=zM(t,o.callout);let c,u;return t==="left"||t==="right"?(c={x:e.x,y:i+Dn(r,a)},u={x:c.x+l,y:c.y}):(c={x:e.x+Dn(s,a),y:e.y},u={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:u}}function zM(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function BM(n,t){const e=t.position;return df.includes(e)?e:HM(n,t)}function HM(n,t){const{x:e,y:i,x2:s,y2:r,width:o,height:a,pointX:l,pointY:c,centerX:u,centerY:d,rotation:h}=n,g={x:u,y:d},p=t.start,b=Dn(o,p),w=Dn(a,p),v=[e,e+b,e+b,s],S=[i+w,r,i,r],D=[];for(let k=0;k<4;k++){const C=Jn({x:v[k],y:S[k]},g,Yt(h));D.push({position:df[k],distance:ci(C,{x:l,y:c})})}return D.sort((k,C)=>k.distance-C.distance)[0].position}function WM(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 hf={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 ki(n,t,e){return t=typeof t=="number"?t:n.parse(t),Et(t)?n.getPixelForValue(t):e}function ni(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 ff(n,t){if(n){const e=n.options.reverse,i=ki(n,t.min,e?t.end:t.start),s=ki(n,t.max,e?t.start:t.end);return{start:i,end:s}}}function gf(n,t){const{chartArea:e,scales:i}=n,s=i[ni(i,t,"xScaleID")],r=i[ni(i,t,"yScaleID")];let o=e.width/2,a=e.height/2;return s&&(o=ki(s,t.xValue,s.left+s.width/2)),r&&(a=ki(r,t.yValue,r.top+r.height/2)),{x:o,y:a}}function el(n,t){const e=n.scales,i=e[ni(e,t,"xScaleID")],s=e[ni(e,t,"yScaleID")];if(!i&&!s)return{};let{left:r,right:o}=i||n.chartArea,{top:a,bottom:l}=s||n.chartArea;const c=yf(i,{min:t.xMin,max:t.xMax,start:r,end:o});r=c.start,o=c.end;const u=yf(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(!rf(t)){const e=el(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 jM(n,t)}function YM(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?VM(s,r,t):$M(e,r,t),r}function mf(n,t){const e=el(n,t);return e.initProperties=Mi(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:XM(n,e,t),initProperties:e.initProperties}],e}function jM(n,t){const e=gf(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 yf(n,t){const e=ff(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function VM(n,t,e){const i=ki(n,e.value,NaN),s=ki(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=s):(t.y=i,t.y2=s)}function $M(n,t,e){for(const i of Object.keys(hf)){const s=n[ni(n,e,i)];if(s){const{min:r,max:o,start:a,end:l,startProp:c,endProp:u}=hf[i],d=ff(s,{min:e[r],max:e[o],start:s[a],end:s[l]});t[c]=d.start,t[u]=d.end}}}function UM({properties:n,options:t},e,i,s){const{x:r,x2:o,width:a}=n;return bf({start:r,end:o,size:a,borderWidth:t.borderWidth},{position:i.x,padding:{start:s.left,end:s.right},adjust:t.label.xAdjust,size:e.width})}function qM({properties:n,options:t},e,i,s){const{y:r,y2:o,height:a}=n;return bf({start:r,end:o,size:a,borderWidth:t.borderWidth},{position:i.y,padding:{start:s.top,end:s.bottom},adjust:t.label.yAdjust,size:e.height})}function bf(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+Qa(c,r)}function XM(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const s=Ja(i.position),r=jt(i.padding),o=Ur(n.ctx,i),a=UM({properties:t,options:e},o,s,r),l=qM({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 nl=["enter","leave"],il=nl.concat("click");function GM(n,t,e){t.listened=af(e,il,t.listeners),t.moveListened=!1,nl.forEach(i=>{fe(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&fe(i.click)&&(t.listened=!0),t.moveListened||nl.forEach(s=>{fe(i[s])&&(t.listened=!0,t.moveListened=!0)})})}function KM(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return ZM(n,t,e);case"click":return QM(n,t,e)}}function ZM(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=Za(n.visibleElements,t,e.interaction):i=[];const s=n.hovered;n.hovered=i;const r={state:n,event:t};let o=_f(r,"leave",s,i);return _f(r,"enter",i,s)||o}function _f({state:n,event:t},e,i,s){let r;for(const o of i)s.indexOf(o)<0&&(r=xf(o.options[e]||n.listeners[e],o,t)||r);return r}function QM(n,t,e){const i=n.listeners,s=Za(n.visibleElements,t,e.interaction);let r;for(const o of s)r=xf(o.options.click||i.click,o,t)||r;return r}function xf(n,t,e){return xt(n,[t.$context,e])===!0}const qr=["afterDraw","beforeDraw"];function JM(n,t,e){const i=t.visibleElements;t.hooked=af(e,qr,t.hooks),t.hooked||i.forEach(s=>{t.hooked||qr.forEach(r=>{fe(s.options[r])&&(t.hooked=!0)})})}function wf(n,t,e){if(n.hooked){const i=t.options[e]||n.hooks[e];return xt(i,[t.$context])}}function tS(n,t,e){const i=rS(n.scales,t,e);let s=vf(t,i,"min","suggestedMin");s=vf(t,i,"max","suggestedMax")||s,s&&fe(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function eS(n,t){for(const e of n)iS(e,t)}function vf(n,t,e,i){if(Et(t[e])&&!nS(n.options,e,i)){const s=n[e]!==t[e];return n[e]=t[e],s}}function nS(n,t,e){return he(n[t])||he(n[e])}function iS(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=ni(t,n,e);i&&!t[i]&&sS(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function sS(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(he(n[e+i]))return!0;return!1}function rS(n,t,e){const i=t.axis,s=t.id,r=i+"ScaleID",o={min:it(t.min,Number.NEGATIVE_INFINITY),max:it(t.max,Number.POSITIVE_INFINITY)};for(const a of e)a.scaleID===s?Mf(a,t,["value","endValue"],o):ni(n,a,r)===s&&Mf(a,t,[i+"Min",i+"Max",i+"Value"],o);return o}function Mf(n,t,e,i){for(const s of e){const r=n[s];if(he(r)){const o=t.parse(r);i.min=Math.min(i.min,o),i.max=Math.max(i.max,o)}}}class Di extends Gt{inRange(t,e,i,s){const{x:r,y:o}=Jn({x:t,y:e},this.getCenterPoint(s),Yt(-this.options.rotation));return Kh({x:r,y:o},this.getProps(["x","y","x2","y2"],s),i,this.options)}getCenterPoint(t){return ei(this,t)}draw(t){t.save(),$r(t,this.getCenterPoint(),this.options.rotation),cf(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return mf(t,e)}}Di.id="boxAnnotation",Di.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},Di.defaultRoutes={borderColor:"color",backgroundColor:"color"},Di.descriptors={label:{_fallback:!0}};class Xr extends Gt{inRange(t,e,i,s){return Zh({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 ei(this,t)}draw(t){const e=this.options;!e.display||!e.content||(dS(t,this),t.save(),$r(t,this.getCenterPoint(),this.rotation),uf(t,this,e,this._fitRatio),t.restore())}resolveElementProperties(t,e){const i=oS(t,e);if(!i)return{};const{controllerMeta:s,point:r,radius:o}=lS(t,e,i);let a=Ur(t.ctx,e);const l=cS(a,o);nf(e,l)&&(a={width:a.width*l,height:a.height*l});const{position:c,xAdjust:u,yAdjust:d}=e,h=ef(r,a,{borderWidth:0,position:c,xAdjust:u,yAdjust:d});return{initProperties:Mi(t,h,e),...h,...s,rotation:e.rotation,_fitRatio:l}}}Xr.id="doughnutLabelAnnotation",Xr.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},Xr.defaultRoutes={};function oS(n,t){return n.getSortedVisibleDatasetMetas().reduce(function(e,i){const s=i.controller;return s instanceof sn&&aS(n,t,i.data)&&(!e||s.innerRadius<e.controller.innerRadius)&&s.options.circumference>=90?i:e},void 0)}function aS(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 lS({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,h={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:(h.left+h.right)/2,y:(h.top+h.bottom)/2},p=t.spacing+t.borderWidth/2,b=a-p,w=g.y>d,v=w?s+p:o-p,S=uS(v,u,d,b);return{controllerMeta:{_centerX:u,_centerY:d,_radius:b,_counterclockwise:w,...S},point:g,radius:Math.min(a,Math.min(h.right-h.left,h.bottom-h.top)/2)}}function cS({width:n,height:t},e){const i=Math.sqrt(Math.pow(n,2)+Math.pow(t,2));return e*2/i}function uS(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:kt};const c=(-o-Math.sqrt(l))/2,u=(-o+Math.sqrt(l))/2;return{_startAngle:Js({x:t,y:e},{x:c,y:n}).angle,_endAngle:Js({x:t,y:e},{x:u,y:n}).angle}}function dS(n,t){const{_centerX:e,_centerY:i,_radius:s,_startAngle:r,_endAngle:o,_counterclockwise:a,options:l}=t;n.save();const c=ln(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 Cs extends Gt{inRange(t,e,i,s){return Zh({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 ei(this,t)}draw(t){const e=this.options,i=!he(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),$r(t,this.getCenterPoint(),this.rotation),LM(t,this),cf(t,this,e),uf(t,hS(this),e),t.restore())}resolveElementProperties(t,e){let i;if(rf(e))i=gf(t,e);else{const{centerX:a,centerY:l}=el(t,e);i={x:a,y:l}}const s=jt(e.padding),r=Ur(t.ctx,e),o=ef(i,r,e,s);return{initProperties:Mi(t,o,e),pointX:i.x,pointY:i.y,...o,rotation:e.rotation}}}Cs.id="labelAnnotation",Cs.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},Cs.defaultRoutes={borderColor:"color"};function hS({x:n,y:t,width:e,height:i,options:s}){const r=s.borderWidth/2,o=jt(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 sl=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),rl=(n,t,e)=>sl(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,Sf=(n,t,e)=>sl(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,Os=n=>n*n,fS=(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},kf=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,ol=(n,t,e,i)=>({x:kf(n.x,t.x,e.x,i),y:kf(n.y,t.y,e.y,i)}),Df=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),Tf=(n,t,e,i)=>-Math.atan2(Df(n.x,t.x,e.x,i),Df(n.y,t.y,e.y,i))+.5*dt;class Ps extends Gt{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){ln(l,this.options),l.lineWidth+=this.options.hitTolerance;const{chart:u}=this.$context,d=t*u.currentDevicePixelRatio,h=e*u.currentDevicePixelRatio,g=l.isPointInStroke(a,d,h)||al(this,o,s);return l.restore(),g}const c=Os(r);return yS(this,o,c,s)||al(this,o,s)}return gS(this,{mouseX:t,mouseY:e},i,{hitSize:r,useFinalPosition:s})}getCenterPoint(t){return ei(this,t)}draw(t){const{x:e,y:i,x2:s,y2:r,cp:o,options:a}=this;if(t.save(),!ln(t,a))return t.restore();Si(t,a);const l=Math.sqrt(Math.pow(s-e,2)+Math.pow(r-i,2));if(a.curve&&o)return kS(t,this,o,l),t.restore();const{startOpts:c,endOpts:u,startAdjust:d,endAdjust:h}=Af(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-h,0),t.shadowColor=a.borderShadowColor,t.stroke(),ll(t,0,d,c),ll(t,l,-h,u),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=YM(t,e),{x:s,y:r,x2:o,y2:a}=i,l=pS(i,t.chartArea),c=l?mS({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=Mi(t,c,e),e.curve){const d={x:c.x,y:c.y},h={x:c.x2,y:c.y2};c.cp=SS(c,e,ci(d,h))}const u=bS(t,c,e.label);return u._visible=l,c.elements=[{type:"label",optionScope:"label",properties:u,initProperties:c.initProperties}],c}}Ps.id="lineAnnotation";const Cf={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};Ps.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},Cf),fill:!1,length:12,start:Object.assign({},Cf),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({},Cs.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},Ps.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},Ps.defaultRoutes={borderColor:"color"};function gS(n,{mouseX:t,mouseY:e},i,{hitSize:s,useFinalPosition:r}){const o=fS(t,e,n.getProps(["x","y","x2","y2"],r),i);return Gh(o,s)||al(n,{mouseX:t,mouseY:e},r,i)}function pS({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 Of({x:n,y:t},e,{top:i,right:s,bottom:r,left:o}){return n<o&&(t=Sf(o,{x:n,y:t},e),n=o),n>s&&(t=Sf(s,{x:n,y:t},e),n=s),t<i&&(n=rl(i,{x:n,y:t},e),t=i),t>r&&(n=rl(r,{x:n,y:t},e),t=r),{x:n,y:t}}function mS(n,t,e){const{x:i,y:s}=Of(n,t,e),{x:r,y:o}=Of(t,n,e);return{x:i,y:s,x2:r,y2:o,width:Math.abs(r-i),height:Math.abs(o-s)}}function yS(n,{mouseX:t,mouseY:e},i=ti,s){const{x:r,y:o,x2:a,y2:l}=n.getProps(["x","y","x2","y2"],s),c=a-r,u=l-o,d=Os(c)+Os(u),h=d===0?-1:((t-r)*c+(e-o)*u)/d;let g,p;return h<0?(g=r,p=o):h>1?(g=a,p=l):(g=r+h*c,p=o+h*u),Os(t-g)+Os(e-p)<=i}function al(n,{mouseX:t,mouseY:e},i,s){const r=n.label;return r.options.display&&r.inRange(t,e,s,i)}function bS(n,t,e){const i=e.borderWidth,s=jt(e.padding),r=Ur(n.ctx,e),o=r.width+s.width+i,a=r.height+s.height+i;return xS(t,e,{width:o,height:a,padding:s},n.chartArea)}function _S(n){const{x:t,y:e,x2:i,y2:s}=n,r=Math.atan2(s-e,i-t);return r>dt/2?r-dt:r<dt/-2?r+dt:r}function xS(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"?_S(n):Yt(t.rotation),h=wS(s,r,d),g=vS(n,t,{labelSize:h,padding:o},i),p=n.cp?ol(c,n.cp,u,g):sl(c,u,g),b={size:h.w,min:i.left,max:i.right,padding:o.left},w={size:h.h,min:i.top,max:i.bottom,padding:o.top},v=Ef(p.x,b)+a,S=Ef(p.y,w)+l;return{x:v-s/2,y:S-r/2,x2:v+s/2,y2:S+r/2,centerX:v,centerY:S,pointX:p.x,pointY:p.y,width:s,height:r,rotation:Qs(d)}}function wS(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 vS(n,t,e,i){let s;const r=MS(n,i);return t.position==="start"?s=Pf({w:n.x2-n.x,h:n.y2-n.y},e,t,r):t.position==="end"?s=1-Pf({w:n.x-n.x2,h:n.y-n.y2},e,t,r):s=Qa(1,t.position),s}function Pf(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 jr(Math.max(l,c),0,.25)}function MS(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 Ef(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 Af(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:Rf(n,e),endAdjust:Rf(n,i)}}function Rf(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(rl(0,r,{x:0,y:s}))}function ll(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(),Si(n,i),ln(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 SS(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=Ja(t.controlPoint,0),d={x:a+Dn(e,u.x,!1),y:l+Dn(e,u.y,!1)};return Jn(d,{x:a,y:l},c)}function Lf(n,{x:t,y:e},{angle:i,adjust:s},r){!r||!r.display||(n.save(),n.translate(t,e),n.rotate(i),ll(n,0,-s,r),n.restore())}function kS(n,t,e,i){const{x:s,y:r,x2:o,y2:a,options:l}=t,{startOpts:c,endOpts:u,startAdjust:d,endAdjust:h}=Af(t),g={x:s,y:r},p={x:o,y:a},b=Tf(g,e,p,0),w=Tf(g,e,p,1)-dt,v=ol(g,e,p,d/i),S=ol(g,e,p,1-h/i),D=new Path2D;n.beginPath(),D.moveTo(v.x,v.y),D.quadraticCurveTo(e.x,e.y,S.x,S.y),n.shadowColor=l.borderShadowColor,n.stroke(D),t.path=D,t.ctx=n,Lf(n,v,{angle:b,adjust:d},c),Lf(n,S,{angle:w,adjust:h},u)}class Es extends Gt{inRange(t,e,i,s){const r=this.options.rotation,o=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return DS({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},h=Jn({x:t,y:e},this.getCenterPoint(s),Yt(-r));return h[i]>=d.start-o-ti&&h[i]<=d.end+o+ti}getCenterPoint(t){return ei(this,t)}draw(t){const{width:e,height:i,centerX:s,centerY:r,options:o}=this;t.save(),$r(t,this.getCenterPoint(),o.rotation),Si(t,this.options),t.beginPath(),t.fillStyle=o.backgroundColor;const a=ln(t,o);t.ellipse(s,r,i/2,e/2,dt/2,0,2*dt),t.fill(),a&&(t.shadowColor=o.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return mf(t,e)}}Es.id="ellipseAnnotation",Es.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},Di.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},Es.defaultRoutes={borderColor:"color",backgroundColor:"color"},Es.descriptors={label:{_fallback:!0}};function DS(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=Yt(e||0),d=Math.cos(u),h=Math.sin(u),g=Math.pow(d*(n.x-o)+h*(n.y-a),2),p=Math.pow(h*(n.x-o)-d*(n.y-a),2);return g/Math.pow(l+i,2)+p/Math.pow(c+i,2)<=1.0001}class Gr extends Gt{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"?xM({x:t,y:e},this.getCenterPoint(s),c/2,u):Gh(i==="y"?{start:o,end:l,value:e}:{start:r,end:a,value:t},u)}getCenterPoint(t){return ei(this,t)}draw(t){const e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,Si(t,e);const s=ln(t,e);CM(t,this,this.centerX,this.centerY),s&&!Vr(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=pf(t,e);return i.initProperties=Mi(t,i,e),i}}Gr.id="pointAnnotation",Gr.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},Gr.defaultRoutes={borderColor:"color",backgroundColor:"color"};class Kr extends Gt{inRange(t,e,i,s){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&CS(this.elements,t,e,s);const r=Jn({x:t,y:e},this.getCenterPoint(s),Yt(-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 ei(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Si(t,i);const s=ln(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*dt/s;let l=r*Do;for(let c=0;c<s;c++,l+=a){const u=TS(i,e,l);u.initProperties=Mi(t,i,e),o.push(u)}return i.elements=o,i}}Kr.id="polygonAnnotation",Kr.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},Kr.defaultRoutes={borderColor:"color",backgroundColor:"color"};function TS({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 CS(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 Tn={box:Di,doughnutLabel:Xr,ellipse:Es,label:Cs,line:Ps,point:Gr,polygon:Kr};Object.keys(Tn).forEach(n=>{Pt.describe(`elements.${Tn[n].id}`,{_fallback:"plugins.annotation.common"})});const OS={update:Object.assign},PS=il.concat(qr),If=(n,t)=>lt(t)?dl(n,t):n,cl=n=>n==="color"||n==="font";function ul(n="line"){return Tn[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function ES(n,t,e,i){const s=RS(n,e.animations,i),r=t.annotations,o=NS(t.elements,r);for(let a=0;a<r.length;a++){const l=r[a],c=Nf(o,a,l.type),u=l.setContext(IS(n,c,o,l)),d=c.resolveElementProperties(n,u);d.skip=AS(d),"elements"in d&&(LS(c,d.elements,u,s),delete d.elements),he(c.x)||Object.assign(c,d),Object.assign(c,d.initProperties),d.options=Ff(u),s.update(c,d)}}function AS(n){return isNaN(n.x)||isNaN(n.y)}function RS(n,t,e){return e==="reset"||e==="none"||e==="resize"?OS:new Ho(n,t)}function LS(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=Nf(s,r,o.type,o.initProperties),c=e[o.optionScope].override(o);a.options=Ff(c),i.update(l,a)}}function Nf(n,t,e,i){const s=Tn[ul(e)];let r=n[t];return(!r||!(r instanceof s))&&(r=n[t]=new s,Object.assign(r,i)),r}function Ff(n){const t=Tn[ul(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,dl(n,t.defaults),dl(n,t.defaultRoutes));for(const i of PS)e[i]=n[i];return e}function dl(n,t){const e={};for(const i of Object.keys(t)){const s=t[i],r=n[i];cl(i)&&_t(r)?e[i]=r.map(o=>If(o,s)):e[i]=If(r,s)}return e}function IS(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 NS(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 FS="3.1.0";const Cn=new Map,zf=n=>n.type!=="doughnutLabel",zS=il.concat(qr);var Bf={id:"annotation",version:FS,beforeRegister(){wM("chart.js","4.0",Pe.version)},afterRegister(){Pe.register(Tn)},afterUnregister(){Pe.unregister(Tn)},beforeInit(n){Cn.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=Cn.get(n),s=i.annotations=[];let r=e.annotations;lt(r)?Object.keys(r).forEach(o=>{const a=r[o];lt(a)&&(a.id=o,s.push(a))}):_t(r)&&s.push(...r),eS(s.filter(zf),n.scales)},afterDataLimits(n,t){const e=Cn.get(n);tS(n,t.scale,e.annotations.filter(zf).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=Cn.get(n);GM(n,i,e),ES(n,i,e,t.mode),i.visibleElements=i.elements.filter(s=>!s.skip&&s.options.display),JM(n,i,e)},beforeDatasetsDraw(n,t,e){As(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){As(n,"afterDatasetsDraw",e.clip)},beforeDatasetDraw(n,t,e){As(n,t.index,e.clip)},beforeDraw(n,t,e){As(n,"beforeDraw",e.clip)},afterDraw(n,t,e){As(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const i=Cn.get(n);KM(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){Cn.delete(n)},getAnnotations(n){const t=Cn.get(n);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(n,t,e){return Za(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=>!zS.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${Tn[ul(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:cl,_fallback:!0},_indexable:cl}},additionalOptionScopes:[""]};function As(n,t,e){const{ctx:i,chartArea:s}=n,r=Cn.get(n);e&&Gi(i,s);const o=BS(r.visibleElements,t).sort((a,l)=>a.element.options.z-l.element.options.z);for(const a of o)HS(i,s,r,a);e&&Ki(i)}function BS(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 HS(n,t,e,i){const s=i.element;i.main?(wf(e,s,"beforeDraw"),s.draw(n,t),wf(e,s,"afterDraw")):s.draw(n,t)}const WS={class:"tooltip-title"},YS={class:"title font-bold"},jS={key:1,class:"subtitle"},VS={class:"tooltip"},$S={key:0},US={class:"display-value"},qS=f.defineComponent({__name:"ChartTooltip",props:{showTooltip:{type:Boolean,required:!0,default:!1},left:{type:String,required:!1,default:null},top:{type:String,required:!1,default:null},tooltipTitle:{type:String,required:!1,default:""},context:{type:[String,Number],required:!1,default:""},series:{type:Array,required:!0,default:()=>[]},locked:{type:Boolean,required:!1,default:!1}},emits:["dimensions","top","left"],setup(n,{emit:t}){const e=t,i=n,s=f.ref(null),r=f.ref(!1),o=f.ref({x:0,y:0}),a=f.ref({x:0,y:0}),l=f.ref({left:i.left,top:i.top});f.watch(s,g=>{if(g){const{width:p,height:b}=g.getBoundingClientRect();e("dimensions",{width:p,height:b})}}),f.watch(()=>i.locked,g=>{g?(l.value.left=i.left,l.value.top=i.top):g===!1&&(e("top",l.value.top),e("left",l.value.left))});function c(g){if(s.value){r.value=!0;const p=window.getComputedStyle(s.value),b=p.transform||p.webkitTransform||p.mozTransform,w=new DOMMatrix(b),v=w.m41,S=w.m42;o.value={x:v,y:S},a.value={x:g.clientX,y:g.clientY},window.addEventListener("mousemove",d),window.addEventListener("mouseup",h)}}let u=null;function d(g){g.preventDefault(),g.stopPropagation(),r.value&&(u!==null&&window.cancelAnimationFrame(u),u=window.requestAnimationFrame(()=>{const p=g.clientX-a.value.x,b=g.clientY-a.value.y;l.value.left=`${o.value.x+p}px`,l.value.top=`${o.value.y+b}px`}))}function h(){r.value=!1,u!==null&&window.cancelAnimationFrame(u),window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",h)}return(g,p)=>n.showTooltip?(f.openBlock(),f.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:s,class:f.normalizeClass(["tooltip-container",{locked:n.locked}]),style:f.normalizeStyle({transform:n.locked?`translate(${l.value.left}, ${l.value.top})`:`translate(${n.left}, ${n.top})`,left:"0",top:"0",pointerEvents:n.locked?"all":"none"}),onMousedown:c},[f.createElementVNode("div",WS,[f.createElementVNode("span",YS,f.toDisplayString(n.tooltipTitle),1),n.locked?(f.openBlock(),f.createBlock(f.unref(Zl.DragIcon),{key:0,class:"drag-icon",color:f.unref(nM)},null,8,["color"])):f.createCommentVNode("",!0),n.context?(f.openBlock(),f.createElementBlock("span",jS,f.toDisplayString(n.context),1)):f.createCommentVNode("",!0)]),f.createElementVNode("ul",VS,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.series,({backgroundColor:b,borderColor:w,label:v,value:S,isSegmentEmpty:D})=>(f.openBlock(),f.createElementBlock(f.Fragment,{key:v},[n.series.length?(f.openBlock(),f.createElementBlock("li",$S,[f.createElementVNode("div",{class:"square-marker",style:f.normalizeStyle({background:b,"border-color":w})},null,4),f.createElementVNode("span",{class:f.normalizeClass(["display-label",{empty:D}])},f.toDisplayString(v),3),f.createElementVNode("span",US,f.toDisplayString(S),1)])):f.createCommentVNode("",!0)],64))),128))])],38)):f.createCommentVNode("",!0)}}),cn=(n,t)=>{const e=n.__vccOpts||n;for(const[i,s]of t)e[i]=s;return e},hl=cn(qS,[["__scopeId","data-v-6d10428e"]]),XS=["onClick"],GS={key:0,class:"sub-label"},KS={class:"tooltip-content"},fl=cn(f.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){f.useCssVars(k=>({"05011806":l.value}));const t=n,{i18n:e}=yt.useI18n(),i=f.ref(),s=f.ref([]),r=f.inject("showLegendValues",!0),o=f.inject("legendPosition",f.ref(It.Right)),a=f.ref([]),l=f.ref(qh),c=()=>{const k=i.value;if(!k||!s.value||k.children.length===0)return 0;const C=k.children[0].getBoundingClientRect().top;for(const R of s.value)if(R.getBoundingClientRect().top>C)return!0;return!1},u=f.computed(()=>t.items.length>2||o.value===It.Right),d=()=>{i.value&&o.value===It.Bottom&&(c()?l.value=oM:l.value=qh)},h=()=>{if(i.value&&o.value===It.Bottom){let k=0;s.value.forEach(R=>{const E=Array.from(R.children).reduce((m,_)=>m+_.offsetWidth,0);E>k&&(k=E)});const C=parseInt(rM,10);i.value.style.gridTemplateColumns=`repeat(auto-fit, ${k+C}px)`}d()},g=()=>{if(t.items.length!==a.value.length)return a.value=t.items,!0;for(let k=0;k<t.items.length;k++)if(t.items[k].text!==a.value[k].text)return a.value=t.items,!0;return!1};f.watch(()=>t.items,()=>{g()&&h()},{immediate:!0,flush:"post"});const p=f.ref(0),b=f.ref(0),w=new ResizeObserver(jd(k=>{const C=k[0],R=C.contentRect.width,E=C.contentRect.height;R!==p.value&&E===b.value&&h(),p.value=R,b.value=E},100));f.watch(()=>o.value,()=>{h()}),f.onMounted(()=>{a.value=t.items,i.value&&w.observe(i.value),window.requestAnimationFrame(()=>{h()})}),f.onBeforeUnmount(()=>{i.value&&w.unobserve(i.value)});const v=(k=0,C)=>{if(t.chartInstance===null)return;const R=t.chartInstance instanceof Pe?t.chartInstance:t.chartInstance.chart;S(k,C)?R.hide(k,C):R.show(k,C),R.update()},S=(k=0,C)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const R=t.chartInstance instanceof Pe?t.chartInstance:t.chartInstance.chart,E=R.getDatasetMeta(k);return E.dataset||C===void 0?R.isDatasetVisible(k):!(E.data.length&&E.data[C].hidden)},D=k=>({[It.Right]:"vertical",[It.Bottom]:"horizontal",[It.Hidden]:"hidden"})[k];return(k,C)=>{const R=f.resolveComponent("KTooltip");return f.unref(o)!==f.unref(It).Hidden?(f.openBlock(),f.createElementBlock("ul",{key:0,ref_key:"legendContainerRef",ref:i,class:f.normalizeClass(["legend-container",D(f.unref(o))]),"data-testid":"legend"},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.items,({fillStyle:E,strokeStyle:m,text:_,datasetIndex:T,index:A,value:L,isSegmentEmpty:N})=>(f.openBlock(),f.createElementBlock("li",{key:_,ref_for:!0,ref_key:"legendItemsRef",ref:s,onClick:B=>v(T,A)},[f.createElementVNode("div",{class:"square-marker",style:f.normalizeStyle({background:E,"border-color":m})},null,4),f.createVNode(R,null,f.createSlots({default:f.withCtx(()=>[f.createElementVNode("div",{class:f.normalizeClass(["label-container",{"strike-through":!S(T,A)}])},[f.createElementVNode("div",{class:f.normalizeClass(["label",{"truncate-label":u.value,empty:N}])},f.toDisplayString(_),3),L&&f.unref(r)?(f.openBlock(),f.createElementBlock("div",GS,f.toDisplayString(L.formatted),1)):f.createCommentVNode("",!0)],2)]),_:2},[N?{name:"content",fn:f.withCtx(()=>[f.createElementVNode("div",KS,f.toDisplayString(f.unref(e).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],8,XS))),128))],2)):f.createCommentVNode("",!0)}}}),[["__scopeId","data-v-57146e87"]]);for(var Jt=[],gl=0;gl<256;++gl)Jt.push((gl+256).toString(16).slice(1));function ZS(n,t=0){return(Jt[n[t+0]]+Jt[n[t+1]]+Jt[n[t+2]]+Jt[n[t+3]]+"-"+Jt[n[t+4]]+Jt[n[t+5]]+"-"+Jt[n[t+6]]+Jt[n[t+7]]+"-"+Jt[n[t+8]]+Jt[n[t+9]]+"-"+Jt[n[t+10]]+Jt[n[t+11]]+Jt[n[t+12]]+Jt[n[t+13]]+Jt[n[t+14]]+Jt[n[t+15]]).toLowerCase()}var Zr,QS=new Uint8Array(16);function JS(){if(!Zr&&(Zr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Zr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Zr(QS)}var tk=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Hf={randomUUID:tk};function On(n,t,e){if(Hf.randomUUID&&!t&&!n)return Hf.randomUUID();n=n||{};var i=n.random||(n.rng||JS)();return i[6]=i[6]&15|64,i[8]=i[8]&63|128,ZS(i)}const Wf=(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()},Yf={id:"highlightPlugin",clicked:!1,afterDatasetsDraw:function(n){this.clickedElements&&this.clickedElements.length&&Wf(n,this.clickedElements)},afterEvent:function(n,{event:t}){var s;if(t.type!=="click"||!t.native)return;this.clicked=!this.clicked;const e=((s=n.options.interaction)==null?void 0:s.mode)||"index",i=n.getElementsAtEventForMode(t.native,e,{intersect:!1},!0);i.length&&this.clicked?(this.clickedElements=i,Wf(n,this.clickedElements),this.previousHoverOption=n.options.hover,n.options.hover={mode:null}):(delete this.clickedElements,n.options.hover=this.previousHoverOption||n.options.hover,this.clicked=!1)},beforeDestroy(n){delete this.clickedElements,n.options.hover=this.previousHoverOption||n.options.hover,this.clicked=!1}},ek={class:"axis-tooltip-content"},jf=6,nk="100%",ik="100%",sk=20,rk=20,Vf=6,ok=0,ak=10,lk=10,ck=1,uk=cn(f.defineComponent({__name:"StackedBarChart",props:{chartData:{type:Object,required:!1,default:()=>({labels:[],datasets:[]})},tooltipTitle:{type:String,required:!1,default:""},legendValues:{type:Object,required:!1,default:null},metricUnit:{type:String,required:!1,default:""},orientation:{type:String,required:!1,default:"horizontal",validator:n=>["horizontal","vertical"].includes(n)},annotations:{type:Boolean,required:!1,default:!0},metricAxesTitle:{type:String,required:!1,default:null},dimensionAxesTitle:{type:String,required:!1,default:null},stacked:{type:Boolean,required:!1,default:!0},syntheticsDataKey:{type:String,required:!1,default:""},chartLegendSortFn:{type:Function,required:!1,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,required:!1,default:(n,t)=>t.rawValue-n.rawValue}},setup(n){const t=n,{i18n:e}=yt.useI18n(),{translateUnit:i}=yt.useTranslatedUnits(),s=f.ref(null),r=({chart:z},j)=>{var tt;const X=z.data,Z=(tt=X.labels)==null?void 0:tt.indexOf(j);return X.datasets.reduce((q,V,ot)=>{if(z.isDatasetVisible(ot)){const J=V.data[Z];return isNaN(J)?q:q+J}else return q},0)},o=(z,j,X,Z)=>{const tt=Z==="horizontal";j===null&&(j=e.t("entityNoName"));const q={type:"label",yValue:J=>tt?j:r(J,j),xValue:J=>tt?r(J,j):j},V={...q,position:tt?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>tt?0:-Math.abs(uw()),content:J=>Pa(r(J,j),X)},ot={...q,content:J=>eh(r(J,j),th(J.chart,z)),position:tt?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:J=>tt?Jd(Pa(r(J,j),X)):0,color:Kd};return{[`${j}-value`]:V,[`${j}-percent`]:ot}},a=f.ref(null),l=f.ref(),c=f.ref(On()),u=On(),d=On(),h=f.ref([]),g=f.ref(f.inject("legendPosition",It.Right)),p=f.ref({show:!1,top:"0px",left:"0px",text:"",offset:-50}),b=f.toRef(t,"metricUnit"),w=f.computed(()=>f.toRef(t,"orientation").value==="horizontal"),v=f.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:b,translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,locked:!1,chartType:w.value?"horizontal_bar":"vertical_bar",chartTooltipSortFn:t.chartTooltipSortFn}),S=f.ref(0),D=()=>{var z;return t.annotations&&((z=t.chartData.labels)==null?void 0:z.reduce((j,X)=>Object.assign(j,o(t.chartData,X,b.value,t.orientation)),{}))},k={id:c.value,afterUpdate(z){S.value+=1,h.value=Vd(z,t.legendValues,t.chartLegendSortFn)}},C={id:u,afterUpdate(z){z.options.plugins.annotation.annotations=t.annotations?D():{}}},m=[k,{id:"axisHover",afterEvent(z,j){var X;if(p.value.show=!1,j.event.type==="mousemove"){const Z=j.event,tt=z.options.indexAxis,q=z.scales,V=z.scales[tt].getLabelForValue(Number(z.scales[tt].getValueForPixel(Z[tt]))),J=z.scales[tt].getLabels().indexOf(V),Ct=(X=t.chartData.isLabelEmpty)==null?void 0:X[J];if((Rt=>Rt==="x"?Z.y>q.x.top:Z.x<q.y.right)(tt)){v.locked||(v.showTooltip=!1);const bt=z.canvas.getContext("2d").measureText(V).width,ft=Math.abs(Math.round(Z.x-bt*.5)),$t=Math.round(Z.x+bt*.5);p.value.left=tt==="x"?`${(ft>0?ft:$t)-p.value.offset}px`:`${Z.x-bt*.5-p.value.offset}px`,p.value.top=`${Z.y-50}px`,V.length>Ar?(p.value.show=!0,p.value.text=V):Ct?(p.value.text=e.t("emptyEntityInfo"),p.value.show=!0):p.value.show=!1}else p.value.show=!1}}},{id:d,afterUpdate(z){z.options.layout.padding.right=w.value?H.value:0}},Yf,...t.annotations?[C]:[]],_=f.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),T=f.ref(0),A=f.ref(0),L=new ResizeObserver(jd(z=>{T.value=z[0].contentRect.width,A.value=z[0].contentRect.height},100)),N=f.computed(()=>{var j,X;const z=(X=(j=t.chartData)==null?void 0:j.labels)==null?void 0:X.length;return a.value&&z&&!w.value?`${Math.max(z*(sk+Vf),T.value)}px`:nk}),B=f.computed(()=>{var j,X;const z=(X=(j=t.chartData)==null?void 0:j.labels)==null?void 0:X.length;return a.value&&z&&w.value?`${Math.max(z*(rk+Vf),A.value)}px`:ik});yt.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey")),f.onMounted(()=>{t.annotations&&Pe.register(Bf),s.value&&(T.value=s.value.offsetWidth,A.value=s.value.offsetHeight,L.observe(s.value))}),f.onUnmounted(()=>{s.value&&L.unobserve(s.value)});const G=f.computed(()=>{const z=yt.useBarChartOptions({tooltipState:v,legendID:c.value,stacked:f.toRef(t,"stacked"),metricAxesTitle:f.toRef(t,"metricAxesTitle"),dimensionAxesTitle:f.toRef(t,"dimensionAxesTitle"),indexAxis:w.value?"y":"x",numLabels:_});return{...z.value,plugins:{...z.value.plugins,annotation:{annotations:D(),clip:!1}},layout:{autoPadding:!1,padding:{right:0,top:6*jf}}}}),U=yt.useChartJSCommon("bar",a,f.toRef(t,"chartData"),m,G),H=f.computed(()=>{S.value;const z=t.chartData.labels,j=t.chartData.datasets,X=z.map((q,V)=>j.reduce((ot,J)=>isNaN(Number(J.data[V]))?ot:ot+Number(J.data[V]),0)),Z=U.value?th(U.value,t.chartData):dw(t.chartData);return X.map(q=>Jd(Pa(q,b.value)+eh(q,Z))).reduce((q,V)=>Math.max(q,V),0)+jf});f.onBeforeUnmount(()=>{Pe.unregister(Bf)});const ut={[It.Right]:"legend-row",[It.Bottom]:"column"},Y=f.computed(()=>{if(l.value&&U.value){const z=window.devicePixelRatio,j=U.value,X=j.scales.y.width*z+ck,Z=(j.scales.y.height+j.scales.y.top+j.scales.x.height)*z,tt=l.value.getContext("2d");return tt.scale(z,z),tt.canvas.width=X,tt.canvas.height=Z,tt.canvas.style.width=`${X/z}px`,tt.canvas.style.height=`${Z/z}px`,{scale:z,width:X*z,height:Z*z,targetCtx:tt}}return null}),et=z=>{const j=z.target;if(Y.value&&U.value&&!w.value){const X=Y.value.scale,Z=Y.value.targetCtx,tt=Y.value.width,q=Y.value.height,V=U.value,ot=V.canvas;Z.fillStyle="white",j.scrollLeft>=ok&&j.scrollLeft<=ak?(Z.globalCompositeOperation="source-over",Z.clearRect(0,0,tt,q),Z.drawImage(ot,0,0,tt,q,0,0,tt,q),Z.globalCompositeOperation="destination-over",Z.fillRect(0,0,tt,q)):(Z.globalCompositeOperation="source-over",Z.fillRect(0,(V.scales.y.height+V.scales.y.top+lk)*X,tt,V.scales.x.height*X))}v.offsetY=j.scrollTop,v.offsetX=j.scrollLeft,p.value.offset=j.scrollLeft},Dt=({width:z,height:j})=>{v.width=z,v.height=j};f.watch(()=>t.orientation,()=>{var z;if(l.value&&Y.value){const j=Y.value.width,X=Y.value.height;((z=l.value)==null?void 0:z.getContext("2d")).clearRect(0,0,j,X)}v.showTooltip=!1,v.locked=!1}),f.watch(()=>t.annotations,z=>{U.value&&(z?U.value.options.plugins.annotation.annotations=D(t.chartData):delete U.value.options.plugins.annotation.annotations)});const $=()=>{v.showTooltip&&(v.locked=!v.locked)};return(z,j)=>(f.openBlock(),f.createElementBlock("div",{class:f.normalizeClass(["chart-parent",ut[g.value]])},[f.createElementVNode("canvas",{ref_key:"axis",ref:l,class:"axis"},null,512),f.createElementVNode("div",{ref_key:"chartContainerRef",ref:s,class:"chart-container","on:scroll":et,onClick:j[0]||(j[0]=X=>$())},[f.createElementVNode("div",{class:"chart-body",style:f.normalizeStyle({width:N.value,height:B.value})},[f.createElementVNode("canvas",{ref_key:"canvas",ref:a,class:"chart-canvas"},null,512)],4)],544),p.value.show?(f.openBlock(),f.createElementBlock("div",{key:0,class:"axis-tooltip",style:f.normalizeStyle({top:p.value.top,left:p.value.left}),width:"auto"},[f.createElementVNode("div",ek,f.toDisplayString(p.value.text),1)],4)):f.createCommentVNode("",!0),f.createVNode(hl,{context:v.tooltipContext,left:v.left,locked:v.locked,series:v.tooltipSeries,"show-tooltip":v.showTooltip,"tooltip-title":n.tooltipTitle,top:v.top,onDimensions:Dt},null,8,["context","left","locked","series","show-tooltip","tooltip-title","top"]),f.createVNode(fl,{id:c.value,"chart-instance":f.unref(U),items:h.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-e3a7d88f"]]);/*!
23
+ */const Xh={modes:{point(n,t){return Yr(n,t,{intersect:!0})},nearest(n,t,e){return yM(n,t,e)},x(n,t,e){return Yr(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return Yr(n,t,{intersect:e.intersect,axis:"y"})}}};function Za(n,t,e){return(Xh.modes[e.mode]||Xh.modes.nearest)(n,t,e)}function pM(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 mM(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function Yr(n,t,e){return n.filter(i=>e.intersect?i.inRange(t.x,t.y):pM(i,t,e.axis))}function yM(n,t,e){let i=Number.POSITIVE_INFINITY;return Yr(n,t,e).reduce((s,r)=>{const o=r.getCenterPoint(),a=mM(t,o,e.axis),l=ci(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 Jn(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 bM=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,ti=.001,jr=(n,t,e)=>Math.min(e,Math.max(t,n)),Gh=(n,t)=>n.value>=n.start-t&&n.value<=n.end+t;function _M(n,t,e){for(const i of Object.keys(n))n[i]=jr(n[i],t,e);return n}function xM(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 Kh(n,{x:t,y:e,x2:i,y2:s},r,{borderWidth:o,hitTolerance:a}){const l=(o+a)/2,c=n.x>=t-l-ti&&n.x<=i+l+ti,u=n.y>=e-l-ti&&n.y<=s+l+ti;return r==="x"?c:(r==="y"||c)&&u}function Zh(n,{rect:t,center:e},i,{rotation:s,borderWidth:r,hitTolerance:o}){const a=Jn(n,e,Yt(-s));return Kh(a,t,i,{borderWidth:r,hitTolerance:o})}function ei(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function wM(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(bM(a,o)){if(i)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const Qh=n=>typeof n=="string"&&n.endsWith("%"),Jh=n=>parseFloat(n)/100,tf=n=>jr(Jh(n),0,1),Ts=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),vM={box:n=>Ts(n.centerX,n.centerY),doughnutLabel:n=>Ts(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>Ts(n.centerX,n.centerY),line:n=>Ts(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>Ts(n.centerX,n.centerY)};function Qa(n,t){return t==="start"?0:t==="end"?n:Qh(t)?tf(t)*n:n/2}function Dn(n,t,e=!0){return typeof t=="number"?t:Qh(t)?(e?tf(t):Jh(t))*n:n}function MM(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 ef(n,t,{borderWidth:e,position:i,xAdjust:s,yAdjust:r},o){const a=lt(o),l=t.width+(a?o.width:0)+e,c=t.height+(a?o.height:0)+e,u=Ja(i),d=of(n.x,l,s,u.x),h=of(n.y,c,r,u.y);return{x:d,y:h,x2:d+l,y2:h+c,width:l,height:c,centerX:d+l/2,centerY:h+c/2}}function Ja(n,t="center"){return lt(n)?{x:it(n.x,t),y:it(n.y,t)}:(n=it(n,t),{x:n,y:n})}const nf=(n,t)=>n&&n.autoFit&&t<1;function sf(n,t){const e=n.font,i=_t(e)?e:[e];return nf(n,t)?i.map(function(s){const r=At(s);return r.size=Math.floor(s.size*t),r.lineHeight=s.lineHeight,At(r)}):i.map(s=>At(s))}function rf(n){return n&&(he(n.xValue)||he(n.yValue))}function of(n,t,e=0,i){return n-Qa(t,i)+e}function Mi(n,t,e){const i=e.init;if(i){if(i===!0)return lf(t,e)}else return;return SM(n,t,e)}function af(n,t,e){let i=!1;return t.forEach(s=>{fe(n[s])?(i=!0,e[s]=n[s]):he(e[s])&&delete e[s]}),i}function lf(n,t){const e=t.type||"line";return vM[e](n)}function SM(n,t,e){const i=xt(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return lf(t,e);if(lt(i))return i}const tl=new Map,kM=n=>isNaN(n)||n<=0,DM=n=>n.reduce(function(t,e){return t+=e.string,t},"");function Vr(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function $r(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate(Yt(i)),n.translate(-t,-e))}function ln(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 Si(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function Ur(n,t){const e=t.content;if(Vr(e))return{width:Dn(e.width,t.width),height:Dn(e.height,t.height)};const i=sf(t),s=t.textStrokeWidth,r=_t(e)?e:[e],o=r.join()+DM(i)+s+(n._measureText?"-spriting":"");return tl.has(o)||tl.set(o,PM(n,r,i,s)),tl.get(o)}function cf(n,t,e){const{x:i,y:s,width:r,height:o}=t;n.save(),Si(n,e);const a=ln(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),ui(n,{x:i,y:s,w:r,h:o,radius:_M(_n(e.borderRadius),0,Math.min(r,o)/2)}),n.closePath(),n.fill(),a&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function uf(n,t,e,i){const s=e.content;if(Vr(s)){n.save(),n.globalAlpha=RM(e.opacity,s.style.opacity),n.drawImage(s,t.x,t.y,t.width,t.height),n.restore();return}const r=_t(s)?s:[s],o=sf(e,i),a=e.color,l=_t(a)?a:[a],c=MM(t,e),u=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,TM(n,e)&&EM(n,{x:c,y:u},r,o),AM(n,{x:c,y:u},r,{fonts:o,colors:l}),n.restore()}function TM(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function CM(n,t,e,i){const{radius:s,options:r}=t,o=r.pointStyle,a=r.rotation;let l=(a||0)*Do;if(Vr(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}kM(s)||OM(n,{x:e,y:i,radius:s,rotation:a,style:o,rad:l})}function OM(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,kt),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(o)*i,e-Math.cos(o)*i),o+=Zs,n.lineTo(t+Math.sin(o)*i,e-Math.cos(o)*i),o+=Zs,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+Oe)*c,l=Math.sin(o+Oe)*c,n.arc(t-a,e-l,u,o-dt,o-Ot),n.arc(t+l,e-a,u,o-Ot,o),n.arc(t+a,e+l,u,o,o+Ot),n.arc(t-l,e+a,u,o+Ot,o+dt),n.closePath();break;case"rect":if(!s){c=Math.SQRT1_2*i,n.rect(t-c,e-c,2*c,2*c);break}o+=Oe;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+=Oe;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+=Oe,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 PM(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 EM(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 AM(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 RM(n,t){const e=bn(n)?n:t;return bn(e)?jr(e,0,1):1}const df=["left","bottom","top","right"];function LM(n,t){const{pointX:e,pointY:i,options:s}=t,r=s.callout,o=r&&r.display&&BM(t,r);if(!o||WM(t,r,o))return;if(n.save(),n.beginPath(),!ln(n,r))return n.restore();const{separatorStart:l,separatorEnd:c}=IM(t,o),{sideStart:u,sideEnd:d}=FM(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 h=Jn({x:e,y:i},t.getCenterPoint(),Yt(-t.rotation));n.lineTo(h.x,h.y),n.stroke(),n.restore()}function IM(n,t){const{x:e,y:i,x2:s,y2:r}=n,o=NM(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 NM(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 FM(n,t,e){const{y:i,width:s,height:r,options:o}=n,a=o.callout.start,l=zM(t,o.callout);let c,u;return t==="left"||t==="right"?(c={x:e.x,y:i+Dn(r,a)},u={x:c.x+l,y:c.y}):(c={x:e.x+Dn(s,a),y:e.y},u={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:u}}function zM(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function BM(n,t){const e=t.position;return df.includes(e)?e:HM(n,t)}function HM(n,t){const{x:e,y:i,x2:s,y2:r,width:o,height:a,pointX:l,pointY:c,centerX:u,centerY:d,rotation:h}=n,g={x:u,y:d},p=t.start,b=Dn(o,p),w=Dn(a,p),v=[e,e+b,e+b,s],S=[i+w,r,i,r],D=[];for(let k=0;k<4;k++){const C=Jn({x:v[k],y:S[k]},g,Yt(h));D.push({position:df[k],distance:ci(C,{x:l,y:c})})}return D.sort((k,C)=>k.distance-C.distance)[0].position}function WM(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 hf={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 ki(n,t,e){return t=typeof t=="number"?t:n.parse(t),Et(t)?n.getPixelForValue(t):e}function ni(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 ff(n,t){if(n){const e=n.options.reverse,i=ki(n,t.min,e?t.end:t.start),s=ki(n,t.max,e?t.start:t.end);return{start:i,end:s}}}function gf(n,t){const{chartArea:e,scales:i}=n,s=i[ni(i,t,"xScaleID")],r=i[ni(i,t,"yScaleID")];let o=e.width/2,a=e.height/2;return s&&(o=ki(s,t.xValue,s.left+s.width/2)),r&&(a=ki(r,t.yValue,r.top+r.height/2)),{x:o,y:a}}function el(n,t){const e=n.scales,i=e[ni(e,t,"xScaleID")],s=e[ni(e,t,"yScaleID")];if(!i&&!s)return{};let{left:r,right:o}=i||n.chartArea,{top:a,bottom:l}=s||n.chartArea;const c=yf(i,{min:t.xMin,max:t.xMax,start:r,end:o});r=c.start,o=c.end;const u=yf(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(!rf(t)){const e=el(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 jM(n,t)}function YM(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?VM(s,r,t):$M(e,r,t),r}function mf(n,t){const e=el(n,t);return e.initProperties=Mi(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:XM(n,e,t),initProperties:e.initProperties}],e}function jM(n,t){const e=gf(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 yf(n,t){const e=ff(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function VM(n,t,e){const i=ki(n,e.value,NaN),s=ki(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=s):(t.y=i,t.y2=s)}function $M(n,t,e){for(const i of Object.keys(hf)){const s=n[ni(n,e,i)];if(s){const{min:r,max:o,start:a,end:l,startProp:c,endProp:u}=hf[i],d=ff(s,{min:e[r],max:e[o],start:s[a],end:s[l]});t[c]=d.start,t[u]=d.end}}}function UM({properties:n,options:t},e,i,s){const{x:r,x2:o,width:a}=n;return bf({start:r,end:o,size:a,borderWidth:t.borderWidth},{position:i.x,padding:{start:s.left,end:s.right},adjust:t.label.xAdjust,size:e.width})}function qM({properties:n,options:t},e,i,s){const{y:r,y2:o,height:a}=n;return bf({start:r,end:o,size:a,borderWidth:t.borderWidth},{position:i.y,padding:{start:s.top,end:s.bottom},adjust:t.label.yAdjust,size:e.height})}function bf(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+Qa(c,r)}function XM(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const s=Ja(i.position),r=jt(i.padding),o=Ur(n.ctx,i),a=UM({properties:t,options:e},o,s,r),l=qM({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 nl=["enter","leave"],il=nl.concat("click");function GM(n,t,e){t.listened=af(e,il,t.listeners),t.moveListened=!1,nl.forEach(i=>{fe(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&fe(i.click)&&(t.listened=!0),t.moveListened||nl.forEach(s=>{fe(i[s])&&(t.listened=!0,t.moveListened=!0)})})}function KM(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return ZM(n,t,e);case"click":return QM(n,t,e)}}function ZM(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=Za(n.visibleElements,t,e.interaction):i=[];const s=n.hovered;n.hovered=i;const r={state:n,event:t};let o=_f(r,"leave",s,i);return _f(r,"enter",i,s)||o}function _f({state:n,event:t},e,i,s){let r;for(const o of i)s.indexOf(o)<0&&(r=xf(o.options[e]||n.listeners[e],o,t)||r);return r}function QM(n,t,e){const i=n.listeners,s=Za(n.visibleElements,t,e.interaction);let r;for(const o of s)r=xf(o.options.click||i.click,o,t)||r;return r}function xf(n,t,e){return xt(n,[t.$context,e])===!0}const qr=["afterDraw","beforeDraw"];function JM(n,t,e){const i=t.visibleElements;t.hooked=af(e,qr,t.hooks),t.hooked||i.forEach(s=>{t.hooked||qr.forEach(r=>{fe(s.options[r])&&(t.hooked=!0)})})}function wf(n,t,e){if(n.hooked){const i=t.options[e]||n.hooks[e];return xt(i,[t.$context])}}function tS(n,t,e){const i=rS(n.scales,t,e);let s=vf(t,i,"min","suggestedMin");s=vf(t,i,"max","suggestedMax")||s,s&&fe(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function eS(n,t){for(const e of n)iS(e,t)}function vf(n,t,e,i){if(Et(t[e])&&!nS(n.options,e,i)){const s=n[e]!==t[e];return n[e]=t[e],s}}function nS(n,t,e){return he(n[t])||he(n[e])}function iS(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=ni(t,n,e);i&&!t[i]&&sS(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function sS(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(he(n[e+i]))return!0;return!1}function rS(n,t,e){const i=t.axis,s=t.id,r=i+"ScaleID",o={min:it(t.min,Number.NEGATIVE_INFINITY),max:it(t.max,Number.POSITIVE_INFINITY)};for(const a of e)a.scaleID===s?Mf(a,t,["value","endValue"],o):ni(n,a,r)===s&&Mf(a,t,[i+"Min",i+"Max",i+"Value"],o);return o}function Mf(n,t,e,i){for(const s of e){const r=n[s];if(he(r)){const o=t.parse(r);i.min=Math.min(i.min,o),i.max=Math.max(i.max,o)}}}class Di extends Gt{inRange(t,e,i,s){const{x:r,y:o}=Jn({x:t,y:e},this.getCenterPoint(s),Yt(-this.options.rotation));return Kh({x:r,y:o},this.getProps(["x","y","x2","y2"],s),i,this.options)}getCenterPoint(t){return ei(this,t)}draw(t){t.save(),$r(t,this.getCenterPoint(),this.options.rotation),cf(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return mf(t,e)}}Di.id="boxAnnotation",Di.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},Di.defaultRoutes={borderColor:"color",backgroundColor:"color"},Di.descriptors={label:{_fallback:!0}};class Xr extends Gt{inRange(t,e,i,s){return Zh({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 ei(this,t)}draw(t){const e=this.options;!e.display||!e.content||(dS(t,this),t.save(),$r(t,this.getCenterPoint(),this.rotation),uf(t,this,e,this._fitRatio),t.restore())}resolveElementProperties(t,e){const i=oS(t,e);if(!i)return{};const{controllerMeta:s,point:r,radius:o}=lS(t,e,i);let a=Ur(t.ctx,e);const l=cS(a,o);nf(e,l)&&(a={width:a.width*l,height:a.height*l});const{position:c,xAdjust:u,yAdjust:d}=e,h=ef(r,a,{borderWidth:0,position:c,xAdjust:u,yAdjust:d});return{initProperties:Mi(t,h,e),...h,...s,rotation:e.rotation,_fitRatio:l}}}Xr.id="doughnutLabelAnnotation",Xr.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},Xr.defaultRoutes={};function oS(n,t){return n.getSortedVisibleDatasetMetas().reduce(function(e,i){const s=i.controller;return s instanceof sn&&aS(n,t,i.data)&&(!e||s.innerRadius<e.controller.innerRadius)&&s.options.circumference>=90?i:e},void 0)}function aS(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 lS({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,h={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:(h.left+h.right)/2,y:(h.top+h.bottom)/2},p=t.spacing+t.borderWidth/2,b=a-p,w=g.y>d,v=w?s+p:o-p,S=uS(v,u,d,b);return{controllerMeta:{_centerX:u,_centerY:d,_radius:b,_counterclockwise:w,...S},point:g,radius:Math.min(a,Math.min(h.right-h.left,h.bottom-h.top)/2)}}function cS({width:n,height:t},e){const i=Math.sqrt(Math.pow(n,2)+Math.pow(t,2));return e*2/i}function uS(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:kt};const c=(-o-Math.sqrt(l))/2,u=(-o+Math.sqrt(l))/2;return{_startAngle:Js({x:t,y:e},{x:c,y:n}).angle,_endAngle:Js({x:t,y:e},{x:u,y:n}).angle}}function dS(n,t){const{_centerX:e,_centerY:i,_radius:s,_startAngle:r,_endAngle:o,_counterclockwise:a,options:l}=t;n.save();const c=ln(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 Cs extends Gt{inRange(t,e,i,s){return Zh({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 ei(this,t)}draw(t){const e=this.options,i=!he(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),$r(t,this.getCenterPoint(),this.rotation),LM(t,this),cf(t,this,e),uf(t,hS(this),e),t.restore())}resolveElementProperties(t,e){let i;if(rf(e))i=gf(t,e);else{const{centerX:a,centerY:l}=el(t,e);i={x:a,y:l}}const s=jt(e.padding),r=Ur(t.ctx,e),o=ef(i,r,e,s);return{initProperties:Mi(t,o,e),pointX:i.x,pointY:i.y,...o,rotation:e.rotation}}}Cs.id="labelAnnotation",Cs.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},Cs.defaultRoutes={borderColor:"color"};function hS({x:n,y:t,width:e,height:i,options:s}){const r=s.borderWidth/2,o=jt(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 sl=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),rl=(n,t,e)=>sl(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,Sf=(n,t,e)=>sl(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,Os=n=>n*n,fS=(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},kf=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,ol=(n,t,e,i)=>({x:kf(n.x,t.x,e.x,i),y:kf(n.y,t.y,e.y,i)}),Df=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),Tf=(n,t,e,i)=>-Math.atan2(Df(n.x,t.x,e.x,i),Df(n.y,t.y,e.y,i))+.5*dt;class Ps extends Gt{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){ln(l,this.options),l.lineWidth+=this.options.hitTolerance;const{chart:u}=this.$context,d=t*u.currentDevicePixelRatio,h=e*u.currentDevicePixelRatio,g=l.isPointInStroke(a,d,h)||al(this,o,s);return l.restore(),g}const c=Os(r);return yS(this,o,c,s)||al(this,o,s)}return gS(this,{mouseX:t,mouseY:e},i,{hitSize:r,useFinalPosition:s})}getCenterPoint(t){return ei(this,t)}draw(t){const{x:e,y:i,x2:s,y2:r,cp:o,options:a}=this;if(t.save(),!ln(t,a))return t.restore();Si(t,a);const l=Math.sqrt(Math.pow(s-e,2)+Math.pow(r-i,2));if(a.curve&&o)return kS(t,this,o,l),t.restore();const{startOpts:c,endOpts:u,startAdjust:d,endAdjust:h}=Af(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-h,0),t.shadowColor=a.borderShadowColor,t.stroke(),ll(t,0,d,c),ll(t,l,-h,u),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=YM(t,e),{x:s,y:r,x2:o,y2:a}=i,l=pS(i,t.chartArea),c=l?mS({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=Mi(t,c,e),e.curve){const d={x:c.x,y:c.y},h={x:c.x2,y:c.y2};c.cp=SS(c,e,ci(d,h))}const u=bS(t,c,e.label);return u._visible=l,c.elements=[{type:"label",optionScope:"label",properties:u,initProperties:c.initProperties}],c}}Ps.id="lineAnnotation";const Cf={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};Ps.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},Cf),fill:!1,length:12,start:Object.assign({},Cf),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({},Cs.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},Ps.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},Ps.defaultRoutes={borderColor:"color"};function gS(n,{mouseX:t,mouseY:e},i,{hitSize:s,useFinalPosition:r}){const o=fS(t,e,n.getProps(["x","y","x2","y2"],r),i);return Gh(o,s)||al(n,{mouseX:t,mouseY:e},r,i)}function pS({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 Of({x:n,y:t},e,{top:i,right:s,bottom:r,left:o}){return n<o&&(t=Sf(o,{x:n,y:t},e),n=o),n>s&&(t=Sf(s,{x:n,y:t},e),n=s),t<i&&(n=rl(i,{x:n,y:t},e),t=i),t>r&&(n=rl(r,{x:n,y:t},e),t=r),{x:n,y:t}}function mS(n,t,e){const{x:i,y:s}=Of(n,t,e),{x:r,y:o}=Of(t,n,e);return{x:i,y:s,x2:r,y2:o,width:Math.abs(r-i),height:Math.abs(o-s)}}function yS(n,{mouseX:t,mouseY:e},i=ti,s){const{x:r,y:o,x2:a,y2:l}=n.getProps(["x","y","x2","y2"],s),c=a-r,u=l-o,d=Os(c)+Os(u),h=d===0?-1:((t-r)*c+(e-o)*u)/d;let g,p;return h<0?(g=r,p=o):h>1?(g=a,p=l):(g=r+h*c,p=o+h*u),Os(t-g)+Os(e-p)<=i}function al(n,{mouseX:t,mouseY:e},i,s){const r=n.label;return r.options.display&&r.inRange(t,e,s,i)}function bS(n,t,e){const i=e.borderWidth,s=jt(e.padding),r=Ur(n.ctx,e),o=r.width+s.width+i,a=r.height+s.height+i;return xS(t,e,{width:o,height:a,padding:s},n.chartArea)}function _S(n){const{x:t,y:e,x2:i,y2:s}=n,r=Math.atan2(s-e,i-t);return r>dt/2?r-dt:r<dt/-2?r+dt:r}function xS(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"?_S(n):Yt(t.rotation),h=wS(s,r,d),g=vS(n,t,{labelSize:h,padding:o},i),p=n.cp?ol(c,n.cp,u,g):sl(c,u,g),b={size:h.w,min:i.left,max:i.right,padding:o.left},w={size:h.h,min:i.top,max:i.bottom,padding:o.top},v=Ef(p.x,b)+a,S=Ef(p.y,w)+l;return{x:v-s/2,y:S-r/2,x2:v+s/2,y2:S+r/2,centerX:v,centerY:S,pointX:p.x,pointY:p.y,width:s,height:r,rotation:Qs(d)}}function wS(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 vS(n,t,e,i){let s;const r=MS(n,i);return t.position==="start"?s=Pf({w:n.x2-n.x,h:n.y2-n.y},e,t,r):t.position==="end"?s=1-Pf({w:n.x-n.x2,h:n.y-n.y2},e,t,r):s=Qa(1,t.position),s}function Pf(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 jr(Math.max(l,c),0,.25)}function MS(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 Ef(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 Af(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:Rf(n,e),endAdjust:Rf(n,i)}}function Rf(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(rl(0,r,{x:0,y:s}))}function ll(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(),Si(n,i),ln(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 SS(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=Ja(t.controlPoint,0),d={x:a+Dn(e,u.x,!1),y:l+Dn(e,u.y,!1)};return Jn(d,{x:a,y:l},c)}function Lf(n,{x:t,y:e},{angle:i,adjust:s},r){!r||!r.display||(n.save(),n.translate(t,e),n.rotate(i),ll(n,0,-s,r),n.restore())}function kS(n,t,e,i){const{x:s,y:r,x2:o,y2:a,options:l}=t,{startOpts:c,endOpts:u,startAdjust:d,endAdjust:h}=Af(t),g={x:s,y:r},p={x:o,y:a},b=Tf(g,e,p,0),w=Tf(g,e,p,1)-dt,v=ol(g,e,p,d/i),S=ol(g,e,p,1-h/i),D=new Path2D;n.beginPath(),D.moveTo(v.x,v.y),D.quadraticCurveTo(e.x,e.y,S.x,S.y),n.shadowColor=l.borderShadowColor,n.stroke(D),t.path=D,t.ctx=n,Lf(n,v,{angle:b,adjust:d},c),Lf(n,S,{angle:w,adjust:h},u)}class Es extends Gt{inRange(t,e,i,s){const r=this.options.rotation,o=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return DS({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},h=Jn({x:t,y:e},this.getCenterPoint(s),Yt(-r));return h[i]>=d.start-o-ti&&h[i]<=d.end+o+ti}getCenterPoint(t){return ei(this,t)}draw(t){const{width:e,height:i,centerX:s,centerY:r,options:o}=this;t.save(),$r(t,this.getCenterPoint(),o.rotation),Si(t,this.options),t.beginPath(),t.fillStyle=o.backgroundColor;const a=ln(t,o);t.ellipse(s,r,i/2,e/2,dt/2,0,2*dt),t.fill(),a&&(t.shadowColor=o.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return mf(t,e)}}Es.id="ellipseAnnotation",Es.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},Di.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},Es.defaultRoutes={borderColor:"color",backgroundColor:"color"},Es.descriptors={label:{_fallback:!0}};function DS(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=Yt(e||0),d=Math.cos(u),h=Math.sin(u),g=Math.pow(d*(n.x-o)+h*(n.y-a),2),p=Math.pow(h*(n.x-o)-d*(n.y-a),2);return g/Math.pow(l+i,2)+p/Math.pow(c+i,2)<=1.0001}class Gr extends Gt{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"?xM({x:t,y:e},this.getCenterPoint(s),c/2,u):Gh(i==="y"?{start:o,end:l,value:e}:{start:r,end:a,value:t},u)}getCenterPoint(t){return ei(this,t)}draw(t){const e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,Si(t,e);const s=ln(t,e);CM(t,this,this.centerX,this.centerY),s&&!Vr(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=pf(t,e);return i.initProperties=Mi(t,i,e),i}}Gr.id="pointAnnotation",Gr.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},Gr.defaultRoutes={borderColor:"color",backgroundColor:"color"};class Kr extends Gt{inRange(t,e,i,s){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&CS(this.elements,t,e,s);const r=Jn({x:t,y:e},this.getCenterPoint(s),Yt(-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 ei(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Si(t,i);const s=ln(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*dt/s;let l=r*Do;for(let c=0;c<s;c++,l+=a){const u=TS(i,e,l);u.initProperties=Mi(t,i,e),o.push(u)}return i.elements=o,i}}Kr.id="polygonAnnotation",Kr.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},Kr.defaultRoutes={borderColor:"color",backgroundColor:"color"};function TS({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 CS(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 Tn={box:Di,doughnutLabel:Xr,ellipse:Es,label:Cs,line:Ps,point:Gr,polygon:Kr};Object.keys(Tn).forEach(n=>{Pt.describe(`elements.${Tn[n].id}`,{_fallback:"plugins.annotation.common"})});const OS={update:Object.assign},PS=il.concat(qr),If=(n,t)=>lt(t)?dl(n,t):n,cl=n=>n==="color"||n==="font";function ul(n="line"){return Tn[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function ES(n,t,e,i){const s=RS(n,e.animations,i),r=t.annotations,o=NS(t.elements,r);for(let a=0;a<r.length;a++){const l=r[a],c=Nf(o,a,l.type),u=l.setContext(IS(n,c,o,l)),d=c.resolveElementProperties(n,u);d.skip=AS(d),"elements"in d&&(LS(c,d.elements,u,s),delete d.elements),he(c.x)||Object.assign(c,d),Object.assign(c,d.initProperties),d.options=Ff(u),s.update(c,d)}}function AS(n){return isNaN(n.x)||isNaN(n.y)}function RS(n,t,e){return e==="reset"||e==="none"||e==="resize"?OS:new Ho(n,t)}function LS(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=Nf(s,r,o.type,o.initProperties),c=e[o.optionScope].override(o);a.options=Ff(c),i.update(l,a)}}function Nf(n,t,e,i){const s=Tn[ul(e)];let r=n[t];return(!r||!(r instanceof s))&&(r=n[t]=new s,Object.assign(r,i)),r}function Ff(n){const t=Tn[ul(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,dl(n,t.defaults),dl(n,t.defaultRoutes));for(const i of PS)e[i]=n[i];return e}function dl(n,t){const e={};for(const i of Object.keys(t)){const s=t[i],r=n[i];cl(i)&&_t(r)?e[i]=r.map(o=>If(o,s)):e[i]=If(r,s)}return e}function IS(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 NS(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 FS="3.1.0";const Cn=new Map,zf=n=>n.type!=="doughnutLabel",zS=il.concat(qr);var Bf={id:"annotation",version:FS,beforeRegister(){wM("chart.js","4.0",Pe.version)},afterRegister(){Pe.register(Tn)},afterUnregister(){Pe.unregister(Tn)},beforeInit(n){Cn.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=Cn.get(n),s=i.annotations=[];let r=e.annotations;lt(r)?Object.keys(r).forEach(o=>{const a=r[o];lt(a)&&(a.id=o,s.push(a))}):_t(r)&&s.push(...r),eS(s.filter(zf),n.scales)},afterDataLimits(n,t){const e=Cn.get(n);tS(n,t.scale,e.annotations.filter(zf).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=Cn.get(n);GM(n,i,e),ES(n,i,e,t.mode),i.visibleElements=i.elements.filter(s=>!s.skip&&s.options.display),JM(n,i,e)},beforeDatasetsDraw(n,t,e){As(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){As(n,"afterDatasetsDraw",e.clip)},beforeDatasetDraw(n,t,e){As(n,t.index,e.clip)},beforeDraw(n,t,e){As(n,"beforeDraw",e.clip)},afterDraw(n,t,e){As(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const i=Cn.get(n);KM(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){Cn.delete(n)},getAnnotations(n){const t=Cn.get(n);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(n,t,e){return Za(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=>!zS.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${Tn[ul(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:cl,_fallback:!0},_indexable:cl}},additionalOptionScopes:[""]};function As(n,t,e){const{ctx:i,chartArea:s}=n,r=Cn.get(n);e&&Gi(i,s);const o=BS(r.visibleElements,t).sort((a,l)=>a.element.options.z-l.element.options.z);for(const a of o)HS(i,s,r,a);e&&Ki(i)}function BS(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 HS(n,t,e,i){const s=i.element;i.main?(wf(e,s,"beforeDraw"),s.draw(n,t),wf(e,s,"afterDraw")):s.draw(n,t)}const WS={class:"tooltip-title"},YS={class:"title font-bold"},jS={key:1,class:"subtitle"},VS={class:"tooltip"},$S={key:0},US={class:"display-value"},qS=f.defineComponent({__name:"ChartTooltip",props:{showTooltip:{type:Boolean,required:!0,default:!1},left:{type:String,required:!1,default:null},top:{type:String,required:!1,default:null},tooltipTitle:{type:String,required:!1,default:""},context:{type:[String,Number],required:!1,default:""},series:{type:Array,required:!0,default:()=>[]},locked:{type:Boolean,required:!1,default:!1}},emits:["dimensions","top","left"],setup(n,{emit:t}){const e=t,i=n,s=f.ref(null),r=f.ref(!1),o=f.ref({x:0,y:0}),a=f.ref({x:0,y:0}),l=f.ref({left:i.left,top:i.top});f.watch(s,g=>{if(g){const{width:p,height:b}=g.getBoundingClientRect();e("dimensions",{width:p,height:b})}}),f.watch(()=>i.locked,g=>{g?(l.value.left=i.left,l.value.top=i.top):g===!1&&(e("top",l.value.top),e("left",l.value.left))});function c(g){if(s.value){r.value=!0;const p=window.getComputedStyle(s.value),b=p.transform||p.webkitTransform||p.mozTransform,w=new DOMMatrix(b),v=w.m41,S=w.m42;o.value={x:v,y:S},a.value={x:g.clientX,y:g.clientY},window.addEventListener("mousemove",d),window.addEventListener("mouseup",h)}}let u=null;function d(g){g.preventDefault(),g.stopPropagation(),r.value&&(u!==null&&window.cancelAnimationFrame(u),u=window.requestAnimationFrame(()=>{const p=g.clientX-a.value.x,b=g.clientY-a.value.y;l.value.left=`${o.value.x+p}px`,l.value.top=`${o.value.y+b}px`}))}function h(){r.value=!1,u!==null&&window.cancelAnimationFrame(u),window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",h)}return(g,p)=>n.showTooltip?(f.openBlock(),f.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:s,class:f.normalizeClass(["tooltip-container",{locked:n.locked}]),style:f.normalizeStyle({transform:n.locked?`translate(${l.value.left}, ${l.value.top})`:`translate(${n.left}, ${n.top})`,left:"0",top:"0",pointerEvents:n.locked?"all":"none"}),onMousedown:c},[f.createElementVNode("div",WS,[f.createElementVNode("span",YS,f.toDisplayString(n.tooltipTitle),1),n.locked?(f.openBlock(),f.createBlock(f.unref(Zl.DragIcon),{key:0,class:"drag-icon",color:f.unref(nM)},null,8,["color"])):f.createCommentVNode("",!0),n.context?(f.openBlock(),f.createElementBlock("span",jS,f.toDisplayString(n.context),1)):f.createCommentVNode("",!0)]),f.createElementVNode("ul",VS,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.series,({backgroundColor:b,borderColor:w,label:v,value:S,isSegmentEmpty:D})=>(f.openBlock(),f.createElementBlock(f.Fragment,{key:v},[n.series.length?(f.openBlock(),f.createElementBlock("li",$S,[f.createElementVNode("div",{class:"square-marker",style:f.normalizeStyle({background:b,"border-color":w})},null,4),f.createElementVNode("span",{class:f.normalizeClass(["display-label",{empty:D}])},f.toDisplayString(v),3),f.createElementVNode("span",US,f.toDisplayString(S),1)])):f.createCommentVNode("",!0)],64))),128))])],38)):f.createCommentVNode("",!0)}}),cn=(n,t)=>{const e=n.__vccOpts||n;for(const[i,s]of t)e[i]=s;return e},hl=cn(qS,[["__scopeId","data-v-6d10428e"]]),XS=["onClick"],GS={key:0,class:"sub-label"},KS={class:"tooltip-content"},fl=cn(f.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){f.useCssVars(k=>({"024ed260":l.value}));const t=n,{i18n:e}=yt.useI18n(),i=f.ref(),s=f.ref([]),r=f.inject("showLegendValues",!0),o=f.inject("legendPosition",f.ref(It.Right)),a=f.ref([]),l=f.ref(qh),c=()=>{const k=i.value;if(!k||!s.value||k.children.length===0)return 0;const C=k.children[0].getBoundingClientRect().top;for(const R of s.value)if(R.getBoundingClientRect().top>C)return!0;return!1},u=f.computed(()=>t.items.length>2||o.value===It.Right),d=()=>{i.value&&o.value===It.Bottom&&(c()?l.value=oM:l.value=qh)},h=()=>{if(i.value&&o.value===It.Bottom){let k=0;s.value.forEach(R=>{const E=Array.from(R.children).reduce((m,_)=>m+_.offsetWidth,0);E>k&&(k=E)});const C=parseInt(rM,10);i.value.style.gridTemplateColumns=`repeat(auto-fit, ${k+C}px)`}d()},g=()=>{if(t.items.length!==a.value.length)return a.value=t.items,!0;for(let k=0;k<t.items.length;k++)if(t.items[k].text!==a.value[k].text)return a.value=t.items,!0;return!1};f.watch(()=>t.items,()=>{g()&&h()},{immediate:!0,flush:"post"});const p=f.ref(0),b=f.ref(0),w=new ResizeObserver(jd(k=>{const C=k[0],R=C.contentRect.width,E=C.contentRect.height;R!==p.value&&E===b.value&&h(),p.value=R,b.value=E},100));f.watch(()=>o.value,()=>{h()}),f.onMounted(()=>{a.value=t.items,i.value&&w.observe(i.value),window.requestAnimationFrame(()=>{h()})}),f.onBeforeUnmount(()=>{i.value&&w.unobserve(i.value)});const v=(k=0,C)=>{if(t.chartInstance===null)return;const R=t.chartInstance instanceof Pe?t.chartInstance:t.chartInstance.chart;S(k,C)?R.hide(k,C):R.show(k,C),R.update()},S=(k=0,C)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const R=t.chartInstance instanceof Pe?t.chartInstance:t.chartInstance.chart,E=R.getDatasetMeta(k);return E.dataset||C===void 0?R.isDatasetVisible(k):!(E.data.length&&E.data[C].hidden)},D=k=>({[It.Right]:"vertical",[It.Bottom]:"horizontal",[It.Hidden]:"hidden"})[k];return(k,C)=>{const R=f.resolveComponent("KTooltip");return f.unref(o)!==f.unref(It).Hidden?(f.openBlock(),f.createElementBlock("ul",{key:0,ref_key:"legendContainerRef",ref:i,class:f.normalizeClass(["legend-container",D(f.unref(o))]),"data-testid":"legend"},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.items,({fillStyle:E,strokeStyle:m,text:_,datasetIndex:T,index:A,value:L,isSegmentEmpty:N})=>(f.openBlock(),f.createElementBlock("li",{key:_,ref_for:!0,ref_key:"legendItemsRef",ref:s,onClick:B=>v(T,A)},[f.createElementVNode("div",{class:"square-marker",style:f.normalizeStyle({background:E,"border-color":m})},null,4),f.createVNode(R,null,f.createSlots({default:f.withCtx(()=>[f.createElementVNode("div",{class:f.normalizeClass(["label-container",{"strike-through":!S(T,A)}])},[f.createElementVNode("div",{class:f.normalizeClass(["label",{"truncate-label":u.value,empty:N}])},f.toDisplayString(_),3),L&&f.unref(r)?(f.openBlock(),f.createElementBlock("div",GS,f.toDisplayString(L.formatted),1)):f.createCommentVNode("",!0)],2)]),_:2},[N?{name:"content",fn:f.withCtx(()=>[f.createElementVNode("div",KS,f.toDisplayString(f.unref(e).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],8,XS))),128))],2)):f.createCommentVNode("",!0)}}}),[["__scopeId","data-v-14909126"]]);for(var Jt=[],gl=0;gl<256;++gl)Jt.push((gl+256).toString(16).slice(1));function ZS(n,t=0){return(Jt[n[t+0]]+Jt[n[t+1]]+Jt[n[t+2]]+Jt[n[t+3]]+"-"+Jt[n[t+4]]+Jt[n[t+5]]+"-"+Jt[n[t+6]]+Jt[n[t+7]]+"-"+Jt[n[t+8]]+Jt[n[t+9]]+"-"+Jt[n[t+10]]+Jt[n[t+11]]+Jt[n[t+12]]+Jt[n[t+13]]+Jt[n[t+14]]+Jt[n[t+15]]).toLowerCase()}var Zr,QS=new Uint8Array(16);function JS(){if(!Zr&&(Zr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Zr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Zr(QS)}var tk=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Hf={randomUUID:tk};function On(n,t,e){if(Hf.randomUUID&&!t&&!n)return Hf.randomUUID();n=n||{};var i=n.random||(n.rng||JS)();return i[6]=i[6]&15|64,i[8]=i[8]&63|128,ZS(i)}const Wf=(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()},Yf={id:"highlightPlugin",clicked:!1,afterDatasetsDraw:function(n){this.clickedElements&&this.clickedElements.length&&Wf(n,this.clickedElements)},afterEvent:function(n,{event:t}){var s;if(t.type!=="click"||!t.native)return;this.clicked=!this.clicked;const e=((s=n.options.interaction)==null?void 0:s.mode)||"index",i=n.getElementsAtEventForMode(t.native,e,{intersect:!1},!0);i.length&&this.clicked?(this.clickedElements=i,Wf(n,this.clickedElements),this.previousHoverOption=n.options.hover,n.options.hover={mode:null}):(delete this.clickedElements,n.options.hover=this.previousHoverOption||n.options.hover,this.clicked=!1)},beforeDestroy(n){delete this.clickedElements,n.options.hover=this.previousHoverOption||n.options.hover,this.clicked=!1}},ek={class:"axis-tooltip-content"},jf=6,nk="100%",ik="100%",sk=20,rk=20,Vf=6,ok=0,ak=10,lk=10,ck=1,uk=cn(f.defineComponent({__name:"StackedBarChart",props:{chartData:{type:Object,required:!1,default:()=>({labels:[],datasets:[]})},tooltipTitle:{type:String,required:!1,default:""},legendValues:{type:Object,required:!1,default:null},metricUnit:{type:String,required:!1,default:""},orientation:{type:String,required:!1,default:"horizontal",validator:n=>["horizontal","vertical"].includes(n)},annotations:{type:Boolean,required:!1,default:!0},metricAxesTitle:{type:String,required:!1,default:null},dimensionAxesTitle:{type:String,required:!1,default:null},stacked:{type:Boolean,required:!1,default:!0},syntheticsDataKey:{type:String,required:!1,default:""},chartLegendSortFn:{type:Function,required:!1,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,required:!1,default:(n,t)=>t.rawValue-n.rawValue}},setup(n){const t=n,{i18n:e}=yt.useI18n(),{translateUnit:i}=yt.useTranslatedUnits(),s=f.ref(null),r=({chart:z},j)=>{var tt;const X=z.data,Z=(tt=X.labels)==null?void 0:tt.indexOf(j);return X.datasets.reduce((q,V,ot)=>{if(z.isDatasetVisible(ot)){const J=V.data[Z];return isNaN(J)?q:q+J}else return q},0)},o=(z,j,X,Z)=>{const tt=Z==="horizontal";j===null&&(j=e.t("entityNoName"));const q={type:"label",yValue:J=>tt?j:r(J,j),xValue:J=>tt?r(J,j):j},V={...q,position:tt?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>tt?0:-Math.abs(uw()),content:J=>Pa(r(J,j),X)},ot={...q,content:J=>eh(r(J,j),th(J.chart,z)),position:tt?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:J=>tt?Jd(Pa(r(J,j),X)):0,color:Kd};return{[`${j}-value`]:V,[`${j}-percent`]:ot}},a=f.ref(null),l=f.ref(),c=f.ref(On()),u=On(),d=On(),h=f.ref([]),g=f.ref(f.inject("legendPosition",It.Right)),p=f.ref({show:!1,top:"0px",left:"0px",text:"",offset:-50}),b=f.toRef(t,"metricUnit"),w=f.computed(()=>f.toRef(t,"orientation").value==="horizontal"),v=f.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:b,translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,locked:!1,chartType:w.value?"horizontal_bar":"vertical_bar",chartTooltipSortFn:t.chartTooltipSortFn}),S=f.ref(0),D=()=>{var z;return t.annotations&&((z=t.chartData.labels)==null?void 0:z.reduce((j,X)=>Object.assign(j,o(t.chartData,X,b.value,t.orientation)),{}))},k={id:c.value,afterUpdate(z){S.value+=1,h.value=Vd(z,t.legendValues,t.chartLegendSortFn)}},C={id:u,afterUpdate(z){z.options.plugins.annotation.annotations=t.annotations?D():{}}},m=[k,{id:"axisHover",afterEvent(z,j){var X;if(p.value.show=!1,j.event.type==="mousemove"){const Z=j.event,tt=z.options.indexAxis,q=z.scales,V=z.scales[tt].getLabelForValue(Number(z.scales[tt].getValueForPixel(Z[tt]))),J=z.scales[tt].getLabels().indexOf(V),Ct=(X=t.chartData.isLabelEmpty)==null?void 0:X[J];if((Rt=>Rt==="x"?Z.y>q.x.top:Z.x<q.y.right)(tt)){v.locked||(v.showTooltip=!1);const bt=z.canvas.getContext("2d").measureText(V).width,ft=Math.abs(Math.round(Z.x-bt*.5)),$t=Math.round(Z.x+bt*.5);p.value.left=tt==="x"?`${(ft>0?ft:$t)-p.value.offset}px`:`${Z.x-bt*.5-p.value.offset}px`,p.value.top=`${Z.y-50}px`,V.length>Ar?(p.value.show=!0,p.value.text=V):Ct?(p.value.text=e.t("emptyEntityInfo"),p.value.show=!0):p.value.show=!1}else p.value.show=!1}}},{id:d,afterUpdate(z){z.options.layout.padding.right=w.value?H.value:0}},Yf,...t.annotations?[C]:[]],_=f.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),T=f.ref(0),A=f.ref(0),L=new ResizeObserver(jd(z=>{T.value=z[0].contentRect.width,A.value=z[0].contentRect.height},100)),N=f.computed(()=>{var j,X;const z=(X=(j=t.chartData)==null?void 0:j.labels)==null?void 0:X.length;return a.value&&z&&!w.value?`${Math.max(z*(sk+Vf),T.value)}px`:nk}),B=f.computed(()=>{var j,X;const z=(X=(j=t.chartData)==null?void 0:j.labels)==null?void 0:X.length;return a.value&&z&&w.value?`${Math.max(z*(rk+Vf),A.value)}px`:ik});yt.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey")),f.onMounted(()=>{t.annotations&&Pe.register(Bf),s.value&&(T.value=s.value.offsetWidth,A.value=s.value.offsetHeight,L.observe(s.value))}),f.onUnmounted(()=>{s.value&&L.unobserve(s.value)});const G=f.computed(()=>{const z=yt.useBarChartOptions({tooltipState:v,legendID:c.value,stacked:f.toRef(t,"stacked"),metricAxesTitle:f.toRef(t,"metricAxesTitle"),dimensionAxesTitle:f.toRef(t,"dimensionAxesTitle"),indexAxis:w.value?"y":"x",numLabels:_});return{...z.value,plugins:{...z.value.plugins,annotation:{annotations:D(),clip:!1}},layout:{autoPadding:!1,padding:{right:0,top:6*jf}}}}),U=yt.useChartJSCommon("bar",a,f.toRef(t,"chartData"),m,G),H=f.computed(()=>{S.value;const z=t.chartData.labels,j=t.chartData.datasets,X=z.map((q,V)=>j.reduce((ot,J)=>isNaN(Number(J.data[V]))?ot:ot+Number(J.data[V]),0)),Z=U.value?th(U.value,t.chartData):dw(t.chartData);return X.map(q=>Jd(Pa(q,b.value)+eh(q,Z))).reduce((q,V)=>Math.max(q,V),0)+jf});f.onBeforeUnmount(()=>{Pe.unregister(Bf)});const ut={[It.Right]:"legend-row",[It.Bottom]:"column"},Y=f.computed(()=>{if(l.value&&U.value){const z=window.devicePixelRatio,j=U.value,X=j.scales.y.width*z+ck,Z=(j.scales.y.height+j.scales.y.top+j.scales.x.height)*z,tt=l.value.getContext("2d");return tt.scale(z,z),tt.canvas.width=X,tt.canvas.height=Z,tt.canvas.style.width=`${X/z}px`,tt.canvas.style.height=`${Z/z}px`,{scale:z,width:X*z,height:Z*z,targetCtx:tt}}return null}),et=z=>{const j=z.target;if(Y.value&&U.value&&!w.value){const X=Y.value.scale,Z=Y.value.targetCtx,tt=Y.value.width,q=Y.value.height,V=U.value,ot=V.canvas;Z.fillStyle="white",j.scrollLeft>=ok&&j.scrollLeft<=ak?(Z.globalCompositeOperation="source-over",Z.clearRect(0,0,tt,q),Z.drawImage(ot,0,0,tt,q,0,0,tt,q),Z.globalCompositeOperation="destination-over",Z.fillRect(0,0,tt,q)):(Z.globalCompositeOperation="source-over",Z.fillRect(0,(V.scales.y.height+V.scales.y.top+lk)*X,tt,V.scales.x.height*X))}v.offsetY=j.scrollTop,v.offsetX=j.scrollLeft,p.value.offset=j.scrollLeft},Dt=({width:z,height:j})=>{v.width=z,v.height=j};f.watch(()=>t.orientation,()=>{var z;if(l.value&&Y.value){const j=Y.value.width,X=Y.value.height;((z=l.value)==null?void 0:z.getContext("2d")).clearRect(0,0,j,X)}v.showTooltip=!1,v.locked=!1}),f.watch(()=>t.annotations,z=>{U.value&&(z?U.value.options.plugins.annotation.annotations=D(t.chartData):delete U.value.options.plugins.annotation.annotations)});const $=()=>{v.showTooltip&&(v.locked=!v.locked)};return(z,j)=>(f.openBlock(),f.createElementBlock("div",{class:f.normalizeClass(["chart-parent",ut[g.value]])},[f.createElementVNode("canvas",{ref_key:"axis",ref:l,class:"axis"},null,512),f.createElementVNode("div",{ref_key:"chartContainerRef",ref:s,class:"chart-container","on:scroll":et,onClick:j[0]||(j[0]=X=>$())},[f.createElementVNode("div",{class:"chart-body",style:f.normalizeStyle({width:N.value,height:B.value})},[f.createElementVNode("canvas",{ref_key:"canvas",ref:a,class:"chart-canvas"},null,512)],4)],544),p.value.show?(f.openBlock(),f.createElementBlock("div",{key:0,class:"axis-tooltip",style:f.normalizeStyle({top:p.value.top,left:p.value.left}),width:"auto"},[f.createElementVNode("div",ek,f.toDisplayString(p.value.text),1)],4)):f.createCommentVNode("",!0),f.createVNode(hl,{context:v.tooltipContext,left:v.left,locked:v.locked,series:v.tooltipSeries,"show-tooltip":v.showTooltip,"tooltip-title":n.tooltipTitle,top:v.top,onDimensions:Dt},null,8,["context","left","locked","series","show-tooltip","tooltip-title","top"]),f.createVNode(fl,{id:c.value,"chart-instance":f.unref(U),items:h.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-e3a7d88f"]]);/*!
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 dk={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"};nu._date.override({_id:"date-fns",formats:function(){return dk},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=rt(n):e==="string"&&(typeof t=="string"?n=Cx(n,t,new Date,this.options):n=Wd(n,this.options)),ya(n)?n.getTime():null},format:function(n,t){return Id(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return pa(n,t);case"second":return M0(n,t);case"minute":return w0(n,t);case"hour":return b0(n,t);case"day":return Tr(n,t);case"week":return S0(n,t);case"month":return ga(n,t);case"quarter":return v0(n,t);case"year":return k0(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return ba(n,t);case"second":return R0(n,t);case"minute":return P0(n,t);case"hour":return O0(n,t);case"day":return _d(n,t);case"week":return L0(n,t);case"month":return Md(n,t);case"quarter":return A0(n,t);case"year":return I0(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return Ax(n);case"minute":return Ex(n);case"hour":return Px(n);case"day":return ma(n);case"week":return Ue(n);case"isoWeek":return Ue(n,{weekStartsOn:+e});case"month":return F0(n);case"quarter":return N0(n);case"year":return Sd(n);default:return n}},endOf:function(n,t){switch(t){case"second":return j0(n);case"minute":return W0(n);case"hour":return B0(n);case"day":return wd(n);case"week":return H0(n);case"month":return vd(n);case"quarter":return Y0(n);case"year":return z0(n);default:return n}}});const $f={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},hk={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...$f,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},fk=f.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function Ti(n){return f.isProxy(n)?f.toRaw(n):n}function gk(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return f.isProxy(t)?new Proxy(n,{}):n}function pk(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function Uf(n,t){n.labels=t}function qf(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 mk(n,t){const e={labels:[],datasets:[]};return Uf(e,n.labels),qf(e,n.datasets,t),e}const yk=f.defineComponent({props:hk,setup(n,t){let{expose:e,slots:i}=t;const s=f.ref(null),r=f.shallowRef(null);e({chart:r});const o=()=>{if(!s.value)return;const{type:c,data:u,options:d,plugins:h,datasetIdKey:g}=n,p=mk(u,g),b=gk(p,u);r.value=new Pe(s.value,{type:c,data:b,options:{...d},plugins:h})},a=()=>{const c=f.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 f.onMounted(o),f.onUnmounted(a),f.watch([()=>n.options,()=>n.data],(c,u)=>{let[d,h]=c,[g,p]=u;const b=f.toRaw(r.value);if(!b)return;let w=!1;if(d){const v=Ti(d),S=Ti(g);v&&v!==S&&(pk(b,v),w=!0)}if(h){const v=Ti(h.labels),S=Ti(p.labels),D=Ti(h.datasets),k=Ti(p.datasets);v!==S&&(Uf(b.config.data,v),w=!0),D&&D!==k&&(qf(b.config.data,D,n.datasetIdKey),w=!0)}w&&f.nextTick(()=>{l(b)})},{deep:!0}),()=>f.h("canvas",{role:"img",ariaLabel:n.ariaLabel,ariaDescribedby:n.ariaDescribedby,ref:s},[f.h("p",{},[i.default?i.default():""])])}});function pl(n,t){return Pe.register(t),f.defineComponent({props:$f,setup(e,i){let{expose:s}=i;const r=f.shallowRef(null),o=a=>{r.value=a==null?void 0:a.chart};return s({chart:r}),()=>f.h(yk,fk({ref:o},{type:n,...e}))}})}const bk=pl("bar",Ji),Xf=pl("doughnut",sn),_k=pl("line",ts),xk={class:"chart-container"},wk=f.defineComponent({__name:"DoughnutChart",props:{chartData:{type:Object,required:!1,default:null},tooltipTitle:{type:String,required:!0},metricUnit:{type:String,required:!1,default:""},legendPosition:{type:String,required:!1,default:It.Right},legendValues:{type:Object,required:!1,default:null},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:on}},setup(n){const t=n,{translateUnit:e}=yt.useTranslatedUnits(),i=f.ref(On()),s=f.ref(On()),r=f.ref([]),o=f.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:f.toRef(t,"metricUnit"),translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartType:"doughnut"}),a={id:i.value,afterUpdate(b){r.value=b.options.plugins.legend.labels.generateLabels(b).map(w=>({...w,value:t.legendValues&&t.legendValues[w.text],hidden:!1}))}},l=f.computed(()=>[a]),c=f.computed(()=>[t.chartData.datasets.reduce((w,v)=>(w.labels.push(v.label),w.backgroundColor.push(v.backgroundColor),w.borderColor.push(Gd(v.backgroundColor,50)),w.data.push(v.data.reduce((S,D)=>S+D,0)),w),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),u=f.computed(()=>({...t.chartData,datasets:c.value}));yt.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey"));const{options:d}=yt.useDoughnutChartOptions({tooltipState:o,legendID:i.value}),h=f.ref(),g=b=>({[It.Right]:"legend-row",[It.Bottom]:"column",[It.Hidden]:"hidden"})[b],p=({width:b,height:w})=>{o.width=b,o.height=w};return(b,w)=>(f.openBlock(),f.createElementBlock("div",{class:f.normalizeClass(["chart-parent",g(n.legendPosition)]),"data-testid":"doughnut-chart-parent"},[f.createElementVNode("div",xk,[f.createVNode(f.unref(Xf),{ref_key:"chartInstance",ref:h,"chart-id":s.value,data:u.value,options:f.unref(d),plugins:l.value},null,8,["chart-id","data","options","plugins"]),f.createVNode(hl,{left:o.left,series:o.tooltipSeries,"show-tooltip":o.showTooltip,"tooltip-title":n.tooltipTitle,top:o.top,unit:n.metricUnit,onDimensions:p},null,8,["left","series","show-tooltip","tooltip-title","top","unit"])]),f.createVNode(fl,{id:i.value,"chart-instance":h.value,items:r.value,position:n.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),vk=cn(wk,[["__scopeId","data-v-5cc0c740"]]),Gf=(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()},Rs={id:"linePlugin",afterDatasetsDraw:function(n){if(!this.pause&&n.tooltip&&n.tooltip.getActiveElements()&&n.tooltip.getActiveElements().length&&!this.clickedSegment){const{x:t}=n.tooltip.dataPoints[0].element,e=n.ctx;Gf(e,t,n.scales.y.top,n.scales.y.bottom)}if(!this.pause&&this.clickedSegment){const{x:t}=this.clickedSegment.element,e=n.ctx;Gf(e,t,n.scales.y.top,n.scales.y.bottom)}},beforeDestroy(){delete this.clickedSegment}},Mk=(n,t,e)=>{const i=n.ctx;i.save(),i.fillStyle="rgba(200, 200, 200, 0.5)",i.fillRect(t,n.chartArea.top,e-t,n.chartArea.bottom-n.chartArea.top),i.restore()},Kf=(n,t,e)=>{const i=t.scales.x.getValueForPixel(e.startX),s=t.scales.x.getValueForPixel(e.endX);t.canvas.dispatchEvent(new CustomEvent(n,{detail:{xStart:i,xEnd:s}}))},Sk={id:"dragSelectPlugin",isDragging:!1,startX:0,endX:0,beforeInit:function(n){const t=n.canvas,e=t.getBoundingClientRect();let i=!1;const s=a=>{this.dragTimeout=window.setTimeout(()=>{this.isDragging=!0,i=!0,this.startX=a.clientX-e.left},150)},r=a=>{i&&this.isDragging&&(this.endX=a.clientX-e.left,Kf("dragSelectMove",n,this),n.update())},o=a=>{clearTimeout(this.dragTimeout),i&&this.isDragging&&(this.endX=a.clientX-e.left,Kf("dragSelect",n,this),n.update(),this.isDragging=!1,i=!1)};t.addEventListener("mousedown",s),t.addEventListener("mousemove",r),t.addEventListener("mouseup",o),this.dragSelectHandlers={onMouseDown:s,onMouseMove:r,onMouseUp:o}},beforeDestroy(n){const t=n.canvas;if(this.dragSelectHandlers){const{onMouseDown:e,onMouseMove:i,onMouseUp:s}=this.dragSelectHandlers;t.removeEventListener("mousedown",e),t.removeEventListener("mousemove",i),t.removeEventListener("mouseup",s)}this.isDragging=!1},afterDatasetsDraw:function(n){this.isDragging&&Mk(n,this.startX,this.endX)}},kk=cn(f.defineComponent({__name:"TimeSeriesChart",props:{chartData:{type:Object,required:!1,default:null},type:{type:String,required:!1,default:"timeseries_line"},fill:{type:Boolean,required:!1,default:!1},tooltipTitle:{type:String,required:!0},metricUnit:{type:String,required:!1,default:""},timeRangeMs:{type:Number,required:!1,default:void 0},granularity:{type:String,required:!0},stacked:{type:Boolean,required:!1,default:!0},legendValues:{type:Object,required:!1,default:null},metricAxesTitle:{type:String,required:!1,default:null},dimensionAxesTitle:{type:String,required:!1,default:null},syntheticsDataKey:{type:String,required:!1,default:""},chartLegendSortFn:{type:Function,required:!1,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,required:!1,default:(n,t)=>t.rawValue-n.rawValue},zoom:{type:Boolean,required:!1,default:!1}},emits:["zoom-time-range"],setup(n,{emit:t}){const e=n,i=t,{translateUnit:s}=yt.useTranslatedUnits(),r=f.ref(),o=f.ref(On()),a=f.ref(On()),l=f.ref([]),c=f.ref(),u=f.ref(f.inject("legendPosition",It.Right)),d=f.ref(!1),h=f.reactive({showTooltip:!1,tooltipContext:0,tooltipSeries:[],left:"",top:"",units:f.toRef(e,"metricUnit"),translateUnit:s,offsetX:0,offsetY:0,width:0,height:0,chartType:e.type,locked:!1,chartTooltipSortFn:e.chartTooltipSortFn}),g={id:o.value,afterUpdate(_){l.value=Vd(_,e.legendValues,e.chartLegendSortFn)}},p=f.computed(()=>[g,Yf,...e.zoom?[Sk]:[],...e.type==="timeseries_line"?[Rs]:[]]),b=f.computed(()=>`line-${p.value.map(_=>_.id).join("-")}`),w=f.computed(()=>`bar-${p.value.map(_=>_.id).join("-")}`),v=f.computed(()=>Qx(e.chartData)),{options:S}=yt.useLinechartOptions({tooltipState:h,timeRangeMs:f.toRef(e,"timeRangeMs"),granularity:f.toRef(e,"granularity"),legendID:o.value,stacked:f.toRef(e,"stacked"),metricAxesTitle:f.toRef(e,"metricAxesTitle"),dimensionAxesTitle:f.toRef(e,"dimensionAxesTitle"),pointsWithoutHover:v});yt.useReportChartDataForSynthetics(f.toRef(e,"chartData"),f.toRef(e,"syntheticsDataKey"));const D=_=>yh(new Date(_),e.granularity,!0),k=_=>({[It.Right]:"legend-row",[It.Bottom]:"column",[It.Hidden]:"hidden"})[_],C=({width:_,height:T})=>{h.width=_,h.height=T},R=()=>{var _,T,A;h.locked=!h.locked,r.value&&((T=(_=r.value.chart.tooltip)==null?void 0:_.dataPoints)!=null&&T.length)&&(Rs.clickedSegment=h.locked?(A=r.value.chart.tooltip)==null?void 0:A.dataPoints[0]:void 0)};f.watch(()=>e.type,()=>{h.locked=!1,h.showTooltip=!1,delete Rs.clickedSegment});const E=_=>{const{xStart:T,xEnd:A}=_.detail;T&&A&&i("zoom-time-range",{start:new Date(T),end:new Date(A),type:"absolute"}),d.value=!1,R(),Rs.pause=!1},m=()=>{d.value=!0,Rs.pause=!0};return f.watch(()=>{var _;return(_=r.value)==null?void 0:_.chart},()=>{var _;(_=r.value)!=null&&_.chart&&(r.value.chart.canvas.removeEventListener("dragSelect",E),r.value.chart.canvas.removeEventListener("dragSelectMove",m),r.value.chart.canvas.addEventListener("dragSelect",E),r.value.chart.canvas.addEventListener("dragSelectMove",m))}),f.onUnmounted(()=>{var _;(_=r.value)!=null&&_.chart&&(r.value.chart.canvas.removeEventListener("dragSelect",E),r.value.chart.canvas.removeEventListener("dragSelectMove",m))}),(_,T)=>(f.openBlock(),f.createElementBlock("div",{class:f.normalizeClass(["chart-parent",k(u.value)]),"data-testid":"line-chart-parent"},[f.createElementVNode("div",{class:"chart-container",onClick:T[0]||(T[0]=A=>R())},[n.type==="timeseries_line"?(f.openBlock(),f.createBlock(f.unref(_k),{key:b.value,ref_key:"chartInstance",ref:r,"chart-id":a.value,class:"chart-canvas",data:n.chartData,"data-testid":"time-series-line-chart",options:f.unref(S),plugins:p.value},null,8,["chart-id","data","options","plugins"])):n.type==="timeseries_bar"?(f.openBlock(),f.createBlock(f.unref(bk),{key:w.value,ref_key:"chartInstance",ref:r,"chart-id":a.value,class:"chart-canvas",data:n.chartData,"data-testid":"time-series-bar-chart",options:f.unref(S),plugins:p.value},null,8,["chart-id","data","options","plugins"])):f.createCommentVNode("",!0)]),d.value?f.createCommentVNode("",!0):(f.openBlock(),f.createBlock(hl,{key:0,ref_key:"tooltipElement",ref:c,context:D(h.tooltipContext),"data-testid":"tooltip",left:h.left,locked:h.locked,series:h.tooltipSeries,"show-tooltip":h.showTooltip,"tooltip-title":n.tooltipTitle,top:h.top,unit:n.metricUnit,onDimensions:C,onLeft:T[1]||(T[1]=A=>h.left=A),onTop:T[2]||(T[2]=A=>h.top=A)},null,8,["context","left","locked","series","show-tooltip","tooltip-title","top","unit"])),f.createVNode(fl,{id:o.value,"chart-instance":r.value,"data-testid":"legend",items:l.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-4ca2b965"]]),Dk=["hidden","single","full"];var ii=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(ii||{});const Tk=["doughnut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar"],Ck=["gauge","top_n"];var Qr={exports:{}};Qr.exports,function(n,t){var e=200,i="Expected a function",s="__lodash_hash_undefined__",r=1,o=2,a=1/0,l=9007199254740991,c="[object Arguments]",u="[object Array]",d="[object Boolean]",h="[object Date]",g="[object Error]",p="[object Function]",b="[object GeneratorFunction]",w="[object Map]",v="[object Number]",S="[object Object]",D="[object Promise]",k="[object RegExp]",C="[object Set]",R="[object String]",E="[object Symbol]",m="[object WeakMap]",_="[object ArrayBuffer]",T="[object DataView]",A="[object Float32Array]",L="[object Float64Array]",N="[object Int8Array]",B="[object Int16Array]",G="[object Int32Array]",U="[object Uint8Array]",H="[object Uint8ClampedArray]",ut="[object Uint16Array]",Y="[object Uint32Array]",et=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Dt=/^\w*$/,$=/^\./,z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,j=/[\\^$.*+?()[\]{}|]/g,X=/\\(\\)?/g,Z=/^\[object .+?Constructor\]$/,tt=/^(?:0|[1-9]\d*)$/,q={};q[A]=q[L]=q[N]=q[B]=q[G]=q[U]=q[H]=q[ut]=q[Y]=!0,q[c]=q[u]=q[_]=q[d]=q[T]=q[h]=q[g]=q[p]=q[w]=q[v]=q[S]=q[k]=q[C]=q[R]=q[m]=!1;var V=typeof me=="object"&&me&&me.Object===Object&&me,ot=typeof self=="object"&&self&&self.Object===Object&&self,J=V||ot||Function("return this")(),Ct=t&&!t.nodeType&&t,pt=Ct&&!0&&n&&!n.nodeType&&n,Rt=pt&&pt.exports===Ct,bt=Rt&&V.process,ft=function(){try{return bt&&bt.binding("util")}catch{}}(),$t=ft&&ft.isTypedArray;function ie(y,M){for(var I=-1,W=y?y.length:0;++I<W;)if(M(y[I],I,y))return!0;return!1}function ye(y){return function(M){return M==null?void 0:M[y]}}function se(y,M){for(var I=-1,W=Array(y);++I<y;)W[I]=M(I);return W}function Kt(y){return function(M){return y(M)}}function St(y,M){return y==null?void 0:y[M]}function Tt(y){var M=!1;if(y!=null&&typeof y.toString!="function")try{M=!!(y+"")}catch{}return M}function Zt(y){var M=-1,I=Array(y.size);return y.forEach(function(W,at){I[++M]=[at,W]}),I}function gt(y,M){return function(I){return y(M(I))}}function Ge(y){var M=-1,I=Array(y.size);return y.forEach(function(W){I[++M]=W}),I}var be=Array.prototype,Re=Function.prototype,re=Object.prototype,_e=J["__core-js_shared__"],Te=function(){var y=/[^.]+$/.exec(_e&&_e.keys&&_e.keys.IE_PROTO||"");return y?"Symbol(src)_1."+y:""}(),te=Re.toString,oe=re.hasOwnProperty,zt=re.toString,Ci=RegExp("^"+te.call(oe).replace(j,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),En=J.Symbol,Oi=J.Uint8Array,si=re.propertyIsEnumerable,Ls=be.splice,Is=gt(Object.keys,Object),ri=we(J,"DataView"),ze=we(J,"Map"),Ns=we(J,"Promise"),Fs=we(J,"Set"),zs=we(J,"WeakMap"),oi=we(Object,"create"),bl=Ye(ri),Jr=Ye(ze),to=Ye(Ns),un=Ye(Fs),_l=Ye(zs),Pi=En?En.prototype:void 0,Bs=Pi?Pi.valueOf:void 0,eo=Pi?Pi.toString:void 0;function dn(y){var M=-1,I=y?y.length:0;for(this.clear();++M<I;){var W=y[M];this.set(W[0],W[1])}}function Be(){this.__data__=oi?oi(null):{}}function xl(y){return this.has(y)&&delete this.__data__[y]}function wl(y){var M=this.__data__;if(oi){var I=M[y];return I===s?void 0:I}return oe.call(M,y)?M[y]:void 0}function vl(y){var M=this.__data__;return oi?M[y]!==void 0:oe.call(M,y)}function Ml(y,M){var I=this.__data__;return I[y]=oi&&M===void 0?s:M,this}dn.prototype.clear=Be,dn.prototype.delete=xl,dn.prototype.get=wl,dn.prototype.has=vl,dn.prototype.set=Ml;function He(y){var M=-1,I=y?y.length:0;for(this.clear();++M<I;){var W=y[M];this.set(W[0],W[1])}}function An(){this.__data__=[]}function Sl(y){var M=this.__data__,I=Ai(M,y);if(I<0)return!1;var W=M.length-1;return I==W?M.pop():Ls.call(M,I,1),!0}function kl(y){var M=this.__data__,I=Ai(M,y);return I<0?void 0:M[I][1]}function Dl(y){return Ai(this.__data__,y)>-1}function Tl(y,M){var I=this.__data__,W=Ai(I,y);return W<0?I.push([y,M]):I[W][1]=M,this}He.prototype.clear=An,He.prototype.delete=Sl,He.prototype.get=kl,He.prototype.has=Dl,He.prototype.set=Tl;function We(y){var M=-1,I=y?y.length:0;for(this.clear();++M<I;){var W=y[M];this.set(W[0],W[1])}}function Rn(){this.__data__={hash:new dn,map:new(ze||He),string:new dn}}function Cl(y){return Li(this,y).delete(y)}function Ol(y){return Li(this,y).get(y)}function Pl(y){return Li(this,y).has(y)}function El(y,M){return Li(this,y).set(y,M),this}We.prototype.clear=Rn,We.prototype.delete=Cl,We.prototype.get=Ol,We.prototype.has=Pl,We.prototype.set=El;function Ei(y){var M=-1,I=y?y.length:0;for(this.__data__=new We;++M<I;)this.add(y[M])}function Al(y){return this.__data__.set(y,s),this}function no(y){return this.__data__.has(y)}Ei.prototype.add=Ei.prototype.push=Al,Ei.prototype.has=no;function xe(y){this.__data__=new He(y)}function Rl(){this.__data__=new He}function Hs(y){return this.__data__.delete(y)}function Ll(y){return this.__data__.get(y)}function Il(y){return this.__data__.has(y)}function Nl(y,M){var I=this.__data__;if(I instanceof He){var W=I.__data__;if(!ze||W.length<e-1)return W.push([y,M]),this;I=this.__data__=new We(W)}return I.set(y,M),this}xe.prototype.clear=Rl,xe.prototype.delete=Hs,xe.prototype.get=Ll,xe.prototype.has=Il,xe.prototype.set=Nl;function Fl(y,M){var I=O(y)||x(y)?se(y.length,String):[],W=I.length,at=!!W;for(var Q in y)oe.call(y,Q)&&!(at&&(Q=="length"||uo(Q,W)))&&I.push(Q);return I}function Ai(y,M){for(var I=y.length;I--;)if(go(y[I][0],M))return I;return-1}var zl=Ul();function Ws(y,M){return y&&zl(y,M,Fn)}function io(y,M){M=In(M,y)?[M]:oo(M);for(var I=0,W=M.length;y!=null&&I<W;)y=y[Ni(M[I++])];return I&&I==W?y:void 0}function Bl(y){return zt.call(y)}function Hl(y,M){return y!=null&&M in Object(y)}function Ys(y,M,I,W,at){return y===M?!0:y==null||M==null||!ve(y)&&!Ut(M)?y!==y&&M!==M:Wl(y,M,Ys,I,W,at)}function Wl(y,M,I,W,at,Q){var ht=O(y),qt=O(M),Bt=u,ae=u;ht||(Bt=Ke(y),Bt=Bt==c?S:Bt),qt||(ae=Ke(M),ae=ae==c?S:ae);var Me=Bt==S&&!Tt(y),Se=ae==S&&!Tt(M),de=Bt==ae;if(de&&!Me)return Q||(Q=new xe),ht||Nn(y)?ao(y,M,I,W,at,Q):ql(y,M,Bt,I,W,at,Q);if(!(at&o)){var Le=Me&&oe.call(y,"__wrapped__"),Ie=Se&&oe.call(M,"__wrapped__");if(Le||Ie){var zn=Le?y.value():y,fn=Ie?M.value():M;return Q||(Q=new xe),I(zn,fn,W,at,Q)}}return de?(Q||(Q=new xe),Xl(y,M,I,W,at,Q)):!1}function Yl(y,M,I,W){var at=I.length,Q=at;if(y==null)return!Q;for(y=Object(y);at--;){var ht=I[at];if(ht[2]?ht[1]!==y[ht[0]]:!(ht[0]in y))return!1}for(;++at<Q;){ht=I[at];var qt=ht[0],Bt=y[qt],ae=ht[1];if(ht[2]){if(Bt===void 0&&!(qt in y))return!1}else{var Me=new xe,Se;if(!(Se===void 0?Ys(ae,Bt,W,r|o,Me):Se))return!1}}return!0}function jl(y){if(!ve(y)||Gl(y))return!1;var M=Vt(y)||Tt(y)?Ci:Z;return M.test(Ye(y))}function so(y){return Ut(y)&&Qt(y.length)&&!!q[zt.call(y)]}function Vl(y){return typeof y=="function"?y:y==null?jD:typeof y=="object"?O(y)?Ln(y[0],y[1]):Ri(y):VD(y)}function $l(y){if(!Kl(y))return Is(y);var M=[];for(var I in Object(y))oe.call(y,I)&&I!="constructor"&&M.push(I);return M}function Ri(y){var M=lo(y);return M.length==1&&M[0][2]?fo(M[0][0],M[0][1]):function(I){return I===y||Yl(I,y,M)}}function Ln(y,M){return In(y)&&js(M)?fo(Ni(y),M):function(I){var W=mo(I,y);return W===void 0&&W===M?yo(I,y):Ys(M,W,void 0,r|o)}}function ro(y){return function(M){return io(M,y)}}function hn(y){if(typeof y=="string")return y;if(Fi(y))return eo?eo.call(y):"";var M=y+"";return M=="0"&&1/y==-a?"-0":M}function oo(y){return O(y)?y:Ii(y)}function Ul(y){return function(M,I,W){for(var at=-1,Q=Object(M),ht=W(M),qt=ht.length;qt--;){var Bt=ht[++at];if(I(Q[Bt],Bt,Q)===!1)break}return M}}function ao(y,M,I,W,at,Q){var ht=at&o,qt=y.length,Bt=M.length;if(qt!=Bt&&!(ht&&Bt>qt))return!1;var ae=Q.get(y);if(ae&&Q.get(M))return ae==M;var Me=-1,Se=!0,de=at&r?new Ei:void 0;for(Q.set(y,M),Q.set(M,y);++Me<qt;){var Le=y[Me],Ie=M[Me];if(W)var zn=ht?W(Ie,Le,Me,M,y,Q):W(Le,Ie,Me,y,M,Q);if(zn!==void 0){if(zn)continue;Se=!1;break}if(de){if(!ie(M,function(fn,ai){if(!de.has(ai)&&(Le===fn||I(Le,fn,W,at,Q)))return de.add(ai)})){Se=!1;break}}else if(!(Le===Ie||I(Le,Ie,W,at,Q))){Se=!1;break}}return Q.delete(y),Q.delete(M),Se}function ql(y,M,I,W,at,Q,ht){switch(I){case T:if(y.byteLength!=M.byteLength||y.byteOffset!=M.byteOffset)return!1;y=y.buffer,M=M.buffer;case _:return!(y.byteLength!=M.byteLength||!W(new Oi(y),new Oi(M)));case d:case h:case v:return go(+y,+M);case g:return y.name==M.name&&y.message==M.message;case k:case R:return y==M+"";case w:var qt=Zt;case C:var Bt=Q&o;if(qt||(qt=Ge),y.size!=M.size&&!Bt)return!1;var ae=ht.get(y);if(ae)return ae==M;Q|=r,ht.set(y,M);var Me=ao(qt(y),qt(M),W,at,Q,ht);return ht.delete(y),Me;case E:if(Bs)return Bs.call(y)==Bs.call(M)}return!1}function Xl(y,M,I,W,at,Q){var ht=at&o,qt=Fn(y),Bt=qt.length,ae=Fn(M),Me=ae.length;if(Bt!=Me&&!ht)return!1;for(var Se=Bt;Se--;){var de=qt[Se];if(!(ht?de in M:oe.call(M,de)))return!1}var Le=Q.get(y);if(Le&&Q.get(M))return Le==M;var Ie=!0;Q.set(y,M),Q.set(M,y);for(var zn=ht;++Se<Bt;){de=qt[Se];var fn=y[de],ai=M[de];if(W)var ag=ht?W(ai,fn,de,M,y,Q):W(fn,ai,de,y,M,Q);if(!(ag===void 0?fn===ai||I(fn,ai,W,at,Q):ag)){Ie=!1;break}zn||(zn=de=="constructor")}if(Ie&&!zn){var bo=y.constructor,_o=M.constructor;bo!=_o&&"constructor"in y&&"constructor"in M&&!(typeof bo=="function"&&bo instanceof bo&&typeof _o=="function"&&_o instanceof _o)&&(Ie=!1)}return Q.delete(y),Q.delete(M),Ie}function Li(y,M){var I=y.__data__;return ho(M)?I[typeof M=="string"?"string":"hash"]:I.map}function lo(y){for(var M=Fn(y),I=M.length;I--;){var W=M[I],at=y[W];M[I]=[W,at,js(at)]}return M}function we(y,M){var I=St(y,M);return jl(I)?I:void 0}var Ke=Bl;(ri&&Ke(new ri(new ArrayBuffer(1)))!=T||ze&&Ke(new ze)!=w||Ns&&Ke(Ns.resolve())!=D||Fs&&Ke(new Fs)!=C||zs&&Ke(new zs)!=m)&&(Ke=function(y){var M=zt.call(y),I=M==S?y.constructor:void 0,W=I?Ye(I):void 0;if(W)switch(W){case bl:return T;case Jr:return w;case to:return D;case un:return C;case _l:return m}return M});function co(y,M,I){M=In(M,y)?[M]:oo(M);for(var W,at=-1,ht=M.length;++at<ht;){var Q=Ni(M[at]);if(!(W=y!=null&&I(y,Q)))break;y=y[Q]}if(W)return W;var ht=y?y.length:0;return!!ht&&Qt(ht)&&uo(Q,ht)&&(O(y)||x(y))}function uo(y,M){return M=M??l,!!M&&(typeof y=="number"||tt.test(y))&&y>-1&&y%1==0&&y<M}function In(y,M){if(O(y))return!1;var I=typeof y;return I=="number"||I=="symbol"||I=="boolean"||y==null||Fi(y)?!0:Dt.test(y)||!et.test(y)||M!=null&&y in Object(M)}function ho(y){var M=typeof y;return M=="string"||M=="number"||M=="symbol"||M=="boolean"?y!=="__proto__":y===null}function Gl(y){return!!Te&&Te in y}function Kl(y){var M=y&&y.constructor,I=typeof M=="function"&&M.prototype||re;return y===I}function js(y){return y===y&&!ve(y)}function fo(y,M){return function(I){return I==null?!1:I[y]===M&&(M!==void 0||y in Object(I))}}var Ii=Vs(function(y){y=po(y);var M=[];return $.test(y)&&M.push(""),y.replace(z,function(I,W,at,Q){M.push(at?Q.replace(X,"$1"):W||I)}),M});function Ni(y){if(typeof y=="string"||Fi(y))return y;var M=y+"";return M=="0"&&1/y==-a?"-0":M}function Ye(y){if(y!=null){try{return te.call(y)}catch{}try{return y+""}catch{}}return""}function Vs(y,M){if(typeof y!="function"||M&&typeof M!="function")throw new TypeError(i);var I=function(){var W=arguments,at=M?M.apply(this,W):W[0],Q=I.cache;if(Q.has(at))return Q.get(at);var ht=y.apply(this,W);return I.cache=Q.set(at,ht),ht};return I.cache=new(Vs.Cache||We),I}Vs.Cache=We;function go(y,M){return y===M||y!==y&&M!==M}function x(y){return K(y)&&oe.call(y,"callee")&&(!si.call(y,"callee")||zt.call(y)==c)}var O=Array.isArray;function F(y){return y!=null&&Qt(y.length)&&!Vt(y)}function K(y){return Ut(y)&&F(y)}function Vt(y){var M=ve(y)?zt.call(y):"";return M==p||M==b}function Qt(y){return typeof y=="number"&&y>-1&&y%1==0&&y<=l}function ve(y){var M=typeof y;return!!y&&(M=="object"||M=="function")}function Ut(y){return!!y&&typeof y=="object"}function Fi(y){return typeof y=="symbol"||Ut(y)&&zt.call(y)==E}var Nn=$t?Kt($t):so;function po(y){return y==null?"":hn(y)}function mo(y,M,I){var W=y==null?void 0:io(y,M);return W===void 0?I:W}function yo(y,M){return y!=null&&co(y,M,Hl)}function Fn(y){return F(y)?Fl(y):$l(y)}function zi(y,M){var I={};return M=Vl(M),Ws(y,function(W,at,Q){I[M(W,at,Q)]=W}),I}function jD(y){return y}function VD(y){return In(y)?ye(Ni(y)):ro(y)}n.exports=zi}(Qr,Qr.exports);var Ok=Qr.exports;const Pk=Wa(Ok);var Ek=1/0,Ak=9007199254740991,Rk="[object Arguments]",Lk="[object Function]",Ik="[object GeneratorFunction]",Nk="[object Symbol]",Fk=typeof me=="object"&&me&&me.Object===Object&&me,zk=typeof self=="object"&&self&&self.Object===Object&&self,Bk=Fk||zk||Function("return this")();function Hk(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 Wk(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 Yk(n,t){for(var e=-1,i=t.length,s=n.length;++e<i;)n[s+e]=t[e];return n}var ml=Object.prototype,jk=ml.hasOwnProperty,yl=ml.toString,Zf=Bk.Symbol,Vk=ml.propertyIsEnumerable,Qf=Zf?Zf.isConcatSpreadable:void 0,Jf=Math.max;function $k(n,t,e,i,s){var r=-1,o=n.length;for(e||(e=Gk),s||(s=[]);++r<o;){var a=n[r];e(a)?Yk(s,a):s[s.length]=a}return s}function Uk(n,t){return n=Object(n),qk(n,t,function(e,i){return i in n})}function qk(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 Xk(n,t){return t=Jf(t===void 0?n.length-1:t,0),function(){for(var e=arguments,i=-1,s=Jf(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,Hk(n,this,o)}}function Gk(n){return Qk(n)||Zk(n)||!!(Qf&&n&&n[Qf])}function Kk(n){if(typeof n=="string"||sD(n))return n;var t=n+"";return t=="0"&&1/n==-Ek?"-0":t}function Zk(n){return tD(n)&&jk.call(n,"callee")&&(!Vk.call(n,"callee")||yl.call(n)==Rk)}var Qk=Array.isArray;function Jk(n){return n!=null&&nD(n.length)&&!eD(n)}function tD(n){return tg(n)&&Jk(n)}function eD(n){var t=iD(n)?yl.call(n):"";return t==Lk||t==Ik}function nD(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=Ak}function iD(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function tg(n){return!!n&&typeof n=="object"}function sD(n){return typeof n=="symbol"||tg(n)&&yl.call(n)==Nk}var rD=Xk(function(n,t){return n==null?{}:Uk(n,Wk($k(t),Kk))}),oD=rD;const aD=Wa(oD);var eg={exports:{}};(function(n,t){(function(e,i){i()})(me,function(){function e(c,u){return typeof u>"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function i(c,u,d){var h=new XMLHttpRequest;h.open("GET",c),h.responseType="blob",h.onload=function(){l(h.response,u,d)},h.onerror=function(){console.error("could not download file")},h.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 me=="object"&&me.global===me?me: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 h=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=h.createObjectURL(c),setTimeout(function(){h.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 h=document.createElement("a");h.href=c,h.target="_blank",setTimeout(function(){r(h)})}}:function(c,u,d,h){if(h=h||open("","_blank"),h&&(h.document.title=h.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,b=/CriOS\/[\d]+/.test(navigator.userAgent);if((b||g&&p||a)&&typeof FileReader<"u"){var w=new FileReader;w.onloadend=function(){var D=w.result;D=b?D:D.replace(/^data:[^;]*;/,"data:attachment/file;"),h?h.location.href=D:location=D,h=null},w.readAsDataURL(c)}else{var v=o.URL||o.webkitURL,S=v.createObjectURL(c);h?h.location=S:location.href=S,h=null,setTimeout(function(){v.revokeObjectURL(S)},4e4)}});o.saveAs=l.saveAs=l,n.exports=l})})(eg);var lD=eg.exports,ng={exports:{}};/* @license
28
+ */const dk={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"};nu._date.override({_id:"date-fns",formats:function(){return dk},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=rt(n):e==="string"&&(typeof t=="string"?n=Cx(n,t,new Date,this.options):n=Wd(n,this.options)),ya(n)?n.getTime():null},format:function(n,t){return Id(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return pa(n,t);case"second":return M0(n,t);case"minute":return w0(n,t);case"hour":return b0(n,t);case"day":return Tr(n,t);case"week":return S0(n,t);case"month":return ga(n,t);case"quarter":return v0(n,t);case"year":return k0(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return ba(n,t);case"second":return R0(n,t);case"minute":return P0(n,t);case"hour":return O0(n,t);case"day":return _d(n,t);case"week":return L0(n,t);case"month":return Md(n,t);case"quarter":return A0(n,t);case"year":return I0(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return Ax(n);case"minute":return Ex(n);case"hour":return Px(n);case"day":return ma(n);case"week":return Ue(n);case"isoWeek":return Ue(n,{weekStartsOn:+e});case"month":return F0(n);case"quarter":return N0(n);case"year":return Sd(n);default:return n}},endOf:function(n,t){switch(t){case"second":return j0(n);case"minute":return W0(n);case"hour":return B0(n);case"day":return wd(n);case"week":return H0(n);case"month":return vd(n);case"quarter":return Y0(n);case"year":return z0(n);default:return n}}});const $f={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},hk={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...$f,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},fk=f.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function Ti(n){return f.isProxy(n)?f.toRaw(n):n}function gk(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return f.isProxy(t)?new Proxy(n,{}):n}function pk(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function Uf(n,t){n.labels=t}function qf(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 mk(n,t){const e={labels:[],datasets:[]};return Uf(e,n.labels),qf(e,n.datasets,t),e}const yk=f.defineComponent({props:hk,setup(n,t){let{expose:e,slots:i}=t;const s=f.ref(null),r=f.shallowRef(null);e({chart:r});const o=()=>{if(!s.value)return;const{type:c,data:u,options:d,plugins:h,datasetIdKey:g}=n,p=mk(u,g),b=gk(p,u);r.value=new Pe(s.value,{type:c,data:b,options:{...d},plugins:h})},a=()=>{const c=f.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 f.onMounted(o),f.onUnmounted(a),f.watch([()=>n.options,()=>n.data],(c,u)=>{let[d,h]=c,[g,p]=u;const b=f.toRaw(r.value);if(!b)return;let w=!1;if(d){const v=Ti(d),S=Ti(g);v&&v!==S&&(pk(b,v),w=!0)}if(h){const v=Ti(h.labels),S=Ti(p.labels),D=Ti(h.datasets),k=Ti(p.datasets);v!==S&&(Uf(b.config.data,v),w=!0),D&&D!==k&&(qf(b.config.data,D,n.datasetIdKey),w=!0)}w&&f.nextTick(()=>{l(b)})},{deep:!0}),()=>f.h("canvas",{role:"img",ariaLabel:n.ariaLabel,ariaDescribedby:n.ariaDescribedby,ref:s},[f.h("p",{},[i.default?i.default():""])])}});function pl(n,t){return Pe.register(t),f.defineComponent({props:$f,setup(e,i){let{expose:s}=i;const r=f.shallowRef(null),o=a=>{r.value=a==null?void 0:a.chart};return s({chart:r}),()=>f.h(yk,fk({ref:o},{type:n,...e}))}})}const bk=pl("bar",Ji),Xf=pl("doughnut",sn),_k=pl("line",ts),xk={class:"chart-container"},wk=f.defineComponent({__name:"DonutChart",props:{chartData:{type:Object,required:!1,default:null},tooltipTitle:{type:String,required:!0},metricUnit:{type:String,required:!1,default:""},legendPosition:{type:String,required:!1,default:It.Right},legendValues:{type:Object,required:!1,default:null},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:on}},setup(n){const t=n,{translateUnit:e}=yt.useTranslatedUnits(),i=f.ref(On()),s=f.ref(On()),r=f.ref([]),o=f.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:f.toRef(t,"metricUnit"),translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartType:"donut"}),a={id:i.value,afterUpdate(b){r.value=b.options.plugins.legend.labels.generateLabels(b).map(w=>({...w,value:t.legendValues&&t.legendValues[w.text],hidden:!1}))}},l=f.computed(()=>[a]),c=f.computed(()=>[t.chartData.datasets.reduce((w,v)=>(w.labels.push(v.label),w.backgroundColor.push(v.backgroundColor),w.borderColor.push(Gd(v.backgroundColor,50)),w.data.push(v.data.reduce((S,D)=>S+D,0)),w),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),u=f.computed(()=>({...t.chartData,datasets:c.value}));yt.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey"));const{options:d}=yt.useDonutChartOptions({tooltipState:o,legendID:i.value}),h=f.ref(),g=b=>({[It.Right]:"legend-row",[It.Bottom]:"column",[It.Hidden]:"hidden"})[b],p=({width:b,height:w})=>{o.width=b,o.height=w};return(b,w)=>(f.openBlock(),f.createElementBlock("div",{class:f.normalizeClass(["chart-parent",g(n.legendPosition)]),"data-testid":"donut-chart-parent"},[f.createElementVNode("div",xk,[f.createVNode(f.unref(Xf),{ref_key:"chartInstance",ref:h,"chart-id":s.value,data:u.value,options:f.unref(d),plugins:l.value},null,8,["chart-id","data","options","plugins"]),f.createVNode(hl,{left:o.left,series:o.tooltipSeries,"show-tooltip":o.showTooltip,"tooltip-title":n.tooltipTitle,top:o.top,unit:n.metricUnit,onDimensions:p},null,8,["left","series","show-tooltip","tooltip-title","top","unit"])]),f.createVNode(fl,{id:i.value,"chart-instance":h.value,items:r.value,position:n.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),vk=cn(wk,[["__scopeId","data-v-966d2ad0"]]),Gf=(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()},Rs={id:"linePlugin",afterDatasetsDraw:function(n){if(!this.pause&&n.tooltip&&n.tooltip.getActiveElements()&&n.tooltip.getActiveElements().length&&!this.clickedSegment){const{x:t}=n.tooltip.dataPoints[0].element,e=n.ctx;Gf(e,t,n.scales.y.top,n.scales.y.bottom)}if(!this.pause&&this.clickedSegment){const{x:t}=this.clickedSegment.element,e=n.ctx;Gf(e,t,n.scales.y.top,n.scales.y.bottom)}},beforeDestroy(){delete this.clickedSegment}},Mk=(n,t,e)=>{const i=n.ctx;i.save(),i.fillStyle="rgba(200, 200, 200, 0.5)",i.fillRect(t,n.chartArea.top,e-t,n.chartArea.bottom-n.chartArea.top),i.restore()},Kf=(n,t,e)=>{const i=t.scales.x.getValueForPixel(e.startX),s=t.scales.x.getValueForPixel(e.endX);t.canvas.dispatchEvent(new CustomEvent(n,{detail:{xStart:i,xEnd:s}}))},Sk={id:"dragSelectPlugin",isDragging:!1,startX:0,endX:0,beforeInit:function(n){const t=n.canvas,e=t.getBoundingClientRect();let i=!1;const s=a=>{this.dragTimeout=window.setTimeout(()=>{this.isDragging=!0,i=!0,this.startX=a.clientX-e.left},150)},r=a=>{i&&this.isDragging&&(this.endX=a.clientX-e.left,Kf("dragSelectMove",n,this),n.update())},o=a=>{clearTimeout(this.dragTimeout),i&&this.isDragging&&(this.endX=a.clientX-e.left,Kf("dragSelect",n,this),n.update(),this.isDragging=!1,i=!1)};t.addEventListener("mousedown",s),t.addEventListener("mousemove",r),t.addEventListener("mouseup",o),this.dragSelectHandlers={onMouseDown:s,onMouseMove:r,onMouseUp:o}},beforeDestroy(n){const t=n.canvas;if(this.dragSelectHandlers){const{onMouseDown:e,onMouseMove:i,onMouseUp:s}=this.dragSelectHandlers;t.removeEventListener("mousedown",e),t.removeEventListener("mousemove",i),t.removeEventListener("mouseup",s)}this.isDragging=!1},afterDatasetsDraw:function(n){this.isDragging&&Mk(n,this.startX,this.endX)}},kk=cn(f.defineComponent({__name:"TimeSeriesChart",props:{chartData:{type:Object,required:!1,default:null},type:{type:String,required:!1,default:"timeseries_line"},fill:{type:Boolean,required:!1,default:!1},tooltipTitle:{type:String,required:!0},metricUnit:{type:String,required:!1,default:""},timeRangeMs:{type:Number,required:!1,default:void 0},granularity:{type:String,required:!0},stacked:{type:Boolean,required:!1,default:!0},legendValues:{type:Object,required:!1,default:null},metricAxesTitle:{type:String,required:!1,default:null},dimensionAxesTitle:{type:String,required:!1,default:null},syntheticsDataKey:{type:String,required:!1,default:""},chartLegendSortFn:{type:Function,required:!1,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,required:!1,default:(n,t)=>t.rawValue-n.rawValue},zoom:{type:Boolean,required:!1,default:!1}},emits:["zoom-time-range"],setup(n,{emit:t}){const e=n,i=t,{translateUnit:s}=yt.useTranslatedUnits(),r=f.ref(),o=f.ref(On()),a=f.ref(On()),l=f.ref([]),c=f.ref(),u=f.ref(f.inject("legendPosition",It.Right)),d=f.ref(!1),h=f.reactive({showTooltip:!1,tooltipContext:0,tooltipSeries:[],left:"",top:"",units:f.toRef(e,"metricUnit"),translateUnit:s,offsetX:0,offsetY:0,width:0,height:0,chartType:e.type,locked:!1,chartTooltipSortFn:e.chartTooltipSortFn}),g={id:o.value,afterUpdate(_){l.value=Vd(_,e.legendValues,e.chartLegendSortFn)}},p=f.computed(()=>[g,Yf,...e.zoom?[Sk]:[],...e.type==="timeseries_line"?[Rs]:[]]),b=f.computed(()=>`line-${p.value.map(_=>_.id).join("-")}`),w=f.computed(()=>`bar-${p.value.map(_=>_.id).join("-")}`),v=f.computed(()=>Qx(e.chartData)),{options:S}=yt.useLinechartOptions({tooltipState:h,timeRangeMs:f.toRef(e,"timeRangeMs"),granularity:f.toRef(e,"granularity"),legendID:o.value,stacked:f.toRef(e,"stacked"),metricAxesTitle:f.toRef(e,"metricAxesTitle"),dimensionAxesTitle:f.toRef(e,"dimensionAxesTitle"),pointsWithoutHover:v});yt.useReportChartDataForSynthetics(f.toRef(e,"chartData"),f.toRef(e,"syntheticsDataKey"));const D=_=>yh(new Date(_),e.granularity,!0),k=_=>({[It.Right]:"legend-row",[It.Bottom]:"column",[It.Hidden]:"hidden"})[_],C=({width:_,height:T})=>{h.width=_,h.height=T},R=()=>{var _,T,A;h.locked=!h.locked,r.value&&((T=(_=r.value.chart.tooltip)==null?void 0:_.dataPoints)!=null&&T.length)&&(Rs.clickedSegment=h.locked?(A=r.value.chart.tooltip)==null?void 0:A.dataPoints[0]:void 0)};f.watch(()=>e.type,()=>{h.locked=!1,h.showTooltip=!1,delete Rs.clickedSegment});const E=_=>{const{xStart:T,xEnd:A}=_.detail;T&&A&&i("zoom-time-range",{start:new Date(T),end:new Date(A),type:"absolute"}),d.value=!1,R(),Rs.pause=!1},m=()=>{d.value=!0,Rs.pause=!0};return f.watch(()=>{var _;return(_=r.value)==null?void 0:_.chart},()=>{var _;(_=r.value)!=null&&_.chart&&(r.value.chart.canvas.removeEventListener("dragSelect",E),r.value.chart.canvas.removeEventListener("dragSelectMove",m),r.value.chart.canvas.addEventListener("dragSelect",E),r.value.chart.canvas.addEventListener("dragSelectMove",m))}),f.onUnmounted(()=>{var _;(_=r.value)!=null&&_.chart&&(r.value.chart.canvas.removeEventListener("dragSelect",E),r.value.chart.canvas.removeEventListener("dragSelectMove",m))}),(_,T)=>(f.openBlock(),f.createElementBlock("div",{class:f.normalizeClass(["chart-parent",k(u.value)]),"data-testid":"line-chart-parent"},[f.createElementVNode("div",{class:"chart-container",onClick:T[0]||(T[0]=A=>R())},[n.type==="timeseries_line"?(f.openBlock(),f.createBlock(f.unref(_k),{key:b.value,ref_key:"chartInstance",ref:r,"chart-id":a.value,class:"chart-canvas",data:n.chartData,"data-testid":"time-series-line-chart",options:f.unref(S),plugins:p.value},null,8,["chart-id","data","options","plugins"])):n.type==="timeseries_bar"?(f.openBlock(),f.createBlock(f.unref(bk),{key:w.value,ref_key:"chartInstance",ref:r,"chart-id":a.value,class:"chart-canvas",data:n.chartData,"data-testid":"time-series-bar-chart",options:f.unref(S),plugins:p.value},null,8,["chart-id","data","options","plugins"])):f.createCommentVNode("",!0)]),d.value?f.createCommentVNode("",!0):(f.openBlock(),f.createBlock(hl,{key:0,ref_key:"tooltipElement",ref:c,context:D(h.tooltipContext),"data-testid":"tooltip",left:h.left,locked:h.locked,series:h.tooltipSeries,"show-tooltip":h.showTooltip,"tooltip-title":n.tooltipTitle,top:h.top,unit:n.metricUnit,onDimensions:C,onLeft:T[1]||(T[1]=A=>h.left=A),onTop:T[2]||(T[2]=A=>h.top=A)},null,8,["context","left","locked","series","show-tooltip","tooltip-title","top","unit"])),f.createVNode(fl,{id:o.value,"chart-instance":r.value,"data-testid":"legend",items:l.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-4ca2b965"]]),Dk=["hidden","single","full"];var ii=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(ii||{});const Tk=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar"],Ck=["gauge","top_n"];var Qr={exports:{}};Qr.exports,function(n,t){var e=200,i="Expected a function",s="__lodash_hash_undefined__",r=1,o=2,a=1/0,l=9007199254740991,c="[object Arguments]",u="[object Array]",d="[object Boolean]",h="[object Date]",g="[object Error]",p="[object Function]",b="[object GeneratorFunction]",w="[object Map]",v="[object Number]",S="[object Object]",D="[object Promise]",k="[object RegExp]",C="[object Set]",R="[object String]",E="[object Symbol]",m="[object WeakMap]",_="[object ArrayBuffer]",T="[object DataView]",A="[object Float32Array]",L="[object Float64Array]",N="[object Int8Array]",B="[object Int16Array]",G="[object Int32Array]",U="[object Uint8Array]",H="[object Uint8ClampedArray]",ut="[object Uint16Array]",Y="[object Uint32Array]",et=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Dt=/^\w*$/,$=/^\./,z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,j=/[\\^$.*+?()[\]{}|]/g,X=/\\(\\)?/g,Z=/^\[object .+?Constructor\]$/,tt=/^(?:0|[1-9]\d*)$/,q={};q[A]=q[L]=q[N]=q[B]=q[G]=q[U]=q[H]=q[ut]=q[Y]=!0,q[c]=q[u]=q[_]=q[d]=q[T]=q[h]=q[g]=q[p]=q[w]=q[v]=q[S]=q[k]=q[C]=q[R]=q[m]=!1;var V=typeof me=="object"&&me&&me.Object===Object&&me,ot=typeof self=="object"&&self&&self.Object===Object&&self,J=V||ot||Function("return this")(),Ct=t&&!t.nodeType&&t,pt=Ct&&!0&&n&&!n.nodeType&&n,Rt=pt&&pt.exports===Ct,bt=Rt&&V.process,ft=function(){try{return bt&&bt.binding("util")}catch{}}(),$t=ft&&ft.isTypedArray;function ie(y,M){for(var I=-1,W=y?y.length:0;++I<W;)if(M(y[I],I,y))return!0;return!1}function ye(y){return function(M){return M==null?void 0:M[y]}}function se(y,M){for(var I=-1,W=Array(y);++I<y;)W[I]=M(I);return W}function Kt(y){return function(M){return y(M)}}function St(y,M){return y==null?void 0:y[M]}function Tt(y){var M=!1;if(y!=null&&typeof y.toString!="function")try{M=!!(y+"")}catch{}return M}function Zt(y){var M=-1,I=Array(y.size);return y.forEach(function(W,at){I[++M]=[at,W]}),I}function gt(y,M){return function(I){return y(M(I))}}function Ge(y){var M=-1,I=Array(y.size);return y.forEach(function(W){I[++M]=W}),I}var be=Array.prototype,Re=Function.prototype,re=Object.prototype,_e=J["__core-js_shared__"],Te=function(){var y=/[^.]+$/.exec(_e&&_e.keys&&_e.keys.IE_PROTO||"");return y?"Symbol(src)_1."+y:""}(),te=Re.toString,oe=re.hasOwnProperty,zt=re.toString,Ci=RegExp("^"+te.call(oe).replace(j,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),En=J.Symbol,Oi=J.Uint8Array,si=re.propertyIsEnumerable,Ls=be.splice,Is=gt(Object.keys,Object),ri=we(J,"DataView"),ze=we(J,"Map"),Ns=we(J,"Promise"),Fs=we(J,"Set"),zs=we(J,"WeakMap"),oi=we(Object,"create"),bl=Ye(ri),Jr=Ye(ze),to=Ye(Ns),un=Ye(Fs),_l=Ye(zs),Pi=En?En.prototype:void 0,Bs=Pi?Pi.valueOf:void 0,eo=Pi?Pi.toString:void 0;function dn(y){var M=-1,I=y?y.length:0;for(this.clear();++M<I;){var W=y[M];this.set(W[0],W[1])}}function Be(){this.__data__=oi?oi(null):{}}function xl(y){return this.has(y)&&delete this.__data__[y]}function wl(y){var M=this.__data__;if(oi){var I=M[y];return I===s?void 0:I}return oe.call(M,y)?M[y]:void 0}function vl(y){var M=this.__data__;return oi?M[y]!==void 0:oe.call(M,y)}function Ml(y,M){var I=this.__data__;return I[y]=oi&&M===void 0?s:M,this}dn.prototype.clear=Be,dn.prototype.delete=xl,dn.prototype.get=wl,dn.prototype.has=vl,dn.prototype.set=Ml;function He(y){var M=-1,I=y?y.length:0;for(this.clear();++M<I;){var W=y[M];this.set(W[0],W[1])}}function An(){this.__data__=[]}function Sl(y){var M=this.__data__,I=Ai(M,y);if(I<0)return!1;var W=M.length-1;return I==W?M.pop():Ls.call(M,I,1),!0}function kl(y){var M=this.__data__,I=Ai(M,y);return I<0?void 0:M[I][1]}function Dl(y){return Ai(this.__data__,y)>-1}function Tl(y,M){var I=this.__data__,W=Ai(I,y);return W<0?I.push([y,M]):I[W][1]=M,this}He.prototype.clear=An,He.prototype.delete=Sl,He.prototype.get=kl,He.prototype.has=Dl,He.prototype.set=Tl;function We(y){var M=-1,I=y?y.length:0;for(this.clear();++M<I;){var W=y[M];this.set(W[0],W[1])}}function Rn(){this.__data__={hash:new dn,map:new(ze||He),string:new dn}}function Cl(y){return Li(this,y).delete(y)}function Ol(y){return Li(this,y).get(y)}function Pl(y){return Li(this,y).has(y)}function El(y,M){return Li(this,y).set(y,M),this}We.prototype.clear=Rn,We.prototype.delete=Cl,We.prototype.get=Ol,We.prototype.has=Pl,We.prototype.set=El;function Ei(y){var M=-1,I=y?y.length:0;for(this.__data__=new We;++M<I;)this.add(y[M])}function Al(y){return this.__data__.set(y,s),this}function no(y){return this.__data__.has(y)}Ei.prototype.add=Ei.prototype.push=Al,Ei.prototype.has=no;function xe(y){this.__data__=new He(y)}function Rl(){this.__data__=new He}function Hs(y){return this.__data__.delete(y)}function Ll(y){return this.__data__.get(y)}function Il(y){return this.__data__.has(y)}function Nl(y,M){var I=this.__data__;if(I instanceof He){var W=I.__data__;if(!ze||W.length<e-1)return W.push([y,M]),this;I=this.__data__=new We(W)}return I.set(y,M),this}xe.prototype.clear=Rl,xe.prototype.delete=Hs,xe.prototype.get=Ll,xe.prototype.has=Il,xe.prototype.set=Nl;function Fl(y,M){var I=O(y)||x(y)?se(y.length,String):[],W=I.length,at=!!W;for(var Q in y)oe.call(y,Q)&&!(at&&(Q=="length"||uo(Q,W)))&&I.push(Q);return I}function Ai(y,M){for(var I=y.length;I--;)if(go(y[I][0],M))return I;return-1}var zl=Ul();function Ws(y,M){return y&&zl(y,M,Fn)}function io(y,M){M=In(M,y)?[M]:oo(M);for(var I=0,W=M.length;y!=null&&I<W;)y=y[Ni(M[I++])];return I&&I==W?y:void 0}function Bl(y){return zt.call(y)}function Hl(y,M){return y!=null&&M in Object(y)}function Ys(y,M,I,W,at){return y===M?!0:y==null||M==null||!ve(y)&&!Ut(M)?y!==y&&M!==M:Wl(y,M,Ys,I,W,at)}function Wl(y,M,I,W,at,Q){var ht=O(y),qt=O(M),Bt=u,ae=u;ht||(Bt=Ke(y),Bt=Bt==c?S:Bt),qt||(ae=Ke(M),ae=ae==c?S:ae);var Me=Bt==S&&!Tt(y),Se=ae==S&&!Tt(M),de=Bt==ae;if(de&&!Me)return Q||(Q=new xe),ht||Nn(y)?ao(y,M,I,W,at,Q):ql(y,M,Bt,I,W,at,Q);if(!(at&o)){var Le=Me&&oe.call(y,"__wrapped__"),Ie=Se&&oe.call(M,"__wrapped__");if(Le||Ie){var zn=Le?y.value():y,fn=Ie?M.value():M;return Q||(Q=new xe),I(zn,fn,W,at,Q)}}return de?(Q||(Q=new xe),Xl(y,M,I,W,at,Q)):!1}function Yl(y,M,I,W){var at=I.length,Q=at;if(y==null)return!Q;for(y=Object(y);at--;){var ht=I[at];if(ht[2]?ht[1]!==y[ht[0]]:!(ht[0]in y))return!1}for(;++at<Q;){ht=I[at];var qt=ht[0],Bt=y[qt],ae=ht[1];if(ht[2]){if(Bt===void 0&&!(qt in y))return!1}else{var Me=new xe,Se;if(!(Se===void 0?Ys(ae,Bt,W,r|o,Me):Se))return!1}}return!0}function jl(y){if(!ve(y)||Gl(y))return!1;var M=Vt(y)||Tt(y)?Ci:Z;return M.test(Ye(y))}function so(y){return Ut(y)&&Qt(y.length)&&!!q[zt.call(y)]}function Vl(y){return typeof y=="function"?y:y==null?jD:typeof y=="object"?O(y)?Ln(y[0],y[1]):Ri(y):VD(y)}function $l(y){if(!Kl(y))return Is(y);var M=[];for(var I in Object(y))oe.call(y,I)&&I!="constructor"&&M.push(I);return M}function Ri(y){var M=lo(y);return M.length==1&&M[0][2]?fo(M[0][0],M[0][1]):function(I){return I===y||Yl(I,y,M)}}function Ln(y,M){return In(y)&&js(M)?fo(Ni(y),M):function(I){var W=mo(I,y);return W===void 0&&W===M?yo(I,y):Ys(M,W,void 0,r|o)}}function ro(y){return function(M){return io(M,y)}}function hn(y){if(typeof y=="string")return y;if(Fi(y))return eo?eo.call(y):"";var M=y+"";return M=="0"&&1/y==-a?"-0":M}function oo(y){return O(y)?y:Ii(y)}function Ul(y){return function(M,I,W){for(var at=-1,Q=Object(M),ht=W(M),qt=ht.length;qt--;){var Bt=ht[++at];if(I(Q[Bt],Bt,Q)===!1)break}return M}}function ao(y,M,I,W,at,Q){var ht=at&o,qt=y.length,Bt=M.length;if(qt!=Bt&&!(ht&&Bt>qt))return!1;var ae=Q.get(y);if(ae&&Q.get(M))return ae==M;var Me=-1,Se=!0,de=at&r?new Ei:void 0;for(Q.set(y,M),Q.set(M,y);++Me<qt;){var Le=y[Me],Ie=M[Me];if(W)var zn=ht?W(Ie,Le,Me,M,y,Q):W(Le,Ie,Me,y,M,Q);if(zn!==void 0){if(zn)continue;Se=!1;break}if(de){if(!ie(M,function(fn,ai){if(!de.has(ai)&&(Le===fn||I(Le,fn,W,at,Q)))return de.add(ai)})){Se=!1;break}}else if(!(Le===Ie||I(Le,Ie,W,at,Q))){Se=!1;break}}return Q.delete(y),Q.delete(M),Se}function ql(y,M,I,W,at,Q,ht){switch(I){case T:if(y.byteLength!=M.byteLength||y.byteOffset!=M.byteOffset)return!1;y=y.buffer,M=M.buffer;case _:return!(y.byteLength!=M.byteLength||!W(new Oi(y),new Oi(M)));case d:case h:case v:return go(+y,+M);case g:return y.name==M.name&&y.message==M.message;case k:case R:return y==M+"";case w:var qt=Zt;case C:var Bt=Q&o;if(qt||(qt=Ge),y.size!=M.size&&!Bt)return!1;var ae=ht.get(y);if(ae)return ae==M;Q|=r,ht.set(y,M);var Me=ao(qt(y),qt(M),W,at,Q,ht);return ht.delete(y),Me;case E:if(Bs)return Bs.call(y)==Bs.call(M)}return!1}function Xl(y,M,I,W,at,Q){var ht=at&o,qt=Fn(y),Bt=qt.length,ae=Fn(M),Me=ae.length;if(Bt!=Me&&!ht)return!1;for(var Se=Bt;Se--;){var de=qt[Se];if(!(ht?de in M:oe.call(M,de)))return!1}var Le=Q.get(y);if(Le&&Q.get(M))return Le==M;var Ie=!0;Q.set(y,M),Q.set(M,y);for(var zn=ht;++Se<Bt;){de=qt[Se];var fn=y[de],ai=M[de];if(W)var ag=ht?W(ai,fn,de,M,y,Q):W(fn,ai,de,y,M,Q);if(!(ag===void 0?fn===ai||I(fn,ai,W,at,Q):ag)){Ie=!1;break}zn||(zn=de=="constructor")}if(Ie&&!zn){var bo=y.constructor,_o=M.constructor;bo!=_o&&"constructor"in y&&"constructor"in M&&!(typeof bo=="function"&&bo instanceof bo&&typeof _o=="function"&&_o instanceof _o)&&(Ie=!1)}return Q.delete(y),Q.delete(M),Ie}function Li(y,M){var I=y.__data__;return ho(M)?I[typeof M=="string"?"string":"hash"]:I.map}function lo(y){for(var M=Fn(y),I=M.length;I--;){var W=M[I],at=y[W];M[I]=[W,at,js(at)]}return M}function we(y,M){var I=St(y,M);return jl(I)?I:void 0}var Ke=Bl;(ri&&Ke(new ri(new ArrayBuffer(1)))!=T||ze&&Ke(new ze)!=w||Ns&&Ke(Ns.resolve())!=D||Fs&&Ke(new Fs)!=C||zs&&Ke(new zs)!=m)&&(Ke=function(y){var M=zt.call(y),I=M==S?y.constructor:void 0,W=I?Ye(I):void 0;if(W)switch(W){case bl:return T;case Jr:return w;case to:return D;case un:return C;case _l:return m}return M});function co(y,M,I){M=In(M,y)?[M]:oo(M);for(var W,at=-1,ht=M.length;++at<ht;){var Q=Ni(M[at]);if(!(W=y!=null&&I(y,Q)))break;y=y[Q]}if(W)return W;var ht=y?y.length:0;return!!ht&&Qt(ht)&&uo(Q,ht)&&(O(y)||x(y))}function uo(y,M){return M=M??l,!!M&&(typeof y=="number"||tt.test(y))&&y>-1&&y%1==0&&y<M}function In(y,M){if(O(y))return!1;var I=typeof y;return I=="number"||I=="symbol"||I=="boolean"||y==null||Fi(y)?!0:Dt.test(y)||!et.test(y)||M!=null&&y in Object(M)}function ho(y){var M=typeof y;return M=="string"||M=="number"||M=="symbol"||M=="boolean"?y!=="__proto__":y===null}function Gl(y){return!!Te&&Te in y}function Kl(y){var M=y&&y.constructor,I=typeof M=="function"&&M.prototype||re;return y===I}function js(y){return y===y&&!ve(y)}function fo(y,M){return function(I){return I==null?!1:I[y]===M&&(M!==void 0||y in Object(I))}}var Ii=Vs(function(y){y=po(y);var M=[];return $.test(y)&&M.push(""),y.replace(z,function(I,W,at,Q){M.push(at?Q.replace(X,"$1"):W||I)}),M});function Ni(y){if(typeof y=="string"||Fi(y))return y;var M=y+"";return M=="0"&&1/y==-a?"-0":M}function Ye(y){if(y!=null){try{return te.call(y)}catch{}try{return y+""}catch{}}return""}function Vs(y,M){if(typeof y!="function"||M&&typeof M!="function")throw new TypeError(i);var I=function(){var W=arguments,at=M?M.apply(this,W):W[0],Q=I.cache;if(Q.has(at))return Q.get(at);var ht=y.apply(this,W);return I.cache=Q.set(at,ht),ht};return I.cache=new(Vs.Cache||We),I}Vs.Cache=We;function go(y,M){return y===M||y!==y&&M!==M}function x(y){return K(y)&&oe.call(y,"callee")&&(!si.call(y,"callee")||zt.call(y)==c)}var O=Array.isArray;function F(y){return y!=null&&Qt(y.length)&&!Vt(y)}function K(y){return Ut(y)&&F(y)}function Vt(y){var M=ve(y)?zt.call(y):"";return M==p||M==b}function Qt(y){return typeof y=="number"&&y>-1&&y%1==0&&y<=l}function ve(y){var M=typeof y;return!!y&&(M=="object"||M=="function")}function Ut(y){return!!y&&typeof y=="object"}function Fi(y){return typeof y=="symbol"||Ut(y)&&zt.call(y)==E}var Nn=$t?Kt($t):so;function po(y){return y==null?"":hn(y)}function mo(y,M,I){var W=y==null?void 0:io(y,M);return W===void 0?I:W}function yo(y,M){return y!=null&&co(y,M,Hl)}function Fn(y){return F(y)?Fl(y):$l(y)}function zi(y,M){var I={};return M=Vl(M),Ws(y,function(W,at,Q){I[M(W,at,Q)]=W}),I}function jD(y){return y}function VD(y){return In(y)?ye(Ni(y)):ro(y)}n.exports=zi}(Qr,Qr.exports);var Ok=Qr.exports;const Pk=Wa(Ok);var Ek=1/0,Ak=9007199254740991,Rk="[object Arguments]",Lk="[object Function]",Ik="[object GeneratorFunction]",Nk="[object Symbol]",Fk=typeof me=="object"&&me&&me.Object===Object&&me,zk=typeof self=="object"&&self&&self.Object===Object&&self,Bk=Fk||zk||Function("return this")();function Hk(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 Wk(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 Yk(n,t){for(var e=-1,i=t.length,s=n.length;++e<i;)n[s+e]=t[e];return n}var ml=Object.prototype,jk=ml.hasOwnProperty,yl=ml.toString,Zf=Bk.Symbol,Vk=ml.propertyIsEnumerable,Qf=Zf?Zf.isConcatSpreadable:void 0,Jf=Math.max;function $k(n,t,e,i,s){var r=-1,o=n.length;for(e||(e=Gk),s||(s=[]);++r<o;){var a=n[r];e(a)?Yk(s,a):s[s.length]=a}return s}function Uk(n,t){return n=Object(n),qk(n,t,function(e,i){return i in n})}function qk(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 Xk(n,t){return t=Jf(t===void 0?n.length-1:t,0),function(){for(var e=arguments,i=-1,s=Jf(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,Hk(n,this,o)}}function Gk(n){return Qk(n)||Zk(n)||!!(Qf&&n&&n[Qf])}function Kk(n){if(typeof n=="string"||sD(n))return n;var t=n+"";return t=="0"&&1/n==-Ek?"-0":t}function Zk(n){return tD(n)&&jk.call(n,"callee")&&(!Vk.call(n,"callee")||yl.call(n)==Rk)}var Qk=Array.isArray;function Jk(n){return n!=null&&nD(n.length)&&!eD(n)}function tD(n){return tg(n)&&Jk(n)}function eD(n){var t=iD(n)?yl.call(n):"";return t==Lk||t==Ik}function nD(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=Ak}function iD(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function tg(n){return!!n&&typeof n=="object"}function sD(n){return typeof n=="symbol"||tg(n)&&yl.call(n)==Nk}var rD=Xk(function(n,t){return n==null?{}:Uk(n,Wk($k(t),Kk))}),oD=rD;const aD=Wa(oD);var eg={exports:{}};(function(n,t){(function(e,i){i()})(me,function(){function e(c,u){return typeof u>"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function i(c,u,d){var h=new XMLHttpRequest;h.open("GET",c),h.responseType="blob",h.onload=function(){l(h.response,u,d)},h.onerror=function(){console.error("could not download file")},h.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 me=="object"&&me.global===me?me: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 h=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=h.createObjectURL(c),setTimeout(function(){h.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 h=document.createElement("a");h.href=c,h.target="_blank",setTimeout(function(){r(h)})}}:function(c,u,d,h){if(h=h||open("","_blank"),h&&(h.document.title=h.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,b=/CriOS\/[\d]+/.test(navigator.userAgent);if((b||g&&p||a)&&typeof FileReader<"u"){var w=new FileReader;w.onloadend=function(){var D=w.result;D=b?D:D.replace(/^data:[^;]*;/,"data:attachment/file;"),h?h.location.href=D:location=D,h=null},w.readAsDataURL(c)}else{var v=o.URL||o.webkitURL,S=v.createObjectURL(c);h?h.location=S:location.href=S,h=null,setTimeout(function(){v.revokeObjectURL(S)},4e4)}});o.saveAs=l.saveAs=l,n.exports=l})})(eg);var lD=eg.exports,ng={exports:{}};/* @license
29
29
  Papa Parse
30
30
  v5.4.1
31
31
  https://github.com/mholt/PapaParse
@@ -40,4 +40,4 @@ License: MIT
40
40
  `&&A!=="\r"&&A!==`\r
41
41
  `&&(A=`
42
42
  `);var H=0,ut=!1;this.parse=function(Y,et,Dt){if(typeof Y!="string")throw new Error("Input must be a string");var $=Y.length,z=T.length,j=A.length,X=L.length,Z=E(N),tt=[],q=[],V=[],ot=H=0;if(!Y)return te();if(m.header&&!et){var J=Y.split(A)[0].split(T),Ct=[],pt={},Rt=!1;for(var bt in J){var ft=J[bt];E(m.transformHeader)&&(ft=m.transformHeader(ft,bt));var $t=ft,ie=pt[ft]||0;for(0<ie&&(Rt=!0,$t=ft+"_"+ie),pt[ft]=ie+1;Ct.includes($t);)$t=$t+"_"+ie;Ct.push($t)}if(Rt){var ye=Y.split(A);ye[0]=Ct.join(T),Y=ye.join(A)}}if(G||G!==!1&&Y.indexOf(_)===-1){for(var se=Y.split(A),Kt=0;Kt<se.length;Kt++){if(V=se[Kt],H+=V.length,Kt!==se.length-1)H+=A.length;else if(Dt)return te();if(!L||V.substring(0,X)!==L){if(Z){if(tt=[],Re(V.split(T)),oe(),ut)return te()}else Re(V.split(T));if(B&&B<=Kt)return tt=tt.slice(0,B),te(!0)}}return te()}for(var St=Y.indexOf(T,H),Tt=Y.indexOf(A,H),Zt=new RegExp(w(U)+w(_),"g"),gt=Y.indexOf(_,H);;)if(Y[H]!==_)if(L&&V.length===0&&Y.substring(H,H+X)===L){if(Tt===-1)return te();H=Tt+j,Tt=Y.indexOf(A,H),St=Y.indexOf(T,H)}else if(St!==-1&&(St<Tt||Tt===-1))V.push(Y.substring(H,St)),H=St+z,St=Y.indexOf(T,H);else{if(Tt===-1)break;if(V.push(Y.substring(H,Tt)),Te(Tt+j),Z&&(oe(),ut))return te();if(B&&tt.length>=B)return te(!0)}else for(gt=H,H++;;){if((gt=Y.indexOf(_,gt+1))===-1)return Dt||q.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:tt.length,index:H}),_e();if(gt===$-1)return _e(Y.substring(H,gt).replace(Zt,_));if(_!==U||Y[gt+1]!==U){if(_===U||gt===0||Y[gt-1]!==U){St!==-1&&St<gt+1&&(St=Y.indexOf(T,gt+1)),Tt!==-1&&Tt<gt+1&&(Tt=Y.indexOf(A,gt+1));var Ge=re(Tt===-1?St:Math.min(St,Tt));if(Y.substr(gt+1+Ge,z)===T){V.push(Y.substring(H,gt).replace(Zt,_)),Y[H=gt+1+Ge+z]!==_&&(gt=Y.indexOf(_,H)),St=Y.indexOf(T,H),Tt=Y.indexOf(A,H);break}var be=re(Tt);if(Y.substring(gt+1+be,gt+1+be+j)===A){if(V.push(Y.substring(H,gt).replace(Zt,_)),Te(gt+1+be+j),St=Y.indexOf(T,H),gt=Y.indexOf(_,H),Z&&(oe(),ut))return te();if(B&&tt.length>=B)return te(!0);break}q.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:tt.length,index:H}),gt++}}else gt++}return _e();function Re(zt){tt.push(zt),ot=H}function re(zt){var Ci=0;if(zt!==-1){var En=Y.substring(gt+1,zt);En&&En.trim()===""&&(Ci=En.length)}return Ci}function _e(zt){return Dt||(zt===void 0&&(zt=Y.substring(H)),V.push(zt),H=$,Re(V),Z&&oe()),te()}function Te(zt){H=zt,Re(V),V=[],Tt=Y.indexOf(A,H)}function te(zt){return{data:tt,errors:q,meta:{delimiter:T,linebreak:A,aborted:ut,truncated:!!zt,cursor:ot+(et||0)}}}function oe(){N(te()),tt=[],q=[]}},this.abort=function(){ut=!0},this.getCharIndex=function(){return H}}function S(m){var _=m.data,T=o[_.workerId],A=!1;if(_.error)T.userError(_.error,_.file);else if(_.results&&_.results.data){var L={abort:function(){A=!0,D(_.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:k,resume:k};if(E(T.userStep)){for(var N=0;N<_.results.data.length&&(T.userStep({data:_.results.data[N],errors:_.results.errors,meta:_.results.meta},L),!A);N++);delete _.results}else E(T.userChunk)&&(T.userChunk(_.results,L,_.file),delete _.results)}_.finished&&!A&&D(_.workerId,_.results)}function D(m,_){var T=o[m];E(T.userComplete)&&T.userComplete(_),T.terminate(),delete o[m]}function k(){throw new Error("Not implemented.")}function C(m){if(typeof m!="object"||m===null)return m;var _=Array.isArray(m)?[]:{};for(var T in m)_[T]=C(m[T]);return _}function R(m,_){return function(){m.apply(_,arguments)}}function E(m){return typeof m=="function"}return r&&(i.onmessage=function(m){var _=m.data;if(l.WORKER_ID===void 0&&_&&(l.WORKER_ID=_.workerId),typeof _.input=="string")i.postMessage({workerId:l.WORKER_ID,results:l.parse(_.input,_.config),finished:!0});else if(i.File&&_.input instanceof File||_.input instanceof Object){var T=l.parse(_.input,_.config);T&&i.postMessage({workerId:l.WORKER_ID,results:T,finished:!0})}}),(d.prototype=Object.create(u.prototype)).constructor=d,(h.prototype=Object.create(u.prototype)).constructor=h,(g.prototype=Object.create(g.prototype)).constructor=g,(p.prototype=Object.create(u.prototype)).constructor=p,l})})(ng);var cD=ng.exports;const uD=["id"],dD=f.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=f.computed(()=>`export_${new Date().getTime()}`),r=f.computed(()=>{const u=l();return u.length?u:null}),o=()=>{const u=i.labels;if(typeof i.fields!==ii.Object)throw new Error("Labels needs to be a object containing key / value pairs.");return typeof u===ii.Object?d=>Pk(d,(h,g)=>u[g]||g):d=>d},a=()=>{const u=i.fields;if(typeof i.fields!==ii.Object&&!Array.isArray(u))throw new Error("Fields needs to be an array of strings.");return Array.isArray(u)?d=>aD(d,u):d=>d},l=()=>{if(typeof i.fields===ii.Undefined&&typeof i.labels===ii.Undefined)return i.data;const u=o(),d=a();return i.data.map(h=>u(d(h)))},c=()=>{if(!(r!=null&&r.value)){console.warn("No data to export");return}e("export-started",r.value);let u=cD.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});lD.saveAs(d,i.filename)}};return(u,d)=>(f.openBlock(),f.createElementBlock("div",{id:s.value,"data-testid":"export-csv",onClick:c},[f.renderSlot(u.$slots,"default",{},()=>[f.createTextVNode("Download "+f.toDisplayString(n.filename),1)])],8,uD))}}),hD=f.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(n){const t=n,e=f.computed(()=>Object.keys(t.headers));return(i,s)=>(f.openBlock(),f.createElementBlock("div",null,[f.createVNode(dD,{data:i.rows,fields:e.value,filename:i.filename,labels:i.headers},{default:f.withCtx(()=>[f.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),fD={class:"kong-ui-public-csv-export-modal"},gD={key:0,class:"selected-range"},pD={key:1,class:"text-muted",tag:"span"},ig=3,sg=f.defineComponent({__name:"CsvExportModal",props:{filename:{},modalDescription:{default:void 0},chartData:{}},emits:["toggleModal"],setup(n,{emit:t}){const{i18n:e}=yt.useI18n(),i=n,s=t,r=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,o=f.ref(!0),a=f.computed(()=>{var b,w;return!!((w=(b=i.chartData)==null?void 0:b.data)!=null&&w.length)}),l=f.ref(1),c=f.computed(()=>g.value.rows.length),u=yt.useChartSelectedRange(f.toRef(i,"chartData")),d=f.computed(()=>e.t("csvExport.previewRows",{rowsMax:Math.min(ig,c.value),rowsTotal:c.value,plural:c.value===1?"":"s"})),h=()=>{s("toggleModal",!1)},g=f.computed(()=>{var C,R,E;if(!a.value||!((C=i.chartData)!=null&&C.meta.metric_names))return{headers:[],rows:[],csvHeaders:{}};const b=i.chartData.data.some(m=>m.timestamp!==i.chartData.data[0].timestamp),w=i.chartData.data.map(m=>{const _=new Date(m.timestamp);return{...Object.keys(m.event).reduce((A,L)=>{if(L in i.chartData.meta.display){const N=m.event[L],B=i.chartData.meta.display[L];A[L]=N&&B&&B[N].name||m.event[L]}else A[L]=m.event[L];return A},{}),...b?{timestamp:Ha(_,"yyyy-MM-dd HH:mm:ss"),tzOffset:Ha(_,"XXX")}:{}}});let v=[];b&&(v=[{label:e.t("csvExport.Timestamp"),key:"timestamp"},{label:e.t("csvExport.UtcOffset"),key:"tzOffset"}]);const S="display"in i.chartData.meta&&((R=i.chartData.meta)!=null&&R.display)?(E=i.chartData.meta)==null?void 0:E.display:{},D=[...v,...Object.keys(S).map(m=>({label:e.t(`chartLabels.${m}`),key:m})),...i.chartData.meta.metric_names.map(m=>({label:e.t(`chartLabels.${m}`),key:m}))],k=D.reduce((m,_)=>(m[_.key]=_.label,m),{});return{headers:D,csvHeaders:k,rows:w}}),p=async()=>{const{rows:b}=g.value;return o.value=!1,{total:Number(b.length)||0,data:b.slice(0,ig)}};return f.watch(g,()=>{l.value++}),(b,w)=>{const v=f.resolveComponent("KEmptyState"),S=f.resolveComponent("KTableData"),D=f.resolveComponent("KButton"),k=f.resolveComponent("KModal");return f.openBlock(),f.createElementBlock("div",fD,[f.createVNode(k,{class:"vitals-report","data-testid":"csv-export-modal","show-dismiss-icon":"",title:f.unref(e).t("csvExport.exportPreview"),visible:"",onCancel:h,onKeyup:f.withKeys(h,["esc"])},{default:f.withCtx(()=>{var C;return[f.createElementVNode("div",null,[a.value?(f.openBlock(),f.createElementBlock("div",gD,[f.createElementVNode("p",null,f.toDisplayString(b.modalDescription?b.modalDescription:f.unref(e).t("csvExport.exportDescription")),1),f.createElementVNode("p",null,f.toDisplayString(f.unref(e).t("csvExport.exportTimeRange"))+": "+f.toDisplayString(f.unref(u)),1)])):f.createCommentVNode("",!0),f.createVNode(S,{class:"vitals-table",fetcher:p,"fetcher-cache-key":String(l.value),headers:((C=g.value)==null?void 0:C.headers)||[],"hide-pagination":"","row-hover":!1,sortable:!1},{"empty-state":f.withCtx(()=>[f.createVNode(v,{"action-button-visible":!1},{title:f.withCtx(()=>[f.createElementVNode("h5",null,f.toDisplayString(f.unref(e).t("csvExport.noDataRange")),1)]),default:f.withCtx(()=>[f.createElementVNode("p",null,f.toDisplayString(f.unref(e).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"]),!o.value&&a.value?(f.openBlock(),f.createElementBlock("div",pD,f.toDisplayString(d.value),1)):f.createCommentVNode("",!0)])]}),"footer-actions":f.withCtx(()=>[f.createVNode(D,{appearance:"tertiary",class:"cancel-btn",onClick:h},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(f.unref(e).t("csvExport.cancelButton")),1)]),_:1}),f.createVNode(hD,{class:"vitals-report-export-button",filename:r,headers:g.value.csvHeaders,rows:g.value.rows},{default:f.withCtx(()=>[f.createVNode(D,{appearance:"primary","data-testid":"csv-download-button",disabled:o.value||!a.value},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(f.unref(e).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}}),rg=f.defineComponent({__name:"CsvExportButton",props:{data:{type:Object,required:!0},text:{type:String,required:!1,default:void 0},buttonAppearance:{type:String,required:!1,default:()=>"tertiary"},filenamePrefix:{type:String,required:!1,default:void 0}},setup(n){const t=n,{i18n:e}=yt.useI18n(),i=f.computed(()=>t.filenamePrefix||e.t("csvExport.defaultFilename")),s=f.ref(!1),r=a=>{s.value=a},o=()=>{r(!0)};return(a,l)=>{const c=f.resolveComponent("KButton");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createVNode(c,{appearance:n.buttonAppearance,class:"chart-export-button-display","data-testid":"csv-export-button",onClick:f.withModifiers(o,["prevent"])},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(n.text||f.unref(e).t("csvExport.exportButton")),1)]),_:1},8,["appearance"]),s.value?(f.openBlock(),f.createBlock(sg,{key:0,"chart-data":n.data,filename:i.value,onToggleModal:r},null,8,["chart-data","filename"])):f.createCommentVNode("",!0)],64)}}}),mD={class:"analytics-chart-shell"},yD={key:0,class:"chart-header"},bD=["title"],_D={key:1,class:"chart-header-icons-wrapper"},xD={key:2,class:"chart-export-button"},wD={key:2,class:"analytics-chart-parent"},vD=f.defineComponent({__name:"AnalyticsChart",props:{allowCsvExport:{type:Boolean,required:!1,default:!1},chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},tooltipTitle:{type:String,required:!1,default:""},emptyStateTitle:{type:String,required:!1,default:""},emptyStateDescription:{type:String,required:!1,default:""},chartTitle:{type:String,required:!1,default:""},filenamePrefix:{type:String,required:!1,default:""},legendPosition:{type:String,required:!1,default:It.Right},syntheticsDataKey:{type:String,required:!1,default:""},showLegendValues:{type:Boolean,required:!1,default:!0},showAnnotations:{type:Boolean,required:!1,default:!0},threshold:{type:Object,required:!1,default:void 0},timeseriesZoom:{type:Boolean,required:!1,default:!1}},emits:["zoom-time-range"],setup(n,{emit:t}){const e=n,i=t,{i18n:s}=yt.useI18n(),{evaluateFeatureFlag:r}=yt.useEvaluateFeatureFlag(),o=r("ma-3043-analytics-chart-kebab-menu",!1),a=f.toRef(e,"chartData"),l=f.computed(()=>v.value?yt.useExploreResultToTimeDataset({fill:e.chartOptions.stacked,colorPalette:e.chartOptions.chartDatasetColors||Lr,threshold:e.chartOptions.threshold||void 0},f.toRef(e,"chartData")).value:yt.useExploreResultToDatasets({fill:e.chartOptions.stacked,colorPalette:e.chartOptions.chartDatasetColors||Lr},f.toRef(e,"chartData")).value),c=f.computed(()=>{var N;return(N=e.chartData)!=null&&N.meta?"start_ms"in e.chartData.meta?e.chartData.meta.end_ms-e.chartData.meta.start_ms:void 0:0}),u=f.computed(()=>{var N;return(N=e.chartData.meta)!=null&&N.metric_units?Object.values(e.chartData.meta.metric_units)[0]:""}),d=f.computed(()=>e.showLegendValues&&e.legendPosition!==It.Bottom),{legendValues:h}=yt.useChartLegendValues(l,e.chartOptions.type,u),g=f.computed(()=>{var N,B,G;return((G=(B=(N=e.chartData)==null?void 0:N.meta)==null?void 0:B.limit)==null?void 0:G.toString())||null}),p=f.computed(()=>{var N,B;return((B=(N=e.chartData)==null?void 0:N.meta)==null?void 0:B.truncated)||!1}),b=s.t("limitedResultsShown",{maxReturned:g.value}),w=f.computed(()=>["vertical_bar","horizontal_bar"].includes(e.chartOptions.type)),v=f.computed(()=>["timeseries_bar","timeseries_line"].some(N=>N===e.chartOptions.type)),S=f.computed(()=>e.chartOptions.type==="doughnut"),D=f.computed(()=>e.chartOptions.type.includes("vertical")?"vertical":"horizontal"),k=f.computed(()=>{var G,U,H;if(!((G=e.chartData)!=null&&G.meta.metric_names)||!((U=e.chartData)!=null&&U.meta.metric_units))return;const N=e.chartData.meta.metric_names[0],B=e.chartData.meta.metric_units[N];if(e.chartData.meta.metric_names.length>1){if(N.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${B}`,{plural:"s"})});if(N.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${B}`,{plural:"s"})})}return((H=e.chartOptions)==null?void 0:H.metricAxesTitle)||s.te(`metricAxisTitles.${N}`)&&s.te(`chartUnits.${B}`)&&s.t(`metricAxisTitles.${N}`,{unit:s.t(`chartUnits.${B}`,{plural:"s"})})||void 0}),C=f.computed(()=>{const N=v.value?"Time":Object.keys(e.chartData.meta.display||e.chartData.meta.metric_names)[0];return e.chartOptions.dimensionAxesTitle||s.te(`chartLabels.${N}`)&&s.t(`chartLabels.${N}`)||void 0}),R=f.computed(()=>{const N=Ka(Number(e.chartData.meta.granularity_ms));return s.t(`granularityAxisTitles.${N}`)}),E=f.computed(()=>e.emptyStateTitle||s.t("noDataAvailableTitle")),m=f.computed(()=>e.emptyStateDescription||s.t("noDataAvailableDescription")),_=f.computed(()=>v.value?Jx(l.value):e.chartData&&e.chartData.meta&&e.chartData.data.length),T=f.computed(()=>e.chartData.meta.granularity_ms?Ka(e.chartData.meta.granularity_ms)||"hourly":Ka(new Date(e.chartData.data[1].timestamp).getTime()-new Date(e.chartData.data[0].timestamp).getTime())||"hourly"),A=f.computed(()=>e.chartOptions.chartLegendSortFn?e.chartOptions.chartLegendSortFn:(N,B)=>N.text===s.t("chartLabels.____OTHER____")?1:B.text===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(N.text,10))&&!isNaN(parseInt(B.text,10))?N.text<B.text?-1:1:N.value&&B.value?B.value.raw-N.value.raw:0),L=f.computed(()=>e.chartOptions.chartTooltipSortFn?e.chartOptions.chartTooltipSortFn:(N,B)=>N.label===s.t("chartLabels.____OTHER____")?1:B.label===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(N.label,10))&&!isNaN(parseInt(B.label,10))?N.label<B.label?-1:1:N.value&&B.value?B.rawValue-N.rawValue:0);return f.provide("showLegendValues",d),f.provide("legendPosition",f.toRef(e,"legendPosition")),(N,B)=>{const G=f.resolveComponent("KTooltip"),U=f.resolveComponent("KEmptyState");return f.openBlock(),f.createElementBlock("div",mD,[_.value&&p.value&&g.value||!f.unref(o)&&(n.allowCsvExport||e.chartTitle)?(f.openBlock(),f.createElementBlock("div",yD,[n.chartTitle?(f.openBlock(),f.createElementBlock("div",{key:0,class:"chart-title",title:n.chartTitle},f.toDisplayString(n.chartTitle),9,bD)):f.createCommentVNode("",!0),_.value&&p.value&&g.value?(f.openBlock(),f.createElementBlock("div",_D,[f.createVNode(G,{class:"tooltip","max-width":"500",placement:"right"},{content:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(f.unref(b)),1)]),default:f.withCtx(()=>[f.createVNode(f.unref(Zl.WarningIcon),{color:`var(--kui-color-text-warning, ${f.unref(iM)})`,decorative:"",size:f.unref(sM)},null,8,["color","size"])]),_:1})])):f.createCommentVNode("",!0),!f.unref(o)&&n.allowCsvExport&&_.value?(f.openBlock(),f.createElementBlock("div",xD,[f.createVNode(rg,{data:a.value,"filename-prefix":n.filenamePrefix},null,8,["data","filename-prefix"])])):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0),_.value?(f.openBlock(),f.createElementBlock("div",wD,[v.value?(f.openBlock(),f.createBlock(kk,{key:0,"chart-data":l.value,"chart-legend-sort-fn":A.value,"chart-tooltip-sort-fn":L.value,"dimension-axes-title":R.value,fill:n.chartOptions.stacked,granularity:T.value,"legend-values":f.unref(h),"metric-axes-title":k.value,"metric-unit":u.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,threshold:n.threshold,"time-range-ms":c.value,"tooltip-title":n.tooltipTitle,type:n.chartOptions.type,zoom:n.timeseriesZoom,onZoomTimeRange:B[0]||(B[0]=H=>i("zoom-time-range",H))},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","threshold","time-range-ms","tooltip-title","type","zoom"])):w.value?(f.openBlock(),f.createBlock(uk,{key:1,annotations:n.showAnnotations,"chart-data":l.value,"chart-legend-sort-fn":A.value,"chart-tooltip-sort-fn":L.value,"data-testid":"bar-chart-container","dimension-axes-title":C.value,"legend-values":f.unref(h),"metric-axes-title":k.value,"metric-unit":u.value,orientation:D.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,"tooltip-title":n.tooltipTitle},null,8,["annotations","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","legend-values","metric-axes-title","metric-unit","orientation","stacked","synthetics-data-key","tooltip-title"])):S.value?(f.openBlock(),f.createBlock(vk,{key:2,"chart-data":l.value,"dataset-colors":n.chartOptions.chartDatasetColors||f.unref(Lr),"legend-position":n.legendPosition,"legend-values":f.unref(h),"metric-unit":u.value,"synthetics-data-key":n.syntheticsDataKey,"tooltip-title":n.tooltipTitle},null,8,["chart-data","dataset-colors","legend-position","legend-values","metric-unit","synthetics-data-key","tooltip-title"])):f.createCommentVNode("",!0)])):(f.openBlock(),f.createBlock(U,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(E.value),1)]),default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(m.value),1)]),_:1}))])}}}),MD=cn(vD,[["__scopeId","data-v-19cd92bf"]]),SD={class:"chart-parent","data-testid":"doughnut-chart-parent"},kD={class:"chart-totals-flex"},DD={key:1,class:"metric-small","data-testid":"doughnut-chart-total"},TD=cn(f.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:on},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}=yt.useI18n(),i=f.ref(On()),s=f.computed(()=>[t.chartData.datasets.reduce((p,b)=>(p.labels.push(b.label),p.borderColor.push(b.backgroundColor),p.backgroundColor.push(b.backgroundColor),p.data.push(b.data.reduce((w,v)=>w+v,0)),p),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),r=f.computed(()=>({...t.chartData,datasets:s.value}));yt.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey"));const o={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},a=f.ref(),l=f.computed(()=>{var g;return ws((g=s==null?void 0:s.value[0])==null?void 0:g.data[t.numerator],{capital:!0})}),c=f.computed(()=>{var g,p;return ws(((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=f.computed(()=>{var g;return`color: ${(g=s==null?void 0:s.value[0])==null?void 0:g.backgroundColor[t.numerator]}`}),d=f.computed(()=>["full","single"].includes(t.metricDisplay)),h=f.computed(()=>t.metricDisplay==="full");return(g,p)=>(f.openBlock(),f.createElementBlock("div",SD,[f.createElementVNode("div",kD,[d.value?(f.openBlock(),f.createElementBlock("div",{key:0,class:"metric-large","data-testid":"doughnut-chart-metric",style:f.normalizeStyle(u.value)},f.toDisplayString(l.value),5)):f.createCommentVNode("",!0),h.value?(f.openBlock(),f.createElementBlock("div",DD,f.toDisplayString(f.unref(e).t("total"))+": "+f.toDisplayString(c.value),1)):f.createCommentVNode("",!0)]),f.createElementVNode("div",{class:"chart-container",style:f.normalizeStyle({height:n.height,width:n.width})},[f.createVNode(f.unref(Xf),{ref_key:"chartInstance",ref:a,"chart-id":i.value,data:r.value,options:o},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-6596329c"]]),CD={class:"simple-chart-shell"},OD={key:1,class:"analytics-chart-parent"},PD=cn(f.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}=yt.useI18n(),i=f.computed(()=>{var c;const l=yt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||on},f.toRef(t,"chartData")).value;return(c=t.chartOptions)!=null&&c.reverseDataset&&(l==null||l.datasets.reverse()),l}),s=f.computed(()=>{var l;return(l=t.chartData.meta)!=null&&l.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""}),r=f.computed(()=>t.chartOptions.type==="gauge"),o=f.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),a=f.computed(()=>t.chartData&&t.chartData.meta&&t.chartData.data.length);return(l,c)=>{const u=f.resolveComponent("KEmptyState");return f.openBlock(),f.createElementBlock("div",CD,[a.value?(f.openBlock(),f.createElementBlock("div",OD,[r.value?(f.openBlock(),f.createBlock(TD,{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"])):f.createCommentVNode("",!0)])):(f.openBlock(),f.createBlock(u,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(o.value),1)]),_:1}))])}}}),[["__scopeId","data-v-9d13f2fd"]]),ED={class:"top-n-card-title","data-testid":"top-n-card-title"},AD={class:"top-n-card-description","data-testid":"top-n-card-description"},RD={key:3,class:"top-n-table","data-testid":"top-n-table"},LD={class:"table-headings"},ID={class:"table-row"},ND={class:"column-1"},FD={class:"column-2"},zD={class:"table-body","data-testid":"top-n-data"},BD=["data-testid"],HD={class:"column-1"},WD={class:"column-2"},YD=cn(f.defineComponent({__name:"TopNTable",props:{title:{type:String,required:!0},description:{type:String,default:""},data:{type:Object,required:!0},emptyStateTitle:{type:String,default:""},isLoading:{type:Boolean,default:!1},titleTag:{type:String,default:"h2"}},setup(n){const t=n,{i18n:e}=yt.useI18n(),i=f.computed(()=>t.data.data),s=f.computed(()=>{var p;return!!((p=i.value)!=null&&p.length)}),r=f.computed(()=>{var p,b;return(p=t.data.meta)!=null&&p.display&&((b=Object.keys(t.data.meta.display))==null?void 0:b[0])||""}),o=f.computed(()=>r.value?t.data.meta.display[r.value]:{}),a=f.computed(()=>{var p,b;return(b=(p=t.data.meta)==null?void 0:p.metric_names)!=null&&b.length?t.data.meta.metric_names[0]:""}),l=f.computed(()=>a.value?e.t(`chartLabels.${a.value}`)||a.value:""),c=f.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 b=p.event;return String(b[r.value])},d=p=>{const b=u(p),w=o.value&&o.value[b];return w?w.name:"-"},h=p=>{const b=u(p),w=o.value&&o.value[b];return w?!!w.deleted:!1},g=p=>{if(!a.value)return"–";const w=p.event[a.value];return w?ws(w,{capital:!0,round:!0}):"–"};return(p,b)=>{const w=f.resolveComponent("KEmptyState"),v=f.resolveComponent("KSkeleton"),S=f.resolveComponent("KCard");return f.openBlock(),f.createBlock(S,{class:"kong-ui-public-top-n-table","title-tag":n.titleTag},f.createSlots({default:f.withCtx(()=>[c.value?(f.openBlock(),f.createBlock(w,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(f.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(c.value),1)]),_:1})):n.isLoading?(f.openBlock(),f.createBlock(v,{key:1,"table-columns":2,type:"table"})):s.value?(f.openBlock(),f.createElementBlock("div",RD,[f.createElementVNode("div",LD,[f.createElementVNode("div",ID,[f.createElementVNode("div",ND,f.toDisplayString(f.unref(e).t("topNTable.nameLabel")),1),f.createElementVNode("div",FD,f.toDisplayString(l.value),1)])]),f.createElementVNode("div",zD,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(i.value,(D,k)=>(f.openBlock(),f.createElementBlock("div",{key:`entry-${k}`,class:"table-row","data-testid":`row-${u(D)}`},[f.createElementVNode("div",HD,[f.renderSlot(p.$slots,"name",{record:{id:u(D),name:d(D),deleted:h(D),dimension:r.value}},()=>[f.createTextVNode(f.toDisplayString(d(D)),1)],!0)]),f.createElementVNode("div",WD,"   "+f.toDisplayString(g(D)),1)],8,BD))),128))])])):(f.openBlock(),f.createBlock(w,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(n.emptyStateTitle||f.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[n.title?{name:"title",fn:f.withCtx(()=>[f.createElementVNode("span",ED,f.toDisplayString(n.title),1)]),key:"0"}:void 0,n.description?{name:"actions",fn:f.withCtx(()=>[f.createElementVNode("div",AD,f.toDisplayString(n.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-5db48d63"]]);nt.AnalyticsChart=MD,nt.ChartLegendPosition=It,nt.CsvExportButton=rg,nt.CsvExportModal=sg,nt.DECIMAL_DISPLAY=$d,nt.EMPTY_COLOR=Qd,nt.FONT_SIZE_REGULAR=qd,nt.FONT_SIZE_SMALL=Ud,nt.MAX_LABEL_LENGTH=Ar,nt.OTHERS_COLOR=rw,nt.SimpleChart=PD,nt.TopNTable=YD,nt.ValidType=ii,nt.accessibleGrey=Kd,nt.apiRequestStatusCodeColors=Zd,nt.chartTypes=Tk,nt.codesInSpec=nh,nt.darkenColor=Gd,nt.datavisPalette=on,nt.defaultStatusCodeColors=Lr,nt.determineBaseColor=Ca,nt.errorRateColors=iw,nt.latencyColors=sw,nt.lightGrey=Ea,nt.lookupColor=ow,nt.lookupDatavisColor=Rr,nt.lookupStatusCodeCategoryColor=fw,nt.lookupStatusCodeColor=Aa,nt.numberFormatter=Er,nt.simpleChartMetricDisplay=Dk,nt.simpleChartTypes=Ck,nt.statusCodeBadgeBackgroundColor=ew,nt.trafficColors=nw,Object.defineProperty(nt,Symbol.toStringTag,{value:"Module"})});
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});lD.saveAs(d,i.filename)}};return(u,d)=>(f.openBlock(),f.createElementBlock("div",{id:s.value,"data-testid":"export-csv",onClick:c},[f.renderSlot(u.$slots,"default",{},()=>[f.createTextVNode("Download "+f.toDisplayString(n.filename),1)])],8,uD))}}),hD=f.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(n){const t=n,e=f.computed(()=>Object.keys(t.headers));return(i,s)=>(f.openBlock(),f.createElementBlock("div",null,[f.createVNode(dD,{data:i.rows,fields:e.value,filename:i.filename,labels:i.headers},{default:f.withCtx(()=>[f.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),fD={class:"kong-ui-public-csv-export-modal"},gD={key:0,class:"selected-range"},pD={key:1,class:"text-muted",tag:"span"},ig=3,sg=f.defineComponent({__name:"CsvExportModal",props:{filename:{},modalDescription:{default:void 0},chartData:{}},emits:["toggleModal"],setup(n,{emit:t}){const{i18n:e}=yt.useI18n(),i=n,s=t,r=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,o=f.ref(!0),a=f.computed(()=>{var b,w;return!!((w=(b=i.chartData)==null?void 0:b.data)!=null&&w.length)}),l=f.ref(1),c=f.computed(()=>g.value.rows.length),u=yt.useChartSelectedRange(f.toRef(i,"chartData")),d=f.computed(()=>e.t("csvExport.previewRows",{rowsMax:Math.min(ig,c.value),rowsTotal:c.value,plural:c.value===1?"":"s"})),h=()=>{s("toggleModal",!1)},g=f.computed(()=>{var C,R,E;if(!a.value||!((C=i.chartData)!=null&&C.meta.metric_names))return{headers:[],rows:[],csvHeaders:{}};const b=i.chartData.data.some(m=>m.timestamp!==i.chartData.data[0].timestamp),w=i.chartData.data.map(m=>{const _=new Date(m.timestamp);return{...Object.keys(m.event).reduce((A,L)=>{if(L in i.chartData.meta.display){const N=m.event[L],B=i.chartData.meta.display[L];A[L]=N&&B&&B[N].name||m.event[L]}else A[L]=m.event[L];return A},{}),...b?{timestamp:Ha(_,"yyyy-MM-dd HH:mm:ss"),tzOffset:Ha(_,"XXX")}:{}}});let v=[];b&&(v=[{label:e.t("csvExport.Timestamp"),key:"timestamp"},{label:e.t("csvExport.UtcOffset"),key:"tzOffset"}]);const S="display"in i.chartData.meta&&((R=i.chartData.meta)!=null&&R.display)?(E=i.chartData.meta)==null?void 0:E.display:{},D=[...v,...Object.keys(S).map(m=>({label:e.t(`chartLabels.${m}`),key:m})),...i.chartData.meta.metric_names.map(m=>({label:e.t(`chartLabels.${m}`),key:m}))],k=D.reduce((m,_)=>(m[_.key]=_.label,m),{});return{headers:D,csvHeaders:k,rows:w}}),p=async()=>{const{rows:b}=g.value;return o.value=!1,{total:Number(b.length)||0,data:b.slice(0,ig)}};return f.watch(g,()=>{l.value++}),(b,w)=>{const v=f.resolveComponent("KEmptyState"),S=f.resolveComponent("KTableData"),D=f.resolveComponent("KButton"),k=f.resolveComponent("KModal");return f.openBlock(),f.createElementBlock("div",fD,[f.createVNode(k,{class:"vitals-report","data-testid":"csv-export-modal","show-dismiss-icon":"",title:f.unref(e).t("csvExport.exportPreview"),visible:"",onCancel:h,onKeyup:f.withKeys(h,["esc"])},{default:f.withCtx(()=>{var C;return[f.createElementVNode("div",null,[a.value?(f.openBlock(),f.createElementBlock("div",gD,[f.createElementVNode("p",null,f.toDisplayString(b.modalDescription?b.modalDescription:f.unref(e).t("csvExport.exportDescription")),1),f.createElementVNode("p",null,f.toDisplayString(f.unref(e).t("csvExport.exportTimeRange"))+": "+f.toDisplayString(f.unref(u)),1)])):f.createCommentVNode("",!0),f.createVNode(S,{class:"vitals-table",fetcher:p,"fetcher-cache-key":String(l.value),headers:((C=g.value)==null?void 0:C.headers)||[],"hide-pagination":"","row-hover":!1,sortable:!1},{"empty-state":f.withCtx(()=>[f.createVNode(v,{"action-button-visible":!1},{title:f.withCtx(()=>[f.createElementVNode("h5",null,f.toDisplayString(f.unref(e).t("csvExport.noDataRange")),1)]),default:f.withCtx(()=>[f.createElementVNode("p",null,f.toDisplayString(f.unref(e).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"]),!o.value&&a.value?(f.openBlock(),f.createElementBlock("div",pD,f.toDisplayString(d.value),1)):f.createCommentVNode("",!0)])]}),"footer-actions":f.withCtx(()=>[f.createVNode(D,{appearance:"tertiary",class:"cancel-btn",onClick:h},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(f.unref(e).t("csvExport.cancelButton")),1)]),_:1}),f.createVNode(hD,{class:"vitals-report-export-button",filename:r,headers:g.value.csvHeaders,rows:g.value.rows},{default:f.withCtx(()=>[f.createVNode(D,{appearance:"primary","data-testid":"csv-download-button",disabled:o.value||!a.value},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(f.unref(e).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}}),rg=f.defineComponent({__name:"CsvExportButton",props:{data:{type:Object,required:!0},text:{type:String,required:!1,default:void 0},buttonAppearance:{type:String,required:!1,default:()=>"tertiary"},filenamePrefix:{type:String,required:!1,default:void 0}},setup(n){const t=n,{i18n:e}=yt.useI18n(),i=f.computed(()=>t.filenamePrefix||e.t("csvExport.defaultFilename")),s=f.ref(!1),r=a=>{s.value=a},o=()=>{r(!0)};return(a,l)=>{const c=f.resolveComponent("KButton");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createVNode(c,{appearance:n.buttonAppearance,class:"chart-export-button-display","data-testid":"csv-export-button",onClick:f.withModifiers(o,["prevent"])},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(n.text||f.unref(e).t("csvExport.exportButton")),1)]),_:1},8,["appearance"]),s.value?(f.openBlock(),f.createBlock(sg,{key:0,"chart-data":n.data,filename:i.value,onToggleModal:r},null,8,["chart-data","filename"])):f.createCommentVNode("",!0)],64)}}}),mD={class:"analytics-chart-shell"},yD={key:0,class:"chart-header"},bD=["title"],_D={key:1,class:"chart-header-icons-wrapper"},xD={key:2,class:"chart-export-button"},wD={key:2,class:"analytics-chart-parent"},vD=f.defineComponent({__name:"AnalyticsChart",props:{allowCsvExport:{type:Boolean,required:!1,default:!1},chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},tooltipTitle:{type:String,required:!1,default:""},emptyStateTitle:{type:String,required:!1,default:""},emptyStateDescription:{type:String,required:!1,default:""},chartTitle:{type:String,required:!1,default:""},filenamePrefix:{type:String,required:!1,default:""},legendPosition:{type:String,required:!1,default:It.Right},syntheticsDataKey:{type:String,required:!1,default:""},showLegendValues:{type:Boolean,required:!1,default:!0},showAnnotations:{type:Boolean,required:!1,default:!0},threshold:{type:Object,required:!1,default:void 0},timeseriesZoom:{type:Boolean,required:!1,default:!1}},emits:["zoom-time-range"],setup(n,{emit:t}){const e=n,i=t,{i18n:s}=yt.useI18n(),{evaluateFeatureFlag:r}=yt.useEvaluateFeatureFlag(),o=r("ma-3043-analytics-chart-kebab-menu",!1),a=f.toRef(e,"chartData"),l=f.computed(()=>v.value?yt.useExploreResultToTimeDataset({fill:e.chartOptions.stacked,colorPalette:e.chartOptions.chartDatasetColors||Lr,threshold:e.chartOptions.threshold||void 0},f.toRef(e,"chartData")).value:yt.useExploreResultToDatasets({fill:e.chartOptions.stacked,colorPalette:e.chartOptions.chartDatasetColors||Lr},f.toRef(e,"chartData")).value),c=f.computed(()=>{var N;return(N=e.chartData)!=null&&N.meta?"start_ms"in e.chartData.meta?e.chartData.meta.end_ms-e.chartData.meta.start_ms:void 0:0}),u=f.computed(()=>{var N;return(N=e.chartData.meta)!=null&&N.metric_units?Object.values(e.chartData.meta.metric_units)[0]:""}),d=f.computed(()=>e.showLegendValues&&e.legendPosition!==It.Bottom),{legendValues:h}=yt.useChartLegendValues(l,e.chartOptions.type,u),g=f.computed(()=>{var N,B,G;return((G=(B=(N=e.chartData)==null?void 0:N.meta)==null?void 0:B.limit)==null?void 0:G.toString())||null}),p=f.computed(()=>{var N,B;return((B=(N=e.chartData)==null?void 0:N.meta)==null?void 0:B.truncated)||!1}),b=s.t("limitedResultsShown",{maxReturned:g.value}),w=f.computed(()=>["vertical_bar","horizontal_bar"].includes(e.chartOptions.type)),v=f.computed(()=>["timeseries_bar","timeseries_line"].some(N=>N===e.chartOptions.type)),S=f.computed(()=>e.chartOptions.type==="donut"),D=f.computed(()=>e.chartOptions.type.includes("vertical")?"vertical":"horizontal"),k=f.computed(()=>{var G,U,H;if(!((G=e.chartData)!=null&&G.meta.metric_names)||!((U=e.chartData)!=null&&U.meta.metric_units))return;const N=e.chartData.meta.metric_names[0],B=e.chartData.meta.metric_units[N];if(e.chartData.meta.metric_names.length>1){if(N.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${B}`,{plural:"s"})});if(N.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${B}`,{plural:"s"})})}return((H=e.chartOptions)==null?void 0:H.metricAxesTitle)||s.te(`metricAxisTitles.${N}`)&&s.te(`chartUnits.${B}`)&&s.t(`metricAxisTitles.${N}`,{unit:s.t(`chartUnits.${B}`,{plural:"s"})})||void 0}),C=f.computed(()=>{const N=v.value?"Time":Object.keys(e.chartData.meta.display||e.chartData.meta.metric_names)[0];return e.chartOptions.dimensionAxesTitle||s.te(`chartLabels.${N}`)&&s.t(`chartLabels.${N}`)||void 0}),R=f.computed(()=>{const N=Ka(Number(e.chartData.meta.granularity_ms));return s.t(`granularityAxisTitles.${N}`)}),E=f.computed(()=>e.emptyStateTitle||s.t("noDataAvailableTitle")),m=f.computed(()=>e.emptyStateDescription||s.t("noDataAvailableDescription")),_=f.computed(()=>v.value?Jx(l.value):e.chartData&&e.chartData.meta&&e.chartData.data.length),T=f.computed(()=>e.chartData.meta.granularity_ms?Ka(e.chartData.meta.granularity_ms)||"hourly":Ka(new Date(e.chartData.data[1].timestamp).getTime()-new Date(e.chartData.data[0].timestamp).getTime())||"hourly"),A=f.computed(()=>e.chartOptions.chartLegendSortFn?e.chartOptions.chartLegendSortFn:(N,B)=>N.text===s.t("chartLabels.____OTHER____")?1:B.text===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(N.text,10))&&!isNaN(parseInt(B.text,10))?N.text<B.text?-1:1:N.value&&B.value?B.value.raw-N.value.raw:0),L=f.computed(()=>e.chartOptions.chartTooltipSortFn?e.chartOptions.chartTooltipSortFn:(N,B)=>N.label===s.t("chartLabels.____OTHER____")?1:B.label===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(N.label,10))&&!isNaN(parseInt(B.label,10))?N.label<B.label?-1:1:N.value&&B.value?B.rawValue-N.rawValue:0);return f.provide("showLegendValues",d),f.provide("legendPosition",f.toRef(e,"legendPosition")),(N,B)=>{const G=f.resolveComponent("KTooltip"),U=f.resolveComponent("KEmptyState");return f.openBlock(),f.createElementBlock("div",mD,[_.value&&p.value&&g.value||!f.unref(o)&&(n.allowCsvExport||e.chartTitle)?(f.openBlock(),f.createElementBlock("div",yD,[n.chartTitle?(f.openBlock(),f.createElementBlock("div",{key:0,class:"chart-title",title:n.chartTitle},f.toDisplayString(n.chartTitle),9,bD)):f.createCommentVNode("",!0),_.value&&p.value&&g.value?(f.openBlock(),f.createElementBlock("div",_D,[f.createVNode(G,{class:"tooltip","max-width":"500",placement:"right"},{content:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(f.unref(b)),1)]),default:f.withCtx(()=>[f.createVNode(f.unref(Zl.WarningIcon),{color:`var(--kui-color-text-warning, ${f.unref(iM)})`,decorative:"",size:f.unref(sM)},null,8,["color","size"])]),_:1})])):f.createCommentVNode("",!0),!f.unref(o)&&n.allowCsvExport&&_.value?(f.openBlock(),f.createElementBlock("div",xD,[f.createVNode(rg,{data:a.value,"filename-prefix":n.filenamePrefix},null,8,["data","filename-prefix"])])):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0),_.value?(f.openBlock(),f.createElementBlock("div",wD,[v.value?(f.openBlock(),f.createBlock(kk,{key:0,"chart-data":l.value,"chart-legend-sort-fn":A.value,"chart-tooltip-sort-fn":L.value,"dimension-axes-title":R.value,fill:n.chartOptions.stacked,granularity:T.value,"legend-values":f.unref(h),"metric-axes-title":k.value,"metric-unit":u.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,threshold:n.threshold,"time-range-ms":c.value,"tooltip-title":n.tooltipTitle,type:n.chartOptions.type,zoom:n.timeseriesZoom,onZoomTimeRange:B[0]||(B[0]=H=>i("zoom-time-range",H))},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","threshold","time-range-ms","tooltip-title","type","zoom"])):w.value?(f.openBlock(),f.createBlock(uk,{key:1,annotations:n.showAnnotations,"chart-data":l.value,"chart-legend-sort-fn":A.value,"chart-tooltip-sort-fn":L.value,"data-testid":"bar-chart-container","dimension-axes-title":C.value,"legend-values":f.unref(h),"metric-axes-title":k.value,"metric-unit":u.value,orientation:D.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,"tooltip-title":n.tooltipTitle},null,8,["annotations","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","legend-values","metric-axes-title","metric-unit","orientation","stacked","synthetics-data-key","tooltip-title"])):S.value?(f.openBlock(),f.createBlock(vk,{key:2,"chart-data":l.value,"dataset-colors":n.chartOptions.chartDatasetColors||f.unref(Lr),"legend-position":n.legendPosition,"legend-values":f.unref(h),"metric-unit":u.value,"synthetics-data-key":n.syntheticsDataKey,"tooltip-title":n.tooltipTitle},null,8,["chart-data","dataset-colors","legend-position","legend-values","metric-unit","synthetics-data-key","tooltip-title"])):f.createCommentVNode("",!0)])):(f.openBlock(),f.createBlock(U,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(E.value),1)]),default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(m.value),1)]),_:1}))])}}}),MD=cn(vD,[["__scopeId","data-v-62291458"]]),SD={class:"chart-parent","data-testid":"donut-chart-parent"},kD={class:"chart-totals-flex"},DD={key:1,class:"metric-small","data-testid":"donut-chart-total"},TD=cn(f.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:on},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}=yt.useI18n(),i=f.ref(On()),s=f.computed(()=>[t.chartData.datasets.reduce((p,b)=>(p.labels.push(b.label),p.borderColor.push(b.backgroundColor),p.backgroundColor.push(b.backgroundColor),p.data.push(b.data.reduce((w,v)=>w+v,0)),p),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),r=f.computed(()=>({...t.chartData,datasets:s.value}));yt.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey"));const o={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},a=f.ref(),l=f.computed(()=>{var g;return ws((g=s==null?void 0:s.value[0])==null?void 0:g.data[t.numerator],{capital:!0})}),c=f.computed(()=>{var g,p;return ws(((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=f.computed(()=>{var g;return`color: ${(g=s==null?void 0:s.value[0])==null?void 0:g.backgroundColor[t.numerator]}`}),d=f.computed(()=>["full","single"].includes(t.metricDisplay)),h=f.computed(()=>t.metricDisplay==="full");return(g,p)=>(f.openBlock(),f.createElementBlock("div",SD,[f.createElementVNode("div",kD,[d.value?(f.openBlock(),f.createElementBlock("div",{key:0,class:"metric-large","data-testid":"donut-chart-metric",style:f.normalizeStyle(u.value)},f.toDisplayString(l.value),5)):f.createCommentVNode("",!0),h.value?(f.openBlock(),f.createElementBlock("div",DD,f.toDisplayString(f.unref(e).t("total"))+": "+f.toDisplayString(c.value),1)):f.createCommentVNode("",!0)]),f.createElementVNode("div",{class:"chart-container",style:f.normalizeStyle({height:n.height,width:n.width})},[f.createVNode(f.unref(Xf),{ref_key:"chartInstance",ref:a,"chart-id":i.value,data:r.value,options:o},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-8095ee16"]]),CD={class:"simple-chart-shell"},OD={key:1,class:"analytics-chart-parent"},PD=cn(f.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}=yt.useI18n(),i=f.computed(()=>{var c;const l=yt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||on},f.toRef(t,"chartData")).value;return(c=t.chartOptions)!=null&&c.reverseDataset&&(l==null||l.datasets.reverse()),l}),s=f.computed(()=>{var l;return(l=t.chartData.meta)!=null&&l.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""}),r=f.computed(()=>t.chartOptions.type==="gauge"),o=f.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),a=f.computed(()=>t.chartData&&t.chartData.meta&&t.chartData.data.length);return(l,c)=>{const u=f.resolveComponent("KEmptyState");return f.openBlock(),f.createElementBlock("div",CD,[a.value?(f.openBlock(),f.createElementBlock("div",OD,[r.value?(f.openBlock(),f.createBlock(TD,{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"])):f.createCommentVNode("",!0)])):(f.openBlock(),f.createBlock(u,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(o.value),1)]),_:1}))])}}}),[["__scopeId","data-v-9d13f2fd"]]),ED={class:"top-n-card-title","data-testid":"top-n-card-title"},AD={class:"top-n-card-description","data-testid":"top-n-card-description"},RD={key:3,class:"top-n-table","data-testid":"top-n-table"},LD={class:"table-headings"},ID={class:"table-row"},ND={class:"column-1"},FD={class:"column-2"},zD={class:"table-body","data-testid":"top-n-data"},BD=["data-testid"],HD={class:"column-1"},WD={class:"column-2"},YD=cn(f.defineComponent({__name:"TopNTable",props:{title:{type:String,required:!0},description:{type:String,default:""},data:{type:Object,required:!0},emptyStateTitle:{type:String,default:""},isLoading:{type:Boolean,default:!1},titleTag:{type:String,default:"h2"}},setup(n){const t=n,{i18n:e}=yt.useI18n(),i=f.computed(()=>t.data.data),s=f.computed(()=>{var p;return!!((p=i.value)!=null&&p.length)}),r=f.computed(()=>{var p,b;return(p=t.data.meta)!=null&&p.display&&((b=Object.keys(t.data.meta.display))==null?void 0:b[0])||""}),o=f.computed(()=>r.value?t.data.meta.display[r.value]:{}),a=f.computed(()=>{var p,b;return(b=(p=t.data.meta)==null?void 0:p.metric_names)!=null&&b.length?t.data.meta.metric_names[0]:""}),l=f.computed(()=>a.value?e.t(`chartLabels.${a.value}`)||a.value:""),c=f.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 b=p.event;return String(b[r.value])},d=p=>{const b=u(p),w=o.value&&o.value[b];return w?w.name:"-"},h=p=>{const b=u(p),w=o.value&&o.value[b];return w?!!w.deleted:!1},g=p=>{if(!a.value)return"–";const w=p.event[a.value];return w?ws(w,{capital:!0,round:!0}):"–"};return(p,b)=>{const w=f.resolveComponent("KEmptyState"),v=f.resolveComponent("KSkeleton"),S=f.resolveComponent("KCard");return f.openBlock(),f.createBlock(S,{class:"kong-ui-public-top-n-table","title-tag":n.titleTag},f.createSlots({default:f.withCtx(()=>[c.value?(f.openBlock(),f.createBlock(w,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(f.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(c.value),1)]),_:1})):n.isLoading?(f.openBlock(),f.createBlock(v,{key:1,"table-columns":2,type:"table"})):s.value?(f.openBlock(),f.createElementBlock("div",RD,[f.createElementVNode("div",LD,[f.createElementVNode("div",ID,[f.createElementVNode("div",ND,f.toDisplayString(f.unref(e).t("topNTable.nameLabel")),1),f.createElementVNode("div",FD,f.toDisplayString(l.value),1)])]),f.createElementVNode("div",zD,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(i.value,(D,k)=>(f.openBlock(),f.createElementBlock("div",{key:`entry-${k}`,class:"table-row","data-testid":`row-${u(D)}`},[f.createElementVNode("div",HD,[f.renderSlot(p.$slots,"name",{record:{id:u(D),name:d(D),deleted:h(D),dimension:r.value}},()=>[f.createTextVNode(f.toDisplayString(d(D)),1)],!0)]),f.createElementVNode("div",WD,"   "+f.toDisplayString(g(D)),1)],8,BD))),128))])])):(f.openBlock(),f.createBlock(w,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(n.emptyStateTitle||f.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[n.title?{name:"title",fn:f.withCtx(()=>[f.createElementVNode("span",ED,f.toDisplayString(n.title),1)]),key:"0"}:void 0,n.description?{name:"actions",fn:f.withCtx(()=>[f.createElementVNode("div",AD,f.toDisplayString(n.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-5db48d63"]]);nt.AnalyticsChart=MD,nt.ChartLegendPosition=It,nt.CsvExportButton=rg,nt.CsvExportModal=sg,nt.DECIMAL_DISPLAY=$d,nt.EMPTY_COLOR=Qd,nt.FONT_SIZE_REGULAR=qd,nt.FONT_SIZE_SMALL=Ud,nt.MAX_LABEL_LENGTH=Ar,nt.OTHERS_COLOR=rw,nt.SimpleChart=PD,nt.TopNTable=YD,nt.ValidType=ii,nt.accessibleGrey=Kd,nt.apiRequestStatusCodeColors=Zd,nt.chartTypes=Tk,nt.codesInSpec=nh,nt.darkenColor=Gd,nt.datavisPalette=on,nt.defaultStatusCodeColors=Lr,nt.determineBaseColor=Ca,nt.errorRateColors=iw,nt.latencyColors=sw,nt.lightGrey=Ea,nt.lookupColor=ow,nt.lookupDatavisColor=Rr,nt.lookupStatusCodeCategoryColor=fw,nt.lookupStatusCodeColor=Aa,nt.numberFormatter=Er,nt.simpleChartMetricDisplay=Dk,nt.simpleChartTypes=Ck,nt.statusCodeBadgeBackgroundColor=ew,nt.trafficColors=nw,Object.defineProperty(nt,Symbol.toStringTag,{value:"Module"})});