@yoast/ai-insights-client 1.4.6 → 1.4.7

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.
@@ -64,7 +64,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
64
64
  * Released under the MIT License
65
65
  */class XT{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,i){const s=n.listeners[i],o=n.duration;s.forEach(a=>a({chart:t,initial:n.initial,numSteps:o,currentStep:Math.min(r-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=cb.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const s=r.items;let o=s.length-1,a=!1,l;for(;o>=0;--o)l=s[o],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),a=!0):(s[o]=s[s.length-1],s.pop());a&&(i.draw(),this._notify(i,r,t,"progress")),s.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),n+=s.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,i)=>Math.max(r,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Yn=new XT;const xy="transparent",JT={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=uy(e||xy),i=r.valid&&uy(t||xy);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class ZT{constructor(t,n,r,i){const s=n[r];i=nl([t.to,i,s,t.from]);const o=nl([t.from,s,i]);this._active=!0,this._fn=t.fn||JT[t.type||typeof o],this._easing=Lo[t.easing]||Lo.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=o,this._to=i,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],s=r-this._start,o=this._duration-s;this._start=r,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=nl([t.to,n,i,t.from]),this._from=nl([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,i=this._prop,s=this._from,o=this._loop,a=this._to;let l;if(this._active=s!==a&&(o||n<r),!this._active){this._target[i]=a,this._notify(!0);return}if(n<0){this._target[i]=s;return}l=n/r%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(s,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let i=0;i<r.length;i++)r[i][n]()}}class kb{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Fe(t))return;const n=Object.keys(lt.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const s=t[i];if(!Fe(s))return;const o={};for(const a of n)o[a]=s[a];(it(s.properties)&&s.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,o)})})}_animateOptions(t,n){const r=n.options,i=t5(t,r);if(!i)return[];const s=this._createAnimations(i,r);return r.$shared&&e5(t.options.$animations,r).then(()=>{t.options=r},()=>{}),s}_createAnimations(t,n){const r=this._properties,i=[],s=t.$animations||(t.$animations={}),o=Object.keys(n),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"){i.push(...this._animateOptions(t,n));continue}const u=n[c];let d=s[c];const f=r.get(c);if(d)if(f&&d.active()){d.update(f,u,a);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}s[c]=d=new ZT(f,t,c,u),i.push(d)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return Yn.add(this._chart,r),!0}}function e5(e,t){const n=[],r=Object.keys(t);for(let i=0;i<r.length;i++){const s=e[r[i]];s&&s.active()&&n.push(s.wait())}return Promise.all(n)}function t5(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function wy(e,t){const n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,s=n.max===void 0?t:0;return{start:r?s:i,end:r?i:s}}function n5(e,t,n){if(n===!1)return!1;const r=wy(e,n),i=wy(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function r5(e){let t,n,r,i;return Fe(e)?(t=e.top,n=e.right,r=e.bottom,i=e.left):t=n=r=i=e,{top:t,right:n,bottom:r,left:i,disabled:e===!1}}function Ob(e,t){const n=[],r=e._getSortedDatasetMetas(t);let i,s;for(i=0,s=r.length;i<s;++i)n.push(r[i].index);return n}function Sy(e,t,n,r={}){const i=e.keys,s=r.mode==="single";let o,a,l,c;if(t===null)return;let u=!1;for(o=0,a=i.length;o<a;++o){if(l=+i[o],l===n){if(u=!0,r.all)continue;break}c=e.values[l],yt(c)&&(s||t===0||Ps(t)===Ps(c))&&(t+=c)}return!u&&!r.all?0:t}function i5(e,t){const{iScale:n,vScale:r}=t,i=n.axis==="x"?"x":"y",s=r.axis==="x"?"x":"y",o=Object.keys(e),a=new Array(o.length);let l,c,u;for(l=0,c=o.length;l<c;++l)u=o[l],a[l]={[i]:u,[s]:e[u]};return a}function bu(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function s5(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function o5(e){const{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function a5(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function Cy(e,t,n,r){for(const i of t.getMatchingVisibleMetas(r).reverse()){const s=e[i.index];if(n&&s>0||!n&&s<0)return i.index}return null}function _y(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:s,vScale:o,index:a}=r,l=s.axis,c=o.axis,u=s5(s,o,r),d=t.length;let f;for(let h=0;h<d;++h){const g=t[h],{[l]:m,[c]:p}=g,v=g._stacks||(g._stacks={});f=v[c]=a5(i,u,m),f[a]=p,f._top=Cy(f,o,!0,r.type),f._bottom=Cy(f,o,!1,r.type);const b=f._visualValues||(f._visualValues={});b[a]=p}}function xu(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function l5(e,t){return Gr(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function c5(e,t,n){return Gr(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function ao(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const i of t){const s=i._stacks;if(!s||s[r]===void 0||s[r][n]===void 0)return;delete s[r][n],s[r]._visualValues!==void 0&&s[r]._visualValues[n]!==void 0&&delete s[r]._visualValues[n]}}}const wu=e=>e==="reset"||e==="none",ky=(e,t)=>t?e:Object.assign({},e),u5=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Ob(n,!0),values:null};class Xi{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,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=bu(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&&ao(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(d,f,h,g)=>d==="x"?f:d==="r"?g:h,s=n.xAxisID=je(r.xAxisID,xu(t,"x")),o=n.yAxisID=je(r.yAxisID,xu(t,"y")),a=n.rAxisID=je(r.rAxisID,xu(t,"r")),l=n.indexAxis,c=n.iAxisID=i(l,s,o,a),u=n.vAxisID=i(l,o,s,a);n.xScale=this.getScaleForId(s),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.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 n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&ay(this._data,this),t._stacked&&ao(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Fe(n)){const i=this._cachedMeta;this._data=i5(n,i)}else if(r!==n){if(r){ay(r,this);const i=this._cachedMeta;ao(i),i._parsed=[]}n&&Object.isExtensible(n)&&zP(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let i=!1;this._dataCheck();const s=n._stacked;n._stacked=bu(n.vScale,n),n.stack!==r.stack&&(i=!0,ao(n),n.stack=r.stack),this._resyncElements(t),(i||s!==n._stacked)&&(_y(this,n._parsed),n._stacked=bu(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:i}=this,{iScale:s,_stacked:o}=r,a=s.axis;let l=t===0&&n===i.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,d,f;if(this._parsing===!1)r._parsed=i,r._sorted=!0,f=i;else{it(i[t])?f=this.parseArrayData(r,i,t,n):Fe(i[t])?f=this.parseObjectData(r,i,t,n):f=this.parsePrimitiveData(r,i,t,n);const h=()=>d[a]===null||c&&d[a]<c[a];for(u=0;u<n;++u)r._parsed[u+t]=d=f[u],l&&(h()&&(l=!1),c=d);r._sorted=l}o&&_y(this,f)}parsePrimitiveData(t,n,r,i){const{iScale:s,vScale:o}=t,a=s.axis,l=o.axis,c=s.getLabels(),u=s===o,d=new Array(i);let f,h,g;for(f=0,h=i;f<h;++f)g=f+r,d[f]={[a]:u||s.parse(c[g],g),[l]:o.parse(n[g],g)};return d}parseArrayData(t,n,r,i){const{xScale:s,yScale:o}=t,a=new Array(i);let l,c,u,d;for(l=0,c=i;l<c;++l)u=l+r,d=n[u],a[l]={x:s.parse(d[0],u),y:o.parse(d[1],u)};return a}parseObjectData(t,n,r,i){const{xScale:s,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(i);let u,d,f,h;for(u=0,d=i;u<d;++u)f=u+r,h=n[f],c[u]={x:s.parse(ta(h,a),f),y:o.parse(ta(h,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const i=this.chart,s=this._cachedMeta,o=n[t.axis],a={keys:Ob(i,!0),values:n._stacks[t.axis]._visualValues};return Sy(a,o,s.index,{mode:r})}updateRangeFromParsed(t,n,r,i){const s=r[n.axis];let o=s===null?NaN:s;const a=i&&r._stacks[n.axis];i&&a&&(i.values=a,o=Sy(i,s,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,n){const r=this._cachedMeta,i=r._parsed,s=r._sorted&&t===r.iScale,o=i.length,a=this._getOtherScale(t),l=u5(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=o5(a);let f,h;function g(){h=i[f];const m=h[a.axis];return!yt(h[t.axis])||u>m||d<m}for(f=0;f<o&&!(!g()&&(this.updateRangeFromParsed(c,t,h,l),s));++f);if(s){for(f=o-1;f>=0;--f)if(!g()){this.updateRangeFromParsed(c,t,h,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let i,s,o;for(i=0,s=n.length;i<s;++i)o=n[i][t.axis],yt(o)&&r.push(o);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,i=n.vScale,s=this.getParsed(t);return{label:r?""+r.getLabelForValue(s[r.axis]):"",value:i?""+i.getLabelForValue(s[i.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=r5(je(this.options.clip,n5(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,i=r.data||[],s=n.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||i.length-a,c=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,s,a,l),u=a;u<a+l;++u){const d=i[u];d.hidden||(d.active&&c?o.push(d):d.draw(t,s))}for(u=0;u<o.length;++u)o[u].draw(t,s)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const i=this.getDataset();let s;if(t>=0&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];s=o.$context||(o.$context=c5(this.getContext(),t,o)),s.parsed=this.getParsed(t),s.raw=i.data[t],s.index=s.dataIndex=t}else s=this.$context||(this.$context=l5(this.chart.getContext(),this.index)),s.dataset=i,s.index=s.datasetIndex=this.index;return s.active=!!n,s.mode=r,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const i=n==="active",s=this._cachedDataOpts,o=t+"-"+n,a=s[o],l=this.enableOptionSharing&&Vl(r);if(a)return ky(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=i?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),h=Object.keys(lt.elements[t]),g=()=>this.getContext(r,i,n),m=c.resolveNamedOptions(f,h,g,d);return m.$shared&&(m.$shared=l,s[o]=Object.freeze(ky(m,l))),m}_resolveAnimations(t,n,r){const i=this.chart,s=this._cachedDataOpts,o=`animation-${n}`,a=s[o];if(a)return a;let l;if(i.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(t,r,n))}const c=new kb(i,l&&l.animations);return l&&l._cacheable&&(s[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||wu(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),i=this._sharedOptions,s=this.getSharedOptions(r),o=this.includeOptions(n,s)||s!==i;return this.updateSharedOptions(s,n,r),{sharedOptions:s,includeOptions:o}}updateElement(t,n,r,i){wu(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!wu(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,i){t.active=i;const s=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(t,{options:!i&&this.getSharedOptions(s)||s})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const i=r.length,s=n.length,o=Math.min(s,i);o&&this.parse(0,o),s>i?this._insertElements(i,s-i,t):s<i&&this._removeElements(s,i-s)}_insertElements(t,n,r=!0){const i=this._cachedMeta,s=i.data,o=t+n;let a;const l=c=>{for(c.length+=n,a=c.length-1;a>=o;a--)c[a]=c[a-n]};for(l(s),a=t;a<o;++a)s[a]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,n),r&&this.updateElements(s,t,n,"reset")}updateElements(t,n,r,i){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const i=r._parsed.splice(t,n);r._stacked&&ao(r,i)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,i]=t;this[n](r,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}me(Xi,"defaults",{}),me(Xi,"datasetElementType",null),me(Xi,"dataElementType",null);class kl extends Xi{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:i=[],_dataset:s}=n,o=this.chart._animationsDisabled;let{start:a,count:l}=VP(n,i,o);this._drawStart=a,this._drawCount=l,WP(n)&&(a=0,l=i.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!s._decimated,r.points=i;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!o,options:c},t),this.updateElements(i,a,l,t)}updateElements(t,n,r,i){const s=i==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,i),f=o.axis,h=a.axis,{spanGaps:g,segment:m}=this.options,p=na(g)?g:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||s||i==="none",b=n+r,x=t.length;let C=n>0&&this.getParsed(n-1);for(let w=0;w<x;++w){const k=t[w],S=v?k:{};if(w<n||w>=b){S.skip=!0;continue}const _=this.getParsed(w),O=Ye(_[h]),A=S[f]=o.getPixelForValue(_[f],w),M=S[h]=s||O?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,_,l):_[h],w);S.skip=isNaN(A)||isNaN(M)||O,S.stop=w>0&&Math.abs(_[f]-C[f])>p,m&&(S.parsed=_,S.raw=c.data[w]),d&&(S.options=u||this.resolveDataElementOptions(w,k.active?"active":i)),v||this.updateElement(k,w,S,i),C=_}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const s=i[0].size(this.resolveDataElementOptions(0)),o=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,s,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}me(kl,"id","line"),me(kl,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),me(kl,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Ol extends Xi{getLabelAndValue(t){const n=this._cachedMeta.vScale,r=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(r[n.axis])}}parseObjectData(t,n,r,i){return kT.bind(this)(t,n,r,i)}update(t){const n=this._cachedMeta,r=n.dataset,i=n.data||[],s=n.iScale.getLabels();if(r.points=i,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:s.length===i.length,options:o};this.updateElement(r,void 0,a,t)}this.updateElements(i,0,i.length,t)}updateElements(t,n,r,i){const s=this._cachedMeta.rScale,o=i==="reset";for(let a=n;a<n+r;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":i),u=s.getPointPositionForValue(a,this.getParsed(a).r),d=o?s.xCenter:u.x,f=o?s.yCenter:u.y,h={x:d,y:f,angle:u.angle,skip:isNaN(d)||isNaN(f),options:c};this.updateElement(l,a,h,i)}}}me(Ol,"id","radar"),me(Ol,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),me(Ol,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});function ei(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Mf{constructor(t){me(this,"options");this.options=t||{}}static override(t){Object.assign(Mf.prototype,t)}init(){}formats(){return ei()}parse(){return ei()}format(){return ei()}add(){return ei()}diff(){return ei()}startOf(){return ei()}endOf(){return ei()}}var d5={_date:Mf};function f5(e,t,n,r){const{controller:i,data:s,_sorted:o}=e,a=i._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&o&&s.length){const c=a._reversePixels?BP:ci;if(r){if(i._sharedOptions){const u=s[0],d=typeof u.getRange=="function"&&u.getRange(t);if(d){const f=c(s,t,n-d),h=c(s,t,n+d);return{lo:f.lo,hi:h.hi}}}}else{const u=c(s,t,n);if(l){const{vScale:d}=i._cachedMeta,{_parsed:f}=e,h=f.slice(0,u.lo+1).reverse().findIndex(m=>!Ye(m[d.axis]));u.lo-=Math.max(0,h);const g=f.slice(u.hi).findIndex(m=>!Ye(m[d.axis]));u.hi+=Math.max(0,g)}return u}}return{lo:0,hi:s.length-1}}function Mc(e,t,n,r,i){const s=e.getSortedVisibleDatasetMetas(),o=n[t];for(let a=0,l=s.length;a<l;++a){const{index:c,data:u}=s[a],{lo:d,hi:f}=f5(s[a],t,o,i);for(let h=d;h<=f;++h){const g=u[h];g.skip||r(g,c,h)}}}function h5(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,i){const s=t?Math.abs(r.x-i.x):0,o=n?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(o,2))}}function Su(e,t,n,r,i){const s=[];return!i&&!e.isPointInArea(t)||Mc(e,n,t,function(a,l,c){!i&&!ir(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&s.push({element:a,datasetIndex:l,index:c})},!0),s}function g5(e,t,n,r){let i=[];function s(o,a,l){const{startAngle:c,endAngle:u}=o.getProps(["startAngle","endAngle"],r),{angle:d}=RP(o,{x:t.x,y:t.y});ab(d,c,u)&&i.push({element:o,datasetIndex:a,index:l})}return Mc(e,n,t,s),i}function y5(e,t,n,r,i,s){let o=[];const a=h5(n);let l=Number.POSITIVE_INFINITY;function c(u,d,f){const h=u.inRange(t.x,t.y,i);if(r&&!h)return;const g=u.getCenterPoint(i);if(!(!!s||e.isPointInArea(g))&&!h)return;const p=a(t,g);p<l?(o=[{element:u,datasetIndex:d,index:f}],l=p):p===l&&o.push({element:u,datasetIndex:d,index:f})}return Mc(e,n,t,c),o}function Cu(e,t,n,r,i,s){return!s&&!e.isPointInArea(t)?[]:n==="r"&&!r?g5(e,t,n,i):y5(e,t,n,r,i,s)}function Oy(e,t,n,r,i){const s=[],o=n==="x"?"inXRange":"inYRange";let a=!1;return Mc(e,n,t,(l,c,u)=>{l[o]&&l[o](t[n],i)&&(s.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,i))}),r&&!a?[]:s}var m5={modes:{index(e,t,n,r){const i=ii(t,e),s=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?Su(e,i,s,r,o):Cu(e,i,s,!1,r,o),l=[];return a.length?(e.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(e,t,n,r){const i=ii(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?Su(e,i,s,r,o):Cu(e,i,s,!1,r,o);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(e,t,n,r){const i=ii(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return Su(e,i,s,r,o)},nearest(e,t,n,r){const i=ii(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return Cu(e,i,s,n.intersect,r,o)},x(e,t,n,r){const i=ii(t,e);return Oy(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=ii(t,e);return Oy(e,i,"y",n.intersect,r)}}};const Eb=["left","top","right","bottom"];function lo(e,t){return e.filter(n=>n.pos===t)}function Ey(e,t){return e.filter(n=>Eb.indexOf(n.pos)===-1&&n.box.axis===t)}function co(e,t){return e.sort((n,r)=>{const i=t?r:n,s=t?n:r;return i.weight===s.weight?i.index-s.index:i.weight-s.weight})}function p5(e){const t=[];let n,r,i,s,o,a;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:s,options:{stack:o,stackWeight:a=1}}=i,t.push({index:n,box:i,pos:s,horizontal:i.isHorizontal(),weight:i.weight,stack:o&&s+o,stackWeight:a});return t}function v5(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:s}=n;if(!r||!Eb.includes(i))continue;const o=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=s}return t}function b5(e,t){const n=v5(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t;let s,o,a;for(s=0,o=e.length;s<o;++s){a=e[s];const{fullSize:l}=a.box,c=n[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*r:l&&t.availableWidth,a.height=i):(a.width=r,a.height=u?u*i:l&&t.availableHeight)}return n}function x5(e){const t=p5(e),n=co(t.filter(c=>c.box.fullSize),!0),r=co(lo(t,"left"),!0),i=co(lo(t,"right")),s=co(lo(t,"top"),!0),o=co(lo(t,"bottom")),a=Ey(t,"x"),l=Ey(t,"y");return{fullSize:n,leftAndTop:r.concat(s),rightAndBottom:i.concat(l).concat(o).concat(a),chartArea:lo(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:s.concat(o).concat(a)}}function Ay(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function Ab(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function w5(e,t,n,r){const{pos:i,box:s}=n,o=e.maxPadding;if(!Fe(i)){n.size&&(e[i]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?s.height:s.width),n.size=d.size/d.count,e[i]+=n.size}s.getPadding&&Ab(o,s.getPadding());const a=Math.max(0,t.outerWidth-Ay(o,e,"left","right")),l=Math.max(0,t.outerHeight-Ay(o,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function S5(e){const t=e.maxPadding;function n(r){const i=Math.max(t[r]-e[r],0);return e[r]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function C5(e,t){const n=t.maxPadding;function r(i){const s={left:0,top:0,right:0,bottom:0};return i.forEach(o=>{s[o]=Math.max(t[o],n[o])}),s}return r(e?["left","right"]:["top","bottom"])}function _o(e,t,n,r){const i=[];let s,o,a,l,c,u;for(s=0,o=e.length,c=0;s<o;++s){a=e[s],l=a.box,l.update(a.width||t.w,a.height||t.h,C5(a.horizontal,t));const{same:d,other:f}=w5(t,n,a,r);c|=d&&i.length,u=u||f,l.fullSize||i.push(a)}return c&&_o(i,t,n,r)||u}function ol(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function Py(e,t,n,r){const i=n.padding;let{x:s,y:o}=t;for(const a of e){const l=a.box,c=r[a.stack]||{placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*u,f=c.size||l.height;Vl(c.start)&&(o=c.start),l.fullSize?ol(l,i.left,o,n.outerWidth-i.right-i.left,f):ol(l,t.left+c.placed,o,d,f),c.start=o,c.placed+=d,o=l.bottom}else{const d=t.h*u,f=c.size||l.width;Vl(c.start)&&(s=c.start),l.fullSize?ol(l,s,i.top,f,n.outerHeight-i.bottom-i.top):ol(l,s,t.top+c.placed,f,d),c.start=s,c.placed+=d,s=l.right}}t.x=s,t.y=o}var un={addBox(e,t){e.boxes||(e.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(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const i=Ot(e.options.layout.padding),s=Math.max(t-i.width,0),o=Math.max(n-i.height,0),a=x5(e.boxes),l=a.vertical,c=a.horizontal;Qe(e.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=l.reduce((m,p)=>p.box.options&&p.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},i);Ab(f,Ot(r));const h=Object.assign({maxPadding:f,w:s,h:o,x:i.left,y:i.top},i),g=b5(l.concat(c),d);_o(a.fullSize,h,d,g),_o(l,h,d,g),_o(c,h,d,g)&&_o(l,h,d,g),S5(h),Py(a.leftAndTop,h,d,g),h.x+=h.w,h.y+=h.h,Py(a.rightAndBottom,h,d,g),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Qe(a.chartArea,m=>{const p=m.box;Object.assign(p,e.chartArea),p.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class Pb{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,i){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(t){return!0}updateConfig(t){}}class _5 extends Pb{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const El="$chartjs",k5={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ty=e=>e===null||e==="";function O5(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[El]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Ty(i)){const s=my(e,"width");s!==void 0&&(e.width=s)}if(Ty(r))if(e.style.height==="")e.height=e.width/(t||2);else{const s=my(e,"height");s!==void 0&&(e.height=s)}return e}const Tb=NT?{passive:!0}:!1;function E5(e,t,n){e&&e.addEventListener(t,n,Tb)}function A5(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,Tb)}function P5(e,t){const n=k5[e.type]||e.type,{x:r,y:i}=ii(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function Xl(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function T5(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||Xl(a.addedNodes,r),o=o&&!Xl(a.removedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function M5(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||Xl(a.removedNodes,r),o=o&&!Xl(a.addedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const ra=new Map;let My=0;function Mb(){const e=window.devicePixelRatio;e!==My&&(My=e,ra.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function $5(e,t){ra.size||window.addEventListener("resize",Mb),ra.set(e,t)}function j5(e){ra.delete(e),ra.size||window.removeEventListener("resize",Mb)}function D5(e,t,n){const r=e.canvas,i=r&&Tf(r);if(!i)return;const s=ub((a,l)=>{const c=i.clientWidth;n(a,l),c<i.clientWidth&&n()},window),o=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||s(c,u)});return o.observe(i),$5(e,s),o}function _u(e,t,n){n&&n.disconnect(),t==="resize"&&j5(e)}function L5(e,t,n){const r=e.canvas,i=ub(s=>{e.ctx!==null&&n(P5(s,e))},e);return E5(r,t,i),i}class I5 extends Pb{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(O5(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[El])return!1;const r=n[El].initial;["height","width"].forEach(s=>{const o=r[s];Ye(o)?n.removeAttribute(s):n.setAttribute(s,o)});const i=r.style||{};return Object.keys(i).forEach(s=>{n.style[s]=i[s]}),n.width=n.width,delete n[El],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),o={attach:T5,detach:M5,resize:D5}[n]||L5;i[n]=o(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:_u,detach:_u,resize:_u}[n]||A5)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return FT(t,n,r,i)}isAttached(t){const n=t&&Tf(t);return!!(n&&n.isConnected)}}function R5(e){return!Pf()||typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas?_5:I5}var pl;let Li=(pl=class{constructor(){me(this,"x");me(this,"y");me(this,"active",!1);me(this,"options");me(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return na(this.x)&&na(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const i={};return t.forEach(s=>{i[s]=r[s]&&r[s].active()?r[s]._to:this[s]}),i}},me(pl,"defaults",{}),me(pl,"defaultRoutes"),pl);function F5(e,t){const n=e.options.ticks,r=N5(e),i=Math.min(n.maxTicksLimit||r,r),s=n.major.enabled?q5(t):[],o=s.length,a=s[0],l=s[o-1],c=[];if(o>i)return z5(t,c,s,o/i),c;const u=B5(s,t,i);if(o>0){let d,f;const h=o>1?Math.round((l-a)/(o-1)):null;for(al(t,c,u,Ye(h)?0:a-h,a),d=0,f=o-1;d<f;d++)al(t,c,u,s[d],s[d+1]);return al(t,c,u,l,Ye(h)?t.length:l+h),c}return al(t,c,u),c}function N5(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),i=e._maxLength/n;return Math.floor(Math.min(r,i))}function B5(e,t,n){const r=H5(e),i=t.length/n;if(!r)return Math.max(i,1);const s=jP(r);for(let o=0,a=s.length-1;o<a;o++){const l=s[o];if(l>i)return l}return Math.max(i,1)}function q5(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function z5(e,t,n,r){let i=0,s=n[0],o;for(r=Math.ceil(r),o=0;o<e.length;o++)o===s&&(t.push(e[o]),i++,s=n[i*r])}function al(e,t,n,r,i){const s=je(r,0),o=Math.min(je(i,e.length),e.length);let a=0,l,c,u;for(n=Math.ceil(n),i&&(l=i-r,n=l/Math.floor(l/n)),u=s;u<0;)a++,u=Math.round(s+a*n);for(c=Math.max(s,0);c<o;c++)c===u&&(t.push(e[c]),a++,u=Math.round(s+a*n))}function H5(e){const t=e.length;let n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}const U5=e=>e==="left"?"right":e==="right"?"left":e,$y=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,jy=(e,t)=>Math.min(t||e,e);function Dy(e,t){const n=[],r=e.length/t,i=e.length;let s=0;for(;s<i;s+=r)n.push(e[Math.floor(s)]);return n}function K5(e,t,n){const r=e.ticks.length,i=Math.min(t,r-1),s=e._startPixel,o=e._endPixel,a=1e-6;let l=e.getPixelForTick(i),c;if(!(n&&(r===1?c=Math.max(l-s,o-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(i-1))/2,l+=i<t?c:-c,l<s-a||l>o+a)))return l}function V5(e,t){Qe(e,n=>{const r=n.gc,i=r.length/2;let s;if(i>t){for(s=0;s<i;++s)delete n.data[r[s]];r.splice(0,i)}})}function uo(e){return e.drawTicks?e.tickLength:0}function Ly(e,t){if(!e.display)return 0;const n=ft(e.font,t),r=Ot(e.padding);return(it(e.text)?e.text.length:1)*n.lineHeight+r.height}function W5(e,t){return Gr(e,{scale:t,type:"scale"})}function G5(e,t,n){return Gr(e,{tick:n,index:t,type:"tick"})}function Q5(e,t,n){let r=Cf(e);return(n&&t!=="right"||!n&&t==="right")&&(r=U5(r)),r}function Y5(e,t,n,r){const{top:i,left:s,bottom:o,right:a,chart:l}=e,{chartArea:c,scales:u}=l;let d=0,f,h,g;const m=o-i,p=a-s;if(e.isHorizontal()){if(h=wt(r,s,a),Fe(n)){const v=Object.keys(n)[0],b=n[v];g=u[v].getPixelForValue(b)+m-t}else n==="center"?g=(c.bottom+c.top)/2+m-t:g=$y(e,n,t);f=a-s}else{if(Fe(n)){const v=Object.keys(n)[0],b=n[v];h=u[v].getPixelForValue(b)-p+t}else n==="center"?h=(c.left+c.right)/2-p+t:h=$y(e,n,t);g=wt(r,o,i),d=n==="left"?-Yt:Yt}return{titleX:h,titleY:g,maxWidth:f,rotation:d}}class Us extends Li{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,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:i}=this;return t=Pn(t,Number.POSITIVE_INFINITY),n=Pn(n,Number.NEGATIVE_INFINITY),r=Pn(r,Number.POSITIVE_INFINITY),i=Pn(i,Number.NEGATIVE_INFINITY),{min:Pn(t,r),max:Pn(n,i),minDefined:yt(t),maxDefined:yt(n)}}getMinMax(t){let{min:n,max:r,minDefined:i,maxDefined:s}=this.getUserBounds(),o;if(i&&s)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)o=a[l].controller.getMinMax(this,t),i||(n=Math.min(n,o.min)),s||(r=Math.max(r,o.max));return n=s&&n>r?r:n,r=i&&n>r?n:r,{min:Pn(n,Pn(r,n)),max:Pn(r,Pn(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){et(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:i,grace:s,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=yT(this,s,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Dy(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=F5(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,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,t=!t),this._startPixel=n,this._endPixel=r,this._reversePixels=t,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){et(this.options.afterUpdate,[this])}beforeSetDimensions(){et(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(){et(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),et(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){et(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,i,s;for(r=0,i=t.length;r<i;r++)s=t[r],s.label=et(n.callback,[s.value,r,t],this)}afterTickToLabelConversion(){et(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){et(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=jy(this.ticks.length,t.ticks.maxTicksLimit),i=n.minRotation||0,s=n.maxRotation;let o=i,a,l,c;if(!this._isVisible()||!n.display||i>=s||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,h=cn(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/r:h/(r-1),d+6>a&&(a=h/(r-(t.offset?.5:1)),l=this.maxHeight-uo(t.grid)-n.padding-Ly(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),o=wf(Math.min(Math.asin(cn((u.highest.height+6)/a,-1,1)),Math.asin(cn(l/c,-1,1))-Math.asin(cn(f/c,-1,1)))),o=Math.max(i,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){et(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){et(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:s}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=Ly(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=uo(s)+l):(t.height=this.maxHeight,t.width=uo(s)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),h=r.padding*2,g=Dr(this.labelRotation),m=Math.cos(g),p=Math.sin(g);if(a){const v=r.mirror?0:p*d.width+m*f.height;t.height=Math.min(this.maxHeight,t.height+v+h)}else{const v=r.mirror?0:m*d.width+p*f.height;t.width=Math.min(this.maxWidth,t.width+v+h)}this._calculatePadding(c,u,p,m)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,i){const{ticks:{align:s,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,h=0;l?c?(f=i*t.width,h=r*n.height):(f=r*t.height,h=i*n.width):s==="start"?h=n.width:s==="end"?f=t.width:s!=="inner"&&(f=t.width/2,h=n.width/2),this.paddingLeft=Math.max((f-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-d+o)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;s==="start"?(u=0,d=t.height):s==="end"&&(u=n.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(){et(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)Ye(t[n].label)&&(t.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=Dy(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:i,_longestTextCache:s}=this,o=[],a=[],l=Math.floor(n/jy(n,r));let c=0,u=0,d,f,h,g,m,p,v,b,x,C,w;for(d=0;d<n;d+=l){if(g=t[d].label,m=this._resolveTickFontOptions(d),i.font=p=m.string,v=s[p]=s[p]||{data:{},gc:[]},b=m.lineHeight,x=C=0,!Ye(g)&&!it(g))x=Gl(i,v.data,v.gc,x,g),C=b;else if(it(g))for(f=0,h=g.length;f<h;++f)w=g[f],!Ye(w)&&!it(w)&&(x=Gl(i,v.data,v.gc,x,w),C+=b);o.push(x),a.push(C),c=Math.max(x,c),u=Math.max(C,u)}V5(s,n);const k=o.indexOf(c),S=a.indexOf(u),_=O=>({width:o[O]||0,height:a[O]||0});return{first:_(0),last:_(n-1),widest:_(k),highest:_(S),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return NP(this._alignToPixels?Zr(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const r=n[t];return r.$context||(r.$context=G5(this.getContext(),t,r))}return this.$context||(this.$context=W5(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Dr(this.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),s=this._getLabelSizes(),o=t.autoSkipPadding||0,a=s?s.widest.width+o:0,l=s?s.highest.height+o:0;return this.isHorizontal()?l*r>a*i?a/r:l/i:l*i<a*r?l/r:a/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,i=this.options,{grid:s,position:o,border:a}=i,l=s.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=uo(s),h=[],g=a.setContext(this.getContext()),m=g.display?g.width:0,p=m/2,v=function(j){return Zr(r,j,m)};let b,x,C,w,k,S,_,O,A,M,D,W;if(o==="top")b=v(this.bottom),S=this.bottom-f,O=b-p,M=v(t.top)+p,W=t.bottom;else if(o==="bottom")b=v(this.top),M=t.top,W=v(t.bottom)-p,S=b+p,O=this.top+f;else if(o==="left")b=v(this.right),k=this.right-f,_=b-p,A=v(t.left)+p,D=t.right;else if(o==="right")b=v(this.left),A=t.left,D=v(t.right)-p,k=b+p,_=this.left+f;else if(n==="x"){if(o==="center")b=v((t.top+t.bottom)/2+.5);else if(Fe(o)){const j=Object.keys(o)[0],I=o[j];b=v(this.chart.scales[j].getPixelForValue(I))}M=t.top,W=t.bottom,S=b+p,O=S+f}else if(n==="y"){if(o==="center")b=v((t.left+t.right)/2);else if(Fe(o)){const j=Object.keys(o)[0],I=o[j];b=v(this.chart.scales[j].getPixelForValue(I))}k=b-p,_=k-f,A=t.left,D=t.right}const R=je(i.ticks.maxTicksLimit,d),L=Math.max(1,Math.ceil(d/R));for(x=0;x<d;x+=L){const j=this.getContext(x),I=s.setContext(j),oe=a.setContext(j),ue=I.lineWidth,B=I.color,Y=oe.dash||[],ne=oe.dashOffset,ae=I.tickWidth,F=I.tickColor,G=I.tickBorderDash||[],q=I.tickBorderDashOffset;C=K5(this,x,l),C!==void 0&&(w=Zr(r,C,ue),c?k=_=A=D=w:S=O=M=W=w,h.push({tx1:k,ty1:S,tx2:_,ty2:O,x1:A,y1:M,x2:D,y2:W,width:ue,color:B,borderDash:Y,borderDashOffset:ne,tickWidth:ae,tickColor:F,tickBorderDash:G,tickBorderDashOffset:q}))}return this._ticksLength=d,this._borderValue=b,h}_computeLabelItems(t){const n=this.axis,r=this.options,{position:i,ticks:s}=r,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=s,f=uo(r.grid),h=f+u,g=d?-u:h,m=-Dr(this.labelRotation),p=[];let v,b,x,C,w,k,S,_,O,A,M,D,W="middle";if(i==="top")k=this.bottom-g,S=this._getXAxisLabelAlignment();else if(i==="bottom")k=this.top+g,S=this._getXAxisLabelAlignment();else if(i==="left"){const L=this._getYAxisLabelAlignment(f);S=L.textAlign,w=L.x}else if(i==="right"){const L=this._getYAxisLabelAlignment(f);S=L.textAlign,w=L.x}else if(n==="x"){if(i==="center")k=(t.top+t.bottom)/2+h;else if(Fe(i)){const L=Object.keys(i)[0],j=i[L];k=this.chart.scales[L].getPixelForValue(j)+h}S=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")w=(t.left+t.right)/2-h;else if(Fe(i)){const L=Object.keys(i)[0],j=i[L];w=this.chart.scales[L].getPixelForValue(j)}S=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?W="top":l==="end"&&(W="bottom"));const R=this._getLabelSizes();for(v=0,b=a.length;v<b;++v){x=a[v],C=x.label;const L=s.setContext(this.getContext(v));_=this.getPixelForTick(v)+s.labelOffset,O=this._resolveTickFontOptions(v),A=O.lineHeight,M=it(C)?C.length:1;const j=M/2,I=L.color,oe=L.textStrokeColor,ue=L.textStrokeWidth;let B=S;o?(w=_,S==="inner"&&(v===b-1?B=this.options.reverse?"left":"right":v===0?B=this.options.reverse?"right":"left":B="center"),i==="top"?c==="near"||m!==0?D=-M*A+A/2:c==="center"?D=-R.highest.height/2-j*A+A:D=-R.highest.height+A/2:c==="near"||m!==0?D=A/2:c==="center"?D=R.highest.height/2-j*A:D=R.highest.height-M*A,d&&(D*=-1),m!==0&&!L.showLabelBackdrop&&(w+=A/2*Math.sin(m))):(k=_,D=(1-M)*A/2);let Y;if(L.showLabelBackdrop){const ne=Ot(L.backdropPadding),ae=R.heights[v],F=R.widths[v];let G=D-ne.top,q=0-ne.left;switch(W){case"middle":G-=ae/2;break;case"bottom":G-=ae;break}switch(S){case"center":q-=F/2;break;case"right":q-=F;break;case"inner":v===b-1?q-=F:v>0&&(q-=F/2);break}Y={left:q,top:G,width:F+ne.width,height:ae+ne.height,color:L.backdropColor}}p.push({label:C,font:O,textOffset:D,options:{rotation:m,color:I,strokeColor:oe,strokeWidth:ue,textAlign:B,textBaseline:W,translation:[w,k],backdrop:Y}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Dr(this.labelRotation))return t==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:i,padding:s}}=this.options,o=this._getLabelSizes(),a=t+s,l=o.widest.width;let c,u;return n==="left"?i?(u=this.right+s,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?i?(u=this.left+s,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:i,width:s,height:o}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,i,s,o),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(s=>s.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,o;const a=(l,c,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(s=0,o=i.length;s<o;++s){const l=i[s];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.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:n,options:{border:r,grid:i}}=this,s=r.setContext(this.getContext()),o=r.display?s.width:0;if(!o)return;const a=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,f;this.isHorizontal()?(c=Zr(t,this.left,o)-o/2,u=Zr(t,this.right,a)+a/2,d=f=l):(d=Zr(t,this.top,o)-o/2,f=Zr(t,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=s.width,n.strokeStyle=s.color,n.beginPath(),n.moveTo(c,d),n.lineTo(u,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&Ac(r,i);const s=this.getLabelItems(t);for(const o of s){const a=o.options,l=o.font,c=o.label,u=o.textOffset;Pi(r,c,0,u,l,a)}i&&Pc(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const s=ft(r.font),o=Ot(r.padding),a=r.align;let l=s.lineHeight/2;n==="bottom"||n==="center"||Fe(n)?(l+=o.bottom,it(r.text)&&(l+=s.lineHeight*(r.text.length-1))):l+=o.top;const{titleX:c,titleY:u,maxWidth:d,rotation:f}=Y5(this,l,n,a);Pi(t,r.text,0,0,s,{color:r.color,maxWidth:d,rotation:f,textAlign:Q5(a,n,i),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=je(t.grid&&t.grid.z,-1),i=je(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Us.prototype.draw?[{z:n,draw:s=>{this.draw(s)}}]:[{z:r,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let s,o;for(s=0,o=n.length;s<o;++s){const a=n[s];a[r]===this.id&&(!t||a.type===t)&&i.push(a)}return i}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return ft(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class ll{constructor(t,n,r){this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let r;Z5(n)&&(r=this.register(n));const i=this.items,s=t.id,o=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+t);return s in i||(i[s]=t,X5(t,o,r),this.override&&lt.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,i=this.scope;r in n&&delete n[r],i&&r in lt[i]&&(delete lt[i][r],this.override&&delete Ai[r])}}function X5(e,t,n){const r=ea(Object.create(null),[n?lt.get(n):{},lt.get(t),e.defaults]);lt.set(t,r),e.defaultRoutes&&J5(t,e.defaultRoutes),e.descriptors&&lt.describe(t,e.descriptors)}function J5(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),i=r.pop(),s=[e].concat(r).join("."),o=t[n].split("."),a=o.pop(),l=o.join(".");lt.route(s,i,l,a)})}function Z5(e){return"id"in e&&"defaults"in e}class eM{constructor(){this.controllers=new ll(Xi,"datasets",!0),this.elements=new ll(Li,"elements"),this.plugins=new ll(Object,"plugins"),this.scales=new ll(Us,"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,n,r){[...n].forEach(i=>{const s=r||this._getRegistryForType(i);r||s.isForType(i)||s===this.plugins&&i.id?this._exec(t,s,i):Qe(i,o=>{const a=r||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,n,r){const i=xf(t);et(r["before"+i],[],r),n[t](r),et(r["after"+i],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const i=n.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return i}}var $n=new eM;class tM{constructor(){this._init=[]}notify(t,n,r,i){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const s=i?this._descriptors(t).filter(i):this._descriptors(t),o=this._notify(s,t,n,r);return n==="afterDestroy"&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,n,r,i){i=i||{};for(const s of t){const o=s.plugin,a=o[r],l=[n,i,s.options];if(et(a,l,o)===!1&&i.cancelable)return!1}return!0}invalidate(){Ye(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,i=je(r.options&&r.options.plugins,{}),s=nM(r);return i===!1&&!n?[]:iM(t,s,i,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,i=(s,o)=>s.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(i(n,r),t,"stop"),this._notify(i(r,n),t,"start")}}function nM(e){const t={},n=[],r=Object.keys($n.plugins.items);for(let s=0;s<r.length;s++)n.push($n.getPlugin(r[s]));const i=e.plugins||[];for(let s=0;s<i.length;s++){const o=i[s];n.indexOf(o)===-1&&(n.push(o),t[o.id]=!0)}return{plugins:n,localIds:t}}function rM(e,t){return!t&&e===!1?null:e===!0?{}:e}function iM(e,{plugins:t,localIds:n},r,i){const s=[],o=e.getContext();for(const a of t){const l=a.id,c=rM(r[l],i);c!==null&&s.push({plugin:a,options:sM(e.config,{plugin:a,local:n[l]},c,o)})}return s}function sM(e,{plugin:t,local:n},r,i){const s=e.pluginScopeKeys(t),o=e.getOptionScopes(r,s);return n&&t.defaults&&o.push(t.defaults),e.createResolver(o,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function _d(e,t){const n=lt.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function oM(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function aM(e,t){return e===t?"_index_":"_value_"}function Iy(e){if(e==="x"||e==="y"||e==="r")return e}function lM(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function kd(e,...t){if(Iy(e))return e;for(const n of t){const r=n.axis||lM(n.position)||e.length>1&&Iy(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Ry(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function cM(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return Ry(e,"x",n[0])||Ry(e,"y",n[0])}return{}}function uM(e,t){const n=Ai[e.type]||{scales:{}},r=t.scales||{},i=_d(e.type,t),s=Object.create(null);return Object.keys(r).forEach(o=>{const a=r[o];if(!Fe(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=kd(o,a,cM(o,e),lt.scales[a.type]),c=aM(l,i),u=n.scales||{};s[o]=jo(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(o=>{const a=o.type||e.type,l=o.indexAxis||_d(a,t),u=(Ai[a]||{}).scales||{};Object.keys(u).forEach(d=>{const f=oM(d,l),h=o[f+"AxisID"]||f;s[h]=s[h]||Object.create(null),jo(s[h],[{axis:f},r[h],u[d]])})}),Object.keys(s).forEach(o=>{const a=s[o];jo(a,[lt.scales[a.type],lt.scale])}),s}function $b(e){const t=e.options||(e.options={});t.plugins=je(t.plugins,{}),t.scales=uM(e,t)}function jb(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function dM(e){return e=e||{},e.data=jb(e.data),$b(e),e}const Fy=new Map,Db=new Set;function cl(e,t){let n=Fy.get(e);return n||(n=t(),Fy.set(e,n),Db.add(n)),n}const fo=(e,t,n)=>{const r=ta(t,n);r!==void 0&&e.add(r)};class fM{constructor(t){this._config=dM(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=jb(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(),$b(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return cl(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return cl(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return cl(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return cl(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let i=r.get(t);return(!i||n)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,n,r){const{options:i,type:s}=this,o=this._cachedScopes(t,r),a=o.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>fo(l,t,d))),u.forEach(d=>fo(l,i,d)),u.forEach(d=>fo(l,Ai[s]||{},d)),u.forEach(d=>fo(l,lt,d)),u.forEach(d=>fo(l,Sd,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Db.has(n)&&o.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Ai[n]||{},lt.datasets[n]||{},{type:n},lt,Sd]}resolveNamedOptions(t,n,r,i=[""]){const s={$shared:!0},{resolver:o,subPrefixes:a}=Ny(this._resolverCache,t,i);let l=o;if(gM(o,n)){s.$shared=!1,r=zr(r)?r():r;const c=this.createResolver(t,r,a);l=Ts(o,r,c)}for(const c of n)s[c]=l[c];return s}createResolver(t,n,r=[""],i){const{resolver:s}=Ny(this._resolverCache,t,r);return Fe(n)?Ts(s,n,void 0,i):s}}function Ny(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const i=n.join();let s=r.get(i);return s||(s={resolver:Of(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,s)),s}const hM=e=>Fe(e)&&Object.getOwnPropertyNames(e).some(t=>zr(e[t]));function gM(e,t){const{isScriptable:n,isIndexable:r}=gb(e);for(const i of t){const s=n(i),o=r(i),a=(o||s)&&e[i];if(s&&(zr(a)||hM(a))||o&&it(a))return!0}return!1}var yM="4.5.0";const mM=["top","bottom","left","right","chartArea"];function By(e,t){return e==="top"||e==="bottom"||mM.indexOf(e)===-1&&t==="x"}function qy(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function zy(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),et(n&&n.onComplete,[e],t)}function pM(e){const t=e.chart,n=t.options.animation;et(n&&n.onProgress,[e],t)}function Lb(e){return Pf()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Al={},Hy=e=>{const t=Lb(e);return Object.values(Al).filter(n=>n.canvas===t).pop()};function vM(e,t,n){const r=Object.keys(e);for(const i of r){const s=+i;if(s>=t){const o=e[i];delete e[i],(n>0||s>t)&&(e[s+n]=o)}}}function bM(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}var wr;let $c=(wr=class{static register(...t){$n.add(...t),Uy()}static unregister(...t){$n.remove(...t),Uy()}constructor(t,n){const r=this.config=new fM(n),i=Lb(t),s=Hy(i);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||R5(i)),this.platform.updateConfig(r);const a=this.platform.acquireContext(i,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=_P(),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 tM,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=UP(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],Al[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Yn.listen(this,"complete",zy),Yn.listen(this,"progress",pM),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:s}=this;return Ye(t)?n&&s?s:i?r/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return $n}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():yy(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return fy(this.canvas,this.ctx),this}stop(){return Yn.stop(this),this}resize(t,n){Yn.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,i=this.canvas,s=r.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(i,t,n,s),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,yy(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),et(r.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Qe(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,i=Object.keys(r).reduce((o,a)=>(o[a]=!1,o),{});let s=[];n&&(s=s.concat(Object.keys(n).map(o=>{const a=n[o],l=kd(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Qe(s,o=>{const a=o.options,l=a.id,c=kd(l,a),u=je(a.type,o.dtype);(a.position===void 0||By(a.position,c)!==By(o.dposition))&&(a.position=o.dposition),i[l]=!0;let d=null;if(l in r&&r[l].type===u)d=r[l];else{const f=$n.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,t)}),Qe(i,(o,a)=>{o||delete r[a]}),Qe(r,o=>{un.configure(this,o,o.options),un.addBox(this,o)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((i,s)=>i.index-s.index),r>n){for(let i=n;i<r;++i)this._destroyDatasetMeta(i);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(qy("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,i)=>{n.filter(s=>s===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r<i;r++){const s=n[r];let o=this.getDatasetMeta(r);const a=s.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(r),o=this.getDatasetMeta(r)),o.type=a,o.indexAxis=s.indexAxis||_d(a,this.options),o.order=s.order||0,o.index=r,o.label=""+s.label,o.visible=this.isDatasetVisible(r),o.controller)o.controller.updateIndex(r),o.controller.linkScales();else{const l=$n.getController(a),{datasetElementType:c,dataElementType:u}=lt.datasets[a];Object.assign(l,{dataElementType:$n.getElement(u),datasetElementType:c&&$n.getElement(c)}),o.controller=new l(this,r),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){Qe(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),f=!i&&s.indexOf(d)===-1;d.buildOrUpdateElements(f),o=Math.max(+d.getMaxOverflow(),o)}o=this._minPadding=r.layout.autoPadding?o:0,this._updateLayout(o),i||Qe(s,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(qy("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Qe(this.scales,t=>{un.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!ry(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:s}of n){const o=r==="_removeElements"?-s:s;vM(t,i,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=s=>new Set(t.filter(o=>o[0]===s).map((o,a)=>a+","+o.splice(1).join(","))),i=r(0);for(let s=1;s<n;s++)if(!ry(i,r(s)))return;return Array.from(i).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;un.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Qe(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,s)=>{i._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,zr(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),i={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(r.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Yn.has(this)?this.attached&&!Yn.running(this)&&Yn.start(this):(this.draw(),zy({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,i)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let i,s;for(i=0,s=n.length;i<s;++i){const o=n[i];(!t||o.visible)&&r.push(o)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r={meta:t,index:t.index,cancelable:!0},i=_b(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(i&&Ac(n,i),t.controller.draw(),i&&Pc(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return ir(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const s=m5.modes[n];return typeof s=="function"?s(this,t,r,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let i=r.filter(s=>s&&s._dataset===n).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(i)),i}getContext(){return this.$context||(this.$context=Gr(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const i=r?"show":"hide",s=this.getDatasetMeta(t),o=s.controller._resolveAnimations(void 0,i);Vl(n)?(s.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),o.update(s,{visible:r}),this.update(a=>a.datasetIndex===t?i:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),Yn.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),fy(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Al[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,n=this.platform,r=(s,o)=>{n.addEventListener(this,s,o),t[s]=o},i=(s,o,a)=>{s.offsetX=o,s.offsetY=a,this._eventHandler(s)};Qe(this.options.events,s=>r(s,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},i=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},s=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{i("attach",a),this.attached=!0,this.resize(),r("resize",s),r("detach",o)};o=()=>{this.attached=!1,i("resize",s),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){Qe(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Qe(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const i=r?"set":"remove";let s,o,a,l;for(n==="dataset"&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+i+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){o=t[a];const c=o&&this.getDatasetMeta(o.datasetIndex).controller;c&&c[i+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:s,index:o})=>{const a=this.getDatasetMeta(s);if(!a)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:a.data[o],index:o}});!Ul(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const i=this.options.hover,s=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),o=s(n,t),a=r?t:s(t,n);o.length&&this.updateHoverStyle(o,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const s=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(s||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:i=[],options:s}=this,o=n,a=this._getActiveElements(t,i,r,o),l=TP(t),c=bM(t,this._lastEvent,r,l);r&&(this._lastEvent=null,et(s.onHover,[t,a,this],this),l&&et(s.onClick,[t,a,this],this));const u=!Ul(a,i);return(u||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=c,u}_getActiveElements(t,n,r,i){if(t.type==="mouseout")return[];if(!r)return n;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,i)}},me(wr,"defaults",lt),me(wr,"instances",Al),me(wr,"overrides",Ai),me(wr,"registry",$n),me(wr,"version",yM),me(wr,"getChart",Hy),wr);function Uy(){return Qe($c.instances,e=>e._plugins.invalidate())}function Ib(e,t,n=t){e.lineCap=je(n.borderCapStyle,t.borderCapStyle),e.setLineDash(je(n.borderDash,t.borderDash)),e.lineDashOffset=je(n.borderDashOffset,t.borderDashOffset),e.lineJoin=je(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=je(n.borderWidth,t.borderWidth),e.strokeStyle=je(n.borderColor,t.borderColor)}function xM(e,t,n){e.lineTo(n.x,n.y)}function wM(e){return e.stepped?sT:e.tension||e.cubicInterpolationMode==="monotone"?oT:xM}function Rb(e,t,n={}){const r=e.length,{start:i=0,end:s=r-1}=n,{start:o,end:a}=t,l=Math.max(i,o),c=Math.min(s,a),u=i<o&&s<o||i>a&&s>a;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function SM(e,t,n,r){const{points:i,options:s}=t,{count:o,start:a,loop:l,ilen:c}=Rb(i,n,r),u=wM(s);let{move:d=!0,reverse:f}=r||{},h,g,m;for(h=0;h<=c;++h)g=i[(a+(f?c-h:h))%o],!g.skip&&(d?(e.moveTo(g.x,g.y),d=!1):u(e,m,g,f,s.stepped),m=g);return l&&(g=i[(a+(f?c:0))%o],u(e,m,g,f,s.stepped)),!!l}function CM(e,t,n,r){const i=t.points,{count:s,start:o,ilen:a}=Rb(i,n,r),{move:l=!0,reverse:c}=r||{};let u=0,d=0,f,h,g,m,p,v;const b=C=>(o+(c?a-C:C))%s,x=()=>{m!==p&&(e.lineTo(u,p),e.lineTo(u,m),e.lineTo(u,v))};for(l&&(h=i[b(0)],e.moveTo(h.x,h.y)),f=0;f<=a;++f){if(h=i[b(f)],h.skip)continue;const C=h.x,w=h.y,k=C|0;k===g?(w<m?m=w:w>p&&(p=w),u=(d*u+C)/++d):(x(),e.lineTo(C,w),g=k,d=0,m=p=w),v=w}x()}function Od(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?CM:SM}function _M(e){return e.stepped?BT:e.tension||e.cubicInterpolationMode==="monotone"?qT:si}function kM(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),Ib(e,t.options),e.stroke(i)}function OM(e,t,n,r){const{segments:i,options:s}=t,o=Od(t);for(const a of i)Ib(e,s,a.style),e.beginPath(),o(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const EM=typeof Path2D=="function";function AM(e,t,n,r){EM&&!t.options.segment?kM(e,t,n,r):OM(e,t,n,r)}class Lr extends Li{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,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const i=r.spanGaps?this._loop:this._fullLoop;$T(this._points,r,t,i,n),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=WT(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,i=t[n],s=this.points,o=Cb(this,{property:n,start:i,end:i});if(!o.length)return;const a=[],l=_M(r);let c,u;for(c=0,u=o.length;c<u;++c){const{start:d,end:f}=o[c],h=s[d],g=s[f];if(h===g){a.push(h);continue}const m=Math.abs((i-h[n])/(g[n]-h[n])),p=l(h,g,m,r.stepped);p[n]=t[n],a.push(p)}return a.length===1?a[0]:a}pathSegment(t,n,r){return Od(this)(t,this,n,r)}path(t,n,r){const i=this.segments,s=Od(this);let o=this._loop;n=n||0,r=r||this.points.length-n;for(const a of i)o&=s(t,this,a,{start:n,end:n+r-1});return!!o}draw(t,n,r,i){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(t.save(),AM(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}me(Lr,"id","line"),me(Lr,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),me(Lr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),me(Lr,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Ky(e,t,n,r){const i=e.options,{[n]:s}=e.getProps([n],r);return Math.abs(t-s)<i.radius+i.hitRadius}class Pl extends Li{constructor(n){super();me(this,"parsed");me(this,"skip");me(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,r,i){const s=this.options,{x:o,y:a}=this.getProps(["x","y"],i);return Math.pow(n-o,2)+Math.pow(r-a,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(n,r){return Ky(this,n,"x",r)}inYRange(n,r){return Ky(this,n,"y",r)}getCenterPoint(n){const{x:r,y:i}=this.getProps(["x","y"],n);return{x:r,y:i}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const i=r&&n.borderWidth||0;return(r+i)*2}draw(n,r){const i=this.options;this.skip||i.radius<.1||!ir(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,Cd(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}me(Pl,"id","point"),me(Pl,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),me(Pl,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function PM(e,t,n){const r=e.segments,i=e.points,s=t.points,o=[];for(const a of r){let{start:l,end:c}=a;c=jc(l,c,i);const u=Ed(n,i[l],i[c],a.loop);if(!t.segments){o.push({source:a,target:u,start:i[l],end:i[c]});continue}const d=Cb(t,u);for(const f of d){const h=Ed(n,s[f.start],s[f.end],f.loop),g=Sb(a,i,h);for(const m of g)o.push({source:m,target:f,start:{[n]:Vy(u,h,"start",Math.max)},end:{[n]:Vy(u,h,"end",Math.min)}})}}return o}function Ed(e,t,n,r){if(r)return;let i=t[e],s=n[e];return e==="angle"&&(i=Wt(i),s=Wt(s)),{property:e,start:i,end:s}}function TM(e,t){const{x:n=null,y:r=null}=e||{},i=t.points,s=[];return t.segments.forEach(({start:o,end:a})=>{a=jc(o,a,i);const l=i[o],c=i[a];r!==null?(s.push({x:l.x,y:r}),s.push({x:c.x,y:r})):n!==null&&(s.push({x:n,y:l.y}),s.push({x:n,y:c.y}))}),s}function jc(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function Vy(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function Fb(e,t){let n=[],r=!1;return it(e)?(r=!0,n=e):n=TM(e,t),n.length?new Lr({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function Wy(e){return e&&e.fill!==!1}function MM(e,t,n){let i=e[t].fill;const s=[t];let o;if(!n)return i;for(;i!==!1&&s.indexOf(i)===-1;){if(!yt(i))return i;if(o=e[i],!o)return!1;if(o.visible)return i;s.push(i),i=o.fill}return!1}function $M(e,t,n){const r=IM(e);if(Fe(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return yt(i)&&Math.floor(i)===i?jM(r[0],t,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function jM(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function DM(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:Fe(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function LM(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:Fe(e)?r=e.value:r=t.getBaseValue(),r}function IM(e){const t=e.options,n=t.fill;let r=je(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function RM(e){const{scale:t,index:n,line:r}=e,i=[],s=r.segments,o=r.points,a=FM(t,n);a.push(Fb({x:null,y:t.bottom},r));for(let l=0;l<s.length;l++){const c=s[l];for(let u=c.start;u<=c.end;u++)NM(i,o[u],a)}return new Lr({points:i,options:{}})}function FM(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let i=0;i<r.length;i++){const s=r[i];if(s.index===t)break;s.hidden||n.unshift(s.dataset)}return n}function NM(e,t,n){const r=[];for(let i=0;i<n.length;i++){const s=n[i],{first:o,last:a,point:l}=BM(s,t,"x");if(!(!l||o&&a)){if(o)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function BM(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const i=r[n],s=e.segments,o=e.points;let a=!1,l=!1;for(let c=0;c<s.length;c++){const u=s[c],d=o[u.start][n],f=o[u.end][n];if(Gi(i,d,f)){a=i===d,l=i===f;break}}return{first:a,last:l,point:r}}class Nb{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:i,y:s,radius:o}=this;return n=n||{start:0,end:Xt},t.arc(i,s,o,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:i}=this,s=t.angle;return{x:n+Math.cos(s)*i,y:r+Math.sin(s)*i,angle:s}}}function qM(e){const{chart:t,fill:n,line:r}=e;if(yt(n))return zM(t,n);if(n==="stack")return RM(e);if(n==="shape")return!0;const i=HM(e);return i instanceof Nb?i:Fb(i,r)}function zM(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function HM(e){return(e.scale||{}).getPointPositionForValue?KM(e):UM(e)}function UM(e){const{scale:t={},fill:n}=e,r=DM(n,t);if(yt(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function KM(e){const{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,s=r.reverse?t.max:t.min,o=LM(n,t,s),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,s);return new Nb({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(o)})}for(let l=0;l<i;++l)a.push(t.getPointPositionForValue(l,o));return a}function ku(e,t,n){const r=qM(t),{chart:i,index:s,line:o,scale:a,axis:l}=t,c=o.options,u=c.fill,d=c.backgroundColor,{above:f=d,below:h=d}=u||{},g=i.getDatasetMeta(s),m=_b(i,g);r&&o.points.length&&(Ac(e,n),VM(e,{line:o,target:r,above:f,below:h,area:n,scale:a,axis:l,clip:m}),Pc(e))}function VM(e,t){const{line:n,target:r,above:i,below:s,area:o,scale:a,clip:l}=t,c=n._loop?"angle":t.axis;e.save();let u=s;s!==i&&(c==="x"?(Gy(e,r,o.top),Ou(e,{line:n,target:r,color:i,scale:a,property:c,clip:l}),e.restore(),e.save(),Gy(e,r,o.bottom)):c==="y"&&(Qy(e,r,o.left),Ou(e,{line:n,target:r,color:s,scale:a,property:c,clip:l}),e.restore(),e.save(),Qy(e,r,o.right),u=i)),Ou(e,{line:n,target:r,color:u,scale:a,property:c,clip:l}),e.restore()}function Gy(e,t,n){const{segments:r,points:i}=t;let s=!0,o=!1;e.beginPath();for(const a of r){const{start:l,end:c}=a,u=i[l],d=i[jc(l,c,i)];s?(e.moveTo(u.x,u.y),s=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),o=!!t.pathSegment(e,a,{move:o}),o?e.closePath():e.lineTo(d.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function Qy(e,t,n){const{segments:r,points:i}=t;let s=!0,o=!1;e.beginPath();for(const a of r){const{start:l,end:c}=a,u=i[l],d=i[jc(l,c,i)];s?(e.moveTo(u.x,u.y),s=!1):(e.lineTo(n,u.y),e.lineTo(u.x,u.y)),o=!!t.pathSegment(e,a,{move:o}),o?e.closePath():e.lineTo(n,d.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function Ou(e,t){const{line:n,target:r,property:i,color:s,scale:o,clip:a}=t,l=PM(n,r,i);for(const{source:c,target:u,start:d,end:f}of l){const{style:{backgroundColor:h=s}={}}=c,g=r!==!0;e.save(),e.fillStyle=h,WM(e,o,a,g&&Ed(i,d,f)),e.beginPath();const m=!!n.pathSegment(e,c);let p;if(g){m?e.closePath():Yy(e,r,f,i);const v=!!r.pathSegment(e,u,{move:m,reverse:!0});p=m&&v,p||Yy(e,r,d,i)}e.closePath(),e.fill(p?"evenodd":"nonzero"),e.restore()}}function WM(e,t,n,r){const i=t.chart.chartArea,{property:s,start:o,end:a}=r||{};if(s==="x"||s==="y"){let l,c,u,d;s==="x"?(l=o,c=i.top,u=a,d=i.bottom):(l=i.left,c=o,u=i.right,d=a),e.beginPath(),n&&(l=Math.max(l,n.left),u=Math.min(u,n.right),c=Math.max(c,n.top),d=Math.min(d,n.bottom)),e.rect(l,c,u-l,d-c),e.clip()}}function Yy(e,t,n,r){const i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var GM={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,i=[];let s,o,a,l;for(o=0;o<r;++o)s=e.getDatasetMeta(o),a=s.dataset,l=null,a&&a.options&&a instanceof Lr&&(l={visible:e.isDatasetVisible(o),index:o,fill:$M(a,o,r),chart:e,axis:s.controller.options.indexAxis,scale:s.vScale,line:a}),s.$filler=l,i.push(l);for(o=0;o<r;++o)l=i[o],!(!l||l.fill===!1)&&(l.fill=MM(i,o,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",i=e.getSortedVisibleDatasetMetas(),s=e.chartArea;for(let o=i.length-1;o>=0;--o){const a=i[o].$filler;a&&(a.line.updateControlPoints(s,a.axis),r&&a.fill&&ku(e.ctx,a,s))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let i=r.length-1;i>=0;--i){const s=r[i].$filler;Wy(s)&&ku(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!Wy(r)||n.drawTime!=="beforeDatasetDraw"||ku(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Xy=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},QM=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Jy extends Li{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,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=et(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,i)=>t.sort(r,i,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,i=ft(r.font),s=i.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Xy(r,s);let c,u;n.font=i.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,s,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,i,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,i){const{ctx:s,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=i+a;let d=t;s.textAlign="left",s.textBaseline="middle";let f=-1,h=-u;return this.legendItems.forEach((g,m)=>{const p=r+n/2+s.measureText(g.text).width;(m===0||c[c.length-1]+p+2*a>o)&&(d+=u,c[c.length-(m>0?0:1)]=0,h+=u,f++),l[m]={left:0,top:h,row:f,width:p,height:i},c[c.length-1]+=p+a}),d}_fitCols(t,n,r,i){const{ctx:s,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-t;let d=a,f=0,h=0,g=0,m=0;return this.legendItems.forEach((p,v)=>{const{itemWidth:b,itemHeight:x}=YM(r,n,s,p,i);v>0&&h+x+2*a>u&&(d+=f+a,c.push({width:f,height:h}),g+=f+a,m++,f=h=0),l[v]={left:g,top:h,col:m,width:b,height:x},f=Math.max(f,b),h+=x+a}),d+=f,c.push({width:f,height:h}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:s}}=this,o=Yi(s,this.left,this.width);if(this.isHorizontal()){let a=0,l=wt(r,this.left+i,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=wt(r,this.left+i,this.right-this.lineWidths[a])),c.top+=this.top+t+i,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+i}else{let a=0,l=wt(r,this.top+t+i,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=wt(r,this.top+t+i,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+i,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Ac(t,this),this._draw(),Pc(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:s,labels:o}=t,a=lt.color,l=Yi(t.rtl,this.left,this.width),c=ft(o.font),{padding:u}=o,d=c.size,f=d/2;let h;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;const{boxWidth:g,boxHeight:m,itemHeight:p}=Xy(o,d),v=function(k,S,_){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;i.save();const O=je(_.lineWidth,1);if(i.fillStyle=je(_.fillStyle,a),i.lineCap=je(_.lineCap,"butt"),i.lineDashOffset=je(_.lineDashOffset,0),i.lineJoin=je(_.lineJoin,"miter"),i.lineWidth=O,i.strokeStyle=je(_.strokeStyle,a),i.setLineDash(je(_.lineDash,[])),o.usePointStyle){const A={radius:m*Math.SQRT2/2,pointStyle:_.pointStyle,rotation:_.rotation,borderWidth:O},M=l.xPlus(k,g/2),D=S+f;fb(i,A,M,D,o.pointStyleWidth&&g)}else{const A=S+Math.max((d-m)/2,0),M=l.leftForLtr(k,g),D=Qi(_.borderRadius);i.beginPath(),Object.values(D).some(W=>W!==0)?Ql(i,{x:M,y:A,w:g,h:m,radius:D}):i.rect(M,A,g,m),i.fill(),O!==0&&i.stroke()}i.restore()},b=function(k,S,_){Pi(i,_.text,k,S+p/2,c,{strikethrough:_.hidden,textAlign:l.textAlign(_.textAlign)})},x=this.isHorizontal(),C=this._computeTitleHeight();x?h={x:wt(s,this.left+u,this.right-r[0]),y:this.top+u+C,line:0}:h={x:this.left+u,y:wt(s,this.top+C+u,this.bottom-n[0].height),line:0},bb(this.ctx,t.textDirection);const w=p+u;this.legendItems.forEach((k,S)=>{i.strokeStyle=k.fontColor,i.fillStyle=k.fontColor;const _=i.measureText(k.text).width,O=l.textAlign(k.textAlign||(k.textAlign=o.textAlign)),A=g+f+_;let M=h.x,D=h.y;l.setWidth(this.width),x?S>0&&M+A+u>this.right&&(D=h.y+=w,h.line++,M=h.x=wt(s,this.left+u,this.right-r[h.line])):S>0&&D+w>this.bottom&&(M=h.x=M+n[h.line].width+u,h.line++,D=h.y=wt(s,this.top+C+u,this.bottom-n[h.line].height));const W=l.x(M);if(v(W,D,k),M=KP(O,M+g+f,x?M+A:this.right,t.rtl),b(l.x(M),D,k),x)h.x+=A+u;else if(typeof k.text!="string"){const R=c.lineHeight;h.y+=Bb(k,R)+u}else h.y+=w}),xb(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=ft(n.font),i=Ot(n.padding);if(!n.display)return;const s=Yi(t.rtl,this.left,this.width),o=this.ctx,a=n.position,l=r.size/2,c=i.top+l;let u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=wt(t.align,d,this.right-f);else{const g=this.columnSizes.reduce((m,p)=>Math.max(m,p.height),0);u=c+wt(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const h=wt(a,d,d+f);o.textAlign=s.textAlign(Cf(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=r.string,Pi(o,n.text,h,u,r)}_computeTitleHeight(){const t=this.options.title,n=ft(t.font),r=Ot(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,s;if(Gi(t,this.left,this.right)&&Gi(n,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(i=s[r],Gi(t,i.left,i.left+i.width)&&Gi(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!ZM(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,s=QM(i,r);i&&!s&&et(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!s&&et(n.onHover,[t,r,this],this)}else r&&et(n.onClick,[t,r,this],this)}}function YM(e,t,n,r,i){const s=XM(r,e,t,n),o=JM(i,r,t.lineHeight);return{itemWidth:s,itemHeight:o}}function XM(e,t,n,r){let i=e.text;return i&&typeof i!="string"&&(i=i.reduce((s,o)=>s.length>o.length?s:o)),t+n.size/2+r.measureText(i).width}function JM(e,t,n){let r=e;return typeof t.text!="string"&&(r=Bb(t,n)),r}function Bb(e,t){const n=e.text?e.text.length:0;return t*n}function ZM(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var e$={id:"legend",_element:Jy,start(e,t,n){const r=e.legend=new Jy({ctx:e.ctx,options:n,chart:e});un.configure(e,r,n),un.addBox(e,r)},stop(e){un.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;un.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:s,useBorderRadius:o,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=Ot(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:s,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class qb extends Li{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,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const i=it(r.text)?r.text.length:1;this._padding=Ot(r.padding);const s=i*ft(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:i,right:s,options:o}=this,a=o.align;let l=0,c,u,d;return this.isHorizontal()?(u=wt(a,r,s),d=n+t,c=s-r):(o.position==="left"?(u=r+t,d=wt(a,i,n),l=ut*-.5):(u=s-t,d=wt(a,n,i),l=ut*.5),c=i-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=ft(n.font),s=r.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(s);Pi(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:Cf(n.align),textBaseline:"middle",translation:[o,a]})}}function t$(e,t){const n=new qb({ctx:e.ctx,options:t,chart:e});un.configure(e,n,t),un.addBox(e,n),e.titleBlock=n}var n$={id:"title",_element:qb,start(e,t,n){t$(e,n)},stop(e){const t=e.titleBlock;un.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;un.configure(e,r,n),r.options=n},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 ko={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,s=0;for(t=0,n=e.length;t<n;++t){const a=e[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();r.add(l.x),i+=l.y,++s}}return s===0||r.size===0?!1:{x:[...r].reduce((a,l)=>a+l)/r.size,y:i/s}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=Number.POSITIVE_INFINITY,s,o,a;for(s=0,o=e.length;s<o;++s){const l=e[s].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=wd(t,c);u<i&&(i=u,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function Mn(e,t){return t&&(it(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Xn(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
66
66
  `)>-1?e.split(`
67
- `):e}function r$(e,t){const{element:n,datasetIndex:r,index:i}=t,s=e.getDatasetMeta(r).controller,{label:o,value:a}=s.getLabelAndValue(i);return{chart:e,label:o,parsed:s.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:a,dataset:s.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function Zy(e,t){const n=e.chart.ctx,{body:r,footer:i,title:s}=e,{boxWidth:o,boxHeight:a}=t,l=ft(t.bodyFont),c=ft(t.titleFont),u=ft(t.footerFont),d=s.length,f=i.length,h=r.length,g=Ot(t.padding);let m=g.height,p=0,v=r.reduce((C,w)=>C+w.before.length+w.lines.length+w.after.length,0);if(v+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),v){const C=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=h*C+(v-h)*l.lineHeight+(v-1)*t.bodySpacing}f&&(m+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let b=0;const x=function(C){p=Math.max(p,n.measureText(C).width+b)};return n.save(),n.font=c.string,Qe(e.title,x),n.font=l.string,Qe(e.beforeBody.concat(e.afterBody),x),b=t.displayColors?o+2+t.boxPadding:0,Qe(r,C=>{Qe(C.before,x),Qe(C.lines,x),Qe(C.after,x)}),b=0,n.font=u.string,Qe(e.footer,x),n.restore(),p+=g.width,{width:p,height:m}}function i$(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function s$(e,t,n,r){const{x:i,width:s}=r,o=n.caretSize+n.caretPadding;if(e==="left"&&i+s+o>t.width||e==="right"&&i-s-o<0)return!0}function o$(e,t,n,r){const{x:i,width:s}=n,{width:o,chartArea:{left:a,right:l}}=e;let c="center";return r==="center"?c=i<=(a+l)/2?"left":"right":i<=s/2?c="left":i>=o-s/2&&(c="right"),s$(c,e,t,n)&&(c="center"),c}function em(e,t,n){const r=n.yAlign||t.yAlign||i$(e,n);return{xAlign:n.xAlign||t.xAlign||o$(e,t,n,r),yAlign:r}}function a$(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function l$(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function tm(e,t,n,r){const{caretSize:i,caretPadding:s,cornerRadius:o}=e,{xAlign:a,yAlign:l}=n,c=i+s,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:h}=Qi(o);let g=a$(t,a);const m=l$(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(u,f)+i:a==="right"&&(g+=Math.max(d,h)+i),{x:cn(g,0,r.width-t.width),y:cn(m,0,r.height-t.height)}}function ul(e,t,n){const r=Ot(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function nm(e){return Mn([],Xn(e))}function c$(e,t,n){return Gr(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function rm(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const zb={beforeTitle:Wn,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:Wn,beforeBody:Wn,beforeLabel:Wn,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return Ye(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Wn,afterBody:Wn,beforeFooter:Wn,footer:Wn,afterFooter:Wn};function jt(e,t,n,r){const i=e[t].call(n,r);return typeof i=="undefined"?zb[t].call(n,r):i}class Ad extends Li{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 n=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,s=new kb(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=c$(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=jt(r,"beforeTitle",this,t),s=jt(r,"title",this,t),o=jt(r,"afterTitle",this,t);let a=[];return a=Mn(a,Xn(i)),a=Mn(a,Xn(s)),a=Mn(a,Xn(o)),a}getBeforeBody(t,n){return nm(jt(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return Qe(t,s=>{const o={before:[],lines:[],after:[]},a=rm(r,s);Mn(o.before,Xn(jt(a,"beforeLabel",this,s))),Mn(o.lines,jt(a,"label",this,s)),Mn(o.after,Xn(jt(a,"afterLabel",this,s))),i.push(o)}),i}getAfterBody(t,n){return nm(jt(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=jt(r,"beforeFooter",this,t),s=jt(r,"footer",this,t),o=jt(r,"afterFooter",this,t);let a=[];return a=Mn(a,Xn(i)),a=Mn(a,Xn(s)),a=Mn(a,Xn(o)),a}_createItems(t){const n=this._active,r=this.chart.data,i=[],s=[],o=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(r$(this.chart,n[l]));return t.filter&&(a=a.filter((u,d,f)=>t.filter(u,d,f,r))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,r))),Qe(a,u=>{const d=rm(t.callbacks,u);i.push(jt(d,"labelColor",this,u)),s.push(jt(d,"labelPointStyle",this,u)),o.push(jt(d,"labelTextColor",this,u))}),this.labelColors=i,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let s,o=[];if(!i.length)this.opacity!==0&&(s={opacity:0});else{const a=ko[r.position].call(this,i,this._eventPosition);o=this._createItems(r),this.title=this.getTitle(o,r),this.beforeBody=this.getBeforeBody(o,r),this.body=this.getBody(o,r),this.afterBody=this.getAfterBody(o,r),this.footer=this.getFooter(o,r);const l=this._size=Zy(this,r),c=Object.assign({},a,l),u=em(this.chart,r,c),d=tm(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={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,s&&this._resolveAnimations().update(this,s),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const s=this.getCaretPosition(t,r,i);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:s}=this,{caretSize:o,cornerRadius:a}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=Qi(a),{x:f,y:h}=t,{width:g,height:m}=n;let p,v,b,x,C,w;return s==="center"?(C=h+m/2,i==="left"?(p=f,v=p-o,x=C+o,w=C-o):(p=f+g,v=p+o,x=C-o,w=C+o),b=p):(i==="left"?v=f+Math.max(l,u)+o:i==="right"?v=f+g-Math.max(c,d)-o:v=this.caretX,s==="top"?(x=h,C=x-o,p=v-o,b=v+o):(x=h+m,C=x+o,p=v+o,b=v-o),w=x),{x1:p,x2:v,x3:b,y1:x,y2:C,y3:w}}drawTitle(t,n,r){const i=this.title,s=i.length;let o,a,l;if(s){const c=Yi(r.rtl,this.x,this.width);for(t.x=ul(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",o=ft(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=o.string,l=0;l<s;++l)n.fillText(i[l],c.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===s&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,i,s){const o=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=s,u=ft(s.bodyFont),d=ul(this,"left",s),f=i.x(d),h=l<u.lineHeight?(u.lineHeight-l)/2:0,g=n.y+h;if(s.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},p=i.leftForLtr(f,c)+c/2,v=g+l/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,Cd(t,m,p,v),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Cd(t,m,p,v)}else{t.lineWidth=Fe(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 m=i.leftForLtr(f,c),p=i.leftForLtr(i.xPlus(f,1),c-2),v=Qi(o.borderRadius);Object.values(v).some(b=>b!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,Ql(t,{x:m,y:g,w:c,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Ql(t,{x:p,y:g+1,w:c-2,h:l-2,radius:v}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(m,g,c,l),t.strokeRect(m,g,c,l),t.fillStyle=o.backgroundColor,t.fillRect(p,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:s,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=r,d=ft(r.bodyFont);let f=d.lineHeight,h=0;const g=Yi(r.rtl,this.x,this.width),m=function(_){n.fillText(_,g.x(t.x+h),t.y+f/2),t.y+=f+s},p=g.textAlign(o);let v,b,x,C,w,k,S;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,t.x=ul(this,p,r),n.fillStyle=r.bodyColor,Qe(this.beforeBody,m),h=a&&p!=="right"?o==="center"?c/2+u:c+2+u:0,C=0,k=i.length;C<k;++C){for(v=i[C],b=this.labelTextColors[C],n.fillStyle=b,Qe(v.before,m),x=v.lines,a&&x.length&&(this._drawColorBox(n,t,C,g,r),f=Math.max(d.lineHeight,l)),w=0,S=x.length;w<S;++w)m(x[w]),f=d.lineHeight;Qe(v.after,m)}h=0,f=d.lineHeight,Qe(this.afterBody,m),t.y-=s}drawFooter(t,n,r){const i=this.footer,s=i.length;let o,a;if(s){const l=Yi(r.rtl,this.x,this.width);for(t.x=ul(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",o=ft(r.footerFont),n.fillStyle=r.footerColor,n.font=o.string,a=0;a<s;++a)n.fillText(i[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+r.footerSpacing}}drawBackground(t,n,r,i){const{xAlign:s,yAlign:o}=this,{x:a,y:l}=t,{width:c,height:u}=r,{topLeft:d,topRight:f,bottomLeft:h,bottomRight:g}=Qi(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(a+d,l),o==="top"&&this.drawCaret(t,n,r,i),n.lineTo(a+c-f,l),n.quadraticCurveTo(a+c,l,a+c,l+f),o==="center"&&s==="right"&&this.drawCaret(t,n,r,i),n.lineTo(a+c,l+u-g),n.quadraticCurveTo(a+c,l+u,a+c-g,l+u),o==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(a+h,l+u),n.quadraticCurveTo(a,l+u,a,l+u-h),o==="center"&&s==="left"&&this.drawCaret(t,n,r,i),n.lineTo(a,l+d),n.quadraticCurveTo(a,l,a+d,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,s=r&&r.y;if(i||s){const o=ko[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=Zy(this,t),l=Object.assign({},o,this._size),c=em(n,t,l),u=tm(t,l,c,n);(i._to!==u.x||s._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 n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},s={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const o=Ot(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=r,this.drawBackground(s,t,i,n),bb(t,n.textDirection),s.y+=o.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),xb(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=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}}),s=!Ul(r,i),o=this._positionChanged(i,n);(s||o)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,s=this._active||[],o=this._getActiveElements(t,s,n,r),a=this._positionChanged(o,t),l=n||!Ul(o,s)||a;return l&&(this._active=o,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,i){const s=this.options;if(t.type==="mouseout")return[];if(!i)return n.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,s.mode,s,r);return s.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:r,caretY:i,options:s}=this,o=ko[s.position].call(this,t,n);return o!==!1&&(r!==o.x||i!==o.y)}}me(Ad,"positioners",ko);var u$={id:"tooltip",_element:Ad,positioners:ko,afterInit(e,t,n){n&&(e.tooltip=new Ad({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,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:(e,t)=>t.bodyFont.size,boxWidth:(e,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:zb},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const d$=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function f$(e,t,n,r){const i=e.indexOf(t);if(i===-1)return d$(e,t,n,r);const s=e.lastIndexOf(t);return i!==s?n:i}const h$=(e,t)=>e===null?null:cn(Math.round(e),0,t);function im(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Pd extends Us{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:i,label:s}of n)r[i]===s&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(Ye(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:f$(r,t,je(n,t),this._addedLabels),h$(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,i=[];let s=this.getLabels();s=t===0&&n===s.length-1?s:s.slice(t,n+1),this._valueRange=Math.max(s.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let o=t;o<=n;o++)i.push({value:o});return i}getLabelForValue(t){return im.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 n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}me(Pd,"id","category"),me(Pd,"defaults",{ticks:{callback:im}});function g$(e,t){const n=[],{bounds:i,step:s,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=e,h=s||1,g=u-1,{min:m,max:p}=t,v=!Ye(o),b=!Ye(a),x=!Ye(c),C=(p-m)/(d+1);let w=sy((p-m)/g/h)*h,k,S,_,O;if(w<1e-14&&!v&&!b)return[{value:m},{value:p}];O=Math.ceil(p/w)-Math.floor(m/w),O>g&&(w=sy(O*w/g/h)*h),Ye(l)||(k=Math.pow(10,l),w=Math.ceil(w*k)/k),i==="ticks"?(S=Math.floor(m/w)*w,_=Math.ceil(p/w)*w):(S=m,_=p),v&&b&&s&&LP((a-o)/s,w/1e3)?(O=Math.round(Math.min((a-o)/w,u)),w=(a-o)/O,S=o,_=a):x?(S=v?o:S,_=b?a:_,O=c-1,w=(_-S)/O):(O=(_-S)/w,Do(O,Math.round(O),w/1e3)?O=Math.round(O):O=Math.ceil(O));const A=Math.max(oy(w),oy(S));k=Math.pow(10,Ye(l)?A:l),S=Math.round(S*k)/k,_=Math.round(_*k)/k;let M=0;for(v&&(f&&S!==o?(n.push({value:o}),S<o&&M++,Do(Math.round((S+M*w)*k)/k,o,sm(o,C,e))&&M++):S<o&&M++);M<O;++M){const D=Math.round((S+M*w)*k)/k;if(b&&D>a)break;n.push({value:D})}return b&&f&&_!==a?n.length&&Do(n[n.length-1].value,a,sm(a,C,e))?n[n.length-1].value=a:n.push({value:a}):(!b||_===a)&&n.push({value:_}),n}function sm(e,t,{horizontal:n,minRotation:r}){const i=Dr(r),s=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(""+e).length;return Math.min(t/s,o)}class Td extends Us{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,n){return Ye(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:s}=this;const o=l=>i=n?i:l,a=l=>s=r?s:l;if(t){const l=Ps(i),c=Ps(s);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(i===s){let l=s===0?1:Math.abs(s*.05);a(s+l),t||o(i-l)}this.min=i,this.max=s}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},s=this._range||this,o=g$(i,s);return t.bounds==="ticks"&&IP(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 n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return db(t,this.chart.options.locale,this.options.ticks.format)}}class Md extends Td{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=yt(t)?t:0,this.max=yt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Dr(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}me(Md,"id","linear"),me(Md,"defaults",{ticks:{callback:kf.formatters.numeric}});function $d(e){const t=e.ticks;if(t.display&&e.display){const n=Ot(t.backdropPadding);return je(t.font&&t.font.size,lt.font.size)+n.height}return 0}function y$(e,t,n){return n=it(n)?n:[n],{w:iT(e,t.string,n),h:n.length*t.lineHeight}}function om(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:e<r||e>i?{start:t-n,end:t}:{start:t,end:t+n}}function m$(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],s=e._pointLabels.length,o=e.options.pointLabels,a=o.centerPointLabels?ut/s:0;for(let l=0;l<s;l++){const c=o.setContext(e.getPointLabelContext(l));i[l]=c.padding;const u=e.getPointPosition(l,e.drawingArea+i[l],a),d=ft(c.font),f=y$(e.ctx,d,e._pointLabels[l]);r[l]=f;const h=Wt(e.getIndexAngle(l)+a),g=Math.round(wf(h)),m=om(g,u.x,f.w,0,180),p=om(g,u.y,f.h,90,270);p$(n,t,h,m,p)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=x$(e,r,i)}function p$(e,t,n,r,i){const s=Math.abs(Math.sin(n)),o=Math.abs(Math.cos(n));let a=0,l=0;r.start<t.l?(a=(t.l-r.start)/s,e.l=Math.min(e.l,t.l-a)):r.end>t.r&&(a=(r.end-t.r)/s,e.r=Math.max(e.r,t.r+a)),i.start<t.t?(l=(t.t-i.start)/o,e.t=Math.min(e.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/o,e.b=Math.max(e.b,t.b+l))}function v$(e,t,n){const r=e.drawingArea,{extra:i,additionalAngle:s,padding:o,size:a}=n,l=e.getPointPosition(t,r+i+o,s),c=Math.round(wf(Wt(l.angle+Yt))),u=C$(l.y,a.h,c),d=w$(c),f=S$(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:f,top:u,right:f+a.w,bottom:u+a.h}}function b$(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:s}=e;return!(ir({x:n,y:r},t)||ir({x:n,y:s},t)||ir({x:i,y:r},t)||ir({x:i,y:s},t))}function x$(e,t,n){const r=[],i=e._pointLabels.length,s=e.options,{centerPointLabels:o,display:a}=s.pointLabels,l={extra:$d(s)/2,additionalAngle:o?ut/i:0};let c;for(let u=0;u<i;u++){l.padding=n[u],l.size=t[u];const d=v$(e,u,l);r.push(d),a==="auto"&&(d.visible=b$(d,c),d.visible&&(c=d))}return r}function w$(e){return e===0||e===180?"center":e<180?"left":"right"}function S$(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function C$(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function _$(e,t,n){const{left:r,top:i,right:s,bottom:o}=n,{backdropColor:a}=t;if(!Ye(a)){const l=Qi(t.borderRadius),c=Ot(t.backdropPadding);e.fillStyle=a;const u=r-c.left,d=i-c.top,f=s-r+c.width,h=o-i+c.height;Object.values(l).some(g=>g!==0)?(e.beginPath(),Ql(e,{x:u,y:d,w:f,h,radius:l}),e.fill()):e.fillRect(u,d,f,h)}}function k$(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){const s=e._pointLabelItems[i];if(!s.visible)continue;const o=r.setContext(e.getPointLabelContext(i));_$(n,o,s);const a=ft(o.font),{x:l,y:c,textAlign:u}=s;Pi(n,e._pointLabels[i],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function Hb(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,Xt);else{let s=e.getPointPosition(0,t);i.moveTo(s.x,s.y);for(let o=1;o<r;o++)s=e.getPointPosition(o,t),i.lineTo(s.x,s.y)}}function O$(e,t,n,r,i){const s=e.ctx,o=t.circular,{color:a,lineWidth:l}=t;!o&&!r||!a||!l||n<0||(s.save(),s.strokeStyle=a,s.lineWidth=l,s.setLineDash(i.dash||[]),s.lineDashOffset=i.dashOffset,s.beginPath(),Hb(e,n,o,r),s.closePath(),s.stroke(),s.restore())}function E$(e,t,n){return Gr(e,{label:n,index:t,type:"pointLabel"})}class Oo extends Td{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=Ot($d(this.options)/2),n=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=yt(t)&&!isNaN(t)?t:0,this.max=yt(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/$d(this.options))}generateTickLabels(t){Td.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const i=et(this.options.pointLabels.callback,[n,r],this);return i||i===0?i:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?m$(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,i){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,i))}getIndexAngle(t){const n=Xt/(this._pointLabels.length||1),r=this.options.startAngle||0;return Wt(t*n+Dr(r))}getDistanceFromCenterForValue(t){if(Ye(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(Ye(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const r=n[t];return E$(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const i=this.getIndexAngle(t)-Yt+r;return{x:Math.cos(i)*n+this.xCenter,y:Math.sin(i)*n+this.yCenter,angle:i}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:r,right:i,bottom:s}=this._pointLabelItems[t];return{left:n,top:r,right:i,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),Hb(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:i,border:s}=n,o=this._pointLabels.length;let a,l,c;if(n.pointLabels.display&&k$(this,o),i.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(d),h=i.setContext(f),g=s.setContext(f);O$(this,h,l,o,g)}}),r.display){for(t.save(),a=o-1;a>=0;a--){const u=r.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.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,n=this.options,r=n.ticks;if(!r.display)return;const i=this.getIndexAngle(0);let s,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),u=ft(c.font);if(s=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=Ot(c.backdropPadding);t.fillRect(-o/2-d.left,-s-u.size/2-d.top,o+d.width,u.size+d.height)}Pi(t,a.label,0,-s,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}me(Oo,"id","radialLinear"),me(Oo,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:kf.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),me(Oo,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),me(Oo,"descriptors",{angleLines:{_fallback:"grid"}});const Dc={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}},Rt=Object.keys(Dc);function am(e,t){return e-t}function lm(e,t){if(Ye(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:s}=e._parseOpts;let o=t;return typeof r=="function"&&(o=r(o)),yt(o)||(o=typeof r=="string"?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i==="week"&&(na(s)||s===!0)?n.startOf(o,"isoWeek",s):n.startOf(o,i)),+o)}function cm(e,t,n,r){const i=Rt.length;for(let s=Rt.indexOf(e);s<i-1;++s){const o=Dc[Rt[s]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-t)/(a*o.size))<=r)return Rt[s]}return Rt[i-1]}function A$(e,t,n,r,i){for(let s=Rt.length-1;s>=Rt.indexOf(n);s--){const o=Rt[s];if(Dc[o].common&&e._adapter.diff(i,r,o)>=t-1)return o}return Rt[n?Rt.indexOf(n):0]}function P$(e){for(let t=Rt.indexOf(e)+1,n=Rt.length;t<n;++t)if(Dc[Rt[t]].common)return Rt[t]}function um(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=Sf(n,t),s=n[r]>=t?n[r]:n[i];e[s]=!0}}function T$(e,t,n,r){const i=e._adapter,s=+i.startOf(t[0].value,r),o=t[t.length-1].value;let a,l;for(a=s;a<=o;a=+i.add(a,1,r))l=n[a],l>=0&&(t[l].major=!0);return t}function dm(e,t,n){const r=[],i={},s=t.length;let o,a;for(o=0;o<s;++o)a=t[o],i[a]=o,r.push({value:a,major:!1});return s===0||!n?r:T$(e,r,i,n)}class Jl extends Us{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,n={}){const r=t.time||(t.time={}),i=this._adapter=new d5._date(t.adapters.date);i.init(n),jo(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:lm(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:i,max:s,minDefined:o,maxDefined:a}=this.getUserBounds();function l(c){!o&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!a&&!isNaN(c.max)&&(s=Math.max(s,c.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=yt(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),s=yt(s)&&!isNaN(s)?s:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,s-1),this.max=Math.max(i+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const s=this.min,o=this.max,a=qP(i,s,o);return this._unit=n.unit||(r.autoSkip?cm(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):A$(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:P$(this._unit),this.initOffsets(i),t.reverse&&a.reverse(),dm(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,i,s;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?r=s:r=(s-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=cn(n,0,o),r=cn(r,0,o),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,s=i.time,o=s.unit||cm(s.minUnit,n,r,this._getLabelCapacity(n)),a=je(i.ticks.stepSize,1),l=o==="week"?s.isoWeekday:!1,c=na(l)||l===!0,u={};let d=n,f,h;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":o),t.diff(r,n,o)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+o);const g=i.ticks.source==="data"&&this.getDataTimestamps();for(f=d,h=0;f<r;f=+t.add(f,a,o),h++)um(u,f,g);return(f===r||i.bounds==="ticks"||h===1)&&um(u,f,g),Object.keys(u).sort(am).map(m=>+m)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const i=this.options.time.displayFormats,s=this._unit,o=n||i[s];return this._adapter.format(t,o)}_tickFormatFunction(t,n,r,i){const s=this.options,o=s.ticks.callback;if(o)return et(o,[t,n,r],this);const a=s.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],f=r[n],h=c&&d&&f&&f.major;return this._adapter.format(t,i||(h?d:u))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n<r;++n)i=t[n],i.label=this._tickFormatFunction(i.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,i=Dr(this.isHorizontal()?n.maxRotation:n.minRotation),s=Math.cos(i),o=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:r*s+a*o,h:r*o+a*s}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,s=this._tickFormatFunction(t,0,dm(this,[t],this._majorUnit),i),o=this._getLabelSize(s),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||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)t=t.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const i=this.getLabels();for(n=0,r=i.length;n<r;++n)t.push(lm(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return HP(t.sort(am))}}me(Jl,"id","time"),me(Jl,"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 dl(e,t,n){let r=0,i=e.length-1,s,o,a,l;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=ci(e,"pos",t)),{pos:s,time:a}=e[r],{pos:o,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=ci(e,"time",t)),{time:s,pos:a}=e[r],{time:o,pos:l}=e[i]);const c=o-s;return c?a+(l-a)*(t-s)/c:a}class fm extends Jl{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=dl(n,this.min),this._tableRange=dl(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],s=[];let o,a,l,c,u;for(o=0,a=t.length;o<a;++o)c=t[o],c>=n&&c<=r&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(o=0,a=i.length;o<a;++o)u=i[o+1],l=i[o-1],c=i[o],Math.round((u+l)/2)!==c&&s.push({time:c,pos:o/(a-1)});return s}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((i,s)=>i-s)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(dl(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return dl(this._table,r*this._tableRange+this._minPos,!0)}}me(fm,"id","timeseries"),me(fm,"defaults",Jl.defaults);const Ub="label";function hm(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function M$(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function Kb(e,t){e.labels=t}function Vb(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ub;const r=[];e.datasets=t.map(i=>{const s=e.datasets.find(o=>o[n]===i[n]);return!s||!i.data||r.includes(s)?{...i}:(r.push(s),Object.assign(s,i),s)})}function $$(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ub;const n={labels:[],datasets:[]};return Kb(n,e.labels),Vb(n,e.datasets,t),n}function j$(e,t){const{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:s,type:o,data:a,options:l,plugins:c=[],fallbackContent:u,updateMode:d,...f}=e,h=z.useRef(null),g=z.useRef(null),m=()=>{h.current&&(g.current=new $c(h.current,{type:o,data:$$(a,s),options:l&&{...l},plugins:c}),hm(t,g.current))},p=()=>{hm(t,null),g.current&&(g.current.destroy(),g.current=null)};return z.useEffect(()=>{!i&&g.current&&l&&M$(g.current,l)},[i,l]),z.useEffect(()=>{!i&&g.current&&Kb(g.current.config.data,a.labels)},[i,a.labels]),z.useEffect(()=>{!i&&g.current&&a.datasets&&Vb(g.current.config.data,a.datasets,s)},[i,a.datasets]),z.useEffect(()=>{g.current&&(i?(p(),setTimeout(m)):g.current.update(d))},[i,l,a.labels,a.datasets,d]),z.useEffect(()=>{g.current&&(p(),setTimeout(m))},[o]),z.useEffect(()=>(m(),()=>p()),[]),z.createElement("canvas",{ref:h,role:"img",height:n,width:r,...f},u)}const D$=z.forwardRef(j$);function Wb(e,t){return $c.register(t),z.forwardRef((n,r)=>z.createElement(D$,{...n,ref:r,type:e}))}const L$=Wb("line",kl),I$=Wb("radar",Ol);$c.register(Pd,Md,Oo,Lr,Pl,GM,n$,u$,e$);var jd={elements:{line:{backgroundColor:"rgba(166, 30, 105, 0.2)",borderColor:"rgba(166, 30, 105, 1)",borderWidth:4},point:{backgroundColor:"rgba(166, 30, 105, 1)",borderColor:"rgba(255,255,255, .9)",borderWidth:2,radius:5,hoverRadius:6,hoverBorderWidth:3}},responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{mode:"index",intersect:!1}},interaction:{mode:"nearest",axis:"x",intersect:!1}},R$=function(t){var n=t.chart.ctx,r=t.chart.chartArea;if(!r)return"rgba(166, 30, 105, 0.1)";var i=(r.left+r.right)/2,s=(r.top+r.bottom)/2,o=Math.min((r.right-r.left)/2,(r.bottom-r.top)/2),a=n.createRadialGradient(i,s,0,i,s,o);return a.addColorStop(0,"rgba(255, 255, 255, 0.4)"),a.addColorStop(.3,"rgba(255, 255, 255, 0.4)"),a.addColorStop(1,"rgba(166, 30, 105, 0.2)"),a};function gm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ym(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gm(Object(n),!0).forEach(function(r){F$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gm(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function F$(e,t,n){return(t=N$(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N$(e){var t=B$(e,"string");return $s(t)=="symbol"?t:t+""}function B$(e,t){if($s(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if($s(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $s(e){"@babel/helpers - typeof";return $s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$s(e)}function q$(e){var t=new Date(e);return isNaN(t.getTime())?String(e):t.toLocaleString("en-US",{month:"short",day:"numeric"})}var z$=function(){var t,n,r,i,s=Hs(),o=s.data,a=s.isLoading,l=s.isRefetching,c=o==null?void 0:o.mentions,u=c==null||(t=c.mentionedInNumberOfQueries)===null||t===void 0||(t=t.previous)===null||t===void 0?void 0:t.difference,d=c==null?void 0:c.chart,f=Array.isArray(d==null?void 0:d.labels)?d.labels:d!=null&&d.labels&&$s(d.labels)==="object"?Object.values(d.labels):[],h=f.map(function(v){return q$(String(v))}),g=o==null?void 0:o.numberOfQueries;if(!g){var m=0;Array.isArray(d==null?void 0:d.datasets)&&d.datasets.forEach(function(v){Array.isArray(v==null?void 0:v.data)&&v.data.forEach(function(b){typeof b=="number"&&b>m&&(m=b)})}),g=m+2}var p=ym(ym({},jd),{},{responsive:!0,maintainAspectRatio:!1,scales:{x:{display:!0,title:{display:!1,text:"Date"},grid:{display:!1}},y:{display:!0,title:{display:!1,text:"Number of Mentions"},beginAtZero:!0,max:g,ticks:{stepSize:1}}}});return y.jsx(E.Card,{className:"yst-overflow-visible",children:y.jsxs(E.Card.Content,{className:"yst-space-y-4",children:[y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(Ma,{title:"Mentions progress",tooltip:"Tracks how your brand mentions have changed over time across the same query set."}),y.jsx(Ta,{score:c==null||(n=c.mentionedInNumberOfQueries)===null||n===void 0?void 0:n.value,total:o==null?void 0:o.numberOfQueries,delta:u,deltaSuffix:"since last scan",suffix:"queries",isLoading:a||l})]}),Array.isArray(d==null||(r=d.datasets)===null||r===void 0?void 0:r.data)&&(d==null||(i=d.datasets)===null||i===void 0?void 0:i.data.length)<2?y.jsx(E.Alert,{variant:"info",children:"Needs multiple analyses before info can be shown."}):y.jsx("div",{className:"yst-h-72",children:y.jsx(L$,{data:function(){var v={labels:h,datasets:[d==null?void 0:d.datasets]};return v}(),options:p})})]})})};function fl(e){var t=e.value,n=t===void 0?"—":t,r=e.label,i=e.tooltip,s=e.className,o=e.borderBottom,a=o===void 0?!1:o,l=e.borderRight,c=l===void 0?!1:l,u=e.delta,d=e.tooltipPosition,f=d===void 0?"left":d;return y.jsxs("div",{className:Ce("yst-relative yst-flex yst-flex-col yst-items-center yst-gap-1 yst-p-4 yst-text-center",a&&"yst-border-b yst-border-slate-200",c&&"yst-border-r yst-border-slate-200",s),children:[y.jsx("p",{className:"yst-text-2xl yst-font-bold yst-text-slate-900",children:n}),y.jsx("p",{className:"yst-text-tiny yst-text-slate-600",children:r}),typeof u=="number"&&y.jsxs("p",{className:Ce("yst-flex yst-items-center yst-gap-1 yst-text-tiny yst-font-bold",Go(u)),children:[u>0?y.jsx(Kv,{}):u<0?y.jsx(Uv,{}):null,u>-1e-6&&"+",u]}),i&&y.jsx(gf,{id:"tooltip-".concat(r.replace(/\s+/g,"-").toLowerCase()),className:"yst-absolute yst-right-2 yst-top-2",position:f,children:i})]})}function H$(e){var t=e.children,n=e.className;return y.jsx("div",{className:Ce("yst-grid yst-w-full yst-grid-cols-2 yst-gap-0 yst-rounded-lg",n),children:t})}function U$(e){return e>0?"yst-text-green-600":e<0?"yst-text-red-600":"yst-text-slate-500"}function K$(e){var t=e.current,n=e.previous,r=e.className;if(typeof n!="number")return null;var i=t-n,s=i>0,o=i<0,a="".concat(i>0?"+":"").concat(i.toFixed(1),"%");return y.jsxs("div",{className:Ce("yst-flex yst-items-center yst-gap-1 yst-text-tiny yst-font-bold",U$(i),r),"aria-label":s?"Visibility increased by ".concat(a):o?"Visibility decreased by ".concat(a):"No change in visibility",children:[s&&y.jsx(Kv,{className:"yst-w-4 yst-h-4"}),o&&y.jsx(Uv,{className:"yst-w-4 yst-h-4"}),a]})}function ia(e){"@babel/helpers - typeof";return ia=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ia(e)}function mm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function hl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mm(Object(n),!0).forEach(function(r){V$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mm(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function V$(e,t,n){return(t=W$(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W$(e){var t=G$(e,"string");return ia(t)=="symbol"?t:t+""}function G$(e,t){if(ia(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ia(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Q$(){var e,t,n,r,i,s,o,a,l,c,u,d,f,h,g,m,p,v,b,x,C,w,k,S=Hn(),_=S.brandId,O=S.analysisId,A=wc(_,O,{query:{select:function(ye){var Te=ye.data;return Te},enabled:!!_&&!!O}}),M=A.data,D=A.isLoading,W=M==null||(e=M.analysis)===null||e===void 0?void 0:e.scans,R=Array.isArray(W)&&W.length>0?W.reduce(function(De,ye){if(!De)return ye;if(!(ye!=null&&ye.finishedAt)||!(De!=null&&De.finishedAt))return De;var Te=new Date(ye.finishedAt),Me=new Date(De.finishedAt);return Te>Me?ye:De},void 0):void 0,L=R==null||(t=R.scores)===null||t===void 0?void 0:t.raw,j=R==null||(n=R.scores)===null||n===void 0?void 0:n.standardized,I=20,oe=(r=R==null||(i=R.mentions)===null||i===void 0||(i=i.mentionedInNumberOfQueries)===null||i===void 0?void 0:i.value)!==null&&r!==void 0?r:0,ue=R==null||(s=R.scores)===null||s===void 0||(s=s.standardized)===null||s===void 0||(s=s.awareness)===null||s===void 0||(s=s.previous)===null||s===void 0?void 0:s.difference,B=typeof ue=="number"?ue/I:void 0,Y=(o=R==null||(a=R.citations)===null||a===void 0||(a=a.total)===null||a===void 0?void 0:a.value)!==null&&o!==void 0?o:0,ne=R==null||(l=R.rankings)===null||l===void 0||(l=l.list)===null||l===void 0?void 0:l.find(function(De){var ye;return((ye=De.brand)===null||ye===void 0?void 0:ye.isSelf)===!0}),ae=(c=ne==null||(u=ne.rank)===null||u===void 0?void 0:u.value)!==null&&c!==void 0?c:null,F=ne==null||(d=ne.rank)===null||d===void 0||(d=d.previous)===null||d===void 0?void 0:d.difference,G=typeof F=="number"?F/I:void 0,q=(f=j==null||(h=j.visibility)===null||h===void 0?void 0:h.value)!==null&&f!==void 0?f:0,ce=j==null||(g=j.visibility)===null||g===void 0||(g=g.previous)===null||g===void 0?void 0:g.value,V=(m=j==null||(p=j.ranking)===null||p===void 0?void 0:p.value)!==null&&m!==void 0?m:0,fe=(v=j==null||(b=j.sentiment)===null||b===void 0?void 0:b.value)!==null&&v!==void 0?v:0,he=(x=j==null||(C=j.awareness)===null||C===void 0?void 0:C.value)!==null&&x!==void 0?x:0,Ie={labels:["Mentions","Ranking","Citations","Sentiment"],datasets:[{data:[he,V,Y,fe],backgroundColor:R$,pointBackgroundColor:"rgba(166, 30, 105, 1)"}]},te=hl(hl({},jd),{},{plugins:hl(hl({},jd.plugins),{},{tooltip:{mode:"point",intersect:!0,callbacks:{label:function(ye){var Te=ye.label||"",Me=ye.parsed.r||0;return"".concat(Te,": ").concat(Me,"%")}}}}),interaction:{mode:"point",intersect:!0},scales:{r:{beginAtZero:!0,min:0,max:100,ticks:{stepSize:20}}}});return y.jsx(E.Card,{className:"yst-overflow-visible md:yst-col-span-2",children:y.jsxs(E.Card.Content,{children:[y.jsx(E.Title,{size:"3",className:"yst-mb-2",children:"AI visibility score"}),y.jsx(Ta,{score:q,total:100,isLoading:D}),y.jsx(K$,{current:q,previous:ce,className:"yst-mb-4"}),y.jsxs("div",{className:"yst-flex yst-flex-col yst-items-center yst-justify-around yst-justify-items-center yst-gap-8 md:yst-flex-row",children:[y.jsxs("div",{className:"yst-radar-chart-container yst-relative yst-aspect-square yst-h-full yst-w-full md:yst-flex md:yst-w-1/2 md:yst-items-center md:yst-justify-center",children:[y.jsx(I$,{data:Ie,options:te}),y.jsx(gf,{id:"tooltip-radar-chart",className:"yst-absolute yst-right-2 yst-top-2",placement:"left",children:"The AI Visibility Index (AIVI) shows how visible your brand is across major AI platforms like ChatGPT, based on mentions, citations, sentiment, and rankings."})]}),y.jsx("div",{className:"yst-mt-6 yst-w-full md:yst-mt-0 md:yst-flex md:yst-w-1/2 md:yst-items-center",children:y.jsxs(H$,{children:[y.jsx(fl,{value:oe,label:"Mentions",tooltip:"Mentions show how often your brand appears in AI-generated answers to the questions we send to LLMs.",borderBottom:!0,borderRight:!0,delta:B}),y.jsx(fl,{value:ae&&y.jsxs(y.Fragment,{children:[ae,ae===1&&" 🏆"]}),label:"Competitor ranking",tooltip:"Ranking shows the position your brand is mentioned in AI-generated answers—whether in a numbered list or the order of appearance in full-text responses.",borderBottom:!0,delta:G}),y.jsx(fl,{value:Y,label:"Citations",tooltip:"Citations are the source links found in AI-generated answers. They form the basis for mentions, sentiment, and ranking insights.",borderRight:!0,delta:L==null||(w=L.citations)===null||w===void 0||(w=w.previous)===null||w===void 0?void 0:w.value}),y.jsx(fl,{value:fe?"".concat(fe,"%"):"—%",label:"Positive sentiment",tooltip:"Sentiment reflects how positively, neutrally, or negatively your brand is mentioned in AI-generated answers, based on the cited sources.",delta:R==null||(k=R.scores)===null||k===void 0||(k=k.standardized)===null||k===void 0||(k=k.sentiment)===null||k===void 0||(k=k.previous)===null||k===void 0?void 0:k.difference})]})})]})]})})}var ti={pending:"pending",processing:"processing",completed:"completed",failed:"failed",cancelled:"cancelled"},Eu=function(){var t=Hn(),n=t.brandId,r=t.analysisId,i=zs({query:{select:function(S){var _=S.data;return _==null?void 0:_.brands}}}),s=i.data,o=i.isLoading,a=Rv(n,{query:{enabled:!!n,select:function(S){var _=S.data;return _}}}),l=a.data,c=a.isLoading,u=wc(n,r,{query:{enabled:!!n&&!!r&&r!=="latest"&&typeof r=="string"&&r.length>0,select:function(S){var _=S.data;return _==null?void 0:_.analysis}}}),d=u.data,f=u.isLoading,h=(l==null?void 0:l.name)||"your brand",g=oE(l==null?void 0:l.nextScheduledAnalysis),m=d==null?void 0:d.status,p=function(){switch(m){case ti.pending:return{alertContent:y.jsxs("div",{className:"yst-max-w-xl yst-space-y-2",children:[y.jsx("p",{className:"yst-font-medium",children:"Your analysis is scheduled"}),y.jsxs("p",{children:["You've completed the setup for"," ",y.jsx("b",{className:"yst-font-medium",children:h}),". The analysis is scheduled to run on"," ",y.jsx("b",{className:"yst-font-medium",children:g}),". You'll see the results here once it's ready, and we'll also notify you by email."]})]}),alertVariant:"info"};case ti.processing:return{alertContent:y.jsxs(y.Fragment,{children:["You've completed the setup for ",h,". The analysis is now processing. You'll see the results here once it's ready, and we'll also notify you by email."]}),alertVariant:"info"};case ti.failed:return{alertContent:y.jsx(y.Fragment,{children:"Analysis failed. Try restarting the analysis or contact support if the issue persists."}),alertVariant:"danger"};case ti.cancelled:return{alertContent:y.jsx(y.Fragment,{children:"Analysis was cancelled. You can restart the analysis when ready."}),alertVariant:"warning"};case ti.completed:return{alertContent:null};default:return{alertContent:null,alertVariant:"info"}}}(),v=p.alertContent,b=p.alertVariant,x=o||c||f,C=s&&(s==null?void 0:s.length)>0,w=!x&&d&&m===ti.completed;return C?y.jsxs("div",{className:"yst-space-y-8",children:[y.jsx(eP,{}),m!==ti.completed&&v&&y.jsx(E.Alert,{className:"md:yst-col-span-2",variant:b,children:v}),w&&y.jsxs("div",{className:"yst-space-y-4",children:[y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-between",children:[y.jsx(E.Title,{size:"2",children:"Your brand analysis"}),y.jsxs(E.Button,{as:Vr,variant:"secondary",to:"/brand-list",className:Ce("yst-gap-1.5"),disabled:!n,children:[y.jsx(qv,{})," Edit brand list"]})]}),y.jsxs("div",{className:"yst-grid yst-grid-cols-1 yst-gap-4 md:yst-grid-cols-2",children:[y.jsx(Q$,{}),y.jsx(tP,{}),y.jsx(z$,{}),y.jsx(fA,{}),y.jsx(oA,{}),y.jsx(KE,{}),y.jsx(hA,{})]})]})]}):y.jsx(PE,{})};function Gb(e){var t=e.children,n=e.description,r=e.title;return y.jsxs(E.Card.Header,{className:"yst-h-auto yst-flex-col yst-items-start yst-gap-0 yst-border-b-[1px] yst-border-b-slate-200 yst-bg-white yst-py-8",children:[r&&y.jsx(E.Title,{className:Ce({"yst-mb-3":n||t}),children:r}),n&&y.jsx("p",{children:n}),t]})}var Y$=function(){return y.jsx(E.Card,{className:"yst-mb-4",children:y.jsxs(E.Card.Content,{className:"yst-flex yst-flex-col yst-gap-8",children:[y.jsx(E.Title,{size:"2",children:"Query - Best fish restaurant in Nijmegen"}),y.jsxs("div",{children:[y.jsx("p",{children:"AI Response:"}),y.jsx(E.Link,{href:"#todo",children:"Show more"})]}),y.jsxs("div",{children:[y.jsx("p",{children:"Extracted brands:"}),y.jsx(E.Badge,{children:"Example"}),y.jsx(E.Badge,{children:"Example"}),y.jsx(E.Badge,{children:"Example"}),y.jsx(E.Badge,{children:"Example"}),y.jsx(E.Badge,{children:"Example"})]}),y.jsxs(E.Table,{children:[y.jsx(E.Table.Head,{children:y.jsxs(E.Table.Row,{children:[y.jsx(E.Table.Header,{children:"URL"}),y.jsx(E.Table.Header,{children:"Associated brand"})]})}),y.jsxs(E.Table.Body,{children:[y.jsxs(E.Table.Row,{children:[y.jsx(E.Table.Cell,{children:y.jsx(E.Link,{href:"https://example.com",target:"_blank",children:"https://example.com"})}),y.jsx(E.Table.Cell,{children:"Example Brand"})]}),y.jsxs(E.Table.Row,{children:[y.jsx(E.Table.Cell,{children:y.jsx(E.Link,{href:"https://example2.com",target:"_blank",children:"https://example2.com"})}),y.jsx(E.Table.Cell,{children:"Example Brand 2"})]})]})]})]})})},X$=function(){return y.jsxs(E.Card,{children:[y.jsx(Gb,{title:"Query history"}),y.jsx(E.Card,{className:"yst-mb-4",children:y.jsxs(E.Card.Content,{children:[y.jsxs("p",{className:"yst-mb-8",children:["Manna Fish Restaurant - Analysis performed on:"," ",y.jsx(E.Badge,{children:"2025-04-08 12:31:21"})]}),[0,1,2,3,4].map(function(t){return y.jsx(Y$,{},t)})]})})]})},J$=z.lazy(function(){return Promise.resolve().then(()=>aR)}),Z$=z.lazy(function(){return Promise.resolve().then(()=>DR)}),ej=z.lazy(function(){return Promise.resolve().then(()=>RR)}),tj=z.lazy(function(){return Promise.resolve().then(()=>JR)}),nj=z.lazy(function(){return Promise.resolve().then(()=>gF)}),rj=z.lazy(function(){return Promise.resolve().then(()=>pF)}),ij=new O2({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1,staleTime:1e3*60*5},mutations:{retry:!1}}}),ni=function(){return y.jsx("div",{className:"yst-flex yst-min-h-[200px] yst-items-center yst-justify-center",children:y.jsxs("div",{className:"yst-w-full yst-max-w-md yst-space-y-3",children:[y.jsx(E.SkeletonLoader,{className:"yst-h-8 yst-w-3/4"}),y.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-full"}),y.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-2/3"})]})})},sj=function(t){var n=t.hideNav,r=n===void 0?!1:n,i=t.disableLayout,s=i===void 0?!1:i,o=t.DebugInfo;return y.jsx($w,{children:y.jsxs(zt,{element:y.jsx(rE,{hideNav:r,disableLayout:s,DebugInfo:o}),children:[y.jsxs(zt,{path:"/",element:y.jsx(Zd,{}),children:[y.jsx(zt,{index:!0,element:y.jsx(Eu,{})}),y.jsx(zt,{path:"brands/:brandId",element:y.jsx(Eu,{})}),y.jsx(zt,{path:"brands/:brandId/analysis/:analysisId",element:y.jsx(Eu,{})}),y.jsx(zt,{path:"/brand-list",element:y.jsx(z.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(J$,{})})}),y.jsxs(zt,{path:"/setup",element:y.jsx(z.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(ej,{})}),children:[y.jsx(zt,{index:!0,element:y.jsx(z.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(tj,{})})}),y.jsx(zt,{path:":brandId/queries",element:y.jsx(z.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(nj,{})})})]}),y.jsx(zt,{path:"/setup/:brandId/analysis",element:y.jsx(z.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(rj,{})})})]}),y.jsx(zt,{path:"/settings",element:y.jsx(z.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(Z$,{})})}),y.jsx(zt,{path:"/query-history",element:y.jsx(z.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(X$,{})})})]})})},oj=function(t){var n=t.DebugInfo,r=t.hostAppProps;return y.jsxs(M2,{client:ij,children:[y.jsx(aO,{hostAppProps:r,children:y.jsx(sj,{DebugInfo:n})}),y.jsx(vC,{initialIsOpen:!1})]})};function aj(e){var t=e.subpath,n=t===void 0?"/":t,r=e.onNavigate,i=_n(),s=en(),o=z.useRef(n),a=z.useRef(null),l=z.useRef(!1),c="".concat(s.pathname).concat(s.search).concat(s.hash),u=z.useCallback(r,[r]);return z.useEffect(function(){if(n===c){o.current=n;return}l.current||n!==o.current&&(o.current=n,a.current=n,l.current=!0,i(n,{replace:!0}),setTimeout(function(){l.current=!1},10))},[n,c,i]),z.useEffect(function(){l.current||c!==n&&c!==a.current&&(a.current=c,u(c))},[c,n,u]),null}function lj(e,t){return fj(e)||dj(e,t)||uj(e,t)||cj()}function cj(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
67
+ `):e}function r$(e,t){const{element:n,datasetIndex:r,index:i}=t,s=e.getDatasetMeta(r).controller,{label:o,value:a}=s.getLabelAndValue(i);return{chart:e,label:o,parsed:s.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:a,dataset:s.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function Zy(e,t){const n=e.chart.ctx,{body:r,footer:i,title:s}=e,{boxWidth:o,boxHeight:a}=t,l=ft(t.bodyFont),c=ft(t.titleFont),u=ft(t.footerFont),d=s.length,f=i.length,h=r.length,g=Ot(t.padding);let m=g.height,p=0,v=r.reduce((C,w)=>C+w.before.length+w.lines.length+w.after.length,0);if(v+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),v){const C=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=h*C+(v-h)*l.lineHeight+(v-1)*t.bodySpacing}f&&(m+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let b=0;const x=function(C){p=Math.max(p,n.measureText(C).width+b)};return n.save(),n.font=c.string,Qe(e.title,x),n.font=l.string,Qe(e.beforeBody.concat(e.afterBody),x),b=t.displayColors?o+2+t.boxPadding:0,Qe(r,C=>{Qe(C.before,x),Qe(C.lines,x),Qe(C.after,x)}),b=0,n.font=u.string,Qe(e.footer,x),n.restore(),p+=g.width,{width:p,height:m}}function i$(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function s$(e,t,n,r){const{x:i,width:s}=r,o=n.caretSize+n.caretPadding;if(e==="left"&&i+s+o>t.width||e==="right"&&i-s-o<0)return!0}function o$(e,t,n,r){const{x:i,width:s}=n,{width:o,chartArea:{left:a,right:l}}=e;let c="center";return r==="center"?c=i<=(a+l)/2?"left":"right":i<=s/2?c="left":i>=o-s/2&&(c="right"),s$(c,e,t,n)&&(c="center"),c}function em(e,t,n){const r=n.yAlign||t.yAlign||i$(e,n);return{xAlign:n.xAlign||t.xAlign||o$(e,t,n,r),yAlign:r}}function a$(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function l$(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function tm(e,t,n,r){const{caretSize:i,caretPadding:s,cornerRadius:o}=e,{xAlign:a,yAlign:l}=n,c=i+s,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:h}=Qi(o);let g=a$(t,a);const m=l$(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(u,f)+i:a==="right"&&(g+=Math.max(d,h)+i),{x:cn(g,0,r.width-t.width),y:cn(m,0,r.height-t.height)}}function ul(e,t,n){const r=Ot(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function nm(e){return Mn([],Xn(e))}function c$(e,t,n){return Gr(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function rm(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const zb={beforeTitle:Wn,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:Wn,beforeBody:Wn,beforeLabel:Wn,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return Ye(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Wn,afterBody:Wn,beforeFooter:Wn,footer:Wn,afterFooter:Wn};function jt(e,t,n,r){const i=e[t].call(n,r);return typeof i=="undefined"?zb[t].call(n,r):i}class Ad extends Li{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 n=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,s=new kb(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=c$(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=jt(r,"beforeTitle",this,t),s=jt(r,"title",this,t),o=jt(r,"afterTitle",this,t);let a=[];return a=Mn(a,Xn(i)),a=Mn(a,Xn(s)),a=Mn(a,Xn(o)),a}getBeforeBody(t,n){return nm(jt(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return Qe(t,s=>{const o={before:[],lines:[],after:[]},a=rm(r,s);Mn(o.before,Xn(jt(a,"beforeLabel",this,s))),Mn(o.lines,jt(a,"label",this,s)),Mn(o.after,Xn(jt(a,"afterLabel",this,s))),i.push(o)}),i}getAfterBody(t,n){return nm(jt(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=jt(r,"beforeFooter",this,t),s=jt(r,"footer",this,t),o=jt(r,"afterFooter",this,t);let a=[];return a=Mn(a,Xn(i)),a=Mn(a,Xn(s)),a=Mn(a,Xn(o)),a}_createItems(t){const n=this._active,r=this.chart.data,i=[],s=[],o=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(r$(this.chart,n[l]));return t.filter&&(a=a.filter((u,d,f)=>t.filter(u,d,f,r))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,r))),Qe(a,u=>{const d=rm(t.callbacks,u);i.push(jt(d,"labelColor",this,u)),s.push(jt(d,"labelPointStyle",this,u)),o.push(jt(d,"labelTextColor",this,u))}),this.labelColors=i,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let s,o=[];if(!i.length)this.opacity!==0&&(s={opacity:0});else{const a=ko[r.position].call(this,i,this._eventPosition);o=this._createItems(r),this.title=this.getTitle(o,r),this.beforeBody=this.getBeforeBody(o,r),this.body=this.getBody(o,r),this.afterBody=this.getAfterBody(o,r),this.footer=this.getFooter(o,r);const l=this._size=Zy(this,r),c=Object.assign({},a,l),u=em(this.chart,r,c),d=tm(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={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,s&&this._resolveAnimations().update(this,s),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const s=this.getCaretPosition(t,r,i);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:s}=this,{caretSize:o,cornerRadius:a}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=Qi(a),{x:f,y:h}=t,{width:g,height:m}=n;let p,v,b,x,C,w;return s==="center"?(C=h+m/2,i==="left"?(p=f,v=p-o,x=C+o,w=C-o):(p=f+g,v=p+o,x=C-o,w=C+o),b=p):(i==="left"?v=f+Math.max(l,u)+o:i==="right"?v=f+g-Math.max(c,d)-o:v=this.caretX,s==="top"?(x=h,C=x-o,p=v-o,b=v+o):(x=h+m,C=x+o,p=v+o,b=v-o),w=x),{x1:p,x2:v,x3:b,y1:x,y2:C,y3:w}}drawTitle(t,n,r){const i=this.title,s=i.length;let o,a,l;if(s){const c=Yi(r.rtl,this.x,this.width);for(t.x=ul(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",o=ft(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=o.string,l=0;l<s;++l)n.fillText(i[l],c.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===s&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,i,s){const o=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=s,u=ft(s.bodyFont),d=ul(this,"left",s),f=i.x(d),h=l<u.lineHeight?(u.lineHeight-l)/2:0,g=n.y+h;if(s.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},p=i.leftForLtr(f,c)+c/2,v=g+l/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,Cd(t,m,p,v),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Cd(t,m,p,v)}else{t.lineWidth=Fe(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 m=i.leftForLtr(f,c),p=i.leftForLtr(i.xPlus(f,1),c-2),v=Qi(o.borderRadius);Object.values(v).some(b=>b!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,Ql(t,{x:m,y:g,w:c,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Ql(t,{x:p,y:g+1,w:c-2,h:l-2,radius:v}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(m,g,c,l),t.strokeRect(m,g,c,l),t.fillStyle=o.backgroundColor,t.fillRect(p,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:s,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=r,d=ft(r.bodyFont);let f=d.lineHeight,h=0;const g=Yi(r.rtl,this.x,this.width),m=function(_){n.fillText(_,g.x(t.x+h),t.y+f/2),t.y+=f+s},p=g.textAlign(o);let v,b,x,C,w,k,S;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,t.x=ul(this,p,r),n.fillStyle=r.bodyColor,Qe(this.beforeBody,m),h=a&&p!=="right"?o==="center"?c/2+u:c+2+u:0,C=0,k=i.length;C<k;++C){for(v=i[C],b=this.labelTextColors[C],n.fillStyle=b,Qe(v.before,m),x=v.lines,a&&x.length&&(this._drawColorBox(n,t,C,g,r),f=Math.max(d.lineHeight,l)),w=0,S=x.length;w<S;++w)m(x[w]),f=d.lineHeight;Qe(v.after,m)}h=0,f=d.lineHeight,Qe(this.afterBody,m),t.y-=s}drawFooter(t,n,r){const i=this.footer,s=i.length;let o,a;if(s){const l=Yi(r.rtl,this.x,this.width);for(t.x=ul(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",o=ft(r.footerFont),n.fillStyle=r.footerColor,n.font=o.string,a=0;a<s;++a)n.fillText(i[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+r.footerSpacing}}drawBackground(t,n,r,i){const{xAlign:s,yAlign:o}=this,{x:a,y:l}=t,{width:c,height:u}=r,{topLeft:d,topRight:f,bottomLeft:h,bottomRight:g}=Qi(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(a+d,l),o==="top"&&this.drawCaret(t,n,r,i),n.lineTo(a+c-f,l),n.quadraticCurveTo(a+c,l,a+c,l+f),o==="center"&&s==="right"&&this.drawCaret(t,n,r,i),n.lineTo(a+c,l+u-g),n.quadraticCurveTo(a+c,l+u,a+c-g,l+u),o==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(a+h,l+u),n.quadraticCurveTo(a,l+u,a,l+u-h),o==="center"&&s==="left"&&this.drawCaret(t,n,r,i),n.lineTo(a,l+d),n.quadraticCurveTo(a,l,a+d,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,s=r&&r.y;if(i||s){const o=ko[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=Zy(this,t),l=Object.assign({},o,this._size),c=em(n,t,l),u=tm(t,l,c,n);(i._to!==u.x||s._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 n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},s={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const o=Ot(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=r,this.drawBackground(s,t,i,n),bb(t,n.textDirection),s.y+=o.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),xb(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=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}}),s=!Ul(r,i),o=this._positionChanged(i,n);(s||o)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,s=this._active||[],o=this._getActiveElements(t,s,n,r),a=this._positionChanged(o,t),l=n||!Ul(o,s)||a;return l&&(this._active=o,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,i){const s=this.options;if(t.type==="mouseout")return[];if(!i)return n.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,s.mode,s,r);return s.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:r,caretY:i,options:s}=this,o=ko[s.position].call(this,t,n);return o!==!1&&(r!==o.x||i!==o.y)}}me(Ad,"positioners",ko);var u$={id:"tooltip",_element:Ad,positioners:ko,afterInit(e,t,n){n&&(e.tooltip=new Ad({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,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:(e,t)=>t.bodyFont.size,boxWidth:(e,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:zb},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const d$=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function f$(e,t,n,r){const i=e.indexOf(t);if(i===-1)return d$(e,t,n,r);const s=e.lastIndexOf(t);return i!==s?n:i}const h$=(e,t)=>e===null?null:cn(Math.round(e),0,t);function im(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Pd extends Us{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:i,label:s}of n)r[i]===s&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(Ye(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:f$(r,t,je(n,t),this._addedLabels),h$(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,i=[];let s=this.getLabels();s=t===0&&n===s.length-1?s:s.slice(t,n+1),this._valueRange=Math.max(s.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let o=t;o<=n;o++)i.push({value:o});return i}getLabelForValue(t){return im.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 n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}me(Pd,"id","category"),me(Pd,"defaults",{ticks:{callback:im}});function g$(e,t){const n=[],{bounds:i,step:s,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=e,h=s||1,g=u-1,{min:m,max:p}=t,v=!Ye(o),b=!Ye(a),x=!Ye(c),C=(p-m)/(d+1);let w=sy((p-m)/g/h)*h,k,S,_,O;if(w<1e-14&&!v&&!b)return[{value:m},{value:p}];O=Math.ceil(p/w)-Math.floor(m/w),O>g&&(w=sy(O*w/g/h)*h),Ye(l)||(k=Math.pow(10,l),w=Math.ceil(w*k)/k),i==="ticks"?(S=Math.floor(m/w)*w,_=Math.ceil(p/w)*w):(S=m,_=p),v&&b&&s&&LP((a-o)/s,w/1e3)?(O=Math.round(Math.min((a-o)/w,u)),w=(a-o)/O,S=o,_=a):x?(S=v?o:S,_=b?a:_,O=c-1,w=(_-S)/O):(O=(_-S)/w,Do(O,Math.round(O),w/1e3)?O=Math.round(O):O=Math.ceil(O));const A=Math.max(oy(w),oy(S));k=Math.pow(10,Ye(l)?A:l),S=Math.round(S*k)/k,_=Math.round(_*k)/k;let M=0;for(v&&(f&&S!==o?(n.push({value:o}),S<o&&M++,Do(Math.round((S+M*w)*k)/k,o,sm(o,C,e))&&M++):S<o&&M++);M<O;++M){const D=Math.round((S+M*w)*k)/k;if(b&&D>a)break;n.push({value:D})}return b&&f&&_!==a?n.length&&Do(n[n.length-1].value,a,sm(a,C,e))?n[n.length-1].value=a:n.push({value:a}):(!b||_===a)&&n.push({value:_}),n}function sm(e,t,{horizontal:n,minRotation:r}){const i=Dr(r),s=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(""+e).length;return Math.min(t/s,o)}class Td extends Us{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,n){return Ye(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:s}=this;const o=l=>i=n?i:l,a=l=>s=r?s:l;if(t){const l=Ps(i),c=Ps(s);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(i===s){let l=s===0?1:Math.abs(s*.05);a(s+l),t||o(i-l)}this.min=i,this.max=s}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},s=this._range||this,o=g$(i,s);return t.bounds==="ticks"&&IP(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 n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return db(t,this.chart.options.locale,this.options.ticks.format)}}class Md extends Td{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=yt(t)?t:0,this.max=yt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Dr(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}me(Md,"id","linear"),me(Md,"defaults",{ticks:{callback:kf.formatters.numeric}});function $d(e){const t=e.ticks;if(t.display&&e.display){const n=Ot(t.backdropPadding);return je(t.font&&t.font.size,lt.font.size)+n.height}return 0}function y$(e,t,n){return n=it(n)?n:[n],{w:iT(e,t.string,n),h:n.length*t.lineHeight}}function om(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:e<r||e>i?{start:t-n,end:t}:{start:t,end:t+n}}function m$(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],s=e._pointLabels.length,o=e.options.pointLabels,a=o.centerPointLabels?ut/s:0;for(let l=0;l<s;l++){const c=o.setContext(e.getPointLabelContext(l));i[l]=c.padding;const u=e.getPointPosition(l,e.drawingArea+i[l],a),d=ft(c.font),f=y$(e.ctx,d,e._pointLabels[l]);r[l]=f;const h=Wt(e.getIndexAngle(l)+a),g=Math.round(wf(h)),m=om(g,u.x,f.w,0,180),p=om(g,u.y,f.h,90,270);p$(n,t,h,m,p)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=x$(e,r,i)}function p$(e,t,n,r,i){const s=Math.abs(Math.sin(n)),o=Math.abs(Math.cos(n));let a=0,l=0;r.start<t.l?(a=(t.l-r.start)/s,e.l=Math.min(e.l,t.l-a)):r.end>t.r&&(a=(r.end-t.r)/s,e.r=Math.max(e.r,t.r+a)),i.start<t.t?(l=(t.t-i.start)/o,e.t=Math.min(e.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/o,e.b=Math.max(e.b,t.b+l))}function v$(e,t,n){const r=e.drawingArea,{extra:i,additionalAngle:s,padding:o,size:a}=n,l=e.getPointPosition(t,r+i+o,s),c=Math.round(wf(Wt(l.angle+Yt))),u=C$(l.y,a.h,c),d=w$(c),f=S$(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:f,top:u,right:f+a.w,bottom:u+a.h}}function b$(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:s}=e;return!(ir({x:n,y:r},t)||ir({x:n,y:s},t)||ir({x:i,y:r},t)||ir({x:i,y:s},t))}function x$(e,t,n){const r=[],i=e._pointLabels.length,s=e.options,{centerPointLabels:o,display:a}=s.pointLabels,l={extra:$d(s)/2,additionalAngle:o?ut/i:0};let c;for(let u=0;u<i;u++){l.padding=n[u],l.size=t[u];const d=v$(e,u,l);r.push(d),a==="auto"&&(d.visible=b$(d,c),d.visible&&(c=d))}return r}function w$(e){return e===0||e===180?"center":e<180?"left":"right"}function S$(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function C$(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function _$(e,t,n){const{left:r,top:i,right:s,bottom:o}=n,{backdropColor:a}=t;if(!Ye(a)){const l=Qi(t.borderRadius),c=Ot(t.backdropPadding);e.fillStyle=a;const u=r-c.left,d=i-c.top,f=s-r+c.width,h=o-i+c.height;Object.values(l).some(g=>g!==0)?(e.beginPath(),Ql(e,{x:u,y:d,w:f,h,radius:l}),e.fill()):e.fillRect(u,d,f,h)}}function k$(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){const s=e._pointLabelItems[i];if(!s.visible)continue;const o=r.setContext(e.getPointLabelContext(i));_$(n,o,s);const a=ft(o.font),{x:l,y:c,textAlign:u}=s;Pi(n,e._pointLabels[i],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function Hb(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,Xt);else{let s=e.getPointPosition(0,t);i.moveTo(s.x,s.y);for(let o=1;o<r;o++)s=e.getPointPosition(o,t),i.lineTo(s.x,s.y)}}function O$(e,t,n,r,i){const s=e.ctx,o=t.circular,{color:a,lineWidth:l}=t;!o&&!r||!a||!l||n<0||(s.save(),s.strokeStyle=a,s.lineWidth=l,s.setLineDash(i.dash||[]),s.lineDashOffset=i.dashOffset,s.beginPath(),Hb(e,n,o,r),s.closePath(),s.stroke(),s.restore())}function E$(e,t,n){return Gr(e,{label:n,index:t,type:"pointLabel"})}class Oo extends Td{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=Ot($d(this.options)/2),n=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=yt(t)&&!isNaN(t)?t:0,this.max=yt(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/$d(this.options))}generateTickLabels(t){Td.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const i=et(this.options.pointLabels.callback,[n,r],this);return i||i===0?i:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?m$(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,i){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,i))}getIndexAngle(t){const n=Xt/(this._pointLabels.length||1),r=this.options.startAngle||0;return Wt(t*n+Dr(r))}getDistanceFromCenterForValue(t){if(Ye(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(Ye(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const r=n[t];return E$(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const i=this.getIndexAngle(t)-Yt+r;return{x:Math.cos(i)*n+this.xCenter,y:Math.sin(i)*n+this.yCenter,angle:i}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:r,right:i,bottom:s}=this._pointLabelItems[t];return{left:n,top:r,right:i,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),Hb(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:i,border:s}=n,o=this._pointLabels.length;let a,l,c;if(n.pointLabels.display&&k$(this,o),i.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(d),h=i.setContext(f),g=s.setContext(f);O$(this,h,l,o,g)}}),r.display){for(t.save(),a=o-1;a>=0;a--){const u=r.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.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,n=this.options,r=n.ticks;if(!r.display)return;const i=this.getIndexAngle(0);let s,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),u=ft(c.font);if(s=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=Ot(c.backdropPadding);t.fillRect(-o/2-d.left,-s-u.size/2-d.top,o+d.width,u.size+d.height)}Pi(t,a.label,0,-s,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}me(Oo,"id","radialLinear"),me(Oo,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:kf.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),me(Oo,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),me(Oo,"descriptors",{angleLines:{_fallback:"grid"}});const Dc={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}},Rt=Object.keys(Dc);function am(e,t){return e-t}function lm(e,t){if(Ye(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:s}=e._parseOpts;let o=t;return typeof r=="function"&&(o=r(o)),yt(o)||(o=typeof r=="string"?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i==="week"&&(na(s)||s===!0)?n.startOf(o,"isoWeek",s):n.startOf(o,i)),+o)}function cm(e,t,n,r){const i=Rt.length;for(let s=Rt.indexOf(e);s<i-1;++s){const o=Dc[Rt[s]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-t)/(a*o.size))<=r)return Rt[s]}return Rt[i-1]}function A$(e,t,n,r,i){for(let s=Rt.length-1;s>=Rt.indexOf(n);s--){const o=Rt[s];if(Dc[o].common&&e._adapter.diff(i,r,o)>=t-1)return o}return Rt[n?Rt.indexOf(n):0]}function P$(e){for(let t=Rt.indexOf(e)+1,n=Rt.length;t<n;++t)if(Dc[Rt[t]].common)return Rt[t]}function um(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=Sf(n,t),s=n[r]>=t?n[r]:n[i];e[s]=!0}}function T$(e,t,n,r){const i=e._adapter,s=+i.startOf(t[0].value,r),o=t[t.length-1].value;let a,l;for(a=s;a<=o;a=+i.add(a,1,r))l=n[a],l>=0&&(t[l].major=!0);return t}function dm(e,t,n){const r=[],i={},s=t.length;let o,a;for(o=0;o<s;++o)a=t[o],i[a]=o,r.push({value:a,major:!1});return s===0||!n?r:T$(e,r,i,n)}class Jl extends Us{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,n={}){const r=t.time||(t.time={}),i=this._adapter=new d5._date(t.adapters.date);i.init(n),jo(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:lm(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:i,max:s,minDefined:o,maxDefined:a}=this.getUserBounds();function l(c){!o&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!a&&!isNaN(c.max)&&(s=Math.max(s,c.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=yt(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),s=yt(s)&&!isNaN(s)?s:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,s-1),this.max=Math.max(i+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const s=this.min,o=this.max,a=qP(i,s,o);return this._unit=n.unit||(r.autoSkip?cm(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):A$(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:P$(this._unit),this.initOffsets(i),t.reverse&&a.reverse(),dm(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,i,s;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?r=s:r=(s-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=cn(n,0,o),r=cn(r,0,o),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,s=i.time,o=s.unit||cm(s.minUnit,n,r,this._getLabelCapacity(n)),a=je(i.ticks.stepSize,1),l=o==="week"?s.isoWeekday:!1,c=na(l)||l===!0,u={};let d=n,f,h;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":o),t.diff(r,n,o)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+o);const g=i.ticks.source==="data"&&this.getDataTimestamps();for(f=d,h=0;f<r;f=+t.add(f,a,o),h++)um(u,f,g);return(f===r||i.bounds==="ticks"||h===1)&&um(u,f,g),Object.keys(u).sort(am).map(m=>+m)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const i=this.options.time.displayFormats,s=this._unit,o=n||i[s];return this._adapter.format(t,o)}_tickFormatFunction(t,n,r,i){const s=this.options,o=s.ticks.callback;if(o)return et(o,[t,n,r],this);const a=s.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],f=r[n],h=c&&d&&f&&f.major;return this._adapter.format(t,i||(h?d:u))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n<r;++n)i=t[n],i.label=this._tickFormatFunction(i.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,i=Dr(this.isHorizontal()?n.maxRotation:n.minRotation),s=Math.cos(i),o=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:r*s+a*o,h:r*o+a*s}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,s=this._tickFormatFunction(t,0,dm(this,[t],this._majorUnit),i),o=this._getLabelSize(s),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||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)t=t.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const i=this.getLabels();for(n=0,r=i.length;n<r;++n)t.push(lm(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return HP(t.sort(am))}}me(Jl,"id","time"),me(Jl,"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 dl(e,t,n){let r=0,i=e.length-1,s,o,a,l;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=ci(e,"pos",t)),{pos:s,time:a}=e[r],{pos:o,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=ci(e,"time",t)),{time:s,pos:a}=e[r],{time:o,pos:l}=e[i]);const c=o-s;return c?a+(l-a)*(t-s)/c:a}class fm extends Jl{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=dl(n,this.min),this._tableRange=dl(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],s=[];let o,a,l,c,u;for(o=0,a=t.length;o<a;++o)c=t[o],c>=n&&c<=r&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(o=0,a=i.length;o<a;++o)u=i[o+1],l=i[o-1],c=i[o],Math.round((u+l)/2)!==c&&s.push({time:c,pos:o/(a-1)});return s}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((i,s)=>i-s)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(dl(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return dl(this._table,r*this._tableRange+this._minPos,!0)}}me(fm,"id","timeseries"),me(fm,"defaults",Jl.defaults);const Ub="label";function hm(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function M$(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function Kb(e,t){e.labels=t}function Vb(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ub;const r=[];e.datasets=t.map(i=>{const s=e.datasets.find(o=>o[n]===i[n]);return!s||!i.data||r.includes(s)?{...i}:(r.push(s),Object.assign(s,i),s)})}function $$(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ub;const n={labels:[],datasets:[]};return Kb(n,e.labels),Vb(n,e.datasets,t),n}function j$(e,t){const{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:s,type:o,data:a,options:l,plugins:c=[],fallbackContent:u,updateMode:d,...f}=e,h=z.useRef(null),g=z.useRef(null),m=()=>{h.current&&(g.current=new $c(h.current,{type:o,data:$$(a,s),options:l&&{...l},plugins:c}),hm(t,g.current))},p=()=>{hm(t,null),g.current&&(g.current.destroy(),g.current=null)};return z.useEffect(()=>{!i&&g.current&&l&&M$(g.current,l)},[i,l]),z.useEffect(()=>{!i&&g.current&&Kb(g.current.config.data,a.labels)},[i,a.labels]),z.useEffect(()=>{!i&&g.current&&a.datasets&&Vb(g.current.config.data,a.datasets,s)},[i,a.datasets]),z.useEffect(()=>{g.current&&(i?(p(),setTimeout(m)):g.current.update(d))},[i,l,a.labels,a.datasets,d]),z.useEffect(()=>{g.current&&(p(),setTimeout(m))},[o]),z.useEffect(()=>(m(),()=>p()),[]),z.createElement("canvas",{ref:h,role:"img",height:n,width:r,...f},u)}const D$=z.forwardRef(j$);function Wb(e,t){return $c.register(t),z.forwardRef((n,r)=>z.createElement(D$,{...n,ref:r,type:e}))}const L$=Wb("line",kl),I$=Wb("radar",Ol);$c.register(Pd,Md,Oo,Lr,Pl,GM,n$,u$,e$);var jd={elements:{line:{backgroundColor:"rgba(166, 30, 105, 0.2)",borderColor:"rgba(166, 30, 105, 1)",borderWidth:4},point:{backgroundColor:"rgba(166, 30, 105, 1)",borderColor:"rgba(255,255,255, .9)",borderWidth:2,radius:5,hoverRadius:6,hoverBorderWidth:3}},responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{mode:"index",intersect:!1}},interaction:{mode:"nearest",axis:"x",intersect:!1}},R$=function(t){var n=t.chart.ctx,r=t.chart.chartArea;if(!r)return"rgba(166, 30, 105, 0.1)";var i=(r.left+r.right)/2,s=(r.top+r.bottom)/2,o=Math.min((r.right-r.left)/2,(r.bottom-r.top)/2),a=n.createRadialGradient(i,s,0,i,s,o);return a.addColorStop(0,"rgba(255, 255, 255, 0.4)"),a.addColorStop(.3,"rgba(255, 255, 255, 0.4)"),a.addColorStop(1,"rgba(166, 30, 105, 0.2)"),a};function gm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ym(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gm(Object(n),!0).forEach(function(r){F$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gm(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function F$(e,t,n){return(t=N$(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N$(e){var t=B$(e,"string");return $s(t)=="symbol"?t:t+""}function B$(e,t){if($s(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if($s(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $s(e){"@babel/helpers - typeof";return $s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$s(e)}function q$(e){var t=new Date(e);return isNaN(t.getTime())?String(e):t.toLocaleString("en-US",{month:"short",day:"numeric"})}var z$=function(){var t,n,r,i,s=Hs(),o=s.data,a=s.isLoading,l=s.isRefetching,c=o==null?void 0:o.mentions,u=c==null||(t=c.mentionedInNumberOfQueries)===null||t===void 0||(t=t.previous)===null||t===void 0?void 0:t.difference,d=c==null?void 0:c.chart,f=Array.isArray(d==null?void 0:d.labels)?d.labels:d!=null&&d.labels&&$s(d.labels)==="object"?Object.values(d.labels):[],h=f.map(function(v){return q$(String(v))}),g=o==null?void 0:o.numberOfQueries;if(!g){var m=0;Array.isArray(d==null?void 0:d.datasets)&&d.datasets.forEach(function(v){Array.isArray(v==null?void 0:v.data)&&v.data.forEach(function(b){typeof b=="number"&&b>m&&(m=b)})}),g=m+2}var p=ym(ym({},jd),{},{responsive:!0,maintainAspectRatio:!1,scales:{x:{display:!0,title:{display:!1,text:"Date"},grid:{display:!1}},y:{display:!0,title:{display:!1,text:"Number of Mentions"},beginAtZero:!0,max:g,ticks:{stepSize:1}}}});return y.jsx(E.Card,{className:"yst-overflow-visible",children:y.jsxs(E.Card.Content,{className:"yst-space-y-4",children:[y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(Ma,{title:"Mentions progress",tooltip:"Tracks how your brand mentions have changed over time across the same query set."}),y.jsx(Ta,{score:c==null||(n=c.mentionedInNumberOfQueries)===null||n===void 0?void 0:n.value,total:o==null?void 0:o.numberOfQueries,delta:u,deltaSuffix:"since last scan",suffix:"queries",isLoading:a||l})]}),Array.isArray(d==null||(r=d.datasets)===null||r===void 0?void 0:r.data)&&(d==null||(i=d.datasets)===null||i===void 0?void 0:i.data.length)<2?y.jsx(E.Alert,{variant:"info",children:"Needs multiple analyses before info can be shown."}):y.jsx("div",{className:"yst-h-72",children:y.jsx(L$,{data:function(){var v={labels:h,datasets:[d==null?void 0:d.datasets]};return v}(),options:p})})]})})};function fl(e){var t=e.value,n=t===void 0?"—":t,r=e.label,i=e.tooltip,s=e.className,o=e.borderBottom,a=o===void 0?!1:o,l=e.borderRight,c=l===void 0?!1:l,u=e.delta,d=e.tooltipPosition,f=d===void 0?"left":d;return y.jsxs("div",{className:Ce("yst-relative yst-flex yst-flex-col yst-items-center yst-gap-1 yst-p-4 yst-text-center",a&&"yst-border-b yst-border-slate-200",c&&"yst-border-r yst-border-slate-200",s),children:[y.jsx("p",{className:"yst-text-2xl yst-font-bold yst-text-slate-900",children:n}),y.jsx("p",{className:"yst-text-tiny yst-text-slate-600",children:r}),typeof u=="number"&&y.jsxs("p",{className:Ce("yst-flex yst-items-center yst-gap-1 yst-text-tiny yst-font-bold",Go(u)),children:[u>0?y.jsx(Kv,{}):u<0?y.jsx(Uv,{}):null,u>-1e-6&&"+",u]}),i&&y.jsx(gf,{id:"tooltip-".concat(r.replace(/\s+/g,"-").toLowerCase()),className:"yst-absolute yst-right-2 yst-top-2",position:f,children:i})]})}function H$(e){var t=e.children,n=e.className;return y.jsx("div",{className:Ce("yst-grid yst-w-full yst-grid-cols-2 yst-gap-0 yst-rounded-lg",n),children:t})}function U$(e){return e>0?"yst-text-green-600":e<0?"yst-text-red-600":"yst-text-slate-500"}function K$(e){var t=e.current,n=e.previous,r=e.className;if(typeof n!="number")return null;var i=t-n,s=i>0,o=i<0,a="".concat(i>0?"+":"").concat(i.toFixed(1),"%");return y.jsxs("div",{className:Ce("yst-flex yst-items-center yst-gap-1 yst-text-tiny yst-font-bold",U$(i),r),"aria-label":s?"Visibility increased by ".concat(a):o?"Visibility decreased by ".concat(a):"No change in visibility",children:[s&&y.jsx(Kv,{className:"yst-w-4 yst-h-4"}),o&&y.jsx(Uv,{className:"yst-w-4 yst-h-4"}),a]})}function ia(e){"@babel/helpers - typeof";return ia=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ia(e)}function mm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function hl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mm(Object(n),!0).forEach(function(r){V$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mm(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function V$(e,t,n){return(t=W$(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W$(e){var t=G$(e,"string");return ia(t)=="symbol"?t:t+""}function G$(e,t){if(ia(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ia(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Q$(){var e,t,n,r,i,s,o,a,l,c,u,d,f,h,g,m,p,v,b,x,C,w,k,S=Hn(),_=S.brandId,O=S.analysisId,A=wc(_,O,{query:{select:function(ye){var Te=ye.data;return Te},enabled:!!_&&!!O}}),M=A.data,D=A.isLoading,W=M==null||(e=M.analysis)===null||e===void 0?void 0:e.scans,R=Array.isArray(W)&&W.length>0?W.reduce(function(De,ye){if(!De)return ye;if(!(ye!=null&&ye.finishedAt)||!(De!=null&&De.finishedAt))return De;var Te=new Date(ye.finishedAt),Me=new Date(De.finishedAt);return Te>Me?ye:De},void 0):void 0,L=R==null||(t=R.scores)===null||t===void 0?void 0:t.raw,j=R==null||(n=R.scores)===null||n===void 0?void 0:n.standardized,I=20,oe=(r=R==null||(i=R.mentions)===null||i===void 0||(i=i.mentionedInNumberOfQueries)===null||i===void 0?void 0:i.value)!==null&&r!==void 0?r:0,ue=R==null||(s=R.scores)===null||s===void 0||(s=s.standardized)===null||s===void 0||(s=s.mentions)===null||s===void 0||(s=s.previous)===null||s===void 0?void 0:s.difference,B=typeof ue=="number"?ue/I:void 0,Y=(o=R==null||(a=R.citations)===null||a===void 0||(a=a.total)===null||a===void 0?void 0:a.value)!==null&&o!==void 0?o:0,ne=R==null||(l=R.rankings)===null||l===void 0||(l=l.list)===null||l===void 0?void 0:l.find(function(De){var ye;return((ye=De.brand)===null||ye===void 0?void 0:ye.isSelf)===!0}),ae=(c=ne==null||(u=ne.rank)===null||u===void 0?void 0:u.value)!==null&&c!==void 0?c:null,F=ne==null||(d=ne.rank)===null||d===void 0||(d=d.previous)===null||d===void 0?void 0:d.difference,G=typeof F=="number"?F/I:void 0,q=(f=j==null||(h=j.visibility)===null||h===void 0?void 0:h.value)!==null&&f!==void 0?f:0,ce=j==null||(g=j.visibility)===null||g===void 0||(g=g.previous)===null||g===void 0?void 0:g.value,V=(m=j==null||(p=j.ranking)===null||p===void 0?void 0:p.value)!==null&&m!==void 0?m:0,fe=(v=j==null||(b=j.sentiment)===null||b===void 0?void 0:b.value)!==null&&v!==void 0?v:0,he=(x=j==null||(C=j.mentions)===null||C===void 0?void 0:C.value)!==null&&x!==void 0?x:0,Ie={labels:["Mentions","Ranking","Citations","Sentiment"],datasets:[{data:[he,V,Y,fe],backgroundColor:R$,pointBackgroundColor:"rgba(166, 30, 105, 1)"}]},te=hl(hl({},jd),{},{plugins:hl(hl({},jd.plugins),{},{tooltip:{mode:"point",intersect:!0,callbacks:{label:function(ye){var Te=ye.label||"",Me=ye.parsed.r||0;return"".concat(Te,": ").concat(Me,"%")}}}}),interaction:{mode:"point",intersect:!0},scales:{r:{beginAtZero:!0,min:0,max:100,ticks:{stepSize:20}}}});return y.jsx(E.Card,{className:"yst-overflow-visible md:yst-col-span-2",children:y.jsxs(E.Card.Content,{children:[y.jsx(E.Title,{size:"3",className:"yst-mb-2",children:"AI visibility score"}),y.jsx(Ta,{score:q,total:100,isLoading:D}),y.jsx(K$,{current:q,previous:ce,className:"yst-mb-4"}),y.jsxs("div",{className:"yst-flex yst-flex-col yst-items-center yst-justify-around yst-justify-items-center yst-gap-8 md:yst-flex-row",children:[y.jsxs("div",{className:"yst-radar-chart-container yst-relative yst-aspect-square yst-h-full yst-w-full md:yst-flex md:yst-w-1/2 md:yst-items-center md:yst-justify-center",children:[y.jsx(I$,{data:Ie,options:te}),y.jsx(gf,{id:"tooltip-radar-chart",className:"yst-absolute yst-right-2 yst-top-2",placement:"left",children:"The AI Visibility Index (AIVI) shows how visible your brand is across major AI platforms like ChatGPT, based on mentions, citations, sentiment, and rankings."})]}),y.jsx("div",{className:"yst-mt-6 yst-w-full md:yst-mt-0 md:yst-flex md:yst-w-1/2 md:yst-items-center",children:y.jsxs(H$,{children:[y.jsx(fl,{value:oe,label:"Mentions",tooltip:"Mentions show how often your brand appears in AI-generated answers to the questions we send to LLMs.",borderBottom:!0,borderRight:!0,delta:B}),y.jsx(fl,{value:ae&&y.jsxs(y.Fragment,{children:[ae,ae===1&&" 🏆"]}),label:"Competitor ranking",tooltip:"Ranking shows the position your brand is mentioned in AI-generated answers—whether in a numbered list or the order of appearance in full-text responses.",borderBottom:!0,delta:G}),y.jsx(fl,{value:Y,label:"Citations",tooltip:"Citations are the source links found in AI-generated answers. They form the basis for mentions, sentiment, and ranking insights.",borderRight:!0,delta:L==null||(w=L.citations)===null||w===void 0||(w=w.previous)===null||w===void 0?void 0:w.value}),y.jsx(fl,{value:fe?"".concat(fe,"%"):"—%",label:"Positive sentiment",tooltip:"Sentiment reflects how positively, neutrally, or negatively your brand is mentioned in AI-generated answers, based on the cited sources.",delta:R==null||(k=R.scores)===null||k===void 0||(k=k.standardized)===null||k===void 0||(k=k.sentiment)===null||k===void 0||(k=k.previous)===null||k===void 0?void 0:k.difference})]})})]})]})})}var ti={pending:"pending",processing:"processing",completed:"completed",failed:"failed",cancelled:"cancelled"},Eu=function(){var t=Hn(),n=t.brandId,r=t.analysisId,i=zs({query:{select:function(S){var _=S.data;return _==null?void 0:_.brands}}}),s=i.data,o=i.isLoading,a=Rv(n,{query:{enabled:!!n,select:function(S){var _=S.data;return _}}}),l=a.data,c=a.isLoading,u=wc(n,r,{query:{enabled:!!n&&!!r&&r!=="latest"&&typeof r=="string"&&r.length>0,select:function(S){var _=S.data;return _==null?void 0:_.analysis}}}),d=u.data,f=u.isLoading,h=(l==null?void 0:l.name)||"your brand",g=oE(l==null?void 0:l.nextScheduledAnalysis),m=d==null?void 0:d.status,p=function(){switch(m){case ti.pending:return{alertContent:y.jsxs("div",{className:"yst-max-w-xl yst-space-y-2",children:[y.jsx("p",{className:"yst-font-medium",children:"Your analysis is scheduled"}),y.jsxs("p",{children:["You've completed the setup for"," ",y.jsx("b",{className:"yst-font-medium",children:h}),". The analysis is scheduled to run on"," ",y.jsx("b",{className:"yst-font-medium",children:g}),". You'll see the results here once it's ready, and we'll also notify you by email."]})]}),alertVariant:"info"};case ti.processing:return{alertContent:y.jsxs(y.Fragment,{children:["You've completed the setup for ",h,". The analysis is now processing. You'll see the results here once it's ready, and we'll also notify you by email."]}),alertVariant:"info"};case ti.failed:return{alertContent:y.jsx(y.Fragment,{children:"Analysis failed. Try restarting the analysis or contact support if the issue persists."}),alertVariant:"danger"};case ti.cancelled:return{alertContent:y.jsx(y.Fragment,{children:"Analysis was cancelled. You can restart the analysis when ready."}),alertVariant:"warning"};case ti.completed:return{alertContent:null};default:return{alertContent:null,alertVariant:"info"}}}(),v=p.alertContent,b=p.alertVariant,x=o||c||f,C=s&&(s==null?void 0:s.length)>0,w=!x&&d&&m===ti.completed;return C?y.jsxs("div",{className:"yst-space-y-8",children:[y.jsx(eP,{}),m!==ti.completed&&v&&y.jsx(E.Alert,{className:"md:yst-col-span-2",variant:b,children:v}),w&&y.jsxs("div",{className:"yst-space-y-4",children:[y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-between",children:[y.jsx(E.Title,{size:"2",children:"Your brand analysis"}),y.jsxs(E.Button,{as:Vr,variant:"secondary",to:"/brand-list",className:Ce("yst-gap-1.5"),disabled:!n,children:[y.jsx(qv,{})," Edit brand list"]})]}),y.jsxs("div",{className:"yst-grid yst-grid-cols-1 yst-gap-4 md:yst-grid-cols-2",children:[y.jsx(Q$,{}),y.jsx(tP,{}),y.jsx(z$,{}),y.jsx(fA,{}),y.jsx(oA,{}),y.jsx(KE,{}),y.jsx(hA,{})]})]})]}):y.jsx(PE,{})};function Gb(e){var t=e.children,n=e.description,r=e.title;return y.jsxs(E.Card.Header,{className:"yst-h-auto yst-flex-col yst-items-start yst-gap-0 yst-border-b-[1px] yst-border-b-slate-200 yst-bg-white yst-py-8",children:[r&&y.jsx(E.Title,{className:Ce({"yst-mb-3":n||t}),children:r}),n&&y.jsx("p",{children:n}),t]})}var Y$=function(){return y.jsx(E.Card,{className:"yst-mb-4",children:y.jsxs(E.Card.Content,{className:"yst-flex yst-flex-col yst-gap-8",children:[y.jsx(E.Title,{size:"2",children:"Query - Best fish restaurant in Nijmegen"}),y.jsxs("div",{children:[y.jsx("p",{children:"AI Response:"}),y.jsx(E.Link,{href:"#todo",children:"Show more"})]}),y.jsxs("div",{children:[y.jsx("p",{children:"Extracted brands:"}),y.jsx(E.Badge,{children:"Example"}),y.jsx(E.Badge,{children:"Example"}),y.jsx(E.Badge,{children:"Example"}),y.jsx(E.Badge,{children:"Example"}),y.jsx(E.Badge,{children:"Example"})]}),y.jsxs(E.Table,{children:[y.jsx(E.Table.Head,{children:y.jsxs(E.Table.Row,{children:[y.jsx(E.Table.Header,{children:"URL"}),y.jsx(E.Table.Header,{children:"Associated brand"})]})}),y.jsxs(E.Table.Body,{children:[y.jsxs(E.Table.Row,{children:[y.jsx(E.Table.Cell,{children:y.jsx(E.Link,{href:"https://example.com",target:"_blank",children:"https://example.com"})}),y.jsx(E.Table.Cell,{children:"Example Brand"})]}),y.jsxs(E.Table.Row,{children:[y.jsx(E.Table.Cell,{children:y.jsx(E.Link,{href:"https://example2.com",target:"_blank",children:"https://example2.com"})}),y.jsx(E.Table.Cell,{children:"Example Brand 2"})]})]})]})]})})},X$=function(){return y.jsxs(E.Card,{children:[y.jsx(Gb,{title:"Query history"}),y.jsx(E.Card,{className:"yst-mb-4",children:y.jsxs(E.Card.Content,{children:[y.jsxs("p",{className:"yst-mb-8",children:["Manna Fish Restaurant - Analysis performed on:"," ",y.jsx(E.Badge,{children:"2025-04-08 12:31:21"})]}),[0,1,2,3,4].map(function(t){return y.jsx(Y$,{},t)})]})})]})},J$=z.lazy(function(){return Promise.resolve().then(()=>aR)}),Z$=z.lazy(function(){return Promise.resolve().then(()=>DR)}),ej=z.lazy(function(){return Promise.resolve().then(()=>RR)}),tj=z.lazy(function(){return Promise.resolve().then(()=>JR)}),nj=z.lazy(function(){return Promise.resolve().then(()=>gF)}),rj=z.lazy(function(){return Promise.resolve().then(()=>pF)}),ij=new O2({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1,staleTime:1e3*60*5},mutations:{retry:!1}}}),ni=function(){return y.jsx("div",{className:"yst-flex yst-min-h-[200px] yst-items-center yst-justify-center",children:y.jsxs("div",{className:"yst-w-full yst-max-w-md yst-space-y-3",children:[y.jsx(E.SkeletonLoader,{className:"yst-h-8 yst-w-3/4"}),y.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-full"}),y.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-2/3"})]})})},sj=function(t){var n=t.hideNav,r=n===void 0?!1:n,i=t.disableLayout,s=i===void 0?!1:i,o=t.DebugInfo;return y.jsx($w,{children:y.jsxs(zt,{element:y.jsx(rE,{hideNav:r,disableLayout:s,DebugInfo:o}),children:[y.jsxs(zt,{path:"/",element:y.jsx(Zd,{}),children:[y.jsx(zt,{index:!0,element:y.jsx(Eu,{})}),y.jsx(zt,{path:"brands/:brandId",element:y.jsx(Eu,{})}),y.jsx(zt,{path:"brands/:brandId/analysis/:analysisId",element:y.jsx(Eu,{})}),y.jsx(zt,{path:"/brand-list",element:y.jsx(z.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(J$,{})})}),y.jsxs(zt,{path:"/setup",element:y.jsx(z.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(ej,{})}),children:[y.jsx(zt,{index:!0,element:y.jsx(z.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(tj,{})})}),y.jsx(zt,{path:":brandId/queries",element:y.jsx(z.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(nj,{})})})]}),y.jsx(zt,{path:"/setup/:brandId/analysis",element:y.jsx(z.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(rj,{})})})]}),y.jsx(zt,{path:"/settings",element:y.jsx(z.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(Z$,{})})}),y.jsx(zt,{path:"/query-history",element:y.jsx(z.Suspense,{fallback:y.jsx(ni,{}),children:y.jsx(X$,{})})})]})})},oj=function(t){var n=t.DebugInfo,r=t.hostAppProps;return y.jsxs(M2,{client:ij,children:[y.jsx(aO,{hostAppProps:r,children:y.jsx(sj,{DebugInfo:n})}),y.jsx(vC,{initialIsOpen:!1})]})};function aj(e){var t=e.subpath,n=t===void 0?"/":t,r=e.onNavigate,i=_n(),s=en(),o=z.useRef(n),a=z.useRef(null),l=z.useRef(!1),c="".concat(s.pathname).concat(s.search).concat(s.hash),u=z.useCallback(r,[r]);return z.useEffect(function(){if(n===c){o.current=n;return}l.current||n!==o.current&&(o.current=n,a.current=n,l.current=!0,i(n,{replace:!0}),setTimeout(function(){l.current=!1},10))},[n,c,i]),z.useEffect(function(){l.current||c!==n&&c!==a.current&&(a.current=c,u(c))},[c,n,u]),null}function lj(e,t){return fj(e)||dj(e,t)||uj(e,t)||cj()}function cj(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
68
68
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uj(e,t){if(e){if(typeof e=="string")return pm(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pm(e,t):void 0}}function pm(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function dj(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function fj(e){if(Array.isArray(e))return e}var hj=function(t){var n=t.isRtl,r=n===void 0?!1:n,i=t.className,s=t.style,o=t.token,a=o===void 0?"":o,l=t.apiUrl,c=t.DebugInfo,u=t.subpath,d=u===void 0?"/":u,f=t.onNavigate,h=f===void 0?function(){}:f,g=t.onLogout,m=g===void 0?function(){}:g,p=t.onAddSubscription,v=p===void 0?function(){}:p,b=z.useState(!!(a||l)),x=lj(b,2),C=x[0],w=x[1],k={onAddSubscription:v,onLogout:m,onNavigate:h,DebugInfo:c,subpath:d};return z.useEffect(function(){l&&$v(l),ek(typeof a!="function"?function(){return a}:a),w(!1)},[l,a]),C?y.jsx("div",{className:i,style:s,children:y.jsx(E.Spinner,{})}):y.jsx("div",{className:i,style:s,children:y.jsxs(Tw,{initialEntries:[d||"/"],children:[y.jsx(aj,{subpath:d,onNavigate:h}),y.jsx(E.Root,{context:{isRtl:r},children:y.jsx(oj,{DebugInfo:c,hostAppProps:k})})]})})},gj=e=>e!=null,yj=e=>e.filter(gj);function mj(e){return(...t)=>{for(const n of e)n&&n(...t)}}var Q=e=>typeof e=="function"&&!e.length?e():e,Dd=e=>Array.isArray(e)?e:e?[e]:[];function pj(e,...t){return typeof e=="function"?e(...t):e}var vj=we;function bj(e,t,n,r){const i=e.length,s=t.length;let o=0;if(!s){for(;o<i;o++)n(e[o]);return}if(!i){for(;o<s;o++)r(t[o]);return}for(;o<s&&t[o]===e[o];o++);let a,l;t=t.slice(o),e=e.slice(o);for(a of t)e.includes(a)||r(a);for(l of e)t.includes(l)||n(l)}function xj(e){const[t,n]=re(),r=e!=null&&e.throw?(f,h)=>{throw n(f instanceof Error?f:new Error(h)),f}:(f,h)=>{n(f instanceof Error?f:new Error(h))},i=e!=null&&e.api?Array.isArray(e.api)?e.api:[e.api]:[globalThis.localStorage].filter(Boolean),s=e!=null&&e.prefix?`${e.prefix}.`:"",o=new Map,a=new Proxy({},{get(f,h){let g=o.get(h);g||(g=re(void 0,{equals:!1}),o.set(h,g)),g[0]();const m=i.reduce((p,v)=>{if(p!==null||!v)return p;try{return v.getItem(`${s}${h}`)}catch(b){return r(b,`Error reading ${s}${h} from ${v.name}`),null}},null);return m!==null&&(e!=null&&e.deserializer)?e.deserializer(m,h,e.options):m}}),l=(f,h,g)=>{const m=e!=null&&e.serializer?e.serializer(h,f,g!=null?g:e.options):h,p=`${s}${f}`;i.forEach(b=>{try{b.getItem(p)!==m&&b.setItem(p,m)}catch(x){r(x,`Error setting ${s}${f} to ${m} in ${b.name}`)}});const v=o.get(f);v&&v[1]()},c=f=>i.forEach(h=>{try{h.removeItem(`${s}${f}`)}catch(g){r(g,`Error removing ${s}${f} from ${h.name}`)}}),u=()=>i.forEach(f=>{try{f.clear()}catch(h){r(h,`Error clearing ${f.name}`)}}),d=()=>{const f={},h=(g,m)=>{if(!f.hasOwnProperty(g)){const p=m&&(e!=null&&e.deserializer)?e.deserializer(m,g,e.options):m;p&&(f[g]=p)}};return i.forEach(g=>{if(typeof g.getAll=="function"){let m;try{m=g.getAll()}catch(p){r(p,`Error getting all values from in ${g.name}`)}for(const p of m)h(p,m[p])}else{let m=0,p;try{for(;p=g.key(m++);)f.hasOwnProperty(p)||h(p,g.getItem(p))}catch(v){r(v,`Error getting all values from ${g.name}`)}}}),f};return(e==null?void 0:e.sync)!==!1&&dr(()=>{const f=h=>{var m;let g=!1;i.forEach(p=>{try{p!==h.storageArea&&h.key&&h.newValue!==p.getItem(h.key)&&(h.newValue?p.setItem(h.key,h.newValue):p.removeItem(h.key),g=!0)}catch(v){r(v,`Error synching api ${p.name} from storage event (${h.key}=${h.newValue})`)}}),g&&h.key&&((m=o.get(h.key))==null||m[1]())};"addEventListener"in globalThis?(globalThis.addEventListener("storage",f),we(()=>globalThis.removeEventListener("storage",f))):(i.forEach(h=>{var g;return(g=h.addEventListener)==null?void 0:g.call(h,"storage",f)}),we(()=>i.forEach(h=>{var g;return(g=h.removeEventListener)==null?void 0:g.call(h,"storage",f)})))}),[a,l,{clear:u,error:t,remove:c,toJSON:d}]}var Qb=xj,wj=e=>(typeof e.clear=="function"||(e.clear=()=>{let t;for(;t=e.key(0);)e.removeItem(t)}),e),vm=e=>{if(!e)return"";let t="";for(const n in e){if(!e.hasOwnProperty(n))continue;const r=e[n];t+=r instanceof Date?`; ${n}=${r.toUTCString()}`:typeof r=="boolean"?`; ${n}`:`; ${n}=${r}`}return t},rn=wj({_cookies:[globalThis.document,"cookie"],getItem:e=>{var t,n;return(n=(t=rn._cookies[0][rn._cookies[1]].match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)"))==null?void 0:t.pop())!=null?n:null},setItem:(e,t,n)=>{const r=rn.getItem(e);rn._cookies[0][rn._cookies[1]]=`${e}=${t}${vm(n)}`;const i=Object.assign(new Event("storage"),{key:e,oldValue:r,newValue:t,url:globalThis.document.URL,storageArea:rn});window.dispatchEvent(i)},removeItem:e=>{rn._cookies[0][rn._cookies[1]]=`${e}=deleted${vm({expires:new Date(0)})}`},key:e=>{let t=null,n=0;return rn._cookies[0][rn._cookies[1]].replace(/(?:^|;)\s*(.+?)\s*=\s*[^;]+/g,(r,i)=>(!t&&i&&n++===e&&(t=i),"")),t},get length(){let e=0;return rn._cookies[0][rn._cookies[1]].replace(/(?:^|;)\s*.+?\s*=\s*[^;]+/g,t=>(e+=t?1:0,"")),e}}),Sj=1024,Ti=796,$f=700,Cj="bottom-right",Ld="bottom",Yb="system",_j=!1,Xb=500,kj=500,Jb=500,Oj=Object.keys(sd)[0],bm=1,Ej=Object.keys(od)[0],jf=pt({client:void 0,onlineManager:void 0,queryFlavor:"",version:"",shadowDOMTarget:void 0});function ge(){return vt(jf)}var Zb=pt(void 0),e1=e=>{const[t,n]=re(null),r=()=>{const o=t();o!=null&&(o.close(),n(null))},i=(o,a)=>{if(t()!=null)return;const l=window.open("","TSQD-Devtools-Panel",`width=${o},height=${a},popup`);if(!l)throw new Error("Failed to open popup. Please allow popups for this site to view the devtools in picture-in-picture mode.");l.document.head.innerHTML="",l.document.body.innerHTML="",xS(l.document),l.document.title="TanStack Query Devtools",l.document.body.style.margin="0",l.addEventListener("pagehide",()=>{e.setLocalStore("pip_open","false"),n(null)}),[...(ge().shadowDOMTarget||document).styleSheets].forEach(c=>{try{const u=[...c.cssRules].map(g=>g.cssText).join(""),d=document.createElement("style"),f=c.ownerNode;let h="";f&&"id"in f&&(h=f.id),h&&d.setAttribute("id",h),d.textContent=u,l.document.head.appendChild(d)}catch(u){const d=document.createElement("link");if(c.href==null)return;d.rel="stylesheet",d.type=c.type,d.media=c.media.toString(),d.href=c.href,l.document.head.appendChild(d)}}),fc(["focusin","focusout","pointermove","keydown","pointerdown","pointerup","click","mousedown","input"],l.document),e.setLocalStore("pip_open","true"),n(l)};be(()=>{var a;((a=e.localStore.pip_open)!=null?a:"false")==="true"&&!e.disabled&&i(Number(window.innerWidth),Number(e.localStore.height||kj))}),be(()=>{const o=(ge().shadowDOMTarget||document).querySelector("#_goober"),a=t();if(o&&a){const l=new MutationObserver(()=>{const c=(ge().shadowDOMTarget||a.document).querySelector("#_goober");c&&(c.textContent=o.textContent)});l.observe(o,{childList:!0,subtree:!0,characterDataOldValue:!0}),we(()=>{l.disconnect()})}});const s=H(()=>{var o;return{pipWindow:t(),requestPipWindow:i,closePipWindow:r,disabled:(o=e.disabled)!=null?o:!1}});return T(Zb.Provider,{value:s,get children(){return e.children}})},Df=()=>H(()=>{const t=vt(Zb);if(!t)throw new Error("usePiPWindow must be used within a PiPProvider");return t()}),Lf=pt(()=>"dark");function mt(){return vt(Lf)}var t1={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ù:"u",ú:"u",û:"u",ü:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z"},Aj=Object.keys(t1).join("|"),Pj=new RegExp(Aj,"g");function Tj(e){return e.replace(Pj,t=>t1[t])}var It={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function xm(e,t,n){var r;if(n=n||{},n.threshold=(r=n.threshold)!=null?r:It.MATCHES,!n.accessors){const o=wm(e,t,n);return{rankedValue:e,rank:o,accessorIndex:-1,accessorThreshold:n.threshold,passed:o>=n.threshold}}const i=Dj(e,n.accessors),s={rankedValue:e,rank:It.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let o=0;o<i.length;o++){const a=i[o];let l=wm(a.itemValue,t,n);const{minRanking:c,maxRanking:u,threshold:d=n.threshold}=a.attributes;l<c&&l>=It.MATCHES?l=c:l>u&&(l=u),l=Math.min(l,u),l>=d&&l>s.rank&&(s.rank=l,s.passed=!0,s.accessorIndex=o,s.accessorThreshold=d,s.rankedValue=a.itemValue)}return s}function wm(e,t,n){return e=Sm(e,n),t=Sm(t,n),t.length>e.length?It.NO_MATCH:e===t?It.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),t=t.toLowerCase(),e===t?It.EQUAL:e.startsWith(t)?It.STARTS_WITH:e.includes(` ${t}`)?It.WORD_STARTS_WITH:e.includes(t)?It.CONTAINS:t.length===1?It.NO_MATCH:Mj(e).includes(t)?It.ACRONYM:$j(e,t))}function Mj(e){let t="";return e.split(" ").forEach(r=>{r.split("-").forEach(s=>{t+=s.substr(0,1)})}),t}function $j(e,t){let n=0,r=0;function i(l,c,u){for(let d=u,f=c.length;d<f;d++)if(c[d]===l)return n+=1,d+1;return-1}function s(l){const c=1/l,u=n/t.length;return It.MATCHES+u*c}const o=i(t[0],e,0);if(o<0)return It.NO_MATCH;r=o;for(let l=1,c=t.length;l<c;l++){const u=t[l];if(r=i(u,e,r),!(r>-1))return It.NO_MATCH}const a=r-o;return s(a)}function Sm(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=Tj(e)),e}function jj(e,t){let n=t;typeof t=="object"&&(n=t.accessor);const r=n(e);return r==null?[]:Array.isArray(r)?r:[String(r)]}function Dj(e,t){const n=[];for(let r=0,i=t.length;r<i;r++){const s=t[r],o=Lj(s),a=jj(e,s);for(let l=0,c=a.length;l<c;l++)n.push({itemValue:a[l],attributes:o})}return n}var Cm={maxRanking:1/0,minRanking:-1/0};function Lj(e){return typeof e=="function"?Cm:{...Cm,...e}}var Ij={data:""},Rj=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||Ij,Fj=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Nj=/\/\*[^]*?\*\/| +/g,_m=/\n+/g,oi=(e,t)=>{let n="",r="",i="";for(let s in e){let o=e[s];s[0]=="@"?s[1]=="i"?n=s+" "+o+";":r+=s[1]=="f"?oi(o,s):s+"{"+oi(o,s[1]=="k"?"":t)+"}":typeof o=="object"?r+=oi(o,t?t.replace(/([^,])+/g,a=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,a):a?a+" "+l:l)):s):o!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=oi.p?oi.p(s,o):s+":"+o+";")}return n+(t&&i?t+"{"+i+"}":i)+r},Gn={},n1=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+n1(e[n]);return t}return e},Bj=(e,t,n,r,i)=>{let s=n1(e),o=Gn[s]||(Gn[s]=(l=>{let c=0,u=11;for(;c<l.length;)u=101*u+l.charCodeAt(c++)>>>0;return"go"+u})(s));if(!Gn[o]){let l=s!==e?e:(c=>{let u,d,f=[{}];for(;u=Fj.exec(c.replace(Nj,""));)u[4]?f.shift():u[3]?(d=u[3].replace(_m," ").trim(),f.unshift(f[0][d]=f[0][d]||{})):f[0][u[1]]=u[2].replace(_m," ").trim();return f[0]})(e);Gn[o]=oi(i?{["@keyframes "+o]:l}:l,n?"":"."+o)}let a=n&&Gn.g?Gn.g:null;return n&&(Gn.g=Gn[o]),((l,c,u,d)=>{d?c.data=c.data.replace(d,l):c.data.indexOf(l)===-1&&(c.data=u?l+c.data:c.data+l)})(Gn[o],t,r,a),o},qj=(e,t,n)=>e.reduce((r,i,s)=>{let o=t[s];if(o&&o.call){let a=o(n),l=a&&a.props&&a.props.className||/^go/.test(a)&&a;o=l?"."+l:a&&typeof a=="object"?a.props?"":oi(a,""):a===!1?"":a}return r+i+(o==null?"":o)},"");function Pe(e){let t=this||{},n=e.call?e(t.p):e;return Bj(n.unshift?n.raw?qj(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,Rj(t.target),t.g,t.o,t.k)}Pe.bind({g:1});Pe.bind({k:1});function r1(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=r1(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function se(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=r1(e))&&(r&&(r+=" "),r+=t);return r}function zj(e,t){const n=ot(e),{onChange:r}=t;let i=new Set(t.appear?void 0:n);const s=new WeakSet,[o,a]=re([],{equals:!1}),[l]=X2(),c=d=>{a(f=>(f.push.apply(f,d),f));for(const f of d)s.delete(f)},u=(d,f,h)=>d.splice(h,0,f);return H(d=>{const f=o(),h=e();if(h[cc],ot(l))return l(),d;if(f.length){const g=d.filter(m=>!f.includes(m));return f.length=0,r({list:g,added:[],removed:[],unchanged:g,finishRemoved:c}),g}return ot(()=>{const g=new Set(h),m=h.slice(),p=[],v=[],b=[];for(const C of h)(i.has(C)?b:p).push(C);let x=!p.length;for(let C=0;C<d.length;C++){const w=d[C];g.has(w)||(s.has(w)||(v.push(w),s.add(w)),u(m,w,C)),x&&w!==m[C]&&(x=!1)}return!v.length&&x?d:(r({list:m,added:p,removed:v,unchanged:b,finishRemoved:c}),i=g,m)})},t.appear?[]:n.slice())}function $t(...e){return mj(e)}var km=e=>e instanceof Element;function Id(e,t){if(t(e))return e;if(typeof e=="function"&&!e.length)return Id(e(),t);if(Array.isArray(e)){const n=[];for(const r of e){const i=Id(r,t);i&&(Array.isArray(i)?n.push.apply(n,i):n.push(i))}return n.length?n:null}return null}function Hj(e,t=km,n=km){const r=H(e),i=H(()=>Id(r(),t));return i.toArray=()=>{const s=i();return Array.isArray(s)?s:s?[s]:[]},i}function Uj(e){return H(()=>{const t=e.name||"s";return{enterActive:(e.enterActiveClass||t+"-enter-active").split(" "),enter:(e.enterClass||t+"-enter").split(" "),enterTo:(e.enterToClass||t+"-enter-to").split(" "),exitActive:(e.exitActiveClass||t+"-exit-active").split(" "),exit:(e.exitClass||t+"-exit").split(" "),exitTo:(e.exitToClass||t+"-exit-to").split(" "),move:(e.moveClass||t+"-move").split(" ")}})}function i1(e){requestAnimationFrame(()=>requestAnimationFrame(e))}function Kj(e,t,n,r){const{onBeforeEnter:i,onEnter:s,onAfterEnter:o}=t;i==null||i(n),n.classList.add(...e.enter),n.classList.add(...e.enterActive),queueMicrotask(()=>{if(!n.parentNode)return r==null?void 0:r();s==null||s(n,()=>a())}),i1(()=>{n.classList.remove(...e.enter),n.classList.add(...e.enterTo),(!s||s.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))});function a(l){(!l||l.target===n)&&(n.removeEventListener("transitionend",a),n.removeEventListener("animationend",a),n.classList.remove(...e.enterActive),n.classList.remove(...e.enterTo),o==null||o(n))}}function Vj(e,t,n,r){const{onBeforeExit:i,onExit:s,onAfterExit:o}=t;if(!n.parentNode)return r==null?void 0:r();i==null||i(n),n.classList.add(...e.exit),n.classList.add(...e.exitActive),s==null||s(n,()=>a()),i1(()=>{n.classList.remove(...e.exit),n.classList.add(...e.exitTo),(!s||s.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))});function a(l){(!l||l.target===n)&&(r==null||r(),n.removeEventListener("transitionend",a),n.removeEventListener("animationend",a),n.classList.remove(...e.exitActive),n.classList.remove(...e.exitTo),o==null||o(n))}}var Om=e=>{const t=Uj(e);return zj(Hj(()=>e.children).toArray,{appear:e.appear,onChange({added:n,removed:r,finishRemoved:i,list:s}){const o=t();for(const l of n)Kj(o,e,l);const a=[];for(const l of s)l.isConnected&&(l instanceof HTMLElement||l instanceof SVGElement)&&a.push({el:l,rect:l.getBoundingClientRect()});queueMicrotask(()=>{const l=[];for(const{el:c,rect:u}of a)if(c.isConnected){const d=c.getBoundingClientRect(),f=u.left-d.left,h=u.top-d.top;(f||h)&&(c.style.transform=`translate(${f}px, ${h}px)`,c.style.transitionDuration="0s",l.push(c))}document.body.offsetHeight;for(const c of l){let u=function(d){(d.target===c||/transform$/.test(d.propertyName))&&(c.removeEventListener("transitionend",u),c.classList.remove(...o.move))};c.classList.add(...o.move),c.style.transform=c.style.transitionDuration="",c.addEventListener("transitionend",u)}});for(const l of r)Vj(o,e,l,()=>i([l]))}})},Au=Symbol("fallback");function Em(e){for(const t of e)t.dispose()}function Wj(e,t,n,r={}){const i=new Map;return we(()=>Em(i.values())),()=>{const o=e()||[];return o[cc],ot(()=>{var u,d;if(!o.length)return Em(i.values()),i.clear(),r.fallback?[ar(h=>(i.set(Au,{dispose:h}),r.fallback()))]:[];const a=new Array(o.length),l=i.get(Au);if(!i.size||l){l==null||l.dispose(),i.delete(Au);for(let f=0;f<o.length;f++){const h=o[f],g=t(h,f);s(a,h,f,g)}return a}const c=new Set(i.keys());for(let f=0;f<o.length;f++){const h=o[f],g=t(h,f);c.delete(g);const m=i.get(g);m?(a[f]=m.mapped,(u=m.setIndex)==null||u.call(m,f),m.setItem(()=>h)):s(a,h,f,g)}for(const f of c)(d=i.get(f))==null||d.dispose(),i.delete(f);return a})};function s(o,a,l,c){ar(u=>{const[d,f]=re(a),h={setItem:f,dispose:u};if(n.length>1){const[g,m]=re(l);h.setIndex=m,h.mapped=n(d,g)}else h.mapped=n(d);i.set(c,h),o[l]=h.mapped})}}function Zl(e){const{by:t}=e;return H(Wj(()=>e.each,typeof t=="function"?t:n=>n[t],e.children,"fallback"in e?{fallback:()=>e.fallback}:void 0))}function Gj(e,t,n,r){return e.addEventListener(t,n,r),vj(e.removeEventListener.bind(e,t,n,r))}function Qj(e,t,n,r){const i=()=>{Dd(Q(e)).forEach(s=>{s&&Dd(Q(t)).forEach(o=>Gj(s,o,n,r))})};typeof e=="function"?be(i):ve(i)}function Yj(e,t){const n=new ResizeObserver(e);return we(n.disconnect.bind(n)),{observe:r=>n.observe(r,t),unobserve:n.unobserve.bind(n)}}function s1(e,t,n){const r=new WeakMap,{observe:i,unobserve:s}=Yj(o=>{for(const a of o){const{contentRect:l,target:c}=a,u=Math.round(l.width),d=Math.round(l.height),f=r.get(c);(!f||f.width!==u||f.height!==d)&&(t(l,c,a),r.set(c,{width:u,height:d}))}},n);be(o=>{const a=yj(Dd(Q(e)));return bj(a,o,i,s),a},[])}var Xj=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function Am(e){const t={};let n;for(;n=Xj.exec(e);)t[n[1]]=n[2];return t}function Lc(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=Am(e)}else typeof t=="string"&&(t=Am(t));return{...e,...t}}function Jj(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function Rd(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Zj(e){return typeof e=="number"}function Ui(e){return Object.prototype.toString.call(e)==="[object String]"}function e4(e){return typeof e=="function"}function La(e){return t=>`${e()}-${t}`}function dn(e,t){return e?e===t||e.contains(t):!1}function Eo(e,t=!1){const{activeElement:n}=Nn(e);if(!(n!=null&&n.nodeName))return null;if(o1(n)&&n.contentDocument)return Eo(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const i=Nn(n).getElementById(r);if(i)return i}}return n}function t4(e){return Nn(e).defaultView||window}function Nn(e){return e?e.ownerDocument||e:document}function o1(e){return e.tagName==="IFRAME"}var If=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(If||{});function Rf(e){var t;return typeof window!="undefined"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)==null?void 0:t.platform)||window.navigator.platform):!1}function Ic(){return Rf(/^Mac/i)}function n4(){return Rf(/^iPhone/i)}function r4(){return Rf(/^iPad/i)||Ic()&&navigator.maxTouchPoints>1}function i4(){return n4()||r4()}function s4(){return Ic()||i4()}function tt(e,t){return t&&(e4(t)?t(e):t[0](t[1],e)),e==null?void 0:e.defaultPrevented}function gt(e){return t=>{for(const n of e)tt(t,n)}}function o4(e){return Ic()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function Ct(e){if(e)if(a4())e.focus({preventScroll:!0});else{const t=l4(e);e.focus(),c4(t)}}var gl=null;function a4(){if(gl==null){gl=!1;try{document.createElement("div").focus({get preventScroll(){return gl=!0,!0}})}catch(e){}}return gl}function l4(e){let t=e.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function c4(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var a1=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],u4=[...a1,'[tabindex]:not([tabindex="-1"]):not([disabled])'],Ff=a1.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])",d4=u4.join(':not([hidden]):not([tabindex="-1"]),');function l1(e,t){const r=Array.from(e.querySelectorAll(Ff)).filter(Pm);return t&&Pm(e)&&r.unshift(e),r.forEach((i,s)=>{if(o1(i)&&i.contentDocument){const o=i.contentDocument.body,a=l1(o,!1);r.splice(s,1,...a)}}),r}function Pm(e){return c1(e)&&!f4(e)}function c1(e){return e.matches(Ff)&&Nf(e)}function f4(e){return parseInt(e.getAttribute("tabindex")||"0",10)<0}function Nf(e,t){return e.nodeName!=="#comment"&&h4(e)&&g4(e,t)&&(!e.parentElement||Nf(e.parentElement,e))}function h4(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r=t!=="none"&&n!=="hidden"&&n!=="collapse";if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:i}=e.ownerDocument.defaultView,{display:s,visibility:o}=i(e);r=s!=="none"&&o!=="hidden"&&o!=="collapse"}return r}function g4(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function y4(e,t,n){const r=t!=null&&t.tabbable?d4:Ff,i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(s){var o;return(o=t==null?void 0:t.from)!=null&&o.contains(s)?NodeFilter.FILTER_REJECT:s.matches(r)&&Nf(s)&&(!(t!=null&&t.accept)||t.accept(s))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t!=null&&t.from&&(i.currentNode=t.from),i}function Tm(e){for(;e&&!m4(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function m4(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function p4(){}function v4(e,t){const[n,r]=e;let i=!1;const s=t.length;for(let o=s,a=0,l=o-1;a<o;l=a++){const[c,u]=t[a],[d,f]=t[l],[,h]=t[l===0?o-1:l-1]||[0,0],g=(u-f)*(n-c)-(c-d)*(r-u);if(f<u){if(r>=f&&r<u){if(g===0)return!0;g>0&&(r===f?r>h&&(i=!i):i=!i)}}else if(u<f){if(r>u&&r<=f){if(g===0)return!0;g<0&&(r===f?r<h&&(i=!i):i=!i)}}else if(r==u&&(n>=d&&n<=c||n>=c&&n<=d))return!0}return i}function Ne(e,t){return ke(e,t)}var ho=new Map,Mm=new Set;function $m(){if(typeof window=="undefined")return;const e=n=>{if(!n.target)return;let r=ho.get(n.target);r||(r=new Set,ho.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=ho.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),ho.delete(n.target)),ho.size===0)){for(const i of Mm)i();Mm.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document!="undefined"&&(document.readyState!=="loading"?$m():document.addEventListener("DOMContentLoaded",$m));function Fd(e,t){const n=jm(e,t,"left"),r=jm(e,t,"top"),i=t.offsetWidth,s=t.offsetHeight;let o=e.scrollLeft,a=e.scrollTop;const l=o+e.offsetWidth,c=a+e.offsetHeight;n<=o?o=n:n+i>l&&(o+=n+i-l),r<=a?a=r:r+s>c&&(a+=r+s-c),e.scrollLeft=o,e.scrollTop=a}function jm(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){i-=e[r];break}t=t.offsetParent}return i}function b4(e,t){var n,r;if(document.contains(e)){const i=document.scrollingElement||document.documentElement;if(window.getComputedStyle(i).overflow==="hidden"){let o=Tm(e);for(;e&&o&&e!==i&&o!==i;)Fd(o,e),e=o,o=Tm(e)}else{const{left:o,top:a}=e.getBoundingClientRect();(n=e==null?void 0:e.scrollIntoView)==null||n.call(e,{block:"nearest"});const{left:l,top:c}=e.getBoundingClientRect();(Math.abs(o-l)>1||Math.abs(a-c)>1)&&((r=e.scrollIntoView)==null||r.call(e,{block:"nearest"}))}}}var u1={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"};function fn(e){return t=>(e(t),()=>e(void 0))}function Rc(e,t){const[n,r]=re(Dm(t==null?void 0:t()));return be(()=>{var i;r(((i=e())==null?void 0:i.tagName.toLowerCase())||Dm(t==null?void 0:t()))}),n}function Dm(e){return Ui(e)?e:void 0}function rt(e){const[t,n]=We(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return T(MS,ke(n,{get component(){return t.as}}))}var x4=["id","name","validationState","required","disabled","readOnly"];function w4(e){const t=`form-control-${hn()}`,n=Ne({id:t},e),[r,i]=re(),[s,o]=re(),[a,l]=re(),[c,u]=re(),d=(m,p,v)=>{const b=v!=null||r()!=null;return[v,r(),b&&p!=null?m:void 0].filter(Boolean).join(" ")||void 0},f=m=>[a(),c(),m].filter(Boolean).join(" ")||void 0,h=H(()=>({"data-valid":Q(n.validationState)==="valid"?"":void 0,"data-invalid":Q(n.validationState)==="invalid"?"":void 0,"data-required":Q(n.required)?"":void 0,"data-disabled":Q(n.disabled)?"":void 0,"data-readonly":Q(n.readOnly)?"":void 0}));return{formControlContext:{name:()=>{var m;return(m=Q(n.name))!=null?m:Q(n.id)},dataset:h,validationState:()=>Q(n.validationState),isRequired:()=>Q(n.required),isDisabled:()=>Q(n.disabled),isReadOnly:()=>Q(n.readOnly),labelId:r,fieldId:s,descriptionId:a,errorMessageId:c,getAriaLabelledBy:d,getAriaDescribedBy:f,generateId:La(()=>Q(n.id)),registerLabel:fn(i),registerField:fn(o),registerDescription:fn(l),registerErrorMessage:fn(u)}}}var d1=pt();function Ia(){const e=vt(d1);if(e===void 0)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function f1(e){const t=Ia(),n=Ne({id:t.generateId("description")},e);return be(()=>we(t.registerDescription(n.id))),T(rt,ke({as:"div"},()=>t.dataset(),n))}function h1(e){const t=Ia(),n=Ne({id:t.generateId("error-message")},e),[r,i]=We(n,["forceMount"]),s=()=>t.validationState()==="invalid";return be(()=>{s()&&we(t.registerErrorMessage(i.id))}),T(pe,{get when(){return r.forceMount||s()},get children(){return T(rt,ke({as:"div"},()=>t.dataset(),i))}})}function S4(e){let t;const n=Ia(),r=Ne({id:n.generateId("label")},e),[i,s]=We(r,["ref"]),o=Rc(()=>t,()=>"label");return be(()=>we(n.registerLabel(s.id))),T(rt,ke({as:"label",ref(a){const l=$t(c=>t=c,i.ref);typeof l=="function"&&l(a)},get for(){return H(()=>o()==="label")()?n.fieldId():void 0}},()=>n.dataset(),s))}function C4(e,t){be(ur(e,n=>{if(n==null)return;const r=_4(n);r!=null&&(r.addEventListener("reset",t,{passive:!0}),we(()=>{r.removeEventListener("reset",t)}))}))}function _4(e){return k4(e)?e.form:e.closest("form")}function k4(e){return e.matches("textarea, input, select, button")}function Ra(e){var o;const[t,n]=re((o=e.defaultValue)==null?void 0:o.call(e)),r=H(()=>{var a;return((a=e.value)==null?void 0:a.call(e))!==void 0}),i=H(()=>{var a;return r()?(a=e.value)==null?void 0:a.call(e):t()});return[i,a=>{ot(()=>{var c;const l=pj(a,i());return Object.is(l,i())||(r()||n(l),(c=e.onChange)==null||c.call(e,l)),l})}]}function g1(e){const[t,n]=Ra(e);return[()=>{var i;return(i=t())!=null?i:!1},n]}function O4(e){const[t,n]=Ra(e);return[()=>{var i;return(i=t())!=null?i:[]},n]}function E4(e={}){const[t,n]=g1({value:()=>Q(e.isSelected),defaultValue:()=>!!Q(e.defaultIsSelected),onChange:s=>{var o;return(o=e.onSelectedChange)==null?void 0:o.call(e,s)}});return{isSelected:t,setIsSelected:s=>{!Q(e.isReadOnly)&&!Q(e.isDisabled)&&n(s)},toggle:()=>{!Q(e.isReadOnly)&&!Q(e.isDisabled)&&n(!t())}}}var A4=Object.defineProperty,Fc=(e,t)=>{for(var n in t)A4(e,n,{get:t[n],enumerable:!0})},y1=pt();function m1(){return vt(y1)}function P4(){const e=m1();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function p1(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function T4(e,t){var i;const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const s=(i=e[r])==null?void 0:i.ref();if(s&&p1(s,n))return r+1}return 0}function M4(e){const t=e.map((r,i)=>[i,r]);let n=!1;return t.sort(([r,i],[s,o])=>{const a=i.ref(),l=o.ref();return a===l||!a||!l?0:p1(a,l)?(r>s&&(n=!0),-1):(r<s&&(n=!0),1)}),n?t.map(([r,i])=>i):e}function v1(e,t){const n=M4(e);e!==n&&t(n)}function $4(e){var i,s;const t=e[0],n=(i=e[e.length-1])==null?void 0:i.ref();let r=(s=t==null?void 0:t.ref())==null?void 0:s.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return Nn(r).body}function j4(e,t){be(()=>{const n=setTimeout(()=>{v1(e(),t)});we(()=>clearTimeout(n))})}function D4(e,t){if(typeof IntersectionObserver!="function"){j4(e,t);return}let n=[];be(()=>{const r=()=>{const o=!!n.length;n=e(),o&&v1(e(),t)},i=$4(e()),s=new IntersectionObserver(r,{root:i});for(const o of e()){const a=o.ref();a&&s.observe(a)}we(()=>s.disconnect())})}function L4(e={}){const[t,n]=O4({value:()=>Q(e.items),onChange:s=>{var o;return(o=e.onItemsChange)==null?void 0:o.call(e,s)}});D4(t,n);const r=s=>(n(o=>{const a=T4(o,s);return Jj(o,s,a)}),()=>{n(o=>{const a=o.filter(l=>l.ref()!==s.ref());return o.length===a.length?o:a})});return{DomCollectionProvider:s=>T(y1.Provider,{value:{registerItem:r},get children(){return s.children}})}}function I4(e){const t=P4(),n=Ne({shouldRegisterItem:!0},e);be(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());we(r)})}function b1(e){var l,c,u;let t=(l=e.startIndex)!=null?l:0;const n=(c=e.startLevel)!=null?c:0,r=[],i=d=>{var g;if(d==null)return"";const f=(g=e.getKey)!=null?g:"key",h=Ui(f)?d[f]:f(d);return h!=null?String(h):""},s=d=>{var g;if(d==null)return"";const f=(g=e.getTextValue)!=null?g:"textValue",h=Ui(f)?d[f]:f(d);return h!=null?String(h):""},o=d=>{var h,g;if(d==null)return!1;const f=(h=e.getDisabled)!=null?h:"disabled";return(g=Ui(f)?d[f]:f(d))!=null?g:!1},a=d=>{var f;if(d!=null)return Ui(e.getSectionChildren)?d[e.getSectionChildren]:(f=e.getSectionChildren)==null?void 0:f.call(e,d)};for(const d of e.dataSource){if(Ui(d)||Zj(d)){r.push({type:"item",rawValue:d,key:String(d),textValue:String(d),disabled:o(d),level:n,index:t}),t++;continue}if(a(d)!=null){r.push({type:"section",rawValue:d,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const f=(u=a(d))!=null?u:[];if(f.length>0){const h=b1({dataSource:f,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...h),t+=h.length}}else r.push({type:"item",rawValue:d,key:i(d),textValue:s(d),disabled:o(d),level:n,index:t}),t++}return r}function R4(e,t=[]){return H(()=>{const n=b1({dataSource:Q(e.dataSource),getKey:Q(e.getKey),getTextValue:Q(e.getTextValue),getDisabled:Q(e.getDisabled),getSectionChildren:Q(e.getSectionChildren)});for(let r=0;r<t.length;r++)t[r]();return e.factory(n)})}var F4=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),N4=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function B4(e){var n;if(Intl.Locale){const r=(n=new Intl.Locale(e).maximize().script)!=null?n:"";return F4.has(r)}const t=e.split("-")[0];return N4.has(t)}function q4(e){return B4(e)?"rtl":"ltr"}function x1(){let e=typeof navigator!="undefined"&&(navigator.language||navigator.userLanguage)||"en-US";return{locale:e,direction:q4(e)}}var Nd=x1(),Ao=new Set;function Lm(){Nd=x1();for(const e of Ao)e(Nd)}function z4(){const[e,t]=re(Nd),n=H(()=>e());return dr(()=>{Ao.size===0&&window.addEventListener("languagechange",Lm),Ao.add(t),we(()=>{Ao.delete(t),Ao.size===0&&window.removeEventListener("languagechange",Lm)})}),{locale:()=>n().locale,direction:()=>n().direction}}var H4=pt();function Qr(){const e=z4();return vt(H4)||e}var Pu=new Map;function U4(e){const{locale:t}=Qr(),n=H(()=>t()+(e?Object.entries(e).sort((r,i)=>r[0]<i[0]?-1:1).join():""));return H(()=>{const r=n();let i;return Pu.has(r)&&(i=Pu.get(r)),i||(i=new Intl.Collator(t(),e),Pu.set(r,i)),i})}var Zn=class w1 extends Set{constructor(n,r,i){super(n);me(this,"anchorKey");me(this,"currentKey");n instanceof w1?(this.anchorKey=r||n.anchorKey,this.currentKey=i||n.currentKey):(this.anchorKey=r,this.currentKey=i)}};function K4(e){const[t,n]=Ra(e);return[()=>{var i;return(i=t())!=null?i:new Zn},n]}function S1(e){return s4()?e.altKey:e.ctrlKey}function Ki(e){return Ic()?e.metaKey:e.ctrlKey}function Im(e){return new Zn(e)}function V4(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function W4(e){const t=Ne({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=re(!1),[i,s]=re(),o=H(()=>{const m=Q(t.selectedKeys);return m!=null?Im(m):m}),a=H(()=>{const m=Q(t.defaultSelectedKeys);return m!=null?Im(m):new Zn}),[l,c]=K4({value:o,defaultValue:a,onChange:m=>{var p;return(p=t.onSelectionChange)==null?void 0:p.call(t,m)}}),[u,d]=re(Q(t.selectionBehavior)),f=()=>Q(t.selectionMode),h=()=>{var m;return(m=Q(t.disallowEmptySelection))!=null?m:!1},g=m=>{(Q(t.allowDuplicateSelectionEvents)||!V4(m,l()))&&c(m)};return be(()=>{const m=l();Q(t.selectionBehavior)==="replace"&&u()==="toggle"&&typeof m=="object"&&m.size===0&&d("replace")}),be(()=>{var m;d((m=Q(t.selectionBehavior))!=null?m:"toggle")}),{selectionMode:f,disallowEmptySelection:h,selectionBehavior:u,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:i,setFocusedKey:s,selectedKeys:l,setSelectedKeys:g}}function G4(e){const[t,n]=re(""),[r,i]=re(-1);return{typeSelectHandlers:{onKeyDown:o=>{var f,h,g;if(Q(e.isDisabled))return;const a=Q(e.keyboardDelegate),l=Q(e.selectionManager);if(!a.getKeyForSearch)return;const c=Q4(o.key);if(!c||o.ctrlKey||o.metaKey)return;c===" "&&t().trim().length>0&&(o.preventDefault(),o.stopPropagation());let u=n(m=>m+c),d=(f=a.getKeyForSearch(u,l.focusedKey()))!=null?f:a.getKeyForSearch(u);d==null&&Y4(u)&&(u=u[0],d=(h=a.getKeyForSearch(u,l.focusedKey()))!=null?h:a.getKeyForSearch(u)),d!=null&&(l.setFocusedKey(d),(g=e.onTypeSelect)==null||g.call(e,d)),clearTimeout(r()),i(window.setTimeout(()=>n(""),500))}}}}function Q4(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function Y4(e){return e.split("").every(t=>t===e[0])}function X4(e,t,n){const i=ke({selectOnFocus:()=>Q(e.selectionManager).selectionBehavior()==="replace"},e),s=()=>t(),{direction:o}=Qr();let a={top:0,left:0};Qj(()=>Q(i.isVirtualized)?void 0:s(),"scroll",()=>{const p=s();p&&(a={top:p.scrollTop,left:p.scrollLeft})});const{typeSelectHandlers:l}=G4({isDisabled:()=>Q(i.disallowTypeAhead),keyboardDelegate:()=>Q(i.keyboardDelegate),selectionManager:()=>Q(i.selectionManager)}),c=()=>{var p;return(p=Q(i.orientation))!=null?p:"vertical"},u=p=>{var _,O,A,M,D,W,R,L;tt(p,l.onKeyDown),p.altKey&&p.key==="Tab"&&p.preventDefault();const v=t();if(!(v!=null&&v.contains(p.target)))return;const b=Q(i.selectionManager),x=Q(i.selectOnFocus),C=j=>{j!=null&&(b.setFocusedKey(j),p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(j):x&&!S1(p)&&b.replaceSelection(j))},w=Q(i.keyboardDelegate),k=Q(i.shouldFocusWrap),S=b.focusedKey();switch(p.key){case(c()==="vertical"?"ArrowDown":"ArrowRight"):{if(w.getKeyBelow){p.preventDefault();let j;S!=null?j=w.getKeyBelow(S):j=(_=w.getFirstKey)==null?void 0:_.call(w),j==null&&k&&(j=(O=w.getFirstKey)==null?void 0:O.call(w,S)),C(j)}break}case(c()==="vertical"?"ArrowUp":"ArrowLeft"):{if(w.getKeyAbove){p.preventDefault();let j;S!=null?j=w.getKeyAbove(S):j=(A=w.getLastKey)==null?void 0:A.call(w),j==null&&k&&(j=(M=w.getLastKey)==null?void 0:M.call(w,S)),C(j)}break}case(c()==="vertical"?"ArrowLeft":"ArrowUp"):{if(w.getKeyLeftOf){p.preventDefault();const j=o()==="rtl";let I;S!=null?I=w.getKeyLeftOf(S):I=j?(D=w.getFirstKey)==null?void 0:D.call(w):(W=w.getLastKey)==null?void 0:W.call(w),C(I)}break}case(c()==="vertical"?"ArrowRight":"ArrowDown"):{if(w.getKeyRightOf){p.preventDefault();const j=o()==="rtl";let I;S!=null?I=w.getKeyRightOf(S):I=j?(R=w.getLastKey)==null?void 0:R.call(w):(L=w.getFirstKey)==null?void 0:L.call(w),C(I)}break}case"Home":if(w.getFirstKey){p.preventDefault();const j=w.getFirstKey(S,Ki(p));j!=null&&(b.setFocusedKey(j),Ki(p)&&p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(j):x&&b.replaceSelection(j))}break;case"End":if(w.getLastKey){p.preventDefault();const j=w.getLastKey(S,Ki(p));j!=null&&(b.setFocusedKey(j),Ki(p)&&p.shiftKey&&b.selectionMode()==="multiple"?b.extendSelection(j):x&&b.replaceSelection(j))}break;case"PageDown":if(w.getKeyPageBelow&&S!=null){p.preventDefault();const j=w.getKeyPageBelow(S);C(j)}break;case"PageUp":if(w.getKeyPageAbove&&S!=null){p.preventDefault();const j=w.getKeyPageAbove(S);C(j)}break;case"a":Ki(p)&&b.selectionMode()==="multiple"&&Q(i.disallowSelectAll)!==!0&&(p.preventDefault(),b.selectAll());break;case"Escape":p.defaultPrevented||(p.preventDefault(),Q(i.disallowEmptySelection)||b.clearSelection());break;case"Tab":if(!Q(i.allowsTabNavigation)){if(p.shiftKey)v.focus();else{const j=y4(v,{tabbable:!0});let I,oe;do oe=j.lastChild(),oe&&(I=oe);while(oe);I&&!I.contains(document.activeElement)&&Ct(I)}break}}},d=p=>{var C,w,k,S;const v=Q(i.selectionManager),b=Q(i.keyboardDelegate),x=Q(i.selectOnFocus);if(v.isFocused()){p.currentTarget.contains(p.target)||v.setFocused(!1);return}if(p.currentTarget.contains(p.target)){if(v.setFocused(!0),v.focusedKey()==null){const _=A=>{A!=null&&(v.setFocusedKey(A),x&&v.replaceSelection(A))},O=p.relatedTarget;O&&p.currentTarget.compareDocumentPosition(O)&Node.DOCUMENT_POSITION_FOLLOWING?_((w=v.lastSelectedKey())!=null?w:(C=b.getLastKey)==null?void 0:C.call(b)):_((S=v.firstSelectedKey())!=null?S:(k=b.getFirstKey)==null?void 0:k.call(b))}else if(!Q(i.isVirtualized)){const _=s();if(_){_.scrollTop=a.top,_.scrollLeft=a.left;const O=_.querySelector(`[data-key="${v.focusedKey()}"]`);O&&(Ct(O),Fd(_,O))}}}},f=p=>{const v=Q(i.selectionManager);p.currentTarget.contains(p.relatedTarget)||v.setFocused(!1)},h=p=>{s()===p.target&&p.preventDefault()},g=()=>{var k,S;const p=Q(i.autoFocus);if(!p)return;const v=Q(i.selectionManager),b=Q(i.keyboardDelegate);let x;p==="first"&&(x=(k=b.getFirstKey)==null?void 0:k.call(b)),p==="last"&&(x=(S=b.getLastKey)==null?void 0:S.call(b));const C=v.selectedKeys();C.size&&(x=C.values().next().value),v.setFocused(!0),v.setFocusedKey(x);const w=t();w&&x==null&&!Q(i.shouldUseVirtualFocus)&&Ct(w)};return dr(()=>{i.deferAutoFocus?setTimeout(g,0):g()}),be(ur([s,()=>Q(i.isVirtualized),()=>Q(i.selectionManager).focusedKey()],p=>{var C;const[v,b,x]=p;if(b)x&&((C=i.scrollToKey)==null||C.call(i,x));else if(x&&v){const w=v.querySelector(`[data-key="${x}"]`);w&&Fd(v,w)}})),{tabIndex:H(()=>{if(!Q(i.shouldUseVirtualFocus))return Q(i.selectionManager).focusedKey()==null?0:-1}),onKeyDown:u,onMouseDown:h,onFocusIn:d,onFocusOut:f}}function C1(e,t){const n=()=>Q(e.selectionManager),r=()=>Q(e.key),i=()=>Q(e.shouldUseVirtualFocus),s=b=>{n().selectionMode()!=="none"&&(n().selectionMode()==="single"?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):b!=null&&b.shiftKey?n().extendSelection(r()):n().selectionBehavior()==="toggle"||Ki(b)||"pointerType"in b&&b.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},o=()=>n().isSelected(r()),a=()=>Q(e.disabled)||n().isDisabled(r()),l=()=>!a()&&n().canSelectItem(r());let c=null;const u=b=>{l()&&(c=b.pointerType,b.pointerType==="mouse"&&b.button===0&&!Q(e.shouldSelectOnPressUp)&&s(b))},d=b=>{l()&&b.pointerType==="mouse"&&b.button===0&&Q(e.shouldSelectOnPressUp)&&Q(e.allowsDifferentPressOrigin)&&s(b)},f=b=>{l()&&(Q(e.shouldSelectOnPressUp)&&!Q(e.allowsDifferentPressOrigin)||c!=="mouse")&&s(b)},h=b=>{!l()||!["Enter"," "].includes(b.key)||(S1(b)?n().toggleSelection(r()):s(b))},g=b=>{a()&&b.preventDefault()},m=b=>{const x=t();i()||a()||!x||b.target===x&&n().setFocusedKey(r())},p=H(()=>{if(!(i()||a()))return r()===n().focusedKey()?0:-1}),v=H(()=>Q(e.virtualized)?void 0:r());return be(ur([t,r,i,()=>n().focusedKey(),()=>n().isFocused()],([b,x,C,w,k])=>{b&&x===w&&k&&!C&&document.activeElement!==b&&(e.focus?e.focus():Ct(b))})),{isSelected:o,isDisabled:a,allowsSelection:l,tabIndex:p,dataKey:v,onPointerDown:u,onPointerUp:d,onClick:f,onKeyDown:h,onMouseDown:g,onFocus:m}}var J4=class{constructor(e,t){me(this,"collection");me(this,"state");this.collection=e,this.state=t}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}isFocused(){return this.state.isFocused()}setFocused(e){this.state.setFocused(e)}focusedKey(){return this.state.focusedKey()}setFocusedKey(e){(e==null||this.collection().getItem(e))&&this.state.setFocusedKey(e)}selectedKeys(){return this.state.selectedKeys()}isSelected(e){if(this.state.selectionMode()==="none")return!1;const t=this.getKey(e);return t==null?!1:this.state.selectedKeys().has(t)}isEmpty(){return this.state.selectedKeys().size===0}isSelectAll(){if(this.isEmpty())return!1;const e=this.state.selectedKeys();return this.getAllSelectableKeys().every(t=>e.has(t))}firstSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=(n==null?void 0:n.index)!=null&&(e==null?void 0:e.index)!=null&&n.index<e.index;(!e||r)&&(e=n)}return e==null?void 0:e.key}lastSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=(n==null?void 0:n.index)!=null&&(e==null?void 0:e.index)!=null&&n.index>e.index;(!e||r)&&(e=n)}return e==null?void 0:e.key}extendSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=this.state.selectedKeys(),r=n.anchorKey||t,i=new Zn(n,r,t);for(const s of this.getKeyRange(r,n.currentKey||t))i.delete(s);for(const s of this.getKeyRange(t,r))this.canSelectItem(s)&&i.add(s);this.state.setSelectedKeys(i)}getKeyRange(e,t){const n=this.collection().getItem(e),r=this.collection().getItem(t);return n&&r?n.index!=null&&r.index!=null&&n.index<=r.index?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){const n=[];let r=e;for(;r!=null;){const i=this.collection().getItem(r);if(i&&i.type==="item"&&n.push(r),r===t)return n;r=this.collection().getKeyAfter(r)}return[]}getKey(e){const t=this.collection().getItem(e);return t?!t||t.type!=="item"?null:t.key:e}toggleSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=new Zn(this.state.selectedKeys());n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),!(this.disallowEmptySelection()&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode()==="none")return;const t=this.getKey(e);if(t==null)return;const n=this.canSelectItem(t)?new Zn([t],t,t):new Zn;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode()==="none")return;const t=new Zn;for(const n of e){const r=this.getKey(n);if(r!=null&&(t.add(r),this.selectionMode()==="single"))break}this.state.setSelectedKeys(t)}selectAll(){this.selectionMode()==="multiple"&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const e=this.state.selectedKeys();!this.disallowEmptySelection()&&e.size>0&&this.state.setSelectedKeys(new Zn)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode()!=="none"&&(this.selectionMode()==="single"?this.isSelected(e)&&!this.disallowEmptySelection()?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior()==="toggle"||t&&t.pointerType==="touch"?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys())return!0;const t=this.selectedKeys();if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;for(const n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if(this.state.selectionMode()==="none")return!1;const t=this.collection().getItem(e);return t!=null&&!t.disabled}isDisabled(e){const t=this.collection().getItem(e);return!t||t.disabled}getAllSelectableKeys(){const e=[];return(n=>{for(;n!=null;){if(this.canSelectItem(n)){const r=this.collection().getItem(n);if(!r)continue;r.type==="item"&&e.push(n)}n=this.collection().getKeyAfter(n)}})(this.collection().getFirstKey()),e}},Rm=class{constructor(e){me(this,"keyMap",new Map);me(this,"iterable");me(this,"firstKey");me(this,"lastKey");this.iterable=e;for(const r of e)this.keyMap.set(r.key,r);if(this.keyMap.size===0)return;let t,n=0;for(const[r,i]of this.keyMap)t?(t.nextKey=r,i.prevKey=t.key):(this.firstKey=r,i.prevKey=void 0),i.type==="item"&&(i.index=n++),t=i,t.nextKey=void 0;this.lastKey=t.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){var t;return(t=this.keyMap.get(e))==null?void 0:t.prevKey}getKeyAfter(e){var t;return(t=this.keyMap.get(e))==null?void 0:t.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)}at(e){const t=[...this.getKeys()];return this.getItem(t[e])}};function Z4(e){const t=W4(e),r=R4({dataSource:()=>Q(e.dataSource),getKey:()=>Q(e.getKey),getTextValue:()=>Q(e.getTextValue),getDisabled:()=>Q(e.getDisabled),getSectionChildren:()=>Q(e.getSectionChildren),factory:s=>e.filter?new Rm(e.filter(s)):new Rm(s)},[()=>e.filter]),i=new J4(r,t);return E0(()=>{const s=t.focusedKey();s!=null&&!r().getItem(s)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>i}}var St=e=>typeof e=="function"?e():e,eD=e=>{const t=H(()=>{const o=St(e.element);if(o)return getComputedStyle(o)}),n=()=>{var o,a;return(a=(o=t())==null?void 0:o.animationName)!=null?a:"none"},[r,i]=re(St(e.show)?"present":"hidden");let s="none";return be(o=>{const a=St(e.show);return ot(()=>{var u;if(o===a)return a;const l=s,c=n();a?i("present"):c==="none"||((u=t())==null?void 0:u.display)==="none"?i("hidden"):i(o===!0&&l!==c?"hiding":"hidden")}),a}),be(()=>{const o=St(e.element);if(!o)return;const a=c=>{c.target===o&&(s=n())},l=c=>{const d=n().includes(c.animationName);c.target===o&&d&&r()==="hiding"&&i("hidden")};o.addEventListener("animationstart",a),o.addEventListener("animationcancel",l),o.addEventListener("animationend",l),we(()=>{o.removeEventListener("animationstart",a),o.removeEventListener("animationcancel",l),o.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r}},tD=eD,_1=tD,ec="data-kb-top-layer",k1,Bd=!1,fr=[];function sa(e){return fr.findIndex(t=>t.node===e)}function nD(e){return fr[sa(e)]}function rD(e){return fr[fr.length-1].node===e}function O1(){return fr.filter(e=>e.isPointerBlocking)}function iD(){return[...O1()].slice(-1)[0]}function Bf(){return O1().length>0}function E1(e){var n;const t=sa((n=iD())==null?void 0:n.node);return sa(e)<t}function sD(e){fr.push(e)}function oD(e){const t=sa(e);t<0||fr.splice(t,1)}function aD(){for(const{node:e}of fr)e.style.pointerEvents=E1(e)?"none":"auto"}function lD(e){if(Bf()&&!Bd){const t=Nn(e);k1=document.body.style.pointerEvents,t.body.style.pointerEvents="none",Bd=!0}}function cD(e){if(Bf())return;const t=Nn(e);t.body.style.pointerEvents=k1,t.body.style.length===0&&t.body.removeAttribute("style"),Bd=!1}var qt={layers:fr,isTopMostLayer:rD,hasPointerBlockingLayer:Bf,isBelowPointerBlockingLayer:E1,addLayer:sD,removeLayer:oD,indexOf:sa,find:nD,assignPointerEventToLayers:aD,disableBodyPointerEvents:lD,restoreBodyPointerEvents:cD},uD={};Fc(uD,{Button:()=>hD,Root:()=>qf});var dD=["button","color","file","image","reset","submit"];function fD(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?dD.indexOf(e.type)!==-1:!1}function qf(e){let t;const n=Ne({type:"button"},e),[r,i]=We(n,["ref","type","disabled"]),s=Rc(()=>t,()=>"button"),o=H(()=>{const c=s();return c==null?!1:fD({tagName:c,type:r.type})}),a=H(()=>s()==="input"),l=H(()=>s()==="a"&&(t==null?void 0:t.getAttribute("href"))!=null);return T(rt,ke({as:"button",ref(c){const u=$t(d=>t=d,r.ref);typeof u=="function"&&u(c)},get type(){return o()||a()?r.type:void 0},get role(){return!o()&&!l()?"button":void 0},get tabIndex(){return!o()&&!l()&&!r.disabled?0:void 0},get disabled(){return o()||a()?r.disabled:void 0},get"aria-disabled"(){return!o()&&!a()&&r.disabled?!0:void 0},get"data-disabled"(){return r.disabled?"":void 0}},i))}var hD=qf,gD=["top","right","bottom","left"],Rn=Math.min,Qt=Math.max,tc=Math.round,yl=Math.floor,Hr=e=>({x:e,y:e}),yD={left:"right",right:"left",bottom:"top",top:"bottom"},mD={start:"end",end:"start"};function qd(e,t,n){return Qt(e,Rn(t,n))}function Ii(e,t){return typeof e=="function"?e(t):e}function Ur(e){return e.split("-")[0]}function Ks(e){return e.split("-")[1]}function A1(e){return e==="x"?"y":"x"}function zf(e){return e==="y"?"height":"width"}function Mi(e){return["top","bottom"].includes(Ur(e))?"y":"x"}function Hf(e){return A1(Mi(e))}function pD(e,t,n){n===void 0&&(n=!1);const r=Ks(e),i=Hf(e),s=zf(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=nc(o)),[o,nc(o)]}function vD(e){const t=nc(e);return[zd(e),t,zd(t)]}function zd(e){return e.replace(/start|end/g,t=>mD[t])}function bD(e,t,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?s:o;default:return[]}}function xD(e,t,n,r){const i=Ks(e);let s=bD(Ur(e),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(zd)))),s}function nc(e){return e.replace(/left|right|bottom|top/g,t=>yD[t])}function wD(e){return{top:0,right:0,bottom:0,left:0,...e}}function P1(e){return typeof e!="number"?wD(e):{top:e,right:e,bottom:e,left:e}}function rc(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Fm(e,t,n){let{reference:r,floating:i}=e;const s=Mi(t),o=Hf(t),a=zf(o),l=Ur(t),c=s==="y",u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[a]/2-i[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-i.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-i.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Ks(t)){case"start":h[o]-=f*(n&&c?-1:1);break;case"end":h[o]+=f*(n&&c?-1:1);break}return h}var SD=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let c=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Fm(c,r,l),f=r,h={},g=0;for(let m=0;m<a.length;m++){const{name:p,fn:v}=a[m],{x:b,y:x,data:C,reset:w}=await v({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:h,rects:c,platform:o,elements:{reference:e,floating:t}});u=b!=null?b:u,d=x!=null?x:d,h={...h,[p]:{...h[p],...C}},w&&g<=50&&(g++,typeof w=="object"&&(w.placement&&(f=w.placement),w.rects&&(c=w.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):w.rects),{x:u,y:d}=Fm(c,f,l)),m=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:h}};async function oa(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Ii(t,e),g=P1(h),p=a[f?d==="floating"?"reference":"floating":d],v=rc(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(p)))==null||n?p:p.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),b=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),C=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},w=rc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:x,strategy:l}):b);return{top:(v.top-w.top+g.top)/C.y,bottom:(w.bottom-v.bottom+g.bottom)/C.y,left:(v.left-w.left+g.left)/C.x,right:(w.right-v.right+g.right)/C.x}}var CD=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Ii(e,t)||{};if(c==null)return{};const d=P1(u),f={x:n,y:r},h=Hf(i),g=zf(h),m=await o.getDimensions(c),p=h==="y",v=p?"top":"left",b=p?"bottom":"right",x=p?"clientHeight":"clientWidth",C=s.reference[g]+s.reference[h]-f[h]-s.floating[g],w=f[h]-s.reference[h],k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let S=k?k[x]:0;(!S||!await(o.isElement==null?void 0:o.isElement(k)))&&(S=a.floating[x]||s.floating[g]);const _=C/2-w/2,O=S/2-m[g]/2-1,A=Rn(d[v],O),M=Rn(d[b],O),D=A,W=S-m[g]-M,R=S/2-m[g]/2+_,L=qd(D,R,W),j=!l.arrow&&Ks(i)!=null&&R!==L&&s.reference[g]/2-(R<D?A:M)-m[g]/2<0,I=j?R<D?R-D:R-W:0;return{[h]:f[h]+I,data:{[h]:L,centerOffset:R-L-I,...j&&{alignmentOffset:I}},reset:j}}}),_D=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...p}=Ii(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=Ur(i),b=Mi(a),x=Ur(a)===a,C=await(l.isRTL==null?void 0:l.isRTL(c.floating)),w=f||(x||!m?[nc(a)]:vD(a)),k=g!=="none";!f&&k&&w.push(...xD(a,m,g,C));const S=[a,...w],_=await oa(t,p),O=[];let A=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&O.push(_[v]),d){const R=pD(i,o,C);O.push(_[R[0]],_[R[1]])}if(A=[...A,{placement:i,overflows:O}],!O.every(R=>R<=0)){var M,D;const R=(((M=s.flip)==null?void 0:M.index)||0)+1,L=S[R];if(L)return{data:{index:R,overflows:A},reset:{placement:L}};let j=(D=A.filter(I=>I.overflows[0]<=0).sort((I,oe)=>I.overflows[1]-oe.overflows[1])[0])==null?void 0:D.placement;if(!j)switch(h){case"bestFit":{var W;const I=(W=A.filter(oe=>{if(k){const ue=Mi(oe.placement);return ue===b||ue==="y"}return!0}).map(oe=>[oe.placement,oe.overflows.filter(ue=>ue>0).reduce((ue,B)=>ue+B,0)]).sort((oe,ue)=>oe[1]-ue[1])[0])==null?void 0:W[0];I&&(j=I);break}case"initialPlacement":j=a;break}if(i!==j)return{reset:{placement:j}}}return{}}}};function Nm(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Bm(e){return gD.some(t=>e[t]>=0)}var kD=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=Ii(e,t);switch(r){case"referenceHidden":{const s=await oa(t,{...i,elementContext:"reference"}),o=Nm(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Bm(o)}}}case"escaped":{const s=await oa(t,{...i,altBoundary:!0}),o=Nm(s,n.floating);return{data:{escapedOffsets:o,escaped:Bm(o)}}}default:return{}}}}};async function OD(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ur(n),a=Ks(n),l=Mi(n)==="y",c=["left","top"].includes(o)?-1:1,u=s&&l?-1:1,d=Ii(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}var ED=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=t,l=await OD(t,e);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},AD=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:p=>{let{x:v,y:b}=p;return{x:v,y:b}}},...l}=Ii(e,t),c={x:n,y:r},u=await oa(t,l),d=Mi(Ur(i)),f=A1(d);let h=c[f],g=c[d];if(s){const p=f==="y"?"top":"left",v=f==="y"?"bottom":"right",b=h+u[p],x=h-u[v];h=qd(b,h,x)}if(o){const p=d==="y"?"top":"left",v=d==="y"?"bottom":"right",b=g+u[p],x=g-u[v];g=qd(b,g,x)}const m=a.fn({...t,[f]:h,[d]:g});return{...m,data:{x:m.x-n,y:m.y-r}}}}},PD=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:s}=t,{apply:o=()=>{},...a}=Ii(e,t),l=await oa(t,a),c=Ur(n),u=Ks(n),d=Mi(n)==="y",{width:f,height:h}=r.floating;let g,m;c==="top"||c==="bottom"?(g=c,m=u===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(m=c,g=u==="end"?"top":"bottom");const p=h-l.top-l.bottom,v=f-l.left-l.right,b=Rn(h-l[g],p),x=Rn(f-l[m],v),C=!t.middlewareData.shift;let w=b,k=x;if(d?k=u||C?Rn(x,v):v:w=u||C?Rn(b,p):p,C&&!u){const _=Qt(l.left,0),O=Qt(l.right,0),A=Qt(l.top,0),M=Qt(l.bottom,0);d?k=f-2*(_!==0||O!==0?_+O:Qt(l.left,l.right)):w=h-2*(A!==0||M!==0?A+M:Qt(l.top,l.bottom))}await o({...t,availableWidth:k,availableHeight:w});const S=await i.getDimensions(s.floating);return f!==S.width||h!==S.height?{reset:{rects:!0}}:{}}}};function Vs(e){return T1(e)?(e.nodeName||"").toLowerCase():"#document"}function Jt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function yr(e){var t;return(t=(T1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function T1(e){return e instanceof Node||e instanceof Jt(e).Node}function Sn(e){return e instanceof Element||e instanceof Jt(e).Element}function Bn(e){return e instanceof HTMLElement||e instanceof Jt(e).HTMLElement}function qm(e){return typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof Jt(e).ShadowRoot}function Fa(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Cn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function TD(e){return["table","td","th"].includes(Vs(e))}function Nc(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(n){return!1}})}function Uf(e){const t=Kf(),n=Sn(e)?Cn(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function MD(e){let t=Kr(e);for(;Bn(t)&&!js(t);){if(Uf(t))return t;if(Nc(t))return null;t=Kr(t)}return null}function Kf(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function js(e){return["html","body","#document"].includes(Vs(e))}function Cn(e){return Jt(e).getComputedStyle(e)}function Bc(e){return Sn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Kr(e){if(Vs(e)==="html")return e;const t=e.assignedSlot||e.parentNode||qm(e)&&e.host||yr(e);return qm(t)?t.host:t}function M1(e){const t=Kr(e);return js(t)?e.ownerDocument?e.ownerDocument.body:e.body:Bn(t)&&Fa(t)?t:M1(t)}function aa(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=M1(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),o=Jt(i);return s?t.concat(o,o.visualViewport||[],Fa(i)?i:[],o.frameElement&&n?aa(o.frameElement):[]):t.concat(i,aa(i,[],n))}function $1(e){const t=Cn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Bn(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r,a=tc(n)!==s||tc(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function Vf(e){return Sn(e)?e:e.contextElement}function Ji(e){const t=Vf(e);if(!Bn(t))return Hr(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=$1(t);let o=(s?tc(n.width):n.width)/r,a=(s?tc(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}var $D=Hr(0);function j1(e){const t=Jt(e);return!Kf()||!t.visualViewport?$D:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function jD(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Jt(e)?!1:t}function $i(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=Vf(e);let o=Hr(1);t&&(r?Sn(r)&&(o=Ji(r)):o=Ji(e));const a=jD(s,n,r)?j1(s):Hr(0);let l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(s){const f=Jt(s),h=r&&Sn(r)?Jt(r):r;let g=f,m=g.frameElement;for(;m&&r&&h!==g;){const p=Ji(m),v=m.getBoundingClientRect(),b=Cn(m),x=v.left+(m.clientLeft+parseFloat(b.paddingLeft))*p.x,C=v.top+(m.clientTop+parseFloat(b.paddingTop))*p.y;l*=p.x,c*=p.y,u*=p.x,d*=p.y,l+=x,c+=C,g=Jt(m),m=g.frameElement}}return rc({width:u,height:d,x:l,y:c})}function DD(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",o=yr(r),a=t?Nc(t.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=Hr(1);const u=Hr(0),d=Bn(r);if((d||!d&&!s)&&((Vs(r)!=="body"||Fa(o))&&(l=Bc(r)),Bn(r))){const f=$i(r);c=Ji(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}}function LD(e){return Array.from(e.getClientRects())}function D1(e){return $i(yr(e)).left+Bc(e).scrollLeft}function ID(e){const t=yr(e),n=Bc(e),r=e.ownerDocument.body,i=Qt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Qt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+D1(e);const a=-n.scrollTop;return Cn(r).direction==="rtl"&&(o+=Qt(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function RD(e,t){const n=Jt(e),r=yr(e),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const c=Kf();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function FD(e,t){const n=$i(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=Bn(e)?Ji(e):Hr(1),o=e.clientWidth*s.x,a=e.clientHeight*s.y,l=i*s.x,c=r*s.y;return{width:o,height:a,x:l,y:c}}function zm(e,t,n){let r;if(t==="viewport")r=RD(e,n);else if(t==="document")r=ID(yr(e));else if(Sn(t))r=FD(t,n);else{const i=j1(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return rc(r)}function L1(e,t){const n=Kr(e);return n===t||!Sn(n)||js(n)?!1:Cn(n).position==="fixed"||L1(n,t)}function ND(e,t){const n=t.get(e);if(n)return n;let r=aa(e,[],!1).filter(a=>Sn(a)&&Vs(a)!=="body"),i=null;const s=Cn(e).position==="fixed";let o=s?Kr(e):e;for(;Sn(o)&&!js(o);){const a=Cn(o),l=Uf(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Fa(o)&&!l&&L1(e,o))?r=r.filter(u=>u!==o):i=a,o=Kr(o)}return t.set(e,r),r}function BD(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?Nc(t)?[]:ND(t,this._c):[].concat(n),r],a=o[0],l=o.reduce((c,u)=>{const d=zm(t,u,i);return c.top=Qt(d.top,c.top),c.right=Rn(d.right,c.right),c.bottom=Rn(d.bottom,c.bottom),c.left=Qt(d.left,c.left),c},zm(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function qD(e){const{width:t,height:n}=$1(e);return{width:t,height:n}}function zD(e,t,n){const r=Bn(t),i=yr(t),s=n==="fixed",o=$i(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=Hr(0);if(r||!r&&!s)if((Vs(t)!=="body"||Fa(i))&&(a=Bc(t)),r){const d=$i(t,!0,s,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&(l.x=D1(i));const c=o.left+a.scrollLeft-l.x,u=o.top+a.scrollTop-l.y;return{x:c,y:u,width:o.width,height:o.height}}function Tu(e){return Cn(e).position==="static"}function Hm(e,t){return!Bn(e)||Cn(e).position==="fixed"?null:t?t(e):e.offsetParent}function I1(e,t){const n=Jt(e);if(Nc(e))return n;if(!Bn(e)){let i=Kr(e);for(;i&&!js(i);){if(Sn(i)&&!Tu(i))return i;i=Kr(i)}return n}let r=Hm(e,t);for(;r&&TD(r)&&Tu(r);)r=Hm(r,t);return r&&js(r)&&Tu(r)&&!Uf(r)?n:r||MD(e)||n}var HD=async function(e){const t=this.getOffsetParent||I1,n=this.getDimensions,r=await n(e.floating);return{reference:zD(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function UD(e){return Cn(e).direction==="rtl"}var R1={convertOffsetParentRelativeRectToViewportRelativeRect:DD,getDocumentElement:yr,getClippingRect:BD,getOffsetParent:I1,getElementRects:HD,getClientRects:LD,getDimensions:qD,getScale:Ji,isElement:Sn,isRTL:UD};function KD(e,t){let n=null,r;const i=yr(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const h=yl(u),g=yl(i.clientWidth-(c+d)),m=yl(i.clientHeight-(u+f)),p=yl(c),b={rootMargin:-h+"px "+-g+"px "+-m+"px "+-p+"px",threshold:Qt(0,Rn(1,l))||1};let x=!0;function C(w){const k=w[0].intersectionRatio;if(k!==l){if(!x)return o();k?o(!1,k):r=setTimeout(()=>{o(!1,1e-7)},1e3)}x=!1}try{n=new IntersectionObserver(C,{...b,root:i.ownerDocument})}catch(w){n=new IntersectionObserver(C,b)}n.observe(e)}return o(!0),s}function VD(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Vf(e),u=i||s?[...c?aa(c):[],...aa(t)]:[];u.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const d=c&&a?KD(c,n):null;let f=-1,h=null;o&&(h=new ResizeObserver(v=>{let[b]=v;b&&b.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let g,m=l?$i(e):null;l&&p();function p(){const v=$i(e);m&&(v.x!==m.x||v.y!==m.y||v.width!==m.width||v.height!==m.height)&&n(),m=v,g=requestAnimationFrame(p)}return n(),()=>{var v;u.forEach(b=>{i&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),d==null||d(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(g)}}var WD=ED,GD=AD,QD=_D,YD=PD,XD=kD,JD=CD,ZD=(e,t,n)=>{const r=new Map,i={platform:R1,...n},s={...i.platform,_c:r};return SD(e,t,{...i,platform:s})},Wf=pt();function Gf(){const e=vt(Wf);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var e6=le('<svg display="block" viewBox="0 0 30 30" style="transform:scale(1.02)"><g><path fill="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z"></path><path stroke="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z">'),Hd=30,Um=Hd/2,t6={top:180,right:-90,bottom:0,left:90};function Qf(e){const t=Gf(),n=Ne({size:Hd},e),[r,i]=We(n,["ref","style","size"]),s=()=>t.currentPlacement().split("-")[0],o=n6(t.contentRef),a=()=>{var f;return((f=o())==null?void 0:f.getPropertyValue("background-color"))||"none"},l=()=>{var f;return((f=o())==null?void 0:f.getPropertyValue(`border-${s()}-color`))||"none"},c=()=>{var f;return((f=o())==null?void 0:f.getPropertyValue(`border-${s()}-width`))||"0px"},u=()=>Number.parseInt(c())*2*(Hd/r.size),d=()=>`rotate(${t6[s()]} ${Um} ${Um}) translate(0 2)`;return T(rt,ke({as:"div",ref(f){const h=$t(t.setArrowRef,r.ref);typeof h=="function"&&h(f)},"aria-hidden":"true",get style(){return Lc({position:"absolute","font-size":`${r.size}px`,width:"1em",height:"1em","pointer-events":"none",fill:a(),stroke:l(),"stroke-width":u()},r.style)}},i,{get children(){const f=e6(),h=f.firstChild;return ve(()=>J(h,"transform",d())),f}}))}function n6(e){const[t,n]=re();return be(()=>{const r=e();r&&n(t4(r).getComputedStyle(r))}),t}function r6(e){const t=Gf(),[n,r]=We(e,["ref","style"]);return T(rt,ke({as:"div",ref(i){const s=$t(t.setPositionerRef,n.ref);typeof s=="function"&&s(i)},"data-popper-positioner":"",get style(){return Lc({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}function Km(e){const{x:t=0,y:n=0,width:r=0,height:i=0}=e!=null?e:{};if(typeof DOMRect=="function")return new DOMRect(t,n,r,i);const s={x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:n+i,left:t};return{...s,toJSON:()=>s}}function i6(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?Km(r):e?e.getBoundingClientRect():Km()}}}function s6(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var o6={top:"bottom",right:"left",bottom:"top",left:"right"};function a6(e,t){const[n,r]=e.split("-"),i=o6[n];return r?n==="left"||n==="right"?`${i} ${r==="start"?"top":"bottom"}`:r==="start"?`${i} ${t==="rtl"?"right":"left"}`:`${i} ${t==="rtl"?"left":"right"}`:`${i} center`}function l6(e){const t=Ne({getAnchorRect:f=>f==null?void 0:f.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=re(),[i,s]=re(),[o,a]=re(t.placement),l=()=>{var f;return i6((f=t.anchorRef)==null?void 0:f.call(t),t.getAnchorRect)},{direction:c}=Qr();async function u(){var k,S,_;const f=l(),h=n(),g=i();if(!f||!h)return;const m=((g==null?void 0:g.clientHeight)||0)/2,p=typeof t.gutter=="number"?t.gutter+m:(k=t.gutter)!=null?k:m;h.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),f.getBoundingClientRect();const v=[WD(({placement:O})=>{const A=!!O.split("-")[1];return{mainAxis:p,crossAxis:A?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const O=typeof t.flip=="string"?t.flip.split(" "):void 0;if(O!==void 0&&!O.every(s6))throw new Error("`flip` expects a spaced-delimited list of placements");v.push(QD({padding:t.overflowPadding,fallbackPlacements:O}))}(t.slide||t.overlap)&&v.push(GD({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),v.push(YD({padding:t.overflowPadding,apply({availableWidth:O,availableHeight:A,rects:M}){const D=Math.round(M.reference.width);O=Math.floor(O),A=Math.floor(A),h.style.setProperty("--kb-popper-anchor-width",`${D}px`),h.style.setProperty("--kb-popper-content-available-width",`${O}px`),h.style.setProperty("--kb-popper-content-available-height",`${A}px`),t.sameWidth&&(h.style.width=`${D}px`),t.fitViewport&&(h.style.maxWidth=`${O}px`,h.style.maxHeight=`${A}px`)}})),t.hideWhenDetached&&v.push(XD({padding:t.detachedPadding})),g&&v.push(JD({element:g,padding:t.arrowPadding}));const b=await ZD(f,h,{placement:t.placement,strategy:"absolute",middleware:v,platform:{...R1,isRTL:()=>c()==="rtl"}});if(a(b.placement),(S=t.onCurrentPlacementChange)==null||S.call(t,b.placement),!h)return;h.style.setProperty("--kb-popper-content-transform-origin",a6(b.placement,c()));const x=Math.round(b.x),C=Math.round(b.y);let w;if(t.hideWhenDetached&&(w=(_=b.middlewareData.hide)!=null&&_.referenceHidden?"hidden":"visible"),Object.assign(h.style,{top:"0",left:"0",transform:`translate3d(${x}px, ${C}px, 0)`,visibility:w}),g&&b.middlewareData.arrow){const{x:O,y:A}=b.middlewareData.arrow,M=b.placement.split("-")[0];Object.assign(g.style,{left:O!=null?`${O}px`:"",top:A!=null?`${A}px`:"",[M]:"100%"})}}be(()=>{const f=l(),h=n();if(!f||!h)return;const g=VD(f,h,u,{elementResize:typeof ResizeObserver=="function"});we(g)}),be(()=>{var g;const f=n(),h=(g=t.contentRef)==null?void 0:g.call(t);!f||!h||queueMicrotask(()=>{f.style.zIndex=getComputedStyle(h).zIndex})});const d={currentPlacement:o,contentRef:()=>{var f;return(f=t.contentRef)==null?void 0:f.call(t)},setPositionerRef:r,setArrowRef:s};return T(Wf.Provider,{value:d,get children(){return t.children}})}var F1=Object.assign(l6,{Arrow:Qf,Context:Wf,usePopperContext:Gf,Positioner:r6});function c6(e){const t=n=>{var r;n.key===If.Escape&&((r=e.onEscapeKeyDown)==null||r.call(e,n))};be(()=>{var r,i;if(Q(e.isDisabled))return;const n=(i=(r=e.ownerDocument)==null?void 0:r.call(e))!=null?i:Nn();n.addEventListener("keydown",t),we(()=>{n.removeEventListener("keydown",t)})})}var Vm="interactOutside.pointerDownOutside",Wm="interactOutside.focusOutside";function u6(e,t){let n,r=p4;const i=()=>Nn(t()),s=d=>{var f;return(f=e.onPointerDownOutside)==null?void 0:f.call(e,d)},o=d=>{var f;return(f=e.onFocusOutside)==null?void 0:f.call(e,d)},a=d=>{var f;return(f=e.onInteractOutside)==null?void 0:f.call(e,d)},l=d=>{var h;const f=d.target;return!(f instanceof HTMLElement)||f.closest(`[${ec}]`)||!dn(i(),f)||dn(t(),f)?!1:!((h=e.shouldExcludeElement)!=null&&h.call(e,f))},c=d=>{function f(){const h=t(),g=d.target;if(!h||!g||!l(d))return;const m=gt([s,a]);g.addEventListener(Vm,m,{once:!0});const p=new CustomEvent(Vm,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:d.button===2||o4(d)&&d.button===0}});g.dispatchEvent(p)}d.pointerType==="touch"?(i().removeEventListener("click",f),r=f,i().addEventListener("click",f,{once:!0})):f()},u=d=>{const f=t(),h=d.target;if(!f||!h||!l(d))return;const g=gt([o,a]);h.addEventListener(Wm,g,{once:!0});const m=new CustomEvent(Wm,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:!1}});h.dispatchEvent(m)};be(()=>{Q(e.isDisabled)||(n=window.setTimeout(()=>{i().addEventListener("pointerdown",c,!0)},0),i().addEventListener("focusin",u,!0),we(()=>{window.clearTimeout(n),i().removeEventListener("click",r),i().removeEventListener("pointerdown",c,!0),i().removeEventListener("focusin",u,!0)}))})}var N1=pt();function d6(){return vt(N1)}function f6(e){let t;const n=d6(),[r,i]=We(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),s=new Set([]),o=d=>{s.add(d);const f=n==null?void 0:n.registerNestedLayer(d);return()=>{s.delete(d),f==null||f()}};u6({shouldExcludeElement:d=>{var f;return t?((f=r.excludedElements)==null?void 0:f.some(h=>dn(h(),d)))||[...s].some(h=>dn(h,d)):!1},onPointerDownOutside:d=>{var f,h,g;!t||qt.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!qt.isTopMostLayer(t)||((f=r.onPointerDownOutside)==null||f.call(r,d),(h=r.onInteractOutside)==null||h.call(r,d),d.defaultPrevented||(g=r.onDismiss)==null||g.call(r))},onFocusOutside:d=>{var f,h,g;(f=r.onFocusOutside)==null||f.call(r,d),(h=r.onInteractOutside)==null||h.call(r,d),d.defaultPrevented||(g=r.onDismiss)==null||g.call(r)}},()=>t),c6({ownerDocument:()=>Nn(t),onEscapeKeyDown:d=>{var f;!t||!qt.isTopMostLayer(t)||((f=r.onEscapeKeyDown)==null||f.call(r,d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),dr(()=>{if(!t)return;qt.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n==null?void 0:n.registerNestedLayer(t);qt.assignPointerEventToLayers(),qt.disableBodyPointerEvents(t),we(()=>{t&&(qt.removeLayer(t),d==null||d(),qt.assignPointerEventToLayers(),qt.restoreBodyPointerEvents(t))})}),be(ur([()=>t,()=>r.disableOutsidePointerEvents],([d,f])=>{if(!d)return;const h=qt.find(d);h&&h.isPointerBlocking!==f&&(h.isPointerBlocking=f,qt.assignPointerEventToLayers()),f&&qt.disableBodyPointerEvents(d),we(()=>{qt.restoreBodyPointerEvents(d)})},{defer:!0}));const u={registerNestedLayer:o};return T(N1.Provider,{value:u,get children(){return T(rt,ke({as:"div",ref(d){const f=$t(h=>t=h,r.ref);typeof f=="function"&&f(d)}},i))}})}function B1(e={}){const[t,n]=g1({value:()=>Q(e.open),defaultValue:()=>!!Q(e.defaultOpen),onChange:o=>{var a;return(a=e.onOpenChange)==null?void 0:a.call(e,o)}}),r=()=>{n(!0)},i=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:i,toggle:()=>{t()?i():r()}}}var on={};Fc(on,{Description:()=>f1,ErrorMessage:()=>h1,Item:()=>U1,ItemControl:()=>K1,ItemDescription:()=>V1,ItemIndicator:()=>W1,ItemInput:()=>G1,ItemLabel:()=>Q1,Label:()=>Y1,RadioGroup:()=>h6,Root:()=>X1});var q1=pt();function z1(){const e=vt(q1);if(e===void 0)throw new Error("[kobalte]: `useRadioGroupContext` must be used within a `RadioGroup` component");return e}var H1=pt();function Na(){const e=vt(H1);if(e===void 0)throw new Error("[kobalte]: `useRadioGroupItemContext` must be used within a `RadioGroup.Item` component");return e}function U1(e){const t=Ia(),n=z1(),r=`${t.generateId("item")}-${hn()}`,i=Ne({id:r},e),[s,o]=We(i,["value","disabled","onPointerDown"]),[a,l]=re(),[c,u]=re(),[d,f]=re(),[h,g]=re(),[m,p]=re(!1),v=H(()=>n.isSelectedValue(s.value)),b=H(()=>s.disabled||t.isDisabled()||!1),x=k=>{tt(k,s.onPointerDown),m()&&k.preventDefault()},C=H(()=>({...t.dataset(),"data-disabled":b()?"":void 0,"data-checked":v()?"":void 0})),w={value:()=>s.value,dataset:C,isSelected:v,isDisabled:b,inputId:a,labelId:c,descriptionId:d,inputRef:h,select:()=>n.setSelectedValue(s.value),generateId:La(()=>o.id),registerInput:fn(l),registerLabel:fn(u),registerDescription:fn(f),setIsFocused:p,setInputRef:g};return T(H1.Provider,{value:w,get children(){return T(rt,ke({as:"div",role:"group",onPointerDown:x},C,o))}})}function K1(e){const t=Na(),n=Ne({id:t.generateId("control")},e),[r,i]=We(n,["onClick","onKeyDown"]);return T(rt,ke({as:"div",onClick:a=>{var l;tt(a,r.onClick),t.select(),(l=t.inputRef())==null||l.focus()},onKeyDown:a=>{var l;tt(a,r.onKeyDown),a.key===If.Space&&(t.select(),(l=t.inputRef())==null||l.focus())}},()=>t.dataset(),i))}function V1(e){const t=Na(),n=Ne({id:t.generateId("description")},e);return be(()=>we(t.registerDescription(n.id))),T(rt,ke({as:"div"},()=>t.dataset(),n))}function W1(e){const t=Na(),n=Ne({id:t.generateId("indicator")},e),[r,i]=We(n,["ref","forceMount"]),[s,o]=re(),{present:a}=_1({show:()=>r.forceMount||t.isSelected(),element:()=>{var l;return(l=s())!=null?l:null}});return T(pe,{get when(){return a()},get children(){return T(rt,ke({as:"div",ref(l){const c=$t(o,r.ref);typeof c=="function"&&c(l)}},()=>t.dataset(),i))}})}function G1(e){const t=Ia(),n=z1(),r=Na(),i=Ne({id:r.generateId("input")},e),[s,o]=We(i,["ref","style","aria-labelledby","aria-describedby","onChange","onFocus","onBlur"]),a=()=>[s["aria-labelledby"],r.labelId(),s["aria-labelledby"]!=null&&o["aria-label"]!=null?o.id:void 0].filter(Boolean).join(" ")||void 0,l=()=>[s["aria-describedby"],r.descriptionId(),n.ariaDescribedBy()].filter(Boolean).join(" ")||void 0,[c,u]=re(!1),d=g=>{if(tt(g,s.onChange),g.stopPropagation(),!c()){n.setSelectedValue(r.value());const m=g.target;m.checked=r.isSelected()}u(!1)},f=g=>{tt(g,s.onFocus),r.setIsFocused(!0)},h=g=>{tt(g,s.onBlur),r.setIsFocused(!1)};return be(ur([()=>r.isSelected(),()=>r.value()],g=>{if(!g[0]&&g[1]===r.value())return;u(!0);const m=r.inputRef();m==null||m.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),m==null||m.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))},{defer:!0})),be(()=>we(r.registerInput(o.id))),T(rt,ke({as:"input",ref(g){const m=$t(r.setInputRef,s.ref);typeof m=="function"&&m(g)},type:"radio",get name(){return t.name()},get value(){return r.value()},get checked(){return r.isSelected()},get required(){return t.isRequired()},get disabled(){return r.isDisabled()},get readonly(){return t.isReadOnly()},get style(){return Lc({...u1},s.style)},get"aria-labelledby"(){return a()},get"aria-describedby"(){return l()},onChange:d,onFocus:f,onBlur:h},()=>r.dataset(),o))}function Q1(e){const t=Na(),n=Ne({id:t.generateId("label")},e);return be(()=>we(t.registerLabel(n.id))),T(rt,ke({as:"label",get for(){return t.inputId()}},()=>t.dataset(),n))}function Y1(e){return T(S4,ke({as:"span"},e))}function X1(e){let t;const n=`radiogroup-${hn()}`,r=Ne({id:n,orientation:"vertical"},e),[i,s,o]=We(r,["ref","value","defaultValue","onChange","orientation","aria-labelledby","aria-describedby"],x4),[a,l]=Ra({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:g=>{var m;return(m=i.onChange)==null?void 0:m.call(i,g)}}),{formControlContext:c}=w4(s);C4(()=>t,()=>{var g;return l((g=i.defaultValue)!=null?g:"")});const u=()=>c.getAriaLabelledBy(Q(s.id),o["aria-label"],i["aria-labelledby"]),d=()=>c.getAriaDescribedBy(i["aria-describedby"]),f=g=>g===a(),h={ariaDescribedBy:d,isSelectedValue:f,setSelectedValue:g=>{if(!(c.isReadOnly()||c.isDisabled())&&(l(g),t))for(const m of t.querySelectorAll("[type='radio']")){const p=m;p.checked=f(p.value)}}};return T(d1.Provider,{value:c,get children(){return T(q1.Provider,{value:h,get children(){return T(rt,ke({as:"div",ref(g){const m=$t(p=>t=p,i.ref);typeof m=="function"&&m(g)},role:"radiogroup",get id(){return Q(s.id)},get"aria-invalid"(){return c.validationState()==="invalid"||void 0},get"aria-required"(){return c.isRequired()||void 0},get"aria-disabled"(){return c.isDisabled()||void 0},get"aria-readonly"(){return c.isReadOnly()||void 0},get"aria-orientation"(){return i.orientation},get"aria-labelledby"(){return u()},get"aria-describedby"(){return d()}},()=>c.dataset(),o))}})}})}var h6=Object.assign(X1,{Description:f1,ErrorMessage:h1,Item:U1,ItemControl:K1,ItemDescription:V1,ItemIndicator:W1,ItemInput:G1,ItemLabel:Q1,Label:Y1}),g6=class{constructor(e,t,n){me(this,"collection");me(this,"ref");me(this,"collator");this.collection=e,this.ref=t,this.collator=n}getKeyBelow(e){let t=this.collection().getKeyAfter(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyAfter(t)}}getKeyAbove(e){let t=this.collection().getKeyBefore(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyBefore(t)}}getFirstKey(){let e=this.collection().getFirstKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyAfter(e)}}getLastKey(){let e=this.collection().getLastKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyBefore(e)}}getItem(e){var t,n,r;return(r=(n=(t=this.ref)==null?void 0:t.call(this))==null?void 0:n.querySelector(`[data-key="${e}"]`))!=null?r:null}getKeyPageAbove(e){var s;const t=(s=this.ref)==null?void 0:s.call(this);let n=this.getItem(e);if(!t||!n)return;const r=Math.max(0,n.offsetTop+n.offsetHeight-t.offsetHeight);let i=e;for(;i&&n&&n.offsetTop>r;)i=this.getKeyAbove(i),n=i!=null?this.getItem(i):null;return i}getKeyPageBelow(e){var s;const t=(s=this.ref)==null?void 0:s.call(this);let n=this.getItem(e);if(!t||!n)return;const r=Math.min(t.scrollHeight,n.offsetTop-n.offsetHeight+t.offsetHeight);let i=e;for(;i&&n&&n.offsetTop<r;)i=this.getKeyBelow(i),n=i!=null?this.getItem(i):null;return i}getKeyForSearch(e,t){var i;const n=(i=this.collator)==null?void 0:i.call(this);if(!n)return;let r=t!=null?this.getKeyBelow(t):this.getFirstKey();for(;r!=null;){const s=this.collection().getItem(r);if(s){const o=s.textValue.slice(0,e.length);if(s.textValue&&n.compare(o,e)===0)return r}r=this.getKeyBelow(r)}}};function y6(e,t,n){const r=U4({usage:"search",sensitivity:"base"}),i=H(()=>{const s=Q(e.keyboardDelegate);return s||new g6(e.collection,t,r)});return X4({selectionManager:()=>Q(e.selectionManager),keyboardDelegate:i,autoFocus:()=>Q(e.autoFocus),deferAutoFocus:()=>Q(e.deferAutoFocus),shouldFocusWrap:()=>Q(e.shouldFocusWrap),disallowEmptySelection:()=>Q(e.disallowEmptySelection),selectOnFocus:()=>Q(e.selectOnFocus),disallowTypeAhead:()=>Q(e.disallowTypeAhead),shouldUseVirtualFocus:()=>Q(e.shouldUseVirtualFocus),allowsTabNavigation:()=>Q(e.allowsTabNavigation),isVirtualized:()=>Q(e.isVirtualized),scrollToKey:s=>{var o;return(o=Q(e.scrollToKey))==null?void 0:o(s)},orientation:()=>Q(e.orientation)},t)}var Mu="focusScope.autoFocusOnMount",$u="focusScope.autoFocusOnUnmount",Gm={bubbles:!1,cancelable:!0},Qm={stack:[],active(){return this.stack[0]},add(e){var t;e!==this.active()&&((t=this.active())==null||t.pause()),this.stack=Rd(this.stack,e),this.stack.unshift(e)},remove(e){var t;this.stack=Rd(this.stack,e),(t=this.active())==null||t.resume()}};function m6(e,t){const[n,r]=re(!1),i={pause(){r(!0)},resume(){r(!1)}};let s=null;const o=g=>{var m;return(m=e.onMountAutoFocus)==null?void 0:m.call(e,g)},a=g=>{var m;return(m=e.onUnmountAutoFocus)==null?void 0:m.call(e,g)},l=()=>Nn(t()),c=()=>{const g=l().createElement("span");return g.setAttribute("data-focus-trap",""),g.tabIndex=0,Object.assign(g.style,u1),g},u=()=>{const g=t();return g?l1(g,!0).filter(m=>!m.hasAttribute("data-focus-trap")):[]},d=()=>{const g=u();return g.length>0?g[0]:null},f=()=>{const g=u();return g.length>0?g[g.length-1]:null},h=()=>{const g=t();if(!g)return!1;const m=Eo(g);return!m||dn(g,m)?!1:c1(m)};be(()=>{const g=t();if(!g)return;Qm.add(i);const m=Eo(g);if(!dn(g,m)){const v=new CustomEvent(Mu,Gm);g.addEventListener(Mu,o),g.dispatchEvent(v),v.defaultPrevented||setTimeout(()=>{Ct(d()),Eo(g)===m&&Ct(g)},0)}we(()=>{g.removeEventListener(Mu,o),setTimeout(()=>{const v=new CustomEvent($u,Gm);h()&&v.preventDefault(),g.addEventListener($u,a),g.dispatchEvent(v),v.defaultPrevented||Ct(m!=null?m:l().body),g.removeEventListener($u,a),Qm.remove(i)},0)})}),be(()=>{const g=t();if(!g||!Q(e.trapFocus)||n())return;const m=v=>{const b=v.target;b!=null&&b.closest(`[${ec}]`)||(dn(g,b)?s=b:Ct(s))},p=v=>{const b=v.relatedTarget,x=b!=null?b:Eo(g);x!=null&&x.closest(`[${ec}]`)||dn(g,x)||Ct(s)};l().addEventListener("focusin",m),l().addEventListener("focusout",p),we(()=>{l().removeEventListener("focusin",m),l().removeEventListener("focusout",p)})}),be(()=>{const g=t();if(!g||!Q(e.trapFocus)||n())return;const m=c();g.insertAdjacentElement("afterbegin",m);const p=c();g.insertAdjacentElement("beforeend",p);function v(x){const C=d(),w=f();x.relatedTarget===C?Ct(w):Ct(C)}m.addEventListener("focusin",v),p.addEventListener("focusin",v);const b=new MutationObserver(x=>{for(const C of x)C.previousSibling===p&&(p.remove(),g.insertAdjacentElement("beforeend",p)),C.nextSibling===m&&(m.remove(),g.insertAdjacentElement("afterbegin",m))});b.observe(g,{childList:!0,subtree:!1}),we(()=>{m.removeEventListener("focusin",v),p.removeEventListener("focusin",v),m.remove(),p.remove(),b.disconnect()})})}var p6="data-live-announcer";function v6(e){be(()=>{Q(e.isDisabled)||we(b6(Q(e.targets),Q(e.root)))})}var go=new WeakMap,sn=[];function b6(e,t=document.body){const n=new Set(e),r=new Set,i=l=>{for(const f of l.querySelectorAll(`[${p6}], [${ec}]`))n.add(f);const c=f=>{if(n.has(f)||f.parentElement&&r.has(f.parentElement)&&f.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const h of n)if(f.contains(h))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},u=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:c}),d=c(l);if(d===NodeFilter.FILTER_ACCEPT&&s(l),d!==NodeFilter.FILTER_REJECT){let f=u.nextNode();for(;f!=null;)s(f),f=u.nextNode()}},s=l=>{var u;const c=(u=go.get(l))!=null?u:0;l.getAttribute("aria-hidden")==="true"&&c===0||(c===0&&l.setAttribute("aria-hidden","true"),r.add(l),go.set(l,c+1))};sn.length&&sn[sn.length-1].disconnect(),i(t);const o=new MutationObserver(l=>{for(const c of l)if(!(c.type!=="childList"||c.addedNodes.length===0)&&![...n,...r].some(u=>u.contains(c.target))){for(const u of c.removedNodes)u instanceof Element&&(n.delete(u),r.delete(u));for(const u of c.addedNodes)(u instanceof HTMLElement||u instanceof SVGElement)&&(u.dataset.liveAnnouncer==="true"||u.dataset.reactAriaTopLayer==="true")?n.add(u):u instanceof Element&&i(u)}});o.observe(t,{childList:!0,subtree:!0});const a={observe(){o.observe(t,{childList:!0,subtree:!0})},disconnect(){o.disconnect()}};return sn.push(a),()=>{o.disconnect();for(const l of r){const c=go.get(l);if(c==null)return;c===1?(l.removeAttribute("aria-hidden"),go.delete(l)):go.set(l,c-1)}a===sn[sn.length-1]?(sn.pop(),sn.length&&sn[sn.length-1].observe()):sn.splice(sn.indexOf(a),1)}}var ml=new Map,x6=e=>{be(()=>{var s,o;const t=(s=St(e.style))!=null?s:{},n=(o=St(e.properties))!=null?o:[],r={};for(const a in t)r[a]=e.element.style[a];const i=ml.get(e.key);i?i.activeCount++:ml.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(a=>a.key)}),Object.assign(e.element.style,e.style);for(const a of n)e.element.style.setProperty(a.key,a.value);we(()=>{var l;const a=ml.get(e.key);if(a){if(a.activeCount!==1){a.activeCount--;return}ml.delete(e.key);for(const[c,u]of Object.entries(a.originalStyles))e.element.style[c]=u;for(const c of a.properties)e.element.style.removeProperty(c);e.element.style.length===0&&e.element.removeAttribute("style"),(l=e.cleanup)==null||l.call(e)}})})},Ym=x6,w6=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},S6=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},C6=(e,t,n)=>{var l;const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let i=e,s=0,o=0,a=!1;do{const[c,u,d]=w6(i,t),f=d-c-r*u;(u!==0||f!==0)&&S6(i,t)&&(s+=f,o+=u),i===(n!=null?n:document.documentElement)?a=!0:i=(l=i._$host)!=null?l:i.parentElement}while(i&&!a);return[s,o]},[Xm,Jm]=re([]),_6=e=>Xm().indexOf(e)===Xm().length-1,k6=e=>{const t=ke({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=hn();let r=[0,0],i=null,s=null;be(()=>{St(t.enabled)&&(Jm(c=>[...c,n]),we(()=>{Jm(c=>c.filter(u=>u!==n))}))}),be(()=>{if(!St(t.enabled)||!St(t.hideScrollbar))return;const{body:c}=document,u=window.innerWidth-c.offsetWidth;if(St(t.preventScrollbarShift)){const d={overflow:"hidden"},f=[];u>0&&(St(t.preventScrollbarShiftMode)==="padding"?d.paddingRight=`calc(${window.getComputedStyle(c).paddingRight} + ${u}px)`:d.marginRight=`calc(${window.getComputedStyle(c).marginRight} + ${u}px)`,f.push({key:"--scrollbar-width",value:`${u}px`}));const h=window.scrollY,g=window.scrollX;Ym({key:"prevent-scroll",element:c,style:d,properties:f,cleanup:()=>{St(t.restoreScrollPosition)&&u>0&&window.scrollTo(g,h)}})}else Ym({key:"prevent-scroll",element:c,style:{overflow:"hidden"}})}),be(()=>{!_6(n)||!St(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",o,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),we(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",o),document.removeEventListener("touchmove",l)}))});const o=c=>{r=Zm(c),i=null,s=null},a=c=>{const u=c.target,d=St(t.element),f=O6(c),h=Math.abs(f[0])>Math.abs(f[1])?"x":"y",g=h==="x"?f[0]:f[1],m=ep(u,h,g,d);let p;d&&Ud(d,u)?p=!m:p=!0,p&&c.cancelable&&c.preventDefault()},l=c=>{const u=St(t.element),d=c.target;let f;if(c.touches.length===2)f=!St(t.allowPinchZoom);else{if(i==null||s===null){const h=Zm(c).map((m,p)=>r[p]-m),g=Math.abs(h[0])>Math.abs(h[1])?"x":"y";i=g,s=g==="x"?h[0]:h[1]}if(d.type==="range")f=!1;else{const h=ep(d,i,s,u);u&&Ud(u,d)?f=!h:f=!0}}f&&c.cancelable&&c.preventDefault()}},O6=e=>[e.deltaX,e.deltaY],Zm=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],ep=(e,t,n,r)=>{const i=r!==null&&Ud(r,e),[s,o]=C6(e,t,i?r:void 0);return!(n>0&&Math.abs(s)<=1||n<0&&Math.abs(o)<1)},Ud=(e,t)=>{var r;if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=(r=n._$host)!=null?r:n.parentElement}return!1},E6=k6,A6=E6,J1=pt();function Z1(){return vt(J1)}function mr(){const e=Z1();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var ex=pt();function Yf(){const e=vt(ex);if(e===void 0)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var tx=pt();function Un(){const e=vt(tx);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function Xf(e){let t;const n=Un(),r=mr(),i=Ne({id:n.generateId(`item-${hn()}`)},e),[s,o]=We(i,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=re(),[c,u]=re(),[d,f]=re(),h=()=>r.listState().selectionManager(),g=()=>o.id,m=()=>h().focusedKey()===g(),p=()=>{var O;(O=s.onSelect)==null||O.call(s),s.closeOnSelect&&setTimeout(()=>{r.close(!0)})};I4({getItem:()=>{var O,A,M,D,W;return{ref:()=>t,type:"item",key:g(),textValue:(D=(M=(A=s.textValue)!=null?A:(O=d())==null?void 0:O.textContent)!=null?M:t==null?void 0:t.textContent)!=null?D:"",disabled:(W=s.disabled)!=null?W:!1}}});const v=C1({key:g,selectionManager:h,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>s.disabled},()=>t),b=O=>{tt(O,s.onPointerMove),O.pointerType==="mouse"&&(s.disabled?r.onItemLeave(O):(r.onItemEnter(O),O.defaultPrevented||(Ct(O.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(g()))))},x=O=>{tt(O,s.onPointerLeave),O.pointerType==="mouse"&&r.onItemLeave(O)},C=O=>{tt(O,s.onPointerUp),!s.disabled&&O.button===0&&p()},w=O=>{if(tt(O,s.onKeyDown),!O.repeat&&!s.disabled)switch(O.key){case"Enter":case" ":p();break}},k=H(()=>{if(s.indeterminate)return"mixed";if(s.checked!=null)return s.checked}),S=H(()=>({"data-indeterminate":s.indeterminate?"":void 0,"data-checked":s.checked&&!s.indeterminate?"":void 0,"data-disabled":s.disabled?"":void 0,"data-highlighted":m()?"":void 0})),_={isChecked:()=>s.checked,dataset:S,setLabelRef:f,generateId:La(()=>o.id),registerLabel:fn(l),registerDescription:fn(u)};return T(ex.Provider,{value:_,get children(){return T(rt,ke({as:"div",ref(O){const A=$t(M=>t=M,s.ref);typeof A=="function"&&A(O)},get tabIndex(){return v.tabIndex()},get"aria-checked"(){return k()},get"aria-disabled"(){return s.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return v.dataKey()},get onPointerDown(){return gt([s.onPointerDown,v.onPointerDown])},get onPointerUp(){return gt([C,v.onPointerUp])},get onClick(){return gt([s.onClick,v.onClick])},get onKeyDown(){return gt([w,v.onKeyDown])},get onMouseDown(){return gt([s.onMouseDown,v.onMouseDown])},get onFocus(){return gt([s.onFocus,v.onFocus])},onPointerMove:b,onPointerLeave:x},S,o))}})}function nx(e){const t=Ne({closeOnSelect:!1},e),[n,r]=We(t,["checked","defaultChecked","onChange","onSelect"]),i=E4({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:o=>{var a;return(a=n.onChange)==null?void 0:a.call(n,o)},isDisabled:()=>r.disabled});return T(Xf,ke({role:"menuitemcheckbox",get checked(){return i.isSelected()},onSelect:()=>{var o;(o=n.onSelect)==null||o.call(n),i.toggle()}},r))}var P6=pt();function qc(){return vt(P6)}var la={next:(e,t)=>e==="ltr"?t==="horizontal"?"ArrowRight":"ArrowDown":t==="horizontal"?"ArrowLeft":"ArrowUp",previous:(e,t)=>la.next(e==="ltr"?"rtl":"ltr",t)},tp={first:e=>e==="horizontal"?"ArrowDown":"ArrowRight",last:e=>e==="horizontal"?"ArrowUp":"ArrowLeft"};function rx(e){const t=Un(),n=mr(),r=qc(),{direction:i}=Qr(),s=Ne({id:t.generateId("trigger")},e),[o,a]=We(s,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let l=()=>t.value();r!==void 0&&(l=()=>{var v;return(v=t.value())!=null?v:o.id},r.lastValue()===void 0&&r.setLastValue(l));const c=Rc(()=>n.triggerRef(),()=>"button"),u=H(()=>{var v;return c()==="a"&&((v=n.triggerRef())==null?void 0:v.getAttribute("href"))!=null});be(ur(()=>r==null?void 0:r.value(),v=>{var b;u()&&v===l()&&((b=n.triggerRef())==null||b.focus())}));const d=()=>{r!==void 0?n.isOpen()?r.value()===l()&&r.closeMenu():(r.autoFocusMenu()||r.setAutoFocusMenu(!0),n.open(!1)):n.toggle(!0)},f=v=>{tt(v,o.onPointerDown),v.currentTarget.dataset.pointerType=v.pointerType,!o.disabled&&v.pointerType!=="touch"&&v.button===0&&d()},h=v=>{tt(v,o.onClick),o.disabled||v.currentTarget.dataset.pointerType==="touch"&&d()},g=v=>{if(tt(v,o.onKeyDown),!o.disabled){if(u())switch(v.key){case"Enter":case" ":return}switch(v.key){case"Enter":case" ":case tp.first(t.orientation()):v.stopPropagation(),v.preventDefault(),b4(v.currentTarget),n.open("first"),r==null||r.setAutoFocusMenu(!0),r==null||r.setValue(l);break;case tp.last(t.orientation()):v.stopPropagation(),v.preventDefault(),n.open("last");break;case la.next(i(),t.orientation()):if(r===void 0)break;v.stopPropagation(),v.preventDefault(),r.nextMenu();break;case la.previous(i(),t.orientation()):if(r===void 0)break;v.stopPropagation(),v.preventDefault(),r.previousMenu();break}}},m=v=>{var b;tt(v,o.onMouseOver),((b=n.triggerRef())==null?void 0:b.dataset.pointerType)!=="touch"&&!o.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(l)},p=v=>{tt(v,o.onFocus),r!==void 0&&v.currentTarget.dataset.pointerType!=="touch"&&r.setValue(l)};return be(()=>we(n.registerTriggerId(o.id))),T(qf,ke({ref(v){const b=$t(n.setTriggerRef,o.ref);typeof b=="function"&&b(v)},get"data-kb-menu-value-trigger"(){return t.value()},get id(){return o.id},get disabled(){return o.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return H(()=>!!n.isOpen())()?n.contentId():void 0},get"data-highlighted"(){return l()!==void 0&&(r==null?void 0:r.value())===l()?!0:void 0},get tabIndex(){return r!==void 0?r.value()===l()||r.lastValue()===l()?0:-1:void 0},onPointerDown:f,onMouseOver:m,onClick:h,onKeyDown:g,onFocus:p,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),a))}var T6=pt();function ix(){return vt(T6)}function sx(e){let t;const n=Un(),r=mr(),i=qc(),s=ix(),{direction:o}=Qr(),a=Ne({id:n.generateId(`content-${hn()}`)},e),[l,c]=We(a,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let u=0;const d=()=>r.parentMenuContext()==null&&i===void 0&&n.isModal(),f=y6({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused(),orientation:()=>n.orientation()==="horizontal"?"vertical":"horizontal"},()=>t);m6({trapFocus:()=>d()&&r.isOpen(),onMountAutoFocus:x=>{var C;i===void 0&&((C=l.onOpenAutoFocus)==null||C.call(l,x))},onUnmountAutoFocus:l.onCloseAutoFocus},()=>t);const h=x=>{if(dn(x.currentTarget,x.target)&&(x.key==="Tab"&&r.isOpen()&&x.preventDefault(),i!==void 0&&x.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(x.key){case la.next(o(),n.orientation()):x.stopPropagation(),x.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.nextMenu();break;case la.previous(o(),n.orientation()):if(x.currentTarget.hasAttribute("data-closed"))break;x.stopPropagation(),x.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.previousMenu();break}},g=x=>{var C;(C=l.onEscapeKeyDown)==null||C.call(l,x),i==null||i.setAutoFocusMenu(!1),r.close(!0)},m=x=>{var C;(C=l.onFocusOutside)==null||C.call(l,x),n.isModal()&&x.preventDefault()},p=x=>{var C,w;tt(x,l.onPointerEnter),r.isOpen()&&((C=r.parentMenuContext())==null||C.listState().selectionManager().setFocused(!1),(w=r.parentMenuContext())==null||w.listState().selectionManager().setFocusedKey(void 0))},v=x=>{if(tt(x,l.onPointerMove),x.pointerType!=="mouse")return;const C=x.target,w=u!==x.clientX;dn(x.currentTarget,C)&&w&&(r.setPointerDir(x.clientX>u?"right":"left"),u=x.clientX)};be(()=>we(r.registerContentId(l.id)));const b={ref:$t(x=>{r.setContentRef(x),t=x},l.ref),role:"menu",get id(){return l.id},get tabIndex(){return f.tabIndex()},get"aria-labelledby"(){return r.triggerId()},onKeyDown:gt([l.onKeyDown,f.onKeyDown,h]),onMouseDown:gt([l.onMouseDown,f.onMouseDown]),onFocusIn:gt([l.onFocusIn,f.onFocusIn]),onFocusOut:gt([l.onFocusOut,f.onFocusOut]),onPointerEnter:p,onPointerMove:v,get"data-orientation"(){return n.orientation()}};return T(pe,{get when(){return r.contentPresent()},get children(){return T(pe,{get when(){return s===void 0||r.parentMenuContext()!=null},get fallback(){return T(rt,ke({as:"div"},()=>r.dataset(),b,c))},get children(){return T(F1.Positioner,{get children(){return T(f6,ke({get disableOutsidePointerEvents(){return H(()=>!!d())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return Lc({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},l.style)},onEscapeKeyDown:g,onFocusOutside:m,get onDismiss(){return r.close}},()=>r.dataset(),b,c))}})}})}})}function M6(e){let t;const n=Un(),r=mr(),[i,s]=We(e,["ref"]);return A6({element:()=>t!=null?t:null,enabled:()=>r.contentPresent()&&n.preventScroll()}),T(sx,ke({ref(o){const a=$t(l=>{t=l},i.ref);typeof a=="function"&&a(o)}},s))}var ox=pt();function $6(){const e=vt(ox);if(e===void 0)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}function Jf(e){const t=Un(),n=Ne({id:t.generateId(`group-${hn()}`)},e),[r,i]=re(),s={generateId:La(()=>n.id),registerLabelId:fn(i)};return T(ox.Provider,{value:s,get children(){return T(rt,ke({as:"div",role:"group",get"aria-labelledby"(){return r()}},n))}})}function ax(e){const t=$6(),n=Ne({id:t.generateId("label")},e),[r,i]=We(n,["id"]);return be(()=>we(t.registerLabelId(r.id))),T(rt,ke({as:"span",get id(){return r.id},"aria-hidden":"true"},i))}function lx(e){const t=mr(),n=Ne({children:"▼"},e);return T(rt,ke({as:"span","aria-hidden":"true"},()=>t.dataset(),n))}function cx(e){return T(Xf,ke({role:"menuitem",closeOnSelect:!0},e))}function ux(e){const t=Yf(),n=Ne({id:t.generateId("description")},e),[r,i]=We(n,["id"]);return be(()=>we(t.registerDescription(r.id))),T(rt,ke({as:"div",get id(){return r.id}},()=>t.dataset(),i))}function dx(e){const t=Yf(),n=Ne({id:t.generateId("indicator")},e),[r,i]=We(n,["forceMount"]);return T(pe,{get when(){return r.forceMount||t.isChecked()},get children(){return T(rt,ke({as:"div"},()=>t.dataset(),i))}})}function fx(e){const t=Yf(),n=Ne({id:t.generateId("label")},e),[r,i]=We(n,["ref","id"]);return be(()=>we(t.registerLabel(r.id))),T(rt,ke({as:"div",ref(s){const o=$t(t.setLabelRef,r.ref);typeof o=="function"&&o(s)},get id(){return r.id}},()=>t.dataset(),i))}function hx(e){const t=mr();return T(pe,{get when(){return t.contentPresent()},get children(){return T(B0,e)}})}var gx=pt();function j6(){const e=vt(gx);if(e===void 0)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}function yx(e){const n=Un().generateId(`radiogroup-${hn()}`),r=Ne({id:n},e),[i,s]=We(r,["value","defaultValue","onChange","disabled"]),[o,a]=Ra({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:c=>{var u;return(u=i.onChange)==null?void 0:u.call(i,c)}}),l={isDisabled:()=>i.disabled,isSelectedValue:c=>c===o(),setSelectedValue:a};return T(gx.Provider,{value:l,get children(){return T(Jf,s)}})}function mx(e){const t=j6(),n=Ne({closeOnSelect:!1},e),[r,i]=We(n,["value","onSelect"]);return T(Xf,ke({role:"menuitemradio",get checked(){return t.isSelectedValue(r.value)},onSelect:()=>{var o;(o=r.onSelect)==null||o.call(r),t.setSelectedValue(r.value)}},i))}function D6(e,t,n){const r=e.split("-")[0],i=n.getBoundingClientRect(),s=[],o=t.clientX,a=t.clientY;switch(r){case"top":s.push([o,a+5]),s.push([i.left,i.bottom]),s.push([i.left,i.top]),s.push([i.right,i.top]),s.push([i.right,i.bottom]);break;case"right":s.push([o-5,a]),s.push([i.left,i.top]),s.push([i.right,i.top]),s.push([i.right,i.bottom]),s.push([i.left,i.bottom]);break;case"bottom":s.push([o,a-5]),s.push([i.right,i.top]),s.push([i.right,i.bottom]),s.push([i.left,i.bottom]),s.push([i.left,i.top]);break;case"left":s.push([o+5,a]),s.push([i.right,i.bottom]),s.push([i.left,i.bottom]),s.push([i.left,i.top]),s.push([i.right,i.top]);break}return s}function L6(e,t){return t?v4([e.clientX,e.clientY],t):!1}function px(e){const t=Un(),n=m1(),r=Z1(),i=qc(),s=ix(),o=Ne({placement:t.orientation()==="horizontal"?"bottom-start":"right-start"},e),[a,l]=We(o,["open","defaultOpen","onOpenChange"]);let c=0,u=null,d="right";const[f,h]=re(),[g,m]=re(),[p,v]=re(),[b,x]=re(),[C,w]=re(!0),[k,S]=re(l.placement),[_,O]=re([]),[A,M]=re([]),{DomCollectionProvider:D}=L4({items:A,onItemsChange:M}),W=B1({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:V=>{var fe;return(fe=a.onOpenChange)==null?void 0:fe.call(a,V)}}),{present:R}=_1({show:()=>t.forceMount()||W.isOpen(),element:()=>{var V;return(V=b())!=null?V:null}}),L=Z4({selectionMode:"none",dataSource:A}),j=V=>{w(V),W.open()},I=(V=!1)=>{W.close(),V&&r&&r.close(!0)},oe=V=>{w(V),W.toggle()},ue=()=>{const V=b();V&&(Ct(V),L.selectionManager().setFocused(!0),L.selectionManager().setFocusedKey(void 0))},B=()=>{s!=null?setTimeout(()=>ue()):ue()},Y=V=>{O(he=>[...he,V]);const fe=r==null?void 0:r.registerNestedMenu(V);return()=>{O(he=>Rd(he,V)),fe==null||fe()}},ne=V=>d===(u==null?void 0:u.side)&&L6(V,u==null?void 0:u.area),ae=V=>{ne(V)&&V.preventDefault()},F=V=>{ne(V)||B()},G=V=>{ne(V)&&V.preventDefault()};v6({isDisabled:()=>!(r==null&&W.isOpen()&&t.isModal()),targets:()=>[b(),..._()].filter(Boolean)}),be(()=>{const V=b();if(!V||!r)return;const fe=r.registerNestedMenu(V);we(()=>{fe()})}),be(()=>{r===void 0&&(i==null||i.registerMenu(t.value(),[b(),..._()]))}),be(()=>{var V;r!==void 0||i===void 0||(i.value()===t.value()?((V=p())==null||V.focus(),i.autoFocusMenu()&&j(!0)):I())}),be(()=>{r!==void 0||i===void 0||W.isOpen()&&i.setValue(t.value())}),we(()=>{r===void 0&&(i==null||i.unregisterMenu(t.value()))});const ce={dataset:H(()=>({"data-expanded":W.isOpen()?"":void 0,"data-closed":W.isOpen()?void 0:""})),isOpen:W.isOpen,contentPresent:R,nestedMenus:_,currentPlacement:k,pointerGraceTimeoutId:()=>c,autoFocus:C,listState:()=>L,parentMenuContext:()=>r,triggerRef:p,contentRef:b,triggerId:f,contentId:g,setTriggerRef:v,setContentRef:x,open:j,close:I,toggle:oe,focusContent:B,onItemEnter:ae,onItemLeave:F,onTriggerLeave:G,setPointerDir:V=>d=V,setPointerGraceTimeoutId:V=>c=V,setPointerGraceIntent:V=>u=V,registerNestedMenu:Y,registerItemToParentDomCollection:n==null?void 0:n.registerItem,registerTriggerId:fn(h),registerContentId:fn(m)};return T(D,{get children(){return T(J1.Provider,{value:ce,get children(){return T(pe,{when:s===void 0,get fallback(){return l.children},get children(){return T(F1,ke({anchorRef:p,contentRef:b,onCurrentPlacementChange:S},l))}})}})}})}function vx(e){const{direction:t}=Qr();return T(px,ke({get placement(){return t()==="rtl"?"left-start":"right-start"},flip:!0},e))}var I6={close:(e,t)=>e==="ltr"?[t==="horizontal"?"ArrowLeft":"ArrowUp"]:[t==="horizontal"?"ArrowRight":"ArrowDown"]};function bx(e){const t=mr(),n=Un(),[r,i]=We(e,["onFocusOutside","onKeyDown"]),{direction:s}=Qr();return T(sx,ke({onOpenAutoFocus:u=>{u.preventDefault()},onCloseAutoFocus:u=>{u.preventDefault()},onFocusOutside:u=>{var f;(f=r.onFocusOutside)==null||f.call(r,u);const d=u.target;dn(t.triggerRef(),d)||t.close()},onKeyDown:u=>{tt(u,r.onKeyDown);const d=dn(u.currentTarget,u.target),f=I6.close(s(),n.orientation()).includes(u.key),h=t.parentMenuContext()!=null;d&&f&&h&&(t.close(),Ct(t.triggerRef()))}},i))}var np=["Enter"," "],R6={open:(e,t)=>e==="ltr"?[...np,t==="horizontal"?"ArrowRight":"ArrowDown"]:[...np,t==="horizontal"?"ArrowLeft":"ArrowUp"]};function xx(e){let t;const n=Un(),r=mr(),i=Ne({id:n.generateId(`sub-trigger-${hn()}`)},e),[s,o]=We(i,["ref","id","textValue","disabled","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);let a=null;const l=()=>{a&&window.clearTimeout(a),a=null},{direction:c}=Qr(),u=()=>s.id,d=()=>{const x=r.parentMenuContext();if(x==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return x.listState().selectionManager()},f=()=>r.listState().collection(),h=()=>d().focusedKey()===u(),g=C1({key:u,selectionManager:d,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>s.disabled},()=>t),m=x=>{tt(x,s.onClick),!r.isOpen()&&!s.disabled&&r.open(!0)},p=x=>{var w;if(tt(x,s.onPointerMove),x.pointerType!=="mouse")return;const C=r.parentMenuContext();if(C==null||C.onItemEnter(x),!x.defaultPrevented){if(s.disabled){C==null||C.onItemLeave(x);return}!r.isOpen()&&!a&&((w=r.parentMenuContext())==null||w.setPointerGraceIntent(null),a=window.setTimeout(()=>{r.open(!1),l()},100)),C==null||C.onItemEnter(x),x.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),Ct(x.currentTarget),C==null||C.listState().selectionManager().setFocused(!0),C==null||C.listState().selectionManager().setFocusedKey(u()))}},v=x=>{if(tt(x,s.onPointerLeave),x.pointerType!=="mouse")return;l();const C=r.parentMenuContext(),w=r.contentRef();if(w){C==null||C.setPointerGraceIntent({area:D6(r.currentPlacement(),x,w),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(C==null?void 0:C.pointerGraceTimeoutId());const k=window.setTimeout(()=>{C==null||C.setPointerGraceIntent(null)},300);C==null||C.setPointerGraceTimeoutId(k)}else{if(C==null||C.onTriggerLeave(x),x.defaultPrevented)return;C==null||C.setPointerGraceIntent(null)}C==null||C.onItemLeave(x)},b=x=>{tt(x,s.onKeyDown),!x.repeat&&(s.disabled||R6.open(c(),n.orientation()).includes(x.key)&&(x.stopPropagation(),x.preventDefault(),d().setFocused(!1),d().setFocusedKey(void 0),r.isOpen()||r.open("first"),r.focusContent(),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(f().getFirstKey())))};return be(()=>{var C,w,k;if(r.registerItemToParentDomCollection==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");const x=r.registerItemToParentDomCollection({ref:()=>t,type:"item",key:u(),textValue:(w=(C=s.textValue)!=null?C:t==null?void 0:t.textContent)!=null?w:"",disabled:(k=s.disabled)!=null?k:!1});we(x)}),be(ur(()=>{var x;return(x=r.parentMenuContext())==null?void 0:x.pointerGraceTimeoutId()},x=>{we(()=>{var C;window.clearTimeout(x),(C=r.parentMenuContext())==null||C.setPointerGraceIntent(null)})})),be(()=>we(r.registerTriggerId(s.id))),we(()=>{l()}),T(rt,ke({as:"div",ref(x){const C=$t(w=>{r.setTriggerRef(w),t=w},s.ref);typeof C=="function"&&C(x)},get id(){return s.id},role:"menuitem",get tabIndex(){return g.tabIndex()},"aria-haspopup":"true",get"aria-expanded"(){return r.isOpen()},get"aria-controls"(){return H(()=>!!r.isOpen())()?r.contentId():void 0},get"aria-disabled"(){return s.disabled},get"data-key"(){return g.dataKey()},get"data-highlighted"(){return h()?"":void 0},get"data-disabled"(){return s.disabled?"":void 0},get onPointerDown(){return gt([s.onPointerDown,g.onPointerDown])},get onPointerUp(){return gt([s.onPointerUp,g.onPointerUp])},get onClick(){return gt([m,g.onClick])},get onKeyDown(){return gt([b,g.onKeyDown])},get onMouseDown(){return gt([s.onMouseDown,g.onMouseDown])},get onFocus(){return gt([s.onFocus,g.onFocus])},onPointerMove:p,onPointerLeave:v},()=>r.dataset(),o))}function F6(e){const t=qc(),n=`menu-${hn()}`,r=Ne({id:n,modal:!0},e),[i,s]=We(r,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),o=B1({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:l=>{var c;return(c=i.onOpenChange)==null?void 0:c.call(i,l)}}),a={isModal:()=>{var l;return(l=i.modal)!=null?l:!0},preventScroll:()=>{var l;return(l=i.preventScroll)!=null?l:a.isModal()},forceMount:()=>{var l;return(l=i.forceMount)!=null?l:!1},generateId:La(()=>i.id),value:()=>i.value,orientation:()=>{var l,c;return(c=(l=i.orientation)!=null?l:t==null?void 0:t.orientation())!=null?c:"horizontal"}};return T(tx.Provider,{value:a,get children(){return T(px,ke({get open(){return o.isOpen()},get onOpenChange(){return o.setIsOpen}},s))}})}var N6={};Fc(N6,{Root:()=>zc,Separator:()=>B6});function zc(e){let t;const n=Ne({orientation:"horizontal"},e),[r,i]=We(n,["ref","orientation"]),s=Rc(()=>t,()=>"hr");return T(rt,ke({as:"hr",ref(o){const a=$t(l=>t=l,r.ref);typeof a=="function"&&a(o)},get role(){return s()!=="hr"?"separator":void 0},get"aria-orientation"(){return r.orientation==="vertical"?"vertical":void 0},get"data-orientation"(){return r.orientation}},i))}var B6=zc,ct={};Fc(ct,{Arrow:()=>Qf,CheckboxItem:()=>nx,Content:()=>wx,DropdownMenu:()=>q6,Group:()=>Jf,GroupLabel:()=>ax,Icon:()=>lx,Item:()=>cx,ItemDescription:()=>ux,ItemIndicator:()=>dx,ItemLabel:()=>fx,Portal:()=>hx,RadioGroup:()=>yx,RadioItem:()=>mx,Root:()=>Sx,Separator:()=>zc,Sub:()=>vx,SubContent:()=>bx,SubTrigger:()=>xx,Trigger:()=>rx});function wx(e){const t=Un(),n=mr(),[r,i]=We(e,["onCloseAutoFocus","onInteractOutside"]);let s=!1;return T(M6,ke({onCloseAutoFocus:l=>{var c;(c=r.onCloseAutoFocus)==null||c.call(r,l),s||Ct(n.triggerRef()),s=!1,l.preventDefault()},onInteractOutside:l=>{var c;(c=r.onInteractOutside)==null||c.call(r,l),(!t.isModal()||l.detail.isContextMenu)&&(s=!0)}},i))}function Sx(e){const t=`dropdownmenu-${hn()}`,n=Ne({id:t},e);return T(F6,n)}var q6=Object.assign(Sx,{Arrow:Qf,CheckboxItem:nx,Content:wx,Group:Jf,GroupLabel:ax,Icon:lx,Item:cx,ItemDescription:ux,ItemIndicator:dx,ItemLabel:fx,Portal:hx,RadioGroup:yx,RadioItem:mx,Separator:zc,Sub:vx,SubContent:bx,SubTrigger:xx,Trigger:rx}),U={colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000000",white:"#ffffff",neutral:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},darkGray:{50:"#525c7a",100:"#49536e",200:"#414962",300:"#394056",400:"#313749",500:"#292e3d",600:"#212530",700:"#191c24",800:"#111318",900:"#0b0d10"},gray:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},blue:{25:"#F5FAFF",50:"#EFF8FF",100:"#D1E9FF",200:"#B2DDFF",300:"#84CAFF",400:"#53B1FD",500:"#2E90FA",600:"#1570EF",700:"#175CD3",800:"#1849A9",900:"#194185"},green:{25:"#F6FEF9",50:"#ECFDF3",100:"#D1FADF",200:"#A6F4C5",300:"#6CE9A6",400:"#32D583",500:"#12B76A",600:"#039855",700:"#027A48",800:"#05603A",900:"#054F31"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},yellow:{25:"#FFFCF5",50:"#FFFAEB",100:"#FEF0C7",200:"#FEDF89",300:"#FEC84B",400:"#FDB022",500:"#F79009",600:"#DC6803",700:"#B54708",800:"#93370D",900:"#7A2E0E"},purple:{25:"#FAFAFF",50:"#F4F3FF",100:"#EBE9FE",200:"#D9D6FE",300:"#BDB4FE",400:"#9B8AFB",500:"#7A5AF8",600:"#6938EF",700:"#5925DC",800:"#4A1FB8",900:"#3E1C96"},teal:{25:"#F6FEFC",50:"#F0FDF9",100:"#CCFBEF",200:"#99F6E0",300:"#5FE9D0",400:"#2ED3B7",500:"#15B79E",600:"#0E9384",700:"#107569",800:"#125D56",900:"#134E48"},pink:{25:"#fdf2f8",50:"#fce7f3",100:"#fbcfe8",200:"#f9a8d4",300:"#f472b6",400:"#ec4899",500:"#db2777",600:"#be185d",700:"#9d174d",800:"#831843",900:"#500724"},cyan:{25:"#ecfeff",50:"#cffafe",100:"#a5f3fc",200:"#67e8f9",300:"#22d3ee",400:"#06b6d4",500:"#0891b2",600:"#0e7490",700:"#155e75",800:"#164e63",900:"#083344"}},alpha:{90:"e5",80:"cc"},font:{size:{xs:"calc(var(--tsqd-font-size) * 0.75)",sm:"calc(var(--tsqd-font-size) * 0.875)",md:"var(--tsqd-font-size)"},lineHeight:{xs:"calc(var(--tsqd-font-size) * 1)",sm:"calc(var(--tsqd-font-size) * 1.25)",md:"calc(var(--tsqd-font-size) * 1.5)"},weight:{medium:"500",semibold:"600",bold:"700"}},border:{radius:{xs:"calc(var(--tsqd-font-size) * 0.125)",sm:"calc(var(--tsqd-font-size) * 0.25)",full:"9999px"}},size:{.25:"calc(var(--tsqd-font-size) * 0.0625)",.5:"calc(var(--tsqd-font-size) * 0.125)",1:"calc(var(--tsqd-font-size) * 0.25)",1.5:"calc(var(--tsqd-font-size) * 0.375)",2:"calc(var(--tsqd-font-size) * 0.5)",2.5:"calc(var(--tsqd-font-size) * 0.625)",3:"calc(var(--tsqd-font-size) * 0.75)",3.5:"calc(var(--tsqd-font-size) * 0.875)",4:"calc(var(--tsqd-font-size) * 1)",4.5:"calc(var(--tsqd-font-size) * 1.125)",5:"calc(var(--tsqd-font-size) * 1.25)",6:"calc(var(--tsqd-font-size) * 1.5)",6.5:"calc(var(--tsqd-font-size) * 1.625)",14:"calc(var(--tsqd-font-size) * 3.5)"},shadow:{xs:(e="rgb(0 0 0 / 0.1)")=>"0 1px 2px 0 rgb(0 0 0 / 0.05)",sm:(e="rgb(0 0 0 / 0.1)")=>`0 1px 3px 0 ${e}, 0 1px 2px -1px ${e}`,md:(e="rgb(0 0 0 / 0.1)")=>`0 4px 6px -1px ${e}, 0 2px 4px -2px ${e}`,lg:(e="rgb(0 0 0 / 0.1)")=>`0 10px 15px -3px ${e}, 0 4px 6px -4px ${e}`,xl:(e="rgb(0 0 0 / 0.1)")=>`0 20px 25px -5px ${e}, 0 8px 10px -6px ${e}`,"2xl":(e="rgb(0 0 0 / 0.25)")=>`0 25px 50px -12px ${e}`,inner:(e="rgb(0 0 0 / 0.05)")=>`inset 0 2px 4px 0 ${e}`,none:()=>"none"}},z6=le('<svg width=14 height=14 viewBox="0 0 14 14"fill=none xmlns=http://www.w3.org/2000/svg><path d="M13 13L9.00007 9M10.3333 5.66667C10.3333 8.244 8.244 10.3333 5.66667 10.3333C3.08934 10.3333 1 8.244 1 5.66667C1 3.08934 3.08934 1 5.66667 1C8.244 1 10.3333 3.08934 10.3333 5.66667Z"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),H6=le('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9 3H15M3 6H21M19 6L18.2987 16.5193C18.1935 18.0975 18.1409 18.8867 17.8 19.485C17.4999 20.0118 17.0472 20.4353 16.5017 20.6997C15.882 21 15.0911 21 13.5093 21H10.4907C8.90891 21 8.11803 21 7.49834 20.6997C6.95276 20.4353 6.50009 20.0118 6.19998 19.485C5.85911 18.8867 5.8065 18.0975 5.70129 16.5193L5 6M10 10.5V15.5M14 10.5V15.5"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),U6=le('<svg width=10 height=6 viewBox="0 0 10 6"fill=none xmlns=http://www.w3.org/2000/svg><path d="M1 1L5 5L9 1"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),K6=le('<svg width=12 height=12 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 13.3333V2.66667M8 2.66667L4 6.66667M8 2.66667L12 6.66667"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),Zf=le('<svg width=12 height=12 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 2.66667V13.3333M8 13.3333L4 9.33333M8 13.3333L12 9.33333"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),V6=le('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M12 2v2m0 16v2M4 12H2m4.314-5.686L4.9 4.9m12.786 1.414L19.1 4.9M6.314 17.69 4.9 19.104m12.786-1.414 1.414 1.414M22 12h-2m-3 0a5 5 0 1 1-10 0 5 5 0 0 1 10 0Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),W6=le('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M22 15.844a10.424 10.424 0 0 1-4.306.925c-5.779 0-10.463-4.684-10.463-10.462 0-1.536.33-2.994.925-4.307A10.464 10.464 0 0 0 2 11.538C2 17.316 6.684 22 12.462 22c4.243 0 7.896-2.526 9.538-6.156Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),G6=le('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 21h8m-4-4v4m-5.2-4h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 14.72 22 13.88 22 12.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 3 18.88 3 17.2 3H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 5.28 2 6.12 2 7.8v4.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 17 5.12 17 6.8 17Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),Q6=le('<svg stroke=currentColor fill=currentColor stroke-width=0 viewBox="0 0 24 24"height=1em width=1em xmlns=http://www.w3.org/2000/svg><path fill=none d="M0 0h24v24H0z"></path><path d="M1 9l2 2c4.97-4.97 13.03-4.97 18 0l2-2C16.93 2.93 7.08 2.93 1 9zm8 8l3 3 3-3a4.237 4.237 0 00-6 0zm-4-4l2 2a7.074 7.074 0 0110 0l2-2C15.14 9.14 8.87 9.14 5 13z">'),Y6=le('<svg stroke-width=0 viewBox="0 0 24 24"height=1em width=1em xmlns=http://www.w3.org/2000/svg><path fill=none d="M24 .01c0-.01 0-.01 0 0L0 0v24h24V.01zM0 0h24v24H0V0zm0 0h24v24H0V0z"></path><path d="M22.99 9C19.15 5.16 13.8 3.76 8.84 4.78l2.52 2.52c3.47-.17 6.99 1.05 9.63 3.7l2-2zm-4 4a9.793 9.793 0 00-4.49-2.56l3.53 3.53.96-.97zM2 3.05L5.07 6.1C3.6 6.82 2.22 7.78 1 9l1.99 2c1.24-1.24 2.67-2.16 4.2-2.77l2.24 2.24A9.684 9.684 0 005 13v.01L6.99 15a7.042 7.042 0 014.92-2.06L18.98 20l1.27-1.26L3.29 1.79 2 3.05zM9 17l3 3 3-3a4.237 4.237 0 00-6 0z">'),X6=le('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9.3951 19.3711L9.97955 20.6856C10.1533 21.0768 10.4368 21.4093 10.7958 21.6426C11.1547 21.8759 11.5737 22.0001 12.0018 22C12.4299 22.0001 12.8488 21.8759 13.2078 21.6426C13.5667 21.4093 13.8503 21.0768 14.024 20.6856L14.6084 19.3711C14.8165 18.9047 15.1664 18.5159 15.6084 18.26C16.0532 18.0034 16.5678 17.8941 17.0784 17.9478L18.5084 18.1C18.9341 18.145 19.3637 18.0656 19.7451 17.8713C20.1265 17.6771 20.4434 17.3763 20.6573 17.0056C20.8715 16.635 20.9735 16.2103 20.9511 15.7829C20.9286 15.3555 20.7825 14.9438 20.5307 14.5978L19.684 13.4344C19.3825 13.0171 19.2214 12.5148 19.224 12C19.2239 11.4866 19.3865 10.9864 19.6884 10.5711L20.5351 9.40778C20.787 9.06175 20.933 8.65007 20.9555 8.22267C20.978 7.79528 20.8759 7.37054 20.6618 7C20.4479 6.62923 20.131 6.32849 19.7496 6.13423C19.3681 5.93997 18.9386 5.86053 18.5129 5.90556L17.0829 6.05778C16.5722 6.11141 16.0577 6.00212 15.6129 5.74556C15.17 5.48825 14.82 5.09736 14.6129 4.62889L14.024 3.31444C13.8503 2.92317 13.5667 2.59072 13.2078 2.3574C12.8488 2.12408 12.4299 1.99993 12.0018 2C11.5737 1.99993 11.1547 2.12408 10.7958 2.3574C10.4368 2.59072 10.1533 2.92317 9.97955 3.31444L9.3951 4.62889C9.18803 5.09736 8.83798 5.48825 8.3951 5.74556C7.95032 6.00212 7.43577 6.11141 6.9251 6.05778L5.49066 5.90556C5.06499 5.86053 4.6354 5.93997 4.25397 6.13423C3.87255 6.32849 3.55567 6.62923 3.34177 7C3.12759 7.37054 3.02555 7.79528 3.04804 8.22267C3.07052 8.65007 3.21656 9.06175 3.46844 9.40778L4.3151 10.5711C4.61704 10.9864 4.77964 11.4866 4.77955 12C4.77964 12.5134 4.61704 13.0137 4.3151 13.4289L3.46844 14.5922C3.21656 14.9382 3.07052 15.3499 3.04804 15.7773C3.02555 16.2047 3.12759 16.6295 3.34177 17C3.55589 17.3706 3.8728 17.6712 4.25417 17.8654C4.63554 18.0596 5.06502 18.1392 5.49066 18.0944L6.92066 17.9422C7.43133 17.8886 7.94587 17.9979 8.39066 18.2544C8.83519 18.511 9.18687 18.902 9.3951 19.3711Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round></path><path d="M12 15C13.6568 15 15 13.6569 15 12C15 10.3431 13.6568 9 12 9C10.3431 9 8.99998 10.3431 8.99998 12C8.99998 13.6569 10.3431 15 12 15Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),J6=le('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M16 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V8M11.5 12.5L17 7M17 7H12M17 7V12M6.2 21H8.8C9.9201 21 10.4802 21 10.908 20.782C11.2843 20.5903 11.5903 20.2843 11.782 19.908C12 19.4802 12 18.9201 12 17.8V15.2C12 14.0799 12 13.5198 11.782 13.092C11.5903 12.7157 11.2843 12.4097 10.908 12.218C10.4802 12 9.92011 12 8.8 12H6.2C5.0799 12 4.51984 12 4.09202 12.218C3.71569 12.4097 3.40973 12.7157 3.21799 13.092C3 13.5198 3 14.0799 3 15.2V17.8C3 18.9201 3 19.4802 3.21799 19.908C3.40973 20.2843 3.71569 20.5903 4.09202 20.782C4.51984 21 5.07989 21 6.2 21Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),Z6=le('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path class=copier d="M8 8V5.2C8 4.0799 8 3.51984 8.21799 3.09202C8.40973 2.71569 8.71569 2.40973 9.09202 2.21799C9.51984 2 10.0799 2 11.2 2H18.8C19.9201 2 20.4802 2 20.908 2.21799C21.2843 2.40973 21.5903 2.71569 21.782 3.09202C22 3.51984 22 4.0799 22 5.2V12.8C22 13.9201 22 14.4802 21.782 14.908C21.5903 15.2843 21.2843 15.5903 20.908 15.782C20.4802 16 19.9201 16 18.8 16H16M5.2 22H12.8C13.9201 22 14.4802 22 14.908 21.782C15.2843 21.5903 15.5903 21.2843 15.782 20.908C16 20.4802 16 19.9201 16 18.8V11.2C16 10.0799 16 9.51984 15.782 9.09202C15.5903 8.71569 15.2843 8.40973 14.908 8.21799C14.4802 8 13.9201 8 12.8 8H5.2C4.0799 8 3.51984 8 3.09202 8.21799C2.71569 8.40973 2.40973 8.71569 2.21799 9.09202C2 9.51984 2 10.0799 2 11.2V18.8C2 19.9201 2 20.4802 2.21799 20.908C2.40973 21.2843 2.71569 21.5903 3.09202 21.782C3.51984 22 4.07989 22 5.2 22Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round stroke=currentColor>'),eL=le('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M2.5 21.4998L8.04927 19.3655C8.40421 19.229 8.58168 19.1607 8.74772 19.0716C8.8952 18.9924 9.0358 18.901 9.16804 18.7984C9.31692 18.6829 9.45137 18.5484 9.72028 18.2795L21 6.99982C22.1046 5.89525 22.1046 4.10438 21 2.99981C19.8955 1.89525 18.1046 1.89524 17 2.99981L5.72028 14.2795C5.45138 14.5484 5.31692 14.6829 5.20139 14.8318C5.09877 14.964 5.0074 15.1046 4.92823 15.2521C4.83911 15.4181 4.77085 15.5956 4.63433 15.9506L2.5 21.4998ZM2.5 21.4998L4.55812 16.1488C4.7054 15.7659 4.77903 15.5744 4.90534 15.4867C5.01572 15.4101 5.1523 15.3811 5.2843 15.4063C5.43533 15.4351 5.58038 15.5802 5.87048 15.8703L8.12957 18.1294C8.41967 18.4195 8.56472 18.5645 8.59356 18.7155C8.61877 18.8475 8.58979 18.9841 8.51314 19.0945C8.42545 19.2208 8.23399 19.2944 7.85107 19.4417L2.5 21.4998Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),Cx=le('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M7.5 12L10.5 15L16.5 9M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),tL=le('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9 9L15 15M15 9L9 15M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z"stroke=#F04438 stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),nL=le('<svg width=24 height=24 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 xmlns=http://www.w3.org/2000/svg><rect class=list width=20 height=20 y=2 x=2 rx=2></rect><line class=list-item y1=7 y2=7 x1=6 x2=18></line><line class=list-item y2=12 y1=12 x1=6 x2=18></line><line class=list-item y1=17 y2=17 x1=6 x2=18>'),rL=le('<svg viewBox="0 0 24 24"height=20 width=20 fill=none xmlns=http://www.w3.org/2000/svg><path d="M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),iL=le('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M7.5 12L10.5 15L16.5 9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),sL=le('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M12 2V6M12 18V22M6 12H2M22 12H18M19.0784 19.0784L16.25 16.25M19.0784 4.99994L16.25 7.82837M4.92157 19.0784L7.75 16.25M4.92157 4.99994L7.75 7.82837"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round></path><animateTransform attributeName=transform attributeType=XML type=rotate from=0 to=360 dur=2s repeatCount=indefinite>'),oL=le('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M15 9L9 15M9 9L15 15M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),aL=le('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9.5 15V9M14.5 15V9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),lL=le('<svg version=1.0 viewBox="0 0 633 633"><linearGradient x1=-666.45 x2=-666.45 y1=163.28 y2=163.99 gradientTransform="matrix(633 0 0 633 422177 -103358)"gradientUnits=userSpaceOnUse><stop stop-color=#6BDAFF offset=0></stop><stop stop-color=#F9FFB5 offset=.32></stop><stop stop-color=#FFA770 offset=.71></stop><stop stop-color=#FF7373 offset=1></stop></linearGradient><circle cx=316.5 cy=316.5 r=316.5></circle><defs><filter x=-137.5 y=412 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=412 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=610.5 rx=214.5 ry=186 fill=#015064 stroke=#00CFE2 stroke-width=25></ellipse></g><defs><filter x=316.5 y=412 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=412 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=610.5 rx=214.5 ry=186 fill=#015064 stroke=#00CFE2 stroke-width=25></ellipse></g><defs><filter x=-137.5 y=450 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=450 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=648.5 rx=214.5 ry=186 fill=#015064 stroke=#00A8B8 stroke-width=25></ellipse></g><defs><filter x=316.5 y=450 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=450 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=648.5 rx=214.5 ry=186 fill=#015064 stroke=#00A8B8 stroke-width=25></ellipse></g><defs><filter x=-137.5 y=486 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=486 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=684.5 rx=214.5 ry=186 fill=#015064 stroke=#007782 stroke-width=25></ellipse></g><defs><filter x=316.5 y=486 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=486 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=684.5 rx=214.5 ry=186 fill=#015064 stroke=#007782 stroke-width=25></ellipse></g><defs><filter x=272.2 y=308 width=176.9 height=129.3 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=272.2 y=308 width=176.9 height=129.3 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><line x1=436 x2=431 y1=403.2 y2=431.8 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><line x1=291 x2=280 y1=341.5 y2=403.5 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><line x1=332.9 x2=328.6 y1=384.1 y2=411.2 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><linearGradient x1=-670.75 x2=-671.59 y1=164.4 y2=164.49 gradientTransform="matrix(-184.16 -32.472 -11.461 64.997 -121359 -32126)"gradientUnits=userSpaceOnUse><stop stop-color=#EE2700 offset=0></stop><stop stop-color=#FF008E offset=1></stop></linearGradient><path d="m344.1 363 97.7 17.2c5.8 2.1 8.2 6.1 7.1 12.1s-4.7 9.2-11 9.9l-106-18.7-57.5-59.2c-3.2-4.8-2.9-9.1 0.8-12.8s8.3-4.4 13.7-2.1l55.2 53.6z"clip-rule=evenodd fill-rule=evenodd></path><line x1=428.2 x2=429.1 y1=384.5 y2=378 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=395.2 x2=396.1 y1=379.5 y2=373 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=362.2 x2=363.1 y1=373.5 y2=367.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=324.2 x2=328.4 y1=351.3 y2=347.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=303.2 x2=307.4 y1=331.3 y2=327.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line></g><defs><filter x=73.2 y=113.8 width=280.6 height=317.4 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=73.2 y=113.8 width=280.6 height=317.4 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-672.16 x2=-672.16 y1=165.03 y2=166.03 gradientTransform="matrix(-100.18 48.861 97.976 200.88 -83342 -93.059)"gradientUnits=userSpaceOnUse><stop stop-color=#A17500 offset=0></stop><stop stop-color=#5D2100 offset=1></stop></linearGradient><path d="m192.3 203c8.1 37.3 14 73.6 17.8 109.1 3.8 35.4 2.8 75.1-3 119.2l61.2-16.7c-15.6-59-25.2-97.9-28.6-116.6s-10.8-51.9-22.1-99.6l-25.3 4.6"clip-rule=evenodd fill-rule=evenodd></path><g stroke=#2F8A00><linearGradient x1=-660.23 x2=-660.23 y1=166.72 y2=167.72 gradientTransform="matrix(92.683 4.8573 -2.0259 38.657 61680 -3088.6)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m195 183.9s-12.6-22.1-36.5-29.9c-15.9-5.2-34.4-1.5-55.5 11.1 15.9 14.3 29.5 22.6 40.7 24.9 16.8 3.6 51.3-6.1 51.3-6.1z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-661.36 x2=-661.36 y1=164.18 y2=165.18 gradientTransform="matrix(110 5.7648 -6.3599 121.35 73933 -15933)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5s-47.5-8.5-83.2 15.7c-23.8 16.2-34.3 49.3-31.6 99.4 30.3-27.8 52.1-48.5 65.2-61.9 19.8-20.2 49.6-53.2 49.6-53.2z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-656.79 x2=-656.79 y1=165.15 y2=166.15 gradientTransform="matrix(62.954 3.2993 -3.5023 66.828 42156 -8754.1)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m195 183.9c-0.8-21.9 6-38 20.6-48.2s29.8-15.4 45.5-15.3c-6.1 21.4-14.5 35.8-25.2 43.4s-24.4 14.2-40.9 20.1z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-663.07 x2=-663.07 y1=165.44 y2=166.44 gradientTransform="matrix(152.47 7.9907 -3.0936 59.029 101884 -4318.7)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c31.9-30 64.1-39.7 96.7-29s50.8 30.4 54.6 59.1c-35.2-5.5-60.4-9.6-75.8-12.1-15.3-2.6-40.5-8.6-75.5-18z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-662.57 x2=-662.57 y1=164.44 y2=165.44 gradientTransform="matrix(136.46 7.1517 -5.2163 99.533 91536 -11442)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c35.8-7.6 65.6-0.2 89.2 22s37.7 49 42.3 80.3c-39.8-9.7-68.3-23.8-85.5-42.4s-32.5-38.5-46-59.9z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-656.43 x2=-656.43 y1=163.86 y2=164.86 gradientTransform="matrix(60.866 3.1899 -8.7773 167.48 41560 -25168)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c-33.6 13.8-53.6 35.7-60.1 65.6s-3.6 63.1 8.7 99.6c27.4-40.3 43.2-69.6 47.4-88s5.6-44.1 4-77.2z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><path d="m196.5 182.3c-14.8 21.6-25.1 41.4-30.8 59.4s-9.5 33-11.1 45.1"fill=none stroke-linecap=round stroke-width=8></path><path d="m194.9 185.7c-24.4 1.7-43.8 9-58.1 21.8s-24.7 25.4-31.3 37.8"fill=none stroke-linecap=round stroke-width=8></path><path d="m204.5 176.4c29.7-6.7 52-8.4 67-5.1s26.9 8.6 35.8 15.9"fill=none stroke-linecap=round stroke-width=8></path><path d="m196.5 181.4c20.3 9.9 38.2 20.5 53.9 31.9s27.4 22.1 35.1 32"fill=none stroke-linecap=round stroke-width=8></path></g></g><defs><filter x=50.5 y=399 width=532 height=633 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=50.5 y=399 width=532 height=633 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-666.06 x2=-666.23 y1=163.36 y2=163.75 gradientTransform="matrix(532 0 0 633 354760 -102959)"gradientUnits=userSpaceOnUse><stop stop-color=#FFF400 offset=0></stop><stop stop-color=#3C8700 offset=1></stop></linearGradient><ellipse cx=316.5 cy=715.5 rx=266 ry=316.5></ellipse></g><defs><filter x=391 y=-24 width=288 height=283 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=391 y=-24 width=288 height=283 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-664.56 x2=-664.56 y1=163.79 y2=164.79 gradientTransform="matrix(227 0 0 227 151421 -37204)"gradientUnits=userSpaceOnUse><stop stop-color=#FFDF00 offset=0></stop><stop stop-color=#FF9D00 offset=1></stop></linearGradient><circle cx=565.5 cy=89.5 r=113.5></circle><linearGradient x1=-644.5 x2=-645.77 y1=342 y2=342 gradientTransform="matrix(30 0 0 1 19770 -253)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=427 x2=397 y1=89 y2=89 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-641.56 x2=-642.83 y1=196.02 y2=196.07 gradientTransform="matrix(26.5 0 0 5.5 17439 -1025.5)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=430.5 x2=404 y1=55.5 y2=50 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-643.73 x2=-645 y1=185.83 y2=185.9 gradientTransform="matrix(29 0 0 8 19107 -1361)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=431 x2=402 y1=122 y2=130 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-638.94 x2=-640.22 y1=177.09 y2=177.39 gradientTransform="matrix(24 0 0 13 15783 -2145)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=442 x2=418 y1=153 y2=166 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-633.42 x2=-634.7 y1=172.41 y2=173.31 gradientTransform="matrix(20 0 0 19 13137 -3096)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=464 x2=444 y1=180 y2=199 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-619.05 x2=-619.52 y1=170.82 y2=171.82 gradientTransform="matrix(13.83 0 0 22.85 9050 -3703.4)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=491.4 x2=477.5 y1=203 y2=225.9 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-578.5 x2=-578.63 y1=170.31 y2=171.31 gradientTransform="matrix(7.5 0 0 24.5 4860 -3953)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=524.5 x2=517 y1=219.5 y2=244 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=666.5 x2=666.5 y1=170.31 y2=171.31 gradientTransform="matrix(.5 0 0 24.5 231.5 -3944)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=564.5 x2=565 y1=228.5 y2=253 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12>');function cL(){return z6()}function _x(){return H6()}function Ro(){return U6()}function rp(){return K6()}function ip(){return Zf()}function uL(){return(()=>{var e=Zf();return e.style.setProperty("transform","rotate(90deg)"),e})()}function dL(){return(()=>{var e=Zf();return e.style.setProperty("transform","rotate(-90deg)"),e})()}function fL(){return V6()}function hL(){return W6()}function gL(){return G6()}function yL(){return Q6()}function mL(){return Y6()}function pL(){return X6()}function vL(){return J6()}function bL(){return Z6()}function xL(){return eL()}function wL(e){return(()=>{var t=Cx(),n=t.firstChild;return ve(()=>J(n,"stroke",e.theme==="dark"?"#12B76A":"#027A48")),t})()}function SL(){return tL()}function CL(){return nL()}function _L(e){return[T(pe,{get when(){return e.checked},get children(){var t=Cx(),n=t.firstChild;return ve(()=>J(n,"stroke",e.theme==="dark"?"#9B8AFB":"#6938EF")),t}}),T(pe,{get when(){return!e.checked},get children(){var t=rL(),n=t.firstChild;return ve(()=>J(n,"stroke",e.theme==="dark"?"#9B8AFB":"#6938EF")),t}})]}function kL(){return iL()}function OL(){return sL()}function EL(){return oL()}function AL(){return aL()}function sp(){const e=hn();return(()=>{var t=lL(),n=t.firstChild,r=n.nextSibling,i=r.nextSibling,s=i.firstChild,o=i.nextSibling,a=o.firstChild,l=o.nextSibling,c=l.nextSibling,u=c.firstChild,d=c.nextSibling,f=d.firstChild,h=d.nextSibling,g=h.nextSibling,m=g.firstChild,p=g.nextSibling,v=p.firstChild,b=p.nextSibling,x=b.nextSibling,C=x.firstChild,w=x.nextSibling,k=w.firstChild,S=w.nextSibling,_=S.nextSibling,O=_.firstChild,A=_.nextSibling,M=A.firstChild,D=A.nextSibling,W=D.nextSibling,R=W.firstChild,L=W.nextSibling,j=L.firstChild,I=L.nextSibling,oe=I.nextSibling,ue=oe.firstChild,B=oe.nextSibling,Y=B.firstChild,ne=B.nextSibling,ae=ne.firstChild,F=ae.nextSibling,G=F.nextSibling,q=G.nextSibling,ce=q.nextSibling,V=ne.nextSibling,fe=V.firstChild,he=V.nextSibling,Ie=he.firstChild,te=he.nextSibling,De=te.firstChild,ye=De.nextSibling,Te=ye.nextSibling,Me=Te.firstChild,Et=Me.nextSibling,Z=Et.nextSibling,$e=Z.nextSibling,Ze=$e.nextSibling,Re=Ze.nextSibling,Be=Re.nextSibling,qe=Be.nextSibling,xe=qe.nextSibling,de=xe.nextSibling,Ae=de.nextSibling,ze=Ae.nextSibling,mn=te.nextSibling,Yr=mn.firstChild,Kn=mn.nextSibling,Xr=Kn.firstChild,Vn=Kn.nextSibling,pr=Vn.firstChild,qa=pr.nextSibling,Qs=Vn.nextSibling,za=Qs.firstChild,Ri=Qs.nextSibling,Ha=Ri.firstChild,Ys=Ri.nextSibling,Xs=Ys.firstChild,Js=Xs.nextSibling,Fi=Js.nextSibling,ih=Fi.nextSibling,sh=ih.nextSibling,oh=sh.nextSibling,ah=oh.nextSibling,lh=ah.nextSibling,ch=lh.nextSibling,uh=ch.nextSibling,dh=uh.nextSibling,fh=dh.nextSibling,hh=fh.nextSibling,gh=hh.nextSibling,yh=gh.nextSibling,mh=yh.nextSibling,ph=mh.nextSibling,Ix=ph.nextSibling;return J(n,"id",`a-${e}`),J(r,"fill",`url(#a-${e})`),J(s,"id",`am-${e}`),J(o,"id",`b-${e}`),J(a,"filter",`url(#am-${e})`),J(l,"mask",`url(#b-${e})`),J(u,"id",`ah-${e}`),J(d,"id",`k-${e}`),J(f,"filter",`url(#ah-${e})`),J(h,"mask",`url(#k-${e})`),J(m,"id",`ae-${e}`),J(p,"id",`j-${e}`),J(v,"filter",`url(#ae-${e})`),J(b,"mask",`url(#j-${e})`),J(C,"id",`ai-${e}`),J(w,"id",`i-${e}`),J(k,"filter",`url(#ai-${e})`),J(S,"mask",`url(#i-${e})`),J(O,"id",`aj-${e}`),J(A,"id",`h-${e}`),J(M,"filter",`url(#aj-${e})`),J(D,"mask",`url(#h-${e})`),J(R,"id",`ag-${e}`),J(L,"id",`g-${e}`),J(j,"filter",`url(#ag-${e})`),J(I,"mask",`url(#g-${e})`),J(ue,"id",`af-${e}`),J(B,"id",`f-${e}`),J(Y,"filter",`url(#af-${e})`),J(ne,"mask",`url(#f-${e})`),J(q,"id",`m-${e}`),J(ce,"fill",`url(#m-${e})`),J(fe,"id",`ak-${e}`),J(he,"id",`e-${e}`),J(Ie,"filter",`url(#ak-${e})`),J(te,"mask",`url(#e-${e})`),J(De,"id",`n-${e}`),J(ye,"fill",`url(#n-${e})`),J(Me,"id",`r-${e}`),J(Et,"fill",`url(#r-${e})`),J(Z,"id",`s-${e}`),J($e,"fill",`url(#s-${e})`),J(Ze,"id",`q-${e}`),J(Re,"fill",`url(#q-${e})`),J(Be,"id",`p-${e}`),J(qe,"fill",`url(#p-${e})`),J(xe,"id",`o-${e}`),J(de,"fill",`url(#o-${e})`),J(Ae,"id",`l-${e}`),J(ze,"fill",`url(#l-${e})`),J(Yr,"id",`al-${e}`),J(Kn,"id",`d-${e}`),J(Xr,"filter",`url(#al-${e})`),J(Vn,"mask",`url(#d-${e})`),J(pr,"id",`u-${e}`),J(qa,"fill",`url(#u-${e})`),J(za,"id",`ad-${e}`),J(Ri,"id",`c-${e}`),J(Ha,"filter",`url(#ad-${e})`),J(Ys,"mask",`url(#c-${e})`),J(Xs,"id",`t-${e}`),J(Js,"fill",`url(#t-${e})`),J(Fi,"id",`v-${e}`),J(ih,"stroke",`url(#v-${e})`),J(sh,"id",`aa-${e}`),J(oh,"stroke",`url(#aa-${e})`),J(ah,"id",`w-${e}`),J(lh,"stroke",`url(#w-${e})`),J(ch,"id",`ac-${e}`),J(uh,"stroke",`url(#ac-${e})`),J(dh,"id",`ab-${e}`),J(fh,"stroke",`url(#ab-${e})`),J(hh,"id",`y-${e}`),J(gh,"stroke",`url(#y-${e})`),J(yh,"id",`x-${e}`),J(mh,"stroke",`url(#x-${e})`),J(ph,"id",`z-${e}`),J(Ix,"stroke",`url(#z-${e})`),t})()}var PL=le('<span><svg width=16 height=16 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M6 12L10 8L6 4"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),TL=le('<button title="Copy object to clipboard">'),ML=le('<button title="Remove all items"aria-label="Remove all items">'),$L=le('<button title="Delete item"aria-label="Delete item">'),jL=le('<button title="Toggle value"aria-label="Toggle value">'),DL=le('<button title="Bulk Edit Data"aria-label="Bulk Edit Data">'),yo=le("<div>"),LL=le("<div><button> <span></span> <span> "),IL=le("<input>"),op=le("<span>"),RL=le("<div><span>:"),FL=le("<div><div><button> [<!>...<!>]");function NL(e,t){let n=0;const r=[];for(;n<e.length;)r.push(e.slice(n,n+t)),n=n+t;return r}var ap=e=>{const t=mt(),n=ge().shadowDOMTarget?Pe.bind({target:ge().shadowDOMTarget}):Pe,r=H(()=>t()==="dark"?Gs(n):Ws(n));return(()=>{var i=PL();return ve(()=>ee(i,se(r().expander,n`
69
69
  transform: rotate(${e.expanded?90:0}deg);
70
70
  `,e.expanded&&n`
@@ -20919,10 +20919,10 @@ function $4() {
20919
20919
  return Re;
20920
20920
  var $e = new Date(ge.finishedAt), De = new Date(Re.finishedAt);
20921
20921
  return $e > De ? ge : Re;
20922
- }, void 0) : void 0, L = N == null || (t = N.scores) === null || t === void 0 ? void 0 : t.raw, D = N == null || (n = N.scores) === null || n === void 0 ? void 0 : n.standardized, R = 20, se = (r = N == null || (i = N.mentions) === null || i === void 0 || (i = i.mentionedInNumberOfQueries) === null || i === void 0 ? void 0 : i.value) !== null && r !== void 0 ? r : 0, ce = N == null || (s = N.scores) === null || s === void 0 || (s = s.standardized) === null || s === void 0 || (s = s.awareness) === null || s === void 0 || (s = s.previous) === null || s === void 0 ? void 0 : s.difference, j = typeof ce == "number" ? ce / R : void 0, Q = (o = N == null || (a = N.citations) === null || a === void 0 || (a = a.total) === null || a === void 0 ? void 0 : a.value) !== null && o !== void 0 ? o : 0, te = N == null || (l = N.rankings) === null || l === void 0 || (l = l.list) === null || l === void 0 ? void 0 : l.find(function(Re) {
20922
+ }, void 0) : void 0, L = N == null || (t = N.scores) === null || t === void 0 ? void 0 : t.raw, D = N == null || (n = N.scores) === null || n === void 0 ? void 0 : n.standardized, R = 20, se = (r = N == null || (i = N.mentions) === null || i === void 0 || (i = i.mentionedInNumberOfQueries) === null || i === void 0 ? void 0 : i.value) !== null && r !== void 0 ? r : 0, ce = N == null || (s = N.scores) === null || s === void 0 || (s = s.standardized) === null || s === void 0 || (s = s.mentions) === null || s === void 0 || (s = s.previous) === null || s === void 0 ? void 0 : s.difference, j = typeof ce == "number" ? ce / R : void 0, Q = (o = N == null || (a = N.citations) === null || a === void 0 || (a = a.total) === null || a === void 0 ? void 0 : a.value) !== null && o !== void 0 ? o : 0, te = N == null || (l = N.rankings) === null || l === void 0 || (l = l.list) === null || l === void 0 ? void 0 : l.find(function(Re) {
20923
20923
  var ge;
20924
20924
  return ((ge = Re.brand) === null || ge === void 0 ? void 0 : ge.isSelf) === !0;
20925
- }), oe = (c = te == null || (u = te.rank) === null || u === void 0 ? void 0 : u.value) !== null && c !== void 0 ? c : null, F = te == null || (d = te.rank) === null || d === void 0 || (d = d.previous) === null || d === void 0 ? void 0 : d.difference, W = typeof F == "number" ? F / R : void 0, q = (f = D == null || (h = D.visibility) === null || h === void 0 ? void 0 : h.value) !== null && f !== void 0 ? f : 0, le = D == null || (g = D.visibility) === null || g === void 0 || (g = g.previous) === null || g === void 0 ? void 0 : g.value, K = (y = D == null || (m = D.ranking) === null || m === void 0 ? void 0 : m.value) !== null && y !== void 0 ? y : 0, de = (p = D == null || (b = D.sentiment) === null || b === void 0 ? void 0 : b.value) !== null && p !== void 0 ? p : 0, fe = (w = D == null || (C = D.awareness) === null || C === void 0 ? void 0 : C.value) !== null && w !== void 0 ? w : 0, Fe = {
20925
+ }), oe = (c = te == null || (u = te.rank) === null || u === void 0 ? void 0 : u.value) !== null && c !== void 0 ? c : null, F = te == null || (d = te.rank) === null || d === void 0 || (d = d.previous) === null || d === void 0 ? void 0 : d.difference, W = typeof F == "number" ? F / R : void 0, q = (f = D == null || (h = D.visibility) === null || h === void 0 ? void 0 : h.value) !== null && f !== void 0 ? f : 0, le = D == null || (g = D.visibility) === null || g === void 0 || (g = g.previous) === null || g === void 0 ? void 0 : g.value, K = (y = D == null || (m = D.ranking) === null || m === void 0 ? void 0 : m.value) !== null && y !== void 0 ? y : 0, de = (p = D == null || (b = D.sentiment) === null || b === void 0 ? void 0 : b.value) !== null && p !== void 0 ? p : 0, fe = (w = D == null || (C = D.mentions) === null || C === void 0 ? void 0 : C.value) !== null && w !== void 0 ? w : 0, Fe = {
20926
20926
  labels: ["Mentions", "Ranking", "Citations", "Sentiment"],
20927
20927
  datasets: [{
20928
20928
  data: [fe, K, Q, de],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@yoast/ai-insights-client",
3
3
  "private": false,
4
- "version": "1.4.6",
4
+ "version": "1.4.7",
5
5
  "type": "module",
6
6
  "description": "A React component library for AI-powered brand analysis and insights",
7
7
  "keywords": [