From bb6c7f19c3afb4a85f3c14d42e146fc8d8112532 Mon Sep 17 00:00:00 2001 From: DrCBeatz Date: Fri, 15 Mar 2024 22:33:04 -0400 Subject: [PATCH] add VITE_API_URL .env variable for local & production --- .gitignore | 2 ++ frontend/package-lock.json | 4 ++-- frontend/package.json | 2 +- frontend/src/App.tsx | 22 ++++++++++++------- .../{index--18X3qIR.js => index-HE6f1_nl.js} | 6 ++--- static/index.html | 2 +- .../{index--18X3qIR.js => index-HE6f1_nl.js} | 6 ++--- staticfiles/index.html | 2 +- 8 files changed, 27 insertions(+), 19 deletions(-) rename static/assets/{index--18X3qIR.js => index-HE6f1_nl.js} (96%) rename staticfiles/assets/{index--18X3qIR.js => index-HE6f1_nl.js} (96%) diff --git a/.gitignore b/.gitignore index 4360a2d..2e1b2a7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ .env +.env.production +.env.local *.pyc *.pyo *.pyd diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 4bd3c9a..d049791 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -10,7 +10,7 @@ "dependencies": { "@fortawesome/fontawesome-free": "^6.5.1", "chart.js": "^4.4.2", - "mdb-react-ui-kit": "git+https://oauth2:VWmSVN7q3SGDUX_dguTV@git.mdbootstrap.com/mdb/react/mdb5/prd/mdb5-react-ui-kit-pro-essential", + "mdb-react-ui-kit": "git+https://oauth2:[api-key-redacted]@git.mdbootstrap.com/mdb/react/mdb5/prd/mdb5-react-ui-kit-pro-essential", "react": "^18.2.0", "react-dom": "^18.2.0" }, @@ -2633,7 +2633,7 @@ }, "node_modules/mdb-react-ui-kit": { "version": "7.2.0", - "resolved": "git+https://oauth2:VWmSVN7q3SGDUX_dguTV@git.mdbootstrap.com/mdb/react/mdb5/prd/mdb5-react-ui-kit-pro-essential#e570e3ae816f170fbfb96201506f2e33059e04c2", + "resolved": "git+https://oauth2:[api-key-redacted]@git.mdbootstrap.com/mdb/react/mdb5/prd/mdb5-react-ui-kit-pro-essential#e570e3ae816f170fbfb96201506f2e33059e04c2", "dependencies": { "@popperjs/core": "2.11.5", "chart.js": "^3.8.0", diff --git a/frontend/package.json b/frontend/package.json index 3d91496..37dfd09 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -12,7 +12,7 @@ "dependencies": { "@fortawesome/fontawesome-free": "^6.5.1", "chart.js": "^4.4.2", - "mdb-react-ui-kit": "git+https://oauth2:VWmSVN7q3SGDUX_dguTV@git.mdbootstrap.com/mdb/react/mdb5/prd/mdb5-react-ui-kit-pro-essential", + "mdb-react-ui-kit": "git+https://oauth2:[api-key-redacted]@git.mdbootstrap.com/mdb/react/mdb5/prd/mdb5-react-ui-kit-pro-essential", "react": "^18.2.0", "react-dom": "^18.2.0" }, diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index e8ad7f2..23b4979 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -164,7 +164,10 @@ function App() { useEffect(() => { const fetchAlgorithms = async () => { try { - const response = await fetch("http://localhost:8000/api/algorithms"); + const response = await fetch( + `${import.meta.env.VITE_API_URL}/algorithms` + ); + if (!response.ok) { throw new Error("Network response was not ok"); } @@ -213,13 +216,16 @@ function App() { setSelectedAlgorithmDetails(tempSelectedAlgorithmDetails); try { - const response = await fetch("http://localhost:8000/api/evaluate/", { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ a, b, k }), - }); + const response = await fetch( + `${import.meta.env.VITE_API_URL}/evaluate/`, + { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ a, b, k }), + } + ); if (!response.ok) { throw new Error("Network response was not ok"); diff --git a/static/assets/index--18X3qIR.js b/static/assets/index-HE6f1_nl.js similarity index 96% rename from static/assets/index--18X3qIR.js rename to static/assets/index-HE6f1_nl.js index 93546f8..a1417ae 100644 --- a/static/assets/index--18X3qIR.js +++ b/static/assets/index-HE6f1_nl.js @@ -52,9 +52,9 @@ Error generating stack: `+r.message+` * https://www.chartjs.org * (c) 2024 Chart.js Contributors * Released under the MIT License - */let qO=class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,i,s){const r=n.listeners[s],o=n.duration;r.forEach(a=>a({chart:t,initial:n.initial,numSteps:o,currentStep:Math.min(i-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=BS.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const r=i.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),r.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),n+=r.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}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((i,s)=>Math.max(i,s._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 i=n.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};var Ai=new qO;const ux="transparent",QO={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=tx(e||ux),s=i.valid&&tx(t||ux);return s&&s.valid?s.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};let ZO=class{constructor(t,n,i,s){const r=n[i];s=Ht([t.to,s,r,t.from]);const o=Ht([t.from,r,s]);this._active=!0,this._fn=t.fn||QO[t.type||typeof o],this._easing=hl[t.easing]||hl.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=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);const s=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Ht([t.to,n,s,t.from]),this._from=Ht([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,i=this._duration,s=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||n1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){const n=t?"res":"rej",i=this._promises||[];for(let s=0;s{const r=t[s];if(!gt(r))return;const o={};for(const a of n)o[a]=r[a];(Ut(r.properties)&&r.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,o)})})}_animateOptions(t,n){const i=n.options,s=tL(t,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&JO(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,n){const i=this._properties,s=[],r=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"){s.push(...this._animateOptions(t,n));continue}const u=n[c];let d=r[c];const h=i.get(c);if(d)if(h&&d.active()){d.update(h,u,a);continue}else d.cancel();if(!h||!h.duration){t[c]=u;continue}r[c]=d=new ZO(h,t,c,u),s.push(d)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return Ai.add(this._chart,i),!0}};function JO(e,t){const n=[],i=Object.keys(t);for(let s=0;s0||!n&&r<0)return s.index}return null}function mx(e,t){const{chart:n,_cachedMeta:i}=e,s=n._stacks||(n._stacks={}),{iScale:r,vScale:o,index:a}=i,l=r.axis,c=o.axis,u=sL(r,o,i),d=t.length;let h;for(let f=0;fn[i].axis===t).shift()}function aL(e,t){return Qs(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function lL(e,t,n){return Qs(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function xa(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const s of t){const r=s._stacks;if(!r||r[i]===void 0||r[i][n]===void 0)return;delete r[i][n],r[i]._visualValues!==void 0&&r[i]._visualValues[n]!==void 0&&delete r[i]._visualValues[n]}}}const $f=e=>e==="reset"||e==="none",gx=(e,t)=>t?e:Object.assign({},e),cL=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:rM(n,!0),values:null};var Na;let Zs=(Na=class{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=fx(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&&xa(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(d,h,f,p)=>d==="x"?h:d==="r"?p:f,r=n.xAxisID=at(i.xAxisID,jf(t,"x")),o=n.yAxisID=at(i.yAxisID,jf(t,"y")),a=n.rAxisID=at(i.rAxisID,jf(t,"r")),l=n.indexAxis,c=n.iAxisID=s(l,r,o,a),u=n.vAxisID=s(l,o,r,a);n.xScale=this.getScaleForId(r),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&&Qv(this._data,this),t._stacked&&xa(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(gt(n))this._data=iL(n);else if(i!==n){if(i){Qv(i,this);const s=this._cachedMeta;xa(s),s._parsed=[]}n&&Object.isExtensible(n)&&KA(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,i=this.getDataset();let s=!1;this._dataCheck();const r=n._stacked;n._stacked=fx(n.vScale,n),n.stack!==i.stack&&(s=!0,xa(n),n.stack=i.stack),this._resyncElements(t),(s||r!==n._stacked)&&mx(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:i,_data:s}=this,{iScale:r,_stacked:o}=i,a=r.axis;let l=t===0&&n===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,d,h;if(this._parsing===!1)i._parsed=s,i._sorted=!0,h=s;else{Ut(s[t])?h=this.parseArrayData(i,s,t,n):gt(s[t])?h=this.parseObjectData(i,s,t,n):h=this.parsePrimitiveData(i,s,t,n);const f=()=>d[a]===null||c&&d[a]m||d=0;--h)if(!p()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let s,r,o;for(s=0,r=n.length;s=0&&tthis.getContext(i,s,n),m=c.resolveNamedOptions(h,f,p,d);return m.$shared&&(m.$shared=l,r[o]=Object.freeze(gx(m,l))),m}_resolveAnimations(t,n,i){const s=this.chart,r=this._cachedDataOpts,o=`animation-${n}`,a=r[o];if(a)return a;let l;if(s.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),h=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(h,this.getContext(t,i,n))}const c=new sM(s,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||$f(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),s=this._sharedOptions,r=this.getSharedOptions(i),o=this.includeOptions(n,r)||r!==s;return this.updateSharedOptions(r,n,i),{sharedOptions:r,includeOptions:o}}updateElement(t,n,i,s){$f(s)?Object.assign(t,i):this._resolveAnimations(n,s).update(t,i)}updateSharedOptions(t,n,i){t&&!$f(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,s){t.active=s;const r=this.getStyle(n,s);this._resolveAnimations(n,i,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=i.length,r=n.length,o=Math.min(r,s);o&&this.parse(0,o),r>s?this._insertElements(s,r-s,t):r{for(c.length+=n,a=c.length-1;a>=o;a--)c[a]=c[a-n]};for(l(r),a=t;as-r))}return e._cache.$bar}function dL(e){const t=e.iScale,n=uL(t,e.type);let i=t._length,s,r,o,a;const l=()=>{o===32767||o===-32768||(zl(a)&&(i=Math.min(i,Math.abs(o-a)||i)),a=o)};for(s=0,r=n.length;s0?s[e-1]:null,a=eMath.abs(a)&&(l=a,c=o),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}function oM(e,t,n,i){return Ut(e)?pL(e,t,n,i):t[n.axis]=n.parse(e,i),t}function yx(e,t,n,i){const s=e.iScale,r=e.vScale,o=s.getLabels(),a=s===r,l=[];let c,u,d,h;for(c=n,u=n+i;c=n?1:-1)}function gL(e){let t,n,i,s,r;return e.horizontal?(t=e.base>e.x,n="left",i="right"):(t=e.basel.controller.options.grouped),r=i.options.stacked,o=[],a=l=>{const c=l.controller.getParsed(n),u=c&&c[l.vScale.axis];if(bt(u)||isNaN(u))return!0};for(const l of s)if(!(n!==void 0&&a(l))&&((r===!1||o.indexOf(l.stack)===-1||r===void 0&&l.stack===void 0)&&o.push(l.stack),l.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,i){const s=this._getStacks(t,i),r=n!==void 0?s.indexOf(n):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,n=this._cachedMeta,i=n.iScale,s=[];let r,o;for(r=0,o=n.data.length;r=0;--i)n=Math.max(n,t[i].size(this.resolveDataElementOptions(i))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=n,o=this.getParsed(t),a=s.getLabelForValue(o.x),l=r.getLabelForValue(o.y),c=o._custom;return{label:i[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,i,s){const r=s==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,s),u=o.axis,d=a.axis;for(let h=n;hWl(x,a,l,!0)?1:Math.max(_,_*n,w,w*n),p=(x,_,w)=>Wl(x,a,l,!0)?-1:Math.min(_,_*n,w,w*n),m=f(0,c,d),v=f(ue,u,h),y=p(Kt,c,d),g=p(Kt+ue,u,h);i=(m-y)/2,s=(v-g)/2,r=-(m+y)/2,o=-(v+g)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:o}}var no;let vy=(no=class extends Zs{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let r=l=>+i[l];if(gt(i[t])){const{key:l="value"}=this._parsing;r=c=>+zs(i[c],l)}let o,a;for(o=t,a=t+n;o0&&!isNaN(t)?Xt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=hc(n._parsed[t],i.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let n=0;const i=this.chart;let s,r,o,a,l;if(!t){for(s=0,r=i.data.datasets.length;st!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),K(no,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return n.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}}}),no);var Ia;let kL=(Ia=class extends Zs{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=n,o=this.chart._animationsDisabled;let{start:a,count:l}=zS(n,s,o);this._drawStart=a,this._drawCount=l,WS(n)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,n,i,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,s),h=o.axis,f=a.axis,{spanGaps:p,segment:m}=this.options,v=Wo(p)?p:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||r||s==="none",g=n+i,x=t.length;let _=n>0&&this.getParsed(n-1);for(let w=0;w=g){C.skip=!0;continue}const M=this.getParsed(w),P=bt(M[f]),T=C[h]=o.getPixelForValue(M[h],w),A=C[f]=r||P?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,M,l):M[f],w);C.skip=isNaN(T)||isNaN(A)||P,C.stop=w>0&&Math.abs(M[h]-_[h])>v,m&&(C.parsed=M,C.raw=c.data[w]),d&&(C.options=u||this.resolveDataElementOptions(w,S.active?"active":s)),y||this.updateElement(S,w,C,s),_=M}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const r=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},K(Ia,"id","line"),K(Ia,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),K(Ia,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}}),Ia);var Fa;let aM=(Fa=class extends Zs{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=hc(n._parsed[t].r,i.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,n,i,s){return QS.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(rn.max&&(n.max=r))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,i=t.options,s=Math.min(n.right-n.left,n.bottom-n.top),r=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,i,s){const r=s==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,h=c.getIndexAngle(0)-.5*Kt;let f=h,p;const m=360/this.countVisibleElements();for(p=0;p{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&n++}),n}_computeAngle(t,n,i){return this.chart.getDataVisibility(t)?Jn(this.resolveDataElementOptions(t,n).angle||i):0}},K(Fa,"id","polarArea"),K(Fa,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),K(Fa,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return n.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}}),Fa);var Ou;let SL=(Ou=class extends vy{},K(Ou,"id","pie"),K(Ou,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"}),Ou);var Ba;let ML=(Ba=class extends Zs{getLabelAndValue(t){const n=this._cachedMeta.vScale,i=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(i[n.axis])}}parseObjectData(t,n,i,s){return QS.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta,i=n.dataset,s=n.data||[],r=n.iScale.getLabels();if(i.points=s,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:r.length===s.length,options:o};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,n,i,s){const r=this._cachedMeta.rScale,o=s==="reset";for(let a=n;a0&&this.getParsed(n-1);for(let _=n;_0&&Math.abs(S[f]-x[f])>y,v&&(C.parsed=S,C.raw=c.data[_]),h&&(C.options=d||this.resolveDataElementOptions(_,w.active?"active":s)),g||this.updateElement(w,_,C,s),x=S}this.updateSharedOptions(d,s,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!n.length)return s;const r=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,r,o)/2}},K(Va,"id","scatter"),K(Va,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),K(Va,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}}),Va);var PL=Object.freeze({__proto__:null,BarController:bL,BubbleController:_L,DoughnutController:vy,LineController:kL,PieController:SL,PolarAreaController:aM,RadarController:ML,ScatterController:CL});function or(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class xy{constructor(t){K(this,"options");this.options=t||{}}static override(t){Object.assign(xy.prototype,t)}init(){}formats(){return or()}parse(){return or()}format(){return or()}add(){return or()}diff(){return or()}startOf(){return or()}endOf(){return or()}}var TL={_date:xy};function DL(e,t,n,i){const{controller:s,data:r,_sorted:o}=e,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&o&&r.length){const l=a._reversePixels?YA:zi;if(i){if(s._sharedOptions){const c=r[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(r,t,n-u),h=l(r,t,n+u);return{lo:d.lo,hi:h.hi}}}}else return l(r,t,n)}return{lo:0,hi:r.length-1}}function fc(e,t,n,i,s){const r=e.getSortedVisibleDatasetMetas(),o=n[t];for(let a=0,l=r.length;a{l[o](t[n],s)&&(r.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:r}var LL={evaluateInteractionItems:fc,modes:{index(e,t,n,i){const s=fr(t,e),r=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?Ff(e,s,r,i,o):Bf(e,s,r,!1,i,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,i){const s=fr(t,e),r=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?Ff(e,s,r,i,o):Bf(e,s,r,!1,i,o);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;un.pos===t)}function _x(e,t){return e.filter(n=>lM.indexOf(n.pos)===-1&&n.box.axis===t)}function _a(e,t){return e.sort((n,i)=>{const s=t?i:n,r=t?n:i;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function RL(e){const t=[];let n,i,s,r,o,a;for(n=0,i=(e||[]).length;nc.box.fullSize),!0),i=_a(ba(t,"left"),!0),s=_a(ba(t,"right")),r=_a(ba(t,"top"),!0),o=_a(ba(t,"bottom")),a=_x(t,"x"),l=_x(t,"y");return{fullSize:n,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:ba(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}function wx(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function cM(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 IL(e,t,n,i){const{pos:s,box:r}=n,o=e.maxPadding;if(!gt(s)){n.size&&(e[s]-=n.size);const d=i[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?r.height:r.width),n.size=d.size/d.count,e[s]+=n.size}r.getPadding&&cM(o,r.getPadding());const a=Math.max(0,t.outerWidth-wx(o,e,"left","right")),l=Math.max(0,t.outerHeight-wx(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 FL(e){const t=e.maxPadding;function n(i){const s=Math.max(t[i]-e[i],0);return e[i]+=s,s}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function BL(e,t){const n=t.maxPadding;function i(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{r[o]=Math.max(t[o],n[o])}),r}return i(e?["left","right"]:["top","bottom"])}function Ga(e,t,n,i){const s=[];let r,o,a,l,c,u;for(r=0,o=e.length,c=0;r{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=l.reduce((m,v)=>v.box.options&&v.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/u,hBoxMaxHeight:o/2}),h=Object.assign({},s);cM(h,Ae(i));const f=Object.assign({maxPadding:h,w:r,h:o,x:s.left,y:s.top},s),p=jL(l.concat(c),d);Ga(a.fullSize,f,d,p),Ga(l,f,d,p),Ga(c,f,d,p)&&Ga(l,f,d,p),FL(f),kx(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,kx(a.rightAndBottom,f,d,p),e.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},Et(a.chartArea,m=>{const v=m.box;Object.assign(v,e.chartArea),v.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};let uM=class{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,s){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,s?Math.floor(n/s):i)}}isAttached(t){return!0}updateConfig(t){}},VL=class extends uM{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}};const Qu="$chartjs",zL={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Sx=e=>e===null||e==="";function WL(e,t){const n=e.style,i=e.getAttribute("height"),s=e.getAttribute("width");if(e[Qu]={initial:{height:i,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Sx(s)){const r=ox(e,"width");r!==void 0&&(e.width=r)}if(Sx(i))if(e.style.height==="")e.height=e.width/(t||2);else{const r=ox(e,"height");r!==void 0&&(e.height=r)}return e}const dM=FO?{passive:!0}:!1;function HL(e,t,n){e&&e.addEventListener(t,n,dM)}function UL(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,dM)}function YL(e,t){const n=zL[e.type]||e.type,{x:i,y:s}=fr(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Id(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function XL(e,t,n){const i=e.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||Id(a.addedNodes,i),o=o&&!Id(a.removedNodes,i);o&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function KL(e,t,n){const i=e.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||Id(a.removedNodes,i),o=o&&!Id(a.addedNodes,i);o&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const Ul=new Map;let Mx=0;function hM(){const e=window.devicePixelRatio;e!==Mx&&(Mx=e,Ul.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function GL(e,t){Ul.size||window.addEventListener("resize",hM),Ul.set(e,t)}function qL(e){Ul.delete(e),Ul.size||window.removeEventListener("resize",hM)}function QL(e,t,n){const i=e.canvas,s=i&&yy(i);if(!s)return;const r=VS((a,l)=>{const c=s.clientWidth;n(a,l),c{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return o.observe(s),GL(e,r),o}function Vf(e,t,n){n&&n.disconnect(),t==="resize"&&qL(e)}function ZL(e,t,n){const i=e.canvas,s=VS(r=>{e.ctx!==null&&n(YL(r,e))},e);return HL(i,t,s),s}let JL=class extends uM{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(WL(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[Qu])return!1;const i=n[Qu].initial;["height","width"].forEach(r=>{const o=i[r];bt(o)?n.removeAttribute(r):n.setAttribute(r,o)});const s=i.style||{};return Object.keys(s).forEach(r=>{n.style[r]=s[r]}),n.width=n.width,delete n[Qu],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const s=t.$proxies||(t.$proxies={}),o={attach:XL,detach:KL,resize:QL}[n]||ZL;s[n]=o(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),s=i[n];if(!s)return;({attach:Vf,detach:Vf,resize:Vf}[n]||UL)(t,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,s){return IO(t,n,i,s)}isAttached(t){const n=yy(t);return!!(n&&n.isConnected)}};function tR(e){return!gy()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?VL:JL}var Lu;let os=(Lu=class{constructor(){K(this,"x");K(this,"y");K(this,"active",!1);K(this,"options");K(this,"$animations")}tooltipPosition(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return Wo(this.x)&&Wo(this.y)}getProps(t,n){const i=this.$animations;if(!n||!i)return this;const s={};return t.forEach(r=>{s[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),s}},K(Lu,"defaults",{}),K(Lu,"defaultRoutes"),Lu);function eR(e,t){const n=e.options.ticks,i=nR(e),s=Math.min(n.maxTicksLimit||i,i),r=n.major.enabled?sR(t):[],o=r.length,a=r[0],l=r[o-1],c=[];if(o>s)return rR(t,c,r,o/s),c;const u=iR(r,t,s);if(o>0){let d,h;const f=o>1?Math.round((l-a)/(o-1)):null;for(eu(t,c,u,bt(f)?0:a-f,a),d=0,h=o-1;ds)return l}return Math.max(s,1)}function sR(e){const t=[];let n,i;for(n=0,i=e.length;ne==="left"?"right":e==="right"?"left":e,Cx=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Px=(e,t)=>Math.min(t||e,e);function Tx(e,t){const n=[],i=e.length/t,s=e.length;let r=0;for(;ro+a)))return l}function cR(e,t){Et(e,n=>{const i=n.gc,s=i.length/2;let r;if(s>t){for(r=0;ri?i:n,i=s&&n>i?n:i,{min:mn(n,mn(i,n)),max:mn(i,mn(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){$t(this.options.beforeUpdate,[this])}update(t,n,i){const{beginAtZero:s,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=gO(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),d=u.widest.width,h=u.highest.height,f=we(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:f/(i-1),d+6>a&&(a=f/(i-(t.offset?.5:1)),l=this.maxHeight-wa(t.grid)-n.padding-Dx(t.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),o=ly(Math.min(Math.asin(we((u.highest.height+6)/a,-1,1)),Math.asin(we(l/c,-1,1))-Math.asin(we(h/c,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){$t(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){$t(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=Dx(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=wa(r)+l):(t.height=this.maxHeight,t.width=wa(r)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),f=i.padding*2,p=Jn(this.labelRotation),m=Math.cos(p),v=Math.sin(p);if(a){const y=i.mirror?0:v*d.width+m*h.height;t.height=Math.min(this.maxHeight,t.height+y+f)}else{const y=i.mirror?0:m*d.width+v*h.height;t.width=Math.min(this.maxWidth,t.width+y+f)}this._calculatePadding(c,u,v,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,i,s){const{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,f=0;l?c?(h=s*t.width,f=i*n.height):(h=i*t.height,f=s*n.width):r==="start"?f=n.width:r==="end"?h=t.width:r!=="inner"&&(h=t.width/2,f=n.width/2),this.paddingLeft=Math.max((h-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((f-d+o)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;r==="start"?(u=0,d=t.height):r==="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(){$t(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,i;for(n=0,i=t.length;n({width:o[P]||0,height:a[P]||0});return{first:M(0),last:M(n-1),widest:M(S),highest:M(C),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 UA(this._alignToPixels?rr(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&&ta*s?a/i:l/s:l*s0}_computeGridLineItems(t){const n=this.axis,i=this.chart,s=this.options,{grid:r,position:o,border:a}=s,l=r.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),h=wa(r),f=[],p=a.setContext(this.getContext()),m=p.display?p.width:0,v=m/2,y=function(R){return rr(i,R,m)};let g,x,_,w,S,C,M,P,T,A,E,z;if(o==="top")g=y(this.bottom),C=this.bottom-h,P=g-v,A=y(t.top)+v,z=t.bottom;else if(o==="bottom")g=y(this.top),A=t.top,z=y(t.bottom)-v,C=g+v,P=this.top+h;else if(o==="left")g=y(this.right),S=this.right-h,M=g-v,T=y(t.left)+v,E=t.right;else if(o==="right")g=y(this.left),T=t.left,E=y(t.right)-v,S=g+v,M=this.left+h;else if(n==="x"){if(o==="center")g=y((t.top+t.bottom)/2+.5);else if(gt(o)){const R=Object.keys(o)[0],B=o[R];g=y(this.chart.scales[R].getPixelForValue(B))}A=t.top,z=t.bottom,C=g+v,P=C+h}else if(n==="y"){if(o==="center")g=y((t.left+t.right)/2);else if(gt(o)){const R=Object.keys(o)[0],B=o[R];g=y(this.chart.scales[R].getPixelForValue(B))}S=g-v,M=S-h,T=t.left,E=t.right}const N=at(s.ticks.maxTicksLimit,d),L=Math.max(1,Math.ceil(d/N));for(x=0;x0&&(U-=Z/2);break}V={left:U,top:O,width:Z+W.width,height:et+W.height,color:L.backdropColor}}v.push({label:_,font:P,textOffset:E,options:{rotation:m,color:B,strokeColor:D,strokeWidth:$,textAlign:F,textBaseline:z,translation:[w,S],backdrop:V}})}return v}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Jn(this.labelRotation))return t==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:i,mirror:s,padding:r}}=this.options,o=this._getLabelSizes(),a=t+r,l=o.widest.width;let c,u;return n==="left"?s?(u=this.right+r,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?s?(u=this.left+r,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,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:i,top:s,width:r,height:o}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(i,s,r,o),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(r=>r.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(n.display)for(r=0,o=s.length;r{this.draw(r)}}]:[{z:i,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let r,o;for(r=0,o=n.length;r{const i=n.split("."),s=i.pop(),r=[e].concat(i).join("."),o=t[n].split("."),a=o.pop(),l=o.join(".");ne.route(r,s,l,a)})}function gR(e){return"id"in e&&"defaults"in e}let yR=class{constructor(){this.controllers=new nu(Zs,"datasets",!0),this.elements=new nu(os,"elements"),this.plugins=new nu(Object,"plugins"),this.scales=new nu(pc,"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,i){[...n].forEach(s=>{const r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):Et(s,o=>{const a=i||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,n,i){const s=ay(t);$t(i["before"+s],[],i),n[t](i),$t(i["after"+s],[],i)}_getRegistryForType(t){for(let n=0;nr.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(s(n,i),t,"stop"),this._notify(s(i,n),t,"start")}};function xR(e){const t={},n=[],i=Object.keys(hi.plugins.items);for(let r=0;r1&&Ex(e[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Ax(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function CR(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(i=>i.xAxisID===e||i.yAxisID===e);if(n.length)return Ax(e,"x",n[0])||Ax(e,"y",n[0])}return{}}function PR(e,t){const n=Fr[e.type]||{scales:{}},i=t.scales||{},s=wm(e.type,t),r=Object.create(null);return Object.keys(i).forEach(o=>{const a=i[o];if(!gt(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=km(o,a,CR(o,e),ne.scales[a.type]),c=SR(l,s),u=n.scales||{};r[o]=ul(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(o=>{const a=o.type||e.type,l=o.indexAxis||wm(a,t),u=(Fr[a]||{}).scales||{};Object.keys(u).forEach(d=>{const h=kR(d,l),f=o[h+"AxisID"]||h;r[f]=r[f]||Object.create(null),ul(r[f],[{axis:h},i[f],u[d]])})}),Object.keys(r).forEach(o=>{const a=r[o];ul(a,[ne.scales[a.type],ne.scale])}),r}function pM(e){const t=e.options||(e.options={});t.plugins=at(t.plugins,{}),t.scales=PR(e,t)}function mM(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function TR(e){return e=e||{},e.data=mM(e.data),pM(e),e}const Ox=new Map,gM=new Set;function iu(e,t){let n=Ox.get(e);return n||(n=t(),Ox.set(e,n),gM.add(n)),n}const ka=(e,t,n)=>{const i=zs(t,n);i!==void 0&&e.add(i)};let DR=class{constructor(t){this._config=TR(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=mM(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(),pM(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return iu(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return iu(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return iu(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return iu(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let s=i.get(t);return(!s||n)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,n,i){const{options:s,type:r}=this,o=this._cachedScopes(t,i),a=o.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>ka(l,t,d))),u.forEach(d=>ka(l,s,d)),u.forEach(d=>ka(l,Fr[r]||{},d)),u.forEach(d=>ka(l,ne,d)),u.forEach(d=>ka(l,bm,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),gM.has(n)&&o.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Fr[n]||{},ne.datasets[n]||{},{type:n},ne,bm]}resolveNamedOptions(t,n,i,s=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=Lx(this._resolverCache,t,s);let l=o;if(AR(o,n)){r.$shared=!1,i=Ws(i)?i():i;const c=this.createResolver(t,i,a);l=Ho(o,i,c)}for(const c of n)r[c]=l[c];return r}createResolver(t,n,i=[""],s){const{resolver:r}=Lx(this._resolverCache,t,i);return gt(n)?Ho(r,n,void 0,s):r}};function Lx(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const s=n.join();let r=i.get(s);return r||(r={resolver:fy(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,r)),r}const ER=e=>gt(e)&&Object.getOwnPropertyNames(e).some(t=>Ws(e[t]));function AR(e,t){const{isScriptable:n,isIndexable:i}=XS(e);for(const s of t){const r=n(s),o=i(s),a=(o||r)&&e[s];if(r&&(Ws(a)||ER(a))||o&&Ut(a))return!0}return!1}var OR="4.4.2";const LR=["top","bottom","left","right","chartArea"];function Rx(e,t){return e==="top"||e==="bottom"||LR.indexOf(e)===-1&&t==="x"}function Nx(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function jx(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),$t(n&&n.onComplete,[e],t)}function RR(e){const t=e.chart,n=t.options.animation;$t(n&&n.onProgress,[e],t)}function yM(e){return gy()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Zu={},$x=e=>{const t=yM(e);return Object.values(Zu).filter(n=>n.canvas===t).pop()};function NR(e,t,n){const i=Object.keys(e);for(const s of i){const r=+s;if(r>=t){const o=e[s];delete e[s],(n>0||r>t)&&(e[r+n]=o)}}}function jR(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}function su(e,t,n){return e.options.clip?e[n]:t[n]}function $R(e,t){const{xScale:n,yScale:i}=e;return n&&i?{left:su(n,t,"left"),right:su(n,t,"right"),top:su(i,t,"top"),bottom:su(i,t,"bottom")}:t}var fs;let by=(fs=class{static register(...t){hi.add(...t),Ix()}static unregister(...t){hi.remove(...t),Ix()}constructor(t,n){const i=this.config=new DR(n),s=yM(t),r=$x(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||tR(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=LA(),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 vR,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=GA(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],Zu[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Ai.listen(this,"complete",jx),Ai.listen(this,"progress",RR),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:s,_aspectRatio:r}=this;return bt(t)?n&&r?r:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return hi}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():rx(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return nx(this.canvas,this.ctx),this}stop(){return Ai.stop(this),this}resize(t,n){Ai.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,n,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,rx(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),$t(i.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Et(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,s=Object.keys(i).reduce((o,a)=>(o[a]=!1,o),{});let r=[];n&&(r=r.concat(Object.keys(n).map(o=>{const a=n[o],l=km(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Et(r,o=>{const a=o.options,l=a.id,c=km(l,a),u=at(a.type,o.dtype);(a.position===void 0||Rx(a.position,c)!==Rx(o.dposition))&&(a.position=o.dposition),s[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{const h=hi.getScale(u);d=new h({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),Et(s,(o,a)=>{o||delete i[a]}),Et(i,o=>{Fe.configure(this,o,o.options),Fe.addBox(this,o)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((s,r)=>s.index-r.index),i>n){for(let s=n;sn.length&&delete this._stacks,t.forEach((i,s)=>{n.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Nx("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Et(this.scales,t=>{Fe.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Xv(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:r}of n){const o=i==="_removeElements"?-r:r;NR(t,s,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),s=i(0);for(let r=1;rr.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Fe.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],Et(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,i=t._clip,s=!i.disabled,r=$R(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&Ch(n,{left:i.left===!1?0:r.left-i.left,right:i.right===!1?this.width:r.right+i.right,top:i.top===!1?0:r.top-i.top,bottom:i.bottom===!1?this.height:r.bottom+i.bottom}),t.controller.draw(),s&&Ph(n),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return Wi(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,s){const r=LL.modes[n];return typeof r=="function"?r(this,t,i,s):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let s=i.filter(r=>r&&r._dataset===n).pop();return s||(s={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},i.push(s)),s}getContext(){return this.$context||(this.$context=Qs(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){const s=i?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,s);zl(n)?(r.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(r,{visible:i}),this.update(a=>a.datasetIndex===t?s: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(),Ai.remove(this),t=0,n=this.data.datasets.length;t{n.addEventListener(this,r,o),t[r]=o},s=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};Et(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,i=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",r),i("detach",o)};o=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){Et(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Et(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const s=i?"set":"remove";let r,o,a,l;for(n==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a{const a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!Ld(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,i){const s=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),o=r(n,t),a=i?t:r(t,n);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,n){const i={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},s=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const r=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(t,n,i){const{_active:s=[],options:r}=this,o=n,a=this._getActiveElements(t,s,i,o),l=FA(t),c=jR(t,this._lastEvent,i,l);i&&(this._lastEvent=null,$t(r.onHover,[t,a,this],this),l&&$t(r.onClick,[t,a,this],this));const u=!Ld(a,s);return(u||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=c,u}_getActiveElements(t,n,i,s){if(t.type==="mouseout")return[];if(!i)return n;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}},K(fs,"defaults",ne),K(fs,"instances",Zu),K(fs,"overrides",Fr),K(fs,"registry",hi),K(fs,"version",OR),K(fs,"getChart",$x),fs);function Ix(){return Et(by.instances,e=>e._plugins.invalidate())}function IR(e,t,n){const{startAngle:i,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=t;let c=s/a;e.beginPath(),e.arc(r,o,a,i-c,n+c),l>s?(c=s/l,e.arc(r,o,l,n+c,i-c,!0)):e.arc(r,o,s,n+ue,i-ue),e.closePath(),e.clip()}function FR(e){return hy(e,["outerStart","outerEnd","innerStart","innerEnd"])}function BR(e,t,n,i){const s=FR(e.options.borderRadius),r=(n-t)/2,o=Math.min(r,i*t/2),a=l=>{const c=(n-Math.min(r,l))*i/2;return we(l,0,Math.min(r,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:we(s.innerStart,0,o),innerEnd:we(s.innerEnd,0,o)}}function Zr(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function Fd(e,t,n,i,s,r){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+i+n-c,0),h=u>0?u+i+n+c:0;let f=0;const p=s-l;if(i){const L=u>0?u-i:0,R=d>0?d-i:0,B=(L+R)/2,D=B!==0?p*B/(B+i):p;f=(p-D)/2}const m=Math.max(.001,p*d-n/Kt)/d,v=(p-m)/2,y=l+v+f,g=s-v-f,{outerStart:x,outerEnd:_,innerStart:w,innerEnd:S}=BR(t,h,d,g-y),C=d-x,M=d-_,P=y+x/C,T=g-_/M,A=h+w,E=h+S,z=y+w/A,N=g-S/E;if(e.beginPath(),r){const L=(P+T)/2;if(e.arc(o,a,d,P,L),e.arc(o,a,d,L,T),_>0){const $=Zr(M,T,o,a);e.arc($.x,$.y,_,T,g+ue)}const R=Zr(E,g,o,a);if(e.lineTo(R.x,R.y),S>0){const $=Zr(E,N,o,a);e.arc($.x,$.y,S,g+ue,N+Math.PI)}const B=(g-S/h+(y+w/h))/2;if(e.arc(o,a,h,g-S/h,B,!0),e.arc(o,a,h,B,y+w/h,!0),w>0){const $=Zr(A,z,o,a);e.arc($.x,$.y,w,z+Math.PI,y-ue)}const D=Zr(C,y,o,a);if(e.lineTo(D.x,D.y),x>0){const $=Zr(C,P,o,a);e.arc($.x,$.y,x,y-ue,P)}}else{e.moveTo(o,a);const L=Math.cos(P)*d+o,R=Math.sin(P)*d+a;e.lineTo(L,R);const B=Math.cos(T)*d+o,D=Math.sin(T)*d+a;e.lineTo(B,D)}e.closePath()}function VR(e,t,n,i,s){const{fullCircles:r,startAngle:o,circumference:a}=t;let l=t.endAngle;if(r){Fd(e,t,n,i,l,s);for(let c=0;c=Xt||Wl(o,l,c),v=Vi(a,u+f,d+f);return m&&v}getCenterPoint(n){const{x:i,y:s,startAngle:r,endAngle:o,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:u}=this.options,d=(r+o)/2,h=(a+l+u+c)/2;return{x:i+Math.cos(d)*h,y:s+Math.sin(d)*h}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:i,circumference:s}=this,r=(i.offset||0)/4,o=(i.spacing||0)/2,a=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>Xt?Math.floor(s/Xt):0,s===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*r,Math.sin(l)*r);const c=1-Math.sin(Math.min(Kt,s||0)),u=r*c;n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,VR(n,this,u,o,a),zR(n,this,u,o,a),n.restore()}},K(io,"id","arc"),K(io,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),K(io,"defaultRoutes",{backgroundColor:"backgroundColor"}),K(io,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"}),io);function xM(e,t,n=t){e.lineCap=at(n.borderCapStyle,t.borderCapStyle),e.setLineDash(at(n.borderDash,t.borderDash)),e.lineDashOffset=at(n.borderDashOffset,t.borderDashOffset),e.lineJoin=at(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=at(n.borderWidth,t.borderWidth),e.strokeStyle=at(n.borderColor,t.borderColor)}function WR(e,t,n){e.lineTo(n.x,n.y)}function HR(e){return e.stepped?aO:e.tension||e.cubicInterpolationMode==="monotone"?lO:WR}function bM(e,t,n={}){const i=e.length,{start:s=0,end:r=i-1}=n,{start:o,end:a}=t,l=Math.max(s,o),c=Math.min(r,a),u=sa&&r>a;return{count:i,start:l,loop:t.loop,ilen:c(o+(c?a-_:_))%r,x=()=>{m!==v&&(e.lineTo(u,v),e.lineTo(u,m),e.lineTo(u,y))};for(l&&(f=s[g(0)],e.moveTo(f.x,f.y)),h=0;h<=a;++h){if(f=s[g(h)],f.skip)continue;const _=f.x,w=f.y,S=_|0;S===p?(wv&&(v=w),u=(d*u+_)/++d):(x(),e.lineTo(_,w),p=S,d=0,m=v=w),y=w}x()}function Sm(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?YR:UR}function XR(e){return e.stepped?BO:e.tension||e.cubicInterpolationMode==="monotone"?VO:pr}function KR(e,t,n,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,i)&&s.closePath()),xM(e,t.options),e.stroke(s)}function GR(e,t,n,i){const{segments:s,options:r}=t,o=Sm(t);for(const a of s)xM(e,r,a.style),e.beginPath(),o(e,t,a,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const qR=typeof Path2D=="function";function QR(e,t,n,i){qR&&!t.options.segment?KR(e,t,n,i):GR(e,t,n,i)}var so;let Dh=(so=class extends os{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 i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;OO(this._points,i,t,s,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=XO(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,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){const i=this.options,s=t[n],r=this.points,o=iM(this,{property:n,start:s,end:s});if(!o.length)return;const a=[],l=XR(i);let c,u;for(c=0,u=o.length;ct!=="borderDash"&&t!=="fill"}),so);function Fx(e,t,n,i){const s=e.options,{[n]:r}=e.getProps([n],i);return Math.abs(t-r)e.replace("rgb(","rgba(").replace(")",", 0.5)"));function SM(e){return Mm[e%Mm.length]}function MM(e){return Bx[e%Bx.length]}function s2(e,t){return e.borderColor=SM(t),e.backgroundColor=MM(t),++t}function r2(e,t){return e.backgroundColor=e.data.map(()=>SM(t++)),t}function o2(e,t){return e.backgroundColor=e.data.map(()=>MM(t++)),t}function a2(e){let t=0;return(n,i)=>{const s=e.getDatasetMeta(i).controller;s instanceof vy?t=r2(n,t):s instanceof aM?t=o2(n,t):s&&(t=s2(n,t))}}function Vx(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function l2(e){return e&&(e.borderColor||e.backgroundColor)}var c2={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:i},options:s}=e.config,{elements:r}=s;if(!n.forceOverride&&(Vx(i)||l2(s)||r&&Vx(r)))return;const o=a2(e);i.forEach(o)}};function u2(e,t,n,i,s){const r=s.samples||i;if(r>=n)return e.slice(t,t+n);const o=[],a=(n-2)/(r-2);let l=0;const c=t+n-1;let u=t,d,h,f,p,m;for(o[l++]=e[u],d=0;df&&(f=p,h=e[g],m=g);o[l++]=h,u=m}return o[l++]=e[c],o}function d2(e,t,n,i){let s=0,r=0,o,a,l,c,u,d,h,f,p,m;const v=[],y=t+n-1,g=e[t].x,_=e[y].x-g;for(o=t;om&&(m=c,h=o),s=(r*s+a.x)/++r;else{const S=o-1;if(!bt(d)&&!bt(h)){const C=Math.min(d,h),M=Math.max(d,h);C!==f&&C!==S&&v.push({...e[C],x:s}),M!==f&&M!==S&&v.push({...e[M],x:s})}o>0&&S!==f&&v.push(e[S]),v.push(a),u=w,r=0,p=m=c,d=h=f=o}}return v}function CM(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function zx(e){e.data.datasets.forEach(t=>{CM(t)})}function h2(e,t){const n=t.length;let i=0,s;const{iScale:r}=e,{min:o,max:a,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=we(zi(t,r.axis,o).lo,0,n-1)),c?s=we(zi(t,r.axis,a).hi+1,i,n)-i:s=n-i,{start:i,count:s}}var f2={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){zx(e);return}const i=e.width;e.data.datasets.forEach((s,r)=>{const{_data:o,indexAxis:a}=s,l=e.getDatasetMeta(r),c=o||s.data;if(Ht([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:d,count:h}=h2(l,c);const f=n.threshold||4*i;if(h<=f){CM(s);return}bt(o)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let p;switch(n.algorithm){case"lttb":p=u2(c,d,h,i,n);break;case"min-max":p=d2(c,d,h,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}s._decimated=p})},destroy(e){zx(e)}};function p2(e,t,n){const i=e.segments,s=e.points,r=t.points,o=[];for(const a of i){let{start:l,end:c}=a;c=_y(l,c,s);const u=Cm(n,s[l],s[c],a.loop);if(!t.segments){o.push({source:a,target:u,start:s[l],end:s[c]});continue}const d=iM(t,u);for(const h of d){const f=Cm(n,r[h.start],r[h.end],h.loop),p=nM(a,s,f);for(const m of p)o.push({source:m,target:h,start:{[n]:Wx(u,f,"start",Math.max)},end:{[n]:Wx(u,f,"end",Math.min)}})}}return o}function Cm(e,t,n,i){if(i)return;let s=t[e],r=n[e];return e==="angle"&&(s=yn(s),r=yn(r)),{property:e,start:s,end:r}}function m2(e,t){const{x:n=null,y:i=null}=e||{},s=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=_y(o,a,s);const l=s[o],c=s[a];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):n!==null&&(r.push({x:n,y:l.y}),r.push({x:n,y:c.y}))}),r}function _y(e,t,n){for(;t>e;t--){const i=n[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Wx(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function PM(e,t){let n=[],i=!1;return Ut(e)?(i=!0,n=e):n=m2(e,t),n.length?new Dh({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function Hx(e){return e&&e.fill!==!1}function g2(e,t,n){let s=e[t].fill;const r=[t];let o;if(!n)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!oe(s))return s;if(o=e[s],!o)return!1;if(o.visible)return s;r.push(s),s=o.fill}return!1}function y2(e,t,n){const i=_2(e);if(gt(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return oe(s)&&Math.floor(s)===s?v2(i[0],t,s,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function v2(e,t,n,i){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=i?!1:n}function x2(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:gt(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function b2(e,t,n){let i;return e==="start"?i=n:e==="end"?i=t.options.reverse?t.min:t.max:gt(e)?i=e.value:i=t.getBaseValue(),i}function _2(e){const t=e.options,n=t.fill;let i=at(n&&n.target,n);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function w2(e){const{scale:t,index:n,line:i}=e,s=[],r=i.segments,o=i.points,a=k2(t,n);a.push(PM({x:null,y:t.bottom},i));for(let l=0;l=0;--o){const a=s[o].$filler;a&&(a.line.updateControlPoints(r,a.axis),i&&a.fill&&Hf(e.ctx,a,r))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=e.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const r=i[s].$filler;Hx(r)&&Hf(e.ctx,r,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;!Hx(i)||n.drawTime!=="beforeDatasetDraw"||Hf(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Kx=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}},R2=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;let Gx=class extends os{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,i){this.maxWidth=t,this.maxHeight=n,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=$t(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,s)=>t.sort(i,s,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 i=t.labels,s=ge(i.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Kx(i,r);let c,u;n.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,r,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,s){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a;let d=t;r.textAlign="left",r.textBaseline="middle";let h=-1,f=-u;return this.legendItems.forEach((p,m)=>{const v=i+n/2+r.measureText(p.text).width;(m===0||c[c.length-1]+v+2*a>o)&&(d+=u,c[c.length-(m>0?0:1)]=0,f+=u,h++),l[m]={left:0,top:f,row:h,width:v,height:s},c[c.length-1]+=v+a}),d}_fitCols(t,n,i,s){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-t;let d=a,h=0,f=0,p=0,m=0;return this.legendItems.forEach((v,y)=>{const{itemWidth:g,itemHeight:x}=N2(i,n,r,v,s);y>0&&f+x+2*a>u&&(d+=h+a,c.push({width:h,height:f}),p+=h+a,m++,h=f=0),l[y]={left:p,top:f,col:m,width:g,height:x},h=Math.max(h,g),f+=x+a}),d+=h,c.push({width:h,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:r}}=this,o=Oo(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=Ne(i,this.left+s,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=Ne(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+s}else{let a=0,l=Ne(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=Ne(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Ch(t,this),this._draw(),Ph(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:s}=this,{align:r,labels:o}=t,a=ne.color,l=Oo(t.rtl,this.left,this.width),c=ge(o.font),{padding:u}=o,d=c.size,h=d/2;let f;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:p,boxHeight:m,itemHeight:v}=Kx(o,d),y=function(S,C,M){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;s.save();const P=at(M.lineWidth,1);if(s.fillStyle=at(M.fillStyle,a),s.lineCap=at(M.lineCap,"butt"),s.lineDashOffset=at(M.lineDashOffset,0),s.lineJoin=at(M.lineJoin,"miter"),s.lineWidth=P,s.strokeStyle=at(M.strokeStyle,a),s.setLineDash(at(M.lineDash,[])),o.usePointStyle){const T={radius:m*Math.SQRT2/2,pointStyle:M.pointStyle,rotation:M.rotation,borderWidth:P},A=l.xPlus(S,p/2),E=C+h;US(s,T,A,E,o.pointStyleWidth&&p)}else{const T=C+Math.max((d-m)/2,0),A=l.leftForLtr(S,p),E=Cr(M.borderRadius);s.beginPath(),Object.values(E).some(z=>z!==0)?Hl(s,{x:A,y:T,w:p,h:m,radius:E}):s.rect(A,T,p,m),s.fill(),P!==0&&s.stroke()}s.restore()},g=function(S,C,M){Br(s,M.text,S,C+v/2,c,{strikethrough:M.hidden,textAlign:l.textAlign(M.textAlign)})},x=this.isHorizontal(),_=this._computeTitleHeight();x?f={x:Ne(r,this.left+u,this.right-i[0]),y:this.top+u+_,line:0}:f={x:this.left+u,y:Ne(r,this.top+_+u,this.bottom-n[0].height),line:0},JS(this.ctx,t.textDirection);const w=v+u;this.legendItems.forEach((S,C)=>{s.strokeStyle=S.fontColor,s.fillStyle=S.fontColor;const M=s.measureText(S.text).width,P=l.textAlign(S.textAlign||(S.textAlign=o.textAlign)),T=p+h+M;let A=f.x,E=f.y;l.setWidth(this.width),x?C>0&&A+T+u>this.right&&(E=f.y+=w,f.line++,A=f.x=Ne(r,this.left+u,this.right-i[f.line])):C>0&&E+w>this.bottom&&(A=f.x=A+n[f.line].width+u,f.line++,E=f.y=Ne(r,this.top+_+u,this.bottom-n[f.line].height));const z=l.x(A);if(y(z,E,S),A=qA(P,A+p+h,x?A+T:this.right,t.rtl),g(l.x(A),E,S),x)f.x+=T+u;else if(typeof S.text!="string"){const N=c.lineHeight;f.y+=DM(S,N)+u}else f.y+=w}),tM(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=ge(n.font),s=Ae(n.padding);if(!n.display)return;const r=Oo(t.rtl,this.left,this.width),o=this.ctx,a=n.position,l=i.size/2,c=s.top+l;let u,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,d=Ne(t.align,d,this.right-h);else{const p=this.columnSizes.reduce((m,v)=>Math.max(m,v.height),0);u=c+Ne(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const f=Ne(a,d,d+h);o.textAlign=r.textAlign(uy(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=i.string,Br(o,n.text,f,u,i)}_computeTitleHeight(){const t=this.options.title,n=ge(t.font),i=Ae(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,s,r;if(Vi(t,this.left,this.right)&&Vi(n,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;ir.length>o.length?r:o)),t+n.size/2+i.measureText(s).width}function $2(e,t,n){let i=e;return typeof t.text!="string"&&(i=DM(t,n)),i}function DM(e,t){const n=e.text?e.text.length:0;return t*n}function I2(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var F2={id:"legend",_element:Gx,start(e,t,n){const i=e.legend=new Gx({ctx:e.ctx,options:n,chart:e});Fe.configure(e,i,n),Fe.addBox(e,i)},stop(e){Fe.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;Fe.configure(e,i,n),i.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 i=t.datasetIndex,s=n.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),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:i,textAlign:s,color:r,useBorderRadius:o,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=Ae(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:r,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};let wy=class extends os{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 i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const s=Ut(i.text)?i.text.length:1;this._padding=Ae(i.padding);const r=s*ge(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:i,bottom:s,right:r,options:o}=this,a=o.align;let l=0,c,u,d;return this.isHorizontal()?(u=Ne(a,i,r),d=n+t,c=r-i):(o.position==="left"?(u=i+t,d=Ne(a,s,n),l=Kt*-.5):(u=r-t,d=Ne(a,n,s),l=Kt*.5),c=s-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=ge(n.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);Br(t,n.text,0,0,i,{color:n.color,maxWidth:l,rotation:c,textAlign:uy(n.align),textBaseline:"middle",translation:[o,a]})}};function B2(e,t){const n=new wy({ctx:e.ctx,options:t,chart:e});Fe.configure(e,n,t),Fe.addBox(e,n),e.titleBlock=n}var V2={id:"title",_element:wy,start(e,t,n){B2(e,n)},stop(e){const t=e.titleBlock;Fe.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;Fe.configure(e,i,n),i.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 ru=new WeakMap;var z2={id:"subtitle",start(e,t,n){const i=new wy({ctx:e.ctx,options:n,chart:e});Fe.configure(e,i,n),Fe.addBox(e,i),ru.set(e,i)},stop(e){Fe.removeBox(e,ru.get(e)),ru.delete(e)},beforeUpdate(e,t,n){const i=ru.get(e);Fe.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const qa={average(e){if(!e.length)return!1;let t,n,i=new Set,s=0,r=0;for(t=0,n=e.length;ta+l)/i.size,y:s/r}},nearest(e,t){if(!e.length)return!1;let n=t.x,i=t.y,s=Number.POSITIVE_INFINITY,r,o,a;for(r=0,o=e.length;ra({chart:t,initial:n.initial,numSteps:o,currentStep:Math.min(i-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=BS.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const r=i.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),r.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),n+=r.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}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((i,s)=>Math.max(i,s._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 i=n.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};var Ai=new qO;const ux="transparent",QO={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=tx(e||ux),s=i.valid&&tx(t||ux);return s&&s.valid?s.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};let ZO=class{constructor(t,n,i,s){const r=n[i];s=Ht([t.to,s,r,t.from]);const o=Ht([t.from,r,s]);this._active=!0,this._fn=t.fn||QO[t.type||typeof o],this._easing=hl[t.easing]||hl.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=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);const s=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Ht([t.to,n,s,t.from]),this._from=Ht([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,i=this._duration,s=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||n1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){const n=t?"res":"rej",i=this._promises||[];for(let s=0;s{const r=t[s];if(!gt(r))return;const o={};for(const a of n)o[a]=r[a];(Ut(r.properties)&&r.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,o)})})}_animateOptions(t,n){const i=n.options,s=t2(t,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&JO(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,n){const i=this._properties,s=[],r=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"){s.push(...this._animateOptions(t,n));continue}const u=n[c];let d=r[c];const h=i.get(c);if(d)if(h&&d.active()){d.update(h,u,a);continue}else d.cancel();if(!h||!h.duration){t[c]=u;continue}r[c]=d=new ZO(h,t,c,u),s.push(d)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return Ai.add(this._chart,i),!0}};function JO(e,t){const n=[],i=Object.keys(t);for(let s=0;s0||!n&&r<0)return s.index}return null}function mx(e,t){const{chart:n,_cachedMeta:i}=e,s=n._stacks||(n._stacks={}),{iScale:r,vScale:o,index:a}=i,l=r.axis,c=o.axis,u=s2(r,o,i),d=t.length;let h;for(let f=0;fn[i].axis===t).shift()}function a2(e,t){return Qs(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function l2(e,t,n){return Qs(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function xa(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const s of t){const r=s._stacks;if(!r||r[i]===void 0||r[i][n]===void 0)return;delete r[i][n],r[i]._visualValues!==void 0&&r[i]._visualValues[n]!==void 0&&delete r[i]._visualValues[n]}}}const $f=e=>e==="reset"||e==="none",gx=(e,t)=>t?e:Object.assign({},e),c2=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:rM(n,!0),values:null};var Na;let Zs=(Na=class{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=fx(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&&xa(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(d,h,f,p)=>d==="x"?h:d==="r"?p:f,r=n.xAxisID=at(i.xAxisID,jf(t,"x")),o=n.yAxisID=at(i.yAxisID,jf(t,"y")),a=n.rAxisID=at(i.rAxisID,jf(t,"r")),l=n.indexAxis,c=n.iAxisID=s(l,r,o,a),u=n.vAxisID=s(l,o,r,a);n.xScale=this.getScaleForId(r),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&&Qv(this._data,this),t._stacked&&xa(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(gt(n))this._data=i2(n);else if(i!==n){if(i){Qv(i,this);const s=this._cachedMeta;xa(s),s._parsed=[]}n&&Object.isExtensible(n)&&KA(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,i=this.getDataset();let s=!1;this._dataCheck();const r=n._stacked;n._stacked=fx(n.vScale,n),n.stack!==i.stack&&(s=!0,xa(n),n.stack=i.stack),this._resyncElements(t),(s||r!==n._stacked)&&mx(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:i,_data:s}=this,{iScale:r,_stacked:o}=i,a=r.axis;let l=t===0&&n===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,d,h;if(this._parsing===!1)i._parsed=s,i._sorted=!0,h=s;else{Ut(s[t])?h=this.parseArrayData(i,s,t,n):gt(s[t])?h=this.parseObjectData(i,s,t,n):h=this.parsePrimitiveData(i,s,t,n);const f=()=>d[a]===null||c&&d[a]m||d=0;--h)if(!p()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let s,r,o;for(s=0,r=n.length;s=0&&tthis.getContext(i,s,n),m=c.resolveNamedOptions(h,f,p,d);return m.$shared&&(m.$shared=l,r[o]=Object.freeze(gx(m,l))),m}_resolveAnimations(t,n,i){const s=this.chart,r=this._cachedDataOpts,o=`animation-${n}`,a=r[o];if(a)return a;let l;if(s.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),h=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(h,this.getContext(t,i,n))}const c=new sM(s,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||$f(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),s=this._sharedOptions,r=this.getSharedOptions(i),o=this.includeOptions(n,r)||r!==s;return this.updateSharedOptions(r,n,i),{sharedOptions:r,includeOptions:o}}updateElement(t,n,i,s){$f(s)?Object.assign(t,i):this._resolveAnimations(n,s).update(t,i)}updateSharedOptions(t,n,i){t&&!$f(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,s){t.active=s;const r=this.getStyle(n,s);this._resolveAnimations(n,i,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=i.length,r=n.length,o=Math.min(r,s);o&&this.parse(0,o),r>s?this._insertElements(s,r-s,t):r{for(c.length+=n,a=c.length-1;a>=o;a--)c[a]=c[a-n]};for(l(r),a=t;as-r))}return e._cache.$bar}function d2(e){const t=e.iScale,n=u2(t,e.type);let i=t._length,s,r,o,a;const l=()=>{o===32767||o===-32768||(zl(a)&&(i=Math.min(i,Math.abs(o-a)||i)),a=o)};for(s=0,r=n.length;s0?s[e-1]:null,a=eMath.abs(a)&&(l=a,c=o),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}function oM(e,t,n,i){return Ut(e)?p2(e,t,n,i):t[n.axis]=n.parse(e,i),t}function yx(e,t,n,i){const s=e.iScale,r=e.vScale,o=s.getLabels(),a=s===r,l=[];let c,u,d,h;for(c=n,u=n+i;c=n?1:-1)}function g2(e){let t,n,i,s,r;return e.horizontal?(t=e.base>e.x,n="left",i="right"):(t=e.basel.controller.options.grouped),r=i.options.stacked,o=[],a=l=>{const c=l.controller.getParsed(n),u=c&&c[l.vScale.axis];if(bt(u)||isNaN(u))return!0};for(const l of s)if(!(n!==void 0&&a(l))&&((r===!1||o.indexOf(l.stack)===-1||r===void 0&&l.stack===void 0)&&o.push(l.stack),l.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,i){const s=this._getStacks(t,i),r=n!==void 0?s.indexOf(n):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,n=this._cachedMeta,i=n.iScale,s=[];let r,o;for(r=0,o=n.data.length;r=0;--i)n=Math.max(n,t[i].size(this.resolveDataElementOptions(i))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=n,o=this.getParsed(t),a=s.getLabelForValue(o.x),l=r.getLabelForValue(o.y),c=o._custom;return{label:i[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,i,s){const r=s==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,s),u=o.axis,d=a.axis;for(let h=n;hWl(x,a,l,!0)?1:Math.max(_,_*n,w,w*n),p=(x,_,w)=>Wl(x,a,l,!0)?-1:Math.min(_,_*n,w,w*n),m=f(0,c,d),v=f(ue,u,h),y=p(Kt,c,d),g=p(Kt+ue,u,h);i=(m-y)/2,s=(v-g)/2,r=-(m+y)/2,o=-(v+g)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:o}}var no;let vy=(no=class extends Zs{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let r=l=>+i[l];if(gt(i[t])){const{key:l="value"}=this._parsing;r=c=>+zs(i[c],l)}let o,a;for(o=t,a=t+n;o0&&!isNaN(t)?Xt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=hc(n._parsed[t],i.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let n=0;const i=this.chart;let s,r,o,a,l;if(!t){for(s=0,r=i.data.datasets.length;st!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),K(no,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return n.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}}}),no);var Ia;let k2=(Ia=class extends Zs{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=n,o=this.chart._animationsDisabled;let{start:a,count:l}=zS(n,s,o);this._drawStart=a,this._drawCount=l,WS(n)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,n,i,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,s),h=o.axis,f=a.axis,{spanGaps:p,segment:m}=this.options,v=Wo(p)?p:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||r||s==="none",g=n+i,x=t.length;let _=n>0&&this.getParsed(n-1);for(let w=0;w=g){C.skip=!0;continue}const M=this.getParsed(w),P=bt(M[f]),T=C[h]=o.getPixelForValue(M[h],w),A=C[f]=r||P?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,M,l):M[f],w);C.skip=isNaN(T)||isNaN(A)||P,C.stop=w>0&&Math.abs(M[h]-_[h])>v,m&&(C.parsed=M,C.raw=c.data[w]),d&&(C.options=u||this.resolveDataElementOptions(w,S.active?"active":s)),y||this.updateElement(S,w,C,s),_=M}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const r=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},K(Ia,"id","line"),K(Ia,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),K(Ia,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}}),Ia);var Fa;let aM=(Fa=class extends Zs{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=hc(n._parsed[t].r,i.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,n,i,s){return QS.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(rn.max&&(n.max=r))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,i=t.options,s=Math.min(n.right-n.left,n.bottom-n.top),r=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,i,s){const r=s==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,h=c.getIndexAngle(0)-.5*Kt;let f=h,p;const m=360/this.countVisibleElements();for(p=0;p{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&n++}),n}_computeAngle(t,n,i){return this.chart.getDataVisibility(t)?Jn(this.resolveDataElementOptions(t,n).angle||i):0}},K(Fa,"id","polarArea"),K(Fa,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),K(Fa,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return n.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}}),Fa);var Ou;let S2=(Ou=class extends vy{},K(Ou,"id","pie"),K(Ou,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"}),Ou);var Ba;let M2=(Ba=class extends Zs{getLabelAndValue(t){const n=this._cachedMeta.vScale,i=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(i[n.axis])}}parseObjectData(t,n,i,s){return QS.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta,i=n.dataset,s=n.data||[],r=n.iScale.getLabels();if(i.points=s,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:r.length===s.length,options:o};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,n,i,s){const r=this._cachedMeta.rScale,o=s==="reset";for(let a=n;a0&&this.getParsed(n-1);for(let _=n;_0&&Math.abs(S[f]-x[f])>y,v&&(C.parsed=S,C.raw=c.data[_]),h&&(C.options=d||this.resolveDataElementOptions(_,w.active?"active":s)),g||this.updateElement(w,_,C,s),x=S}this.updateSharedOptions(d,s,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!n.length)return s;const r=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,r,o)/2}},K(Va,"id","scatter"),K(Va,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),K(Va,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}}),Va);var P2=Object.freeze({__proto__:null,BarController:b2,BubbleController:_2,DoughnutController:vy,LineController:k2,PieController:S2,PolarAreaController:aM,RadarController:M2,ScatterController:C2});function or(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class xy{constructor(t){K(this,"options");this.options=t||{}}static override(t){Object.assign(xy.prototype,t)}init(){}formats(){return or()}parse(){return or()}format(){return or()}add(){return or()}diff(){return or()}startOf(){return or()}endOf(){return or()}}var T2={_date:xy};function D2(e,t,n,i){const{controller:s,data:r,_sorted:o}=e,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&o&&r.length){const l=a._reversePixels?YA:zi;if(i){if(s._sharedOptions){const c=r[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(r,t,n-u),h=l(r,t,n+u);return{lo:d.lo,hi:h.hi}}}}else return l(r,t,n)}return{lo:0,hi:r.length-1}}function fc(e,t,n,i,s){const r=e.getSortedVisibleDatasetMetas(),o=n[t];for(let a=0,l=r.length;a{l[o](t[n],s)&&(r.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:r}var L2={evaluateInteractionItems:fc,modes:{index(e,t,n,i){const s=fr(t,e),r=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?Ff(e,s,r,i,o):Bf(e,s,r,!1,i,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,i){const s=fr(t,e),r=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?Ff(e,s,r,i,o):Bf(e,s,r,!1,i,o);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;un.pos===t)}function _x(e,t){return e.filter(n=>lM.indexOf(n.pos)===-1&&n.box.axis===t)}function _a(e,t){return e.sort((n,i)=>{const s=t?i:n,r=t?n:i;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function R2(e){const t=[];let n,i,s,r,o,a;for(n=0,i=(e||[]).length;nc.box.fullSize),!0),i=_a(ba(t,"left"),!0),s=_a(ba(t,"right")),r=_a(ba(t,"top"),!0),o=_a(ba(t,"bottom")),a=_x(t,"x"),l=_x(t,"y");return{fullSize:n,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:ba(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}function wx(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function cM(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 I2(e,t,n,i){const{pos:s,box:r}=n,o=e.maxPadding;if(!gt(s)){n.size&&(e[s]-=n.size);const d=i[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?r.height:r.width),n.size=d.size/d.count,e[s]+=n.size}r.getPadding&&cM(o,r.getPadding());const a=Math.max(0,t.outerWidth-wx(o,e,"left","right")),l=Math.max(0,t.outerHeight-wx(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 F2(e){const t=e.maxPadding;function n(i){const s=Math.max(t[i]-e[i],0);return e[i]+=s,s}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function B2(e,t){const n=t.maxPadding;function i(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{r[o]=Math.max(t[o],n[o])}),r}return i(e?["left","right"]:["top","bottom"])}function Ga(e,t,n,i){const s=[];let r,o,a,l,c,u;for(r=0,o=e.length,c=0;r{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=l.reduce((m,v)=>v.box.options&&v.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/u,hBoxMaxHeight:o/2}),h=Object.assign({},s);cM(h,Ae(i));const f=Object.assign({maxPadding:h,w:r,h:o,x:s.left,y:s.top},s),p=j2(l.concat(c),d);Ga(a.fullSize,f,d,p),Ga(l,f,d,p),Ga(c,f,d,p)&&Ga(l,f,d,p),F2(f),kx(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,kx(a.rightAndBottom,f,d,p),e.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},Et(a.chartArea,m=>{const v=m.box;Object.assign(v,e.chartArea),v.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};let uM=class{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,s){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,s?Math.floor(n/s):i)}}isAttached(t){return!0}updateConfig(t){}},V2=class extends uM{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}};const Qu="$chartjs",z2={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Sx=e=>e===null||e==="";function W2(e,t){const n=e.style,i=e.getAttribute("height"),s=e.getAttribute("width");if(e[Qu]={initial:{height:i,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Sx(s)){const r=ox(e,"width");r!==void 0&&(e.width=r)}if(Sx(i))if(e.style.height==="")e.height=e.width/(t||2);else{const r=ox(e,"height");r!==void 0&&(e.height=r)}return e}const dM=FO?{passive:!0}:!1;function H2(e,t,n){e&&e.addEventListener(t,n,dM)}function U2(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,dM)}function Y2(e,t){const n=z2[e.type]||e.type,{x:i,y:s}=fr(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Id(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function X2(e,t,n){const i=e.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||Id(a.addedNodes,i),o=o&&!Id(a.removedNodes,i);o&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function K2(e,t,n){const i=e.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||Id(a.removedNodes,i),o=o&&!Id(a.addedNodes,i);o&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const Ul=new Map;let Mx=0;function hM(){const e=window.devicePixelRatio;e!==Mx&&(Mx=e,Ul.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function G2(e,t){Ul.size||window.addEventListener("resize",hM),Ul.set(e,t)}function q2(e){Ul.delete(e),Ul.size||window.removeEventListener("resize",hM)}function Q2(e,t,n){const i=e.canvas,s=i&&yy(i);if(!s)return;const r=VS((a,l)=>{const c=s.clientWidth;n(a,l),c{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return o.observe(s),G2(e,r),o}function Vf(e,t,n){n&&n.disconnect(),t==="resize"&&q2(e)}function Z2(e,t,n){const i=e.canvas,s=VS(r=>{e.ctx!==null&&n(Y2(r,e))},e);return H2(i,t,s),s}let J2=class extends uM{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(W2(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[Qu])return!1;const i=n[Qu].initial;["height","width"].forEach(r=>{const o=i[r];bt(o)?n.removeAttribute(r):n.setAttribute(r,o)});const s=i.style||{};return Object.keys(s).forEach(r=>{n.style[r]=s[r]}),n.width=n.width,delete n[Qu],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const s=t.$proxies||(t.$proxies={}),o={attach:X2,detach:K2,resize:Q2}[n]||Z2;s[n]=o(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),s=i[n];if(!s)return;({attach:Vf,detach:Vf,resize:Vf}[n]||U2)(t,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,s){return IO(t,n,i,s)}isAttached(t){const n=yy(t);return!!(n&&n.isConnected)}};function tL(e){return!gy()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?V2:J2}var Lu;let os=(Lu=class{constructor(){K(this,"x");K(this,"y");K(this,"active",!1);K(this,"options");K(this,"$animations")}tooltipPosition(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return Wo(this.x)&&Wo(this.y)}getProps(t,n){const i=this.$animations;if(!n||!i)return this;const s={};return t.forEach(r=>{s[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),s}},K(Lu,"defaults",{}),K(Lu,"defaultRoutes"),Lu);function eL(e,t){const n=e.options.ticks,i=nL(e),s=Math.min(n.maxTicksLimit||i,i),r=n.major.enabled?sL(t):[],o=r.length,a=r[0],l=r[o-1],c=[];if(o>s)return rL(t,c,r,o/s),c;const u=iL(r,t,s);if(o>0){let d,h;const f=o>1?Math.round((l-a)/(o-1)):null;for(eu(t,c,u,bt(f)?0:a-f,a),d=0,h=o-1;ds)return l}return Math.max(s,1)}function sL(e){const t=[];let n,i;for(n=0,i=e.length;ne==="left"?"right":e==="right"?"left":e,Cx=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Px=(e,t)=>Math.min(t||e,e);function Tx(e,t){const n=[],i=e.length/t,s=e.length;let r=0;for(;ro+a)))return l}function cL(e,t){Et(e,n=>{const i=n.gc,s=i.length/2;let r;if(s>t){for(r=0;ri?i:n,i=s&&n>i?n:i,{min:mn(n,mn(i,n)),max:mn(i,mn(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){$t(this.options.beforeUpdate,[this])}update(t,n,i){const{beginAtZero:s,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=gO(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),d=u.widest.width,h=u.highest.height,f=we(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:f/(i-1),d+6>a&&(a=f/(i-(t.offset?.5:1)),l=this.maxHeight-wa(t.grid)-n.padding-Dx(t.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),o=ly(Math.min(Math.asin(we((u.highest.height+6)/a,-1,1)),Math.asin(we(l/c,-1,1))-Math.asin(we(h/c,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){$t(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){$t(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=Dx(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=wa(r)+l):(t.height=this.maxHeight,t.width=wa(r)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),f=i.padding*2,p=Jn(this.labelRotation),m=Math.cos(p),v=Math.sin(p);if(a){const y=i.mirror?0:v*d.width+m*h.height;t.height=Math.min(this.maxHeight,t.height+y+f)}else{const y=i.mirror?0:m*d.width+v*h.height;t.width=Math.min(this.maxWidth,t.width+y+f)}this._calculatePadding(c,u,v,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,i,s){const{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,f=0;l?c?(h=s*t.width,f=i*n.height):(h=i*t.height,f=s*n.width):r==="start"?f=n.width:r==="end"?h=t.width:r!=="inner"&&(h=t.width/2,f=n.width/2),this.paddingLeft=Math.max((h-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((f-d+o)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;r==="start"?(u=0,d=t.height):r==="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(){$t(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,i;for(n=0,i=t.length;n({width:o[P]||0,height:a[P]||0});return{first:M(0),last:M(n-1),widest:M(S),highest:M(C),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 UA(this._alignToPixels?rr(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&&ta*s?a/i:l/s:l*s0}_computeGridLineItems(t){const n=this.axis,i=this.chart,s=this.options,{grid:r,position:o,border:a}=s,l=r.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),h=wa(r),f=[],p=a.setContext(this.getContext()),m=p.display?p.width:0,v=m/2,y=function(R){return rr(i,R,m)};let g,x,_,w,S,C,M,P,T,A,E,z;if(o==="top")g=y(this.bottom),C=this.bottom-h,P=g-v,A=y(t.top)+v,z=t.bottom;else if(o==="bottom")g=y(this.top),A=t.top,z=y(t.bottom)-v,C=g+v,P=this.top+h;else if(o==="left")g=y(this.right),S=this.right-h,M=g-v,T=y(t.left)+v,E=t.right;else if(o==="right")g=y(this.left),T=t.left,E=y(t.right)-v,S=g+v,M=this.left+h;else if(n==="x"){if(o==="center")g=y((t.top+t.bottom)/2+.5);else if(gt(o)){const R=Object.keys(o)[0],B=o[R];g=y(this.chart.scales[R].getPixelForValue(B))}A=t.top,z=t.bottom,C=g+v,P=C+h}else if(n==="y"){if(o==="center")g=y((t.left+t.right)/2);else if(gt(o)){const R=Object.keys(o)[0],B=o[R];g=y(this.chart.scales[R].getPixelForValue(B))}S=g-v,M=S-h,T=t.left,E=t.right}const N=at(s.ticks.maxTicksLimit,d),L=Math.max(1,Math.ceil(d/N));for(x=0;x0&&(U-=Z/2);break}V={left:U,top:O,width:Z+W.width,height:et+W.height,color:L.backdropColor}}v.push({label:_,font:P,textOffset:E,options:{rotation:m,color:B,strokeColor:D,strokeWidth:$,textAlign:F,textBaseline:z,translation:[w,S],backdrop:V}})}return v}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Jn(this.labelRotation))return t==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:i,mirror:s,padding:r}}=this.options,o=this._getLabelSizes(),a=t+r,l=o.widest.width;let c,u;return n==="left"?s?(u=this.right+r,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?s?(u=this.left+r,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,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:i,top:s,width:r,height:o}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(i,s,r,o),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(r=>r.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(n.display)for(r=0,o=s.length;r{this.draw(r)}}]:[{z:i,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let r,o;for(r=0,o=n.length;r{const i=n.split("."),s=i.pop(),r=[e].concat(i).join("."),o=t[n].split("."),a=o.pop(),l=o.join(".");ne.route(r,s,l,a)})}function gL(e){return"id"in e&&"defaults"in e}let yL=class{constructor(){this.controllers=new nu(Zs,"datasets",!0),this.elements=new nu(os,"elements"),this.plugins=new nu(Object,"plugins"),this.scales=new nu(pc,"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,i){[...n].forEach(s=>{const r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):Et(s,o=>{const a=i||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,n,i){const s=ay(t);$t(i["before"+s],[],i),n[t](i),$t(i["after"+s],[],i)}_getRegistryForType(t){for(let n=0;nr.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(s(n,i),t,"stop"),this._notify(s(i,n),t,"start")}};function xL(e){const t={},n=[],i=Object.keys(hi.plugins.items);for(let r=0;r1&&Ex(e[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Ax(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function CL(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(i=>i.xAxisID===e||i.yAxisID===e);if(n.length)return Ax(e,"x",n[0])||Ax(e,"y",n[0])}return{}}function PL(e,t){const n=Fr[e.type]||{scales:{}},i=t.scales||{},s=wm(e.type,t),r=Object.create(null);return Object.keys(i).forEach(o=>{const a=i[o];if(!gt(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=km(o,a,CL(o,e),ne.scales[a.type]),c=SL(l,s),u=n.scales||{};r[o]=ul(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(o=>{const a=o.type||e.type,l=o.indexAxis||wm(a,t),u=(Fr[a]||{}).scales||{};Object.keys(u).forEach(d=>{const h=kL(d,l),f=o[h+"AxisID"]||h;r[f]=r[f]||Object.create(null),ul(r[f],[{axis:h},i[f],u[d]])})}),Object.keys(r).forEach(o=>{const a=r[o];ul(a,[ne.scales[a.type],ne.scale])}),r}function pM(e){const t=e.options||(e.options={});t.plugins=at(t.plugins,{}),t.scales=PL(e,t)}function mM(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function TL(e){return e=e||{},e.data=mM(e.data),pM(e),e}const Ox=new Map,gM=new Set;function iu(e,t){let n=Ox.get(e);return n||(n=t(),Ox.set(e,n),gM.add(n)),n}const ka=(e,t,n)=>{const i=zs(t,n);i!==void 0&&e.add(i)};let DL=class{constructor(t){this._config=TL(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=mM(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(),pM(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return iu(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return iu(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return iu(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return iu(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let s=i.get(t);return(!s||n)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,n,i){const{options:s,type:r}=this,o=this._cachedScopes(t,i),a=o.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>ka(l,t,d))),u.forEach(d=>ka(l,s,d)),u.forEach(d=>ka(l,Fr[r]||{},d)),u.forEach(d=>ka(l,ne,d)),u.forEach(d=>ka(l,bm,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),gM.has(n)&&o.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Fr[n]||{},ne.datasets[n]||{},{type:n},ne,bm]}resolveNamedOptions(t,n,i,s=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=Lx(this._resolverCache,t,s);let l=o;if(AL(o,n)){r.$shared=!1,i=Ws(i)?i():i;const c=this.createResolver(t,i,a);l=Ho(o,i,c)}for(const c of n)r[c]=l[c];return r}createResolver(t,n,i=[""],s){const{resolver:r}=Lx(this._resolverCache,t,i);return gt(n)?Ho(r,n,void 0,s):r}};function Lx(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const s=n.join();let r=i.get(s);return r||(r={resolver:fy(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,r)),r}const EL=e=>gt(e)&&Object.getOwnPropertyNames(e).some(t=>Ws(e[t]));function AL(e,t){const{isScriptable:n,isIndexable:i}=XS(e);for(const s of t){const r=n(s),o=i(s),a=(o||r)&&e[s];if(r&&(Ws(a)||EL(a))||o&&Ut(a))return!0}return!1}var OL="4.4.2";const LL=["top","bottom","left","right","chartArea"];function Rx(e,t){return e==="top"||e==="bottom"||LL.indexOf(e)===-1&&t==="x"}function Nx(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function jx(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),$t(n&&n.onComplete,[e],t)}function RL(e){const t=e.chart,n=t.options.animation;$t(n&&n.onProgress,[e],t)}function yM(e){return gy()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Zu={},$x=e=>{const t=yM(e);return Object.values(Zu).filter(n=>n.canvas===t).pop()};function NL(e,t,n){const i=Object.keys(e);for(const s of i){const r=+s;if(r>=t){const o=e[s];delete e[s],(n>0||r>t)&&(e[r+n]=o)}}}function jL(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}function su(e,t,n){return e.options.clip?e[n]:t[n]}function $L(e,t){const{xScale:n,yScale:i}=e;return n&&i?{left:su(n,t,"left"),right:su(n,t,"right"),top:su(i,t,"top"),bottom:su(i,t,"bottom")}:t}var fs;let by=(fs=class{static register(...t){hi.add(...t),Ix()}static unregister(...t){hi.remove(...t),Ix()}constructor(t,n){const i=this.config=new DL(n),s=yM(t),r=$x(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||tL(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=LA(),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 vL,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=GA(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],Zu[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Ai.listen(this,"complete",jx),Ai.listen(this,"progress",RL),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:s,_aspectRatio:r}=this;return bt(t)?n&&r?r:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return hi}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():rx(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return nx(this.canvas,this.ctx),this}stop(){return Ai.stop(this),this}resize(t,n){Ai.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,n,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,rx(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),$t(i.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Et(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,s=Object.keys(i).reduce((o,a)=>(o[a]=!1,o),{});let r=[];n&&(r=r.concat(Object.keys(n).map(o=>{const a=n[o],l=km(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Et(r,o=>{const a=o.options,l=a.id,c=km(l,a),u=at(a.type,o.dtype);(a.position===void 0||Rx(a.position,c)!==Rx(o.dposition))&&(a.position=o.dposition),s[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{const h=hi.getScale(u);d=new h({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),Et(s,(o,a)=>{o||delete i[a]}),Et(i,o=>{Fe.configure(this,o,o.options),Fe.addBox(this,o)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((s,r)=>s.index-r.index),i>n){for(let s=n;sn.length&&delete this._stacks,t.forEach((i,s)=>{n.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Nx("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Et(this.scales,t=>{Fe.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Xv(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:r}of n){const o=i==="_removeElements"?-r:r;NL(t,s,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),s=i(0);for(let r=1;rr.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Fe.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],Et(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,i=t._clip,s=!i.disabled,r=$L(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&Ch(n,{left:i.left===!1?0:r.left-i.left,right:i.right===!1?this.width:r.right+i.right,top:i.top===!1?0:r.top-i.top,bottom:i.bottom===!1?this.height:r.bottom+i.bottom}),t.controller.draw(),s&&Ph(n),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return Wi(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,s){const r=L2.modes[n];return typeof r=="function"?r(this,t,i,s):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let s=i.filter(r=>r&&r._dataset===n).pop();return s||(s={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},i.push(s)),s}getContext(){return this.$context||(this.$context=Qs(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){const s=i?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,s);zl(n)?(r.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(r,{visible:i}),this.update(a=>a.datasetIndex===t?s: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(),Ai.remove(this),t=0,n=this.data.datasets.length;t{n.addEventListener(this,r,o),t[r]=o},s=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};Et(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,i=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",r),i("detach",o)};o=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){Et(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Et(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const s=i?"set":"remove";let r,o,a,l;for(n==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a{const a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!Ld(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,i){const s=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),o=r(n,t),a=i?t:r(t,n);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,n){const i={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},s=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const r=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(t,n,i){const{_active:s=[],options:r}=this,o=n,a=this._getActiveElements(t,s,i,o),l=FA(t),c=jL(t,this._lastEvent,i,l);i&&(this._lastEvent=null,$t(r.onHover,[t,a,this],this),l&&$t(r.onClick,[t,a,this],this));const u=!Ld(a,s);return(u||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=c,u}_getActiveElements(t,n,i,s){if(t.type==="mouseout")return[];if(!i)return n;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}},K(fs,"defaults",ne),K(fs,"instances",Zu),K(fs,"overrides",Fr),K(fs,"registry",hi),K(fs,"version",OL),K(fs,"getChart",$x),fs);function Ix(){return Et(by.instances,e=>e._plugins.invalidate())}function IL(e,t,n){const{startAngle:i,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=t;let c=s/a;e.beginPath(),e.arc(r,o,a,i-c,n+c),l>s?(c=s/l,e.arc(r,o,l,n+c,i-c,!0)):e.arc(r,o,s,n+ue,i-ue),e.closePath(),e.clip()}function FL(e){return hy(e,["outerStart","outerEnd","innerStart","innerEnd"])}function BL(e,t,n,i){const s=FL(e.options.borderRadius),r=(n-t)/2,o=Math.min(r,i*t/2),a=l=>{const c=(n-Math.min(r,l))*i/2;return we(l,0,Math.min(r,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:we(s.innerStart,0,o),innerEnd:we(s.innerEnd,0,o)}}function Zr(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function Fd(e,t,n,i,s,r){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+i+n-c,0),h=u>0?u+i+n+c:0;let f=0;const p=s-l;if(i){const L=u>0?u-i:0,R=d>0?d-i:0,B=(L+R)/2,D=B!==0?p*B/(B+i):p;f=(p-D)/2}const m=Math.max(.001,p*d-n/Kt)/d,v=(p-m)/2,y=l+v+f,g=s-v-f,{outerStart:x,outerEnd:_,innerStart:w,innerEnd:S}=BL(t,h,d,g-y),C=d-x,M=d-_,P=y+x/C,T=g-_/M,A=h+w,E=h+S,z=y+w/A,N=g-S/E;if(e.beginPath(),r){const L=(P+T)/2;if(e.arc(o,a,d,P,L),e.arc(o,a,d,L,T),_>0){const $=Zr(M,T,o,a);e.arc($.x,$.y,_,T,g+ue)}const R=Zr(E,g,o,a);if(e.lineTo(R.x,R.y),S>0){const $=Zr(E,N,o,a);e.arc($.x,$.y,S,g+ue,N+Math.PI)}const B=(g-S/h+(y+w/h))/2;if(e.arc(o,a,h,g-S/h,B,!0),e.arc(o,a,h,B,y+w/h,!0),w>0){const $=Zr(A,z,o,a);e.arc($.x,$.y,w,z+Math.PI,y-ue)}const D=Zr(C,y,o,a);if(e.lineTo(D.x,D.y),x>0){const $=Zr(C,P,o,a);e.arc($.x,$.y,x,y-ue,P)}}else{e.moveTo(o,a);const L=Math.cos(P)*d+o,R=Math.sin(P)*d+a;e.lineTo(L,R);const B=Math.cos(T)*d+o,D=Math.sin(T)*d+a;e.lineTo(B,D)}e.closePath()}function VL(e,t,n,i,s){const{fullCircles:r,startAngle:o,circumference:a}=t;let l=t.endAngle;if(r){Fd(e,t,n,i,l,s);for(let c=0;c=Xt||Wl(o,l,c),v=Vi(a,u+f,d+f);return m&&v}getCenterPoint(n){const{x:i,y:s,startAngle:r,endAngle:o,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:u}=this.options,d=(r+o)/2,h=(a+l+u+c)/2;return{x:i+Math.cos(d)*h,y:s+Math.sin(d)*h}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:i,circumference:s}=this,r=(i.offset||0)/4,o=(i.spacing||0)/2,a=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>Xt?Math.floor(s/Xt):0,s===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*r,Math.sin(l)*r);const c=1-Math.sin(Math.min(Kt,s||0)),u=r*c;n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,VL(n,this,u,o,a),zL(n,this,u,o,a),n.restore()}},K(io,"id","arc"),K(io,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),K(io,"defaultRoutes",{backgroundColor:"backgroundColor"}),K(io,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"}),io);function xM(e,t,n=t){e.lineCap=at(n.borderCapStyle,t.borderCapStyle),e.setLineDash(at(n.borderDash,t.borderDash)),e.lineDashOffset=at(n.borderDashOffset,t.borderDashOffset),e.lineJoin=at(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=at(n.borderWidth,t.borderWidth),e.strokeStyle=at(n.borderColor,t.borderColor)}function WL(e,t,n){e.lineTo(n.x,n.y)}function HL(e){return e.stepped?aO:e.tension||e.cubicInterpolationMode==="monotone"?lO:WL}function bM(e,t,n={}){const i=e.length,{start:s=0,end:r=i-1}=n,{start:o,end:a}=t,l=Math.max(s,o),c=Math.min(r,a),u=sa&&r>a;return{count:i,start:l,loop:t.loop,ilen:c(o+(c?a-_:_))%r,x=()=>{m!==v&&(e.lineTo(u,v),e.lineTo(u,m),e.lineTo(u,y))};for(l&&(f=s[g(0)],e.moveTo(f.x,f.y)),h=0;h<=a;++h){if(f=s[g(h)],f.skip)continue;const _=f.x,w=f.y,S=_|0;S===p?(wv&&(v=w),u=(d*u+_)/++d):(x(),e.lineTo(_,w),p=S,d=0,m=v=w),y=w}x()}function Sm(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?YL:UL}function XL(e){return e.stepped?BO:e.tension||e.cubicInterpolationMode==="monotone"?VO:pr}function KL(e,t,n,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,i)&&s.closePath()),xM(e,t.options),e.stroke(s)}function GL(e,t,n,i){const{segments:s,options:r}=t,o=Sm(t);for(const a of s)xM(e,r,a.style),e.beginPath(),o(e,t,a,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const qL=typeof Path2D=="function";function QL(e,t,n,i){qL&&!t.options.segment?KL(e,t,n,i):GL(e,t,n,i)}var so;let Dh=(so=class extends os{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 i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;OO(this._points,i,t,s,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=XO(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,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){const i=this.options,s=t[n],r=this.points,o=iM(this,{property:n,start:s,end:s});if(!o.length)return;const a=[],l=XL(i);let c,u;for(c=0,u=o.length;ct!=="borderDash"&&t!=="fill"}),so);function Fx(e,t,n,i){const s=e.options,{[n]:r}=e.getProps([n],i);return Math.abs(t-r)e.replace("rgb(","rgba(").replace(")",", 0.5)"));function SM(e){return Mm[e%Mm.length]}function MM(e){return Bx[e%Bx.length]}function sR(e,t){return e.borderColor=SM(t),e.backgroundColor=MM(t),++t}function rR(e,t){return e.backgroundColor=e.data.map(()=>SM(t++)),t}function oR(e,t){return e.backgroundColor=e.data.map(()=>MM(t++)),t}function aR(e){let t=0;return(n,i)=>{const s=e.getDatasetMeta(i).controller;s instanceof vy?t=rR(n,t):s instanceof aM?t=oR(n,t):s&&(t=sR(n,t))}}function Vx(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function lR(e){return e&&(e.borderColor||e.backgroundColor)}var cR={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:i},options:s}=e.config,{elements:r}=s;if(!n.forceOverride&&(Vx(i)||lR(s)||r&&Vx(r)))return;const o=aR(e);i.forEach(o)}};function uR(e,t,n,i,s){const r=s.samples||i;if(r>=n)return e.slice(t,t+n);const o=[],a=(n-2)/(r-2);let l=0;const c=t+n-1;let u=t,d,h,f,p,m;for(o[l++]=e[u],d=0;df&&(f=p,h=e[g],m=g);o[l++]=h,u=m}return o[l++]=e[c],o}function dR(e,t,n,i){let s=0,r=0,o,a,l,c,u,d,h,f,p,m;const v=[],y=t+n-1,g=e[t].x,_=e[y].x-g;for(o=t;om&&(m=c,h=o),s=(r*s+a.x)/++r;else{const S=o-1;if(!bt(d)&&!bt(h)){const C=Math.min(d,h),M=Math.max(d,h);C!==f&&C!==S&&v.push({...e[C],x:s}),M!==f&&M!==S&&v.push({...e[M],x:s})}o>0&&S!==f&&v.push(e[S]),v.push(a),u=w,r=0,p=m=c,d=h=f=o}}return v}function CM(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function zx(e){e.data.datasets.forEach(t=>{CM(t)})}function hR(e,t){const n=t.length;let i=0,s;const{iScale:r}=e,{min:o,max:a,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=we(zi(t,r.axis,o).lo,0,n-1)),c?s=we(zi(t,r.axis,a).hi+1,i,n)-i:s=n-i,{start:i,count:s}}var fR={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){zx(e);return}const i=e.width;e.data.datasets.forEach((s,r)=>{const{_data:o,indexAxis:a}=s,l=e.getDatasetMeta(r),c=o||s.data;if(Ht([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:d,count:h}=hR(l,c);const f=n.threshold||4*i;if(h<=f){CM(s);return}bt(o)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let p;switch(n.algorithm){case"lttb":p=uR(c,d,h,i,n);break;case"min-max":p=dR(c,d,h,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}s._decimated=p})},destroy(e){zx(e)}};function pR(e,t,n){const i=e.segments,s=e.points,r=t.points,o=[];for(const a of i){let{start:l,end:c}=a;c=_y(l,c,s);const u=Cm(n,s[l],s[c],a.loop);if(!t.segments){o.push({source:a,target:u,start:s[l],end:s[c]});continue}const d=iM(t,u);for(const h of d){const f=Cm(n,r[h.start],r[h.end],h.loop),p=nM(a,s,f);for(const m of p)o.push({source:m,target:h,start:{[n]:Wx(u,f,"start",Math.max)},end:{[n]:Wx(u,f,"end",Math.min)}})}}return o}function Cm(e,t,n,i){if(i)return;let s=t[e],r=n[e];return e==="angle"&&(s=yn(s),r=yn(r)),{property:e,start:s,end:r}}function mR(e,t){const{x:n=null,y:i=null}=e||{},s=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=_y(o,a,s);const l=s[o],c=s[a];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):n!==null&&(r.push({x:n,y:l.y}),r.push({x:n,y:c.y}))}),r}function _y(e,t,n){for(;t>e;t--){const i=n[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Wx(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function PM(e,t){let n=[],i=!1;return Ut(e)?(i=!0,n=e):n=mR(e,t),n.length?new Dh({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function Hx(e){return e&&e.fill!==!1}function gR(e,t,n){let s=e[t].fill;const r=[t];let o;if(!n)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!oe(s))return s;if(o=e[s],!o)return!1;if(o.visible)return s;r.push(s),s=o.fill}return!1}function yR(e,t,n){const i=_R(e);if(gt(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return oe(s)&&Math.floor(s)===s?vR(i[0],t,s,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function vR(e,t,n,i){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=i?!1:n}function xR(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:gt(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function bR(e,t,n){let i;return e==="start"?i=n:e==="end"?i=t.options.reverse?t.min:t.max:gt(e)?i=e.value:i=t.getBaseValue(),i}function _R(e){const t=e.options,n=t.fill;let i=at(n&&n.target,n);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function wR(e){const{scale:t,index:n,line:i}=e,s=[],r=i.segments,o=i.points,a=kR(t,n);a.push(PM({x:null,y:t.bottom},i));for(let l=0;l=0;--o){const a=s[o].$filler;a&&(a.line.updateControlPoints(r,a.axis),i&&a.fill&&Hf(e.ctx,a,r))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=e.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const r=i[s].$filler;Hx(r)&&Hf(e.ctx,r,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;!Hx(i)||n.drawTime!=="beforeDatasetDraw"||Hf(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Kx=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}},RR=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;let Gx=class extends os{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,i){this.maxWidth=t,this.maxHeight=n,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=$t(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,s)=>t.sort(i,s,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 i=t.labels,s=ge(i.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Kx(i,r);let c,u;n.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,r,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,s){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a;let d=t;r.textAlign="left",r.textBaseline="middle";let h=-1,f=-u;return this.legendItems.forEach((p,m)=>{const v=i+n/2+r.measureText(p.text).width;(m===0||c[c.length-1]+v+2*a>o)&&(d+=u,c[c.length-(m>0?0:1)]=0,f+=u,h++),l[m]={left:0,top:f,row:h,width:v,height:s},c[c.length-1]+=v+a}),d}_fitCols(t,n,i,s){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-t;let d=a,h=0,f=0,p=0,m=0;return this.legendItems.forEach((v,y)=>{const{itemWidth:g,itemHeight:x}=NR(i,n,r,v,s);y>0&&f+x+2*a>u&&(d+=h+a,c.push({width:h,height:f}),p+=h+a,m++,h=f=0),l[y]={left:p,top:f,col:m,width:g,height:x},h=Math.max(h,g),f+=x+a}),d+=h,c.push({width:h,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:r}}=this,o=Oo(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=Ne(i,this.left+s,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=Ne(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+s}else{let a=0,l=Ne(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=Ne(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Ch(t,this),this._draw(),Ph(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:s}=this,{align:r,labels:o}=t,a=ne.color,l=Oo(t.rtl,this.left,this.width),c=ge(o.font),{padding:u}=o,d=c.size,h=d/2;let f;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:p,boxHeight:m,itemHeight:v}=Kx(o,d),y=function(S,C,M){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;s.save();const P=at(M.lineWidth,1);if(s.fillStyle=at(M.fillStyle,a),s.lineCap=at(M.lineCap,"butt"),s.lineDashOffset=at(M.lineDashOffset,0),s.lineJoin=at(M.lineJoin,"miter"),s.lineWidth=P,s.strokeStyle=at(M.strokeStyle,a),s.setLineDash(at(M.lineDash,[])),o.usePointStyle){const T={radius:m*Math.SQRT2/2,pointStyle:M.pointStyle,rotation:M.rotation,borderWidth:P},A=l.xPlus(S,p/2),E=C+h;US(s,T,A,E,o.pointStyleWidth&&p)}else{const T=C+Math.max((d-m)/2,0),A=l.leftForLtr(S,p),E=Cr(M.borderRadius);s.beginPath(),Object.values(E).some(z=>z!==0)?Hl(s,{x:A,y:T,w:p,h:m,radius:E}):s.rect(A,T,p,m),s.fill(),P!==0&&s.stroke()}s.restore()},g=function(S,C,M){Br(s,M.text,S,C+v/2,c,{strikethrough:M.hidden,textAlign:l.textAlign(M.textAlign)})},x=this.isHorizontal(),_=this._computeTitleHeight();x?f={x:Ne(r,this.left+u,this.right-i[0]),y:this.top+u+_,line:0}:f={x:this.left+u,y:Ne(r,this.top+_+u,this.bottom-n[0].height),line:0},JS(this.ctx,t.textDirection);const w=v+u;this.legendItems.forEach((S,C)=>{s.strokeStyle=S.fontColor,s.fillStyle=S.fontColor;const M=s.measureText(S.text).width,P=l.textAlign(S.textAlign||(S.textAlign=o.textAlign)),T=p+h+M;let A=f.x,E=f.y;l.setWidth(this.width),x?C>0&&A+T+u>this.right&&(E=f.y+=w,f.line++,A=f.x=Ne(r,this.left+u,this.right-i[f.line])):C>0&&E+w>this.bottom&&(A=f.x=A+n[f.line].width+u,f.line++,E=f.y=Ne(r,this.top+_+u,this.bottom-n[f.line].height));const z=l.x(A);if(y(z,E,S),A=qA(P,A+p+h,x?A+T:this.right,t.rtl),g(l.x(A),E,S),x)f.x+=T+u;else if(typeof S.text!="string"){const N=c.lineHeight;f.y+=DM(S,N)+u}else f.y+=w}),tM(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=ge(n.font),s=Ae(n.padding);if(!n.display)return;const r=Oo(t.rtl,this.left,this.width),o=this.ctx,a=n.position,l=i.size/2,c=s.top+l;let u,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,d=Ne(t.align,d,this.right-h);else{const p=this.columnSizes.reduce((m,v)=>Math.max(m,v.height),0);u=c+Ne(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const f=Ne(a,d,d+h);o.textAlign=r.textAlign(uy(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=i.string,Br(o,n.text,f,u,i)}_computeTitleHeight(){const t=this.options.title,n=ge(t.font),i=Ae(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,s,r;if(Vi(t,this.left,this.right)&&Vi(n,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;ir.length>o.length?r:o)),t+n.size/2+i.measureText(s).width}function $R(e,t,n){let i=e;return typeof t.text!="string"&&(i=DM(t,n)),i}function DM(e,t){const n=e.text?e.text.length:0;return t*n}function IR(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var FR={id:"legend",_element:Gx,start(e,t,n){const i=e.legend=new Gx({ctx:e.ctx,options:n,chart:e});Fe.configure(e,i,n),Fe.addBox(e,i)},stop(e){Fe.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;Fe.configure(e,i,n),i.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 i=t.datasetIndex,s=n.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),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:i,textAlign:s,color:r,useBorderRadius:o,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=Ae(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:r,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};let wy=class extends os{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 i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const s=Ut(i.text)?i.text.length:1;this._padding=Ae(i.padding);const r=s*ge(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:i,bottom:s,right:r,options:o}=this,a=o.align;let l=0,c,u,d;return this.isHorizontal()?(u=Ne(a,i,r),d=n+t,c=r-i):(o.position==="left"?(u=i+t,d=Ne(a,s,n),l=Kt*-.5):(u=r-t,d=Ne(a,n,s),l=Kt*.5),c=s-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=ge(n.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);Br(t,n.text,0,0,i,{color:n.color,maxWidth:l,rotation:c,textAlign:uy(n.align),textBaseline:"middle",translation:[o,a]})}};function BR(e,t){const n=new wy({ctx:e.ctx,options:t,chart:e});Fe.configure(e,n,t),Fe.addBox(e,n),e.titleBlock=n}var VR={id:"title",_element:wy,start(e,t,n){BR(e,n)},stop(e){const t=e.titleBlock;Fe.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;Fe.configure(e,i,n),i.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 ru=new WeakMap;var zR={id:"subtitle",start(e,t,n){const i=new wy({ctx:e.ctx,options:n,chart:e});Fe.configure(e,i,n),Fe.addBox(e,i),ru.set(e,i)},stop(e){Fe.removeBox(e,ru.get(e)),ru.delete(e)},beforeUpdate(e,t,n){const i=ru.get(e);Fe.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const qa={average(e){if(!e.length)return!1;let t,n,i=new Set,s=0,r=0;for(t=0,n=e.length;ta+l)/i.size,y:s/r}},nearest(e,t){if(!e.length)return!1;let n=t.x,i=t.y,s=Number.POSITIVE_INFINITY,r,o,a;for(r=0,o=e.length;r-1?e.split(` -`):e}function W2(e,t){const{element:n,datasetIndex:i,index:s}=t,r=e.getDatasetMeta(i).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:e,label:o,parsed:r.getParsed(s),raw:e.data.datasets[i].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:n}}function qx(e,t){const n=e.chart.ctx,{body:i,footer:s,title:r}=e,{boxWidth:o,boxHeight:a}=t,l=ge(t.bodyFont),c=ge(t.titleFont),u=ge(t.footerFont),d=r.length,h=s.length,f=i.length,p=Ae(t.padding);let m=p.height,v=0,y=i.reduce((_,w)=>_+w.before.length+w.lines.length+w.after.length,0);if(y+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),y){const _=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=f*_+(y-f)*l.lineHeight+(y-1)*t.bodySpacing}h&&(m+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let g=0;const x=function(_){v=Math.max(v,n.measureText(_).width+g)};return n.save(),n.font=c.string,Et(e.title,x),n.font=l.string,Et(e.beforeBody.concat(e.afterBody),x),g=t.displayColors?o+2+t.boxPadding:0,Et(i,_=>{Et(_.before,x),Et(_.lines,x),Et(_.after,x)}),g=0,n.font=u.string,Et(e.footer,x),n.restore(),v+=p.width,{width:v,height:m}}function H2(e,t){const{y:n,height:i}=t;return ne.height-i/2?"bottom":"center"}function U2(e,t,n,i){const{x:s,width:r}=i,o=n.caretSize+n.caretPadding;if(e==="left"&&s+r+o>t.width||e==="right"&&s-r-o<0)return!0}function Y2(e,t,n,i){const{x:s,width:r}=n,{width:o,chartArea:{left:a,right:l}}=e;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),U2(c,e,t,n)&&(c="center"),c}function Qx(e,t,n){const i=n.yAlign||t.yAlign||H2(e,n);return{xAlign:n.xAlign||t.xAlign||Y2(e,t,n,i),yAlign:i}}function X2(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function K2(e,t,n){let{y:i,height:s}=e;return t==="top"?i+=n:t==="bottom"?i-=s+n:i-=s/2,i}function Zx(e,t,n,i){const{caretSize:s,caretPadding:r,cornerRadius:o}=e,{xAlign:a,yAlign:l}=n,c=s+r,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:f}=Cr(o);let p=X2(t,a);const m=K2(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,h)+s:a==="right"&&(p+=Math.max(d,f)+s),{x:we(p,0,i.width-t.width),y:we(m,0,i.height-t.height)}}function ou(e,t,n){const i=Ae(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function Jx(e){return ci([],Oi(e))}function G2(e,t,n){return Qs(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function tb(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const EM={beforeTitle:Di,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex"u"?EM[t].call(n,i):s}var kp;let eb=(kp=class extends os{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,i=this.options.setContext(this.getContext()),s=i.enabled&&n.options.animation&&i.animations,r=new sM(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=G2(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,s=qe(i,"beforeTitle",this,t),r=qe(i,"title",this,t),o=qe(i,"afterTitle",this,t);let a=[];return a=ci(a,Oi(s)),a=ci(a,Oi(r)),a=ci(a,Oi(o)),a}getBeforeBody(t,n){return Jx(qe(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,s=[];return Et(t,r=>{const o={before:[],lines:[],after:[]},a=tb(i,r);ci(o.before,Oi(qe(a,"beforeLabel",this,r))),ci(o.lines,qe(a,"label",this,r)),ci(o.after,Oi(qe(a,"afterLabel",this,r))),s.push(o)}),s}getAfterBody(t,n){return Jx(qe(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,s=qe(i,"beforeFooter",this,t),r=qe(i,"footer",this,t),o=qe(i,"afterFooter",this,t);let a=[];return a=ci(a,Oi(s)),a=ci(a,Oi(r)),a=ci(a,Oi(o)),a}_createItems(t){const n=this._active,i=this.chart.data,s=[],r=[],o=[];let a=[],l,c;for(l=0,c=n.length;lt.filter(u,d,h,i))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,i))),Et(a,u=>{const d=tb(t.callbacks,u);s.push(qe(d,"labelColor",this,u)),r.push(qe(d,"labelPointStyle",this,u)),o.push(qe(d,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,n){const i=this.options.setContext(this.getContext()),s=this._active;let r,o=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const a=qa[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const l=this._size=qx(this,i),c=Object.assign({},a,l),u=Qx(this.chart,i,c),d=Zx(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,s){const r=this.getCaretPosition(t,i,s);n.lineTo(r.x1,r.y1),n.lineTo(r.x2,r.y2),n.lineTo(r.x3,r.y3)}getCaretPosition(t,n,i){const{xAlign:s,yAlign:r}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=Cr(a),{x:h,y:f}=t,{width:p,height:m}=n;let v,y,g,x,_,w;return r==="center"?(_=f+m/2,s==="left"?(v=h,y=v-o,x=_+o,w=_-o):(v=h+p,y=v+o,x=_-o,w=_+o),g=v):(s==="left"?y=h+Math.max(l,u)+o:s==="right"?y=h+p-Math.max(c,d)-o:y=this.caretX,r==="top"?(x=f,_=x-o,v=y-o,g=y+o):(x=f+m,_=x+o,v=y+o,g=y-o),w=x),{x1:v,x2:y,x3:g,y1:x,y2:_,y3:w}}drawTitle(t,n,i){const s=this.title,r=s.length;let o,a,l;if(r){const c=Oo(i.rtl,this.x,this.width);for(t.x=ou(this,i.titleAlign,i),n.textAlign=c.textAlign(i.titleAlign),n.textBaseline="middle",o=ge(i.titleFont),a=i.titleSpacing,n.fillStyle=i.titleColor,n.font=o.string,l=0;lg!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Hl(t,{x:m,y:p,w:c,h:l,radius:y}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Hl(t,{x:v,y:p+1,w:c-2,h:l-2,radius:y}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(m,p,c,l),t.strokeRect(m,p,c,l),t.fillStyle=o.backgroundColor,t.fillRect(v,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=ge(i.bodyFont);let h=d.lineHeight,f=0;const p=Oo(i.rtl,this.x,this.width),m=function(M){n.fillText(M,p.x(t.x+f),t.y+h/2),t.y+=h+r},v=p.textAlign(o);let y,g,x,_,w,S,C;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,t.x=ou(this,v,i),n.fillStyle=i.bodyColor,Et(this.beforeBody,m),f=a&&v!=="right"?o==="center"?c/2+u:c+2+u:0,_=0,S=s.length;_0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const o=qa[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=qx(this,t),l=Object.assign({},o,this._size),c=Qx(n,t,l),u=Zx(t,l,c,n);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Ae(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=i,this.drawBackground(r,t,s,n),JS(t,n.textDirection),r.y+=o.top,this.drawTitle(r,t,n),this.drawBody(r,t,n),this.drawFooter(r,t,n),tM(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!Ld(i,s),o=this._positionChanged(s,n);(r||o)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],o=this._getActiveElements(t,r,n,i),a=this._positionChanged(o,t),l=n||!Ld(o,r)||a;return l&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,i,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)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,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:i,caretY:s,options:r}=this,o=qa[r.position].call(this,t,n);return o!==!1&&(i!==o.x||s!==o.y)}},K(kp,"positioners",qa),kp);var q2={id:"tooltip",_element:eb,positioners:qa,afterInit(e,t,n){n&&(e.tooltip=new eb({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:EM},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"]},Q2=Object.freeze({__proto__:null,Colors:c2,Decimation:f2,Filler:L2,Legend:F2,SubTitle:z2,Title:V2,Tooltip:q2});const Z2=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function J2(e,t,n,i){const s=e.indexOf(t);if(s===-1)return Z2(e,t,n,i);const r=e.lastIndexOf(t);return s!==r?n:s}const tN=(e,t)=>e===null?null:we(Math.round(e),0,t);function nb(e){const t=this.getLabels();return e>=0&&en.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}},K(Ru,"id","category"),K(Ru,"defaults",{ticks:{callback:nb}}),Ru);function nN(e,t){const n=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=e,f=r||1,p=u-1,{min:m,max:v}=t,y=!bt(o),g=!bt(a),x=!bt(c),_=(v-m)/(d+1);let w=Gv((v-m)/p/f)*f,S,C,M,P;if(w<1e-14&&!y&&!g)return[{value:m},{value:v}];P=Math.ceil(v/w)-Math.floor(m/w),P>p&&(w=Gv(P*w/p/f)*f),bt(l)||(S=Math.pow(10,l),w=Math.ceil(w*S)/S),s==="ticks"?(C=Math.floor(m/w)*w,M=Math.ceil(v/w)*w):(C=m,M=v),y&&g&&r&&WA((a-o)/r,w/1e3)?(P=Math.round(Math.min((a-o)/w,u)),w=(a-o)/P,C=o,M=a):x?(C=y?o:C,M=g?a:M,P=c-1,w=(M-C)/P):(P=(M-C)/w,dl(P,Math.round(P),w/1e3)?P=Math.round(P):P=Math.ceil(P));const T=Math.max(qv(w),qv(C));S=Math.pow(10,bt(l)?T:l),C=Math.round(C*S)/S,M=Math.round(M*S)/S;let A=0;for(y&&(h&&C!==o?(n.push({value:o}),Ca)break;n.push({value:E})}return g&&h&&M!==a?n.length&&dl(n[n.length-1].value,a,ib(a,_,e))?n[n.length-1].value=a:n.push({value:a}):(!g||M===a)&&n.push({value:M}),n}function ib(e,t,{horizontal:n,minRotation:i}){const s=Jn(i),r=(n?Math.sin(s):Math.cos(s))||.001,o=.75*t*(""+e).length;return Math.min(t/r,o)}let Bd=class extends pc{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 bt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:s,max:r}=this;const o=l=>s=n?s:l,a=l=>r=i?r:l;if(t){const l=vi(s),c=vi(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(s===r){let l=r===0?1:Math.abs(r*.05);a(r+l),t||o(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},r=this._range||this,o=nN(s,r);return t.bounds==="ticks"&&jS(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,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-n)/Math.max(t.length-1,1)/2;n-=s,i+=s}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return hc(t,this.chart.options.locale,this.options.ticks.format)}};var Nu;let iN=(Nu=class extends Bd{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=oe(t)?t:0,this.max=oe(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=Jn(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}},K(Nu,"id","linear"),K(Nu,"defaults",{ticks:{callback:Mh.formatters.numeric}}),Nu);const Yl=e=>Math.floor(Ss(e)),ar=(e,t)=>Math.pow(10,Yl(e)+t);function sb(e){return e/Math.pow(10,Yl(e))===1}function rb(e,t,n){const i=Math.pow(10,n),s=Math.floor(e/i);return Math.ceil(t/i)-s}function sN(e,t){const n=t-e;let i=Yl(n);for(;rb(e,t,i)>10;)i++;for(;rb(e,t,i)<10;)i--;return Math.min(i,Yl(e))}function rN(e,{min:t,max:n}){t=mn(e.min,t);const i=[],s=Yl(t);let r=sN(t,n),o=r<0?Math.pow(10,Math.abs(r)):1;const a=Math.pow(10,r),l=s>r?Math.pow(10,s):0,c=Math.round((t-l)*o)/o,u=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((c-u)/Math.pow(10,r)),h=mn(e.min,Math.round((l+u+d*Math.pow(10,r))*o)/o);for(;h=10?d=d<15?15:20:d++,d>=20&&(r++,d=2,o=r>=0?1:o),h=Math.round((l+u+d*Math.pow(10,r))*o)/o;const f=mn(e.max,h);return i.push({value:f,major:sb(f),significand:d}),i}var ju;let oN=(ju=class extends pc{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const i=Bd.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return oe(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=oe(t)?Math.max(0,t):null,this.max=oe(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!oe(this._userMin)&&(this.min=t===ar(this.min,0)?ar(this.min,-1):ar(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let i=this.min,s=this.max;const r=a=>i=t?i:a,o=a=>s=n?s:a;i===s&&(i<=0?(r(1),o(10)):(r(ar(i,-1)),o(ar(s,1)))),i<=0&&r(ar(s,-1)),s<=0&&o(ar(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},i=rN(n,this);return t.bounds==="ticks"&&jS(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":hc(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ss(t),this._valueRange=Ss(this.max)-Ss(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ss(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}},K(ju,"id","logarithmic"),K(ju,"defaults",{ticks:{callback:Mh.formatters.logarithmic,major:{enabled:!0}}}),ju);function Pm(e){const t=e.ticks;if(t.display&&e.display){const n=Ae(t.backdropPadding);return at(t.font&&t.font.size,ne.font.size)+n.height}return 0}function aN(e,t,n){return n=Ut(n)?n:[n],{w:oO(e,t.string,n),h:n.length*t.lineHeight}}function ob(e,t,n,i,s){return e===i||e===s?{start:t-n/2,end:t+n/2}:es?{start:t-n,end:t}:{start:t,end:t+n}}function lN(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),i=[],s=[],r=e._pointLabels.length,o=e.options.pointLabels,a=o.centerPointLabels?Kt/r:0;for(let l=0;lt.r&&(a=(i.end-t.r)/r,e.r=Math.max(e.r,t.r+a)),s.startt.b&&(l=(s.end-t.b)/o,e.b=Math.max(e.b,t.b+l))}function uN(e,t,n){const i=e.drawingArea,{extra:s,additionalAngle:r,padding:o,size:a}=n,l=e.getPointPosition(t,i+s+o,r),c=Math.round(ly(yn(l.angle+ue))),u=mN(l.y,a.h,c),d=fN(c),h=pN(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+a.w,bottom:u+a.h}}function dN(e,t){if(!t)return!0;const{left:n,top:i,right:s,bottom:r}=e;return!(Wi({x:n,y:i},t)||Wi({x:n,y:r},t)||Wi({x:s,y:i},t)||Wi({x:s,y:r},t))}function hN(e,t,n){const i=[],s=e._pointLabels.length,r=e.options,{centerPointLabels:o,display:a}=r.pointLabels,l={extra:Pm(r)/2,additionalAngle:o?Kt/s:0};let c;for(let u=0;u270||n<90)&&(e-=t),e}function gN(e,t,n){const{left:i,top:s,right:r,bottom:o}=n,{backdropColor:a}=t;if(!bt(a)){const l=Cr(t.borderRadius),c=Ae(t.backdropPadding);e.fillStyle=a;const u=i-c.left,d=s-c.top,h=r-i+c.width,f=o-s+c.height;Object.values(l).some(p=>p!==0)?(e.beginPath(),Hl(e,{x:u,y:d,w:h,h:f,radius:l}),e.fill()):e.fillRect(u,d,h,f)}}function yN(e,t){const{ctx:n,options:{pointLabels:i}}=e;for(let s=t-1;s>=0;s--){const r=e._pointLabelItems[s];if(!r.visible)continue;const o=i.setContext(e.getPointLabelContext(s));gN(n,o,r);const a=ge(o.font),{x:l,y:c,textAlign:u}=r;Br(n,e._pointLabels[s],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function AM(e,t,n,i){const{ctx:s}=e;if(n)s.arc(e.xCenter,e.yCenter,t,0,Xt);else{let r=e.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let o=1;o{const s=$t(this.options.pointLabels.callback,[n,i],this);return s||s===0?s:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?lN(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,s){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,s))}getIndexAngle(t){const n=Xt/(this._pointLabels.length||1),i=this.options.startAngle||0;return yn(t*n+Jn(i))}getDistanceFromCenterForValue(t){if(bt(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(bt(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{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(d),f=s.setContext(h),p=r.setContext(h);vN(this,f,l,o,p)}}),i.display){for(t.save(),a=o-1;a>=0;a--){const u=i.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:h}=u;!h||!d||(t.lineWidth=h,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.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,i=n.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=i.setContext(this.getContext(l)),u=ge(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=Ae(c.backdropPadding);t.fillRect(-o/2-d.left,-r-u.size/2-d.top,o+d.width,u.size+d.height)}Br(t,a.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}},K(ro,"id","radialLinear"),K(ro,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Mh.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),K(ro,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),K(ro,"descriptors",{angleLines:{_fallback:"grid"}}),ro);const Eh={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}},tn=Object.keys(Eh);function ab(e,t){return e-t}function lb(e,t){if(bt(t))return null;const n=e._adapter,{parser:i,round:s,isoWeekday:r}=e._parseOpts;let o=t;return typeof i=="function"&&(o=i(o)),oe(o)||(o=typeof i=="string"?n.parse(o,i):n.parse(o)),o===null?null:(s&&(o=s==="week"&&(Wo(r)||r===!0)?n.startOf(o,"isoWeek",r):n.startOf(o,s)),+o)}function cb(e,t,n,i){const s=tn.length;for(let r=tn.indexOf(e);r=tn.indexOf(n);r--){const o=tn[r];if(Eh[o].common&&e._adapter.diff(s,i,o)>=t-1)return o}return tn[n?tn.indexOf(n):0]}function wN(e){for(let t=tn.indexOf(e)+1,n=tn.length;t=t?n[i]:n[s];e[r]=!0}}function kN(e,t,n,i){const s=e._adapter,r=+s.startOf(t[0].value,i),o=t[t.length-1].value;let a,l;for(a=r;a<=o;a=+s.add(a,1,i))l=n[a],l>=0&&(t[l].major=!0);return t}function db(e,t,n){const i=[],s={},r=t.length;let o,a;for(o=0;o+t.value))}initOffsets(t=[]){let n=0,i=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=we(n,0,o),i=we(i,0,o),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,s=this.options,r=s.time,o=r.unit||cb(r.minUnit,n,i,this._getLabelCapacity(n)),a=at(s.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=Wo(l)||l===!0,u={};let d=n,h,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":o),t.diff(i,n,o)>1e5*a)throw new Error(n+" and "+i+" are too far apart with stepSize of "+a+" "+o);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(h=d,f=0;h+m)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){const s=this.options.time.displayFormats,r=this._unit,o=n||s[r];return this._adapter.format(t,o)}_tickFormatFunction(t,n,i,s){const r=this.options,o=r.ticks.callback;if(o)return $t(o,[t,n,i],this);const a=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],h=i[n],f=c&&d&&h&&h.major;return this._adapter.format(t,s||(f?d:u))}generateTickLabels(t){let n,i,s;for(n=0,i=t.length;n0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,i=s.length;n=e[i].pos&&t<=e[s].pos&&({lo:i,hi:s}=zi(e,"pos",t)),{pos:r,time:a}=e[i],{pos:o,time:l}=e[s]):(t>=e[i].time&&t<=e[s].time&&({lo:i,hi:s}=zi(e,"time",t)),{time:r,pos:a}=e[i],{time:o,pos:l}=e[s]);const c=o-r;return c?a+(l-a)*(t-r)/c:a}var Iu;let SN=(Iu=class extends Tm{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=au(n,this.min),this._tableRange=au(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,s=[],r=[];let o,a,l,c,u;for(o=0,a=t.length;o=n&&c<=i&&s.push(c);if(s.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(o=0,a=s.length;os-r)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?t=this.normalize(n.concat(i)):t=n.length?n:i,t=this._cache.all=t,t}getDecimalForValue(t){return(au(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return au(this._table,i*this._tableRange+this._minPos,!0)}},K(Iu,"id","timeseries"),K(Iu,"defaults",Tm.defaults),Iu);var MN=Object.freeze({__proto__:null,CategoryScale:eN,LinearScale:iN,LogarithmicScale:oN,RadialLinearScale:bN,TimeScale:Tm,TimeSeriesScale:SN});const CN=[PL,i2,Q2,MN];by.register(...CN);function OM(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t"u")return!1;var t=si(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function FN(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var i=t.styles[n]||{},s=t.attributes[n]||{},r=t.elements[n];!Fn(r)||!ki(r)||(Object.assign(r.style,i),Object.keys(s).forEach(function(o){var a=s[o];a===!1?r.removeAttribute(o):r.setAttribute(o,a===!0?"":a)}))})}function BN(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(i){var s=t.elements[i],r=t.attributes[i]||{},o=Object.keys(t.styles.hasOwnProperty(i)?t.styles[i]:n[i]),a=o.reduce(function(l,c){return l[c]="",l},{});!Fn(s)||!ki(s)||(Object.assign(s.style,a),Object.keys(r).forEach(function(l){s.removeAttribute(l)}))})}}const VN={name:"applyStyles",enabled:!0,phase:"write",fn:FN,effect:BN,requires:["computeStyles"]};function xi(e){return e.split("-")[0]}var Tr=Math.max,Vd=Math.min,Ko=Math.round;function Go(e,t){t===void 0&&(t=!1);var n=e.getBoundingClientRect(),i=1,s=1;if(Fn(e)&&t){var r=e.offsetHeight,o=e.offsetWidth;o>0&&(i=Ko(n.width)/o||1),r>0&&(s=Ko(n.height)/r||1)}return{width:n.width/i,height:n.height/s,top:n.top/s,right:n.right/i,bottom:n.bottom/s,left:n.left/i,x:n.left/i,y:n.top/s}}function My(e){var t=Go(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function NM(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Sy(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function ns(e){return si(e).getComputedStyle(e)}function zN(e){return["table","td","th"].indexOf(ki(e))>=0}function Js(e){return((Xo(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ah(e){return ki(e)==="html"?e:e.assignedSlot||e.parentNode||(Sy(e)?e.host:null)||Js(e)}function mb(e){return!Fn(e)||ns(e).position==="fixed"?null:e.offsetParent}function WN(e){var t=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,n=navigator.userAgent.indexOf("Trident")!==-1;if(n&&Fn(e)){var i=ns(e);if(i.position==="fixed")return null}var s=Ah(e);for(Sy(s)&&(s=s.host);Fn(s)&&["html","body"].indexOf(ki(s))<0;){var r=ns(s);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||t&&r.willChange==="filter"||t&&r.filter&&r.filter!=="none")return s;s=s.parentNode}return null}function gc(e){for(var t=si(e),n=mb(e);n&&zN(n)&&ns(n).position==="static";)n=mb(n);return n&&(ki(n)==="html"||ki(n)==="body"&&ns(n).position==="static")?t:n||WN(e)||t}function Cy(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function pl(e,t,n){return Tr(e,Vd(t,n))}function HN(e,t,n){var i=pl(e,t,n);return i>n?n:i}function jM(){return{top:0,right:0,bottom:0,left:0}}function $M(e){return Object.assign({},jM(),e)}function IM(e,t){return t.reduce(function(n,i){return n[i]=e,n},{})}var UN=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,$M(typeof t!="number"?t:IM(t,mc))};function YN(e){var t,n=e.state,i=e.name,s=e.options,r=n.elements.arrow,o=n.modifiersData.popperOffsets,a=xi(n.placement),l=Cy(a),c=[cn,Wn].indexOf(a)>=0,u=c?"height":"width";if(!(!r||!o)){var d=UN(s.padding,n),h=My(r),f=l==="y"?ln:cn,p=l==="y"?zn:Wn,m=n.rects.reference[u]+n.rects.reference[l]-o[l]-n.rects.popper[u],v=o[l]-n.rects.reference[l],y=gc(r),g=y?l==="y"?y.clientHeight||0:y.clientWidth||0:0,x=m/2-v/2,_=d[f],w=g-h[u]-d[p],S=g/2-h[u]/2+x,C=pl(_,S,w),M=l;n.modifiersData[i]=(t={},t[M]=C,t.centerOffset=C-S,t)}}function XN(e){var t=e.state,n=e.options,i=n.element,s=i===void 0?"[data-popper-arrow]":i;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||NM(t.elements.popper,s)&&(t.elements.arrow=s))}const KN={name:"arrow",enabled:!0,phase:"main",fn:YN,effect:XN,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function qo(e){return e.split("-")[1]}var GN={top:"auto",right:"auto",bottom:"auto",left:"auto"};function qN(e){var t=e.x,n=e.y,i=window,s=i.devicePixelRatio||1;return{x:Ko(t*s)/s||0,y:Ko(n*s)/s||0}}function gb(e){var t,n=e.popper,i=e.popperRect,s=e.placement,r=e.variation,o=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,h=o.x,f=h===void 0?0:h,p=o.y,m=p===void 0?0:p,v=typeof u=="function"?u({x:f,y:m}):{x:f,y:m};f=v.x,m=v.y;var y=o.hasOwnProperty("x"),g=o.hasOwnProperty("y"),x=cn,_=ln,w=window;if(c){var S=gc(n),C="clientHeight",M="clientWidth";if(S===si(n)&&(S=Js(n),ns(S).position!=="static"&&a==="absolute"&&(C="scrollHeight",M="scrollWidth")),S=S,s===ln||(s===cn||s===Wn)&&r===Xl){_=zn;var P=d&&S===w&&w.visualViewport?w.visualViewport.height:S[C];m-=P-i.height,m*=l?1:-1}if(s===cn||(s===ln||s===zn)&&r===Xl){x=Wn;var T=d&&S===w&&w.visualViewport?w.visualViewport.width:S[M];f-=T-i.width,f*=l?1:-1}}var A=Object.assign({position:a},c&&GN),E=u===!0?qN({x:f,y:m}):{x:f,y:m};if(f=E.x,m=E.y,l){var z;return Object.assign({},A,(z={},z[_]=g?"0":"",z[x]=y?"0":"",z.transform=(w.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",z))}return Object.assign({},A,(t={},t[_]=g?m+"px":"",t[x]=y?f+"px":"",t.transform="",t))}function QN(e){var t=e.state,n=e.options,i=n.gpuAcceleration,s=i===void 0?!0:i,r=n.adaptive,o=r===void 0?!0:r,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:xi(t.placement),variation:qo(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,gb(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,gb(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const ZN={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:QN,data:{}};var lu={passive:!0};function JN(e){var t=e.state,n=e.instance,i=e.options,s=i.scroll,r=s===void 0?!0:s,o=i.resize,a=o===void 0?!0:o,l=si(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&c.forEach(function(u){u.addEventListener("scroll",n.update,lu)}),a&&l.addEventListener("resize",n.update,lu),function(){r&&c.forEach(function(u){u.removeEventListener("scroll",n.update,lu)}),a&&l.removeEventListener("resize",n.update,lu)}}const tj={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:JN,data:{}};var ej={left:"right",right:"left",bottom:"top",top:"bottom"};function Ju(e){return e.replace(/left|right|bottom|top/g,function(t){return ej[t]})}var nj={start:"end",end:"start"};function yb(e){return e.replace(/start|end/g,function(t){return nj[t]})}function Py(e){var t=si(e),n=t.pageXOffset,i=t.pageYOffset;return{scrollLeft:n,scrollTop:i}}function Ty(e){return Go(Js(e)).left+Py(e).scrollLeft}function ij(e){var t=si(e),n=Js(e),i=t.visualViewport,s=n.clientWidth,r=n.clientHeight,o=0,a=0;return i&&(s=i.width,r=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=i.offsetLeft,a=i.offsetTop)),{width:s,height:r,x:o+Ty(e),y:a}}function sj(e){var t,n=Js(e),i=Py(e),s=(t=e.ownerDocument)==null?void 0:t.body,r=Tr(n.scrollWidth,n.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=Tr(n.scrollHeight,n.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-i.scrollLeft+Ty(e),l=-i.scrollTop;return ns(s||n).direction==="rtl"&&(a+=Tr(n.clientWidth,s?s.clientWidth:0)-r),{width:r,height:o,x:a,y:l}}function Dy(e){var t=ns(e),n=t.overflow,i=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+s+i)}function FM(e){return["html","body","#document"].indexOf(ki(e))>=0?e.ownerDocument.body:Fn(e)&&Dy(e)?e:FM(Ah(e))}function ml(e,t){var n;t===void 0&&(t=[]);var i=FM(e),s=i===((n=e.ownerDocument)==null?void 0:n.body),r=si(i),o=s?[r].concat(r.visualViewport||[],Dy(i)?i:[]):i,a=t.concat(o);return s?a:a.concat(ml(Ah(o)))}function Dm(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function rj(e){var t=Go(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}function vb(e,t){return t===LM?Dm(ij(e)):Xo(t)?rj(t):Dm(sj(Js(e)))}function oj(e){var t=ml(Ah(e)),n=["absolute","fixed"].indexOf(ns(e).position)>=0,i=n&&Fn(e)?gc(e):e;return Xo(i)?t.filter(function(s){return Xo(s)&&NM(s,i)&&ki(s)!=="body"}):[]}function aj(e,t,n){var i=t==="clippingParents"?oj(e):[].concat(t),s=[].concat(i,[n]),r=s[0],o=s.reduce(function(a,l){var c=vb(e,l);return a.top=Tr(c.top,a.top),a.right=Vd(c.right,a.right),a.bottom=Vd(c.bottom,a.bottom),a.left=Tr(c.left,a.left),a},vb(e,r));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function BM(e){var t=e.reference,n=e.element,i=e.placement,s=i?xi(i):null,r=i?qo(i):null,o=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,l;switch(s){case ln:l={x:o,y:t.y-n.height};break;case zn:l={x:o,y:t.y+t.height};break;case Wn:l={x:t.x+t.width,y:a};break;case cn:l={x:t.x-n.width,y:a};break;default:l={x:t.x,y:t.y}}var c=s?Cy(s):null;if(c!=null){var u=c==="y"?"height":"width";switch(r){case Yo:l[c]=l[c]-(t[u]/2-n[u]/2);break;case Xl:l[c]=l[c]+(t[u]/2-n[u]/2);break}}return l}function Kl(e,t){t===void 0&&(t={});var n=t,i=n.placement,s=i===void 0?e.placement:i,r=n.boundary,o=r===void 0?PN:r,a=n.rootBoundary,l=a===void 0?LM:a,c=n.elementContext,u=c===void 0?Sa:c,d=n.altBoundary,h=d===void 0?!1:d,f=n.padding,p=f===void 0?0:f,m=$M(typeof p!="number"?p:IM(p,mc)),v=u===Sa?TN:Sa,y=e.rects.popper,g=e.elements[h?v:u],x=aj(Xo(g)?g:g.contextElement||Js(e.elements.popper),o,l),_=Go(e.elements.reference),w=BM({reference:_,element:y,strategy:"absolute",placement:s}),S=Dm(Object.assign({},y,w)),C=u===Sa?S:_,M={top:x.top-C.top+m.top,bottom:C.bottom-x.bottom+m.bottom,left:x.left-C.left+m.left,right:C.right-x.right+m.right},P=e.modifiersData.offset;if(u===Sa&&P){var T=P[s];Object.keys(M).forEach(function(A){var E=[Wn,zn].indexOf(A)>=0?1:-1,z=[ln,zn].indexOf(A)>=0?"y":"x";M[A]+=T[z]*E})}return M}function lj(e,t){t===void 0&&(t={});var n=t,i=n.placement,s=n.boundary,r=n.rootBoundary,o=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?RM:l,u=qo(i),d=u?a?pb:pb.filter(function(p){return qo(p)===u}):mc,h=d.filter(function(p){return c.indexOf(p)>=0});h.length===0&&(h=d);var f=h.reduce(function(p,m){return p[m]=Kl(e,{placement:m,boundary:s,rootBoundary:r,padding:o})[xi(m)],p},{});return Object.keys(f).sort(function(p,m){return f[p]-f[m]})}function cj(e){if(xi(e)===ky)return[];var t=Ju(e);return[yb(e),t,yb(t)]}function uj(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var s=n.mainAxis,r=s===void 0?!0:s,o=n.altAxis,a=o===void 0?!0:o,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,h=n.altBoundary,f=n.flipVariations,p=f===void 0?!0:f,m=n.allowedAutoPlacements,v=t.options.placement,y=xi(v),g=y===v,x=l||(g||!p?[Ju(v)]:cj(v)),_=[v].concat(x).reduce(function(Z,O){return Z.concat(xi(O)===ky?lj(t,{placement:O,boundary:u,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:m}):O)},[]),w=t.rects.reference,S=t.rects.popper,C=new Map,M=!0,P=_[0],T=0;T<_.length;T++){var A=_[T],E=xi(A),z=qo(A)===Yo,N=[ln,zn].indexOf(E)>=0,L=N?"width":"height",R=Kl(t,{placement:A,boundary:u,rootBoundary:d,altBoundary:h,padding:c}),B=N?z?Wn:cn:z?zn:ln;w[L]>S[L]&&(B=Ju(B));var D=Ju(B),$=[];if(r&&$.push(R[E]<=0),a&&$.push(R[B]<=0,R[D]<=0),$.every(function(Z){return Z})){P=A,M=!1;break}C.set(A,$)}if(M)for(var F=p?3:1,V=function(O){var U=_.find(function(lt){var ct=C.get(lt);if(ct)return ct.slice(0,O).every(function(kt){return kt})});if(U)return P=U,"break"},W=F;W>0;W--){var et=V(W);if(et==="break")break}t.placement!==P&&(t.modifiersData[i]._skip=!0,t.placement=P,t.reset=!0)}}const VM={name:"flip",enabled:!0,phase:"main",fn:uj,requiresIfExists:["offset"],data:{_skip:!1}};function xb(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function bb(e){return[ln,Wn,zn,cn].some(function(t){return e[t]>=0})}function dj(e){var t=e.state,n=e.name,i=t.rects.reference,s=t.rects.popper,r=t.modifiersData.preventOverflow,o=Kl(t,{elementContext:"reference"}),a=Kl(t,{altBoundary:!0}),l=xb(o,i),c=xb(a,s,r),u=bb(l),d=bb(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const hj={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:dj};function fj(e,t,n){var i=xi(e),s=[cn,ln].indexOf(i)>=0?-1:1,r=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,o=r[0],a=r[1];return o=o||0,a=(a||0)*s,[cn,Wn].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}function pj(e){var t=e.state,n=e.options,i=e.name,s=n.offset,r=s===void 0?[0,0]:s,o=RM.reduce(function(u,d){return u[d]=fj(d,t.rects,r),u},{}),a=o[t.placement],l=a.x,c=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[i]=o}const mj={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:pj};function gj(e){var t=e.state,n=e.name;t.modifiersData[n]=BM({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const yj={name:"popperOffsets",enabled:!0,phase:"read",fn:gj,data:{}};function vj(e){return e==="x"?"y":"x"}function xj(e){var t=e.state,n=e.options,i=e.name,s=n.mainAxis,r=s===void 0?!0:s,o=n.altAxis,a=o===void 0?!1:o,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,h=n.tether,f=h===void 0?!0:h,p=n.tetherOffset,m=p===void 0?0:p,v=Kl(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),y=xi(t.placement),g=qo(t.placement),x=!g,_=Cy(y),w=vj(_),S=t.modifiersData.popperOffsets,C=t.rects.reference,M=t.rects.popper,P=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,T=typeof P=="number"?{mainAxis:P,altAxis:P}:Object.assign({mainAxis:0,altAxis:0},P),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,E={x:0,y:0};if(S){if(r){var z,N=_==="y"?ln:cn,L=_==="y"?zn:Wn,R=_==="y"?"height":"width",B=S[_],D=B+v[N],$=B-v[L],F=f?-M[R]/2:0,V=g===Yo?C[R]:M[R],W=g===Yo?-M[R]:-C[R],et=t.elements.arrow,Z=f&&et?My(et):{width:0,height:0},O=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:jM(),U=O[N],lt=O[L],ct=pl(0,C[R],Z[R]),kt=x?C[R]/2-F-ct-U-T.mainAxis:V-ct-U-T.mainAxis,it=x?-C[R]/2+F+ct+lt+T.mainAxis:W+ct+lt+T.mainAxis,Lt=t.elements.arrow&&gc(t.elements.arrow),Ct=Lt?_==="y"?Lt.clientTop||0:Lt.clientLeft||0:0,Qt=(z=A==null?void 0:A[_])!=null?z:0,ft=B+kt-Qt-Ct,wt=B+it-Qt,dt=pl(f?Vd(D,ft):D,B,f?Tr($,wt):$);S[_]=dt,E[_]=dt-B}if(a){var jt,pt=_==="x"?ln:cn,xt=_==="x"?zn:Wn,J=S[w],mt=w==="y"?"height":"width",q=J+v[pt],ye=J-v[xt],Dt=[ln,cn].indexOf(y)!==-1,he=(jt=A==null?void 0:A[w])!=null?jt:0,Un=Dt?q:J-C[mt]-M[mt]-he+T.altAxis,Yn=Dt?J+C[mt]+M[mt]-he-T.altAxis:ye,Mn=f&&Dt?HN(Un,J,Yn):pl(f?Un:q,J,f?Yn:ye);S[w]=Mn,E[w]=Mn-J}t.modifiersData[i]=E}}const bj={name:"preventOverflow",enabled:!0,phase:"main",fn:xj,requiresIfExists:["offset"]};function _j(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function wj(e){return e===si(e)||!Fn(e)?Py(e):_j(e)}function kj(e){var t=e.getBoundingClientRect(),n=Ko(t.width)/e.offsetWidth||1,i=Ko(t.height)/e.offsetHeight||1;return n!==1||i!==1}function Sj(e,t,n){n===void 0&&(n=!1);var i=Fn(t),s=Fn(t)&&kj(t),r=Js(t),o=Go(e,s),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!n)&&((ki(t)!=="body"||Dy(r))&&(a=wj(t)),Fn(t)?(l=Go(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):r&&(l.x=Ty(r))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function Mj(e){var t=new Map,n=new Set,i=[];e.forEach(function(r){t.set(r.name,r)});function s(r){n.add(r.name);var o=[].concat(r.requires||[],r.requiresIfExists||[]);o.forEach(function(a){if(!n.has(a)){var l=t.get(a);l&&s(l)}}),i.push(r)}return e.forEach(function(r){n.has(r.name)||s(r)}),i}function Cj(e){var t=Mj(e);return IN.reduce(function(n,i){return n.concat(t.filter(function(s){return s.phase===i}))},[])}function Pj(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Tj(e){var t=e.reduce(function(n,i){var s=n[i.name];return n[i.name]=s?Object.assign({},s,i,{options:Object.assign({},s.options,i.options),data:Object.assign({},s.data,i.data)}):i,n},{});return Object.keys(t).map(function(n){return t[n]})}var _b={placement:"bottom",modifiers:[],strategy:"absolute"};function wb(){for(var e=arguments.length,t=new Array(e),n=0;ne,isStatic:!1,reducedMotion:"never"}),Lh=k.createContext({}),Rh=k.createContext(null),Nh=typeof document<"u",Ey=Nh?k.useLayoutEffect:k.useEffect,WM=k.createContext({strict:!1}),Ay=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),Fj="framerAppearId",HM="data-"+Ay(Fj);function Bj(e,t,n,i){const{visualElement:s}=k.useContext(Lh),r=k.useContext(WM),o=k.useContext(Rh),a=k.useContext(zM).reducedMotion,l=k.useRef();i=i||r.renderer,!l.current&&i&&(l.current=i(e,{visualState:t,parent:s,props:n,presenceContext:o,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:a}));const c=l.current;k.useInsertionEffect(()=>{c&&c.update(n,o)});const u=k.useRef(!!(n[HM]&&!window.HandoffComplete));return Ey(()=>{c&&(c.render(),u.current&&c.animationState&&c.animationState.animateChanges())}),k.useEffect(()=>{c&&(c.updateFeatures(),!u.current&&c.animationState&&c.animationState.animateChanges(),u.current&&(u.current=!1,window.HandoffComplete=!0))}),c}function _o(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Vj(e,t,n){return k.useCallback(i=>{i&&e.mount&&e.mount(i),t&&(i?t.mount(i):t.unmount()),n&&(typeof n=="function"?n(i):_o(n)&&(n.current=i))},[t])}function Gl(e){return typeof e=="string"||Array.isArray(e)}function jh(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Oy=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ly=["initial",...Oy];function $h(e){return jh(e.animate)||Ly.some(t=>Gl(e[t]))}function UM(e){return!!($h(e)||e.variants)}function zj(e,t){if($h(e)){const{initial:n,animate:i}=e;return{initial:n===!1||Gl(n)?n:void 0,animate:Gl(i)?i:void 0}}return e.inherit!==!1?t:{}}function Wj(e){const{initial:t,animate:n}=zj(e,k.useContext(Lh));return k.useMemo(()=>({initial:t,animate:n}),[kb(t),kb(n)])}function kb(e){return Array.isArray(e)?e.join(" "):e}const Sb={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},ql={};for(const e in Sb)ql[e]={isEnabled:t=>Sb[e].some(n=>!!t[n])};function Hj(e){for(const t in e)ql[t]={...ql[t],...e[t]}}const Ry=k.createContext({}),YM=k.createContext({}),Uj=Symbol.for("motionComponentSymbol");function Yj({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:i,Component:s}){e&&Hj(e);function r(a,l){let c;const u={...k.useContext(zM),...a,layoutId:Xj(a)},{isStatic:d}=u,h=Wj(a),f=i(a,d);if(!d&&Nh){h.visualElement=Bj(s,f,u,t);const p=k.useContext(YM),m=k.useContext(WM).strict;h.visualElement&&(c=h.visualElement.loadFeatures(u,m,e,p))}return k.createElement(Lh.Provider,{value:h},c&&h.visualElement?k.createElement(c,{visualElement:h.visualElement,...u}):null,n(s,a,Vj(f,h.visualElement,l),f,d,h.visualElement))}const o=k.forwardRef(r);return o[Uj]=s,o}function Xj({layoutId:e}){const t=k.useContext(Ry).id;return t&&e!==void 0?t+"-"+e:e}function Kj(e){function t(i,s={}){return Yj(e(i,s))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(i,s)=>(n.has(s)||n.set(s,t(s)),n.get(s))})}const Gj=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Ny(e){return typeof e!="string"||e.includes("-")?!1:!!(Gj.indexOf(e)>-1||/[A-Z]/.test(e))}const zd={};function qj(e){Object.assign(zd,e)}const yc=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ur=new Set(yc);function XM(e,{layout:t,layoutId:n}){return Ur.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!zd[e]||e==="opacity")}const un=e=>!!(e&&e.getVelocity),Qj={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Zj=yc.length;function Jj(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},i,s){let r="";for(let o=0;ot=>typeof t=="string"&&t.startsWith(e),GM=KM("--"),Em=KM("var(--"),t$=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,e$=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Hs=(e,t,n)=>Math.min(Math.max(n,e),t),Yr={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},gl={...Yr,transform:e=>Hs(0,1,e)},cu={...Yr,default:1},yl=e=>Math.round(e*1e5)/1e5,Ih=/(-)?([\d]*\.?[\d])+/g,qM=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,n$=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function vc(e){return typeof e=="string"}const xc=e=>({test:t=>vc(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ps=xc("deg"),bi=xc("%"),st=xc("px"),i$=xc("vh"),s$=xc("vw"),Mb={...bi,parse:e=>bi.parse(e)/100,transform:e=>bi.transform(e*100)},Cb={...Yr,transform:Math.round},QM={borderWidth:st,borderTopWidth:st,borderRightWidth:st,borderBottomWidth:st,borderLeftWidth:st,borderRadius:st,radius:st,borderTopLeftRadius:st,borderTopRightRadius:st,borderBottomRightRadius:st,borderBottomLeftRadius:st,width:st,maxWidth:st,height:st,maxHeight:st,size:st,top:st,right:st,bottom:st,left:st,padding:st,paddingTop:st,paddingRight:st,paddingBottom:st,paddingLeft:st,margin:st,marginTop:st,marginRight:st,marginBottom:st,marginLeft:st,rotate:ps,rotateX:ps,rotateY:ps,rotateZ:ps,scale:cu,scaleX:cu,scaleY:cu,scaleZ:cu,skew:ps,skewX:ps,skewY:ps,distance:st,translateX:st,translateY:st,translateZ:st,x:st,y:st,z:st,perspective:st,transformPerspective:st,opacity:gl,originX:Mb,originY:Mb,originZ:st,zIndex:Cb,fillOpacity:gl,strokeOpacity:gl,numOctaves:Cb};function jy(e,t,n,i){const{style:s,vars:r,transform:o,transformOrigin:a}=e;let l=!1,c=!1,u=!0;for(const d in t){const h=t[d];if(GM(d)){r[d]=h;continue}const f=QM[d],p=e$(h,f);if(Ur.has(d)){if(l=!0,o[d]=p,!u)continue;h!==(f.default||0)&&(u=!1)}else d.startsWith("origin")?(c=!0,a[d]=p):s[d]=p}if(t.transform||(l||i?s.transform=Jj(e.transform,n,u,i):s.transform&&(s.transform="none")),c){const{originX:d="50%",originY:h="50%",originZ:f=0}=a;s.transformOrigin=`${d} ${h} ${f}`}}const $y=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ZM(e,t,n){for(const i in t)!un(t[i])&&!XM(i,n)&&(e[i]=t[i])}function r$({transformTemplate:e},t,n){return k.useMemo(()=>{const i=$y();return jy(i,t,{enableHardwareAcceleration:!n},e),Object.assign({},i.vars,i.style)},[t])}function o$(e,t,n){const i=e.style||{},s={};return ZM(s,i,e),Object.assign(s,r$(e,t,n)),e.transformValues?e.transformValues(s):s}function a$(e,t,n){const i={},s=o$(e,t,n);return e.drag&&e.dragListener!==!1&&(i.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(i.tabIndex=0),i.style=s,i}const l$=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Wd(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||l$.has(e)}let JM=e=>!Wd(e);function c$(e){e&&(JM=t=>t.startsWith("on")?!Wd(t):e(t))}try{c$(require("@emotion/is-prop-valid").default)}catch{}function u$(e,t,n){const i={};for(const s in e)s==="values"&&typeof e.values=="object"||(JM(s)||n===!0&&Wd(s)||!t&&!Wd(s)||e.draggable&&s.startsWith("onDrag"))&&(i[s]=e[s]);return i}function Pb(e,t,n){return typeof e=="string"?e:st.transform(t+n*e)}function d$(e,t,n){const i=Pb(t,e.x,e.width),s=Pb(n,e.y,e.height);return`${i} ${s}`}const h$={offset:"stroke-dashoffset",array:"stroke-dasharray"},f$={offset:"strokeDashoffset",array:"strokeDasharray"};function p$(e,t,n=1,i=0,s=!0){e.pathLength=1;const r=s?h$:f$;e[r.offset]=st.transform(-i);const o=st.transform(t),a=st.transform(n);e[r.array]=`${o} ${a}`}function Iy(e,{attrX:t,attrY:n,attrScale:i,originX:s,originY:r,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},u,d,h){if(jy(e,c,u,h),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:p,dimensions:m}=e;f.transform&&(m&&(p.transform=f.transform),delete f.transform),m&&(s!==void 0||r!==void 0||p.transform)&&(p.transformOrigin=d$(m,s!==void 0?s:.5,r!==void 0?r:.5)),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),i!==void 0&&(f.scale=i),o!==void 0&&p$(f,o,a,l,!1)}const tC=()=>({...$y(),attrs:{}}),Fy=e=>typeof e=="string"&&e.toLowerCase()==="svg";function m$(e,t,n,i){const s=k.useMemo(()=>{const r=tC();return Iy(r,t,{enableHardwareAcceleration:!1},Fy(i),e.transformTemplate),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};ZM(r,e.style,e),s.style={...r,...s.style}}return s}function g$(e=!1){return(n,i,s,{latestValues:r},o)=>{const l=(Ny(n)?m$:a$)(i,r,o,n),u={...u$(i,typeof n=="string",e),...l,ref:s},{children:d}=i,h=k.useMemo(()=>un(d)?d.get():d,[d]);return k.createElement(n,{...u,children:h})}}function eC(e,{style:t,vars:n},i,s){Object.assign(e.style,t,s&&s.getProjectionStyles(i));for(const r in n)e.style.setProperty(r,n[r])}const nC=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function iC(e,t,n,i){eC(e,t,void 0,i);for(const s in t.attrs)e.setAttribute(nC.has(s)?s:Ay(s),t.attrs[s])}function By(e,t){const{style:n}=e,i={};for(const s in n)(un(n[s])||t.style&&un(t.style[s])||XM(s,e))&&(i[s]=n[s]);return i}function sC(e,t){const n=By(e,t);for(const i in e)if(un(e[i])||un(t[i])){const s=yc.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[s]=e[i]}return n}function Vy(e,t,n,i={},s={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,i,s)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,i,s)),t}function rC(e){const t=k.useRef(null);return t.current===null&&(t.current=e()),t.current}const Hd=e=>Array.isArray(e),y$=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),v$=e=>Hd(e)?e[e.length-1]||0:e;function ed(e){const t=un(e)?e.get():e;return y$(t)?t.toValue():t}function x$({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},i,s,r){const o={latestValues:b$(i,s,r,e),renderState:t()};return n&&(o.mount=a=>n(i,a,o)),o}const oC=e=>(t,n)=>{const i=k.useContext(Lh),s=k.useContext(Rh),r=()=>x$(e,t,i,s);return n?r():rC(r)};function b$(e,t,n,i){const s={},r=i(e,{});for(const h in r)s[h]=ed(r[h]);let{initial:o,animate:a}=e;const l=$h(e),c=UM(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const d=u?a:o;return d&&typeof d!="boolean"&&!jh(d)&&(Array.isArray(d)?d:[d]).forEach(f=>{const p=Vy(e,f);if(!p)return;const{transitionEnd:m,transition:v,...y}=p;for(const g in y){let x=y[g];if(Array.isArray(x)){const _=u?x.length-1:0;x=x[_]}x!==null&&(s[g]=x)}for(const g in m)s[g]=m[g]}),s}const ce=e=>e;class Tb{constructor(){this.order=[],this.scheduled=new Set}add(t){if(!this.scheduled.has(t))return this.scheduled.add(t),this.order.push(t),!0}remove(t){const n=this.order.indexOf(t);n!==-1&&(this.order.splice(n,1),this.scheduled.delete(t))}clear(){this.order.length=0,this.scheduled.clear()}}function _$(e){let t=new Tb,n=new Tb,i=0,s=!1,r=!1;const o=new WeakSet,a={schedule:(l,c=!1,u=!1)=>{const d=u&&s,h=d?t:n;return c&&o.add(l),h.add(l)&&d&&s&&(i=t.order.length),l},cancel:l=>{n.remove(l),o.delete(l)},process:l=>{if(s){r=!0;return}if(s=!0,[t,n]=[n,t],n.clear(),i=t.order.length,i)for(let c=0;c(d[h]=_$(()=>n=!0),d),{}),o=d=>r[d].process(s),a=()=>{const d=performance.now();n=!1,s.delta=i?1e3/60:Math.max(Math.min(d-s.timestamp,w$),1),s.timestamp=d,s.isProcessing=!0,uu.forEach(o),s.isProcessing=!1,n&&t&&(i=!1,e(a))},l=()=>{n=!0,i=!0,s.isProcessing||e(a)};return{schedule:uu.reduce((d,h)=>{const f=r[h];return d[h]=(p,m=!1,v=!1)=>(n||l(),f.schedule(p,m,v)),d},{}),cancel:d=>uu.forEach(h=>r[h].cancel(d)),state:s,steps:r}}const{schedule:zt,cancel:is,state:je,steps:Uf}=k$(typeof requestAnimationFrame<"u"?requestAnimationFrame:ce,!0),S$={useVisualState:oC({scrapeMotionValuesFromProps:sC,createRenderState:tC,onMount:(e,t,{renderState:n,latestValues:i})=>{zt.read(()=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),zt.render(()=>{Iy(n,i,{enableHardwareAcceleration:!1},Fy(t.tagName),e.transformTemplate),iC(t,n)})}})},M$={useVisualState:oC({scrapeMotionValuesFromProps:By,createRenderState:$y})};function C$(e,{forwardMotionProps:t=!1},n,i){return{...Ny(e)?S$:M$,preloadedFeatures:n,useRender:g$(t),createVisualElement:i,Component:e}}function Hi(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}const aC=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Fh(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}const P$=e=>t=>aC(t)&&e(t,Fh(t));function qi(e,t,n,i){return Hi(e,t,P$(n),i)}const T$=(e,t)=>n=>t(e(n)),Is=(...e)=>e.reduce(T$);function lC(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const Db=lC("dragHorizontal"),Eb=lC("dragVertical");function cC(e){let t=!1;if(e==="y")t=Eb();else if(e==="x")t=Db();else{const n=Db(),i=Eb();n&&i?t=()=>{n(),i()}:(n&&n(),i&&i())}return t}function uC(){const e=cC(!0);return e?(e(),!1):!0}class tr{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Ab(e,t){const n="pointer"+(t?"enter":"leave"),i="onHover"+(t?"Start":"End"),s=(r,o)=>{if(r.pointerType==="touch"||uC())return;const a=e.getProps();e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",t),a[i]&&zt.update(()=>a[i](r,o))};return qi(e.current,n,s,{passive:!e.getProps()[i]})}class D$ extends tr{mount(){this.unmount=Is(Ab(this.node,!0),Ab(this.node,!1))}unmount(){}}class E$ extends tr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Is(Hi(this.node.current,"focus",()=>this.onFocus()),Hi(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const dC=(e,t)=>t?e===t?!0:dC(e,t.parentElement):!1;function Yf(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,Fh(n))}class A$ extends tr{constructor(){super(...arguments),this.removeStartListeners=ce,this.removeEndListeners=ce,this.removeAccessibleListeners=ce,this.startPointerPress=(t,n)=>{if(this.isPressing)return;this.removeEndListeners();const i=this.node.getProps(),r=qi(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:c,onTapCancel:u,globalTapTarget:d}=this.node.getProps();zt.update(()=>{!d&&!dC(this.node.current,a.target)?u&&u(a,l):c&&c(a,l)})},{passive:!(i.onTap||i.onPointerUp)}),o=qi(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(i.onTapCancel||i.onPointerCancel)});this.removeEndListeners=Is(r,o),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=r=>{if(r.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||Yf("up",(l,c)=>{const{onTap:u}=this.node.getProps();u&&zt.update(()=>u(l,c))})};this.removeEndListeners(),this.removeEndListeners=Hi(this.node.current,"keyup",o),Yf("down",(a,l)=>{this.startPress(a,l)})},n=Hi(this.node.current,"keydown",t),i=()=>{this.isPressing&&Yf("cancel",(r,o)=>this.cancelPress(r,o))},s=Hi(this.node.current,"blur",i);this.removeAccessibleListeners=Is(n,s)}}startPress(t,n){this.isPressing=!0;const{onTapStart:i,whileTap:s}=this.node.getProps();s&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),i&&zt.update(()=>i(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!uC()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:i}=this.node.getProps();i&&zt.update(()=>i(t,n))}mount(){const t=this.node.getProps(),n=qi(t.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),i=Hi(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Is(n,i)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const Am=new WeakMap,Xf=new WeakMap,O$=e=>{const t=Am.get(e.target);t&&t(e)},L$=e=>{e.forEach(O$)};function R$({root:e,...t}){const n=e||document;Xf.has(n)||Xf.set(n,{});const i=Xf.get(n),s=JSON.stringify(t);return i[s]||(i[s]=new IntersectionObserver(L$,{root:e,...t})),i[s]}function N$(e,t,n){const i=R$(t);return Am.set(e,n),i.observe(e),()=>{Am.delete(e),i.unobserve(e)}}const j$={some:0,all:1};class $$ extends tr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:i,amount:s="some",once:r}=t,o={root:n?n.current:void 0,rootMargin:i,threshold:typeof s=="number"?s:j$[s]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,r&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),h=c?u:d;h&&h(l)};return N$(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(I$(t,n))&&this.startObserver()}unmount(){}}function I$({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const F$={inView:{Feature:$$},tap:{Feature:A$},focus:{Feature:E$},hover:{Feature:D$}};function hC(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;it[i]=n.get()),t}function V$(e){const t={};return e.values.forEach((n,i)=>t[i]=n.getVelocity()),t}function Bh(e,t,n){const i=e.getProps();return Vy(i,t,n!==void 0?n:i.custom,B$(e),V$(e))}let zy=ce;const Dr=e=>e*1e3,Qi=e=>e/1e3,z$={current:!1},fC=e=>Array.isArray(e)&&typeof e[0]=="number";function pC(e){return!!(!e||typeof e=="string"&&mC[e]||fC(e)||Array.isArray(e)&&e.every(pC))}const Qa=([e,t,n,i])=>`cubic-bezier(${e}, ${t}, ${n}, ${i})`,mC={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Qa([0,.65,.55,1]),circOut:Qa([.55,0,1,.45]),backIn:Qa([.31,.01,.66,-.59]),backOut:Qa([.33,1.53,.69,.99])};function gC(e){if(e)return fC(e)?Qa(e):Array.isArray(e)?e.map(gC):mC[e]}function W$(e,t,n,{delay:i=0,duration:s,repeat:r=0,repeatType:o="loop",ease:a,times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=gC(a);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:i,duration:s,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"})}function H$(e,{repeat:t,repeatType:n="loop"}){const i=t&&n!=="loop"&&t%2===1?0:e.length-1;return e[i]}const yC=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,U$=1e-7,Y$=12;function X$(e,t,n,i,s){let r,o,a=0;do o=t+(n-t)/2,r=yC(o,i,s)-e,r>0?n=o:t=o;while(Math.abs(r)>U$&&++aX$(r,0,1,e,n);return r=>r===0||r===1?r:yC(s(r),t,i)}const K$=bc(.42,0,1,1),G$=bc(0,0,.58,1),vC=bc(.42,0,.58,1),q$=e=>Array.isArray(e)&&typeof e[0]!="number",xC=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,bC=e=>t=>1-e(1-t),Wy=e=>1-Math.sin(Math.acos(e)),_C=bC(Wy),Q$=xC(Wy),wC=bc(.33,1.53,.69,.99),Hy=bC(wC),Z$=xC(Hy),J$=e=>(e*=2)<1?.5*Hy(e):.5*(2-Math.pow(2,-10*(e-1))),tI={linear:ce,easeIn:K$,easeInOut:vC,easeOut:G$,circIn:Wy,circInOut:Q$,circOut:_C,backIn:Hy,backInOut:Z$,backOut:wC,anticipate:J$},Ob=e=>{if(Array.isArray(e)){zy(e.length===4);const[t,n,i,s]=e;return bc(t,n,i,s)}else if(typeof e=="string")return tI[e];return e},Uy=(e,t)=>n=>!!(vc(n)&&n$.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),kC=(e,t,n)=>i=>{if(!vc(i))return i;const[s,r,o,a]=i.match(Ih);return{[e]:parseFloat(s),[t]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},eI=e=>Hs(0,255,e),Kf={...Yr,transform:e=>Math.round(eI(e))},kr={test:Uy("rgb","red"),parse:kC("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+Kf.transform(e)+", "+Kf.transform(t)+", "+Kf.transform(n)+", "+yl(gl.transform(i))+")"};function nI(e){let t="",n="",i="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),i=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),i=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,i+=i,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}}const Om={test:Uy("#"),parse:nI,transform:kr.transform},wo={test:Uy("hsl","hue"),parse:kC("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+bi.transform(yl(t))+", "+bi.transform(yl(n))+", "+yl(gl.transform(i))+")"},We={test:e=>kr.test(e)||Om.test(e)||wo.test(e),parse:e=>kr.test(e)?kr.parse(e):wo.test(e)?wo.parse(e):Om.parse(e),transform:e=>vc(e)?e:e.hasOwnProperty("red")?kr.transform(e):wo.transform(e)},ee=(e,t,n)=>-n*e+n*t+e;function Gf(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function iI({hue:e,saturation:t,lightness:n,alpha:i}){e/=360,t/=100,n/=100;let s=0,r=0,o=0;if(!t)s=r=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;s=Gf(l,a,e+1/3),r=Gf(l,a,e),o=Gf(l,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:i}}const qf=(e,t,n)=>{const i=e*e;return Math.sqrt(Math.max(0,n*(t*t-i)+i))},sI=[Om,kr,wo],rI=e=>sI.find(t=>t.test(e));function Lb(e){const t=rI(e);let n=t.parse(e);return t===wo&&(n=iI(n)),n}const SC=(e,t)=>{const n=Lb(e),i=Lb(t),s={...n};return r=>(s.red=qf(n.red,i.red,r),s.green=qf(n.green,i.green,r),s.blue=qf(n.blue,i.blue,r),s.alpha=ee(n.alpha,i.alpha,r),kr.transform(s))};function oI(e){var t,n;return isNaN(e)&&vc(e)&&(((t=e.match(Ih))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(qM))===null||n===void 0?void 0:n.length)||0)>0}const MC={regex:t$,countKey:"Vars",token:"${v}",parse:ce},CC={regex:qM,countKey:"Colors",token:"${c}",parse:We.parse},PC={regex:Ih,countKey:"Numbers",token:"${n}",parse:Yr.parse};function Qf(e,{regex:t,countKey:n,token:i,parse:s}){const r=e.tokenised.match(t);r&&(e["num"+n]=r.length,e.tokenised=e.tokenised.replace(t,i),e.values.push(...r.map(s)))}function Ud(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&Qf(n,MC),Qf(n,CC),Qf(n,PC),n}function TC(e){return Ud(e).values}function DC(e){const{values:t,numColors:n,numVars:i,tokenised:s}=Ud(e),r=t.length;return o=>{let a=s;for(let l=0;ltypeof e=="number"?0:e;function lI(e){const t=TC(e);return DC(e)(t.map(aI))}const Us={test:oI,parse:TC,createTransformer:DC,getAnimatableNone:lI},EC=(e,t)=>n=>`${n>0?t:e}`;function AC(e,t){return typeof e=="number"?n=>ee(e,t,n):We.test(e)?SC(e,t):e.startsWith("var(")?EC(e,t):LC(e,t)}const OC=(e,t)=>{const n=[...e],i=n.length,s=e.map((r,o)=>AC(r,t[o]));return r=>{for(let o=0;o{const n={...e,...t},i={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(i[s]=AC(e[s],t[s]));return s=>{for(const r in i)n[r]=i[r](s);return n}},LC=(e,t)=>{const n=Us.createTransformer(t),i=Ud(e),s=Ud(t);return i.numVars===s.numVars&&i.numColors===s.numColors&&i.numNumbers>=s.numNumbers?Is(OC(i.values,s.values),n):EC(e,t)},Ql=(e,t,n)=>{const i=t-e;return i===0?1:(n-e)/i},Rb=(e,t)=>n=>ee(e,t,n);function uI(e){return typeof e=="number"?Rb:typeof e=="string"?We.test(e)?SC:LC:Array.isArray(e)?OC:typeof e=="object"?cI:Rb}function dI(e,t,n){const i=[],s=n||uI(e[0]),r=e.length-1;for(let o=0;ot[0];e[0]>e[r-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=dI(t,i,s),a=o.length,l=c=>{let u=0;if(a>1)for(;ul(Hs(e[0],e[r-1],c)):l}function hI(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const s=Ql(0,t,i);e.push(ee(n,1,s))}}function fI(e){const t=[0];return hI(t,e.length-1),t}function pI(e,t){return e.map(n=>n*t)}function mI(e,t){return e.map(()=>t||vC).splice(0,e.length-1)}function Yd({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const s=q$(i)?i.map(Ob):Ob(i),r={done:!1,value:t[0]},o=pI(n&&n.length===t.length?n:fI(t),e),a=RC(o,t,{ease:Array.isArray(s)?s:mI(t,s)});return{calculatedDuration:e,next:l=>(r.value=a(l),r.done=l>=e,r)}}function NC(e,t){return t?e*(1e3/t):0}const gI=5;function jC(e,t,n){const i=Math.max(t-gI,0);return NC(n-e(i),t-i)}const Zf=.001,yI=.01,vI=10,xI=.05,bI=1;function _I({duration:e=800,bounce:t=.25,velocity:n=0,mass:i=1}){let s,r,o=1-t;o=Hs(xI,bI,o),e=Hs(yI,vI,Qi(e)),o<1?(s=c=>{const u=c*o,d=u*e,h=u-n,f=Lm(c,o),p=Math.exp(-d);return Zf-h/f*p},r=c=>{const d=c*o*e,h=d*n+n,f=Math.pow(o,2)*Math.pow(c,2)*e,p=Math.exp(-d),m=Lm(Math.pow(c,2),o);return(-s(c)+Zf>0?-1:1)*((h-f)*p)/m}):(s=c=>{const u=Math.exp(-c*e),d=(c-n)*e+1;return-Zf+u*d},r=c=>{const u=Math.exp(-c*e),d=(n-c)*(e*e);return u*d});const a=5/e,l=kI(s,r,a);if(e=Dr(e),isNaN(l))return{stiffness:100,damping:10,duration:e};{const c=Math.pow(l,2)*i;return{stiffness:c,damping:o*2*Math.sqrt(i*c),duration:e}}}const wI=12;function kI(e,t,n){let i=n;for(let s=1;se[n]!==void 0)}function CI(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!Nb(e,MI)&&Nb(e,SI)){const n=_I(e);t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}function $C({keyframes:e,restDelta:t,restSpeed:n,...i}){const s=e[0],r=e[e.length-1],o={done:!1,value:s},{stiffness:a,damping:l,mass:c,duration:u,velocity:d,isResolvedFromDuration:h}=CI({...i,velocity:-Qi(i.velocity||0)}),f=d||0,p=l/(2*Math.sqrt(a*c)),m=r-s,v=Qi(Math.sqrt(a/c)),y=Math.abs(m)<5;n||(n=y?.01:2),t||(t=y?.005:.5);let g;if(p<1){const x=Lm(v,p);g=_=>{const w=Math.exp(-p*v*_);return r-w*((f+p*v*m)/x*Math.sin(x*_)+m*Math.cos(x*_))}}else if(p===1)g=x=>r-Math.exp(-v*x)*(m+(f+v*m)*x);else{const x=v*Math.sqrt(p*p-1);g=_=>{const w=Math.exp(-p*v*_),S=Math.min(x*_,300);return r-w*((f+p*v*m)*Math.sinh(S)+x*m*Math.cosh(S))/x}}return{calculatedDuration:h&&u||null,next:x=>{const _=g(x);if(h)o.done=x>=u;else{let w=f;x!==0&&(p<1?w=jC(g,x,_):w=0);const S=Math.abs(w)<=n,C=Math.abs(r-_)<=t;o.done=S&&C}return o.value=o.done?r:_,o}}}function jb({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],h={done:!1,value:d},f=M=>a!==void 0&&Ml,p=M=>a===void 0?l:l===void 0||Math.abs(a-M)-m*Math.exp(-M/i),x=M=>y+g(M),_=M=>{const P=g(M),T=x(M);h.done=Math.abs(P)<=c,h.value=h.done?y:T};let w,S;const C=M=>{f(h.value)&&(w=M,S=$C({keyframes:[h.value,p(h.value)],velocity:jC(x,M,h.value),damping:s,stiffness:r,restDelta:c,restSpeed:u}))};return C(0),{calculatedDuration:null,next:M=>{let P=!1;return!S&&w===void 0&&(P=!0,_(M),C(M)),w!==void 0&&M>w?S.next(M-w):(!P&&_(M),h)}}}const PI=e=>{const t=({timestamp:n})=>e(n);return{start:()=>zt.update(t,!0),stop:()=>is(t),now:()=>je.isProcessing?je.timestamp:performance.now()}},$b=2e4;function Ib(e){let t=0;const n=50;let i=e.next(t);for(;!i.done&&t<$b;)t+=n,i=e.next(t);return t>=$b?1/0:t}const TI={decay:jb,inertia:jb,tween:Yd,keyframes:Yd,spring:$C};function Xd({autoplay:e=!0,delay:t=0,driver:n=PI,keyframes:i,type:s="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:a="loop",onPlay:l,onStop:c,onComplete:u,onUpdate:d,...h}){let f=1,p=!1,m,v;const y=()=>{v=new Promise(V=>{m=V})};y();let g;const x=TI[s]||Yd;let _;x!==Yd&&typeof i[0]!="number"&&(_=RC([0,100],i,{clamp:!1}),i=[0,100]);const w=x({...h,keyframes:i});let S;a==="mirror"&&(S=x({...h,keyframes:[...i].reverse(),velocity:-(h.velocity||0)}));let C="idle",M=null,P=null,T=null;w.calculatedDuration===null&&r&&(w.calculatedDuration=Ib(w));const{calculatedDuration:A}=w;let E=1/0,z=1/0;A!==null&&(E=A+o,z=E*(r+1)-o);let N=0;const L=V=>{if(P===null)return;f>0&&(P=Math.min(P,V)),f<0&&(P=Math.min(V-z/f,P)),M!==null?N=M:N=Math.round(V-P)*f;const W=N-t*(f>=0?1:-1),et=f>=0?W<0:W>z;N=Math.max(W,0),C==="finished"&&M===null&&(N=z);let Z=N,O=w;if(r){const kt=Math.min(N,z)/E;let it=Math.floor(kt),Lt=kt%1;!Lt&&kt>=1&&(Lt=1),Lt===1&&it--,it=Math.min(it,r+1),!!(it%2)&&(a==="reverse"?(Lt=1-Lt,o&&(Lt-=o/E)):a==="mirror"&&(O=S)),Z=Hs(0,1,Lt)*E}const U=et?{done:!1,value:i[0]}:O.next(Z);_&&(U.value=_(U.value));let{done:lt}=U;!et&&A!==null&&(lt=f>=0?N>=z:N<=0);const ct=M===null&&(C==="finished"||C==="running"&<);return d&&d(U.value),ct&&D(),U},R=()=>{g&&g.stop(),g=void 0},B=()=>{C="idle",R(),m(),y(),P=T=null},D=()=>{C="finished",u&&u(),R(),m()},$=()=>{if(p)return;g||(g=n(L));const V=g.now();l&&l(),M!==null?P=V-M:(!P||C==="finished")&&(P=V),C==="finished"&&y(),T=P,M=null,C="running",g.start()};e&&$();const F={then(V,W){return v.then(V,W)},get time(){return Qi(N)},set time(V){V=Dr(V),N=V,M!==null||!g||f===0?M=V:P=g.now()-V/f},get duration(){const V=w.calculatedDuration===null?Ib(w):w.calculatedDuration;return Qi(V)},get speed(){return f},set speed(V){V===f||!g||(f=V,F.time=Qi(N))},get state(){return C},play:$,pause:()=>{C="paused",M=N},stop:()=>{p=!0,C!=="idle"&&(C="idle",c&&c(),B())},cancel:()=>{T!==null&&L(T),B()},complete:()=>{C="finished"},sample:V=>(P=0,L(V))};return F}function DI(e){let t;return()=>(t===void 0&&(t=e()),t)}const EI=DI(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),AI=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),du=10,OI=2e4,LI=(e,t)=>t.type==="spring"||e==="backgroundColor"||!pC(t.ease);function RI(e,t,{onUpdate:n,onComplete:i,...s}){if(!(EI()&&AI.has(t)&&!s.repeatDelay&&s.repeatType!=="mirror"&&s.damping!==0&&s.type!=="inertia"))return!1;let o=!1,a,l,c=!1;const u=()=>{l=new Promise(x=>{a=x})};u();let{keyframes:d,duration:h=300,ease:f,times:p}=s;if(LI(t,s)){const x=Xd({...s,repeat:0,delay:0});let _={done:!1,value:d[0]};const w=[];let S=0;for(;!_.done&&S{c=!1,m.cancel()},y=()=>{c=!0,zt.update(v),a(),u()};return m.onfinish=()=>{c||(e.set(H$(d,s)),i&&i(),y())},{then(x,_){return l.then(x,_)},attachTimeline(x){return m.timeline=x,m.onfinish=null,ce},get time(){return Qi(m.currentTime||0)},set time(x){m.currentTime=Dr(x)},get speed(){return m.playbackRate},set speed(x){m.playbackRate=x},get duration(){return Qi(h)},play:()=>{o||(m.play(),is(v))},pause:()=>m.pause(),stop:()=>{if(o=!0,m.playState==="idle")return;const{currentTime:x}=m;if(x){const _=Xd({...s,autoplay:!1});e.setWithVelocity(_.sample(x-du).value,_.sample(x).value,du)}y()},complete:()=>{c||m.finish()},cancel:y}}function NI({keyframes:e,delay:t,onUpdate:n,onComplete:i}){const s=()=>(n&&n(e[e.length-1]),i&&i(),{time:0,speed:1,duration:0,play:ce,pause:ce,stop:ce,then:r=>(r(),Promise.resolve()),cancel:ce,complete:ce});return t?Xd({keyframes:[0,1],duration:0,delay:t,onComplete:s}):s()}const jI={type:"spring",stiffness:500,damping:25,restSpeed:10},$I=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),II={type:"keyframes",duration:.8},FI={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},BI=(e,{keyframes:t})=>t.length>2?II:Ur.has(e)?e.startsWith("scale")?$I(t[1]):jI:FI,Rm=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Us.test(t)||t==="0")&&!t.startsWith("url(")),VI=new Set(["brightness","contrast","saturate","opacity"]);function zI(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=n.match(Ih)||[];if(!i)return e;const s=n.replace(i,"");let r=VI.has(t)?1:0;return i!==n&&(r*=100),t+"("+r+s+")"}const WI=/([a-z-]*)\(.*?\)/g,Nm={...Us,getAnimatableNone:e=>{const t=e.match(WI);return t?t.map(zI).join(" "):e}},HI={...QM,color:We,backgroundColor:We,outlineColor:We,fill:We,stroke:We,borderColor:We,borderTopColor:We,borderRightColor:We,borderBottomColor:We,borderLeftColor:We,filter:Nm,WebkitFilter:Nm},Yy=e=>HI[e];function IC(e,t){let n=Yy(e);return n!==Nm&&(n=Us),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const FC=e=>/^0[^.\s]+$/.test(e);function UI(e){if(typeof e=="number")return e===0;if(e!==null)return e==="none"||e==="0"||FC(e)}function YI(e,t,n,i){const s=Rm(t,n);let r;Array.isArray(n)?r=[...n]:r=[null,n];const o=i.from!==void 0?i.from:e.get();let a;const l=[];for(let c=0;cs=>{const r=Xy(i,e)||{},o=r.delay||i.delay||0;let{elapsed:a=0}=i;a=a-Dr(o);const l=YI(t,e,n,r),c=l[0],u=l[l.length-1],d=Rm(e,c),h=Rm(e,u);let f={keyframes:l,velocity:t.getVelocity(),ease:"easeOut",...r,delay:-a,onUpdate:p=>{t.set(p),r.onUpdate&&r.onUpdate(p)},onComplete:()=>{s(),r.onComplete&&r.onComplete()}};if(XI(r)||(f={...f,...BI(e,f)}),f.duration&&(f.duration=Dr(f.duration)),f.repeatDelay&&(f.repeatDelay=Dr(f.repeatDelay)),!d||!h||z$.current||r.type===!1||KI.skipAnimations)return NI(f);if(!i.isHandoff&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const p=RI(t,e,f);if(p)return p}return Xd(f)};function Kd(e){return!!(un(e)&&e.add)}const BC=e=>/^\-?\d*\.?\d+$/.test(e);function Gy(e,t){e.indexOf(t)===-1&&e.push(t)}function qy(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Qy{constructor(){this.subscriptions=[]}add(t){return Gy(this.subscriptions,t),()=>qy(this.subscriptions,t)}notify(t,n,i){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,i);else for(let r=0;r!isNaN(parseFloat(e));class qI{constructor(t,n={}){this.version="10.18.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(i,s=!0)=>{this.prev=this.current,this.current=i;const{delta:r,timestamp:o}=je;this.lastUpdated!==o&&(this.timeDelta=r,this.lastUpdated=o,zt.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),s&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>zt.postRender(this.velocityCheck),this.velocityCheck=({timestamp:i})=>{i!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=GI(this.current),this.owner=n.owner}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Qy);const i=this.events[t].add(n);return t==="change"?()=>{i(),zt.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,i){this.set(n),this.prev=t,this.timeDelta=i}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?NC(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Qo(e,t){return new qI(e,t)}const VC=e=>t=>t.test(e),QI={test:e=>e==="auto",parse:e=>e},zC=[Yr,st,bi,ps,s$,i$,QI],Ma=e=>zC.find(VC(e)),ZI=[...zC,We,Us],JI=e=>ZI.find(VC(e));function tF(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Qo(n))}function eF(e,t){const n=Bh(e,t);let{transitionEnd:i={},transition:s={},...r}=n?e.makeTargetAnimatable(n,!1):{};r={...r,...i};for(const o in r){const a=v$(r[o]);tF(e,o,a)}}function nF(e,t,n){var i,s;const r=Object.keys(t).filter(a=>!e.hasValue(a)),o=r.length;if(o)for(let a=0;al.remove(d))),c.push(v)}return o&&Promise.all(c).then(()=>{o&&eF(e,o)}),c}function jm(e,t,n={}){const i=Bh(e,t,n.custom);let{transition:s=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const r=i?()=>Promise.all(WC(e,i,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:u,staggerDirection:d}=s;return aF(e,t,c+l,u,d,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[l,c]=a==="beforeChildren"?[r,o]:[o,r];return l().then(()=>c())}else return Promise.all([r(),o(n.delay)])}function aF(e,t,n=0,i=0,s=1,r){const o=[],a=(e.variantChildren.size-1)*i,l=s===1?(c=0)=>c*i:(c=0)=>a-c*i;return Array.from(e.variantChildren).sort(lF).forEach((c,u)=>{c.notify("AnimationStart",t),o.push(jm(c,t,{...r,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function lF(e,t){return e.sortNodePosition(t)}function cF(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const s=t.map(r=>jm(e,r,n));i=Promise.all(s)}else if(typeof t=="string")i=jm(e,t,n);else{const s=typeof t=="function"?Bh(e,t,n.custom):t;i=Promise.all(WC(e,s,n))}return i.then(()=>e.notify("AnimationComplete",t))}const uF=[...Oy].reverse(),dF=Oy.length;function hF(e){return t=>Promise.all(t.map(({animation:n,options:i})=>cF(e,n,i)))}function fF(e){let t=hF(e);const n=mF();let i=!0;const s=(l,c)=>{const u=Bh(e,c);if(u){const{transition:d,transitionEnd:h,...f}=u;l={...l,...f,...h}}return l};function r(l){t=l(e)}function o(l,c){const u=e.getProps(),d=e.getVariantContext(!0)||{},h=[],f=new Set;let p={},m=1/0;for(let y=0;ym&&w,T=!1;const A=Array.isArray(_)?_:[_];let E=A.reduce(s,{});S===!1&&(E={});const{prevResolvedValues:z={}}=x,N={...z,...E},L=R=>{P=!0,f.has(R)&&(T=!0,f.delete(R)),x.needsAnimating[R]=!0};for(const R in N){const B=E[R],D=z[R];if(p.hasOwnProperty(R))continue;let $=!1;Hd(B)&&Hd(D)?$=!hC(B,D):$=B!==D,$?B!==void 0?L(R):f.add(R):B!==void 0&&f.has(R)?L(R):x.protectedKeys[R]=!0}x.prevProp=_,x.prevResolvedValues=E,x.isActive&&(p={...p,...E}),i&&e.blockInitialAnimation&&(P=!1),P&&(!C||T)&&h.push(...A.map(R=>({animation:R,options:{type:g,...l}})))}if(f.size){const y={};f.forEach(g=>{const x=e.getBaseTarget(g);x!==void 0&&(y[g]=x)}),h.push({animation:y})}let v=!!h.length;return i&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(v=!1),i=!1,v?t(h):Promise.resolve()}function a(l,c,u){var d;if(n[l].isActive===c)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(f=>{var p;return(p=f.animationState)===null||p===void 0?void 0:p.setActive(l,c)}),n[l].isActive=c;const h=o(u,l);for(const f in n)n[f].protectedKeys={};return h}return{animateChanges:o,setActive:a,setAnimateFunction:r,getState:()=>n}}function pF(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!hC(t,e):!1}function lr(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function mF(){return{animate:lr(!0),whileInView:lr(),whileHover:lr(),whileTap:lr(),whileDrag:lr(),whileFocus:lr(),exit:lr()}}class gF extends tr{constructor(t){super(t),t.animationState||(t.animationState=fF(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),jh(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){}}let yF=0;class vF extends tr{constructor(){super(...arguments),this.id=yF++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n,custom:i}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const r=this.node.animationState.setActive("exit",!t,{custom:i??this.node.getProps().custom});n&&!t&&r.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const xF={animation:{Feature:gF},exit:{Feature:vF}},Fb=(e,t)=>Math.abs(e-t);function bF(e,t){const n=Fb(e.x,t.x),i=Fb(e.y,t.y);return Math.sqrt(n**2+i**2)}class HC{constructor(t,n,{transformPagePoint:i,contextWindow:s,dragSnapToOrigin:r=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=tp(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,f=bF(d.offset,{x:0,y:0})>=3;if(!h&&!f)return;const{point:p}=d,{timestamp:m}=je;this.history.push({...p,timestamp:m});const{onStart:v,onMove:y}=this.handlers;h||(v&&v(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,h)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Jf(h,this.transformPagePoint),zt.update(this.updatePoint,!0)},this.handlePointerUp=(d,h)=>{this.end();const{onEnd:f,onSessionEnd:p,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=tp(d.type==="pointercancel"?this.lastMoveEventInfo:Jf(h,this.transformPagePoint),this.history);this.startEvent&&f&&f(d,v),p&&p(d,v)},!aC(t))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=i,this.contextWindow=s||window;const o=Fh(t),a=Jf(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=je;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=n;u&&u(t,tp(a,this.history)),this.removeListeners=Is(qi(this.contextWindow,"pointermove",this.handlePointerMove),qi(this.contextWindow,"pointerup",this.handlePointerUp),qi(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),is(this.updatePoint)}}function Jf(e,t){return t?{point:t(e.point)}:e}function Bb(e,t){return{x:e.x-t.x,y:e.y-t.y}}function tp({point:e},t){return{point:e,delta:Bb(e,UC(t)),offset:Bb(e,_F(t)),velocity:wF(t,.1)}}function _F(e){return e[0]}function UC(e){return e[e.length-1]}function wF(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const s=UC(e);for(;n>=0&&(i=e[n],!(s.timestamp-i.timestamp>Dr(t)));)n--;if(!i)return{x:0,y:0};const r=Qi(s.timestamp-i.timestamp);if(r===0)return{x:0,y:0};const o={x:(s.x-i.x)/r,y:(s.y-i.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function wn(e){return e.max-e.min}function $m(e,t=0,n=.01){return Math.abs(e-t)<=n}function Vb(e,t,n,i=.5){e.origin=i,e.originPoint=ee(t.min,t.max,e.origin),e.scale=wn(n)/wn(t),($m(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=ee(n.min,n.max,e.origin)-e.originPoint,($m(e.translate)||isNaN(e.translate))&&(e.translate=0)}function vl(e,t,n,i){Vb(e.x,t.x,n.x,i?i.originX:void 0),Vb(e.y,t.y,n.y,i?i.originY:void 0)}function zb(e,t,n){e.min=n.min+t.min,e.max=e.min+wn(t)}function kF(e,t,n){zb(e.x,t.x,n.x),zb(e.y,t.y,n.y)}function Wb(e,t,n){e.min=t.min-n.min,e.max=e.min+wn(t)}function xl(e,t,n){Wb(e.x,t.x,n.x),Wb(e.y,t.y,n.y)}function SF(e,{min:t,max:n},i){return t!==void 0&&en&&(e=i?ee(n,e,i.max):Math.min(e,n)),e}function Hb(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function MF(e,{top:t,left:n,bottom:i,right:s}){return{x:Hb(e.x,n,s),y:Hb(e.y,t,i)}}function Ub(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.mini?n=Ql(t.min,t.max-i,e.min):i>s&&(n=Ql(e.min,e.max-s,t.min)),Hs(0,1,n)}function TF(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Im=.35;function DF(e=Im){return e===!1?e=0:e===!0&&(e=Im),{x:Yb(e,"left","right"),y:Yb(e,"top","bottom")}}function Yb(e,t,n){return{min:Xb(e,t),max:Xb(e,n)}}function Xb(e,t){return typeof e=="number"?e:e[t]||0}const Kb=()=>({translate:0,scale:1,origin:0,originPoint:0}),ko=()=>({x:Kb(),y:Kb()}),Gb=()=>({min:0,max:0}),fe=()=>({x:Gb(),y:Gb()});function An(e){return[e("x"),e("y")]}function YC({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function EF({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function AF(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function ep(e){return e===void 0||e===1}function Fm({scale:e,scaleX:t,scaleY:n}){return!ep(e)||!ep(t)||!ep(n)}function mr(e){return Fm(e)||XC(e)||e.z||e.rotate||e.rotateX||e.rotateY}function XC(e){return qb(e.x)||qb(e.y)}function qb(e){return e&&e!=="0%"}function Gd(e,t,n){const i=e-n,s=t*i;return n+s}function Qb(e,t,n,i,s){return s!==void 0&&(e=Gd(e,s,i)),Gd(e,n,i)+t}function Bm(e,t=0,n=1,i,s){e.min=Qb(e.min,t,n,i,s),e.max=Qb(e.max,t,n,i,s)}function KC(e,{x:t,y:n}){Bm(e.x,t.translate,t.scale,t.originPoint),Bm(e.y,n.translate,n.scale,n.originPoint)}function OF(e,t,n,i=!1){const s=n.length;if(!s)return;t.x=t.y=1;let r,o;for(let a=0;a1.0000000000001||e<.999999999999?e:1}function ys(e,t){e.min=e.min+t,e.max=e.max+t}function Jb(e,t,[n,i,s]){const r=t[s]!==void 0?t[s]:.5,o=ee(e.min,e.max,r);Bm(e,t[n],t[i],o,t.scale)}const LF=["x","scaleX","originX"],RF=["y","scaleY","originY"];function So(e,t){Jb(e.x,t,LF),Jb(e.y,t,RF)}function GC(e,t){return YC(AF(e.getBoundingClientRect(),t))}function NF(e,t,n){const i=GC(e,n),{scroll:s}=t;return s&&(ys(i.x,s.offset.x),ys(i.y,s.offset.y)),i}const qC=({current:e})=>e?e.ownerDocument.defaultView:null,jF=new WeakMap;class $F{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=fe(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const s=u=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Fh(u,"page").point)},r=(u,d)=>{const{drag:h,dragPropagation:f,onDragStart:p}=this.getProps();if(h&&!f&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=cC(h),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),An(v=>{let y=this.getAxisMotionValue(v).get()||0;if(bi.test(y)){const{projection:g}=this.visualElement;if(g&&g.layout){const x=g.layout.layoutBox[v];x&&(y=wn(x)*(parseFloat(y)/100))}}this.originPoint[v]=y}),p&&zt.update(()=>p(u,d),!1,!0);const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},o=(u,d)=>{const{dragPropagation:h,dragDirectionLock:f,onDirectionLock:p,onDrag:m}=this.getProps();if(!h&&!this.openGlobalLock)return;const{offset:v}=d;if(f&&this.currentDirection===null){this.currentDirection=IF(v),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",d.point,v),this.updateAxis("y",d.point,v),this.visualElement.render(),m&&m(u,d)},a=(u,d)=>this.stop(u,d),l=()=>An(u=>{var d;return this.getAnimationState(u)==="paused"&&((d=this.getAxisMotionValue(u).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new HC(t,{onSessionStart:s,onStart:r,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:qC(this.visualElement)})}stop(t,n){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:r}=this.getProps();r&&zt.update(()=>r(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,i){const{drag:s}=this.getProps();if(!i||!hu(t,s,this.currentDirection))return;const r=this.getAxisMotionValue(t);let o=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(o=SF(o,this.constraints[t],this.elastic[t])),r.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:i}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,r=this.constraints;n&&_o(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=MF(s.layoutBox,n):this.constraints=!1,this.elastic=DF(i),r!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&An(o=>{this.getAxisMotionValue(o)&&(this.constraints[o]=TF(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!_o(t))return!1;const i=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const r=NF(i,s.root,this.visualElement.getTransformPagePoint());let o=CF(s.layout.layoutBox,r);if(n){const a=n(EF(o));this.hasMutatedConstraints=!!a,a&&(o=YC(a))}return o}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:s,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=An(u=>{if(!hu(u,n,this.currentDirection))return;let d=l&&l[u]||{};o&&(d={min:0,max:0});const h=s?200:1e6,f=s?40:1e7,p={type:"inertia",velocity:i?t[u]:0,bounceStiffness:h,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...r,...d};return this.startAxisValueAnimation(u,p)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const i=this.getAxisMotionValue(t);return i.start(Ky(t,i,0,n))}stopAnimation(){An(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){An(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n="_drag"+t.toUpperCase(),i=this.visualElement.getProps(),s=i[n];return s||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){An(n=>{const{drag:i}=this.getProps();if(!hu(n,i,this.currentDirection))return;const{projection:s}=this.visualElement,r=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n];r.set(t[n]-ee(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!_o(n)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};An(o=>{const a=this.getAxisMotionValue(o);if(a){const l=a.get();s[o]=PF({min:l,max:l},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),An(o=>{if(!hu(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(ee(l,c,s[o]))})}addListeners(){if(!this.visualElement.current)return;jF.set(this.visualElement,this);const t=this.visualElement.current,n=qi(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),i=()=>{const{dragConstraints:l}=this.getProps();_o(l)&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,r=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),i();const o=Hi(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(An(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())});return()=>{o(),n(),r(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:s=!1,dragConstraints:r=!1,dragElastic:o=Im,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:s,dragConstraints:r,dragElastic:o,dragMomentum:a}}}function hu(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function IF(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class FF extends tr{constructor(t){super(t),this.removeGroupControls=ce,this.removeListeners=ce,this.controls=new $F(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ce}unmount(){this.removeGroupControls(),this.removeListeners()}}const t1=e=>(t,n)=>{e&&zt.update(()=>e(t,n))};class BF extends tr{constructor(){super(...arguments),this.removePointerDownListener=ce}onPointerDown(t){this.session=new HC(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:qC(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:s}=this.node.getProps();return{onSessionStart:t1(t),onStart:t1(n),onMove:i,onEnd:(r,o)=>{delete this.session,s&&zt.update(()=>s(r,o))}}}mount(){this.removePointerDownListener=qi(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function VF(){const e=k.useContext(Rh);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:i}=e,s=k.useId();return k.useEffect(()=>i(s),[]),!t&&n?[!1,()=>n&&n(s)]:[!0]}const nd={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function e1(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Ca={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(st.test(e))e=parseFloat(e);else return e;const n=e1(e,t.target.x),i=e1(e,t.target.y);return`${n}% ${i}%`}},zF={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,s=Us.parse(e);if(s.length>5)return i;const r=Us.createTransformer(e),o=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;s[0+o]/=a,s[1+o]/=l;const c=ee(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=c),typeof s[3+o]=="number"&&(s[3+o]/=c),r(s)}};class WF extends Y.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i,layoutId:s}=this.props,{projection:r}=t;qj(HF),r&&(n.group&&n.group.add(r),i&&i.register&&s&&i.register(r),r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),nd.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:i,drag:s,isPresent:r}=this.props,o=i.projection;return o&&(o.isPresent=r,s||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==r&&(r?o.promote():o.relegate()||zt.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),queueMicrotask(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),i&&i.deregister&&i.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function QC(e){const[t,n]=VF(),i=k.useContext(Ry);return Y.createElement(WF,{...e,layoutGroup:i,switchLayoutGroup:k.useContext(YM),isPresent:t,safeToRemove:n})}const HF={borderRadius:{...Ca,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ca,borderTopRightRadius:Ca,borderBottomLeftRadius:Ca,borderBottomRightRadius:Ca,boxShadow:zF},ZC=["TopLeft","TopRight","BottomLeft","BottomRight"],UF=ZC.length,n1=e=>typeof e=="string"?parseFloat(e):e,i1=e=>typeof e=="number"||st.test(e);function YF(e,t,n,i,s,r){s?(e.opacity=ee(0,n.opacity!==void 0?n.opacity:1,XF(i)),e.opacityExit=ee(t.opacity!==void 0?t.opacity:1,0,KF(i))):r&&(e.opacity=ee(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,i));for(let o=0;oit?1:n(Ql(e,t,i))}function r1(e,t){e.min=t.min,e.max=t.max}function Dn(e,t){r1(e.x,t.x),r1(e.y,t.y)}function o1(e,t,n,i,s){return e-=t,e=Gd(e,1/n,i),s!==void 0&&(e=Gd(e,1/s,i)),e}function GF(e,t=0,n=1,i=.5,s,r=e,o=e){if(bi.test(t)&&(t=parseFloat(t),t=ee(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=ee(r.min,r.max,i);e===r&&(a-=t),e.min=o1(e.min,t,n,a,s),e.max=o1(e.max,t,n,a,s)}function a1(e,t,[n,i,s],r,o){GF(e,t[n],t[i],t[s],t.scale,r,o)}const qF=["x","scaleX","originX"],QF=["y","scaleY","originY"];function l1(e,t,n,i){a1(e.x,t,qF,n?n.x:void 0,i?i.x:void 0),a1(e.y,t,QF,n?n.y:void 0,i?i.y:void 0)}function c1(e){return e.translate===0&&e.scale===1}function tP(e){return c1(e.x)&&c1(e.y)}function ZF(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function eP(e,t){return Math.round(e.x.min)===Math.round(t.x.min)&&Math.round(e.x.max)===Math.round(t.x.max)&&Math.round(e.y.min)===Math.round(t.y.min)&&Math.round(e.y.max)===Math.round(t.y.max)}function u1(e){return wn(e.x)/wn(e.y)}class JF{constructor(){this.members=[]}add(t){Gy(this.members,t),t.scheduleRender()}remove(t){if(qy(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let i;for(let s=n;s>=0;s--){const r=this.members[s];if(r.isPresent!==!1){i=r;break}}return i?(this.promote(i),!0):!1}promote(t,n){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,n&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:i}=t;n.onExitComplete&&n.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function d1(e,t,n){let i="";const s=e.x.translate/t.x,r=e.y.translate/t.y;if((s||r)&&(i=`translate3d(${s}px, ${r}px, 0) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:l,rotateX:c,rotateY:u}=n;l&&(i+=`rotate(${l}deg) `),c&&(i+=`rotateX(${c}deg) `),u&&(i+=`rotateY(${u}deg) `)}const o=e.x.scale*t.x,a=e.y.scale*t.y;return(o!==1||a!==1)&&(i+=`scale(${o}, ${a})`),i||"none"}const tB=(e,t)=>e.depth-t.depth;class eB{constructor(){this.children=[],this.isDirty=!1}add(t){Gy(this.children,t),this.isDirty=!0}remove(t){qy(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(tB),this.isDirty=!1,this.children.forEach(t)}}function nB(e,t){const n=performance.now(),i=({timestamp:s})=>{const r=s-n;r>=t&&(is(i),e(r-t))};return zt.read(i,!0),()=>is(i)}function iB(e){window.MotionDebug&&window.MotionDebug.record(e)}function sB(e){return e instanceof SVGElement&&e.tagName!=="svg"}function rB(e,t,n){const i=un(e)?e:Qo(e);return i.start(Ky("",i,t,n)),i.animation}const h1=["","X","Y","Z"],oB={visibility:"hidden"},f1=1e3;let aB=0;const gr={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function nP({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(o={},a=t==null?void 0:t()){this.id=aB++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,gr.totalNodes=gr.resolvedTargetDeltas=gr.recalculatedProjection=0,this.nodes.forEach(uB),this.nodes.forEach(mB),this.nodes.forEach(gB),this.nodes.forEach(dB),iB(gr)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=nB(h,250),nd.hasAnimatedSinceResize&&(nd.hasAnimatedSinceResize=!1,this.nodes.forEach(m1))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeTargetChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||u.getDefaultTransition()||_B,{onLayoutAnimationStart:v,onLayoutAnimationComplete:y}=u.getProps(),g=!this.targetLayout||!eP(this.targetLayout,p)||f,x=!h&&f;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||h&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,x);const _={...Xy(m,"layout"),onPlay:v,onComplete:y};(u.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_)}else h||m1(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,is(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(yB),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;uthis.update()))}clearAllSnapshots(){this.nodes.forEach(hB),this.sharedNodes.forEach(vB)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,zt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){zt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const w=_/1e3;g1(d.x,o.x,w),g1(d.y,o.y,w),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(xl(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),xB(this.relativeTarget,this.relativeTargetOrigin,h,w),x&&ZF(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=fe()),Dn(x,this.relativeTarget)),m&&(this.animationValues=u,YF(u,c,this.latestValues,w,g,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(is(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=zt.update(()=>{nd.hasAnimatedSinceResize=!0,this.currentAnimation=rB(0,f1,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(f1),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&iP(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||fe();const d=wn(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+d;const h=wn(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}Dn(a,l),So(a,u),vl(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new JF),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(a=!0),!a)return;const c={};for(let u=0;u{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(p1),this.root.sharedNodes.clear()}}}function lB(e){e.updateLayout()}function cB(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:s}=e.layout,{animationType:r}=e.options,o=n.source!==e.layout.source;r==="size"?An(d=>{const h=o?n.measuredBox[d]:n.layoutBox[d],f=wn(h);h.min=i[d].min,h.max=h.min+f}):iP(r,n.layoutBox,i)&&An(d=>{const h=o?n.measuredBox[d]:n.layoutBox[d],f=wn(i[d]);h.max=h.min+f,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+f)});const a=ko();vl(a,i,n.layoutBox);const l=ko();o?vl(l,e.applyTransform(s,!0),n.measuredBox):vl(l,i,n.layoutBox);const c=!tP(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:h,layout:f}=d;if(h&&f){const p=fe();xl(p,n.layoutBox,h.layoutBox);const m=fe();xl(m,i,f.layoutBox),eP(p,m)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=p,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:i,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeTargetChanged:u})}else if(e.isLead()){const{onExitComplete:i}=e.options;i&&i()}e.options.transition=void 0}function uB(e){gr.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function dB(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function hB(e){e.clearSnapshot()}function p1(e){e.clearMeasurements()}function fB(e){e.isLayoutDirty=!1}function pB(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function m1(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function mB(e){e.resolveTargetDelta()}function gB(e){e.calcProjection()}function yB(e){e.resetRotation()}function vB(e){e.removeLeadSnapshot()}function g1(e,t,n){e.translate=ee(t.translate,0,n),e.scale=ee(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function y1(e,t,n,i){e.min=ee(t.min,n.min,i),e.max=ee(t.max,n.max,i)}function xB(e,t,n,i){y1(e.x,t.x,n.x,i),y1(e.y,t.y,n.y,i)}function bB(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const _B={duration:.45,ease:[.4,0,.1,1]},v1=e=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(e),x1=v1("applewebkit/")&&!v1("chrome/")?Math.round:ce;function b1(e){e.min=x1(e.min),e.max=x1(e.max)}function wB(e){b1(e.x),b1(e.y)}function iP(e,t,n){return e==="position"||e==="preserve-aspect"&&!$m(u1(t),u1(n),.2)}const kB=nP({attachResizeListener:(e,t)=>Hi(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),np={current:void 0},sP=nP({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!np.current){const e=new kB({});e.mount(window),e.setOptions({layoutScroll:!0}),np.current=e}return np.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),SB={pan:{Feature:BF},drag:{Feature:FF,ProjectionNode:sP,MeasureLayout:QC}},MB=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function CB(e){const t=MB.exec(e);if(!t)return[,];const[,n,i]=t;return[n,i]}function Vm(e,t,n=1){const[i,s]=CB(e);if(!i)return;const r=window.getComputedStyle(t).getPropertyValue(i);if(r){const o=r.trim();return BC(o)?parseFloat(o):o}else return Em(s)?Vm(s,t,n+1):s}function PB(e,{...t},n){const i=e.current;if(!(i instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(s=>{const r=s.get();if(!Em(r))return;const o=Vm(r,i);o&&s.set(o)});for(const s in t){const r=t[s];if(!Em(r))continue;const o=Vm(r,i);o&&(t[s]=o,n||(n={}),n[s]===void 0&&(n[s]=r))}return{target:t,transitionEnd:n}}const TB=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),rP=e=>TB.has(e),DB=e=>Object.keys(e).some(rP),_1=e=>e===Yr||e===st,w1=(e,t)=>parseFloat(e.split(", ")[t]),k1=(e,t)=>(n,{transform:i})=>{if(i==="none"||!i)return 0;const s=i.match(/^matrix3d\((.+)\)$/);if(s)return w1(s[1],t);{const r=i.match(/^matrix\((.+)\)$/);return r?w1(r[1],e):0}},EB=new Set(["x","y","z"]),AB=yc.filter(e=>!EB.has(e));function OB(e){const t=[];return AB.forEach(n=>{const i=e.getValue(n);i!==void 0&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const Zo={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:k1(4,13),y:k1(5,14)};Zo.translateX=Zo.x;Zo.translateY=Zo.y;const LB=(e,t,n)=>{const i=t.measureViewportBox(),s=t.current,r=getComputedStyle(s),{display:o}=r,a={};o==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(c=>{a[c]=Zo[c](i,r)}),t.render();const l=t.measureViewportBox();return n.forEach(c=>{const u=t.getValue(c);u&&u.jump(a[c]),e[c]=Zo[c](l,r)}),e},RB=(e,t,n={},i={})=>{t={...t},i={...i};const s=Object.keys(t).filter(rP);let r=[],o=!1;const a=[];if(s.forEach(l=>{const c=e.getValue(l);if(!e.hasValue(l))return;let u=n[l],d=Ma(u);const h=t[l];let f;if(Hd(h)){const p=h.length,m=h[0]===null?1:0;u=h[m],d=Ma(u);for(let v=m;v=0?window.pageYOffset:null,c=LB(t,e,a);return r.length&&r.forEach(([u,d])=>{e.getValue(u).set(d)}),e.render(),Nh&&l!==null&&window.scrollTo({top:l}),{target:c,transitionEnd:i}}else return{target:t,transitionEnd:i}};function NB(e,t,n,i){return DB(t)?RB(e,t,n,i):{target:t,transitionEnd:i}}const jB=(e,t,n,i)=>{const s=PB(e,t,i);return t=s.target,i=s.transitionEnd,NB(e,t,n,i)},zm={current:null},oP={current:!1};function $B(){if(oP.current=!0,!!Nh)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>zm.current=e.matches;e.addListener(t),t()}else zm.current=!1}function IB(e,t,n){const{willChange:i}=t;for(const s in t){const r=t[s],o=n[s];if(un(r))e.addValue(s,r),Kd(i)&&i.add(s);else if(un(o))e.addValue(s,Qo(r,{owner:e})),Kd(i)&&i.remove(s);else if(o!==r)if(e.hasValue(s)){const a=e.getValue(s);!a.hasAnimated&&a.set(r)}else{const a=e.getStaticValue(s);e.addValue(s,Qo(a!==void 0?a:r,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const S1=new WeakMap,aP=Object.keys(ql),FB=aP.length,M1=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],BB=Ly.length;class VB{constructor({parent:t,props:n,presenceContext:i,reducedMotionConfig:s,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>zt.render(this.render,!1,!0);const{latestValues:a,renderState:l}=r;this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=o,this.isControllingVariants=$h(n),this.isVariantNode=UM(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:c,...u}=this.scrapeMotionValuesFromProps(n,{});for(const d in u){const h=u[d];a[d]!==void 0&&un(h)&&(h.set(a[d],!1),Kd(c)&&c.add(d))}}scrapeMotionValuesFromProps(t,n){return{}}mount(t){this.current=t,S1.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,i)=>this.bindToMotionValue(i,n)),oP.current||$B(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:zm.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){S1.delete(this.current),this.projection&&this.projection.unmount(),is(this.notifyUpdate),is(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,n){const i=Ur.has(t),s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&zt.update(this.notifyUpdate,!1,!0),i&&this.projection&&(this.projection.isTransformDirty=!0)}),r=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{s(),r()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures({children:t,...n},i,s,r){let o,a;for(let l=0;lthis.scheduleRender(),animationType:typeof c=="string"?c:"both",initialPromotionConfig:r,layoutScroll:h,layoutRoot:f})}return a}updateFeatures(){for(const t in this.features){const n=this.features[t];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):fe()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;in.variantChildren.delete(t)}addValue(t,n){n!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,n)),this.values.set(t,n),this.latestValues[t]=n.get()}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return i===void 0&&n!==void 0&&(i=Qo(n,{owner:this}),this.addValue(t,i)),i}readValue(t){var n;return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(n=this.getBaseTargetFromProps(this.props,t))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:i}=this.props,s=typeof i=="string"||typeof i=="object"?(n=Vy(this.props,i))===null||n===void 0?void 0:n[t]:void 0;if(i&&s!==void 0)return s;const r=this.getBaseTargetFromProps(this.props,t);return r!==void 0&&!un(r)?r:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Qy),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class lP extends VB{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:i}){delete n[t],delete i[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...i},{transformValues:s},r){let o=sF(i,t||{},this);if(s&&(n&&(n=s(n)),i&&(i=s(i)),o&&(o=s(o))),r){nF(this,i,o);const a=jB(this,i,o,n);n=a.transitionEnd,i=a.target}return{transition:t,transitionEnd:n,...i}}}function zB(e){return window.getComputedStyle(e)}class WB extends lP{constructor(){super(...arguments),this.type="html"}readValueFromInstance(t,n){if(Ur.has(n)){const i=Yy(n);return i&&i.default||0}else{const i=zB(t),s=(GM(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return GC(t,n)}build(t,n,i,s){jy(t,n,i,s.transformTemplate)}scrapeMotionValuesFromProps(t,n){return By(t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;un(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(t,n,i,s){eC(t,n,i,s)}}class HB extends lP{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ur.has(n)){const i=Yy(n);return i&&i.default||0}return n=nC.has(n)?n:Ay(n),t.getAttribute(n)}measureInstanceViewportBox(){return fe()}scrapeMotionValuesFromProps(t,n){return sC(t,n)}build(t,n,i,s){Iy(t,n,i,this.isSVGTag,s.transformTemplate)}renderInstance(t,n,i,s){iC(t,n,i,s)}mount(t){this.isSVGTag=Fy(t.tagName),super.mount(t)}}const UB=(e,t)=>Ny(e)?new HB(t,{enableHardwareAcceleration:!1}):new WB(t,{enableHardwareAcceleration:!0}),YB={layout:{ProjectionNode:sP,MeasureLayout:QC}},XB={...xF,...F$,...SB,...YB},Jo=Kj((e,t)=>C$(e,t,XB,UB));function cP(){const e=k.useRef(!1);return Ey(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function KB(){const e=cP(),[t,n]=k.useState(0),i=k.useCallback(()=>{e.current&&n(t+1)},[t]);return[k.useCallback(()=>zt.postRender(i),[i]),t]}class GB extends k.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function qB({children:e,isPresent:t}){const n=k.useId(),i=k.useRef(null),s=k.useRef({width:0,height:0,top:0,left:0});return k.useInsertionEffect(()=>{const{width:r,height:o,top:a,left:l}=s.current;if(t||!i.current||!r||!o)return;i.current.dataset.motionPopId=n;const c=document.createElement("style");return document.head.appendChild(c),c.sheet&&c.sheet.insertRule(` +`):e}function WR(e,t){const{element:n,datasetIndex:i,index:s}=t,r=e.getDatasetMeta(i).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:e,label:o,parsed:r.getParsed(s),raw:e.data.datasets[i].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:n}}function qx(e,t){const n=e.chart.ctx,{body:i,footer:s,title:r}=e,{boxWidth:o,boxHeight:a}=t,l=ge(t.bodyFont),c=ge(t.titleFont),u=ge(t.footerFont),d=r.length,h=s.length,f=i.length,p=Ae(t.padding);let m=p.height,v=0,y=i.reduce((_,w)=>_+w.before.length+w.lines.length+w.after.length,0);if(y+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),y){const _=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=f*_+(y-f)*l.lineHeight+(y-1)*t.bodySpacing}h&&(m+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let g=0;const x=function(_){v=Math.max(v,n.measureText(_).width+g)};return n.save(),n.font=c.string,Et(e.title,x),n.font=l.string,Et(e.beforeBody.concat(e.afterBody),x),g=t.displayColors?o+2+t.boxPadding:0,Et(i,_=>{Et(_.before,x),Et(_.lines,x),Et(_.after,x)}),g=0,n.font=u.string,Et(e.footer,x),n.restore(),v+=p.width,{width:v,height:m}}function HR(e,t){const{y:n,height:i}=t;return ne.height-i/2?"bottom":"center"}function UR(e,t,n,i){const{x:s,width:r}=i,o=n.caretSize+n.caretPadding;if(e==="left"&&s+r+o>t.width||e==="right"&&s-r-o<0)return!0}function YR(e,t,n,i){const{x:s,width:r}=n,{width:o,chartArea:{left:a,right:l}}=e;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),UR(c,e,t,n)&&(c="center"),c}function Qx(e,t,n){const i=n.yAlign||t.yAlign||HR(e,n);return{xAlign:n.xAlign||t.xAlign||YR(e,t,n,i),yAlign:i}}function XR(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function KR(e,t,n){let{y:i,height:s}=e;return t==="top"?i+=n:t==="bottom"?i-=s+n:i-=s/2,i}function Zx(e,t,n,i){const{caretSize:s,caretPadding:r,cornerRadius:o}=e,{xAlign:a,yAlign:l}=n,c=s+r,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:f}=Cr(o);let p=XR(t,a);const m=KR(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,h)+s:a==="right"&&(p+=Math.max(d,f)+s),{x:we(p,0,i.width-t.width),y:we(m,0,i.height-t.height)}}function ou(e,t,n){const i=Ae(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function Jx(e){return ci([],Oi(e))}function GR(e,t,n){return Qs(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function tb(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const EM={beforeTitle:Di,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex"u"?EM[t].call(n,i):s}var kp;let eb=(kp=class extends os{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,i=this.options.setContext(this.getContext()),s=i.enabled&&n.options.animation&&i.animations,r=new sM(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=GR(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,s=qe(i,"beforeTitle",this,t),r=qe(i,"title",this,t),o=qe(i,"afterTitle",this,t);let a=[];return a=ci(a,Oi(s)),a=ci(a,Oi(r)),a=ci(a,Oi(o)),a}getBeforeBody(t,n){return Jx(qe(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,s=[];return Et(t,r=>{const o={before:[],lines:[],after:[]},a=tb(i,r);ci(o.before,Oi(qe(a,"beforeLabel",this,r))),ci(o.lines,qe(a,"label",this,r)),ci(o.after,Oi(qe(a,"afterLabel",this,r))),s.push(o)}),s}getAfterBody(t,n){return Jx(qe(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,s=qe(i,"beforeFooter",this,t),r=qe(i,"footer",this,t),o=qe(i,"afterFooter",this,t);let a=[];return a=ci(a,Oi(s)),a=ci(a,Oi(r)),a=ci(a,Oi(o)),a}_createItems(t){const n=this._active,i=this.chart.data,s=[],r=[],o=[];let a=[],l,c;for(l=0,c=n.length;lt.filter(u,d,h,i))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,i))),Et(a,u=>{const d=tb(t.callbacks,u);s.push(qe(d,"labelColor",this,u)),r.push(qe(d,"labelPointStyle",this,u)),o.push(qe(d,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,n){const i=this.options.setContext(this.getContext()),s=this._active;let r,o=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const a=qa[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const l=this._size=qx(this,i),c=Object.assign({},a,l),u=Qx(this.chart,i,c),d=Zx(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,s){const r=this.getCaretPosition(t,i,s);n.lineTo(r.x1,r.y1),n.lineTo(r.x2,r.y2),n.lineTo(r.x3,r.y3)}getCaretPosition(t,n,i){const{xAlign:s,yAlign:r}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=Cr(a),{x:h,y:f}=t,{width:p,height:m}=n;let v,y,g,x,_,w;return r==="center"?(_=f+m/2,s==="left"?(v=h,y=v-o,x=_+o,w=_-o):(v=h+p,y=v+o,x=_-o,w=_+o),g=v):(s==="left"?y=h+Math.max(l,u)+o:s==="right"?y=h+p-Math.max(c,d)-o:y=this.caretX,r==="top"?(x=f,_=x-o,v=y-o,g=y+o):(x=f+m,_=x+o,v=y+o,g=y-o),w=x),{x1:v,x2:y,x3:g,y1:x,y2:_,y3:w}}drawTitle(t,n,i){const s=this.title,r=s.length;let o,a,l;if(r){const c=Oo(i.rtl,this.x,this.width);for(t.x=ou(this,i.titleAlign,i),n.textAlign=c.textAlign(i.titleAlign),n.textBaseline="middle",o=ge(i.titleFont),a=i.titleSpacing,n.fillStyle=i.titleColor,n.font=o.string,l=0;lg!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Hl(t,{x:m,y:p,w:c,h:l,radius:y}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Hl(t,{x:v,y:p+1,w:c-2,h:l-2,radius:y}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(m,p,c,l),t.strokeRect(m,p,c,l),t.fillStyle=o.backgroundColor,t.fillRect(v,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=ge(i.bodyFont);let h=d.lineHeight,f=0;const p=Oo(i.rtl,this.x,this.width),m=function(M){n.fillText(M,p.x(t.x+f),t.y+h/2),t.y+=h+r},v=p.textAlign(o);let y,g,x,_,w,S,C;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,t.x=ou(this,v,i),n.fillStyle=i.bodyColor,Et(this.beforeBody,m),f=a&&v!=="right"?o==="center"?c/2+u:c+2+u:0,_=0,S=s.length;_0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const o=qa[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=qx(this,t),l=Object.assign({},o,this._size),c=Qx(n,t,l),u=Zx(t,l,c,n);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Ae(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=i,this.drawBackground(r,t,s,n),JS(t,n.textDirection),r.y+=o.top,this.drawTitle(r,t,n),this.drawBody(r,t,n),this.drawFooter(r,t,n),tM(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!Ld(i,s),o=this._positionChanged(s,n);(r||o)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],o=this._getActiveElements(t,r,n,i),a=this._positionChanged(o,t),l=n||!Ld(o,r)||a;return l&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,i,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)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,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:i,caretY:s,options:r}=this,o=qa[r.position].call(this,t,n);return o!==!1&&(i!==o.x||s!==o.y)}},K(kp,"positioners",qa),kp);var qR={id:"tooltip",_element:eb,positioners:qa,afterInit(e,t,n){n&&(e.tooltip=new eb({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:EM},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"]},QR=Object.freeze({__proto__:null,Colors:cR,Decimation:fR,Filler:LR,Legend:FR,SubTitle:zR,Title:VR,Tooltip:qR});const ZR=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function JR(e,t,n,i){const s=e.indexOf(t);if(s===-1)return ZR(e,t,n,i);const r=e.lastIndexOf(t);return s!==r?n:s}const tN=(e,t)=>e===null?null:we(Math.round(e),0,t);function nb(e){const t=this.getLabels();return e>=0&&en.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}},K(Ru,"id","category"),K(Ru,"defaults",{ticks:{callback:nb}}),Ru);function nN(e,t){const n=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=e,f=r||1,p=u-1,{min:m,max:v}=t,y=!bt(o),g=!bt(a),x=!bt(c),_=(v-m)/(d+1);let w=Gv((v-m)/p/f)*f,S,C,M,P;if(w<1e-14&&!y&&!g)return[{value:m},{value:v}];P=Math.ceil(v/w)-Math.floor(m/w),P>p&&(w=Gv(P*w/p/f)*f),bt(l)||(S=Math.pow(10,l),w=Math.ceil(w*S)/S),s==="ticks"?(C=Math.floor(m/w)*w,M=Math.ceil(v/w)*w):(C=m,M=v),y&&g&&r&&WA((a-o)/r,w/1e3)?(P=Math.round(Math.min((a-o)/w,u)),w=(a-o)/P,C=o,M=a):x?(C=y?o:C,M=g?a:M,P=c-1,w=(M-C)/P):(P=(M-C)/w,dl(P,Math.round(P),w/1e3)?P=Math.round(P):P=Math.ceil(P));const T=Math.max(qv(w),qv(C));S=Math.pow(10,bt(l)?T:l),C=Math.round(C*S)/S,M=Math.round(M*S)/S;let A=0;for(y&&(h&&C!==o?(n.push({value:o}),Ca)break;n.push({value:E})}return g&&h&&M!==a?n.length&&dl(n[n.length-1].value,a,ib(a,_,e))?n[n.length-1].value=a:n.push({value:a}):(!g||M===a)&&n.push({value:M}),n}function ib(e,t,{horizontal:n,minRotation:i}){const s=Jn(i),r=(n?Math.sin(s):Math.cos(s))||.001,o=.75*t*(""+e).length;return Math.min(t/r,o)}let Bd=class extends pc{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 bt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:s,max:r}=this;const o=l=>s=n?s:l,a=l=>r=i?r:l;if(t){const l=vi(s),c=vi(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(s===r){let l=r===0?1:Math.abs(r*.05);a(r+l),t||o(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},r=this._range||this,o=nN(s,r);return t.bounds==="ticks"&&jS(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,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-n)/Math.max(t.length-1,1)/2;n-=s,i+=s}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return hc(t,this.chart.options.locale,this.options.ticks.format)}};var Nu;let iN=(Nu=class extends Bd{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=oe(t)?t:0,this.max=oe(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=Jn(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}},K(Nu,"id","linear"),K(Nu,"defaults",{ticks:{callback:Mh.formatters.numeric}}),Nu);const Yl=e=>Math.floor(Ss(e)),ar=(e,t)=>Math.pow(10,Yl(e)+t);function sb(e){return e/Math.pow(10,Yl(e))===1}function rb(e,t,n){const i=Math.pow(10,n),s=Math.floor(e/i);return Math.ceil(t/i)-s}function sN(e,t){const n=t-e;let i=Yl(n);for(;rb(e,t,i)>10;)i++;for(;rb(e,t,i)<10;)i--;return Math.min(i,Yl(e))}function rN(e,{min:t,max:n}){t=mn(e.min,t);const i=[],s=Yl(t);let r=sN(t,n),o=r<0?Math.pow(10,Math.abs(r)):1;const a=Math.pow(10,r),l=s>r?Math.pow(10,s):0,c=Math.round((t-l)*o)/o,u=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((c-u)/Math.pow(10,r)),h=mn(e.min,Math.round((l+u+d*Math.pow(10,r))*o)/o);for(;h=10?d=d<15?15:20:d++,d>=20&&(r++,d=2,o=r>=0?1:o),h=Math.round((l+u+d*Math.pow(10,r))*o)/o;const f=mn(e.max,h);return i.push({value:f,major:sb(f),significand:d}),i}var ju;let oN=(ju=class extends pc{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const i=Bd.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return oe(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=oe(t)?Math.max(0,t):null,this.max=oe(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!oe(this._userMin)&&(this.min=t===ar(this.min,0)?ar(this.min,-1):ar(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let i=this.min,s=this.max;const r=a=>i=t?i:a,o=a=>s=n?s:a;i===s&&(i<=0?(r(1),o(10)):(r(ar(i,-1)),o(ar(s,1)))),i<=0&&r(ar(s,-1)),s<=0&&o(ar(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},i=rN(n,this);return t.bounds==="ticks"&&jS(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":hc(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ss(t),this._valueRange=Ss(this.max)-Ss(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ss(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}},K(ju,"id","logarithmic"),K(ju,"defaults",{ticks:{callback:Mh.formatters.logarithmic,major:{enabled:!0}}}),ju);function Pm(e){const t=e.ticks;if(t.display&&e.display){const n=Ae(t.backdropPadding);return at(t.font&&t.font.size,ne.font.size)+n.height}return 0}function aN(e,t,n){return n=Ut(n)?n:[n],{w:oO(e,t.string,n),h:n.length*t.lineHeight}}function ob(e,t,n,i,s){return e===i||e===s?{start:t-n/2,end:t+n/2}:es?{start:t-n,end:t}:{start:t,end:t+n}}function lN(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),i=[],s=[],r=e._pointLabels.length,o=e.options.pointLabels,a=o.centerPointLabels?Kt/r:0;for(let l=0;lt.r&&(a=(i.end-t.r)/r,e.r=Math.max(e.r,t.r+a)),s.startt.b&&(l=(s.end-t.b)/o,e.b=Math.max(e.b,t.b+l))}function uN(e,t,n){const i=e.drawingArea,{extra:s,additionalAngle:r,padding:o,size:a}=n,l=e.getPointPosition(t,i+s+o,r),c=Math.round(ly(yn(l.angle+ue))),u=mN(l.y,a.h,c),d=fN(c),h=pN(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+a.w,bottom:u+a.h}}function dN(e,t){if(!t)return!0;const{left:n,top:i,right:s,bottom:r}=e;return!(Wi({x:n,y:i},t)||Wi({x:n,y:r},t)||Wi({x:s,y:i},t)||Wi({x:s,y:r},t))}function hN(e,t,n){const i=[],s=e._pointLabels.length,r=e.options,{centerPointLabels:o,display:a}=r.pointLabels,l={extra:Pm(r)/2,additionalAngle:o?Kt/s:0};let c;for(let u=0;u270||n<90)&&(e-=t),e}function gN(e,t,n){const{left:i,top:s,right:r,bottom:o}=n,{backdropColor:a}=t;if(!bt(a)){const l=Cr(t.borderRadius),c=Ae(t.backdropPadding);e.fillStyle=a;const u=i-c.left,d=s-c.top,h=r-i+c.width,f=o-s+c.height;Object.values(l).some(p=>p!==0)?(e.beginPath(),Hl(e,{x:u,y:d,w:h,h:f,radius:l}),e.fill()):e.fillRect(u,d,h,f)}}function yN(e,t){const{ctx:n,options:{pointLabels:i}}=e;for(let s=t-1;s>=0;s--){const r=e._pointLabelItems[s];if(!r.visible)continue;const o=i.setContext(e.getPointLabelContext(s));gN(n,o,r);const a=ge(o.font),{x:l,y:c,textAlign:u}=r;Br(n,e._pointLabels[s],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function AM(e,t,n,i){const{ctx:s}=e;if(n)s.arc(e.xCenter,e.yCenter,t,0,Xt);else{let r=e.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let o=1;o{const s=$t(this.options.pointLabels.callback,[n,i],this);return s||s===0?s:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?lN(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,s){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,s))}getIndexAngle(t){const n=Xt/(this._pointLabels.length||1),i=this.options.startAngle||0;return yn(t*n+Jn(i))}getDistanceFromCenterForValue(t){if(bt(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(bt(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{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(d),f=s.setContext(h),p=r.setContext(h);vN(this,f,l,o,p)}}),i.display){for(t.save(),a=o-1;a>=0;a--){const u=i.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:h}=u;!h||!d||(t.lineWidth=h,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.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,i=n.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=i.setContext(this.getContext(l)),u=ge(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=Ae(c.backdropPadding);t.fillRect(-o/2-d.left,-r-u.size/2-d.top,o+d.width,u.size+d.height)}Br(t,a.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}},K(ro,"id","radialLinear"),K(ro,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Mh.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),K(ro,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),K(ro,"descriptors",{angleLines:{_fallback:"grid"}}),ro);const Eh={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}},tn=Object.keys(Eh);function ab(e,t){return e-t}function lb(e,t){if(bt(t))return null;const n=e._adapter,{parser:i,round:s,isoWeekday:r}=e._parseOpts;let o=t;return typeof i=="function"&&(o=i(o)),oe(o)||(o=typeof i=="string"?n.parse(o,i):n.parse(o)),o===null?null:(s&&(o=s==="week"&&(Wo(r)||r===!0)?n.startOf(o,"isoWeek",r):n.startOf(o,s)),+o)}function cb(e,t,n,i){const s=tn.length;for(let r=tn.indexOf(e);r=tn.indexOf(n);r--){const o=tn[r];if(Eh[o].common&&e._adapter.diff(s,i,o)>=t-1)return o}return tn[n?tn.indexOf(n):0]}function wN(e){for(let t=tn.indexOf(e)+1,n=tn.length;t=t?n[i]:n[s];e[r]=!0}}function kN(e,t,n,i){const s=e._adapter,r=+s.startOf(t[0].value,i),o=t[t.length-1].value;let a,l;for(a=r;a<=o;a=+s.add(a,1,i))l=n[a],l>=0&&(t[l].major=!0);return t}function db(e,t,n){const i=[],s={},r=t.length;let o,a;for(o=0;o+t.value))}initOffsets(t=[]){let n=0,i=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=we(n,0,o),i=we(i,0,o),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,s=this.options,r=s.time,o=r.unit||cb(r.minUnit,n,i,this._getLabelCapacity(n)),a=at(s.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=Wo(l)||l===!0,u={};let d=n,h,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":o),t.diff(i,n,o)>1e5*a)throw new Error(n+" and "+i+" are too far apart with stepSize of "+a+" "+o);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(h=d,f=0;h+m)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){const s=this.options.time.displayFormats,r=this._unit,o=n||s[r];return this._adapter.format(t,o)}_tickFormatFunction(t,n,i,s){const r=this.options,o=r.ticks.callback;if(o)return $t(o,[t,n,i],this);const a=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],h=i[n],f=c&&d&&h&&h.major;return this._adapter.format(t,s||(f?d:u))}generateTickLabels(t){let n,i,s;for(n=0,i=t.length;n0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,i=s.length;n=e[i].pos&&t<=e[s].pos&&({lo:i,hi:s}=zi(e,"pos",t)),{pos:r,time:a}=e[i],{pos:o,time:l}=e[s]):(t>=e[i].time&&t<=e[s].time&&({lo:i,hi:s}=zi(e,"time",t)),{time:r,pos:a}=e[i],{time:o,pos:l}=e[s]);const c=o-r;return c?a+(l-a)*(t-r)/c:a}var Iu;let SN=(Iu=class extends Tm{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=au(n,this.min),this._tableRange=au(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,s=[],r=[];let o,a,l,c,u;for(o=0,a=t.length;o=n&&c<=i&&s.push(c);if(s.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(o=0,a=s.length;os-r)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?t=this.normalize(n.concat(i)):t=n.length?n:i,t=this._cache.all=t,t}getDecimalForValue(t){return(au(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return au(this._table,i*this._tableRange+this._minPos,!0)}},K(Iu,"id","timeseries"),K(Iu,"defaults",Tm.defaults),Iu);var MN=Object.freeze({__proto__:null,CategoryScale:eN,LinearScale:iN,LogarithmicScale:oN,RadialLinearScale:bN,TimeScale:Tm,TimeSeriesScale:SN});const CN=[P2,iR,QR,MN];by.register(...CN);function OM(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t"u")return!1;var t=si(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function FN(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var i=t.styles[n]||{},s=t.attributes[n]||{},r=t.elements[n];!Fn(r)||!ki(r)||(Object.assign(r.style,i),Object.keys(s).forEach(function(o){var a=s[o];a===!1?r.removeAttribute(o):r.setAttribute(o,a===!0?"":a)}))})}function BN(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(i){var s=t.elements[i],r=t.attributes[i]||{},o=Object.keys(t.styles.hasOwnProperty(i)?t.styles[i]:n[i]),a=o.reduce(function(l,c){return l[c]="",l},{});!Fn(s)||!ki(s)||(Object.assign(s.style,a),Object.keys(r).forEach(function(l){s.removeAttribute(l)}))})}}const VN={name:"applyStyles",enabled:!0,phase:"write",fn:FN,effect:BN,requires:["computeStyles"]};function xi(e){return e.split("-")[0]}var Tr=Math.max,Vd=Math.min,Ko=Math.round;function Go(e,t){t===void 0&&(t=!1);var n=e.getBoundingClientRect(),i=1,s=1;if(Fn(e)&&t){var r=e.offsetHeight,o=e.offsetWidth;o>0&&(i=Ko(n.width)/o||1),r>0&&(s=Ko(n.height)/r||1)}return{width:n.width/i,height:n.height/s,top:n.top/s,right:n.right/i,bottom:n.bottom/s,left:n.left/i,x:n.left/i,y:n.top/s}}function My(e){var t=Go(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function NM(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Sy(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function ns(e){return si(e).getComputedStyle(e)}function zN(e){return["table","td","th"].indexOf(ki(e))>=0}function Js(e){return((Xo(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ah(e){return ki(e)==="html"?e:e.assignedSlot||e.parentNode||(Sy(e)?e.host:null)||Js(e)}function mb(e){return!Fn(e)||ns(e).position==="fixed"?null:e.offsetParent}function WN(e){var t=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,n=navigator.userAgent.indexOf("Trident")!==-1;if(n&&Fn(e)){var i=ns(e);if(i.position==="fixed")return null}var s=Ah(e);for(Sy(s)&&(s=s.host);Fn(s)&&["html","body"].indexOf(ki(s))<0;){var r=ns(s);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||t&&r.willChange==="filter"||t&&r.filter&&r.filter!=="none")return s;s=s.parentNode}return null}function gc(e){for(var t=si(e),n=mb(e);n&&zN(n)&&ns(n).position==="static";)n=mb(n);return n&&(ki(n)==="html"||ki(n)==="body"&&ns(n).position==="static")?t:n||WN(e)||t}function Cy(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function pl(e,t,n){return Tr(e,Vd(t,n))}function HN(e,t,n){var i=pl(e,t,n);return i>n?n:i}function jM(){return{top:0,right:0,bottom:0,left:0}}function $M(e){return Object.assign({},jM(),e)}function IM(e,t){return t.reduce(function(n,i){return n[i]=e,n},{})}var UN=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,$M(typeof t!="number"?t:IM(t,mc))};function YN(e){var t,n=e.state,i=e.name,s=e.options,r=n.elements.arrow,o=n.modifiersData.popperOffsets,a=xi(n.placement),l=Cy(a),c=[cn,Wn].indexOf(a)>=0,u=c?"height":"width";if(!(!r||!o)){var d=UN(s.padding,n),h=My(r),f=l==="y"?ln:cn,p=l==="y"?zn:Wn,m=n.rects.reference[u]+n.rects.reference[l]-o[l]-n.rects.popper[u],v=o[l]-n.rects.reference[l],y=gc(r),g=y?l==="y"?y.clientHeight||0:y.clientWidth||0:0,x=m/2-v/2,_=d[f],w=g-h[u]-d[p],S=g/2-h[u]/2+x,C=pl(_,S,w),M=l;n.modifiersData[i]=(t={},t[M]=C,t.centerOffset=C-S,t)}}function XN(e){var t=e.state,n=e.options,i=n.element,s=i===void 0?"[data-popper-arrow]":i;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||NM(t.elements.popper,s)&&(t.elements.arrow=s))}const KN={name:"arrow",enabled:!0,phase:"main",fn:YN,effect:XN,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function qo(e){return e.split("-")[1]}var GN={top:"auto",right:"auto",bottom:"auto",left:"auto"};function qN(e){var t=e.x,n=e.y,i=window,s=i.devicePixelRatio||1;return{x:Ko(t*s)/s||0,y:Ko(n*s)/s||0}}function gb(e){var t,n=e.popper,i=e.popperRect,s=e.placement,r=e.variation,o=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,h=o.x,f=h===void 0?0:h,p=o.y,m=p===void 0?0:p,v=typeof u=="function"?u({x:f,y:m}):{x:f,y:m};f=v.x,m=v.y;var y=o.hasOwnProperty("x"),g=o.hasOwnProperty("y"),x=cn,_=ln,w=window;if(c){var S=gc(n),C="clientHeight",M="clientWidth";if(S===si(n)&&(S=Js(n),ns(S).position!=="static"&&a==="absolute"&&(C="scrollHeight",M="scrollWidth")),S=S,s===ln||(s===cn||s===Wn)&&r===Xl){_=zn;var P=d&&S===w&&w.visualViewport?w.visualViewport.height:S[C];m-=P-i.height,m*=l?1:-1}if(s===cn||(s===ln||s===zn)&&r===Xl){x=Wn;var T=d&&S===w&&w.visualViewport?w.visualViewport.width:S[M];f-=T-i.width,f*=l?1:-1}}var A=Object.assign({position:a},c&&GN),E=u===!0?qN({x:f,y:m}):{x:f,y:m};if(f=E.x,m=E.y,l){var z;return Object.assign({},A,(z={},z[_]=g?"0":"",z[x]=y?"0":"",z.transform=(w.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",z))}return Object.assign({},A,(t={},t[_]=g?m+"px":"",t[x]=y?f+"px":"",t.transform="",t))}function QN(e){var t=e.state,n=e.options,i=n.gpuAcceleration,s=i===void 0?!0:i,r=n.adaptive,o=r===void 0?!0:r,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:xi(t.placement),variation:qo(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,gb(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,gb(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const ZN={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:QN,data:{}};var lu={passive:!0};function JN(e){var t=e.state,n=e.instance,i=e.options,s=i.scroll,r=s===void 0?!0:s,o=i.resize,a=o===void 0?!0:o,l=si(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&c.forEach(function(u){u.addEventListener("scroll",n.update,lu)}),a&&l.addEventListener("resize",n.update,lu),function(){r&&c.forEach(function(u){u.removeEventListener("scroll",n.update,lu)}),a&&l.removeEventListener("resize",n.update,lu)}}const tj={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:JN,data:{}};var ej={left:"right",right:"left",bottom:"top",top:"bottom"};function Ju(e){return e.replace(/left|right|bottom|top/g,function(t){return ej[t]})}var nj={start:"end",end:"start"};function yb(e){return e.replace(/start|end/g,function(t){return nj[t]})}function Py(e){var t=si(e),n=t.pageXOffset,i=t.pageYOffset;return{scrollLeft:n,scrollTop:i}}function Ty(e){return Go(Js(e)).left+Py(e).scrollLeft}function ij(e){var t=si(e),n=Js(e),i=t.visualViewport,s=n.clientWidth,r=n.clientHeight,o=0,a=0;return i&&(s=i.width,r=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=i.offsetLeft,a=i.offsetTop)),{width:s,height:r,x:o+Ty(e),y:a}}function sj(e){var t,n=Js(e),i=Py(e),s=(t=e.ownerDocument)==null?void 0:t.body,r=Tr(n.scrollWidth,n.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=Tr(n.scrollHeight,n.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-i.scrollLeft+Ty(e),l=-i.scrollTop;return ns(s||n).direction==="rtl"&&(a+=Tr(n.clientWidth,s?s.clientWidth:0)-r),{width:r,height:o,x:a,y:l}}function Dy(e){var t=ns(e),n=t.overflow,i=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+s+i)}function FM(e){return["html","body","#document"].indexOf(ki(e))>=0?e.ownerDocument.body:Fn(e)&&Dy(e)?e:FM(Ah(e))}function ml(e,t){var n;t===void 0&&(t=[]);var i=FM(e),s=i===((n=e.ownerDocument)==null?void 0:n.body),r=si(i),o=s?[r].concat(r.visualViewport||[],Dy(i)?i:[]):i,a=t.concat(o);return s?a:a.concat(ml(Ah(o)))}function Dm(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function rj(e){var t=Go(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}function vb(e,t){return t===LM?Dm(ij(e)):Xo(t)?rj(t):Dm(sj(Js(e)))}function oj(e){var t=ml(Ah(e)),n=["absolute","fixed"].indexOf(ns(e).position)>=0,i=n&&Fn(e)?gc(e):e;return Xo(i)?t.filter(function(s){return Xo(s)&&NM(s,i)&&ki(s)!=="body"}):[]}function aj(e,t,n){var i=t==="clippingParents"?oj(e):[].concat(t),s=[].concat(i,[n]),r=s[0],o=s.reduce(function(a,l){var c=vb(e,l);return a.top=Tr(c.top,a.top),a.right=Vd(c.right,a.right),a.bottom=Vd(c.bottom,a.bottom),a.left=Tr(c.left,a.left),a},vb(e,r));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function BM(e){var t=e.reference,n=e.element,i=e.placement,s=i?xi(i):null,r=i?qo(i):null,o=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,l;switch(s){case ln:l={x:o,y:t.y-n.height};break;case zn:l={x:o,y:t.y+t.height};break;case Wn:l={x:t.x+t.width,y:a};break;case cn:l={x:t.x-n.width,y:a};break;default:l={x:t.x,y:t.y}}var c=s?Cy(s):null;if(c!=null){var u=c==="y"?"height":"width";switch(r){case Yo:l[c]=l[c]-(t[u]/2-n[u]/2);break;case Xl:l[c]=l[c]+(t[u]/2-n[u]/2);break}}return l}function Kl(e,t){t===void 0&&(t={});var n=t,i=n.placement,s=i===void 0?e.placement:i,r=n.boundary,o=r===void 0?PN:r,a=n.rootBoundary,l=a===void 0?LM:a,c=n.elementContext,u=c===void 0?Sa:c,d=n.altBoundary,h=d===void 0?!1:d,f=n.padding,p=f===void 0?0:f,m=$M(typeof p!="number"?p:IM(p,mc)),v=u===Sa?TN:Sa,y=e.rects.popper,g=e.elements[h?v:u],x=aj(Xo(g)?g:g.contextElement||Js(e.elements.popper),o,l),_=Go(e.elements.reference),w=BM({reference:_,element:y,strategy:"absolute",placement:s}),S=Dm(Object.assign({},y,w)),C=u===Sa?S:_,M={top:x.top-C.top+m.top,bottom:C.bottom-x.bottom+m.bottom,left:x.left-C.left+m.left,right:C.right-x.right+m.right},P=e.modifiersData.offset;if(u===Sa&&P){var T=P[s];Object.keys(M).forEach(function(A){var E=[Wn,zn].indexOf(A)>=0?1:-1,z=[ln,zn].indexOf(A)>=0?"y":"x";M[A]+=T[z]*E})}return M}function lj(e,t){t===void 0&&(t={});var n=t,i=n.placement,s=n.boundary,r=n.rootBoundary,o=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?RM:l,u=qo(i),d=u?a?pb:pb.filter(function(p){return qo(p)===u}):mc,h=d.filter(function(p){return c.indexOf(p)>=0});h.length===0&&(h=d);var f=h.reduce(function(p,m){return p[m]=Kl(e,{placement:m,boundary:s,rootBoundary:r,padding:o})[xi(m)],p},{});return Object.keys(f).sort(function(p,m){return f[p]-f[m]})}function cj(e){if(xi(e)===ky)return[];var t=Ju(e);return[yb(e),t,yb(t)]}function uj(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var s=n.mainAxis,r=s===void 0?!0:s,o=n.altAxis,a=o===void 0?!0:o,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,h=n.altBoundary,f=n.flipVariations,p=f===void 0?!0:f,m=n.allowedAutoPlacements,v=t.options.placement,y=xi(v),g=y===v,x=l||(g||!p?[Ju(v)]:cj(v)),_=[v].concat(x).reduce(function(Z,O){return Z.concat(xi(O)===ky?lj(t,{placement:O,boundary:u,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:m}):O)},[]),w=t.rects.reference,S=t.rects.popper,C=new Map,M=!0,P=_[0],T=0;T<_.length;T++){var A=_[T],E=xi(A),z=qo(A)===Yo,N=[ln,zn].indexOf(E)>=0,L=N?"width":"height",R=Kl(t,{placement:A,boundary:u,rootBoundary:d,altBoundary:h,padding:c}),B=N?z?Wn:cn:z?zn:ln;w[L]>S[L]&&(B=Ju(B));var D=Ju(B),$=[];if(r&&$.push(R[E]<=0),a&&$.push(R[B]<=0,R[D]<=0),$.every(function(Z){return Z})){P=A,M=!1;break}C.set(A,$)}if(M)for(var F=p?3:1,V=function(O){var U=_.find(function(lt){var ct=C.get(lt);if(ct)return ct.slice(0,O).every(function(kt){return kt})});if(U)return P=U,"break"},W=F;W>0;W--){var et=V(W);if(et==="break")break}t.placement!==P&&(t.modifiersData[i]._skip=!0,t.placement=P,t.reset=!0)}}const VM={name:"flip",enabled:!0,phase:"main",fn:uj,requiresIfExists:["offset"],data:{_skip:!1}};function xb(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function bb(e){return[ln,Wn,zn,cn].some(function(t){return e[t]>=0})}function dj(e){var t=e.state,n=e.name,i=t.rects.reference,s=t.rects.popper,r=t.modifiersData.preventOverflow,o=Kl(t,{elementContext:"reference"}),a=Kl(t,{altBoundary:!0}),l=xb(o,i),c=xb(a,s,r),u=bb(l),d=bb(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const hj={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:dj};function fj(e,t,n){var i=xi(e),s=[cn,ln].indexOf(i)>=0?-1:1,r=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,o=r[0],a=r[1];return o=o||0,a=(a||0)*s,[cn,Wn].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}function pj(e){var t=e.state,n=e.options,i=e.name,s=n.offset,r=s===void 0?[0,0]:s,o=RM.reduce(function(u,d){return u[d]=fj(d,t.rects,r),u},{}),a=o[t.placement],l=a.x,c=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[i]=o}const mj={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:pj};function gj(e){var t=e.state,n=e.name;t.modifiersData[n]=BM({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const yj={name:"popperOffsets",enabled:!0,phase:"read",fn:gj,data:{}};function vj(e){return e==="x"?"y":"x"}function xj(e){var t=e.state,n=e.options,i=e.name,s=n.mainAxis,r=s===void 0?!0:s,o=n.altAxis,a=o===void 0?!1:o,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,h=n.tether,f=h===void 0?!0:h,p=n.tetherOffset,m=p===void 0?0:p,v=Kl(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),y=xi(t.placement),g=qo(t.placement),x=!g,_=Cy(y),w=vj(_),S=t.modifiersData.popperOffsets,C=t.rects.reference,M=t.rects.popper,P=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,T=typeof P=="number"?{mainAxis:P,altAxis:P}:Object.assign({mainAxis:0,altAxis:0},P),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,E={x:0,y:0};if(S){if(r){var z,N=_==="y"?ln:cn,L=_==="y"?zn:Wn,R=_==="y"?"height":"width",B=S[_],D=B+v[N],$=B-v[L],F=f?-M[R]/2:0,V=g===Yo?C[R]:M[R],W=g===Yo?-M[R]:-C[R],et=t.elements.arrow,Z=f&&et?My(et):{width:0,height:0},O=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:jM(),U=O[N],lt=O[L],ct=pl(0,C[R],Z[R]),kt=x?C[R]/2-F-ct-U-T.mainAxis:V-ct-U-T.mainAxis,it=x?-C[R]/2+F+ct+lt+T.mainAxis:W+ct+lt+T.mainAxis,Lt=t.elements.arrow&&gc(t.elements.arrow),Ct=Lt?_==="y"?Lt.clientTop||0:Lt.clientLeft||0:0,Qt=(z=A==null?void 0:A[_])!=null?z:0,ft=B+kt-Qt-Ct,wt=B+it-Qt,dt=pl(f?Vd(D,ft):D,B,f?Tr($,wt):$);S[_]=dt,E[_]=dt-B}if(a){var jt,pt=_==="x"?ln:cn,xt=_==="x"?zn:Wn,J=S[w],mt=w==="y"?"height":"width",q=J+v[pt],ye=J-v[xt],Dt=[ln,cn].indexOf(y)!==-1,he=(jt=A==null?void 0:A[w])!=null?jt:0,Un=Dt?q:J-C[mt]-M[mt]-he+T.altAxis,Yn=Dt?J+C[mt]+M[mt]-he-T.altAxis:ye,Mn=f&&Dt?HN(Un,J,Yn):pl(f?Un:q,J,f?Yn:ye);S[w]=Mn,E[w]=Mn-J}t.modifiersData[i]=E}}const bj={name:"preventOverflow",enabled:!0,phase:"main",fn:xj,requiresIfExists:["offset"]};function _j(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function wj(e){return e===si(e)||!Fn(e)?Py(e):_j(e)}function kj(e){var t=e.getBoundingClientRect(),n=Ko(t.width)/e.offsetWidth||1,i=Ko(t.height)/e.offsetHeight||1;return n!==1||i!==1}function Sj(e,t,n){n===void 0&&(n=!1);var i=Fn(t),s=Fn(t)&&kj(t),r=Js(t),o=Go(e,s),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!n)&&((ki(t)!=="body"||Dy(r))&&(a=wj(t)),Fn(t)?(l=Go(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):r&&(l.x=Ty(r))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function Mj(e){var t=new Map,n=new Set,i=[];e.forEach(function(r){t.set(r.name,r)});function s(r){n.add(r.name);var o=[].concat(r.requires||[],r.requiresIfExists||[]);o.forEach(function(a){if(!n.has(a)){var l=t.get(a);l&&s(l)}}),i.push(r)}return e.forEach(function(r){n.has(r.name)||s(r)}),i}function Cj(e){var t=Mj(e);return IN.reduce(function(n,i){return n.concat(t.filter(function(s){return s.phase===i}))},[])}function Pj(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Tj(e){var t=e.reduce(function(n,i){var s=n[i.name];return n[i.name]=s?Object.assign({},s,i,{options:Object.assign({},s.options,i.options),data:Object.assign({},s.data,i.data)}):i,n},{});return Object.keys(t).map(function(n){return t[n]})}var _b={placement:"bottom",modifiers:[],strategy:"absolute"};function wb(){for(var e=arguments.length,t=new Array(e),n=0;ne,isStatic:!1,reducedMotion:"never"}),Lh=k.createContext({}),Rh=k.createContext(null),Nh=typeof document<"u",Ey=Nh?k.useLayoutEffect:k.useEffect,WM=k.createContext({strict:!1}),Ay=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),Fj="framerAppearId",HM="data-"+Ay(Fj);function Bj(e,t,n,i){const{visualElement:s}=k.useContext(Lh),r=k.useContext(WM),o=k.useContext(Rh),a=k.useContext(zM).reducedMotion,l=k.useRef();i=i||r.renderer,!l.current&&i&&(l.current=i(e,{visualState:t,parent:s,props:n,presenceContext:o,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:a}));const c=l.current;k.useInsertionEffect(()=>{c&&c.update(n,o)});const u=k.useRef(!!(n[HM]&&!window.HandoffComplete));return Ey(()=>{c&&(c.render(),u.current&&c.animationState&&c.animationState.animateChanges())}),k.useEffect(()=>{c&&(c.updateFeatures(),!u.current&&c.animationState&&c.animationState.animateChanges(),u.current&&(u.current=!1,window.HandoffComplete=!0))}),c}function _o(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Vj(e,t,n){return k.useCallback(i=>{i&&e.mount&&e.mount(i),t&&(i?t.mount(i):t.unmount()),n&&(typeof n=="function"?n(i):_o(n)&&(n.current=i))},[t])}function Gl(e){return typeof e=="string"||Array.isArray(e)}function jh(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Oy=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ly=["initial",...Oy];function $h(e){return jh(e.animate)||Ly.some(t=>Gl(e[t]))}function UM(e){return!!($h(e)||e.variants)}function zj(e,t){if($h(e)){const{initial:n,animate:i}=e;return{initial:n===!1||Gl(n)?n:void 0,animate:Gl(i)?i:void 0}}return e.inherit!==!1?t:{}}function Wj(e){const{initial:t,animate:n}=zj(e,k.useContext(Lh));return k.useMemo(()=>({initial:t,animate:n}),[kb(t),kb(n)])}function kb(e){return Array.isArray(e)?e.join(" "):e}const Sb={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},ql={};for(const e in Sb)ql[e]={isEnabled:t=>Sb[e].some(n=>!!t[n])};function Hj(e){for(const t in e)ql[t]={...ql[t],...e[t]}}const Ry=k.createContext({}),YM=k.createContext({}),Uj=Symbol.for("motionComponentSymbol");function Yj({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:i,Component:s}){e&&Hj(e);function r(a,l){let c;const u={...k.useContext(zM),...a,layoutId:Xj(a)},{isStatic:d}=u,h=Wj(a),f=i(a,d);if(!d&&Nh){h.visualElement=Bj(s,f,u,t);const p=k.useContext(YM),m=k.useContext(WM).strict;h.visualElement&&(c=h.visualElement.loadFeatures(u,m,e,p))}return k.createElement(Lh.Provider,{value:h},c&&h.visualElement?k.createElement(c,{visualElement:h.visualElement,...u}):null,n(s,a,Vj(f,h.visualElement,l),f,d,h.visualElement))}const o=k.forwardRef(r);return o[Uj]=s,o}function Xj({layoutId:e}){const t=k.useContext(Ry).id;return t&&e!==void 0?t+"-"+e:e}function Kj(e){function t(i,s={}){return Yj(e(i,s))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(i,s)=>(n.has(s)||n.set(s,t(s)),n.get(s))})}const Gj=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Ny(e){return typeof e!="string"||e.includes("-")?!1:!!(Gj.indexOf(e)>-1||/[A-Z]/.test(e))}const zd={};function qj(e){Object.assign(zd,e)}const yc=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ur=new Set(yc);function XM(e,{layout:t,layoutId:n}){return Ur.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!zd[e]||e==="opacity")}const un=e=>!!(e&&e.getVelocity),Qj={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Zj=yc.length;function Jj(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},i,s){let r="";for(let o=0;ot=>typeof t=="string"&&t.startsWith(e),GM=KM("--"),Em=KM("var(--"),t$=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,e$=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Hs=(e,t,n)=>Math.min(Math.max(n,e),t),Yr={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},gl={...Yr,transform:e=>Hs(0,1,e)},cu={...Yr,default:1},yl=e=>Math.round(e*1e5)/1e5,Ih=/(-)?([\d]*\.?[\d])+/g,qM=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,n$=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function vc(e){return typeof e=="string"}const xc=e=>({test:t=>vc(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ps=xc("deg"),bi=xc("%"),st=xc("px"),i$=xc("vh"),s$=xc("vw"),Mb={...bi,parse:e=>bi.parse(e)/100,transform:e=>bi.transform(e*100)},Cb={...Yr,transform:Math.round},QM={borderWidth:st,borderTopWidth:st,borderRightWidth:st,borderBottomWidth:st,borderLeftWidth:st,borderRadius:st,radius:st,borderTopLeftRadius:st,borderTopRightRadius:st,borderBottomRightRadius:st,borderBottomLeftRadius:st,width:st,maxWidth:st,height:st,maxHeight:st,size:st,top:st,right:st,bottom:st,left:st,padding:st,paddingTop:st,paddingRight:st,paddingBottom:st,paddingLeft:st,margin:st,marginTop:st,marginRight:st,marginBottom:st,marginLeft:st,rotate:ps,rotateX:ps,rotateY:ps,rotateZ:ps,scale:cu,scaleX:cu,scaleY:cu,scaleZ:cu,skew:ps,skewX:ps,skewY:ps,distance:st,translateX:st,translateY:st,translateZ:st,x:st,y:st,z:st,perspective:st,transformPerspective:st,opacity:gl,originX:Mb,originY:Mb,originZ:st,zIndex:Cb,fillOpacity:gl,strokeOpacity:gl,numOctaves:Cb};function jy(e,t,n,i){const{style:s,vars:r,transform:o,transformOrigin:a}=e;let l=!1,c=!1,u=!0;for(const d in t){const h=t[d];if(GM(d)){r[d]=h;continue}const f=QM[d],p=e$(h,f);if(Ur.has(d)){if(l=!0,o[d]=p,!u)continue;h!==(f.default||0)&&(u=!1)}else d.startsWith("origin")?(c=!0,a[d]=p):s[d]=p}if(t.transform||(l||i?s.transform=Jj(e.transform,n,u,i):s.transform&&(s.transform="none")),c){const{originX:d="50%",originY:h="50%",originZ:f=0}=a;s.transformOrigin=`${d} ${h} ${f}`}}const $y=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ZM(e,t,n){for(const i in t)!un(t[i])&&!XM(i,n)&&(e[i]=t[i])}function r$({transformTemplate:e},t,n){return k.useMemo(()=>{const i=$y();return jy(i,t,{enableHardwareAcceleration:!n},e),Object.assign({},i.vars,i.style)},[t])}function o$(e,t,n){const i=e.style||{},s={};return ZM(s,i,e),Object.assign(s,r$(e,t,n)),e.transformValues?e.transformValues(s):s}function a$(e,t,n){const i={},s=o$(e,t,n);return e.drag&&e.dragListener!==!1&&(i.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(i.tabIndex=0),i.style=s,i}const l$=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Wd(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||l$.has(e)}let JM=e=>!Wd(e);function c$(e){e&&(JM=t=>t.startsWith("on")?!Wd(t):e(t))}try{c$(require("@emotion/is-prop-valid").default)}catch{}function u$(e,t,n){const i={};for(const s in e)s==="values"&&typeof e.values=="object"||(JM(s)||n===!0&&Wd(s)||!t&&!Wd(s)||e.draggable&&s.startsWith("onDrag"))&&(i[s]=e[s]);return i}function Pb(e,t,n){return typeof e=="string"?e:st.transform(t+n*e)}function d$(e,t,n){const i=Pb(t,e.x,e.width),s=Pb(n,e.y,e.height);return`${i} ${s}`}const h$={offset:"stroke-dashoffset",array:"stroke-dasharray"},f$={offset:"strokeDashoffset",array:"strokeDasharray"};function p$(e,t,n=1,i=0,s=!0){e.pathLength=1;const r=s?h$:f$;e[r.offset]=st.transform(-i);const o=st.transform(t),a=st.transform(n);e[r.array]=`${o} ${a}`}function Iy(e,{attrX:t,attrY:n,attrScale:i,originX:s,originY:r,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},u,d,h){if(jy(e,c,u,h),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:p,dimensions:m}=e;f.transform&&(m&&(p.transform=f.transform),delete f.transform),m&&(s!==void 0||r!==void 0||p.transform)&&(p.transformOrigin=d$(m,s!==void 0?s:.5,r!==void 0?r:.5)),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),i!==void 0&&(f.scale=i),o!==void 0&&p$(f,o,a,l,!1)}const tC=()=>({...$y(),attrs:{}}),Fy=e=>typeof e=="string"&&e.toLowerCase()==="svg";function m$(e,t,n,i){const s=k.useMemo(()=>{const r=tC();return Iy(r,t,{enableHardwareAcceleration:!1},Fy(i),e.transformTemplate),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};ZM(r,e.style,e),s.style={...r,...s.style}}return s}function g$(e=!1){return(n,i,s,{latestValues:r},o)=>{const l=(Ny(n)?m$:a$)(i,r,o,n),u={...u$(i,typeof n=="string",e),...l,ref:s},{children:d}=i,h=k.useMemo(()=>un(d)?d.get():d,[d]);return k.createElement(n,{...u,children:h})}}function eC(e,{style:t,vars:n},i,s){Object.assign(e.style,t,s&&s.getProjectionStyles(i));for(const r in n)e.style.setProperty(r,n[r])}const nC=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function iC(e,t,n,i){eC(e,t,void 0,i);for(const s in t.attrs)e.setAttribute(nC.has(s)?s:Ay(s),t.attrs[s])}function By(e,t){const{style:n}=e,i={};for(const s in n)(un(n[s])||t.style&&un(t.style[s])||XM(s,e))&&(i[s]=n[s]);return i}function sC(e,t){const n=By(e,t);for(const i in e)if(un(e[i])||un(t[i])){const s=yc.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[s]=e[i]}return n}function Vy(e,t,n,i={},s={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,i,s)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,i,s)),t}function rC(e){const t=k.useRef(null);return t.current===null&&(t.current=e()),t.current}const Hd=e=>Array.isArray(e),y$=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),v$=e=>Hd(e)?e[e.length-1]||0:e;function ed(e){const t=un(e)?e.get():e;return y$(t)?t.toValue():t}function x$({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},i,s,r){const o={latestValues:b$(i,s,r,e),renderState:t()};return n&&(o.mount=a=>n(i,a,o)),o}const oC=e=>(t,n)=>{const i=k.useContext(Lh),s=k.useContext(Rh),r=()=>x$(e,t,i,s);return n?r():rC(r)};function b$(e,t,n,i){const s={},r=i(e,{});for(const h in r)s[h]=ed(r[h]);let{initial:o,animate:a}=e;const l=$h(e),c=UM(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const d=u?a:o;return d&&typeof d!="boolean"&&!jh(d)&&(Array.isArray(d)?d:[d]).forEach(f=>{const p=Vy(e,f);if(!p)return;const{transitionEnd:m,transition:v,...y}=p;for(const g in y){let x=y[g];if(Array.isArray(x)){const _=u?x.length-1:0;x=x[_]}x!==null&&(s[g]=x)}for(const g in m)s[g]=m[g]}),s}const ce=e=>e;class Tb{constructor(){this.order=[],this.scheduled=new Set}add(t){if(!this.scheduled.has(t))return this.scheduled.add(t),this.order.push(t),!0}remove(t){const n=this.order.indexOf(t);n!==-1&&(this.order.splice(n,1),this.scheduled.delete(t))}clear(){this.order.length=0,this.scheduled.clear()}}function _$(e){let t=new Tb,n=new Tb,i=0,s=!1,r=!1;const o=new WeakSet,a={schedule:(l,c=!1,u=!1)=>{const d=u&&s,h=d?t:n;return c&&o.add(l),h.add(l)&&d&&s&&(i=t.order.length),l},cancel:l=>{n.remove(l),o.delete(l)},process:l=>{if(s){r=!0;return}if(s=!0,[t,n]=[n,t],n.clear(),i=t.order.length,i)for(let c=0;c(d[h]=_$(()=>n=!0),d),{}),o=d=>r[d].process(s),a=()=>{const d=performance.now();n=!1,s.delta=i?1e3/60:Math.max(Math.min(d-s.timestamp,w$),1),s.timestamp=d,s.isProcessing=!0,uu.forEach(o),s.isProcessing=!1,n&&t&&(i=!1,e(a))},l=()=>{n=!0,i=!0,s.isProcessing||e(a)};return{schedule:uu.reduce((d,h)=>{const f=r[h];return d[h]=(p,m=!1,v=!1)=>(n||l(),f.schedule(p,m,v)),d},{}),cancel:d=>uu.forEach(h=>r[h].cancel(d)),state:s,steps:r}}const{schedule:zt,cancel:is,state:je,steps:Uf}=k$(typeof requestAnimationFrame<"u"?requestAnimationFrame:ce,!0),S$={useVisualState:oC({scrapeMotionValuesFromProps:sC,createRenderState:tC,onMount:(e,t,{renderState:n,latestValues:i})=>{zt.read(()=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),zt.render(()=>{Iy(n,i,{enableHardwareAcceleration:!1},Fy(t.tagName),e.transformTemplate),iC(t,n)})}})},M$={useVisualState:oC({scrapeMotionValuesFromProps:By,createRenderState:$y})};function C$(e,{forwardMotionProps:t=!1},n,i){return{...Ny(e)?S$:M$,preloadedFeatures:n,useRender:g$(t),createVisualElement:i,Component:e}}function Hi(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}const aC=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Fh(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}const P$=e=>t=>aC(t)&&e(t,Fh(t));function qi(e,t,n,i){return Hi(e,t,P$(n),i)}const T$=(e,t)=>n=>t(e(n)),Is=(...e)=>e.reduce(T$);function lC(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const Db=lC("dragHorizontal"),Eb=lC("dragVertical");function cC(e){let t=!1;if(e==="y")t=Eb();else if(e==="x")t=Db();else{const n=Db(),i=Eb();n&&i?t=()=>{n(),i()}:(n&&n(),i&&i())}return t}function uC(){const e=cC(!0);return e?(e(),!1):!0}class tr{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Ab(e,t){const n="pointer"+(t?"enter":"leave"),i="onHover"+(t?"Start":"End"),s=(r,o)=>{if(r.pointerType==="touch"||uC())return;const a=e.getProps();e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",t),a[i]&&zt.update(()=>a[i](r,o))};return qi(e.current,n,s,{passive:!e.getProps()[i]})}class D$ extends tr{mount(){this.unmount=Is(Ab(this.node,!0),Ab(this.node,!1))}unmount(){}}class E$ extends tr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Is(Hi(this.node.current,"focus",()=>this.onFocus()),Hi(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const dC=(e,t)=>t?e===t?!0:dC(e,t.parentElement):!1;function Yf(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,Fh(n))}class A$ extends tr{constructor(){super(...arguments),this.removeStartListeners=ce,this.removeEndListeners=ce,this.removeAccessibleListeners=ce,this.startPointerPress=(t,n)=>{if(this.isPressing)return;this.removeEndListeners();const i=this.node.getProps(),r=qi(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:c,onTapCancel:u,globalTapTarget:d}=this.node.getProps();zt.update(()=>{!d&&!dC(this.node.current,a.target)?u&&u(a,l):c&&c(a,l)})},{passive:!(i.onTap||i.onPointerUp)}),o=qi(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(i.onTapCancel||i.onPointerCancel)});this.removeEndListeners=Is(r,o),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=r=>{if(r.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||Yf("up",(l,c)=>{const{onTap:u}=this.node.getProps();u&&zt.update(()=>u(l,c))})};this.removeEndListeners(),this.removeEndListeners=Hi(this.node.current,"keyup",o),Yf("down",(a,l)=>{this.startPress(a,l)})},n=Hi(this.node.current,"keydown",t),i=()=>{this.isPressing&&Yf("cancel",(r,o)=>this.cancelPress(r,o))},s=Hi(this.node.current,"blur",i);this.removeAccessibleListeners=Is(n,s)}}startPress(t,n){this.isPressing=!0;const{onTapStart:i,whileTap:s}=this.node.getProps();s&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),i&&zt.update(()=>i(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!uC()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:i}=this.node.getProps();i&&zt.update(()=>i(t,n))}mount(){const t=this.node.getProps(),n=qi(t.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),i=Hi(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Is(n,i)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const Am=new WeakMap,Xf=new WeakMap,O$=e=>{const t=Am.get(e.target);t&&t(e)},L$=e=>{e.forEach(O$)};function R$({root:e,...t}){const n=e||document;Xf.has(n)||Xf.set(n,{});const i=Xf.get(n),s=JSON.stringify(t);return i[s]||(i[s]=new IntersectionObserver(L$,{root:e,...t})),i[s]}function N$(e,t,n){const i=R$(t);return Am.set(e,n),i.observe(e),()=>{Am.delete(e),i.unobserve(e)}}const j$={some:0,all:1};class $$ extends tr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:i,amount:s="some",once:r}=t,o={root:n?n.current:void 0,rootMargin:i,threshold:typeof s=="number"?s:j$[s]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,r&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),h=c?u:d;h&&h(l)};return N$(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(I$(t,n))&&this.startObserver()}unmount(){}}function I$({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const F$={inView:{Feature:$$},tap:{Feature:A$},focus:{Feature:E$},hover:{Feature:D$}};function hC(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;it[i]=n.get()),t}function V$(e){const t={};return e.values.forEach((n,i)=>t[i]=n.getVelocity()),t}function Bh(e,t,n){const i=e.getProps();return Vy(i,t,n!==void 0?n:i.custom,B$(e),V$(e))}let zy=ce;const Dr=e=>e*1e3,Qi=e=>e/1e3,z$={current:!1},fC=e=>Array.isArray(e)&&typeof e[0]=="number";function pC(e){return!!(!e||typeof e=="string"&&mC[e]||fC(e)||Array.isArray(e)&&e.every(pC))}const Qa=([e,t,n,i])=>`cubic-bezier(${e}, ${t}, ${n}, ${i})`,mC={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Qa([0,.65,.55,1]),circOut:Qa([.55,0,1,.45]),backIn:Qa([.31,.01,.66,-.59]),backOut:Qa([.33,1.53,.69,.99])};function gC(e){if(e)return fC(e)?Qa(e):Array.isArray(e)?e.map(gC):mC[e]}function W$(e,t,n,{delay:i=0,duration:s,repeat:r=0,repeatType:o="loop",ease:a,times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=gC(a);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:i,duration:s,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"})}function H$(e,{repeat:t,repeatType:n="loop"}){const i=t&&n!=="loop"&&t%2===1?0:e.length-1;return e[i]}const yC=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,U$=1e-7,Y$=12;function X$(e,t,n,i,s){let r,o,a=0;do o=t+(n-t)/2,r=yC(o,i,s)-e,r>0?n=o:t=o;while(Math.abs(r)>U$&&++aX$(r,0,1,e,n);return r=>r===0||r===1?r:yC(s(r),t,i)}const K$=bc(.42,0,1,1),G$=bc(0,0,.58,1),vC=bc(.42,0,.58,1),q$=e=>Array.isArray(e)&&typeof e[0]!="number",xC=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,bC=e=>t=>1-e(1-t),Wy=e=>1-Math.sin(Math.acos(e)),_C=bC(Wy),Q$=xC(Wy),wC=bc(.33,1.53,.69,.99),Hy=bC(wC),Z$=xC(Hy),J$=e=>(e*=2)<1?.5*Hy(e):.5*(2-Math.pow(2,-10*(e-1))),tI={linear:ce,easeIn:K$,easeInOut:vC,easeOut:G$,circIn:Wy,circInOut:Q$,circOut:_C,backIn:Hy,backInOut:Z$,backOut:wC,anticipate:J$},Ob=e=>{if(Array.isArray(e)){zy(e.length===4);const[t,n,i,s]=e;return bc(t,n,i,s)}else if(typeof e=="string")return tI[e];return e},Uy=(e,t)=>n=>!!(vc(n)&&n$.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),kC=(e,t,n)=>i=>{if(!vc(i))return i;const[s,r,o,a]=i.match(Ih);return{[e]:parseFloat(s),[t]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},eI=e=>Hs(0,255,e),Kf={...Yr,transform:e=>Math.round(eI(e))},kr={test:Uy("rgb","red"),parse:kC("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+Kf.transform(e)+", "+Kf.transform(t)+", "+Kf.transform(n)+", "+yl(gl.transform(i))+")"};function nI(e){let t="",n="",i="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),i=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),i=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,i+=i,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}}const Om={test:Uy("#"),parse:nI,transform:kr.transform},wo={test:Uy("hsl","hue"),parse:kC("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+bi.transform(yl(t))+", "+bi.transform(yl(n))+", "+yl(gl.transform(i))+")"},We={test:e=>kr.test(e)||Om.test(e)||wo.test(e),parse:e=>kr.test(e)?kr.parse(e):wo.test(e)?wo.parse(e):Om.parse(e),transform:e=>vc(e)?e:e.hasOwnProperty("red")?kr.transform(e):wo.transform(e)},ee=(e,t,n)=>-n*e+n*t+e;function Gf(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function iI({hue:e,saturation:t,lightness:n,alpha:i}){e/=360,t/=100,n/=100;let s=0,r=0,o=0;if(!t)s=r=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;s=Gf(l,a,e+1/3),r=Gf(l,a,e),o=Gf(l,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:i}}const qf=(e,t,n)=>{const i=e*e;return Math.sqrt(Math.max(0,n*(t*t-i)+i))},sI=[Om,kr,wo],rI=e=>sI.find(t=>t.test(e));function Lb(e){const t=rI(e);let n=t.parse(e);return t===wo&&(n=iI(n)),n}const SC=(e,t)=>{const n=Lb(e),i=Lb(t),s={...n};return r=>(s.red=qf(n.red,i.red,r),s.green=qf(n.green,i.green,r),s.blue=qf(n.blue,i.blue,r),s.alpha=ee(n.alpha,i.alpha,r),kr.transform(s))};function oI(e){var t,n;return isNaN(e)&&vc(e)&&(((t=e.match(Ih))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(qM))===null||n===void 0?void 0:n.length)||0)>0}const MC={regex:t$,countKey:"Vars",token:"${v}",parse:ce},CC={regex:qM,countKey:"Colors",token:"${c}",parse:We.parse},PC={regex:Ih,countKey:"Numbers",token:"${n}",parse:Yr.parse};function Qf(e,{regex:t,countKey:n,token:i,parse:s}){const r=e.tokenised.match(t);r&&(e["num"+n]=r.length,e.tokenised=e.tokenised.replace(t,i),e.values.push(...r.map(s)))}function Ud(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&Qf(n,MC),Qf(n,CC),Qf(n,PC),n}function TC(e){return Ud(e).values}function DC(e){const{values:t,numColors:n,numVars:i,tokenised:s}=Ud(e),r=t.length;return o=>{let a=s;for(let l=0;ltypeof e=="number"?0:e;function lI(e){const t=TC(e);return DC(e)(t.map(aI))}const Us={test:oI,parse:TC,createTransformer:DC,getAnimatableNone:lI},EC=(e,t)=>n=>`${n>0?t:e}`;function AC(e,t){return typeof e=="number"?n=>ee(e,t,n):We.test(e)?SC(e,t):e.startsWith("var(")?EC(e,t):LC(e,t)}const OC=(e,t)=>{const n=[...e],i=n.length,s=e.map((r,o)=>AC(r,t[o]));return r=>{for(let o=0;o{const n={...e,...t},i={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(i[s]=AC(e[s],t[s]));return s=>{for(const r in i)n[r]=i[r](s);return n}},LC=(e,t)=>{const n=Us.createTransformer(t),i=Ud(e),s=Ud(t);return i.numVars===s.numVars&&i.numColors===s.numColors&&i.numNumbers>=s.numNumbers?Is(OC(i.values,s.values),n):EC(e,t)},Ql=(e,t,n)=>{const i=t-e;return i===0?1:(n-e)/i},Rb=(e,t)=>n=>ee(e,t,n);function uI(e){return typeof e=="number"?Rb:typeof e=="string"?We.test(e)?SC:LC:Array.isArray(e)?OC:typeof e=="object"?cI:Rb}function dI(e,t,n){const i=[],s=n||uI(e[0]),r=e.length-1;for(let o=0;ot[0];e[0]>e[r-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=dI(t,i,s),a=o.length,l=c=>{let u=0;if(a>1)for(;ul(Hs(e[0],e[r-1],c)):l}function hI(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const s=Ql(0,t,i);e.push(ee(n,1,s))}}function fI(e){const t=[0];return hI(t,e.length-1),t}function pI(e,t){return e.map(n=>n*t)}function mI(e,t){return e.map(()=>t||vC).splice(0,e.length-1)}function Yd({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const s=q$(i)?i.map(Ob):Ob(i),r={done:!1,value:t[0]},o=pI(n&&n.length===t.length?n:fI(t),e),a=RC(o,t,{ease:Array.isArray(s)?s:mI(t,s)});return{calculatedDuration:e,next:l=>(r.value=a(l),r.done=l>=e,r)}}function NC(e,t){return t?e*(1e3/t):0}const gI=5;function jC(e,t,n){const i=Math.max(t-gI,0);return NC(n-e(i),t-i)}const Zf=.001,yI=.01,vI=10,xI=.05,bI=1;function _I({duration:e=800,bounce:t=.25,velocity:n=0,mass:i=1}){let s,r,o=1-t;o=Hs(xI,bI,o),e=Hs(yI,vI,Qi(e)),o<1?(s=c=>{const u=c*o,d=u*e,h=u-n,f=Lm(c,o),p=Math.exp(-d);return Zf-h/f*p},r=c=>{const d=c*o*e,h=d*n+n,f=Math.pow(o,2)*Math.pow(c,2)*e,p=Math.exp(-d),m=Lm(Math.pow(c,2),o);return(-s(c)+Zf>0?-1:1)*((h-f)*p)/m}):(s=c=>{const u=Math.exp(-c*e),d=(c-n)*e+1;return-Zf+u*d},r=c=>{const u=Math.exp(-c*e),d=(n-c)*(e*e);return u*d});const a=5/e,l=kI(s,r,a);if(e=Dr(e),isNaN(l))return{stiffness:100,damping:10,duration:e};{const c=Math.pow(l,2)*i;return{stiffness:c,damping:o*2*Math.sqrt(i*c),duration:e}}}const wI=12;function kI(e,t,n){let i=n;for(let s=1;se[n]!==void 0)}function CI(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!Nb(e,MI)&&Nb(e,SI)){const n=_I(e);t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}function $C({keyframes:e,restDelta:t,restSpeed:n,...i}){const s=e[0],r=e[e.length-1],o={done:!1,value:s},{stiffness:a,damping:l,mass:c,duration:u,velocity:d,isResolvedFromDuration:h}=CI({...i,velocity:-Qi(i.velocity||0)}),f=d||0,p=l/(2*Math.sqrt(a*c)),m=r-s,v=Qi(Math.sqrt(a/c)),y=Math.abs(m)<5;n||(n=y?.01:2),t||(t=y?.005:.5);let g;if(p<1){const x=Lm(v,p);g=_=>{const w=Math.exp(-p*v*_);return r-w*((f+p*v*m)/x*Math.sin(x*_)+m*Math.cos(x*_))}}else if(p===1)g=x=>r-Math.exp(-v*x)*(m+(f+v*m)*x);else{const x=v*Math.sqrt(p*p-1);g=_=>{const w=Math.exp(-p*v*_),S=Math.min(x*_,300);return r-w*((f+p*v*m)*Math.sinh(S)+x*m*Math.cosh(S))/x}}return{calculatedDuration:h&&u||null,next:x=>{const _=g(x);if(h)o.done=x>=u;else{let w=f;x!==0&&(p<1?w=jC(g,x,_):w=0);const S=Math.abs(w)<=n,C=Math.abs(r-_)<=t;o.done=S&&C}return o.value=o.done?r:_,o}}}function jb({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],h={done:!1,value:d},f=M=>a!==void 0&&Ml,p=M=>a===void 0?l:l===void 0||Math.abs(a-M)-m*Math.exp(-M/i),x=M=>y+g(M),_=M=>{const P=g(M),T=x(M);h.done=Math.abs(P)<=c,h.value=h.done?y:T};let w,S;const C=M=>{f(h.value)&&(w=M,S=$C({keyframes:[h.value,p(h.value)],velocity:jC(x,M,h.value),damping:s,stiffness:r,restDelta:c,restSpeed:u}))};return C(0),{calculatedDuration:null,next:M=>{let P=!1;return!S&&w===void 0&&(P=!0,_(M),C(M)),w!==void 0&&M>w?S.next(M-w):(!P&&_(M),h)}}}const PI=e=>{const t=({timestamp:n})=>e(n);return{start:()=>zt.update(t,!0),stop:()=>is(t),now:()=>je.isProcessing?je.timestamp:performance.now()}},$b=2e4;function Ib(e){let t=0;const n=50;let i=e.next(t);for(;!i.done&&t<$b;)t+=n,i=e.next(t);return t>=$b?1/0:t}const TI={decay:jb,inertia:jb,tween:Yd,keyframes:Yd,spring:$C};function Xd({autoplay:e=!0,delay:t=0,driver:n=PI,keyframes:i,type:s="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:a="loop",onPlay:l,onStop:c,onComplete:u,onUpdate:d,...h}){let f=1,p=!1,m,v;const y=()=>{v=new Promise(V=>{m=V})};y();let g;const x=TI[s]||Yd;let _;x!==Yd&&typeof i[0]!="number"&&(_=RC([0,100],i,{clamp:!1}),i=[0,100]);const w=x({...h,keyframes:i});let S;a==="mirror"&&(S=x({...h,keyframes:[...i].reverse(),velocity:-(h.velocity||0)}));let C="idle",M=null,P=null,T=null;w.calculatedDuration===null&&r&&(w.calculatedDuration=Ib(w));const{calculatedDuration:A}=w;let E=1/0,z=1/0;A!==null&&(E=A+o,z=E*(r+1)-o);let N=0;const L=V=>{if(P===null)return;f>0&&(P=Math.min(P,V)),f<0&&(P=Math.min(V-z/f,P)),M!==null?N=M:N=Math.round(V-P)*f;const W=N-t*(f>=0?1:-1),et=f>=0?W<0:W>z;N=Math.max(W,0),C==="finished"&&M===null&&(N=z);let Z=N,O=w;if(r){const kt=Math.min(N,z)/E;let it=Math.floor(kt),Lt=kt%1;!Lt&&kt>=1&&(Lt=1),Lt===1&&it--,it=Math.min(it,r+1),!!(it%2)&&(a==="reverse"?(Lt=1-Lt,o&&(Lt-=o/E)):a==="mirror"&&(O=S)),Z=Hs(0,1,Lt)*E}const U=et?{done:!1,value:i[0]}:O.next(Z);_&&(U.value=_(U.value));let{done:lt}=U;!et&&A!==null&&(lt=f>=0?N>=z:N<=0);const ct=M===null&&(C==="finished"||C==="running"&<);return d&&d(U.value),ct&&D(),U},R=()=>{g&&g.stop(),g=void 0},B=()=>{C="idle",R(),m(),y(),P=T=null},D=()=>{C="finished",u&&u(),R(),m()},$=()=>{if(p)return;g||(g=n(L));const V=g.now();l&&l(),M!==null?P=V-M:(!P||C==="finished")&&(P=V),C==="finished"&&y(),T=P,M=null,C="running",g.start()};e&&$();const F={then(V,W){return v.then(V,W)},get time(){return Qi(N)},set time(V){V=Dr(V),N=V,M!==null||!g||f===0?M=V:P=g.now()-V/f},get duration(){const V=w.calculatedDuration===null?Ib(w):w.calculatedDuration;return Qi(V)},get speed(){return f},set speed(V){V===f||!g||(f=V,F.time=Qi(N))},get state(){return C},play:$,pause:()=>{C="paused",M=N},stop:()=>{p=!0,C!=="idle"&&(C="idle",c&&c(),B())},cancel:()=>{T!==null&&L(T),B()},complete:()=>{C="finished"},sample:V=>(P=0,L(V))};return F}function DI(e){let t;return()=>(t===void 0&&(t=e()),t)}const EI=DI(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),AI=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),du=10,OI=2e4,LI=(e,t)=>t.type==="spring"||e==="backgroundColor"||!pC(t.ease);function RI(e,t,{onUpdate:n,onComplete:i,...s}){if(!(EI()&&AI.has(t)&&!s.repeatDelay&&s.repeatType!=="mirror"&&s.damping!==0&&s.type!=="inertia"))return!1;let o=!1,a,l,c=!1;const u=()=>{l=new Promise(x=>{a=x})};u();let{keyframes:d,duration:h=300,ease:f,times:p}=s;if(LI(t,s)){const x=Xd({...s,repeat:0,delay:0});let _={done:!1,value:d[0]};const w=[];let S=0;for(;!_.done&&S{c=!1,m.cancel()},y=()=>{c=!0,zt.update(v),a(),u()};return m.onfinish=()=>{c||(e.set(H$(d,s)),i&&i(),y())},{then(x,_){return l.then(x,_)},attachTimeline(x){return m.timeline=x,m.onfinish=null,ce},get time(){return Qi(m.currentTime||0)},set time(x){m.currentTime=Dr(x)},get speed(){return m.playbackRate},set speed(x){m.playbackRate=x},get duration(){return Qi(h)},play:()=>{o||(m.play(),is(v))},pause:()=>m.pause(),stop:()=>{if(o=!0,m.playState==="idle")return;const{currentTime:x}=m;if(x){const _=Xd({...s,autoplay:!1});e.setWithVelocity(_.sample(x-du).value,_.sample(x).value,du)}y()},complete:()=>{c||m.finish()},cancel:y}}function NI({keyframes:e,delay:t,onUpdate:n,onComplete:i}){const s=()=>(n&&n(e[e.length-1]),i&&i(),{time:0,speed:1,duration:0,play:ce,pause:ce,stop:ce,then:r=>(r(),Promise.resolve()),cancel:ce,complete:ce});return t?Xd({keyframes:[0,1],duration:0,delay:t,onComplete:s}):s()}const jI={type:"spring",stiffness:500,damping:25,restSpeed:10},$I=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),II={type:"keyframes",duration:.8},FI={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},BI=(e,{keyframes:t})=>t.length>2?II:Ur.has(e)?e.startsWith("scale")?$I(t[1]):jI:FI,Rm=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Us.test(t)||t==="0")&&!t.startsWith("url(")),VI=new Set(["brightness","contrast","saturate","opacity"]);function zI(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=n.match(Ih)||[];if(!i)return e;const s=n.replace(i,"");let r=VI.has(t)?1:0;return i!==n&&(r*=100),t+"("+r+s+")"}const WI=/([a-z-]*)\(.*?\)/g,Nm={...Us,getAnimatableNone:e=>{const t=e.match(WI);return t?t.map(zI).join(" "):e}},HI={...QM,color:We,backgroundColor:We,outlineColor:We,fill:We,stroke:We,borderColor:We,borderTopColor:We,borderRightColor:We,borderBottomColor:We,borderLeftColor:We,filter:Nm,WebkitFilter:Nm},Yy=e=>HI[e];function IC(e,t){let n=Yy(e);return n!==Nm&&(n=Us),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const FC=e=>/^0[^.\s]+$/.test(e);function UI(e){if(typeof e=="number")return e===0;if(e!==null)return e==="none"||e==="0"||FC(e)}function YI(e,t,n,i){const s=Rm(t,n);let r;Array.isArray(n)?r=[...n]:r=[null,n];const o=i.from!==void 0?i.from:e.get();let a;const l=[];for(let c=0;cs=>{const r=Xy(i,e)||{},o=r.delay||i.delay||0;let{elapsed:a=0}=i;a=a-Dr(o);const l=YI(t,e,n,r),c=l[0],u=l[l.length-1],d=Rm(e,c),h=Rm(e,u);let f={keyframes:l,velocity:t.getVelocity(),ease:"easeOut",...r,delay:-a,onUpdate:p=>{t.set(p),r.onUpdate&&r.onUpdate(p)},onComplete:()=>{s(),r.onComplete&&r.onComplete()}};if(XI(r)||(f={...f,...BI(e,f)}),f.duration&&(f.duration=Dr(f.duration)),f.repeatDelay&&(f.repeatDelay=Dr(f.repeatDelay)),!d||!h||z$.current||r.type===!1||KI.skipAnimations)return NI(f);if(!i.isHandoff&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const p=RI(t,e,f);if(p)return p}return Xd(f)};function Kd(e){return!!(un(e)&&e.add)}const BC=e=>/^\-?\d*\.?\d+$/.test(e);function Gy(e,t){e.indexOf(t)===-1&&e.push(t)}function qy(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Qy{constructor(){this.subscriptions=[]}add(t){return Gy(this.subscriptions,t),()=>qy(this.subscriptions,t)}notify(t,n,i){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,i);else for(let r=0;r!isNaN(parseFloat(e));class qI{constructor(t,n={}){this.version="10.18.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(i,s=!0)=>{this.prev=this.current,this.current=i;const{delta:r,timestamp:o}=je;this.lastUpdated!==o&&(this.timeDelta=r,this.lastUpdated=o,zt.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),s&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>zt.postRender(this.velocityCheck),this.velocityCheck=({timestamp:i})=>{i!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=GI(this.current),this.owner=n.owner}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Qy);const i=this.events[t].add(n);return t==="change"?()=>{i(),zt.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,i){this.set(n),this.prev=t,this.timeDelta=i}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?NC(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Qo(e,t){return new qI(e,t)}const VC=e=>t=>t.test(e),QI={test:e=>e==="auto",parse:e=>e},zC=[Yr,st,bi,ps,s$,i$,QI],Ma=e=>zC.find(VC(e)),ZI=[...zC,We,Us],JI=e=>ZI.find(VC(e));function tF(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Qo(n))}function eF(e,t){const n=Bh(e,t);let{transitionEnd:i={},transition:s={},...r}=n?e.makeTargetAnimatable(n,!1):{};r={...r,...i};for(const o in r){const a=v$(r[o]);tF(e,o,a)}}function nF(e,t,n){var i,s;const r=Object.keys(t).filter(a=>!e.hasValue(a)),o=r.length;if(o)for(let a=0;al.remove(d))),c.push(v)}return o&&Promise.all(c).then(()=>{o&&eF(e,o)}),c}function jm(e,t,n={}){const i=Bh(e,t,n.custom);let{transition:s=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const r=i?()=>Promise.all(WC(e,i,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:u,staggerDirection:d}=s;return aF(e,t,c+l,u,d,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[l,c]=a==="beforeChildren"?[r,o]:[o,r];return l().then(()=>c())}else return Promise.all([r(),o(n.delay)])}function aF(e,t,n=0,i=0,s=1,r){const o=[],a=(e.variantChildren.size-1)*i,l=s===1?(c=0)=>c*i:(c=0)=>a-c*i;return Array.from(e.variantChildren).sort(lF).forEach((c,u)=>{c.notify("AnimationStart",t),o.push(jm(c,t,{...r,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function lF(e,t){return e.sortNodePosition(t)}function cF(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const s=t.map(r=>jm(e,r,n));i=Promise.all(s)}else if(typeof t=="string")i=jm(e,t,n);else{const s=typeof t=="function"?Bh(e,t,n.custom):t;i=Promise.all(WC(e,s,n))}return i.then(()=>e.notify("AnimationComplete",t))}const uF=[...Oy].reverse(),dF=Oy.length;function hF(e){return t=>Promise.all(t.map(({animation:n,options:i})=>cF(e,n,i)))}function fF(e){let t=hF(e);const n=mF();let i=!0;const s=(l,c)=>{const u=Bh(e,c);if(u){const{transition:d,transitionEnd:h,...f}=u;l={...l,...f,...h}}return l};function r(l){t=l(e)}function o(l,c){const u=e.getProps(),d=e.getVariantContext(!0)||{},h=[],f=new Set;let p={},m=1/0;for(let y=0;ym&&w,T=!1;const A=Array.isArray(_)?_:[_];let E=A.reduce(s,{});S===!1&&(E={});const{prevResolvedValues:z={}}=x,N={...z,...E},L=R=>{P=!0,f.has(R)&&(T=!0,f.delete(R)),x.needsAnimating[R]=!0};for(const R in N){const B=E[R],D=z[R];if(p.hasOwnProperty(R))continue;let $=!1;Hd(B)&&Hd(D)?$=!hC(B,D):$=B!==D,$?B!==void 0?L(R):f.add(R):B!==void 0&&f.has(R)?L(R):x.protectedKeys[R]=!0}x.prevProp=_,x.prevResolvedValues=E,x.isActive&&(p={...p,...E}),i&&e.blockInitialAnimation&&(P=!1),P&&(!C||T)&&h.push(...A.map(R=>({animation:R,options:{type:g,...l}})))}if(f.size){const y={};f.forEach(g=>{const x=e.getBaseTarget(g);x!==void 0&&(y[g]=x)}),h.push({animation:y})}let v=!!h.length;return i&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(v=!1),i=!1,v?t(h):Promise.resolve()}function a(l,c,u){var d;if(n[l].isActive===c)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(f=>{var p;return(p=f.animationState)===null||p===void 0?void 0:p.setActive(l,c)}),n[l].isActive=c;const h=o(u,l);for(const f in n)n[f].protectedKeys={};return h}return{animateChanges:o,setActive:a,setAnimateFunction:r,getState:()=>n}}function pF(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!hC(t,e):!1}function lr(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function mF(){return{animate:lr(!0),whileInView:lr(),whileHover:lr(),whileTap:lr(),whileDrag:lr(),whileFocus:lr(),exit:lr()}}class gF extends tr{constructor(t){super(t),t.animationState||(t.animationState=fF(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),jh(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){}}let yF=0;class vF extends tr{constructor(){super(...arguments),this.id=yF++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n,custom:i}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const r=this.node.animationState.setActive("exit",!t,{custom:i??this.node.getProps().custom});n&&!t&&r.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const xF={animation:{Feature:gF},exit:{Feature:vF}},Fb=(e,t)=>Math.abs(e-t);function bF(e,t){const n=Fb(e.x,t.x),i=Fb(e.y,t.y);return Math.sqrt(n**2+i**2)}class HC{constructor(t,n,{transformPagePoint:i,contextWindow:s,dragSnapToOrigin:r=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=tp(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,f=bF(d.offset,{x:0,y:0})>=3;if(!h&&!f)return;const{point:p}=d,{timestamp:m}=je;this.history.push({...p,timestamp:m});const{onStart:v,onMove:y}=this.handlers;h||(v&&v(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,h)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Jf(h,this.transformPagePoint),zt.update(this.updatePoint,!0)},this.handlePointerUp=(d,h)=>{this.end();const{onEnd:f,onSessionEnd:p,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=tp(d.type==="pointercancel"?this.lastMoveEventInfo:Jf(h,this.transformPagePoint),this.history);this.startEvent&&f&&f(d,v),p&&p(d,v)},!aC(t))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=i,this.contextWindow=s||window;const o=Fh(t),a=Jf(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=je;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=n;u&&u(t,tp(a,this.history)),this.removeListeners=Is(qi(this.contextWindow,"pointermove",this.handlePointerMove),qi(this.contextWindow,"pointerup",this.handlePointerUp),qi(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),is(this.updatePoint)}}function Jf(e,t){return t?{point:t(e.point)}:e}function Bb(e,t){return{x:e.x-t.x,y:e.y-t.y}}function tp({point:e},t){return{point:e,delta:Bb(e,UC(t)),offset:Bb(e,_F(t)),velocity:wF(t,.1)}}function _F(e){return e[0]}function UC(e){return e[e.length-1]}function wF(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const s=UC(e);for(;n>=0&&(i=e[n],!(s.timestamp-i.timestamp>Dr(t)));)n--;if(!i)return{x:0,y:0};const r=Qi(s.timestamp-i.timestamp);if(r===0)return{x:0,y:0};const o={x:(s.x-i.x)/r,y:(s.y-i.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function wn(e){return e.max-e.min}function $m(e,t=0,n=.01){return Math.abs(e-t)<=n}function Vb(e,t,n,i=.5){e.origin=i,e.originPoint=ee(t.min,t.max,e.origin),e.scale=wn(n)/wn(t),($m(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=ee(n.min,n.max,e.origin)-e.originPoint,($m(e.translate)||isNaN(e.translate))&&(e.translate=0)}function vl(e,t,n,i){Vb(e.x,t.x,n.x,i?i.originX:void 0),Vb(e.y,t.y,n.y,i?i.originY:void 0)}function zb(e,t,n){e.min=n.min+t.min,e.max=e.min+wn(t)}function kF(e,t,n){zb(e.x,t.x,n.x),zb(e.y,t.y,n.y)}function Wb(e,t,n){e.min=t.min-n.min,e.max=e.min+wn(t)}function xl(e,t,n){Wb(e.x,t.x,n.x),Wb(e.y,t.y,n.y)}function SF(e,{min:t,max:n},i){return t!==void 0&&en&&(e=i?ee(n,e,i.max):Math.min(e,n)),e}function Hb(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function MF(e,{top:t,left:n,bottom:i,right:s}){return{x:Hb(e.x,n,s),y:Hb(e.y,t,i)}}function Ub(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.mini?n=Ql(t.min,t.max-i,e.min):i>s&&(n=Ql(e.min,e.max-s,t.min)),Hs(0,1,n)}function TF(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Im=.35;function DF(e=Im){return e===!1?e=0:e===!0&&(e=Im),{x:Yb(e,"left","right"),y:Yb(e,"top","bottom")}}function Yb(e,t,n){return{min:Xb(e,t),max:Xb(e,n)}}function Xb(e,t){return typeof e=="number"?e:e[t]||0}const Kb=()=>({translate:0,scale:1,origin:0,originPoint:0}),ko=()=>({x:Kb(),y:Kb()}),Gb=()=>({min:0,max:0}),fe=()=>({x:Gb(),y:Gb()});function An(e){return[e("x"),e("y")]}function YC({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function EF({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function AF(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function ep(e){return e===void 0||e===1}function Fm({scale:e,scaleX:t,scaleY:n}){return!ep(e)||!ep(t)||!ep(n)}function mr(e){return Fm(e)||XC(e)||e.z||e.rotate||e.rotateX||e.rotateY}function XC(e){return qb(e.x)||qb(e.y)}function qb(e){return e&&e!=="0%"}function Gd(e,t,n){const i=e-n,s=t*i;return n+s}function Qb(e,t,n,i,s){return s!==void 0&&(e=Gd(e,s,i)),Gd(e,n,i)+t}function Bm(e,t=0,n=1,i,s){e.min=Qb(e.min,t,n,i,s),e.max=Qb(e.max,t,n,i,s)}function KC(e,{x:t,y:n}){Bm(e.x,t.translate,t.scale,t.originPoint),Bm(e.y,n.translate,n.scale,n.originPoint)}function OF(e,t,n,i=!1){const s=n.length;if(!s)return;t.x=t.y=1;let r,o;for(let a=0;a1.0000000000001||e<.999999999999?e:1}function ys(e,t){e.min=e.min+t,e.max=e.max+t}function Jb(e,t,[n,i,s]){const r=t[s]!==void 0?t[s]:.5,o=ee(e.min,e.max,r);Bm(e,t[n],t[i],o,t.scale)}const LF=["x","scaleX","originX"],RF=["y","scaleY","originY"];function So(e,t){Jb(e.x,t,LF),Jb(e.y,t,RF)}function GC(e,t){return YC(AF(e.getBoundingClientRect(),t))}function NF(e,t,n){const i=GC(e,n),{scroll:s}=t;return s&&(ys(i.x,s.offset.x),ys(i.y,s.offset.y)),i}const qC=({current:e})=>e?e.ownerDocument.defaultView:null,jF=new WeakMap;class $F{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=fe(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const s=u=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Fh(u,"page").point)},r=(u,d)=>{const{drag:h,dragPropagation:f,onDragStart:p}=this.getProps();if(h&&!f&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=cC(h),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),An(v=>{let y=this.getAxisMotionValue(v).get()||0;if(bi.test(y)){const{projection:g}=this.visualElement;if(g&&g.layout){const x=g.layout.layoutBox[v];x&&(y=wn(x)*(parseFloat(y)/100))}}this.originPoint[v]=y}),p&&zt.update(()=>p(u,d),!1,!0);const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},o=(u,d)=>{const{dragPropagation:h,dragDirectionLock:f,onDirectionLock:p,onDrag:m}=this.getProps();if(!h&&!this.openGlobalLock)return;const{offset:v}=d;if(f&&this.currentDirection===null){this.currentDirection=IF(v),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",d.point,v),this.updateAxis("y",d.point,v),this.visualElement.render(),m&&m(u,d)},a=(u,d)=>this.stop(u,d),l=()=>An(u=>{var d;return this.getAnimationState(u)==="paused"&&((d=this.getAxisMotionValue(u).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new HC(t,{onSessionStart:s,onStart:r,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:qC(this.visualElement)})}stop(t,n){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:r}=this.getProps();r&&zt.update(()=>r(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,i){const{drag:s}=this.getProps();if(!i||!hu(t,s,this.currentDirection))return;const r=this.getAxisMotionValue(t);let o=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(o=SF(o,this.constraints[t],this.elastic[t])),r.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:i}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,r=this.constraints;n&&_o(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=MF(s.layoutBox,n):this.constraints=!1,this.elastic=DF(i),r!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&An(o=>{this.getAxisMotionValue(o)&&(this.constraints[o]=TF(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!_o(t))return!1;const i=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const r=NF(i,s.root,this.visualElement.getTransformPagePoint());let o=CF(s.layout.layoutBox,r);if(n){const a=n(EF(o));this.hasMutatedConstraints=!!a,a&&(o=YC(a))}return o}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:s,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=An(u=>{if(!hu(u,n,this.currentDirection))return;let d=l&&l[u]||{};o&&(d={min:0,max:0});const h=s?200:1e6,f=s?40:1e7,p={type:"inertia",velocity:i?t[u]:0,bounceStiffness:h,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...r,...d};return this.startAxisValueAnimation(u,p)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const i=this.getAxisMotionValue(t);return i.start(Ky(t,i,0,n))}stopAnimation(){An(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){An(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n="_drag"+t.toUpperCase(),i=this.visualElement.getProps(),s=i[n];return s||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){An(n=>{const{drag:i}=this.getProps();if(!hu(n,i,this.currentDirection))return;const{projection:s}=this.visualElement,r=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n];r.set(t[n]-ee(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!_o(n)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};An(o=>{const a=this.getAxisMotionValue(o);if(a){const l=a.get();s[o]=PF({min:l,max:l},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),An(o=>{if(!hu(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(ee(l,c,s[o]))})}addListeners(){if(!this.visualElement.current)return;jF.set(this.visualElement,this);const t=this.visualElement.current,n=qi(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),i=()=>{const{dragConstraints:l}=this.getProps();_o(l)&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,r=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),i();const o=Hi(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(An(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())});return()=>{o(),n(),r(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:s=!1,dragConstraints:r=!1,dragElastic:o=Im,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:s,dragConstraints:r,dragElastic:o,dragMomentum:a}}}function hu(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function IF(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class FF extends tr{constructor(t){super(t),this.removeGroupControls=ce,this.removeListeners=ce,this.controls=new $F(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ce}unmount(){this.removeGroupControls(),this.removeListeners()}}const t1=e=>(t,n)=>{e&&zt.update(()=>e(t,n))};class BF extends tr{constructor(){super(...arguments),this.removePointerDownListener=ce}onPointerDown(t){this.session=new HC(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:qC(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:s}=this.node.getProps();return{onSessionStart:t1(t),onStart:t1(n),onMove:i,onEnd:(r,o)=>{delete this.session,s&&zt.update(()=>s(r,o))}}}mount(){this.removePointerDownListener=qi(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function VF(){const e=k.useContext(Rh);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:i}=e,s=k.useId();return k.useEffect(()=>i(s),[]),!t&&n?[!1,()=>n&&n(s)]:[!0]}const nd={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function e1(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Ca={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(st.test(e))e=parseFloat(e);else return e;const n=e1(e,t.target.x),i=e1(e,t.target.y);return`${n}% ${i}%`}},zF={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,s=Us.parse(e);if(s.length>5)return i;const r=Us.createTransformer(e),o=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;s[0+o]/=a,s[1+o]/=l;const c=ee(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=c),typeof s[3+o]=="number"&&(s[3+o]/=c),r(s)}};class WF extends Y.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i,layoutId:s}=this.props,{projection:r}=t;qj(HF),r&&(n.group&&n.group.add(r),i&&i.register&&s&&i.register(r),r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),nd.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:i,drag:s,isPresent:r}=this.props,o=i.projection;return o&&(o.isPresent=r,s||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==r&&(r?o.promote():o.relegate()||zt.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),queueMicrotask(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),i&&i.deregister&&i.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function QC(e){const[t,n]=VF(),i=k.useContext(Ry);return Y.createElement(WF,{...e,layoutGroup:i,switchLayoutGroup:k.useContext(YM),isPresent:t,safeToRemove:n})}const HF={borderRadius:{...Ca,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ca,borderTopRightRadius:Ca,borderBottomLeftRadius:Ca,borderBottomRightRadius:Ca,boxShadow:zF},ZC=["TopLeft","TopRight","BottomLeft","BottomRight"],UF=ZC.length,n1=e=>typeof e=="string"?parseFloat(e):e,i1=e=>typeof e=="number"||st.test(e);function YF(e,t,n,i,s,r){s?(e.opacity=ee(0,n.opacity!==void 0?n.opacity:1,XF(i)),e.opacityExit=ee(t.opacity!==void 0?t.opacity:1,0,KF(i))):r&&(e.opacity=ee(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,i));for(let o=0;oit?1:n(Ql(e,t,i))}function r1(e,t){e.min=t.min,e.max=t.max}function Dn(e,t){r1(e.x,t.x),r1(e.y,t.y)}function o1(e,t,n,i,s){return e-=t,e=Gd(e,1/n,i),s!==void 0&&(e=Gd(e,1/s,i)),e}function GF(e,t=0,n=1,i=.5,s,r=e,o=e){if(bi.test(t)&&(t=parseFloat(t),t=ee(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=ee(r.min,r.max,i);e===r&&(a-=t),e.min=o1(e.min,t,n,a,s),e.max=o1(e.max,t,n,a,s)}function a1(e,t,[n,i,s],r,o){GF(e,t[n],t[i],t[s],t.scale,r,o)}const qF=["x","scaleX","originX"],QF=["y","scaleY","originY"];function l1(e,t,n,i){a1(e.x,t,qF,n?n.x:void 0,i?i.x:void 0),a1(e.y,t,QF,n?n.y:void 0,i?i.y:void 0)}function c1(e){return e.translate===0&&e.scale===1}function tP(e){return c1(e.x)&&c1(e.y)}function ZF(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function eP(e,t){return Math.round(e.x.min)===Math.round(t.x.min)&&Math.round(e.x.max)===Math.round(t.x.max)&&Math.round(e.y.min)===Math.round(t.y.min)&&Math.round(e.y.max)===Math.round(t.y.max)}function u1(e){return wn(e.x)/wn(e.y)}class JF{constructor(){this.members=[]}add(t){Gy(this.members,t),t.scheduleRender()}remove(t){if(qy(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let i;for(let s=n;s>=0;s--){const r=this.members[s];if(r.isPresent!==!1){i=r;break}}return i?(this.promote(i),!0):!1}promote(t,n){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,n&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:i}=t;n.onExitComplete&&n.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function d1(e,t,n){let i="";const s=e.x.translate/t.x,r=e.y.translate/t.y;if((s||r)&&(i=`translate3d(${s}px, ${r}px, 0) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:l,rotateX:c,rotateY:u}=n;l&&(i+=`rotate(${l}deg) `),c&&(i+=`rotateX(${c}deg) `),u&&(i+=`rotateY(${u}deg) `)}const o=e.x.scale*t.x,a=e.y.scale*t.y;return(o!==1||a!==1)&&(i+=`scale(${o}, ${a})`),i||"none"}const tB=(e,t)=>e.depth-t.depth;class eB{constructor(){this.children=[],this.isDirty=!1}add(t){Gy(this.children,t),this.isDirty=!0}remove(t){qy(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(tB),this.isDirty=!1,this.children.forEach(t)}}function nB(e,t){const n=performance.now(),i=({timestamp:s})=>{const r=s-n;r>=t&&(is(i),e(r-t))};return zt.read(i,!0),()=>is(i)}function iB(e){window.MotionDebug&&window.MotionDebug.record(e)}function sB(e){return e instanceof SVGElement&&e.tagName!=="svg"}function rB(e,t,n){const i=un(e)?e:Qo(e);return i.start(Ky("",i,t,n)),i.animation}const h1=["","X","Y","Z"],oB={visibility:"hidden"},f1=1e3;let aB=0;const gr={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function nP({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(o={},a=t==null?void 0:t()){this.id=aB++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,gr.totalNodes=gr.resolvedTargetDeltas=gr.recalculatedProjection=0,this.nodes.forEach(uB),this.nodes.forEach(mB),this.nodes.forEach(gB),this.nodes.forEach(dB),iB(gr)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=nB(h,250),nd.hasAnimatedSinceResize&&(nd.hasAnimatedSinceResize=!1,this.nodes.forEach(m1))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeTargetChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||u.getDefaultTransition()||_B,{onLayoutAnimationStart:v,onLayoutAnimationComplete:y}=u.getProps(),g=!this.targetLayout||!eP(this.targetLayout,p)||f,x=!h&&f;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||h&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,x);const _={...Xy(m,"layout"),onPlay:v,onComplete:y};(u.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_)}else h||m1(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,is(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(yB),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;uthis.update()))}clearAllSnapshots(){this.nodes.forEach(hB),this.sharedNodes.forEach(vB)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,zt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){zt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const w=_/1e3;g1(d.x,o.x,w),g1(d.y,o.y,w),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(xl(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),xB(this.relativeTarget,this.relativeTargetOrigin,h,w),x&&ZF(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=fe()),Dn(x,this.relativeTarget)),m&&(this.animationValues=u,YF(u,c,this.latestValues,w,g,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(is(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=zt.update(()=>{nd.hasAnimatedSinceResize=!0,this.currentAnimation=rB(0,f1,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(f1),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&iP(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||fe();const d=wn(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+d;const h=wn(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}Dn(a,l),So(a,u),vl(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new JF),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(a=!0),!a)return;const c={};for(let u=0;u{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(p1),this.root.sharedNodes.clear()}}}function lB(e){e.updateLayout()}function cB(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:s}=e.layout,{animationType:r}=e.options,o=n.source!==e.layout.source;r==="size"?An(d=>{const h=o?n.measuredBox[d]:n.layoutBox[d],f=wn(h);h.min=i[d].min,h.max=h.min+f}):iP(r,n.layoutBox,i)&&An(d=>{const h=o?n.measuredBox[d]:n.layoutBox[d],f=wn(i[d]);h.max=h.min+f,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+f)});const a=ko();vl(a,i,n.layoutBox);const l=ko();o?vl(l,e.applyTransform(s,!0),n.measuredBox):vl(l,i,n.layoutBox);const c=!tP(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:h,layout:f}=d;if(h&&f){const p=fe();xl(p,n.layoutBox,h.layoutBox);const m=fe();xl(m,i,f.layoutBox),eP(p,m)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=p,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:i,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeTargetChanged:u})}else if(e.isLead()){const{onExitComplete:i}=e.options;i&&i()}e.options.transition=void 0}function uB(e){gr.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function dB(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function hB(e){e.clearSnapshot()}function p1(e){e.clearMeasurements()}function fB(e){e.isLayoutDirty=!1}function pB(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function m1(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function mB(e){e.resolveTargetDelta()}function gB(e){e.calcProjection()}function yB(e){e.resetRotation()}function vB(e){e.removeLeadSnapshot()}function g1(e,t,n){e.translate=ee(t.translate,0,n),e.scale=ee(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function y1(e,t,n,i){e.min=ee(t.min,n.min,i),e.max=ee(t.max,n.max,i)}function xB(e,t,n,i){y1(e.x,t.x,n.x,i),y1(e.y,t.y,n.y,i)}function bB(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const _B={duration:.45,ease:[.4,0,.1,1]},v1=e=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(e),x1=v1("applewebkit/")&&!v1("chrome/")?Math.round:ce;function b1(e){e.min=x1(e.min),e.max=x1(e.max)}function wB(e){b1(e.x),b1(e.y)}function iP(e,t,n){return e==="position"||e==="preserve-aspect"&&!$m(u1(t),u1(n),.2)}const kB=nP({attachResizeListener:(e,t)=>Hi(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),np={current:void 0},sP=nP({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!np.current){const e=new kB({});e.mount(window),e.setOptions({layoutScroll:!0}),np.current=e}return np.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),SB={pan:{Feature:BF},drag:{Feature:FF,ProjectionNode:sP,MeasureLayout:QC}},MB=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function CB(e){const t=MB.exec(e);if(!t)return[,];const[,n,i]=t;return[n,i]}function Vm(e,t,n=1){const[i,s]=CB(e);if(!i)return;const r=window.getComputedStyle(t).getPropertyValue(i);if(r){const o=r.trim();return BC(o)?parseFloat(o):o}else return Em(s)?Vm(s,t,n+1):s}function PB(e,{...t},n){const i=e.current;if(!(i instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(s=>{const r=s.get();if(!Em(r))return;const o=Vm(r,i);o&&s.set(o)});for(const s in t){const r=t[s];if(!Em(r))continue;const o=Vm(r,i);o&&(t[s]=o,n||(n={}),n[s]===void 0&&(n[s]=r))}return{target:t,transitionEnd:n}}const TB=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),rP=e=>TB.has(e),DB=e=>Object.keys(e).some(rP),_1=e=>e===Yr||e===st,w1=(e,t)=>parseFloat(e.split(", ")[t]),k1=(e,t)=>(n,{transform:i})=>{if(i==="none"||!i)return 0;const s=i.match(/^matrix3d\((.+)\)$/);if(s)return w1(s[1],t);{const r=i.match(/^matrix\((.+)\)$/);return r?w1(r[1],e):0}},EB=new Set(["x","y","z"]),AB=yc.filter(e=>!EB.has(e));function OB(e){const t=[];return AB.forEach(n=>{const i=e.getValue(n);i!==void 0&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const Zo={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:k1(4,13),y:k1(5,14)};Zo.translateX=Zo.x;Zo.translateY=Zo.y;const LB=(e,t,n)=>{const i=t.measureViewportBox(),s=t.current,r=getComputedStyle(s),{display:o}=r,a={};o==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(c=>{a[c]=Zo[c](i,r)}),t.render();const l=t.measureViewportBox();return n.forEach(c=>{const u=t.getValue(c);u&&u.jump(a[c]),e[c]=Zo[c](l,r)}),e},RB=(e,t,n={},i={})=>{t={...t},i={...i};const s=Object.keys(t).filter(rP);let r=[],o=!1;const a=[];if(s.forEach(l=>{const c=e.getValue(l);if(!e.hasValue(l))return;let u=n[l],d=Ma(u);const h=t[l];let f;if(Hd(h)){const p=h.length,m=h[0]===null?1:0;u=h[m],d=Ma(u);for(let v=m;v=0?window.pageYOffset:null,c=LB(t,e,a);return r.length&&r.forEach(([u,d])=>{e.getValue(u).set(d)}),e.render(),Nh&&l!==null&&window.scrollTo({top:l}),{target:c,transitionEnd:i}}else return{target:t,transitionEnd:i}};function NB(e,t,n,i){return DB(t)?RB(e,t,n,i):{target:t,transitionEnd:i}}const jB=(e,t,n,i)=>{const s=PB(e,t,i);return t=s.target,i=s.transitionEnd,NB(e,t,n,i)},zm={current:null},oP={current:!1};function $B(){if(oP.current=!0,!!Nh)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>zm.current=e.matches;e.addListener(t),t()}else zm.current=!1}function IB(e,t,n){const{willChange:i}=t;for(const s in t){const r=t[s],o=n[s];if(un(r))e.addValue(s,r),Kd(i)&&i.add(s);else if(un(o))e.addValue(s,Qo(r,{owner:e})),Kd(i)&&i.remove(s);else if(o!==r)if(e.hasValue(s)){const a=e.getValue(s);!a.hasAnimated&&a.set(r)}else{const a=e.getStaticValue(s);e.addValue(s,Qo(a!==void 0?a:r,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const S1=new WeakMap,aP=Object.keys(ql),FB=aP.length,M1=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],BB=Ly.length;class VB{constructor({parent:t,props:n,presenceContext:i,reducedMotionConfig:s,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>zt.render(this.render,!1,!0);const{latestValues:a,renderState:l}=r;this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=o,this.isControllingVariants=$h(n),this.isVariantNode=UM(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:c,...u}=this.scrapeMotionValuesFromProps(n,{});for(const d in u){const h=u[d];a[d]!==void 0&&un(h)&&(h.set(a[d],!1),Kd(c)&&c.add(d))}}scrapeMotionValuesFromProps(t,n){return{}}mount(t){this.current=t,S1.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,i)=>this.bindToMotionValue(i,n)),oP.current||$B(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:zm.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){S1.delete(this.current),this.projection&&this.projection.unmount(),is(this.notifyUpdate),is(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,n){const i=Ur.has(t),s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&zt.update(this.notifyUpdate,!1,!0),i&&this.projection&&(this.projection.isTransformDirty=!0)}),r=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{s(),r()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures({children:t,...n},i,s,r){let o,a;for(let l=0;lthis.scheduleRender(),animationType:typeof c=="string"?c:"both",initialPromotionConfig:r,layoutScroll:h,layoutRoot:f})}return a}updateFeatures(){for(const t in this.features){const n=this.features[t];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):fe()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;in.variantChildren.delete(t)}addValue(t,n){n!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,n)),this.values.set(t,n),this.latestValues[t]=n.get()}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return i===void 0&&n!==void 0&&(i=Qo(n,{owner:this}),this.addValue(t,i)),i}readValue(t){var n;return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(n=this.getBaseTargetFromProps(this.props,t))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:i}=this.props,s=typeof i=="string"||typeof i=="object"?(n=Vy(this.props,i))===null||n===void 0?void 0:n[t]:void 0;if(i&&s!==void 0)return s;const r=this.getBaseTargetFromProps(this.props,t);return r!==void 0&&!un(r)?r:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Qy),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class lP extends VB{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:i}){delete n[t],delete i[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...i},{transformValues:s},r){let o=sF(i,t||{},this);if(s&&(n&&(n=s(n)),i&&(i=s(i)),o&&(o=s(o))),r){nF(this,i,o);const a=jB(this,i,o,n);n=a.transitionEnd,i=a.target}return{transition:t,transitionEnd:n,...i}}}function zB(e){return window.getComputedStyle(e)}class WB extends lP{constructor(){super(...arguments),this.type="html"}readValueFromInstance(t,n){if(Ur.has(n)){const i=Yy(n);return i&&i.default||0}else{const i=zB(t),s=(GM(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return GC(t,n)}build(t,n,i,s){jy(t,n,i,s.transformTemplate)}scrapeMotionValuesFromProps(t,n){return By(t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;un(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(t,n,i,s){eC(t,n,i,s)}}class HB extends lP{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ur.has(n)){const i=Yy(n);return i&&i.default||0}return n=nC.has(n)?n:Ay(n),t.getAttribute(n)}measureInstanceViewportBox(){return fe()}scrapeMotionValuesFromProps(t,n){return sC(t,n)}build(t,n,i,s){Iy(t,n,i,this.isSVGTag,s.transformTemplate)}renderInstance(t,n,i,s){iC(t,n,i,s)}mount(t){this.isSVGTag=Fy(t.tagName),super.mount(t)}}const UB=(e,t)=>Ny(e)?new HB(t,{enableHardwareAcceleration:!1}):new WB(t,{enableHardwareAcceleration:!0}),YB={layout:{ProjectionNode:sP,MeasureLayout:QC}},XB={...xF,...F$,...SB,...YB},Jo=Kj((e,t)=>C$(e,t,XB,UB));function cP(){const e=k.useRef(!1);return Ey(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function KB(){const e=cP(),[t,n]=k.useState(0),i=k.useCallback(()=>{e.current&&n(t+1)},[t]);return[k.useCallback(()=>zt.postRender(i),[i]),t]}class GB extends k.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function qB({children:e,isPresent:t}){const n=k.useId(),i=k.useRef(null),s=k.useRef({width:0,height:0,top:0,left:0});return k.useInsertionEffect(()=>{const{width:r,height:o,top:a,left:l}=s.current;if(t||!i.current||!r||!o)return;i.current.dataset.motionPopId=n;const c=document.createElement("style");return document.head.appendChild(c),c.sheet&&c.sheet.insertRule(` [data-motion-pop-id="${n}"] { position: absolute !important; width: ${r}px !important; @@ -89,4 +89,4 @@ Error generating stack: `+r.message+` * perfect-scrollbar v1.5.3 * Copyright 2021 Hyunje Jun, MDBootstrap and Contributors * Licensed under MIT - */function mi(e){return getComputedStyle(e)}function Ze(e,t){for(var n in t){var i=t[n];typeof i=="number"&&(i=i+"px"),e.style[n]=i}return e}function Du(e){var t=document.createElement("div");return t.className=e,t}var W_=typeof Element<"u"&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector);function Ts(e,t){if(!W_)throw new Error("No element matching method supported");return W_.call(e,t)}function Mo(e){e.remove?e.remove():e.parentNode&&e.parentNode.removeChild(e)}function H_(e,t){return Array.prototype.filter.call(e.children,function(n){return Ts(n,t)})}var pe={main:"ps",rtl:"ps__rtl",element:{thumb:function(e){return"ps__thumb-"+e},rail:function(e){return"ps__rail-"+e},consuming:"ps__child--consume"},state:{focus:"ps--focus",clicking:"ps--clicking",active:function(e){return"ps--active-"+e},scrolling:function(e){return"ps--scrolling-"+e}}},xT={x:null,y:null};function bT(e,t){var n=e.element.classList,i=pe.state.scrolling(t);n.contains(i)?clearTimeout(xT[t]):n.add(i)}function _T(e,t){xT[t]=setTimeout(function(){return e.isAlive&&e.element.classList.remove(pe.state.scrolling(t))},e.settings.scrollingThreshold)}function d4(e,t){bT(e,t),_T(e,t)}var Cc=function(e){this.element=e,this.handlers={}},wT={isEmpty:{configurable:!0}};Cc.prototype.bind=function(e,t){typeof this.handlers[e]>"u"&&(this.handlers[e]=[]),this.handlers[e].push(t),this.element.addEventListener(e,t,!1)};Cc.prototype.unbind=function(e,t){var n=this;this.handlers[e]=this.handlers[e].filter(function(i){return t&&i!==t?!0:(n.element.removeEventListener(e,i,!1),!1)})};Cc.prototype.unbindAll=function(){for(var e in this.handlers)this.unbind(e)};wT.isEmpty.get=function(){var e=this;return Object.keys(this.handlers).every(function(t){return e.handlers[t].length===0})};Object.defineProperties(Cc.prototype,wT);var la=function(){this.eventElements=[]};la.prototype.eventElement=function(e){var t=this.eventElements.filter(function(n){return n.element===e})[0];return t||(t=new Cc(e),this.eventElements.push(t)),t};la.prototype.bind=function(e,t,n){this.eventElement(e).bind(t,n)};la.prototype.unbind=function(e,t,n){var i=this.eventElement(e);i.unbind(t,n),i.isEmpty&&this.eventElements.splice(this.eventElements.indexOf(i),1)};la.prototype.unbindAll=function(){this.eventElements.forEach(function(e){return e.unbindAll()}),this.eventElements=[]};la.prototype.once=function(e,t,n){var i=this.eventElement(e),s=function(r){i.unbind(t,s),n(r)};i.bind(t,s)};function Eu(e){if(typeof window.CustomEvent=="function")return new CustomEvent(e);var t=document.createEvent("CustomEvent");return t.initCustomEvent(e,!1,!1,void 0),t}function ah(e,t,n,i,s){i===void 0&&(i=!0),s===void 0&&(s=!1);var r;if(t==="top")r=["contentHeight","containerHeight","scrollTop","y","up","down"];else if(t==="left")r=["contentWidth","containerWidth","scrollLeft","x","left","right"];else throw new Error("A proper axis should be provided");h4(e,n,r,i,s)}function h4(e,t,n,i,s){var r=n[0],o=n[1],a=n[2],l=n[3],c=n[4],u=n[5];i===void 0&&(i=!0),s===void 0&&(s=!1);var d=e.element;e.reach[l]=null,d[a]<1&&(e.reach[l]="start"),d[a]>e[r]-e[o]-1&&(e.reach[l]="end"),t&&(d.dispatchEvent(Eu("ps-scroll-"+l)),t<0?d.dispatchEvent(Eu("ps-scroll-"+c)):t>0&&d.dispatchEvent(Eu("ps-scroll-"+u)),i&&d4(e,l)),e.reach[l]&&(t||s)&&d.dispatchEvent(Eu("ps-"+l+"-reach-"+e.reach[l]))}function Jt(e){return parseInt(e,10)||0}function f4(e){return Ts(e,"input,[contenteditable]")||Ts(e,"select,[contenteditable]")||Ts(e,"textarea,[contenteditable]")||Ts(e,"button,[contenteditable]")}function p4(e){var t=mi(e);return Jt(t.width)+Jt(t.paddingLeft)+Jt(t.paddingRight)+Jt(t.borderLeftWidth)+Jt(t.borderRightWidth)}var ao={isWebKit:typeof document<"u"&&"WebkitAppearance"in document.documentElement.style,supportsTouch:typeof window<"u"&&("ontouchstart"in window||"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>0||window.DocumentTouch&&document instanceof window.DocumentTouch),supportsIePointer:typeof navigator<"u"&&navigator.msMaxTouchPoints,isChrome:typeof navigator<"u"&&/Chrome/i.test(navigator&&navigator.userAgent)};function ss(e){var t=e.element,n=Math.floor(t.scrollTop),i=t.getBoundingClientRect();e.containerWidth=Math.round(i.width),e.containerHeight=Math.round(i.height),e.contentWidth=t.scrollWidth,e.contentHeight=t.scrollHeight,t.contains(e.scrollbarXRail)||(H_(t,pe.element.rail("x")).forEach(function(s){return Mo(s)}),t.appendChild(e.scrollbarXRail)),t.contains(e.scrollbarYRail)||(H_(t,pe.element.rail("y")).forEach(function(s){return Mo(s)}),t.appendChild(e.scrollbarYRail)),!e.settings.suppressScrollX&&e.containerWidth+e.settings.scrollXMarginOffset=e.railXWidth-e.scrollbarXWidth&&(e.scrollbarXLeft=e.railXWidth-e.scrollbarXWidth),e.scrollbarYTop>=e.railYHeight-e.scrollbarYHeight&&(e.scrollbarYTop=e.railYHeight-e.scrollbarYHeight),m4(t,e),e.scrollbarXActive?t.classList.add(pe.state.active("x")):(t.classList.remove(pe.state.active("x")),e.scrollbarXWidth=0,e.scrollbarXLeft=0,t.scrollLeft=e.isRtl===!0?e.contentWidth:0),e.scrollbarYActive?t.classList.add(pe.state.active("y")):(t.classList.remove(pe.state.active("y")),e.scrollbarYHeight=0,e.scrollbarYTop=0,t.scrollTop=0)}function U_(e,t){return e.settings.minScrollbarLength&&(t=Math.max(t,e.settings.minScrollbarLength)),e.settings.maxScrollbarLength&&(t=Math.min(t,e.settings.maxScrollbarLength)),t}function m4(e,t){var n={width:t.railXWidth},i=Math.floor(e.scrollTop);t.isRtl?n.left=t.negativeScrollAdjustment+e.scrollLeft+t.containerWidth-t.contentWidth:n.left=e.scrollLeft,t.isScrollbarXUsingBottom?n.bottom=t.scrollbarXBottom-i:n.top=t.scrollbarXTop+i,Ze(t.scrollbarXRail,n);var s={top:i,height:t.railYHeight};t.isScrollbarYUsingRight?t.isRtl?s.right=t.contentWidth-(t.negativeScrollAdjustment+e.scrollLeft)-t.scrollbarYRight-t.scrollbarYOuterWidth-9:s.right=t.scrollbarYRight-e.scrollLeft:t.isRtl?s.left=t.negativeScrollAdjustment+e.scrollLeft+t.containerWidth*2-t.contentWidth-t.scrollbarYLeft-t.scrollbarYOuterWidth:s.left=t.scrollbarYLeft+e.scrollLeft,Ze(t.scrollbarYRail,s),Ze(t.scrollbarX,{left:t.scrollbarXLeft,width:t.scrollbarXWidth-t.railBorderXWidth}),Ze(t.scrollbarY,{top:t.scrollbarYTop,height:t.scrollbarYHeight-t.railBorderYWidth})}function g4(e){e.element,e.event.bind(e.scrollbarY,"mousedown",function(t){return t.stopPropagation()}),e.event.bind(e.scrollbarYRail,"mousedown",function(t){var n=t.pageY-window.pageYOffset-e.scrollbarYRail.getBoundingClientRect().top,i=n>e.scrollbarYTop?1:-1;e.element.scrollTop+=i*e.containerHeight,ss(e),t.stopPropagation()}),e.event.bind(e.scrollbarX,"mousedown",function(t){return t.stopPropagation()}),e.event.bind(e.scrollbarXRail,"mousedown",function(t){var n=t.pageX-window.pageXOffset-e.scrollbarXRail.getBoundingClientRect().left,i=n>e.scrollbarXLeft?1:-1;e.element.scrollLeft+=i*e.containerWidth,ss(e),t.stopPropagation()})}function y4(e){Y_(e,["containerWidth","contentWidth","pageX","railXWidth","scrollbarX","scrollbarXWidth","scrollLeft","x","scrollbarXRail"]),Y_(e,["containerHeight","contentHeight","pageY","railYHeight","scrollbarY","scrollbarYHeight","scrollTop","y","scrollbarYRail"])}function Y_(e,t){var n=t[0],i=t[1],s=t[2],r=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8],d=e.element,h=null,f=null,p=null;function m(g){g.touches&&g.touches[0]&&(g[s]=g.touches[0].pageY),d[l]=h+p*(g[s]-f),bT(e,c),ss(e),g.stopPropagation(),g.type.startsWith("touch")&&g.changedTouches.length>1&&g.preventDefault()}function v(){_T(e,c),e[u].classList.remove(pe.state.clicking),e.event.unbind(e.ownerDocument,"mousemove",m)}function y(g,x){h=d[l],x&&g.touches&&(g[s]=g.touches[0].pageY),f=g[s],p=(e[i]-e[n])/(e[r]-e[a]),x?e.event.bind(e.ownerDocument,"touchmove",m):(e.event.bind(e.ownerDocument,"mousemove",m),e.event.once(e.ownerDocument,"mouseup",v),g.preventDefault()),e[u].classList.add(pe.state.clicking),g.stopPropagation()}e.event.bind(e[o],"mousedown",function(g){y(g)}),e.event.bind(e[o],"touchstart",function(g){y(g,!0)})}function v4(e){var t=e.element,n=function(){return Ts(t,":hover")},i=function(){return Ts(e.scrollbarX,":focus")||Ts(e.scrollbarY,":focus")};function s(r,o){var a=Math.floor(t.scrollTop);if(r===0){if(!e.scrollbarYActive)return!1;if(a===0&&o>0||a>=e.contentHeight-e.containerHeight&&o<0)return!e.settings.wheelPropagation}var l=t.scrollLeft;if(o===0){if(!e.scrollbarXActive)return!1;if(l===0&&r<0||l>=e.contentWidth-e.containerWidth&&r>0)return!e.settings.wheelPropagation}return!0}e.event.bind(e.ownerDocument,"keydown",function(r){if(!(r.isDefaultPrevented&&r.isDefaultPrevented()||r.defaultPrevented)&&!(!n()&&!i())){var o=document.activeElement?document.activeElement:e.ownerDocument.activeElement;if(o){if(o.tagName==="IFRAME")o=o.contentDocument.activeElement;else for(;o.shadowRoot;)o=o.shadowRoot.activeElement;if(f4(o))return}var a=0,l=0;switch(r.which){case 37:r.metaKey?a=-e.contentWidth:r.altKey?a=-e.containerWidth:a=-30;break;case 38:r.metaKey?l=e.contentHeight:r.altKey?l=e.containerHeight:l=30;break;case 39:r.metaKey?a=e.contentWidth:r.altKey?a=e.containerWidth:a=30;break;case 40:r.metaKey?l=-e.contentHeight:r.altKey?l=-e.containerHeight:l=-30;break;case 32:r.shiftKey?l=e.containerHeight:l=-e.containerHeight;break;case 33:l=e.containerHeight;break;case 34:l=-e.containerHeight;break;case 36:l=e.contentHeight;break;case 35:l=-e.contentHeight;break;default:return}e.settings.suppressScrollX&&a!==0||e.settings.suppressScrollY&&l!==0||(t.scrollTop-=l,t.scrollLeft+=a,ss(e),s(a,l)&&r.preventDefault())}})}function x4(e){var t=e.element;function n(o,a){var l=Math.floor(t.scrollTop),c=t.scrollTop===0,u=l+t.offsetHeight===t.scrollHeight,d=t.scrollLeft===0,h=t.scrollLeft+t.offsetWidth===t.scrollWidth,f;return Math.abs(a)>Math.abs(o)?f=c||u:f=d||h,f?!e.settings.wheelPropagation:!0}function i(o){var a=o.deltaX,l=-1*o.deltaY;return(typeof a>"u"||typeof l>"u")&&(a=-1*o.wheelDeltaX/6,l=o.wheelDeltaY/6),o.deltaMode&&o.deltaMode===1&&(a*=10,l*=10),a!==a&&l!==l&&(a=0,l=o.wheelDelta),o.shiftKey?[-l,-a]:[a,l]}function s(o,a,l){if(!ao.isWebKit&&t.querySelector("select:focus"))return!0;if(!t.contains(o))return!1;for(var c=o;c&&c!==t;){if(c.classList.contains(pe.element.consuming))return!0;var u=mi(c);if(l&&u.overflowY.match(/(scroll|auto)/)){var d=c.scrollHeight-c.clientHeight;if(d>0&&(c.scrollTop>0&&l<0||c.scrollTop0))return!0}if(a&&u.overflowX.match(/(scroll|auto)/)){var h=c.scrollWidth-c.clientWidth;if(h>0&&(c.scrollLeft>0&&a<0||c.scrollLeft0))return!0}c=c.parentNode}return!1}function r(o){var a=i(o),l=a[0],c=a[1];if(!s(o.target,l,c)){var u=!1;e.settings.useBothWheelAxes?e.scrollbarYActive&&!e.scrollbarXActive?(c?t.scrollTop-=c*e.settings.wheelSpeed:t.scrollTop+=l*e.settings.wheelSpeed,u=!0):e.scrollbarXActive&&!e.scrollbarYActive&&(l?t.scrollLeft+=l*e.settings.wheelSpeed:t.scrollLeft-=c*e.settings.wheelSpeed,u=!0):(t.scrollTop-=c*e.settings.wheelSpeed,t.scrollLeft+=l*e.settings.wheelSpeed),ss(e),u=u||n(l,c),u&&!o.ctrlKey&&(o.stopPropagation(),o.preventDefault())}}typeof window.onwheel<"u"?e.event.bind(t,"wheel",r):typeof window.onmousewheel<"u"&&e.event.bind(t,"mousewheel",r)}function b4(e){if(!ao.supportsTouch&&!ao.supportsIePointer)return;var t=e.element;function n(p,m){var v=Math.floor(t.scrollTop),y=t.scrollLeft,g=Math.abs(p),x=Math.abs(m);if(x>g){if(m<0&&v===e.contentHeight-e.containerHeight||m>0&&v===0)return window.scrollY===0&&m>0&&ao.isChrome}else if(g>x&&(p<0&&y===e.contentWidth-e.containerWidth||p>0&&y===0))return!0;return!0}function i(p,m){t.scrollTop-=m,t.scrollLeft-=p,ss(e)}var s={},r=0,o={},a=null;function l(p){return p.targetTouches?p.targetTouches[0]:p}function c(p){return p.pointerType&&p.pointerType==="pen"&&p.buttons===0?!1:!!(p.targetTouches&&p.targetTouches.length===1||p.pointerType&&p.pointerType!=="mouse"&&p.pointerType!==p.MSPOINTER_TYPE_MOUSE)}function u(p){if(c(p)){var m=l(p);s.pageX=m.pageX,s.pageY=m.pageY,r=new Date().getTime(),a!==null&&clearInterval(a)}}function d(p,m,v){if(!t.contains(p))return!1;for(var y=p;y&&y!==t;){if(y.classList.contains(pe.element.consuming))return!0;var g=mi(y);if(v&&g.overflowY.match(/(scroll|auto)/)){var x=y.scrollHeight-y.clientHeight;if(x>0&&(y.scrollTop>0&&v<0||y.scrollTop0))return!0}if(m&&g.overflowX.match(/(scroll|auto)/)){var _=y.scrollWidth-y.clientWidth;if(_>0&&(y.scrollLeft>0&&m<0||y.scrollLeft<_&&m>0))return!0}y=y.parentNode}return!1}function h(p){if(c(p)){var m=l(p),v={pageX:m.pageX,pageY:m.pageY},y=v.pageX-s.pageX,g=v.pageY-s.pageY;if(d(p.target,y,g))return;i(y,g),s=v;var x=new Date().getTime(),_=x-r;_>0&&(o.x=y/_,o.y=g/_,r=x),n(y,g)&&p.preventDefault()}}function f(){e.settings.swipeEasing&&(clearInterval(a),a=setInterval(function(){if(e.isInitialized){clearInterval(a);return}if(!o.x&&!o.y){clearInterval(a);return}if(Math.abs(o.x)<.01&&Math.abs(o.y)<.01){clearInterval(a);return}if(!e.element){clearInterval(a);return}i(o.x*30,o.y*30),o.x*=.8,o.y*=.8},10))}ao.supportsTouch?(e.event.bind(t,"touchstart",u),e.event.bind(t,"touchmove",h),e.event.bind(t,"touchend",f)):ao.supportsIePointer&&(window.PointerEvent?(e.event.bind(t,"pointerdown",u),e.event.bind(t,"pointermove",h),e.event.bind(t,"pointerup",f)):window.MSPointerEvent&&(e.event.bind(t,"MSPointerDown",u),e.event.bind(t,"MSPointerMove",h),e.event.bind(t,"MSPointerUp",f)))}var _4=function(){return{handlers:["click-rail","drag-thumb","keyboard","wheel","touch"],maxScrollbarLength:null,minScrollbarLength:null,scrollingThreshold:1e3,scrollXMarginOffset:0,scrollYMarginOffset:0,suppressScrollX:!1,suppressScrollY:!1,swipeEasing:!0,useBothWheelAxes:!1,wheelPropagation:!0,wheelSpeed:1}},w4={"click-rail":g4,"drag-thumb":y4,keyboard:v4,wheel:x4,touch:b4},Pc=function(e,t){var n=this;if(t===void 0&&(t={}),typeof e=="string"&&(e=document.querySelector(e)),!e||!e.nodeName)throw new Error("no element is specified to initialize PerfectScrollbar");this.element=e,e.classList.add(pe.main),this.settings=_4();for(var i in t)this.settings[i]=t[i];this.containerWidth=null,this.containerHeight=null,this.contentWidth=null,this.contentHeight=null;var s=function(){return e.classList.add(pe.state.focus)},r=function(){return e.classList.remove(pe.state.focus)};this.isRtl=mi(e).direction==="rtl",this.isRtl===!0&&e.classList.add(pe.rtl),this.isNegativeScroll=function(){var l=e.scrollLeft,c=null;return e.scrollLeft=-1,c=e.scrollLeft<0,e.scrollLeft=l,c}(),this.negativeScrollAdjustment=this.isNegativeScroll?e.scrollWidth-e.clientWidth:0,this.event=new la,this.ownerDocument=e.ownerDocument||document,this.scrollbarXRail=Du(pe.element.rail("x")),e.appendChild(this.scrollbarXRail),this.scrollbarX=Du(pe.element.thumb("x")),this.scrollbarXRail.appendChild(this.scrollbarX),this.scrollbarX.setAttribute("tabindex",0),this.event.bind(this.scrollbarX,"focus",s),this.event.bind(this.scrollbarX,"blur",r),this.scrollbarXActive=null,this.scrollbarXWidth=null,this.scrollbarXLeft=null;var o=mi(this.scrollbarXRail);this.scrollbarXBottom=parseInt(o.bottom,10),isNaN(this.scrollbarXBottom)?(this.isScrollbarXUsingBottom=!1,this.scrollbarXTop=Jt(o.top)):this.isScrollbarXUsingBottom=!0,this.railBorderXWidth=Jt(o.borderLeftWidth)+Jt(o.borderRightWidth),Ze(this.scrollbarXRail,{display:"block"}),this.railXMarginWidth=Jt(o.marginLeft)+Jt(o.marginRight),Ze(this.scrollbarXRail,{display:""}),this.railXWidth=null,this.railXRatio=null,this.scrollbarYRail=Du(pe.element.rail("y")),e.appendChild(this.scrollbarYRail),this.scrollbarY=Du(pe.element.thumb("y")),this.scrollbarYRail.appendChild(this.scrollbarY),this.scrollbarY.setAttribute("tabindex",0),this.event.bind(this.scrollbarY,"focus",s),this.event.bind(this.scrollbarY,"blur",r),this.scrollbarYActive=null,this.scrollbarYHeight=null,this.scrollbarYTop=null;var a=mi(this.scrollbarYRail);this.scrollbarYRight=parseInt(a.right,10),isNaN(this.scrollbarYRight)?(this.isScrollbarYUsingRight=!1,this.scrollbarYLeft=Jt(a.left)):this.isScrollbarYUsingRight=!0,this.scrollbarYOuterWidth=this.isRtl?p4(this.scrollbarY):null,this.railBorderYWidth=Jt(a.borderTopWidth)+Jt(a.borderBottomWidth),Ze(this.scrollbarYRail,{display:"block"}),this.railYMarginHeight=Jt(a.marginTop)+Jt(a.marginBottom),Ze(this.scrollbarYRail,{display:""}),this.railYHeight=null,this.railYRatio=null,this.reach={x:e.scrollLeft<=0?"start":e.scrollLeft>=this.contentWidth-this.containerWidth?"end":null,y:e.scrollTop<=0?"start":e.scrollTop>=this.contentHeight-this.containerHeight?"end":null},this.isAlive=!0,this.settings.handlers.forEach(function(l){return w4[l](n)}),this.lastScrollTop=Math.floor(e.scrollTop),this.lastScrollLeft=e.scrollLeft,this.event.bind(this.element,"scroll",function(l){return n.onScroll(l)}),ss(this)};Pc.prototype.update=function(){this.isAlive&&(this.negativeScrollAdjustment=this.isNegativeScroll?this.element.scrollWidth-this.element.clientWidth:0,Ze(this.scrollbarXRail,{display:"block"}),Ze(this.scrollbarYRail,{display:"block"}),this.railXMarginWidth=Jt(mi(this.scrollbarXRail).marginLeft)+Jt(mi(this.scrollbarXRail).marginRight),this.railYMarginHeight=Jt(mi(this.scrollbarYRail).marginTop)+Jt(mi(this.scrollbarYRail).marginBottom),Ze(this.scrollbarXRail,{display:"none"}),Ze(this.scrollbarYRail,{display:"none"}),ss(this),ah(this,"top",0,!1,!0),ah(this,"left",0,!1,!0),Ze(this.scrollbarXRail,{display:""}),Ze(this.scrollbarYRail,{display:""}))};Pc.prototype.onScroll=function(e){this.isAlive&&(ss(this),ah(this,"top",this.element.scrollTop-this.lastScrollTop),ah(this,"left",this.element.scrollLeft-this.lastScrollLeft),this.lastScrollTop=Math.floor(this.element.scrollTop),this.lastScrollLeft=this.element.scrollLeft)};Pc.prototype.destroy=function(){this.isAlive&&(this.event.unbindAll(),Mo(this.scrollbarX),Mo(this.scrollbarY),Mo(this.scrollbarXRail),Mo(this.scrollbarYRail),this.removePsClasses(),this.element=null,this.scrollbarX=null,this.scrollbarY=null,this.scrollbarXRail=null,this.scrollbarYRail=null,this.isAlive=!1)};Pc.prototype.removePsClasses=function(){this.element.className=this.element.className.split(" ").filter(function(e){return!e.match(/^ps([-_].+|)$/)}).join(" ")};const k4=({className:e,sidenav:t,tag:n="div",handlers:i=["click-rail","drag-thumb","keyboard","wheel","touch"],wheelSpeed:s=1,wheelPropagation:r=!0,swipeEasing:o=!0,minScrollbarLength:a,maxScrollbarLength:l,scrollingThreshold:c=1e3,useBothWheelAxes:u=!1,suppressScrollX:d=!1,suppressScrollY:h=!1,scrollXMarginOffset:f=0,scrollYMarginOffset:p=0,scrollBarRef:m,onScrollY:v,onScrollX:y,onScrollUp:g,onScrollDown:x,onScrollLeft:_,onScrollRight:w,onYReachStart:S,onYReachEnd:C,onXReachStart:M,onXReachEnd:P,children:T,options:A,...E})=>{const z=I(t&&"sidenav-menu",e),N=k.useRef(null),L=k.useRef(null);return k.useEffect(()=>{let R=null;const B=[],D={handlers:i,wheelSpeed:s,wheelPropagation:r,swipeEasing:o,minScrollbarLength:a,maxScrollbarLength:l,scrollingThreshold:c,useBothWheelAxes:u,suppressScrollX:d,suppressScrollY:h,scrollXMarginOffset:f,scrollYMarginOffset:p,...A};if(!N.current)return;R=N.current,L.current=new Pc(R,D);const $={"ps-scroll-y":v,"ps-scroll-x":y,"ps-scroll-up":g,"ps-scroll-down":x,"ps-scroll-left":_,"ps-scroll-right":w,"ps-y-reach-start":S,"ps-y-reach-end":C,"ps-x-reach-start":M,"ps-x-reach-end":P};return Object.keys($).forEach(F=>{const V=$[F];if(typeof V=="function"&&R){const W=()=>V(R);B.push({eventName:F,handler:W}),R.addEventListener(F,W)}}),m&&m(L.current),()=>{var F;B.forEach(V=>{R==null||R.removeEventListener(V.eventName,V.handler)}),(F=L.current)==null||F.destroy(),L.current=null}},[i,s,r,o,a,l,c,u,d,h,f,p,m,v,y,g,x,_,w,S,C,M,P,A]),b.jsx(n,{className:z,ref:N,...E,children:T})},S4=Y.createContext({color:"primary"}),M4=Y.forwardRef(({className:e,children:t,...n},i)=>{const s=I("sidenav-menu",e);return b.jsx("ul",{className:s,ref:i,...n,children:t})});M4.displayName="MDBSideNavMenu";const C4=Y.forwardRef(({className:e,children:t,...n},i)=>{const s=I("sidenav-item",e);return b.jsx("li",{className:s,ref:i,...n,children:t})});C4.displayName="MDBSideNavItem";const P4=Y.forwardRef(({className:e,icon:t,iconClasses:n,iconAngle:i=180,shouldBeExpanded:s,children:r,active:o,tag:a="a",...l},c)=>{const{color:u}=k.useContext(S4),d=I("sidenav-link",o&&"active",e),h=I("rotate-icon",n),[f,p]=k.useState(s?i:0);return k.useEffect(()=>{p(s?i:0)},[s,i]),b.jsxs(v0,{rippleTag:a,onKeyDown:m=>{m.key==="Enter"&&m.target.click()},tabIndex:1,rippleColor:u,className:d,ref:c,...l,children:[r,t&&b.jsx(sn,{icon:t,style:{transform:`rotate(${f}deg)`},className:h})]})});P4.displayName="MDBSideNavLink";const kT=Y.forwardRef(({className:e,centered:t,children:n,size:i,scrollable:s,tag:r="div",...o},a)=>{const l=I("modal-dialog",s&&"modal-dialog-scrollable",t&&"modal-dialog-centered",i&&`modal-${i}`,e);return b.jsx(r,{className:l,...o,ref:a,children:n})});kT.displayName="MDBModalDialog";const T4=Y.forwardRef(({className:e,side:t,frame:n,position:i,children:s,tag:r="div",...o},a)=>{const l=I(t&&"modal-side",n&&"modal-frame",i&&`modal-${i}`,e);return b.jsx(kT,{className:l,...o,tag:r,ref:a,children:s})});T4.displayName="MDBModalDialog";const nf=Y.createContext({onDatetimepickerModeSwitch:()=>null,isInDatetimepicker:!1,setInputValue:null,setActiveHour:null,setActiveMinute:null,setPeriod:null,setMode:null,setHandAnimation:null,setMinuteAngle:null,setHourAngle:null,submitLabel:"",clearLabel:"",cancelLabel:"",activeHour:12,activeMinute:12,format:"12h",period:"",defaultValue:"",minHour:0,maxHour:23,minPeriod:"",maxPeriod:"",mode:"hours",handAnimation:!1,maxMinute:59,minMinute:0,minuteAngle:360,hourAngle:360,inline:!1,increment:!1,onChange:()=>null,onOpen:()=>null,onClose:()=>null,onCloseHandler:()=>null,amLabel:"AM",pmLabel:"PM",switchHoursToMinutesOnClick:!0,headId:"",bodyId:""}),ld=e=>{const t=e.split(":"),n=t[0],i=t[1].split(" ")[1],s=t[1].split(" ")[0];return{hour:parseInt(n),minute:parseInt(s),defaultPeriod:i}},X_=(e,t)=>(t==="24h"?/^([01]\d|2[0-3])(:[0-5]\d)$/:/^(0?[1-9]|1[012])(:[0-5]\d) [APap][mM]$/).test(e),Ki=(e,t,n,i,s,r)=>{let o=!1;return t&&(s!==""?e>t&&i===s&&(o=!0):e>t&&(o=!0)),n&&(r!==""?eKi(i,s,r,o,a,l)&&(n===t||n===e),D4=(e,t,n)=>{t.split(" ").forEach(i=>{e.addEventListener(i,n)})},E4=(e,t,n)=>{t.split(" ").forEach(i=>{e.removeEventListener(i,n)})},ST=(e,t)=>{const n=t.x-e.x,i=t.y-e.y;return Math.sqrt(n*n+i*i)},A4=(e,t)=>{const n=2*Math.atan2(t.y-e.y-ST(e,t),t.x-e.x);return Math.abs(n*180/Math.PI)},K_=e=>({radius:(e-32)/2-4}),O4=e=>{const t=new Date;let n=t.getHours();const i=t.getMinutes();if(e==="24h")return{hours:n,minutes:i,period:""};const s=n>=12?"PM":"AM";return n=n%12,n=n||12,{hours:n,minutes:i,period:s}},xp=(e,t)=>{const n=e.getMinutes();let i=e.getHours(),s;i===24&&(i=0);const r=i>=12?"PM":"AM";return t=="24h"?s=i<10?`0${i}:${n}`:`${i}:${n}`:t=="12h"&&(s=`${(i+24)%12||12}:${n} ${r}`),s},ig=Y.forwardRef(({...e},t)=>{const{activeHour:n,format:i,period:s,setPeriod:r,mode:o,setMode:a,activeMinute:l,setHandAnimation:c,inline:u,setActiveHour:d,setActiveMinute:h,maxHour:f,maxMinute:p,minHour:m,minMinute:v,maxPeriod:y,minPeriod:g,setInputValue:x,increment:_,submitLabel:w,onChange:S,onCloseHandler:C,amLabel:M,pmLabel:P,headId:T,show:A,onDatetimepickerModeSwitch:E,isInDatetimepicker:z}=k.useContext(nf),N=D=>{a(D),c(!0)},L=()=>{if(Ki(n,f,m,s,y,g)||Ki(l,p,v,s,y,g)||!A)return;C==null||C();const D=n===24?"00":n<10?`0${n}`:n,$=l<10?`0${l}`:l,F=`${D}:${$} ${s}`.trim();x(F),S==null||S(F)},R=(D,$)=>{const F=i==="12h"?12:24;if($.type==="click")return d(D?V=>V===F?1:V+1:V=>V===1?F:V-1);if($.type==="mousedown"){const V=setTimeout(()=>{const et=setInterval(()=>{d(D?O=>O===F?1:O+1:O=>O===1?F:O-1)},100),Z=()=>{clearInterval(et),document.removeEventListener("mouseup",Z)};document.addEventListener("mouseup",Z)},300),W=()=>{clearTimeout(V),document.removeEventListener("mouseup",W)};document.addEventListener("mouseup",W)}},B=(D,$)=>{const F=_?55:59,V=_?5:1;if($.type==="click")return h(D?W=>W>=F?0:W+V:W=>W-V<0?F:W-V);if($.type==="mousedown"){const W=setTimeout(()=>{const Z=setInterval(()=>{h(D?U=>U>=F?0:U+V:U=>U-V<0?F:U-V)},100),O=()=>{clearInterval(Z),document.removeEventListener("mouseup",O)};document.addEventListener("mouseup",O)},300),et=()=>{clearTimeout(W),document.removeEventListener("mouseup",et)};document.addEventListener("mouseup",et)}};return u?b.jsx("div",{id:T,className:"timepicker-head d-flex flex-row align-items-center justify-content-center timepicker-head-inline",style:{paddingRight:"0px"},ref:t,...e,children:b.jsxs("div",{className:"timepicker-head-content d-flex w-100 justify-content-evenly align-items-center",children:[b.jsxs("div",{className:"timepicker-current-wrapper",children:[b.jsxs("span",{className:"position-relative h-100 timepicker-inline-hour-icons",children:[b.jsx(sn,{fas:!0,icon:"chevron-up",style:{display:"flex"},className:"position-absolute text-white timepicker-icon-up timepicker-icon-inline-hour",onClick:D=>R(!0,D),onMouseDown:D=>R(!0,D)}),b.jsx(Zt,{type:"button",color:"none",onClick:()=>{N("hours")},className:`timepicker-current timepicker-current-inline timepicker-hour ${o==="hours"&&"active"}`,tabIndex:0,style:{pointerEvents:o==="hours"?"none":void 0},onFocus:()=>{N("hours")},children:n===24?"00":n<10?`0${n}`:n}),b.jsx(sn,{fas:!0,icon:"chevron-down",style:{display:"flex"},className:"position-absolute text-white timepicker-icon-down timepicker-icon-inline-hour",onClick:D=>R(!1,D),onMouseDown:D=>R(!1,D)})]}),b.jsx(Zt,{color:"none",className:"timepicker-dot timepicker-current-inline",disabled:!0,children:":"}),b.jsxs("span",{className:"position-relative h-100 timepicker-inline-minutes-icons",children:[b.jsx(sn,{fas:!0,icon:"chevron-up",style:{display:"flex"},className:"position-absolute text-white timepicker-icon-up timepicker-icon-inline-minute",onClick:D=>B(!0,D),onMouseDown:D=>B(!0,D)}),b.jsx(Zt,{onClick:()=>{N("minutes")},type:"button",color:"none",className:`timepicker-current timepicker-current-inline timepicker-minute ${o==="minutes"&&"active"}`,tabIndex:0,style:{pointerEvents:o==="minutes"?"none":void 0},onFocus:()=>{N("minutes")},children:l<10?`0${l}`:l}),b.jsx(sn,{fas:!0,icon:"chevron-down",style:{display:"flex"},className:"position-absolute text-white timepicker-icon-down timepicker-icon-inline-minute",onClick:D=>B(!1,D),onMouseDown:D=>B(!1,D)})]})]}),b.jsxs("div",{className:"d-flex justify-content-center timepicker-mode-wrapper",children:[i==="12h"&&b.jsxs(b.Fragment,{children:[b.jsx(Zt,{onClick:()=>r("AM"),type:"button",color:"none",className:`timepicker-hour-mode timepicker-am me-2 ms-4 ${s.toLowerCase()==="am"&&"active"}`,tabIndex:0,children:M}),b.jsx(Zt,{onClick:()=>r("PM"),type:"button",color:"none",className:`timepicker-hour-mode timepicker-pm ${s.toLowerCase()==="pm"&&"active"}`,tabIndex:0,children:P})]}),b.jsx(Zt,{type:"button",color:"none",className:"timepicker-button timepicker-submit timepicker-submit-inline py-1 px-2 mb-0",tabIndex:0,onClick:L,children:w})]})]})}):b.jsxs(b.Fragment,{children:[b.jsx("div",{id:T,className:"timepicker-head d-flex flex-row align-items-center justify-content-center",style:{paddingRight:"0px"},ref:t,...e,children:b.jsxs("div",{className:"timepicker-head-content d-flex w-100 justify-content-evenly",style:{paddingRight:i==="24h"?"50px":""},children:[b.jsxs("div",{className:"timepicker-current-wrapper",children:[b.jsx("span",{className:"position-relative h-100",children:b.jsx(Zt,{type:"button",color:"none",onClick:()=>{N("hours")},className:`timepicker-current timepicker-hour ${o==="hours"&&"active"}`,tabIndex:0,style:{pointerEvents:o==="hours"?"none":void 0},children:n===24?"00":n<10?`0${n}`:n})}),b.jsx(Zt,{color:"none",className:"timepicker-dot",disabled:!0,children:":"}),b.jsx("span",{className:"position-relative h-100",children:b.jsx(Zt,{onClick:()=>{N("minutes")},type:"button",color:"none",className:`timepicker-current timepicker-minute ${o==="minutes"&&"active"}`,tabIndex:0,style:{pointerEvents:o==="minutes"?"none":void 0},children:l<10?`0${l}`:l})})]}),i==="12h"&&b.jsxs("div",{className:"d-flex flex-column justify-content-center timepicker-mode-wrapper",children:[b.jsx(Zt,{onClick:()=>r("AM"),type:"button",color:"none",className:`timepicker-hour-mode timepicker-am ${s.toLowerCase()==="am"&&"active"}`,tabIndex:0,children:M}),b.jsx(Zt,{onClick:()=>r("PM"),type:"button",color:"none",className:`timepicker-hour-mode timepicker-pm ${s.toLowerCase()==="pm"&&"active"}`,tabIndex:0,children:P})]})]})}),z&&b.jsxs("div",{className:"buttons-container",children:[b.jsx("button",{type:"button",className:"datepicker-button-toggle",onClick:E,children:b.jsx("i",{className:"far fa-calendar datepicker-toggle-icon"})}),b.jsx("button",{type:"button",className:"timepicker-button-toggle",children:b.jsx("i",{className:"far fa-clock fa-sm timepicker-icon"})})]})]})});ig.displayName="MDBTimePickerHeader";const bp={hours:[{value:1,left:"169px",bottom:"209.263px",angle:30,id:`hour-1-${Math.floor(Math.random()*1001)}`},{value:2,left:"209.263px",bottom:"169px",angle:60,id:`hour-2-${Math.floor(Math.random()*1001)}`},{value:3,left:"224px",bottom:"114px",angle:90,id:`hour-3-${Math.floor(Math.random()*1001)}`},{value:4,left:"209.263px",bottom:"59px",angle:120,id:`hour-4-${Math.floor(Math.random()*1001)}`},{value:5,left:"169px",bottom:"18.7372px",angle:150,id:`hour-5-${Math.floor(Math.random()*1001)}`},{value:6,left:"114px",bottom:"4px",angle:180,id:`hour-6-${Math.floor(Math.random()*1001)}`},{value:7,left:"59px",bottom:"18.7372px",angle:210,id:`hour-7-${Math.floor(Math.random()*1001)}`},{value:8,left:"18.7372px",bottom:"59px",angle:240,id:`hour-8-${Math.floor(Math.random()*1001)}`},{value:9,left:"4px",bottom:"114px",angle:270,id:`hour-9-${Math.floor(Math.random()*1001)}`},{value:10,left:"18.7372px",bottom:"169px",angle:300,id:`hour-10-${Math.floor(Math.random()*1001)}`},{value:11,left:"59px",bottom:"209.263px",angle:330,id:`hour-11-${Math.floor(Math.random()*1001)}`},{value:12,left:"114px",bottom:"224px",angle:360,id:`hour-12-${Math.floor(Math.random()*1001)}`},{value:13,left:"94px",bottom:"115.962px",angle:30,id:`hour-13-${Math.floor(Math.random()*1001)}`},{value:14,left:"115.962px",bottom:"94px",angle:60,id:`hour-14-${Math.floor(Math.random()*1001)}`},{value:15,left:"124px",bottom:"64px",angle:90,id:`hour-15-${Math.floor(Math.random()*1001)}`},{value:16,left:"115.962px",bottom:"34px",angle:120,id:`hour-16-${Math.floor(Math.random()*1001)}`},{value:17,left:"94px",bottom:"12.0385px",angle:150,id:`hour-17-${Math.floor(Math.random()*1001)}`},{value:18,left:"64px",bottom:"4px",angle:180,id:`hour-18-${Math.floor(Math.random()*1001)}`},{value:19,left:"34px",bottom:"12.0385px",angle:210,id:`hour-19-${Math.floor(Math.random()*1001)}`},{value:20,left:"12.0385px",bottom:"34px",angle:240,id:`hour-20-${Math.floor(Math.random()*1001)}`},{value:21,left:"4px",bottom:"64px",angle:270,id:`hour-21-${Math.floor(Math.random()*1001)}`},{value:22,left:"12.0385px",bottom:"94px",angle:300,id:`hour-22-${Math.floor(Math.random()*1001)}`},{value:23,left:"34px",bottom:"115.962px",angle:330,id:`hour-23-${Math.floor(Math.random()*1001)}`},{value:24,left:"64px",bottom:"124px",angle:360,id:`hour-0-${Math.floor(Math.random()*1001)}`}],minutes:[{value:0,left:"114px",bottom:"224px",angle:360,id:`minute-0-${Math.floor(Math.random()*1001)}`},{value:5,left:"169px",bottom:"209.263px",angle:30,id:`minute-5-${Math.floor(Math.random()*1001)}`},{value:10,left:"209.263px",bottom:"169px",angle:60,id:`minute-10-${Math.floor(Math.random()*1001)}`},{value:15,left:"224px",bottom:"114px",angle:90,id:`minute-15-${Math.floor(Math.random()*1001)}`},{value:20,left:"209.263px",bottom:"59px",angle:120,id:`minute-20-${Math.floor(Math.random()*1001)}`},{value:25,left:"169px",bottom:"18.7372px",angle:150,id:`minute-25-${Math.floor(Math.random()*1001)}`},{value:30,left:"114px",bottom:"4px",angle:180,id:`minute-30-${Math.floor(Math.random()*1001)}`},{value:35,left:"59px",bottom:"18.7372px",angle:210,id:`minute-35-${Math.floor(Math.random()*1001)}`},{value:40,left:"18.7372px",bottom:"59px",angle:240,id:`minute-40-${Math.floor(Math.random()*1001)}`},{value:45,left:"4px",bottom:"114px",angle:270,id:`minute-45-${Math.floor(Math.random()*1001)}`},{value:50,left:"18.7372px",bottom:"169px",angle:300,id:`minute-50-${Math.floor(Math.random()*1001)}`},{value:55,left:"59px",bottom:"209.263px",angle:330,id:`minute-55-${Math.floor(Math.random()*1001)}`}]},MT=Y.forwardRef(({...e},t)=>{const n=k.useRef(null),i=k.useRef(null),[s,r]=k.useState(!1),[o,a]=k.useState(0),[l,c]=k.useState(0),{setActiveHour:u,format:d,activeHour:h,minHour:f,maxHour:p,minPeriod:m,maxPeriod:v,period:y,mode:g,setMode:x,activeMinute:_,setActiveMinute:w,setHandAnimation:S,handAnimation:C,maxMinute:M,minMinute:P,hourAngle:T,setHourAngle:A,minuteAngle:E,setMinuteAngle:z,increment:N,switchHoursToMinutesOnClick:L,bodyId:R}=k.useContext(nf),B=d==="24h"?bp.hours:bp.hours.filter(O=>O.value<13&&O.value!==0),D=bp.minutes,[$,F]=k.useState("calc(40% + 1px)"),V=k.useCallback(A4,[]),W=O=>{O.preventDefault(),r(!0)},et=O=>{O.preventDefault(),r(!1),g==="hours"&&(L&&x("minutes"),S(!0))},Z=k.useCallback(O=>{var U;const{width:lt,top:ct,left:kt}=(U=n.current)==null?void 0:U.getBoundingClientRect(),{clientX:it,clientY:Lt}="touches"in O?O.touches[0]:O,Ct={x:lt/2,y:-lt/2},Qt={x:it-kt,y:ct-Lt},ft=Math.round(V(Ct,Qt)+360)%360;if(g==="hours"){const wt=30*Math.round(ft/30);let dt=wt/30;if(d==="24h"){const{radius:jt}=K_(o),{radius:pt}=K_(l);ST(Ct,Qt)<(jt+pt)/2-16&&(dt+=12)}Ki(dt,p,f,y,v,m)||(u(dt),A(wt))}else if(ft===0)vp(f,p,h,0,M,P,y,v,m)||(w(0),z(360));else{const wt=N?30:6,dt=wt*Math.round(ft/wt);vp(f,p,h,dt/6,M,P,y,v,m)||(w(dt/6===60?0:dt/6),z(dt))}},[V,h,M,P,v,m,g,y,w,p,f,u,l,o,d,A,z,N]);return k.useEffect(()=>{n.current&&a(n.current.offsetWidth),i.current&&c(i.current.offsetWidth)},[]),k.useEffect(()=>(s&&D4(document,"mouseup mousemove mouseleave mouseover touchstart touchmove touchend",Z),()=>{E4(document,"mouseup mousemove mouseleave mouseover touchstart touchmove touchend",Z)}),[s,Z]),k.useEffect(()=>{const O=B.find(U=>U.value===h);O!==void 0&&(O.value>12||O.value===24?F("21.5%"):F("calc(40% + 1px)"))},[B,h]),b.jsx("div",{id:R,className:"timepicker-clock-wrapper d-flex justify-content-center flex-column align-items-center",ref:t,...e,children:b.jsxs("div",{onMouseDown:O=>W(O),onMouseUp:O=>et(O),ref:n,className:"timepicker-clock timepicker-clock-animation",children:[b.jsx("span",{className:"timepicker-middle-dot position-absolute"}),b.jsx("div",{className:`timepicker-hand-pointer position-absolute ${C&&"timepicker-transform"}`,style:{transform:`rotateZ(${g==="hours"?T:E}deg)`,height:g==="hours"?$:"calc(40% + 1px)"},children:b.jsx("div",{className:"timepicker-circle position-absolute",style:{backgroundColor:"rgb(25, 118, 210)"}})}),g==="hours"&&d==="24h"&&b.jsx("div",{ref:i,className:"timepicker-clock-inner",children:B.map(O=>{if(O.value>12||O.value===0)return b.jsx("span",{id:O.id,className:`timepicker-time-tips-inner ${Ki(O.value,p,f,y,v,m)&&"disabled"} ${O.value===h&&"active"}`,style:{left:O.left,bottom:O.bottom},children:b.jsx("span",{className:"timepicker-tips-inner-element",children:O.value===24?"00":O.value})},O.id)})}),g==="hours"&&B.map(O=>{if(d==="24h"){if(O.value<13&&O.value!==0)return b.jsx("span",{id:O.id,className:`timepicker-time-tips-hours ${Ki(O.value,p,f,y,v,m)&&"disabled"} ${O.value===h&&"active"}`,style:{left:O.left,bottom:O.bottom},children:b.jsx("span",{className:"timepicker-tips-element",children:O.value})},O.id)}else return b.jsx("span",{id:O.id,className:`timepicker-time-tips-hours ${Ki(O.value,p,f,y,v,m)&&"disabled"} ${O.value===h&&"active"}`,style:{left:O.left,bottom:O.bottom},children:b.jsx("span",{className:"timepicker-tips-element",children:O.value})},O.id)}),g==="minutes"&&D.map(O=>b.jsx("span",{id:O.id,className:`timepicker-time-tips-minutes ${vp(f,p,h,O.value,M,P,y,v,m)&&"disabled"} ${_===O.value&&"active"}`,style:{left:O.left,bottom:O.bottom},children:b.jsx("span",{className:"timepicker-tips-element",children:O.value<10?`0${O.value}`:O.value})},O.id))]})})});MT.displayName="MDBTimePickerClock";const CT=Y.forwardRef(({...e},t)=>{const{setInputValue:n,cancelLabel:i,submitLabel:s,clearLabel:r,activeHour:o,period:a,activeMinute:l,maxHour:c,maxMinute:u,minHour:d,minMinute:h,maxPeriod:f,minPeriod:p,defaultValue:m,setActiveHour:v,setActiveMinute:y,setPeriod:g,format:x,setHourAngle:_,setMinuteAngle:w,onChange:S,onCloseHandler:C,setMode:M}=k.useContext(nf);return b.jsx("div",{className:"timepicker-footer",ref:t,...e,children:b.jsxs("div",{className:"w-100 d-flex justify-content-between",children:[b.jsx(Zt,{onClick:()=>{if(m!==""&&m!==void 0){const{hour:P,minute:T,defaultPeriod:A}=ld(m);x==="24h"?(v(P===0?24:P),P===0?_(360):P>12?_((P-12)*30):_(P*30)):(v(P),_(P*30),g(A)),y(T),w(T*6),n(m),S==null||S(m)}else v(12),_(360),y(0),w(360),n(""),S==null||S(""),g(x==="24h"?"":"AM");M("hours")},type:"button",color:"none",className:"timepicker-button timepicker-clear",tabIndex:0,children:r}),b.jsx(Zt,{onClick:()=>C==null?void 0:C(),type:"button",color:"none",className:"timepicker-button timepicker-cancel",tabIndex:0,children:i}),b.jsx(Zt,{onClick:()=>{if(Ki(o,c,d,a,f,p)||Ki(l,u,h,a,f,p))return;C==null||C();const P=o===24?"00":o<10?`0${o}`:o,T=l<10?`0${l}`:l,A=`${P}:${T} ${a}`.trim();n(A),S==null||S(A)},type:"button",color:"none",className:"timepicker-button timepicker-submit",tabIndex:0,children:s})]})})});CT.displayName="MDBTimePickerFooter";const L4=({isOpen:e,inline:t})=>{k.useEffect(()=>{if(t)return;const n=window.innerWidth>document.documentElement.clientWidth&&window.innerWidth>=576,i=`${window.innerWidth-document.documentElement.clientWidth}px`;return e&&n?(document.body.style.overflow="hidden",document.body.style.paddingRight=i):(document.body.style.overflow="",document.body.style.paddingRight=""),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[e,t])},R4=({className:e,isOpen:t,wrapperRef:n,inline:i,referenceElement:s,onOpened:r,onClosed:o})=>{const[a,l]=k.useState(null),c=I("timepicker-modal",!i&&"position-fixed",e),u=I("timepicker-wrapper","animation","h-100","d-flex","align-items-center","justify-content-center","flex-column",i?"timepicker-wrapper-inline":"position-fixed","fade",t&&"show"),{styles:d,attributes:h}=Oh(s,a,{placement:"bottom-start"}),f=p=>{p.opacity===0?o():r()};return L4({isOpen:t,inline:i}),b.jsx(b.Fragment,{children:b.jsx(aa,{children:b.jsx(Zy,{children:t&&(i?b.jsx(Jo.div,{className:c,style:d.popper,...h.popper,role:"dialog",ref:l,tabIndex:-1,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onAnimationComplete:p=>f(p),children:b.jsx("div",{ref:n,className:u,children:b.jsx("div",{className:"d-flex align-items-center justify-content-center flex-column shadow timepicker-container",style:{overflowY:"inherit"},children:b.jsx("div",{className:"d-flex flex-column timepicker-elements justify-content-around timepicker-elements-inline",children:b.jsx(ig,{})})})})}):b.jsx(Jo.div,{className:c,role:"dialog",tabIndex:-1,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},onAnimationComplete:p=>f(p),children:b.jsx("div",{ref:n,className:u,children:b.jsxs("div",{className:"d-flex align-items-center justify-content-center flex-column shadow timepicker-container",children:[b.jsxs("div",{className:"d-flex flex-column timepicker-elements justify-content-around",children:[b.jsx(ig,{}),b.jsx(MT,{})]}),b.jsx(CT,{})]})})}))})})})},G_=(e,t,n,i,s)=>{const r=n?55:59,o=n?5:1;let a;s?a=i>=r?0:i+o:a=i<=0?r:i-o,e(a),t(a*6)},Au=(e,t,n,i,s,r)=>{if(r&&e==="24h"){let l=t;r==="isLeft"&&(l=t<=12?t+12:t),r==="isRight"&&(l=t>12?t-12:t),n(l),i(l*30);return}const o=e==="12h"?12:24;let a=t===1?o:t-1;s?a=t===o?1:t+1:a=t===1?o:t-1,n(a),i(a*30)},q_=(e,t,n)=>{const i=n==null?void 0:n.querySelectorAll('[tabindex="0"]');i&&i[t]&&(i[t].focus(),t===i.length-1?e(0):e(t+1))},N4=(e,t,n,i,s,r)=>{var o;!t&&e.target===n&&r&&(r==null||r()),t&&e.target!==n&&!(n!=null&&n.contains(e.target))&&e.target!==(i==null?void 0:i.parentNode)&&!((o=i==null?void 0:i.parentNode)!=null&&o.contains(e.target))&&s&&(r==null||r())},Q_="ArrowLeft",Z_="ArrowUp",J_="ArrowRight",tw="ArrowDown",ew="Enter",nw="Escape",iw="Tab",PT=k.forwardRef(({isInDatetimepicker:e,onDatetimepickerModeSwitch:t,datetimepickerRef:n,className:i,defaultValue:s,value:r,minHour:o,maxHour:a,maxTime:l,minTime:c,noIcon:u=!1,inputID:d,justInput:h=!1,inputClasses:f,inputLabel:p,invalidLabel:m,clearLabel:v,submitLabel:y,cancelLabel:g,format:x="12h",timePickerClasses:_,customIcon:w="far fa-clock",customIconSize:S="sm",btnIcon:C=!0,inline:M=!1,increment:P=!1,onChange:T,inputStyle:A,onOpen:E,onOpened:z,onClose:N,onClosed:L,disableFuture:R,disablePast:B,disabled:D=!1,amLabel:$="AM",pmLabel:F="PM",switchHoursToMinutesOnClick:V=!0,headId:W="",bodyId:et="",open:Z,style:O,...U},lt)=>{const ct=k.useMemo(()=>s instanceof Date?xp(s,x):s,[]),kt=k.useMemo(()=>r instanceof Date?xp(r,x):r,[r,x]),[it,Lt]=k.useState(!1),[Ct,Qt]=k.useState(!1),ft=ef(Ct,Z),[wt,dt]=k.useState(kt||ct||""),[jt,pt]=k.useState(!1),[xt,J]=k.useState(12),[mt,q]=k.useState(0),[ye,Dt]=k.useState(x==="24h"?"":"AM"),[he,Un]=k.useState(a||24),[Yn,Mn]=k.useState(o||1),[Si,dn]=k.useState(59),[Mi,as]=k.useState(0),[ls,Ci]=k.useState(""),[Pi,Ke]=k.useState(""),[Xn,Ti]=k.useState("hours"),[j,Q]=k.useState(!1),[It,nt]=k.useState(360),[Tt,Oe]=k.useState(360),[cs,ai]=k.useState(null),[Kn,Me]=k.useState(0);s instanceof Date&&(s=xp(s,x));const Kr=k.useId(),Gr=d??Kr,Cn={input:p??"Select a time",invalid:m??"Invalid Time Format",clear:v??"Clear",submit:y??"Ok",cancel:g??"Cancel"},ca=I("timepicker",i),Dc=I("timepicker-input",jt&&"is-invalid",f),sf=k.useRef(null),G=k.useRef(null),X=k.useRef(null),rt=k.useRef(null);k.useImperativeHandle(lt,()=>rt.current,[rt]);const ht=Rt=>{dt(Rt.target.value),T==null||T(Rt.target.value)},hn=Rt=>{h&&(Rt.target.blur(),E==null||E())},us=k.useCallback(()=>{Qt(!1),N==null||N()},[N]),Ge=k.useCallback(()=>{Qt(!0),E==null||E()},[E]),fn=k.useCallback(()=>{Lt(!1),L==null||L(),Ti("hours"),Me(0)},[L]),NT=k.useCallback(()=>{Lt(!0),z==null||z()},[z]),rf=k.useCallback(Rt=>{it&&N4(Rt,M,X.current,rt.current,ft,us)},[X,M,rt,ft,us,it]),of=k.useCallback(Rt=>{var Pn,pn;const{key:A0}=Rt,ua=document.activeElement,jT=ua===((Pn=X.current)==null?void 0:Pn.querySelector(".timepicker-hour")),$T=ua===((pn=X.current)==null?void 0:pn.querySelector(".timepicker-minute")),IT=ua==null?void 0:ua.closest('.timepicker-modal [tabindex="0"]');if(![tw,Z_,nw,iw,ew,Q_,J_].includes(A0))return;M&&!IT&&q_(Me,0,X.current),Rt.preventDefault();const Ec=!M&&Xn==="hours"||M&&jT,O0=!M&&Xn==="minutes"||M&&$T;switch(A0){case nw:return N==null?void 0:N();case Z_:if(Ec)return Au(x,xt,J,nt,!0);if(O0)return G_(q,Oe,P,mt,!0);break;case tw:if(Ec)return Au(x,xt,J,nt,!1);if(O0)return G_(q,Oe,P,mt,!1);break;case Q_:if(Ec&&!M)return Au(x,xt,J,nt,!1,"isLeft");break;case J_:if(Ec&&!M)return Au(x,xt,J,nt,!0,"isRight");break;case iw:q_(Me,Kn,X.current);break;case ew:ua.click();break}},[xt,x,Xn,mt,P,M,Kn,N]);return k.useEffect(()=>{if(!B&&!R)return;const{hours:Rt,minutes:Pn,period:pn}=O4(x);if(B)return Mn(Rt),as(Pn),Ci(pn);if(R)return Un(Rt),dn(Pn),Ke(pn)},[R,B,x]),k.useEffect(()=>(ft&&it&&(document.addEventListener("click",rf),document.addEventListener("keydown",of)),()=>{document.removeEventListener("click",rf),document.removeEventListener("keydown",of)}),[ft,it,rf,of]),k.useEffect(()=>{if(l){const{hour:Rt,minute:Pn,defaultPeriod:pn}=ld(l);Un(Rt),dn(Pn),pn!==void 0&&Ke(pn)}if(c){const{hour:Rt,minute:Pn,defaultPeriod:pn}=ld(c);Mn(Rt),as(Pn),pn!==void 0&&Ci(pn)}},[l,c]),k.useEffect(()=>{typeof r=="string"&&r&&X_(r,x)&&dt(r)},[r,x]),k.useEffect(()=>{if(X_(wt,x)||wt===""){if(pt(!1),wt!==""){const{hour:Rt,minute:Pn,defaultPeriod:pn}=ld(wt);x==="24h"?(J(Rt===0?24:Rt),Rt===0?nt(360):Rt>12?nt((Rt-12)*30):nt(Rt*30)):(J(Rt),nt(Rt*30),Dt(pn)),q(Pn),Oe(Pn*6)}}else pt(!0)},[wt,x]),k.useEffect(()=>{let Rt;return j&&(Rt=setTimeout(()=>{Q(!1)},400)),()=>{clearTimeout(Rt)}},[j]),b.jsx(b.Fragment,{children:b.jsx(nf.Provider,{value:{isInDatetimepicker:e,onDatetimepickerModeSwitch:t,show:ft,setInputValue:dt,submitLabel:Cn.submit,clearLabel:Cn.clear,cancelLabel:Cn.cancel,activeHour:xt,activeMinute:mt,setActiveHour:J,setActiveMinute:q,format:x,period:ye,setPeriod:Dt,defaultValue:s,maxHour:he,minHour:Yn,maxPeriod:Pi,minPeriod:ls,mode:Xn,setMode:Ti,setHandAnimation:Q,handAnimation:j,minMinute:Mi,maxMinute:Si,hourAngle:It,setHourAngle:nt,minuteAngle:Tt,setMinuteAngle:Oe,inline:M,increment:P,onChange:T,onOpen:E,onClose:N,onCloseHandler:us,amLabel:$,pmLabel:F,switchHoursToMinutesOnClick:V,headId:W,bodyId:et},children:b.jsxs(b.Fragment,{children:[b.jsx("div",{className:ca,ref:M?ai:sf,style:{...O,height:"fit-content"},...U,children:!e&&b.jsx(wi,{onFocus:hn,ref:rt,labelRef:G,className:Dc,label:Cn.input,id:Gr,value:wt,onChange:ht,wrapperClass:"timepicker",style:A,disabled:D,onClick:()=>{h&&Ge()},children:!h&&!u&&(C?b.jsx(Zt,{className:"timepicker-toggle-button",onClick:Ge,color:"none",tabIndex:0,type:"button",disabled:D,style:{pointerEvents:D?"none":"auto"},children:b.jsx("i",{className:`${w} ${S} timepicker-icon`})}):b.jsx("i",{onClick:Ge,className:`${w} ${S} timepicker-icon timepicker-toggle-button`}))})}),b.jsx(R4,{isOpen:ft,wrapperRef:X,referenceElement:n||cs,inline:M,className:_,onClosed:fn,onOpened:NT})]})})})});PT.displayName="MDBTimepicker";const j4=({className:e,dropdown:t,children:n,styles:i,attributes:s,setPopperElement:r,style:o,onClosed:a,onOpened:l})=>{const c={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3}},u=I("datepicker-dropdown-container",e),d=I("datepicker-modal-container",e),h=f=>{f.opacity===0?a==null||a():l==null||l()};return b.jsx(b.Fragment,{children:t?b.jsx(Jo.div,{style:{position:"absolute",zIndex:1065,...i.popper},...s.popper,ref:r,className:u,tabIndex:-1,...c,onAnimationComplete:f=>h(f),children:n}):b.jsx(Jo.div,{...c,className:d,style:o,onAnimationComplete:f=>h(f),children:n})})},Ce={closeOnEsc:!0,title:"Select date",okBtnText:"Ok",clearBtnText:"Clear",cancelBtnText:"Cancel",customIcon:"far fa-calendar",customHeader:"",inputLabel:"Select a date",monthsFull:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],views:"days",format:"dd/mm/yyyy",weekdaysFull:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysNarrow:["S","M","T","W","T","F","S"],startDay:0};function Te(e){return e.getDate()}function sw(e){return e.getDay()}function Pt(e){return e.getMonth()}function ot(e){return e.getFullYear()}function $4(e,t,n){const i=n,s=i>0?7-i:0,r=new Date(e,t).getDay()+s;return r>=7?r-7:r}function I4(e){return e.getDate()===rc(e)}function sg(e){return I4(e)?rc(new Date(ot(e),Pt(e)+1,1)):Te(e)}function rc(e){return F4(e).getDate()}function F4(e){return Or(e.getFullYear(),e.getMonth()+1,0)}function Ro(){return new Date}function Ln(e,t){return Je(e,t*12)}function Je(e,t){const n=Or(e.getFullYear(),e.getMonth()+t,e.getDate()),i=Te(e),s=Te(n);return i!==s&&n.setDate(0),n}function eo(e,t){return Or(e.getFullYear(),e.getMonth(),e.getDate()+t)}function Or(e,t,n){const i=new Date(e,t,n);return e>=0&&e<100&&i.setFullYear(i.getFullYear()-1900),i}function rg(e){return!Number.isNaN(e.getTime())}function rw(e,t){return ot(e)-ot(t)||Pt(e)-Pt(t)||Te(e)-Te(t)}function vs(e,t){return e.setHours(0,0,0,0),t.setHours(0,0,0,0),e.getTime()===t.getTime()}function ow(e){return parseInt(e,10)<10?`0${e}`:e}function og(e,t){const n=ot(e)-TT(0,null,null);return B4(n,t)}function B4(e,t){return(e%t+t)%t}function TT(e,t,n){let i=0;return n?i=ot(n)-e+1:t&&(i=ot(t)),i}function No(e,t,n,i){const s=t&&rw(e,t)<=0,r=n&&rw(e,n)>=0,o=i&&i(e)===!1;return!!(s||r||o)}function ag(e,t,n,i,s,r){const o=i&&ot(i),a=i&&Pt(i),l=n&&ot(n),c=n&&Pt(n),u=new Date().getFullYear(),d=new Date().getMonth();if(r&&u===t&&ed||r&&u>t||s&&uo||t===o&&e>a:!1,f=c&&l?tr)return!0;const o=t&&ot(t),a=n&&ot(n),l=a?e>a:!1,c=o?en===e)}function aw(e,t,n,i,s){return s?DT(e,s,t,n,i,s):!1}function lw(e,t,n,i,s){return i?DT(e,i,t,n,i,s):!1}function DT(e,t,n,i,s,r){if(n==="days")return ot(e)===ot(t)&&Pt(e)===Pt(t);if(n==="months")return ot(e)===ot(t);if(n==="years"){const o=TT(i,s,r);return Math.floor((ot(e)-o)/i)===Math.floor((ot(t)-o)/i)}return!1}function lh(e,t,n,i){let s;if(t){const r=V4(t);if(r){r[0]!==r[1]?s=r[0]+r[1]:s=r[0];const o=new RegExp(`[${s}]`),a=e.split(o),l=t==null?void 0:t.split(o),c=(t==null?void 0:t.indexOf("mmm"))!==-1,u=[];l==null||l.forEach((m,v)=>{m.indexOf("yy")!==-1&&(u[0]={value:a[v],format:m}),m.indexOf("m")!==-1&&(u[1]={value:a[v],format:m}),m.indexOf("d")!==-1&&m.length<=2&&(u[2]={value:a[v],format:m})});let d;(t==null?void 0:t.indexOf("mmmm"))!==-1?d=n:d=i;const h=Number(u[0].value),f=c?z4(u[1].value,d):Number(u[1].value)-1,p=Number(u[2].value);return Or(h,f,p)}}}function cw(e,t,n,i,s,r){const o=Te(e),a=ow(Te(e).toString()),l=n[sw(e)],c=i[sw(e)],u=Pt(e),d=ow((Pt(e)+1).toString()),h=s[Pt(e)],f=r[Pt(e)],p=ot(e).toString().length===2?ot(e):ot(e).toString().slice(2,4),m=ot(e),v=t.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g);let y="";return v.forEach(g=>{switch(g){case"dddd":g=g.replace(g,c);break;case"ddd":g=g.replace(g,l);break;case"dd":g=g.replace(g,a);break;case"d":g=g.replace(g,o.toString());break;case"mmmm":g=g.replace(g,f);break;case"mmm":g=g.replace(g,h);break;case"mm":g=g.replace(g,d);break;case"m":g=g.replace(g,u.toString());break;case"yyyy":g=g.replace(g,m.toString());break;case"yy":g=g.replace(g,p.toString());break}y+=g}),y}const ET=(e,t)=>{if(!t)return!1;const n=new Date;return n.setHours(0,0,0,0)===e.setHours(0,0,0,0)?!1:et?e>new Date:!1,ir=Y.createContext({view:"days",setView:null,activeDate:new Date,setActiveDate:null,selectedDate:new Date,setSelectedDate:null,weekdaysShort:[],monthsShort:[],monthsFull:[],min:void 0,max:void 0,weekdaysFull:[],yearScope:[],tabCount:0,inline:!1,disableFuture:!1,disablePast:!1}),W4=({clearBtnText:e="Clear",cancelBtnText:t="Cancel",okBtnText:n="Ok",setValue:i,selectDate:s,onClose:r})=>{const{setActiveDate:o,setSelectedDate:a,selectedDate:l,isInDatetimepicker:c,onDatetimepickerModeSwitch:u}=k.useContext(ir),d=h=>{h.currentTarget.blur(),o(new Date),a(void 0),i("")};return b.jsxs("div",{className:"datepicker-footer",children:[b.jsx("button",{tabIndex:0,onClick:h=>d(h),className:"datepicker-footer-btn datepicker-clear-btn",children:e}),b.jsx("button",{tabIndex:0,onClick:()=>r==null?void 0:r(),className:"datepicker-footer-btn datepicker-cancel-btn",children:t}),b.jsx("button",{tabIndex:0,onClick:()=>{s(l),c&&(u==null||u()),r==null||r()},className:"datepicker-footer-btn datepicker-ok-btn",children:n})]})},H4=(e,t,n)=>{const i=document.createElement("button"),s=document.createElement("div");i.id=`datepicker-toggle-${Math.floor(Math.random()*10001)}`,i.tabIndex=0,i.type="button",i.style.pointerEvents="auto";const r=document.createElement("i");r.className=`${e} fa-${t} datepicker-icon`,n&&i.appendChild(r);const o=n?i:r;return o.classList.add("datepicker-toggle-button"),{div:s,selector:o}},U4=(e,t,n,i,s,r)=>{const o=[],a=Pt(e),l=Pt(Je(e,-1)),c=Pt(Je(e,1)),u=ot(e),d=$4(u,a,r),h=rc(e),f=rc(Je(e,-1)),p=7;let m=1,v=!1;for(let y=1;yh&&(m=1,v=!1);const _=Or(u,v?a:c,m);g.push({date:_,currentMonth:v,isSelected:t&&vs(_,t),isToday:vs(_,Ro()),dayNumber:Te(_),disabled:No(_,n,i,s)}),m++}o.push(g)}return o},Y4=e=>{const t=[],n=e[0];let i=[];for(let s=0;s<24;s++)if(i.push(n+s),i.length===4){const r=i;t.push(r),i=[]}return t},X4=e=>{const t=[];let n=[];return e.forEach(i=>{if(n.push(i),n.length===4){const s=n;t.push(s),n=[]}}),t},K4=({filter:e,startWeekdays:t,startDay:n,inlineDayClick:i,selectOnClick:s,selectDate:r,onClose:o})=>{const{min:a,max:l,setActiveDate:c,setSelectedDate:u,activeDate:d,selectedDate:h,tabCount:f,disableFuture:p,disablePast:m}=k.useContext(ir),v=y=>{!No(y,a,l,e)&&(c(y),u(y),i(y),s&&(r(y),o==null||o()))};return b.jsxs("table",{className:"datepicker-table",children:[b.jsx("thead",{children:b.jsx("tr",{children:t.map((y,g)=>b.jsx("th",{className:"datepicker-day-heading",scope:"col",children:y},g))})}),b.jsx("tbody",{className:"datepicker-table-body",children:U4(d,h,a,l,e,n).map((y,g)=>b.jsx("tr",{children:y.map((x,_)=>b.jsx("td",{onClick:()=>v(x.date),tabIndex:vs(x.date,d)?0:void 0,className:I("datepicker-cell","datepicker-small-cell","datepicker-day-cell",x.isToday&&"current",x.isSelected&&"selected",x.disabled&&"disabled",f===3&&vs(x.date,d)&&"focused",Pt(d)!==Pt(x.date)&&"disabled",AT(x.date,p)&&"disabled",ET(x.date,m)&&"disabled"),children:b.jsx("div",{className:"datepicker-cell-content datepicker-small-cell-content",style:{display:x.currentMonth?"block":"none"},children:x.dayNumber})},_))},g))})]})},G4=()=>{const{yearScope:e,setView:t,setActiveDate:n,activeDate:i,selectedDate:s,tabCount:r,min:o,max:a,disableFuture:l,disablePast:c}=k.useContext(ir);return b.jsx("table",{className:"datepicker-table",children:b.jsx("tbody",{className:"datepicker-table-body",children:Y4(e).map((u,d)=>b.jsx("tr",{children:u.map(h=>b.jsx("td",{onClick:()=>{n(new Date(h,Pt(i),Te(i))),t("months")},tabIndex:h===ot(i)?0:void 0,className:I("datepicker-cell","datepicker-large-cell","datepicker-year-cell",s&&h===ot(s)&&"selected",r===3&&h===ot(i)&&"focused",lg(h,o,a,l,c)&&"disabled",ot(Ro())===h&&"current"),children:b.jsx("div",{className:"datepicker-cell-content datepicker-large-cell-content",children:h})},h))},d))})})},q4=()=>{const{monthsShort:e,setActiveDate:t,setView:n,activeDate:i,selectedDate:s,tabCount:r,min:o,max:a,disableFuture:l,disablePast:c}=k.useContext(ir);return b.jsx("table",{className:"datepicker-table",children:b.jsx("tbody",{className:"datepicker-table-body",children:X4(e).map((u,d)=>b.jsx("tr",{children:u.map(h=>b.jsx("td",{onClick:()=>{t(new Date(ot(i),e.indexOf(h),sg(i))),n("days")},tabIndex:e.indexOf(h)===Pt(i)?0:void 0,className:I("datepicker-cell","datepicker-large-cell","datepicker-month-cell",s&&e.indexOf(h)===Pt(s)&&ot(i)===ot(s)&&"selected",r===3&&e.indexOf(h)===Pt(i)&&"focused",Pt(Ro())===e.indexOf(h)&&ot(Ro())===ot(i)&&"current",ag(e.indexOf(h),ot(i),o,a,l,c)&&"disabled"),children:b.jsx("div",{className:"datepicker-cell-content datepicker-large-cell-content",children:h})},e.indexOf(h)))},d))})})},Q4=({title:e,customHeader:t})=>{const{weekdaysShort:n,monthsShort:i,selectedDate:s,isInDatetimepicker:r,onDatetimepickerModeSwitch:o}=k.useContext(ir),a=s||new Date;return b.jsxs("div",{className:"datepicker-header",children:[b.jsx("div",{className:"datepicker-title",children:b.jsx("span",{className:"datepicker-title-text",children:e})}),b.jsxs("div",{className:"datepicker-date",children:[!t&&b.jsxs("span",{className:"datepicker-date-text",children:[n[a.getDay()],", ",i[a.getMonth()]," ",a.getDate()]}),t&&t]}),r&&b.jsxs("div",{className:"buttons-container",children:[b.jsx("button",{type:"button",className:"datepicker-button-toggle",children:b.jsx("i",{className:"far fa-calendar datepicker-toggle-icon"})}),b.jsx("button",{type:"button",className:"timepicker-button-toggle",onClick:o,children:b.jsx("i",{className:"far fa-clock fa-sm timepicker-icon"})})]})]})},Z4=()=>{const{view:e,setView:t,activeDate:n,setActiveDate:i,monthsFull:s,min:r,max:o,yearScope:a}=k.useContext(ir),l=c=>{if(e==="days"){const u=c?new Date(ot(n),Pt(n)+1,sg(n)):new Date(ot(n),Pt(n)-1,sg(n));c?!aw(Je(u,-1),"days",1,r,o)&&i(u):!lw(Je(u,1),"days",1,r,o)&&i(u)}else if(e==="years"){const u=c?new Date(ot(n)+24,Pt(n),Te(n)):new Date(ot(n)-24,Pt(n),Te(n));c?o?a[0]+24ot(r)&&i(u):i(u)}else if(e==="months"){const u=c?new Date(ot(n)+1,Pt(n),Te(n)):new Date(ot(n)-1,Pt(n),Te(n));c?!aw(Ln(u,-1),"months",1,r,o)&&i(u):!lw(Ln(u,1),"months",1,r,o)&&i(u)}};return b.jsxs("div",{className:"datepicker-date-controls",children:[e==="days"&&b.jsxs("button",{tabIndex:0,className:"datepicker-view-change-button",onClick:()=>t("years"),children:[s[n.getMonth()]," ",n.getFullYear()]}),e==="years"&&b.jsxs("button",{tabIndex:0,className:"datepicker-view-change-button",onClick:()=>t("days"),children:[a[0]," - ",a[1]]}),e==="months"&&b.jsx("button",{tabIndex:0,className:"datepicker-view-change-button",onClick:()=>t("days"),children:ot(n)}),b.jsxs("div",{className:"datepicker-arrow-controls",children:[b.jsx("button",{tabIndex:0,className:"datepicker-previous-button",onClick:()=>l(!1)}),b.jsx("button",{tabIndex:0,className:"datepicker-next-button",onClick:()=>l(!0)})]})]})},J4=({labelText:e,inline:t,setReferenceElement:n,inputClasses:i,value:s,style:r,inputStyle:o,icon:a,input:l,inputId:c,inputToggle:u,setDatepickerValue:d,format:h,onOpenHandler:f,...p})=>{const{monthsFull:m,monthsShort:v,setSelectedDate:y,setActiveDate:g}=k.useContext(ir),x=I(s?"active":"",i),_=k.useRef(null);return k.useEffect(()=>{var w;if(u)return;const S=(w=_.current)==null?void 0:w.parentNode,{div:C,selector:M}=H4(a,"sm",!0);return S==null||S.insertBefore(C,_.current),S==null||S.insertBefore(M,_.current),M.addEventListener("click",()=>f==null?void 0:f()),()=>{M.removeEventListener("click",()=>f==null?void 0:f()),S==null||S.removeChild(M)}},[a,f,u]),b.jsx(wi,{className:x,label:e,id:c,ref:t?n:l,labelRef:_,wrapperClass:"datepicker",value:s,onChange:w=>{const S=lh(w.target.value,h,m,v);d(w.target.value),S&&rg(S)?(g(S),y(S)):(g(new Date),y(void 0))},style:o,wrapperStyle:r,onClick:()=>{u&&(f==null||f())},...p})},x0="ArrowLeft",b0="ArrowUp",_0="ArrowRight",w0="ArrowDown",k0="Home",S0="End",M0="PageUp",C0="PageDown",P0="Enter",T0=" ",t8=(e,t,n,i,s,r,o,a,l,c)=>{switch(e){case x0:t(u=>eo(u,-1));break;case _0:t(u=>eo(u,1));break;case b0:t(u=>eo(u,-7));break;case w0:t(u=>eo(u,7));break;case k0:t(u=>eo(u,1-Te(u)));break;case S0:t(u=>eo(u,rc(u)-Te(u)));break;case M0:t(u=>Je(u,-1));break;case C0:t(u=>Je(u,1));break;case P0:if(No(n,i,s,o)||ET(n,c)||AT(n,l))return;a(n),r(n);break;case T0:if(!o||o(n)){if(No(n,i,s,o))return;a(n),r(n)}break;default:return}},e8=(e,t,n,i,s,r,o,a,l)=>{switch(e){case x0:n(c=>Ln(c,-1));break;case _0:n(c=>Ln(c,1));break;case b0:n(c=>Ln(c,-4));break;case w0:n(c=>Ln(c,4));break;case k0:n(c=>Ln(c,-og(c,24)));break;case S0:n(c=>Ln(c,24-og(c,24)-1));break;case M0:n(c=>Ln(c,-24));break;case C0:n(c=>Ln(c,24));break;case P0:!lg(ot(t),i,s,a,l)&&r("months");break;case T0:!lg(ot(t),i,s,a,l)&&o(t);return;default:return}},n8=(e,t,n,i,s,r,o,a,l,c)=>{switch(e){case x0:n(u=>Je(u,-1));break;case _0:n(u=>Je(u,1));break;case b0:n(u=>Je(u,-4));break;case w0:n(u=>Je(u,4));break;case k0:n(u=>Je(u,-Pt(u)));break;case S0:n(u=>Je(u,11-Pt(u)));break;case M0:n(u=>Ln(u,-1));break;case C0:n(u=>Ln(u,1));break;case P0:!ag(Pt(t),ot(t),i,s,l,c)&&r("days");break;case T0:!ag(Pt(t),ot(t),i,s,l,c)&&o(t);return;default:return}},i8=({closeOnEsc:e,isOpen:t,activeDate:n,setActiveDate:i,min:s,max:r,view:o,setView:a,setSelectedDate:l,filter:c,setInlineDate:u,disableFuture:d,disablePast:h,onClose:f})=>{const[p,m]=k.useState(3),v=k.useRef(null),y=k.useCallback(g=>{var x,_,w;if(e&&g.key==="Escape"&&(f==null||f()),g.preventDefault(),!g.shiftKey&&g.key==="Tab"){const S=(x=v.current)==null?void 0:x.querySelectorAll('[tabindex="0"]');S&&(p===S.length-1?m(0):m(p+1))}else if(g.key==="Enter")p!==3&&document.activeElement&&document.activeElement.click();else if(g.shiftKey&&g.key==="Tab"){const S=(_=v.current)==null?void 0:_.querySelectorAll('[tabindex="0"]');S&&m(p===0?S.length-1:p-1)}(w=v.current)!=null&&w.querySelector(".focused")&&p!==4&&(o==="days"?t8(g.key,i,n,s,r,l,c,u,d,h):o==="years"?e8(g.key,n,i,s,r,a,l,d,h):o==="months"&&n8(g.key,n,i,s,r,a,l,c,d,h))},[n,o,c,r,s,e,p,a,i,l,u,d,h,f]);return k.useEffect(()=>{var g,x;const _=(g=v.current)==null?void 0:g.querySelectorAll('[tabindex="0"]');if(_){const w=_[p];if(w.tagName!=="TD"){w.focus();const S=(x=v.current)==null?void 0:x.querySelector(".focused");S==null||S.classList.remove("focused")}else _[p-1].blur(),w.classList.add("focused")}},[p]),k.useEffect(()=>{t||m(3)},[t]),k.useEffect(()=>{m(3)},[o]),k.useEffect(()=>{if(t)return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y)}},[y,t]),{tabCount:p,modalRef:v}},s8=({isOpen:e,inline:t})=>{k.useEffect(()=>{const n=window.innerWidth>document.documentElement.clientWidth&&window.innerWidth>=576;if(!t)return e&&n?(document.body.style.overflow="hidden",document.body.style.paddingRight="17px"):(document.body.style.overflow="",document.body.style.paddingRight=""),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[e,t])},r8=({isOpened:e,isOpen:t,inline:n,popperElement:i,referenceElement:s,backdropRef:r,onCloseHandler:o})=>{const a=k.useCallback(l=>{var c;n?!(i!=null&&i.contains(l.target))&&!((c=s==null?void 0:s.parentNode)!=null&&c.contains(l.target))&&!l.target.classList.contains("datepicker-view-change-button")&&!l.target.classList.contains("datepicker-large-cell-content")&&t&&o():l.target===r.current&&t&&o()},[i,s,r,n,t,o]);k.useEffect(()=>(e&&document.addEventListener("click",a),()=>{document.removeEventListener("click",a)}),[e,a])},OT=k.forwardRef(({datetimepickerRef:e,isInDatetimepicker:t,onDatetimepickerModeSwitch:n,closeOnEsc:i=Ce.closeOnEsc,customHeader:s,title:r=Ce.title,weekdaysNarrow:o=Ce.weekdaysNarrow,monthsFull:a=Ce.monthsFull,monthsShort:l=Ce.monthsShort,weekdaysFull:c=Ce.weekdaysFull,weekdaysShort:u=Ce.weekdaysShort,disableFuture:d,disablePast:h,filter:f,inline:p,className:m,min:v,max:y,format:g=Ce.format,okBtnText:x=Ce.okBtnText,clearBtnText:_=Ce.clearBtnText,cancelBtnText:w=Ce.cancelBtnText,inputToggle:S,customIcon:C=Ce.customIcon,inputId:M,inputLabel:P=Ce.inputLabel,inputStyle:T,startDay:A=Ce.startDay,views:E=Ce.views,style:z,defaultValue:N="",onChange:L,onClose:R,onClosed:B,onOpen:D,onOpened:$,getFormattedDateValues:F,value:V,wrapperClass:W,selectOnClick:et=!1,open:Z,disablePortal:O,...U},lt)=>{const[ct,kt]=k.useState(!1),[it,Lt]=k.useState(!1),Ct=ef(it,Z),[Qt,ft]=k.useState(new Date),[wt,dt]=k.useState(new Date),[jt,pt]=k.useState(E),[xt,J]=k.useState(V||N),[mt,q]=k.useState(),[ye,Dt]=k.useState(),[he,Un]=k.useState(o),[Yn,Mn]=k.useState([0,0]),Si=k.useRef(null),dn=k.useRef(null),Mi=k.useRef(N&&!0),{styles:as,attributes:ls}=Oh(e||ye,mt,{placement:"bottom-start",modifiers:[VM]});k.useImperativeHandle(lt,()=>p?ye:dn.current,[p,ye]);const Ci=nt=>{if(p&&p){const Tt=cw(nt,g,u,c,l,a);J(Tt),t&&(n==null||n()),Ke()}},Pi=nt=>{const Tt=nt&&cw(nt,g,u,c,l,a);Tt&&J(Tt)},Ke=k.useCallback(()=>{Lt(!1),R==null||R()},[R]),Xn=k.useCallback(()=>{Lt(!0),D==null||D()},[D]),Ti=k.useCallback(()=>{kt(!1),B==null||B()},[B]),j=k.useCallback(()=>{kt(!0),$==null||$()},[$]),{tabCount:Q,modalRef:It}=i8({closeOnEsc:i,isOpen:Ct,activeDate:Qt,setActiveDate:ft,min:v,max:y,view:jt,setView:pt,setSelectedDate:dt,filter:f,setInlineDate:Ci,disableFuture:d,disablePast:h});return s8({isOpen:Ct,inline:p}),r8({isOpened:ct,isOpen:Ct,inline:p,referenceElement:ye,popperElement:mt,backdropRef:Si,onCloseHandler:Ke}),k.useEffect(()=>{const nt=ot(Qt),Tt=og(Qt,24),Oe=nt-Tt;Mn([Oe,Oe+23])},[Qt]),k.useEffect(()=>{const nt=o.slice(A).concat(o.slice(0,A));Un(nt)},[o,A]),k.useEffect(()=>{if(!Ct)return;const nt=p?ye:dn.current,Tt=nt==null?void 0:nt.parentNode,Oe=Tt==null?void 0:Tt.querySelector("button");Oe?Oe.blur():nt==null||nt.blur()},[Ct,dn,ye,p,D]),k.useEffect(()=>{Z&&!Ct&&!ct&&(D==null||D(),Lt(!0))},[Z,Ct,ct,D]),k.useEffect(()=>{if(!Mi.current)return;const nt=lh(xt,g,a,l);nt&&rg(nt)&&(ft(nt),dt(nt)),Mi.current=!1},[N,xt,g,a,l]),k.useEffect(()=>{const nt=V&&lh(V,g,a,l);nt&&rg(nt)&&(ft(nt),dt(nt),J(V)),V===""&&(ft(new Date),dt(void 0),J(V))},[V,g,a,l]),k.useEffect(()=>{Ct||(pt(E),xt||(ft(new Date),dt(void 0)))},[Ct,E,xt]),k.useEffect(()=>{L==null||L(xt,Qt)},[xt]),k.useEffect(()=>{const nt=wt||new Date,Tt=String(nt.getDate()),Oe=u[nt.getDay()],cs=c[nt.getDay()],ai=l[nt.getMonth()],Kn=a[nt.getMonth()],Me=String(nt.getFullYear()),Kr=Me.slice(-2);F==null||F({dayNumber:Tt,weekdayShort:Oe,weekdayFull:cs,monthShort:ai,monthFull:Kn,yearFull:Me,yearShort:Kr})},[wt]),b.jsx(ir.Provider,{value:{isInDatetimepicker:t,onDatetimepickerModeSwitch:n,view:jt,setView:pt,activeDate:Qt,setActiveDate:ft,selectedDate:wt,setSelectedDate:dt,weekdaysShort:u,monthsShort:l,monthsFull:a,min:v,max:y,weekdaysFull:c,yearScope:Yn,tabCount:Q,isOpen:Ct,disablePast:h,disableFuture:d},children:b.jsxs(b.Fragment,{children:[!t&&b.jsx(J4,{inputClasses:m,labelText:P,inline:p,setReferenceElement:Dt,value:xt,setDatepickerValue:J,style:z,inputStyle:T,format:g,icon:C,input:dn,inputToggle:S,onOpenHandler:Xn,...U}),b.jsx(aa,{disablePortal:O,children:b.jsx(Zy,{children:Ct&&b.jsxs(b.Fragment,{children:[b.jsxs(j4,{className:W,dropdown:p,styles:as,attributes:ls,setPopperElement:q,onClosed:Ti,onOpened:j,children:[!p&&b.jsx(Q4,{title:r,customHeader:s,onClose:Ke}),b.jsxs("div",{className:"datepicker-main",ref:It,children:[b.jsx(Z4,{}),b.jsxs("div",{className:"datepicker-view",children:[jt==="days"&&b.jsx(K4,{startWeekdays:he,startDay:A,filter:f,inlineDayClick:Ci,selectDate:Pi,selectOnClick:et,onClose:Ke}),jt==="years"&&b.jsx(G4,{}),jt==="months"&&b.jsx(q4,{})]}),!p&&b.jsx(W4,{okBtnText:x,clearBtnText:_,cancelBtnText:w,setValue:J,selectDate:Pi,onClose:Ke})]})]},"datepicker-modal-container"),!p&&b.jsx(Jo.div,{className:"datepicker-backdrop",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},ref:Si})]})})})]})})});OT.displayName="MDBDatepicker";const o8=e=>{const t=/^([0-1]?[0-9]|2[0-3]):[0-5][0-9] [APap][mM]$/,n=/^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$/;return e.match(t)||e.match(n)},a8=e=>e&&Object.prototype.toString.call(e)==="[object Date]"&&!isNaN(e.getTime()),uw=300,l8=k.forwardRef(({className:e,label:t="Select Date and Time",labelStyle:n,labelClass:i,labelRef:s,inputClass:r="",inputRef:o,inline:a,disabled:l,defaultTime:c="",defaultDate:u="",value:d,invalidLabel:h,inputToggle:f=!1,timepickerOptions:p,datepickerOptions:m,showFormat:v,dateFormat:y="dd/mm/yyyy",timeFormat:g="12h",appendValidationInfo:x=!0,onChange:_,onOpen:w,onClose:S,onDatepickerOpen:C,onDatepickerClose:M,onTimepickerOpen:P,onTimepickerClose:T,...A},E)=>{const z=k.useRef(!1),[N,L]=k.useState(!1),[R,B]=k.useState(!1),[D,$]=k.useState(u),[F,V]=k.useState(c),[W,et]=k.useState(""),Z=k.useRef(),O=D?W.split(",")[0]:null,U=F?W.split(", ")[1]:null,lt=I("form-outline","datetimepicker",e),ct=()=>{const pt=O&&lh(O,y,Ce.monthsFull,Ce.monthsShort);return W&&!O&&!U||O&&!a8(pt)||U&&!o8(U)?r+" is-invalid":r},kt=k.useCallback(pt=>{$(pt)},[]),it=k.useCallback(pt=>{V(pt)},[]),Lt=k.useCallback(()=>{B(!1),z.current=!1,M==null||M()},[M]),Ct=k.useCallback(()=>{T==null||T(),L(!1),z.current=!1},[T]),Qt=k.useCallback(()=>{C==null||C()},[C]),ft=k.useCallback(()=>{P==null||P()},[P]),wt=()=>{B(!0),w==null||w(),z.current=!0},dt=k.useCallback(()=>{R?(B(!1),setTimeout(()=>{L(!0)},uw)):N&&(L(!1),setTimeout(()=>{B(!0)},uw))},[R,N]);k.useEffect(()=>{!F||!D||(_==null||_(`${D}, ${F}`),!d&&et(`${D}, ${F}`))},[F,D,_,d]),k.useEffect(()=>{d&&(et(d),_==null||_(d))},[d,_]),k.useEffect(()=>{!R&&!N&&!z.current&&(S==null||S())},[R,N,S]);const jt=pt=>{et(pt);const[xt,J]=pt.split(", ");$(xt||""),V(J||"")};return b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:lt,ref:Z,...A,children:[b.jsx(wi,{label:t,labelStyle:n,labelClass:i,ref:o||E,labelRef:s,placeholder:v?`${y}, ${g}`:void 0,value:d||W,onChange:pt=>{jt(pt.target.value),_==null||_(pt.target.value)},className:x?ct():r,disabled:l,onClick:()=>{f&&wt()},children:h&&b.jsx("div",{className:"invalid-feedback",children:h})}),!f&&b.jsx("button",{type:"button",className:"datetimepicker-toggle-button",onClick:wt,disabled:l,style:{pointerEvents:l?"none":"initial"},children:b.jsx("i",{className:"far fa-calendar datepicker-toggle-icon"})})]}),b.jsx(OT,{...m,inline:a,onChange:kt,format:y,datetimepickerRef:Z.current,defaultValue:u,value:D,onClose:Lt,onOpen:Qt,isInDatetimepicker:!0,open:R,onDatetimepickerModeSwitch:dt}),b.jsx(PT,{...p,inline:a,onChange:it,format:g,datetimepickerRef:Z.current,defaultValue:c,value:F,onClose:Ct,onOpen:ft,isInDatetimepicker:!0,open:N,onDatetimepickerModeSwitch:dt})]})});l8.displayName="MDBDateTimepicker";const c8=Y.forwardRef(({className:e,color:t,children:n,...i},s)=>{const r=I("toast-header",t&&`bg-${t}`,t&&t!=="light"&&"text-white",e);return b.jsx("div",{className:r,ref:s,...i,children:n})});c8.displayName="MDBToastHeader";const u8=Y.forwardRef(({className:e,children:t,color:n,...i},s)=>{const r=I("toast-body",n&&n!=="light"&&"text-white",e);return b.jsx("div",{className:r,ref:s,...i,children:t})});u8.displayName="MDBToastBody";const d8=Y.forwardRef(({className:e,white:t,children:n,...i},s)=>{const r=I("btn-close",t&&"btn-close-white",e);return b.jsx(Zt,{className:r,color:"none",ref:s,...i,children:n})});d8.displayName="MDBToastClose";const h8=0,f8=({selectedElements:e,optionHeight:t,data:n,multiple:i,selectAll:s,handleSelectAll:r,handleOptionClick:o,selectAllLabel:a,selectData:l,activeElementIndex:c,noResults:u,search:d})=>{const h=k.useMemo(()=>l.filter(v=>v.optgroup).map(v=>v.optgroup),[l]),f=k.useMemo(()=>{let v=0;return l.map(y=>(y.optgroup&&v++,{...y,groupIndex:v}))},[l]),p=k.useMemo(()=>l.filter(v=>!v.optgroup&&!v.hidden).length===0,[l]),m=v=>f.map(y=>{if(!y.optgroup&&v===y.groupIndex)return b.jsxs("div",{className:I("select-option",e.includes(y.elementPosition)&&"selected",y.disabled&&"disabled",y.hidden&&"d-none",c===y.elementPosition&&"active"),role:"option",style:{height:t},onClick:()=>o(y),children:[b.jsxs("span",{className:"select-option-text",children:[i&&b.jsx(oh,{disabled:y.disabled,disableWrapper:!0,checked:e.includes(y.elementPosition),readOnly:!0}),y.text,y.secondaryText&&b.jsx("span",{className:"select-option-secondary-text",children:y.secondaryText})]}),y.icon&&b.jsx("span",{className:"select-option-icon-container",children:b.jsx("img",{className:"select-option-icon rounded-circle",src:y.icon})})]},y.elementPosition)});return b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"select-options-list",children:[i&&s&&!p&&b.jsx("div",{className:I("select-option",e.length===n.filter(v=>!v.disabled).length&&"selected",c===-1&&"active"),role:"option",onClick:r,style:{height:t},children:b.jsxs("span",{className:"select-option-text",children:[b.jsx(oh,{disableWrapper:!0,checked:n.filter(v=>!v.disabled&&!v.optgroup).length===e.length,readOnly:!0}),a]})}),m(h8),!p&&(h==null?void 0:h.map((v,y)=>{const g=m(y+1).filter(x=>x!==void 0);if(g.length!==0)return b.jsxs("div",{className:"select-option-group",children:[b.jsx("label",{className:"select-option-group-label",style:{height:t},children:v}),g]},`select-option-group ${v} ${y}`)}))]}),d&&p&&b.jsx("div",{className:"select-no-results",style:{height:t},children:u})]})},_p="ArrowUp",wp="ArrowDown",dw="Enter",hw="Escape",fw="Tab",p8=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;no.includes(a))||!r.every(a=>i[a]===s[a]))return!1}return!0},m8=e=>e.map((t,n)=>({...t,elementPosition:n})),g8={open:{opacity:1,transform:"scaleY(1)",transition:{duration:.2}},closed:{opacity:0,transform:"scaleY(0.8)",transition:{duration:.2}}},Ra=-1,D0=k.forwardRef(({data:e,className:t,inputClassName:n,optionHeight:i=38,visibleOptions:s=5,disabled:r,placeholder:o,label:a,clearBtn:l,children:c,multiple:u,displayedLabels:d=5,optionsSelectedLabel:h="options selected",selectAll:f=!0,selectAllLabel:p="Select all",size:m,openRef:v,contrast:y=!1,open:g,onOpen:x,onOpened:_,onClose:w,onClosed:S,onValueChange:C,onChange:M,search:P=!1,searchLabel:T="Search...",searchFn:A,autoSelect:E=!1,noResultsText:z="No results",validation:N=!1,validFeedback:L="Valid",invalidFeedback:R="Invalid",preventFirstSelection:B=!1,value:D,animationVariants:$,disablePortal:F,...V},W)=>{const[et,Z]=k.useState(!1),O=ef(et,g),[U,lt]=k.useState(!0),[ct,kt]=k.useState(null),[it,Lt]=k.useState(),[Ct,Qt]=k.useState();k.useImperativeHandle(W,()=>it,[it]);const[ft,wt]=k.useState(""),[dt,jt]=k.useState(""),[pt,xt]=k.useState(()=>f?Ra:e.findIndex(G=>!G.disabled)),[J,mt]=k.useState([]),[q,ye]=k.useState([]),[Dt,he]=k.useState(q),[Un,Yn]=k.useState(""),[Mn,Si]=k.useState(0),[dn,Mi]=k.useState(!1),as=I("select-wrapper",t),ls=I("select-input",o&&"placeholder-active",O&&"focused",n),Ci=I(O||ct&&a?"active":"",a&&"select-label"),Pi=I("select-dropdown",O&&"open"),{styles:Ke,attributes:Xn}=Oh(it,Ct,{placement:"bottom-start"}),Ti=k.useRef(null),j=k.useRef(null),Q=k.useRef(null),It=k.useMemo(()=>u&&f?s+1:s,[f,s,u]);k.useEffect(()=>{if(!dt)return he(q);if(A&&dt){const G=A(dt,q);return he(G||[])}he(()=>q.filter(G=>{var X;return((X=G.text)==null?void 0:X.toLocaleLowerCase().includes(dt.toLocaleLowerCase()))||G.optgroup}))},[dt,q,A,ft]),k.useEffect(()=>{O&&dt&&xt(-1)},[O,dt]),k.useEffect(()=>{if(!N)return;const G=J.every(ht=>q[ht].value),X=J.every(ht=>!q[ht].disabled),rt=J.length>0;!u&&(!rt||!G||!X)||u&&(!rt||!X)?it==null||it.setCustomValidity(R):it==null||it.setCustomValidity("")},[N,R,J,it,q,ft,u]);const nt=G=>{if(q.length===0)return;const X=j.current,rt=X.offsetHeight,ht=X.scrollTop,hn=q.filter(Ge=>Ge.hidden&&Ge.elementPosition(u&&f?-2:-1)){const Ge=(us-hn)*i,fn=Ge+i>ht+rt;Ge{const G=rt=>Dt.findIndex(ht=>ht.elementPosition==rt);let X=pt;for(;X{let G=pt;for(;G>=0;){G-=1;const X=Dt.findIndex(ht=>ht.elementPosition==G)!=-1,rt=G>=0&&(q[G].disabled||q[G].hidden||q[G].optgroup);if(G<=0&&(!X||rt))return u&&f?G=-1:pt;if(X&&!rt)break}return G},cs=G=>{const{key:X}=G;if([_p,wp,dw,fw,hw].includes(X)){if(X===fw)return E&&ca(Dt[pt]),it==null||it.focus(),Z(!1);if(G.preventDefault(),G.altKey&&(X===wp||X===_p))return O?w==null||w():x==null||x(),Z(!O);if(X===wp){const rt=Tt();return O?(nt(rt),xt(rt)):u?Z(!0):mt([rt])}if(X===_p){const rt=Oe();return O?(nt(rt),xt(rt)):u?Z(!0):mt([rt])}if(X===dw){const rt=Dt.findIndex(ht=>ht.elementPosition==pt);return O?pt===Ra?Kr():ca(Dt[rt]):(x==null||x(),Z(!0))}if(X===hw)return Z(!1),it==null?void 0:it.focus()}},ai=k.useCallback(()=>{Z(G=>!G)},[]),Kn=k.useCallback(G=>{if(v&&v.current===G.target)return;const X=Ct&&Ct!==null,rt=it&&it!==null,ht=!(Ct!=null&&Ct.contains(G.target))&&!(it!=null&&it.contains(G.target)),hn=G.target===Q.current;X&&O&&rt&&ht&&!hn&&(Z(!1),w==null||w())},[Ct,it,O,w,v]);k.useEffect(()=>{const G=m8(e);p8(G,q)||ye(G)},[e,q]);const Me=k.useCallback(()=>{O&&Yn(`${it==null?void 0:it.offsetWidth}px`)},[it,O]),Kr=()=>{if(!u||!f)return;if(J.length===e.filter(X=>!X.disabled&&!X.optgroup).length)return mt([]),C==null||C([]),M==null||M([]),Cn([]);const G=q==null?void 0:q.filter(X=>!X.disabled&&!X.optgroup).map(X=>X.elementPosition);return mt(G),C==null||C(e.filter(X=>!X.disabled)),M==null||M(e.filter(X=>!X.disabled)),Cn(G)},Gr=k.useCallback(()=>{if(q.length===0)return;let G=J[0];const X=G===void 0,rt=G>=q.length;if(dn&&!u){if(X&&B||!dn||u||rt)return;X&&(G=0);const ht=q[G].value,hn=String(q[G].text);hn?(kt(ht?null:hn),wt(ht?hn:"")):(kt(null),wt(ht?" ":""))}},[u,dn,J,q,B]),Cn=k.useCallback(G=>{const X=d===-1||G.length>d;if(G.length<=0&&(kt(null),wt("")),X)return kt(null),wt(`${G.length} ${h}`);const rt=G.map(fn=>q[fn].text||"").filter(fn=>fn!==""),ht=G.map(fn=>q[fn].value||"").filter(fn=>fn!==""),hn=rt.findIndex(fn=>fn!=="")===-1,us=ht.length>0,Ge=rt.join(", ");hn?(kt(null),wt(us?" ":"")):us?(wt(Ge),kt(null)):(wt(""),kt(Ge))},[d,h,q]);k.useEffect(()=>{Gr()},[J,Gr]);const ca=G=>{if(!G||G.disabled)return;const{elementPosition:X}=G;if(u){const rt=J.includes(X)?J.filter(ht=>ht!==X):[...J,X];return mt(rt),C==null||C(rt.map(ht=>e[ht])),M==null||M(rt.map(ht=>e[ht])),Cn(rt)}return mt([X]),Z(!1),C==null||C(e[X]),M==null||M(e[X]),w==null||w(),it==null?void 0:it.focus()};k.useEffect(()=>{Mi(!0)},[]),k.useEffect(()=>{if(u){const X=q.filter(rt=>rt.defaultSelected).map(rt=>rt.elementPosition);return Cn(X),mt(X)}let G=q.findIndex(X=>X.defaultSelected);G===Ra&&!B&&(G=q.findIndex(X=>!X.disabled&&!X.hidden)),G!==Ra&&mt([G])},[q,Cn,u,B]),k.useEffect(()=>{if(O&&P&&J.length===0)return xt(Ra);O||(J.length>0?xt(Math.max(...J)):xt(0))},[Dt,O,P,J]),k.useEffect(()=>{Si(It*i)},[It,i]),k.useEffect(()=>{Me()},[Me]),k.useEffect(()=>(O&&(window.addEventListener("click",Kn),window.addEventListener("resize",Me)),()=>{window.removeEventListener("click",Kn),window.removeEventListener("resize",Me)}),[Kn,Me,O]),k.useEffect(()=>{if(v){const G=v.current;return G==null||G.addEventListener("click",ai),()=>{G==null||G.removeEventListener("click",ai)}}},[v,ai]),k.useEffect(()=>{if(!D)return;const G=Array.isArray(D)?D:[D],X=q.filter(ht=>ht.value&&G.includes(ht.value)).map(ht=>ht.elementPosition);if(X.toString()===J.toString())return;const rt=u?X.map(ht=>q[ht]):q[X[0]];C==null||C(rt),M==null||M(rt),mt(X),u?Cn(X):Gr()},[D,q,u,C,M,J,Gr,Cn]);const Dc=k.useCallback(()=>{r||(it==null||it.focus(),O?w==null||w():x==null||x(),Z(!O))},[r,O,x,w,it]),sf=k.useCallback(G=>{var X;G==="open"&&(lt(!1),_==null||_(),P&&((X=Ti.current)==null||X.focus())),G==="closed"&&(lt(!0),S==null||S(),P&&jt(""))},[_,S,P]);return b.jsx("div",{className:as,...V,children:b.jsxs(b.Fragment,{children:[b.jsxs(wi,{ref:Lt,onClick:Dc,onKeyDown:cs,className:ls,value:ft,readonly:!N,required:N,disabled:r,placeholder:ct?void 0:o,label:a,labelClass:Ci,size:m,contrast:y,children:[N&&b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"invalid-feedback",children:R}),b.jsx("div",{className:"valid-feedback",children:L})]}),ct&&b.jsx("div",{className:"form-label select-fake-value active",children:ct}),l&&(ft.length>0||ct)&&b.jsx("span",{tabIndex:0,className:`select-clear-btn d-block ${r?"pe-none":""}`,role:"button",onClick:()=>{wt(""),mt([]),C==null||C(u?[]:{}),M==null||M(u?[]:{})},children:"✕"}),b.jsx("span",{className:`select-arrow ${r?"pe-none":""}`,ref:Q,onClick:Dc,style:{cursor:"pointer"}})]}),(e==null?void 0:e.length)>0&&(O||!U)&&b.jsx(aa,{disablePortal:F,children:b.jsx("div",{style:{...Ke.popper,width:Un,zIndex:1070},...Xn.popper,ref:Qt,className:"select-dropdown-container",children:b.jsx(Zy,{children:O&&b.jsxs(Jo.div,{variants:{...g8,...$},initial:"closed",animate:"open",exit:"closed",tabIndex:0,className:Pi,onAnimationStart:()=>{lt(!1)},onAnimationComplete:sf,children:[P&&b.jsx("div",{className:"input-group",children:b.jsx("input",{onKeyDown:cs,onChange:G=>jt(G.target.value),ref:Ti,type:"text",className:"form-control select-filter-input",role:"searchbox",placeholder:T})}),b.jsx("div",{className:"select-options-wrapper",ref:j,style:{maxHeight:`${Mn}px`},children:b.jsx(f8,{data:e,selectData:Dt,selectedElements:J,optionHeight:i,visibleOptions:It,handleOptionClick:ca,handleSelectAll:Kr,selectAll:f,selectAllLabel:p,multiple:u,activeElementIndex:pt,noResults:z,search:P})}),c&&b.jsx("div",{className:"select-custom-content",children:c})]})})})})]})})});D0.displayName="MDBSelectV2";const Tc=k.createContext({isLoading:!1,activePage:0,setActivePage:null,sort:{column:"",option:""},fixedHeader:!1,handleSort:null}),y8=({fullPagination:e,rowsText:t="Rows per page:",selectValue:n,setSelectValue:i,activeDataLength:s,entriesOptions:r=[10,25,50,200],fullDataLength:o,allText:a="All",ofText:l="of"})=>{const{isLoading:c,activePage:u,setActivePage:d}=k.useContext(Tc),h=u===0||c,f=s<=n*(u+1)||c,p=u===Math.floor(s/n),m=r.map(g=>({text:g.toString(),value:g,defaultSelected:n===g}));m.push({text:a,value:o,defaultSelected:n===o});const v=g=>{g instanceof Array||(i(g.value),d(0))},y=`${u*n+1} - ${(u+1)*n>s?s:(u+1)*n} ${l} ${s}`;return b.jsxs("div",{className:"datatable-pagination",children:[b.jsxs("div",{className:"datatable-select-wrapper",children:[b.jsx("p",{className:"datatable-select-text",children:t}),b.jsx(D0,{onValueChange:v,data:m,disabled:c})]}),b.jsx("div",{className:"datatable-pagination-nav",children:y}),b.jsxs("div",{className:"datatable-pagination-buttons",children:[e&&b.jsx(Zt,{disabled:h,onClick:()=>d(0),className:"datatable-pagination-button datatable-pagination-start",color:"link",children:b.jsx(sn,{icon:"angle-double-left"})}),b.jsx(Zt,{disabled:h,onClick:()=>d(u-1),className:"datatable-pagination-button datatable-pagination-left",color:"link",children:b.jsx(sn,{icon:"chevron-left"})}),b.jsx(Zt,{disabled:f,onClick:()=>d(u+1),className:"datatable-pagination-button datatable-pagination-right",color:"link",children:b.jsx(sn,{icon:"chevron-right"})}),e&&b.jsx(Zt,{disabled:p,onClick:()=>d(Math.floor(s/n)),className:"datatable-pagination-button datatable-pagination-end",color:"link",children:b.jsx(sn,{icon:"angle-double-right"})})]})]})},pw=(e,t,n)=>{const i=s=>s.toString().toLowerCase().includes(t.toLowerCase());return e.filter(s=>{if(n&&typeof n=="string")return i(s[n]);let r=Object.values(s);return n&&Array.isArray(n)&&(r=Object.keys(s).filter(o=>n.includes(o)).map(o=>s[o])),r.filter(o=>i(o)).length>0})},v8=(e,t,n)=>Object.assign([],e).sort((i,s)=>{const r=typeof i[t]=="string"?i[t].toLowerCase():i[t],o=typeof s[t]=="string"?s[t].toLowerCase():s[t];return ro?n==="desc"?-1:1:0}),LT=e=>e.every(t=>typeof t=="string"),E0=e=>!e.every(t=>typeof t=="string"),x8=e=>Array.isArray(e),mw=e=>!Array.isArray(e),b8=({search:e,advancedSearch:t,searchValue:n,setSearchValue:i,searchInputProps:s,label:r="Search",setAdvancedSearchValue:o})=>b.jsxs(b.Fragment,{children:[e&&b.jsx(wi,{value:n,onChange:a=>i(a.target.value),label:r,className:"mb-4",...s}),t&&b.jsxs(yT,{className:"mb-4",children:[b.jsx("input",{className:"form-control",value:n,onChange:a=>i(a.target.value),...s}),b.jsx(Zt,{className:"datatable-advanced-search",onClick:()=>o(t(n)),children:b.jsx(sn,{icon:"search"})})]})]}),_8=({dataColumns:e})=>{const{sort:t,fixedHeader:n,handleSort:i}=k.useContext(Tc),[s,r]=k.useState("rotate(0deg)"),o=a=>I("datatable-sort-icon",`${a===t.column&&"active"}`);return k.useEffect(()=>{const a=t.option==="desc"?"rotate(180deg)":"rotate(0deg)";r(a)},[t.option]),b.jsx(b.Fragment,{children:e.map((a,l)=>b.jsxs("th",{className:n?"fixed-cell":"",style:{cursor:"pointer"},scope:"row",onClick:()=>i(a),children:[b.jsx(sn,{fas:!0,icon:"arrow-up",className:o(a),style:{transform:a===t.column?s:"rotate(0deg)"}}),a]},l))})},w8=({dataColumns:e})=>{const[t,n]=k.useState("rotate(0deg)"),{sort:i,fixedHeader:s,handleSort:r,isLoading:o}=k.useContext(Tc),a=l=>I("datatable-sort-icon",`${l===i.column&&"active"}`);return k.useEffect(()=>{const l=i.option==="desc"?"rotate(180deg)":"rotate(0deg)";n(l)},[i.option]),b.jsx(b.Fragment,{children:e.map((l,c)=>{const{fixedValue:u,fixed:d,label:h}=l,f=l.sort!==!1&&!o,p={cursor:I(f&&"pointer"),left:d==="left"?u||0:void 0,right:d==="right"?u||0:void 0},m=I((s||d)&&"fixed-cell");return b.jsxs("th",{className:m,style:p,scope:"row",onClick:()=>f&&r(h),children:[f&&b.jsx(sn,{fas:!0,icon:"arrow-up",className:a(h),style:{transform:i.column===h?t:"rotate(0deg)"}}),h]},c)})})},k8=({row:e,dataColumns:t,format:n,editable:i})=>b.jsx(b.Fragment,{children:t.map((s,r)=>{const{field:o,fixed:a,width:l,fixedValue:c,columnSelector:u}=s,d=e[o],h=Number(d),f=n==null?void 0:n(o,h?Number(d):String(d)),p={minWidth:l,maxWidth:l,left:a==="left"&&(c||0),right:a==="right"&&(c||0),...f},m=I(a&&"fixed-cell",u&&`mdb-datatable-${u}`);return b.jsx("td",{contentEditable:i,className:m,style:p,children:d},r)})}),S8=({row:e,editable:t})=>b.jsx(b.Fragment,{children:e.map((n,i)=>b.jsx("td",{contentEditable:t,children:n},i))}),M8=({activeData:e,dataRows:t,isOnThePage:n,noFoundMessage:i,dataColumns:s,onRowClick:r,selectable:o,handleRowSelect:a,selectedRows:l,format:c,editable:u})=>{const{isLoading:d}=k.useContext(Tc),h=e.length,f=s.length,p=(m,v)=>{m.target.nodeName!=="INPUT"&&(r==null||r(v))};return b.jsxs(H3,{className:"datatable-body",children:[e.map((m,v)=>{const y=t.indexOf(m),g=l.includes(y),x=I(g&&"active",mw(m)&&m.rowSelector&&`mdb-datatable-${m.rowSelector}`);if(n(v))return b.jsxs("tr",{onClick:_=>p(_,m),className:x,style:{cursor:r&&"pointer"},children:[o&&b.jsx("td",{children:b.jsx(oh,{checked:g,onChange:()=>a(y)})}),x8(m)&&b.jsx(S8,{editable:u,row:m}),mw(m)&&E0(s)&&b.jsx(k8,{editable:u,row:m,dataColumns:s,format:c})]},v)}),!h&&!d&&b.jsx("tr",{className:"datatable-results-info",children:b.jsx("td",{colSpan:f,className:"text-center",children:i})})]})},C8=({dataColumns:e,dataRows:t,sort:n,searchValue:i,advancedSearch:s,advancedSearchValue:r})=>{const[o,a]=k.useState(t);return k.useEffect(()=>{const{column:l,option:c}=n,{phrase:u,columns:d}=r;let h;if(l){let f,p=0;E0(e)&&(f=e.find(m=>m.label===l)),LT(e)&&(p=e.indexOf(l)),h=v8(t,f?f.field:p,c)}i&&!s&&(h=pw(h||t,i,void 0)),u&&(h=pw(h||t,u,d)),a(h||t)},[n,t,e,i,s,r]),o},P8=Y.forwardRef(({advancedSearch:e,allText:t,className:n,bordered:i,borderless:s,borderColor:r="",color:o="",dark:a,entries:l=10,editable:c,entriesOptions:u,fixedHeader:d,fullPagination:h,hover:f,format:p,loaderClass:m="bg-primary",isLoading:v,loadingMessage:y="Loading results...",maxWidth:g="",maxHeight:x="",multi:_,noFoundMessage:w="No matching results found",pagination:S=!0,selectable:C,sortField:M="",searchInputProps:P,sortOrder:T="asc",sm:A,striped:E,rowsText:z,data:N={columns:[],rows:[]},search:L,onSelectRow:R,onRowClick:B,searchLabel:D,ofText:$,...F},V)=>{const[W,et]=k.useState(0),[Z,O]=k.useState(l),[U,lt]=k.useState({column:"",option:""}),[ct,kt]=k.useState([]),[it,Lt]=k.useState(""),[Ct,Qt]=k.useState({phrase:"",columns:""}),ft=C8({dataColumns:N.columns,dataRows:N.rows,sort:U,searchValue:it,advancedSearch:e,advancedSearchValue:Ct}),wt=I("datatable",f&&"datatable-hover",o&&`bg-${o}`,a&&"datatable-dark",i&&"datatable-bordered",s&&"datatable-borderless",r&&`border-${r}`,E&&"datatable-striped",A&&"datatable-sm",v&&"datatable-loading",n),dt=J=>W*Z<=J&&J<(W+1)*Z,jt=J=>{const{column:mt,option:q}=U;lt(mt===J?q==="asc"?{...U,option:"desc"}:{column:"",option:""}:{column:J,option:"asc"})},pt=J=>{const mt=J.currentTarget.checked,q=mt?Array.from({length:N.rows.length},(Dt,he)=>he):[],ye=q.map(Dt=>ft[Dt]);R==null||R(ye,q,mt),kt(q)},xt=J=>{const mt=ct.includes(J);let q;_?mt?q=ct.filter(he=>he!==J):q=[...ct,J]:mt?q=[]:q=[J];const ye=q.map(he=>ft[he]),Dt=q.length===N.rows.length;R==null||R(ye,q,Dt),kt(q)};return k.useEffect(()=>{M&<({column:M,option:T})},[M,T]),k.useEffect(()=>{et(0)},[it]),b.jsxs(Tc.Provider,{value:{isLoading:v,activePage:W,setActivePage:et,sort:U,fixedHeader:d,handleSort:jt},children:[b.jsx(b8,{search:L,advancedSearch:e,searchValue:it,setSearchValue:Lt,searchInputProps:P,label:D,setAdvancedSearchValue:Qt}),b.jsxs("div",{className:wt,ref:V,style:{maxWidth:g},...F,children:[b.jsx(k4,{className:"datatable-inner table-responsive ps",style:{overflow:"auto",position:"relative",maxWidth:g,maxHeight:x},children:b.jsxs(z3,{className:"datatable-table",children:[b.jsx(W3,{className:"datatable-header",children:b.jsxs("tr",{children:[C&&b.jsx("th",{className:d?"fixed-cell":"",children:_&&b.jsx(oh,{checked:ct.length===N.rows.length,onChange:pt})}),LT(N.columns)&&b.jsx(_8,{dataColumns:N.columns}),E0(N.columns)&&b.jsx(w8,{dataColumns:N.columns})]})}),b.jsx(M8,{activeData:ft,dataColumns:N.columns,dataRows:N.rows,isOnThePage:dt,onRowClick:B,format:p,handleRowSelect:xt,selectedRows:ct,selectable:C,noFoundMessage:w,editable:c})]})}),v&&b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"datatable-loader bg-light}",children:b.jsx("span",{className:"datatable-loader-inner",children:b.jsx("span",{className:I("datatable-progress",m)})})}),b.jsx("p",{className:"text-center text-muted my-4",children:y})]}),S&&b.jsx(y8,{fullPagination:h,selectValue:Z,setSelectValue:O,activeDataLength:ft.length,rowsText:z,entriesOptions:u,fullDataLength:N.rows.length,allText:t,ofText:$})]})]})});P8.displayName="MDBDatatable";h0.register(...i3||[]);Y.createContext({activeItem:1,setActiveItem:null,prevActive:{current:1},setHeight:null,completed:[],noEditable:!1,isAnimating:{current:!1},linear:!1,formRef:{current:null},validate:{target:0,after:0},setValidate:null,type:"horizontal",stepsLength:0,onValid:void 0,onInvalid:void 0,mobileProgress:!1,disableHeadSteps:!1,animations:!0});Y.createContext({activeItem:0,dynamic:!1,dynamicStyle:{color:"",icon:""},setDynamicStyle:null,setActiveItem:null,hoveredItem:0,setHoveredItem:null,readonly:!1,onChange:void 0});const T8=Y.forwardRef(({backdrop:e=!0,backdropColor:t="black",backdropOpacity:n=.4,color:i,className:s,loadingText:r="Loading...",isOpen:o,fullScreen:a,overflow:l=!0,parentRef:c,spinnerElement:u=b.jsx(hT,{className:"loading-icon",role:"status"}),textClassName:d,textStyles:h,tag:f="div",...p},m)=>{const v=I("loading-text",d),y=I(a?"loading-full":"loading","loading-spinner",a?"position-fixed":"position-absolute",i&&`text-${i}`,s),g=I("loading-backdrop",!a&&"position-absolute");k.useEffect(()=>{const w=c==null?void 0:c.current;if(w)return w.classList.add("position-relative"),()=>{w.classList.remove("position-relative")}},[c]),k.useEffect(()=>{if(a&&l)return o?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}},[a,o,l]);const x=b.jsxs(f,{className:y,ref:m,...p,children:[u,b.jsx("span",{className:v,style:h,children:r})]}),_=b.jsx("div",{className:g,style:{opacity:n,backgroundColor:t}});return b.jsx(b.Fragment,{children:o!==!1&&b.jsx(b.Fragment,{children:a?b.jsxs(aa,{children:[x,_]}):b.jsxs(b.Fragment,{children:[x,e&&_]})})})});T8.displayName="MDBLoadingManagement";const D8=({isOpened:e,inputRef:t,dropdownEl:n,setOpenState:i,onClose:s})=>{const r=k.useCallback(o=>{if(!n)return;const a=t.current===o.target,l=n===o.target,c=n.contains(o.target);e&&!a&&!l&&!c&&(i(!1),s==null||s())},[e,i,n,t,s]);k.useEffect(()=>(document.addEventListener("click",r),()=>{document.removeEventListener("click",r)}),[r])},E8=({inputRef:e,dropdownEl:t})=>{const n=k.useCallback(()=>{if(!e.current||!t)return;const{width:i}=window.getComputedStyle(e.current);t.style.width=i},[t,e]);k.useEffect(()=>(n(),window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)}),[n])},A8=({isOpen:e})=>{const[t,n]=k.useState(!1);return k.useEffect(()=>{let i;return e?n(!0):i=setTimeout(()=>{n(!1)},100),()=>{clearTimeout(i)}},[e]),t},O8=({className:e,customContent:t=null,inputRef:n,isOpen:i,isOpened:s,children:r,setOpenState:o,listHeight:a="190px",onOpened:l,onClose:c,onClosed:u,...d})=>{const[h,f]=k.useState(null),[p,m]=k.useState(null),v=k.useMemo(()=>[{name:"matchReferenceWidth",enabled:!0,fn:({state:S,instance:C})=>{if(!p)return;const M=p.offsetWidth,P=S.rects.reference.width;Math.round(M)!==Math.round(P)&&(p.style.width=`${P}px`,C.update())},phase:"beforeWrite",requires:["computeStyles"]}],[p]),y=A8({isOpen:i}),{styles:g,attributes:x,update:_}=Oh(h,p,{modifiers:v}),w=I("autocomplete-dropdown",i&&"open",e);return D8({isOpened:s,setOpenState:o,dropdownEl:p,inputRef:n,onClose:c}),E8({inputRef:n,dropdownEl:p}),k.useEffect(()=>{n.current&&f(n.current)},[n]),k.useEffect(()=>{i&&(_==null||_())},[i,_,y]),b.jsx(b.Fragment,{children:b.jsx(aa,{children:b.jsx("div",{className:"autocomplete-dropdown-container",ref:m,...d,style:g.popper,...x.popper,onTransitionEnd:S=>{S.propertyName==="opacity"&&(y?l==null||l():u==null||u())},children:b.jsxs("div",{className:w,children:[b.jsx("ul",{className:"autocomplete-items-list",role:"listbox",style:{maxHeight:a,display:y?"block":"none"},children:r}),t]})})})})},L8=({className:e,isActive:t,children:n,onSelect:i,value:s,...r})=>{const o=I("autocomplete-item",t&&"active",e),a=k.useRef(null);return k.useEffect(()=>{!t||!a.current||a.current.scrollIntoView({block:"nearest"})},[t]),b.jsx("li",{className:o,onClick:()=>i(s),ref:a,...r,children:n})},R8=({isOpen:e,setOpenState:t,length:n})=>{const[i,s]=k.useState(-1),r=k.useCallback(o=>{const a=o.key==="Tab",l=o.key==="Escape",c=o.key==="ArrowUp",u=o.key==="ArrowDown",d=o.key==="Home",h=o.key==="End",f=o.key==="Enter",p=o.altKey,m=n-1;if(!e)return s(-1);if(l||f||a||p&&c)return t(!1);if(u){o.preventDefault(),s(v=>v===m?m:v+1);return}if(c){o.preventDefault(),s(v=>v===0?0:v-1);return}if(d&&i!==-1){o.preventDefault(),s(0);return}if(h&&i!==-1){o.preventDefault(),s(m);return}},[e,t,n,i]);return k.useEffect(()=>{s(-1)},[n]),k.useEffect(()=>(document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}),[r]),i},N8=Y.forwardRef(({open:e,autoSelect:t,className:n,customContent:i,data:s=[],displayValue:r,value:o,isLoading:a,listHeight:l,noResults:c="No results found",itemContent:u,onSelect:d,onSearch:h,onChange:f,onClose:p,onClosed:m,onOpen:v,onOpened:y,...g},x)=>{const _=k.useRef(null),[w,S]=k.useState(!1),[C,M]=k.useState(!1),P=ef(w,e),[T,A]=k.useState(""),E=k.useMemo(()=>o!==void 0?o:T,[o,T]),z=R8({isOpen:P,setOpenState:S,length:s.length});k.useImperativeHandle(x,()=>_.current);const N=I(P&&"focused","autocomplete-input",n),L=I((P||E)&&"active","autocomplete-label"),R=()=>{S(!0),v==null||v(),_.current&&!_.current.value&&(h==null||h(""))},B=$=>r?r($):$,D=$=>{S(!1),_.current&&(_.current.value=$,h==null||h($),d==null||d($),f==null||f($),p==null||p(),A($))};return b.jsxs(b.Fragment,{children:[b.jsx(wi,{autoComplete:"off",onKeyDown:$=>{const F=$.key==="Enter",V=$.key==="Tab";if(!w)return S(!0);z!==-1&&(F||t&&V)&&D(B(s[z]))},onChange:$=>{h==null||h($.target.value),f==null||f($.target.value),A($.target.value)},onFocus:R,className:N,labelClass:L,ref:_,role:"combobox",value:E,...g,children:a&&b.jsx("div",{className:"autocomplete-loader spinner-border",children:b.jsx("span",{className:"sr-only",children:"Loading..."})})}),b.jsxs(O8,{isOpen:P,isOpened:C,inputRef:_,setOpenState:S,customContent:i,listHeight:l,onClose:p,onOpened:()=>{y==null||y(),M(!0)},onClosed:()=>{m==null||m(),M(!1)},children:[s.length===0&&b.jsx("li",{className:"autocomplete-item autocomplete-no-results",children:c}),s.map(($,F)=>b.jsx(L8,{isActive:z===F,value:B($),onSelect:D,children:u?u($):B($)},F))]})]})});N8.displayName="MDBAutocomplete";const j8=Y.forwardRef(({className:e,icon:t,tag:n="p",children:i,...s},r)=>{const o=I("popconfirm-message",e);return b.jsxs(n,{className:o,ref:r,...s,children:[t&&b.jsx("span",{className:"popconfirm-icon-container",children:t}),b.jsx("span",{className:"popconfirm-message-text",children:i})]})});j8.displayName="MDBPopconfirmMessage";const $8=Y.forwardRef(({className:e,tag:t="div",zoomLevel:n=1,fontAwesome:i="free",children:s,lightboxRef:r,onOpen:o,onClose:a,onSlide:l,onZoomIn:c,onZoomOut:u,disablePortal:d,...h},f)=>{const p=k.useRef(null),m=k.useRef(null),v=r||m,y=k.useRef(null),[g,x]=k.useState(!1),[_,w]=k.useState(0),[S,C]=k.useState(!1),[M,P]=k.useState([]),[T,A]=k.useState(""),[E,z]=k.useState(1),[N,L]=k.useState(!1),[R,B]=k.useState(),[D,$]=k.useState(!1),F=k.useRef(!1),V=k.useRef(!1),W=k.useRef(),et=k.useRef(),Z=k.useRef(),O=k.useRef(),U=k.useRef(),lt=k.useRef(),ct=k.useRef(),kt=I("lightbox",e),it=I(i==="pro"&&"fontawesome-pro"),Lt=I("lightbox-gallery-close-btn",i==="pro"&&"fontawesome-pro"),Ct=I("lightbox-gallery-fullscreen-btn",i==="pro"&&"fontawesome-pro",S&&"active"),Qt=I("lightbox-gallery-zoom-btn",i==="pro"&&"fontawesome-pro",E>1&&"active"),ft=k.useMemo(()=>document.documentElement.dir==="rtl",[]),wt=()=>{F.current=!0,setTimeout(()=>{F.current=!1},400)},dt=k.useCallback(j=>{let Q=j;return Q>M.length-1?Q=0:Q<0&&(Q=M.length-1),M[Q].classList.contains("lightbox-disabled")?dt(Q-1):Q},[M]),jt=k.useCallback(()=>{E>=3||(z(j=>j+n),c==null||c())},[c,E,n]),pt=k.useCallback(()=>{var j;const Q=(j=p.current)==null?void 0:j.querySelector(".lightbox-gallery-item.active");Q!=null&&Q.parentElement&&(Q.parentElement.style.left="0",Q.parentElement.style.top="0",Q.style.transition="all 0.5s ease-out",Q.style.left="0",Q.style.top="0",ls(Q),setTimeout(()=>{Q.style.transition="none"},500))},[]),xt=k.useCallback(()=>{E-n===1&&pt(),!(E<=1)&&(z(j=>j-n),u==null||u())},[u,pt,E,n]),J=k.useCallback(()=>{var j;p.current&&Array.from((j=p.current)==null?void 0:j.querySelectorAll(".lightbox-gallery-item")).forEach(Q=>{ls(Q)})},[]),mt=k.useCallback(()=>{S&&document.exitFullscreen&&document.exitFullscreen(),setTimeout(()=>{document.body.classList.remove("disabled-scroll"),document.body.classList.remove("replace-scrollbar")}),x(!1),z(1),L(!1),J(),a==null||a()},[J,S,a]),q=k.useCallback(j=>{if(F.current||M.length<=1)return _;let Q=0;switch(j){case"left":Q=_-1;break;case"right":Q=_+1;break;case"last":Q=M.length-1;break;case"first":Q=0;break}wt();const It=dt(Q);w(It),z(1),L(!1),setTimeout(()=>{var nt;const Tt=(nt=p.current)==null?void 0:nt.querySelector(".lightbox-gallery-item.active");J(),A(Tt.getAttribute("data-mdb-caption"))},300),l==null||l()},[_,J,M.length,l,dt]),ye=k.useCallback(j=>{if(g)switch(j.nativeEvent.key){case"ArrowRight":q(ft?"left":"right");break;case"ArrowLeft":q(ft?"right":"left");break;case"Escape":mt();break;case"Home":q("first");break;case"End":q("last");break;case"ArrowUp":jt();break;case"ArrowDown":xt();break}},[mt,q,jt,xt,g,ft]),Dt=k.useCallback(j=>{document.body.classList.add("disabled-scroll"),document.documentElement.scrollHeight>document.documentElement.clientHeight&&document.body.classList.add("replace-scrollbar"),x(!0),w(j),L(!1),J(),setTimeout(()=>{var Q;const It=(Q=p.current)==null?void 0:Q.querySelector(".lightbox-gallery-item.active");A(It.getAttribute("data-mdb-caption"))},0),o==null||o()},[J,o]);k.useImperativeHandle(f,()=>({outsideAccess(j){Dt(j)}}));const he=k.useCallback(()=>{(document.webkitIsFullScreen||document.mozFullScreen||document.msFullscreenElement)===void 0&&C(!1)},[]),Un=()=>{var j,Q,It;if(!S){(Q=(j=p.current)==null?void 0:j.requestFullscreen)==null||Q.call(j),C(!0);return}(It=document.exitFullscreen)==null||It.call(document),C(!1)},Yn=j=>{j.nativeEvent.preventDefault();const Q=j.nativeEvent instanceof TouchEvent?j.nativeEvent.touches[0]:j.nativeEvent,It=Q.clientX,nt=Q.clientY;j.nativeEvent instanceof TouchEvent&&j.type==="touchstart"&&j.nativeEvent.touches.length>1&&($(!0),B(j.nativeEvent.touches));const Tt=j.target;Z.current=parseFloat(Tt.style.left),O.current=parseFloat(Tt.style.top),W.current=parseFloat(Tt.style.left),et.current=parseFloat(Tt.style.top),U.current=It*(1/E)-W.current,lt.current=nt*(1/E)-et.current,L(!0)},Mn=j=>{if(j.type==="touchmove"&&j.nativeEvent instanceof TouchEvent&&j.nativeEvent.targetTouches.length>1&&(j.nativeEvent.preventDefault(),as(j)),!N||D)return;const Q=j.nativeEvent instanceof TouchEvent?j.nativeEvent.touches[0]:j.nativeEvent,It=Q.clientX,nt=Q.clientY,Tt=j.target;if(E!==1){W.current=It*(1/E)-U.current,et.current=nt*(1/E)-lt.current,Tt.style.left=`${W.current}px`,Tt.style.top=`${et.current}px`;return}M.length<=1||(W.current=It*(1/E)-U.current,Tt.style.left=`${W.current}px`)},Si=k.useCallback(()=>{if(!(E!==1||M.length<=1||!W.current||D)){if(W.current-(Z.current||0)>0){q(ft?"right":"left");return}q(ft?"left":"right")}},[q,D,ft,M.length,E]),dn=k.useCallback(j=>{D||(j.nativeEvent instanceof TouchEvent&&!j.nativeEvent.touches&&Xn(j),E!==1?xt():jt())},[jt,xt,D,E]),Mi=j=>{if(L(!1),j.nativeEvent instanceof MouseEvent){Si(),L(!1);return}if(D&&j.targetTouches.length===0){$(!1),B(void 0);return}L(!1),Si()},as=j=>{if(!R)return;const Q=Math.hypot(R[1].pageX-R[0].pageX,R[1].pageY-R[0].pageY),It=Math.hypot(j.nativeEvent.touches[1].pageX-j.nativeEvent.touches[0].pageX,j.nativeEvent.touches[1].pageY-j.nativeEvent.touches[0].pageY),nt=Math.abs(Q-It),Tt=j.nativeEvent.view.screen.width;nt<=Tt*.03||(Q<=It?jt():xt(),B(j.nativeEvent.touches))},ls=j=>{j.parentElement&&(j.width>=j.height?(j.style.width="100%",j.style.maxWidth="100%",j.style.height="auto",j.style.top=`${(j.parentElement.offsetHeight-j.height)/2}px`,j.style.left="0"):(j.style.height="100%",j.style.maxHeight="100%",j.style.width="auto",j.style.left=`${(j.parentElement.offsetWidth-j.width)/2}px`,j.style.top="0"),j.width>=j.parentElement.offsetWidth&&(j.style.width=`${j.parentElement.offsetWidth}px`,j.style.height="auto",j.style.left="0",j.style.top=`${(j.parentElement.offsetHeight-j.height)/2}px`),j.height>=j.parentElement.offsetHeight&&(j.style.height=`${j.parentElement.offsetHeight}px`,j.style.width="auto",j.style.top="0",j.style.left=`${(j.parentElement.offsetWidth-j.width)/2}px`),W.current=parseFloat(j.style.left)||0,et.current=parseFloat(j.style.top)||0)},Ci=j=>{const Q=j.getAttribute("data-mdb-img")?j.getAttribute("data-mdb-img"):j.getAttribute("src")?j.getAttribute("src"):"",It=j.getAttribute("alt")?j.getAttribute("alt"):j.getAttribute("data-mdb-caption")?j.getAttribute("data-mdb-caption"):"",nt=j.getAttribute("data-mdb-caption")?j.getAttribute("data-mdb-caption"):j.getAttribute("alt")?j.getAttribute("alt"):"";return{source:Q,alt:It,caption:nt}},Pi=k.useCallback(()=>{const j=[...v.current.querySelectorAll(".lightbox-item")].filter(Q=>!Q.classList.contains("lightbox-disabled"));P(j)},[v]),Ke=k.useCallback(()=>{J()},[J]),Xn=j=>{W.current=window.innerWidth/2-j.nativeEvent.offsetX-50,et.current=window.innerHeight/2-j.nativeEvent.offsetY-50;const Q=j.target;Q.style.left=`${W.current}px`,Q.style.top=`${et.current}px`,Q.style.transition="all 0.5s ease-out",setTimeout(()=>{Q.style.transition="none"},500)},Ti=j=>{if(j.deltaY>0)return xt();E>=3||(Xn(j),jt())};return k.useEffect(()=>{Pi()},[Pi]),k.useEffect(()=>{M.length&&J()},[J,M]),k.useEffect(()=>(M.forEach((j,Q)=>{!j.classList.contains("lightbox-disabled")&&j.addEventListener("click",()=>Dt(Q))}),()=>{M.forEach((j,Q)=>{j.removeEventListener("click",()=>Dt(Q))})}),[Dt,M]),k.useEffect(()=>(window.addEventListener("resize",Ke),window.addEventListener("fullscreenchange",he),()=>{window.removeEventListener("resize",Ke),window.removeEventListener("fullscreenchange",he)}),[he,Ke]),k.useEffect(()=>{const j=document.querySelector("meta[name=viewport]");if(ct.current||(ct.current=(j==null?void 0:j.getAttribute("content"))||""),!g){V.current=!1,j==null||j.setAttribute("content",ct.current);return}setTimeout(()=>{var Q;V.current=!0,(Q=y.current)==null||Q.focus(),j==null||j.setAttribute("content",`${ct.current} user-scalable=no`)},300)},[g]),b.jsxs(b.Fragment,{children:[b.jsx(t,{ref:v,className:kt,...h,children:s}),b.jsx(aa,{disablePortal:d,children:b.jsxs("div",{className:"lightbox-gallery",onClick:j=>j.target.tagName==="DIV"&&mt(),onKeyUp:ye,ref:p,style:{opacity:g?1:0,pointerEvents:g?"initial":"none",visibility:g?"visible":"hidden"},children:[b.jsx("div",{className:"lightbox-gallery-loader"}),b.jsxs("div",{className:"lightbox-gallery-toolbar",children:[b.jsx("div",{className:"lightbox-gallery-left-tools",children:b.jsx("p",{className:"lightbox-gallery-counter",children:`${_+1} / ${M.length}`})}),b.jsxs("div",{className:"lightbox-gallery-right-tools",children:[b.jsx("button",{className:Ct,onClick:Un}),b.jsx("button",{"aria-label":E>1?"Zoom out":"Zoom in",className:Qt,onClick:()=>E>1?xt():jt()}),b.jsx("button",{className:Lt,onClick:mt})]})]}),b.jsx("div",{className:"lightbox-gallery-content",style:{transform:g?"scale(1)":"scale(0.25)",transition:"all 0.5s ease-out"},children:M.map((j,Q)=>{const{source:It,alt:nt,caption:Tt}=Ci(j),Oe=Q===_?1:0,cs=Q===_?E:0,ai=_===M.length-1&&Q===0&&M.length>1,Kn=_===0&&Q===M.length-1&&M.length>1;let Me;return _Q&&!ai||Kn?Me="-100%":Me="0%",b.jsx("div",{className:"lightbox-gallery-image",style:{position:"absolute",opacity:Oe,left:g?Me:"0%",transform:`scale(${cs})`,transition:_===Q||V.current?"all 0.5s ease-out":"none"},children:b.jsx("img",{src:It||"",alt:nt||"","data-mdb-caption":Tt||"",onMouseDown:Yn,onMouseMove:Mn,onMouseUp:Mi,onWheel:Ti,onTouchStart:Yn,onTouchMove:Mn,onTouchEnd:Mi,onDoubleClick:dn,className:`lightbox-gallery-item ${_===Q&&"active"}`})},Q)})}),b.jsx("div",{className:"lightbox-gallery-arrow-left",children:b.jsx("button",{"aria-label":"Previous",className:it,onClick:()=>q("left")})}),b.jsx("div",{className:"lightbox-gallery-arrow-right",children:b.jsx("button",{"aria-label":"Next",className:it,onClick:()=>q("right"),ref:y})}),b.jsx("div",{className:"lightbox-gallery-caption-wrapper",children:b.jsx("p",{className:"lightbox-gallery-caption",children:T})})]})})]})});$8.displayName="MDBLightbox";const I8=Y.forwardRef(({className:e,fullscreenSrc:t,disabled:n,caption:i,...s},r)=>{const o=I("lightbox-item",n&&"lightbox-disabled",e);return b.jsx("img",{ref:r,"data-mdb-caption":i,"data-mdb-img":t,className:o,...s})});I8.displayName="MDBLightboxItem";const F8=Y.forwardRef(({className:e,...t},n)=>{const[i,s]=k.useState(!1),r=k.useCallback(()=>{const a=document.documentElement.scrollTop;s(!!a)},[]),o=I(i&&"navbar-scrolled","navbar-scroll",e);return k.useEffect(()=>{window.addEventListener("scroll",r)},[r]),b.jsx(pT,{className:o,ref:n,...t})});F8.displayName="MDBAnimatedNavbar";const RT=k.forwardRef(({className:e,closeIcon:t,tag:n="div",color:i,size:s,children:r,onDelete:o,...a},l)=>{const[c,u]=k.useState(!0),d=I("chip",s&&`chip-${s}`,i&&`chip-outline btn-outline-${i}`,e);return c?b.jsxs(n,{ref:l,className:d,...a,children:[r,t&&b.jsx("i",{className:"close fas fa-times",onClick:()=>{o==null||o(r),u(!1)}})]}):null});RT.displayName="MDBChip";const B8=Y.forwardRef(({className:e,value:t="",id:n,labelId:i,labelClass:s,label:r,onChange:o,labelRef:a,labelStyle:l,readonly:c,editable:u,onAdd:d,onDelete:h,initialValues:f=[],...p},m)=>{const v=k.useRef(null),y=a??v,g=k.useRef(null);k.useImperativeHandle(m,()=>g.current);const[x,_]=k.useState(f),[w,S]=k.useState(null),[C,M]=k.useState(0),[P,T]=k.useState(null),[A,E]=k.useState(t),z=x.length>0||A.length>0,N=I("form-outline","chips-input-wrapper",x.length>0&&"chips-padding chips-transition"),L=I("form-control",z&&"active",e),R=I("form-label",s);k.useEffect(()=>{!y.current||y.current.clientWidth===0||M(y.current.clientWidth*.8+8)},[y]);const B=()=>{y.current&&M(y.current.clientWidth*.8+8)},D=O=>{E(O.target.value),o==null||o(O)},$=O=>{A.length||((O.key==="ArrowLeft"||O.key==="ArrowDown")&&T(U=>U?U-1:x.length-1),(O.key==="ArrowRight"||O.key==="ArrowUp")&&T(U=>U===x.length-1||U===null?0:U+1),O.key==="Backspace"&&P!==null&&F(P)),O.key==="Enter"&&A.trim().length&&(d==null||d(A),_([...x,{tag:A}]),E(""))},F=O=>{const U=x.find((lt,ct)=>O===ct);if(U){h==null||h(U==null?void 0:U.tag);const lt=x.filter((ct,kt)=>O!==kt);_(lt),T(null)}},V=(O,U)=>{u&&S(U)},W=(O,U)=>{if(!u)return;const lt=O.currentTarget.textContent,ct=x.map((kt,it)=>it===U&<?{tag:lt}:kt);lt?_(ct):F(U),S(null),T(null)},et=(O,U)=>{O.key==="Enter"&&u&&w!==null&&W(O,U)},Z=()=>{A.trim().length&&(d==null||d(A),_([...x,{tag:A}]),E(""))};return b.jsx("div",{className:"chips chips-placeholder",children:b.jsxs("div",{className:N,children:[x.map((O,U)=>b.jsx(RT,{contentEditable:w===U,suppressContentEditableWarning:!0,onDoubleClick:lt=>V(lt,U),onDelete:()=>F(U),onKeyDown:lt=>et(lt,U),closeIcon:w!==U,className:I("btn",U===P&&"active"),children:O.tag},`${Math.random()}-${U}`)),b.jsx("input",{type:"text",readOnly:c,className:L,onChange:D,onFocus:B,onKeyDown:$,onBlur:()=>Z(),value:A,id:n,ref:g,...p}),r&&b.jsx("label",{className:R,style:l,id:i,htmlFor:n,ref:y,children:r}),b.jsxs("div",{className:"form-notch",children:[b.jsx("div",{className:"form-notch-leading"}),b.jsx("div",{className:"form-notch-middle",style:{width:C}}),b.jsx("div",{className:"form-notch-trailing"})]})]})})});B8.displayName="MDBChipsInput";function V8(){const[e,t]=k.useState(""),[n,i]=k.useState(""),[s,r]=k.useState(""),[o,a]=k.useState(null),[l,c]=k.useState(!1),[u,d]=k.useState([]),[h,f]=k.useState(!1),[p,m]=k.useState(null),[v,y]=k.useState(null),g=k.useRef(null);k.useEffect(()=>{if(l&&o&&o.plot_data&&g&&g.current){const M=g.current.getContext("2d");M&&new by(M,{type:"line",data:{labels:o.plot_data.n,datasets:[{label:"n^log_b(a)",data:o.plot_data.n_log_b_a,borderColor:"blue",borderWidth:1,fill:!1},{label:"f(n)",data:o.plot_data.f_n,borderColor:"red",borderWidth:2,fill:!1,borderDash:[5,5]},{label:"Time Complexity",data:o.plot_data.time_complexity,borderColor:"green",borderWidth:2,fill:!1,borderDash:[10,5]}]},options:{scales:{y:{beginAtZero:!0,title:{display:!0,text:"Function Value",color:"#888",font:{size:12}},ticks:{}},x:{grid:{display:!0},ticks:{callback:function(P){return Number(P).toFixed(0)}},title:{display:!0,text:"Input Size (n)",color:"#888",font:{size:12}}}},plugins:{legend:{display:!0,position:"top",labels:{boxWidth:20,padding:10}},tooltip:{enabled:!0}},elements:{line:{borderWidth:1},point:{radius:0}},responsive:!0,maintainAspectRatio:!1}})}},[l,o]),k.useEffect(()=>{(async()=>{try{const P=await fetch("http://localhost:8000/api/algorithms");if(!P.ok)throw new Error("Network response was not ok");const T=await P.json();d(T)}catch(P){console.error("Failed to fetch algorithms:",P)}})()},[]);const x=M=>{if(M===-1)f(!1),t(""),i(""),r(""),y(null);else{const P=u.find(T=>T.id===M);P&&(t(P.a.toString()),i(P.b.toString()),r(P.k.toString()),f(!0),y(P))}},_=async M=>{M.preventDefault(),await w(M)},w=async M=>{M.preventDefault(),c(!1),m(v);try{const P=await fetch("http://localhost:8000/api/evaluate/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({a:e,b:n,k:s})});if(!P.ok)throw new Error("Network response was not ok");const T=await P.json();a(T),c(!0)}catch(P){console.error("There was a problem with your fetch operation:",P)}},S=M=>{var P;if(Array.isArray(M))console.log("Multiple selections are not supported.");else{const T=parseInt(((P=M.value)==null?void 0:P.toString())||"-1",10);x(T)}},C=[{text:"User Input",value:"-1"},...u.map(M=>({text:M.name,value:M.id.toString()}))];return b.jsxs(b.Fragment,{children:[b.jsxs(rd,{alignment:"center",children:[b.jsx(od,{children:b.jsx("h1",{className:"main-header",children:"Evaluate Master Theorem"})}),b.jsxs(eg,{children:[b.jsx(fT,{children:b.jsx("span",{className:"card-title",children:"Enter the values of a, b, and k to evaluate the Master Theorem:"})}),b.jsxs("form",{onSubmit:_,children:[b.jsx(wi,{label:"a (number of subproblems)",id:"aInput",type:"number",min:"1",className:"my-4",value:e,onChange:M=>t(M.target.value),disabled:h}),b.jsx(wi,{label:"b (factor by which problem size is reduced)",id:"bInput",type:"number",min:"2",className:"my-4",value:n,onChange:M=>i(M.target.value),disabled:h}),b.jsx(wi,{label:"k (exponent in the work outside of recursive calls)",id:"kInput",type:"number",min:"0",className:"my-4",value:s,onChange:M=>r(M.target.value),disabled:h}),b.jsx("div",{className:"my-4",children:b.jsx(D0,{data:C,label:"Choose Algorithm or Enter Values",onChange:S})}),b.jsx(Zt,{onClick:w,className:"btn-block",children:"Evaluate"})]})]})]}),l&&o&&b.jsxs(rd,{className:"my-4",children:[b.jsx(od,{children:b.jsx("h2",{children:"Evaluation"})}),b.jsxs(eg,{className:"evaluation-card-body",children:[b.jsx("canvas",{ref:g,id:"myChart",className:"mb-3"}),b.jsxs(ad,{children:[b.jsx("strong",{children:"Recurrence Relation: "}),b.jsx("span",{dangerouslySetInnerHTML:{__html:o.recurrence_relation}})]}),b.jsxs(ad,{children:[b.jsx("strong",{children:"Evaluation: "}),b.jsx("span",{dangerouslySetInnerHTML:{__html:o.case}})]}),b.jsxs(ad,{children:[b.jsx("strong",{children:"Time Complexity: "}),b.jsx("span",{dangerouslySetInnerHTML:{__html:o.complexity}})]})]}),p&&b.jsxs(b.Fragment,{children:[b.jsxs("h4",{children:[p.name," Algorithm"]}),b.jsxs(ng,{alwaysOpen:!0,initialActive:1,children:[b.jsx(oo,{className:"left-align",collapseId:1,headerTitle:b.jsxs(b.Fragment,{children:[b.jsx(sn,{fas:!0,icon:"question-circle"}),"   Algorithm Description"]}),children:b.jsx("article",{children:p.description})}),b.jsx(oo,{collapseId:2,headerTitle:b.jsxs(b.Fragment,{children:[b.jsx(sn,{fab:!0,icon:"python"}),"   Python Code"]}),children:b.jsx("pre",{className:"left-align",children:b.jsx("code",{children:p.python_code})})})]})]})]}),b.jsxs(rd,{alignment:"center",className:"my-4",children:[b.jsx(od,{children:b.jsx("h2",{children:"About the Master Theorem"})}),b.jsxs(ng,{initialActive:1,children:[b.jsx(oo,{className:"left-align",collapseId:1,headerTitle:"What is the Master Theorem?",children:b.jsxs("article",{children:[b.jsxs("p",{children:["The ",b.jsx("strong",{children:"Master Theorem"})," offers a straightforward way to determine the time complexity of recursive algorithms, especially those that follow the divide and conquer approach. This theorem simplifies the process of analyzing how efficiently an algorithm runs as the size of its input increases. It is particularly useful for computer scientists and software engineers to predict algorithm performance without the need for detailed benchmarks."]}),b.jsx("p",{children:"The following parameters are required to evaluate an algorithm using the Master Theorem:"}),b.jsxs("ul",{children:[b.jsxs("li",{children:[b.jsx("strong",{children:"a"})," = the number of recursive subproblems."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"b"})," = the factor by which the problem size is reduced."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"k"})," = the exponent in the work done outside of the recursive function."]})]})]})}),b.jsx(oo,{className:"left-align",collapseId:2,headerTitle:"Decoding the Master Recurrence",children:b.jsxs("article",{children:[b.jsx("p",{children:"The Master Theorem can only be used to evaluate recursive algorithms with the following recurrence relation:"}),b.jsx("p",{className:"text-center",children:b.jsx("strong",{children:"T(n) = aT(n/b) + f(n)"})}),b.jsxs("p",{children:["This equation is the heart of the Master Theorem. and is called the ",b.jsx("strong",{children:"Master Recurrence"}),". It captures the essence of divide and conquer algorithms:"]}),b.jsxs("ul",{children:[b.jsxs("li",{children:[b.jsx("strong",{children:"T(n)"})," is the total time complexity we aim to find."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"aT(n/b)"})," represents the time taken by the recursive subproblems."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"f(n)"})," is the time taken by the work done outside the recursive calls, such as dividing the problem or combining the results."]})]}),b.jsx("p",{children:"Evaluating the Master Theorem involves comparing the rate of growth of two separate functions:"}),b.jsxs("ul",{children:[b.jsx("p",{className:"text-center",children:b.jsxs("strong",{children:["n",b.jsx("sup",{children:"logb(a)"})," + f(n)"]})}),b.jsxs("li",{children:[b.jsxs("strong",{children:["n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})]})," ","is also known as the ",b.jsx("strong",{children:"watershed function."})]}),b.jsxs("li",{children:[b.jsx("strong",{children:"f(n)"})," is also known as the"," ",b.jsx("strong",{children:"driving function."})]})]}),b.jsx("p",{children:"Comparing the growth rate of these 2 functions results in either of 3 possible cases."})]})}),b.jsx(oo,{className:"left-align",collapseId:3,headerTitle:"The 3 Cases of the Master Theorem",children:b.jsxs("article",{children:[b.jsxs("p",{children:[b.jsx("strong",{children:"Case 1"}),": n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})," ","grows asymptotically and polynomially greater than f(n):"]}),b.jsx("p",{className:"text-center",children:b.jsxs("strong",{children:["T(n) = n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})]})}),b.jsxs("p",{children:[b.jsx("strong",{children:"Case 2:"})," n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})," ","and f(n) grow at the same rate:"]}),b.jsx("p",{className:"text-center",children:b.jsxs("strong",{children:["T(n) = n",b.jsx("sup",{children:"k"})," log(n)"]})}),b.jsxs("p",{children:[b.jsx("strong",{children:"Case 3:"})," f(n) grows assymptotically and polynomially greater than n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})," ","(and also fulfills the regularity condition",b.jsx("sup",{children:"*"}),") :"]}),b.jsx("p",{className:"text-center",children:b.jsxs("strong",{children:["T(n) = f(n",b.jsx("sup",{children:"k"}),")"]})}),b.jsxs("ul",{children:[b.jsxs("li",{children:[b.jsx("strong",{children:"Case 1"})," occurs when the split subproblems dominate the overall time complexity. It implies that as we break the problem down, the sheer number of subproblems is the primary driver of the complexity."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"Case 2"})," occurs when the work done at each level of recursion is just as significant as the number of subproblems. This balance means the time complexity is a combination of the dividing/conquering work and the depth of the recursion."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"Case 3"})," highlights scenarios where the work done outside the recursive calls (combining solutions, for instance) is the main factor determining the time complexity. This is typically seen in algorithms where merging or processing results is more intensive than breaking down the problem."]})]}),b.jsx("p",{children:b.jsxs("small",{children:[b.jsx("strong",{children:"*"})," Please note that this app evaluates n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]}),"and f(n",b.jsx("sup",{children:"k"}),") using their exponents and does not assess the regularity condition in Case 3, or whether the difference in growth between these two functions is polynomial. The regularity condition ensures that the work done at the recursive levels does not grow too quickly compared to the work done to divide the problem and combine the results. This condition helps maintain the integrity of the complexity analysis provided by the theorem."]})})]})})]})]})]})}Sp.createRoot(document.getElementById("root")).render(b.jsx(Y.StrictMode,{children:b.jsx(V8,{})})); + */function mi(e){return getComputedStyle(e)}function Ze(e,t){for(var n in t){var i=t[n];typeof i=="number"&&(i=i+"px"),e.style[n]=i}return e}function Du(e){var t=document.createElement("div");return t.className=e,t}var W_=typeof Element<"u"&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector);function Ts(e,t){if(!W_)throw new Error("No element matching method supported");return W_.call(e,t)}function Mo(e){e.remove?e.remove():e.parentNode&&e.parentNode.removeChild(e)}function H_(e,t){return Array.prototype.filter.call(e.children,function(n){return Ts(n,t)})}var pe={main:"ps",rtl:"ps__rtl",element:{thumb:function(e){return"ps__thumb-"+e},rail:function(e){return"ps__rail-"+e},consuming:"ps__child--consume"},state:{focus:"ps--focus",clicking:"ps--clicking",active:function(e){return"ps--active-"+e},scrolling:function(e){return"ps--scrolling-"+e}}},xT={x:null,y:null};function bT(e,t){var n=e.element.classList,i=pe.state.scrolling(t);n.contains(i)?clearTimeout(xT[t]):n.add(i)}function _T(e,t){xT[t]=setTimeout(function(){return e.isAlive&&e.element.classList.remove(pe.state.scrolling(t))},e.settings.scrollingThreshold)}function d4(e,t){bT(e,t),_T(e,t)}var Cc=function(e){this.element=e,this.handlers={}},wT={isEmpty:{configurable:!0}};Cc.prototype.bind=function(e,t){typeof this.handlers[e]>"u"&&(this.handlers[e]=[]),this.handlers[e].push(t),this.element.addEventListener(e,t,!1)};Cc.prototype.unbind=function(e,t){var n=this;this.handlers[e]=this.handlers[e].filter(function(i){return t&&i!==t?!0:(n.element.removeEventListener(e,i,!1),!1)})};Cc.prototype.unbindAll=function(){for(var e in this.handlers)this.unbind(e)};wT.isEmpty.get=function(){var e=this;return Object.keys(this.handlers).every(function(t){return e.handlers[t].length===0})};Object.defineProperties(Cc.prototype,wT);var la=function(){this.eventElements=[]};la.prototype.eventElement=function(e){var t=this.eventElements.filter(function(n){return n.element===e})[0];return t||(t=new Cc(e),this.eventElements.push(t)),t};la.prototype.bind=function(e,t,n){this.eventElement(e).bind(t,n)};la.prototype.unbind=function(e,t,n){var i=this.eventElement(e);i.unbind(t,n),i.isEmpty&&this.eventElements.splice(this.eventElements.indexOf(i),1)};la.prototype.unbindAll=function(){this.eventElements.forEach(function(e){return e.unbindAll()}),this.eventElements=[]};la.prototype.once=function(e,t,n){var i=this.eventElement(e),s=function(r){i.unbind(t,s),n(r)};i.bind(t,s)};function Eu(e){if(typeof window.CustomEvent=="function")return new CustomEvent(e);var t=document.createEvent("CustomEvent");return t.initCustomEvent(e,!1,!1,void 0),t}function ah(e,t,n,i,s){i===void 0&&(i=!0),s===void 0&&(s=!1);var r;if(t==="top")r=["contentHeight","containerHeight","scrollTop","y","up","down"];else if(t==="left")r=["contentWidth","containerWidth","scrollLeft","x","left","right"];else throw new Error("A proper axis should be provided");h4(e,n,r,i,s)}function h4(e,t,n,i,s){var r=n[0],o=n[1],a=n[2],l=n[3],c=n[4],u=n[5];i===void 0&&(i=!0),s===void 0&&(s=!1);var d=e.element;e.reach[l]=null,d[a]<1&&(e.reach[l]="start"),d[a]>e[r]-e[o]-1&&(e.reach[l]="end"),t&&(d.dispatchEvent(Eu("ps-scroll-"+l)),t<0?d.dispatchEvent(Eu("ps-scroll-"+c)):t>0&&d.dispatchEvent(Eu("ps-scroll-"+u)),i&&d4(e,l)),e.reach[l]&&(t||s)&&d.dispatchEvent(Eu("ps-"+l+"-reach-"+e.reach[l]))}function Jt(e){return parseInt(e,10)||0}function f4(e){return Ts(e,"input,[contenteditable]")||Ts(e,"select,[contenteditable]")||Ts(e,"textarea,[contenteditable]")||Ts(e,"button,[contenteditable]")}function p4(e){var t=mi(e);return Jt(t.width)+Jt(t.paddingLeft)+Jt(t.paddingRight)+Jt(t.borderLeftWidth)+Jt(t.borderRightWidth)}var ao={isWebKit:typeof document<"u"&&"WebkitAppearance"in document.documentElement.style,supportsTouch:typeof window<"u"&&("ontouchstart"in window||"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>0||window.DocumentTouch&&document instanceof window.DocumentTouch),supportsIePointer:typeof navigator<"u"&&navigator.msMaxTouchPoints,isChrome:typeof navigator<"u"&&/Chrome/i.test(navigator&&navigator.userAgent)};function ss(e){var t=e.element,n=Math.floor(t.scrollTop),i=t.getBoundingClientRect();e.containerWidth=Math.round(i.width),e.containerHeight=Math.round(i.height),e.contentWidth=t.scrollWidth,e.contentHeight=t.scrollHeight,t.contains(e.scrollbarXRail)||(H_(t,pe.element.rail("x")).forEach(function(s){return Mo(s)}),t.appendChild(e.scrollbarXRail)),t.contains(e.scrollbarYRail)||(H_(t,pe.element.rail("y")).forEach(function(s){return Mo(s)}),t.appendChild(e.scrollbarYRail)),!e.settings.suppressScrollX&&e.containerWidth+e.settings.scrollXMarginOffset=e.railXWidth-e.scrollbarXWidth&&(e.scrollbarXLeft=e.railXWidth-e.scrollbarXWidth),e.scrollbarYTop>=e.railYHeight-e.scrollbarYHeight&&(e.scrollbarYTop=e.railYHeight-e.scrollbarYHeight),m4(t,e),e.scrollbarXActive?t.classList.add(pe.state.active("x")):(t.classList.remove(pe.state.active("x")),e.scrollbarXWidth=0,e.scrollbarXLeft=0,t.scrollLeft=e.isRtl===!0?e.contentWidth:0),e.scrollbarYActive?t.classList.add(pe.state.active("y")):(t.classList.remove(pe.state.active("y")),e.scrollbarYHeight=0,e.scrollbarYTop=0,t.scrollTop=0)}function U_(e,t){return e.settings.minScrollbarLength&&(t=Math.max(t,e.settings.minScrollbarLength)),e.settings.maxScrollbarLength&&(t=Math.min(t,e.settings.maxScrollbarLength)),t}function m4(e,t){var n={width:t.railXWidth},i=Math.floor(e.scrollTop);t.isRtl?n.left=t.negativeScrollAdjustment+e.scrollLeft+t.containerWidth-t.contentWidth:n.left=e.scrollLeft,t.isScrollbarXUsingBottom?n.bottom=t.scrollbarXBottom-i:n.top=t.scrollbarXTop+i,Ze(t.scrollbarXRail,n);var s={top:i,height:t.railYHeight};t.isScrollbarYUsingRight?t.isRtl?s.right=t.contentWidth-(t.negativeScrollAdjustment+e.scrollLeft)-t.scrollbarYRight-t.scrollbarYOuterWidth-9:s.right=t.scrollbarYRight-e.scrollLeft:t.isRtl?s.left=t.negativeScrollAdjustment+e.scrollLeft+t.containerWidth*2-t.contentWidth-t.scrollbarYLeft-t.scrollbarYOuterWidth:s.left=t.scrollbarYLeft+e.scrollLeft,Ze(t.scrollbarYRail,s),Ze(t.scrollbarX,{left:t.scrollbarXLeft,width:t.scrollbarXWidth-t.railBorderXWidth}),Ze(t.scrollbarY,{top:t.scrollbarYTop,height:t.scrollbarYHeight-t.railBorderYWidth})}function g4(e){e.element,e.event.bind(e.scrollbarY,"mousedown",function(t){return t.stopPropagation()}),e.event.bind(e.scrollbarYRail,"mousedown",function(t){var n=t.pageY-window.pageYOffset-e.scrollbarYRail.getBoundingClientRect().top,i=n>e.scrollbarYTop?1:-1;e.element.scrollTop+=i*e.containerHeight,ss(e),t.stopPropagation()}),e.event.bind(e.scrollbarX,"mousedown",function(t){return t.stopPropagation()}),e.event.bind(e.scrollbarXRail,"mousedown",function(t){var n=t.pageX-window.pageXOffset-e.scrollbarXRail.getBoundingClientRect().left,i=n>e.scrollbarXLeft?1:-1;e.element.scrollLeft+=i*e.containerWidth,ss(e),t.stopPropagation()})}function y4(e){Y_(e,["containerWidth","contentWidth","pageX","railXWidth","scrollbarX","scrollbarXWidth","scrollLeft","x","scrollbarXRail"]),Y_(e,["containerHeight","contentHeight","pageY","railYHeight","scrollbarY","scrollbarYHeight","scrollTop","y","scrollbarYRail"])}function Y_(e,t){var n=t[0],i=t[1],s=t[2],r=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8],d=e.element,h=null,f=null,p=null;function m(g){g.touches&&g.touches[0]&&(g[s]=g.touches[0].pageY),d[l]=h+p*(g[s]-f),bT(e,c),ss(e),g.stopPropagation(),g.type.startsWith("touch")&&g.changedTouches.length>1&&g.preventDefault()}function v(){_T(e,c),e[u].classList.remove(pe.state.clicking),e.event.unbind(e.ownerDocument,"mousemove",m)}function y(g,x){h=d[l],x&&g.touches&&(g[s]=g.touches[0].pageY),f=g[s],p=(e[i]-e[n])/(e[r]-e[a]),x?e.event.bind(e.ownerDocument,"touchmove",m):(e.event.bind(e.ownerDocument,"mousemove",m),e.event.once(e.ownerDocument,"mouseup",v),g.preventDefault()),e[u].classList.add(pe.state.clicking),g.stopPropagation()}e.event.bind(e[o],"mousedown",function(g){y(g)}),e.event.bind(e[o],"touchstart",function(g){y(g,!0)})}function v4(e){var t=e.element,n=function(){return Ts(t,":hover")},i=function(){return Ts(e.scrollbarX,":focus")||Ts(e.scrollbarY,":focus")};function s(r,o){var a=Math.floor(t.scrollTop);if(r===0){if(!e.scrollbarYActive)return!1;if(a===0&&o>0||a>=e.contentHeight-e.containerHeight&&o<0)return!e.settings.wheelPropagation}var l=t.scrollLeft;if(o===0){if(!e.scrollbarXActive)return!1;if(l===0&&r<0||l>=e.contentWidth-e.containerWidth&&r>0)return!e.settings.wheelPropagation}return!0}e.event.bind(e.ownerDocument,"keydown",function(r){if(!(r.isDefaultPrevented&&r.isDefaultPrevented()||r.defaultPrevented)&&!(!n()&&!i())){var o=document.activeElement?document.activeElement:e.ownerDocument.activeElement;if(o){if(o.tagName==="IFRAME")o=o.contentDocument.activeElement;else for(;o.shadowRoot;)o=o.shadowRoot.activeElement;if(f4(o))return}var a=0,l=0;switch(r.which){case 37:r.metaKey?a=-e.contentWidth:r.altKey?a=-e.containerWidth:a=-30;break;case 38:r.metaKey?l=e.contentHeight:r.altKey?l=e.containerHeight:l=30;break;case 39:r.metaKey?a=e.contentWidth:r.altKey?a=e.containerWidth:a=30;break;case 40:r.metaKey?l=-e.contentHeight:r.altKey?l=-e.containerHeight:l=-30;break;case 32:r.shiftKey?l=e.containerHeight:l=-e.containerHeight;break;case 33:l=e.containerHeight;break;case 34:l=-e.containerHeight;break;case 36:l=e.contentHeight;break;case 35:l=-e.contentHeight;break;default:return}e.settings.suppressScrollX&&a!==0||e.settings.suppressScrollY&&l!==0||(t.scrollTop-=l,t.scrollLeft+=a,ss(e),s(a,l)&&r.preventDefault())}})}function x4(e){var t=e.element;function n(o,a){var l=Math.floor(t.scrollTop),c=t.scrollTop===0,u=l+t.offsetHeight===t.scrollHeight,d=t.scrollLeft===0,h=t.scrollLeft+t.offsetWidth===t.scrollWidth,f;return Math.abs(a)>Math.abs(o)?f=c||u:f=d||h,f?!e.settings.wheelPropagation:!0}function i(o){var a=o.deltaX,l=-1*o.deltaY;return(typeof a>"u"||typeof l>"u")&&(a=-1*o.wheelDeltaX/6,l=o.wheelDeltaY/6),o.deltaMode&&o.deltaMode===1&&(a*=10,l*=10),a!==a&&l!==l&&(a=0,l=o.wheelDelta),o.shiftKey?[-l,-a]:[a,l]}function s(o,a,l){if(!ao.isWebKit&&t.querySelector("select:focus"))return!0;if(!t.contains(o))return!1;for(var c=o;c&&c!==t;){if(c.classList.contains(pe.element.consuming))return!0;var u=mi(c);if(l&&u.overflowY.match(/(scroll|auto)/)){var d=c.scrollHeight-c.clientHeight;if(d>0&&(c.scrollTop>0&&l<0||c.scrollTop0))return!0}if(a&&u.overflowX.match(/(scroll|auto)/)){var h=c.scrollWidth-c.clientWidth;if(h>0&&(c.scrollLeft>0&&a<0||c.scrollLeft0))return!0}c=c.parentNode}return!1}function r(o){var a=i(o),l=a[0],c=a[1];if(!s(o.target,l,c)){var u=!1;e.settings.useBothWheelAxes?e.scrollbarYActive&&!e.scrollbarXActive?(c?t.scrollTop-=c*e.settings.wheelSpeed:t.scrollTop+=l*e.settings.wheelSpeed,u=!0):e.scrollbarXActive&&!e.scrollbarYActive&&(l?t.scrollLeft+=l*e.settings.wheelSpeed:t.scrollLeft-=c*e.settings.wheelSpeed,u=!0):(t.scrollTop-=c*e.settings.wheelSpeed,t.scrollLeft+=l*e.settings.wheelSpeed),ss(e),u=u||n(l,c),u&&!o.ctrlKey&&(o.stopPropagation(),o.preventDefault())}}typeof window.onwheel<"u"?e.event.bind(t,"wheel",r):typeof window.onmousewheel<"u"&&e.event.bind(t,"mousewheel",r)}function b4(e){if(!ao.supportsTouch&&!ao.supportsIePointer)return;var t=e.element;function n(p,m){var v=Math.floor(t.scrollTop),y=t.scrollLeft,g=Math.abs(p),x=Math.abs(m);if(x>g){if(m<0&&v===e.contentHeight-e.containerHeight||m>0&&v===0)return window.scrollY===0&&m>0&&ao.isChrome}else if(g>x&&(p<0&&y===e.contentWidth-e.containerWidth||p>0&&y===0))return!0;return!0}function i(p,m){t.scrollTop-=m,t.scrollLeft-=p,ss(e)}var s={},r=0,o={},a=null;function l(p){return p.targetTouches?p.targetTouches[0]:p}function c(p){return p.pointerType&&p.pointerType==="pen"&&p.buttons===0?!1:!!(p.targetTouches&&p.targetTouches.length===1||p.pointerType&&p.pointerType!=="mouse"&&p.pointerType!==p.MSPOINTER_TYPE_MOUSE)}function u(p){if(c(p)){var m=l(p);s.pageX=m.pageX,s.pageY=m.pageY,r=new Date().getTime(),a!==null&&clearInterval(a)}}function d(p,m,v){if(!t.contains(p))return!1;for(var y=p;y&&y!==t;){if(y.classList.contains(pe.element.consuming))return!0;var g=mi(y);if(v&&g.overflowY.match(/(scroll|auto)/)){var x=y.scrollHeight-y.clientHeight;if(x>0&&(y.scrollTop>0&&v<0||y.scrollTop0))return!0}if(m&&g.overflowX.match(/(scroll|auto)/)){var _=y.scrollWidth-y.clientWidth;if(_>0&&(y.scrollLeft>0&&m<0||y.scrollLeft<_&&m>0))return!0}y=y.parentNode}return!1}function h(p){if(c(p)){var m=l(p),v={pageX:m.pageX,pageY:m.pageY},y=v.pageX-s.pageX,g=v.pageY-s.pageY;if(d(p.target,y,g))return;i(y,g),s=v;var x=new Date().getTime(),_=x-r;_>0&&(o.x=y/_,o.y=g/_,r=x),n(y,g)&&p.preventDefault()}}function f(){e.settings.swipeEasing&&(clearInterval(a),a=setInterval(function(){if(e.isInitialized){clearInterval(a);return}if(!o.x&&!o.y){clearInterval(a);return}if(Math.abs(o.x)<.01&&Math.abs(o.y)<.01){clearInterval(a);return}if(!e.element){clearInterval(a);return}i(o.x*30,o.y*30),o.x*=.8,o.y*=.8},10))}ao.supportsTouch?(e.event.bind(t,"touchstart",u),e.event.bind(t,"touchmove",h),e.event.bind(t,"touchend",f)):ao.supportsIePointer&&(window.PointerEvent?(e.event.bind(t,"pointerdown",u),e.event.bind(t,"pointermove",h),e.event.bind(t,"pointerup",f)):window.MSPointerEvent&&(e.event.bind(t,"MSPointerDown",u),e.event.bind(t,"MSPointerMove",h),e.event.bind(t,"MSPointerUp",f)))}var _4=function(){return{handlers:["click-rail","drag-thumb","keyboard","wheel","touch"],maxScrollbarLength:null,minScrollbarLength:null,scrollingThreshold:1e3,scrollXMarginOffset:0,scrollYMarginOffset:0,suppressScrollX:!1,suppressScrollY:!1,swipeEasing:!0,useBothWheelAxes:!1,wheelPropagation:!0,wheelSpeed:1}},w4={"click-rail":g4,"drag-thumb":y4,keyboard:v4,wheel:x4,touch:b4},Pc=function(e,t){var n=this;if(t===void 0&&(t={}),typeof e=="string"&&(e=document.querySelector(e)),!e||!e.nodeName)throw new Error("no element is specified to initialize PerfectScrollbar");this.element=e,e.classList.add(pe.main),this.settings=_4();for(var i in t)this.settings[i]=t[i];this.containerWidth=null,this.containerHeight=null,this.contentWidth=null,this.contentHeight=null;var s=function(){return e.classList.add(pe.state.focus)},r=function(){return e.classList.remove(pe.state.focus)};this.isRtl=mi(e).direction==="rtl",this.isRtl===!0&&e.classList.add(pe.rtl),this.isNegativeScroll=function(){var l=e.scrollLeft,c=null;return e.scrollLeft=-1,c=e.scrollLeft<0,e.scrollLeft=l,c}(),this.negativeScrollAdjustment=this.isNegativeScroll?e.scrollWidth-e.clientWidth:0,this.event=new la,this.ownerDocument=e.ownerDocument||document,this.scrollbarXRail=Du(pe.element.rail("x")),e.appendChild(this.scrollbarXRail),this.scrollbarX=Du(pe.element.thumb("x")),this.scrollbarXRail.appendChild(this.scrollbarX),this.scrollbarX.setAttribute("tabindex",0),this.event.bind(this.scrollbarX,"focus",s),this.event.bind(this.scrollbarX,"blur",r),this.scrollbarXActive=null,this.scrollbarXWidth=null,this.scrollbarXLeft=null;var o=mi(this.scrollbarXRail);this.scrollbarXBottom=parseInt(o.bottom,10),isNaN(this.scrollbarXBottom)?(this.isScrollbarXUsingBottom=!1,this.scrollbarXTop=Jt(o.top)):this.isScrollbarXUsingBottom=!0,this.railBorderXWidth=Jt(o.borderLeftWidth)+Jt(o.borderRightWidth),Ze(this.scrollbarXRail,{display:"block"}),this.railXMarginWidth=Jt(o.marginLeft)+Jt(o.marginRight),Ze(this.scrollbarXRail,{display:""}),this.railXWidth=null,this.railXRatio=null,this.scrollbarYRail=Du(pe.element.rail("y")),e.appendChild(this.scrollbarYRail),this.scrollbarY=Du(pe.element.thumb("y")),this.scrollbarYRail.appendChild(this.scrollbarY),this.scrollbarY.setAttribute("tabindex",0),this.event.bind(this.scrollbarY,"focus",s),this.event.bind(this.scrollbarY,"blur",r),this.scrollbarYActive=null,this.scrollbarYHeight=null,this.scrollbarYTop=null;var a=mi(this.scrollbarYRail);this.scrollbarYRight=parseInt(a.right,10),isNaN(this.scrollbarYRight)?(this.isScrollbarYUsingRight=!1,this.scrollbarYLeft=Jt(a.left)):this.isScrollbarYUsingRight=!0,this.scrollbarYOuterWidth=this.isRtl?p4(this.scrollbarY):null,this.railBorderYWidth=Jt(a.borderTopWidth)+Jt(a.borderBottomWidth),Ze(this.scrollbarYRail,{display:"block"}),this.railYMarginHeight=Jt(a.marginTop)+Jt(a.marginBottom),Ze(this.scrollbarYRail,{display:""}),this.railYHeight=null,this.railYRatio=null,this.reach={x:e.scrollLeft<=0?"start":e.scrollLeft>=this.contentWidth-this.containerWidth?"end":null,y:e.scrollTop<=0?"start":e.scrollTop>=this.contentHeight-this.containerHeight?"end":null},this.isAlive=!0,this.settings.handlers.forEach(function(l){return w4[l](n)}),this.lastScrollTop=Math.floor(e.scrollTop),this.lastScrollLeft=e.scrollLeft,this.event.bind(this.element,"scroll",function(l){return n.onScroll(l)}),ss(this)};Pc.prototype.update=function(){this.isAlive&&(this.negativeScrollAdjustment=this.isNegativeScroll?this.element.scrollWidth-this.element.clientWidth:0,Ze(this.scrollbarXRail,{display:"block"}),Ze(this.scrollbarYRail,{display:"block"}),this.railXMarginWidth=Jt(mi(this.scrollbarXRail).marginLeft)+Jt(mi(this.scrollbarXRail).marginRight),this.railYMarginHeight=Jt(mi(this.scrollbarYRail).marginTop)+Jt(mi(this.scrollbarYRail).marginBottom),Ze(this.scrollbarXRail,{display:"none"}),Ze(this.scrollbarYRail,{display:"none"}),ss(this),ah(this,"top",0,!1,!0),ah(this,"left",0,!1,!0),Ze(this.scrollbarXRail,{display:""}),Ze(this.scrollbarYRail,{display:""}))};Pc.prototype.onScroll=function(e){this.isAlive&&(ss(this),ah(this,"top",this.element.scrollTop-this.lastScrollTop),ah(this,"left",this.element.scrollLeft-this.lastScrollLeft),this.lastScrollTop=Math.floor(this.element.scrollTop),this.lastScrollLeft=this.element.scrollLeft)};Pc.prototype.destroy=function(){this.isAlive&&(this.event.unbindAll(),Mo(this.scrollbarX),Mo(this.scrollbarY),Mo(this.scrollbarXRail),Mo(this.scrollbarYRail),this.removePsClasses(),this.element=null,this.scrollbarX=null,this.scrollbarY=null,this.scrollbarXRail=null,this.scrollbarYRail=null,this.isAlive=!1)};Pc.prototype.removePsClasses=function(){this.element.className=this.element.className.split(" ").filter(function(e){return!e.match(/^ps([-_].+|)$/)}).join(" ")};const k4=({className:e,sidenav:t,tag:n="div",handlers:i=["click-rail","drag-thumb","keyboard","wheel","touch"],wheelSpeed:s=1,wheelPropagation:r=!0,swipeEasing:o=!0,minScrollbarLength:a,maxScrollbarLength:l,scrollingThreshold:c=1e3,useBothWheelAxes:u=!1,suppressScrollX:d=!1,suppressScrollY:h=!1,scrollXMarginOffset:f=0,scrollYMarginOffset:p=0,scrollBarRef:m,onScrollY:v,onScrollX:y,onScrollUp:g,onScrollDown:x,onScrollLeft:_,onScrollRight:w,onYReachStart:S,onYReachEnd:C,onXReachStart:M,onXReachEnd:P,children:T,options:A,...E})=>{const z=I(t&&"sidenav-menu",e),N=k.useRef(null),L=k.useRef(null);return k.useEffect(()=>{let R=null;const B=[],D={handlers:i,wheelSpeed:s,wheelPropagation:r,swipeEasing:o,minScrollbarLength:a,maxScrollbarLength:l,scrollingThreshold:c,useBothWheelAxes:u,suppressScrollX:d,suppressScrollY:h,scrollXMarginOffset:f,scrollYMarginOffset:p,...A};if(!N.current)return;R=N.current,L.current=new Pc(R,D);const $={"ps-scroll-y":v,"ps-scroll-x":y,"ps-scroll-up":g,"ps-scroll-down":x,"ps-scroll-left":_,"ps-scroll-right":w,"ps-y-reach-start":S,"ps-y-reach-end":C,"ps-x-reach-start":M,"ps-x-reach-end":P};return Object.keys($).forEach(F=>{const V=$[F];if(typeof V=="function"&&R){const W=()=>V(R);B.push({eventName:F,handler:W}),R.addEventListener(F,W)}}),m&&m(L.current),()=>{var F;B.forEach(V=>{R==null||R.removeEventListener(V.eventName,V.handler)}),(F=L.current)==null||F.destroy(),L.current=null}},[i,s,r,o,a,l,c,u,d,h,f,p,m,v,y,g,x,_,w,S,C,M,P,A]),b.jsx(n,{className:z,ref:N,...E,children:T})},S4=Y.createContext({color:"primary"}),M4=Y.forwardRef(({className:e,children:t,...n},i)=>{const s=I("sidenav-menu",e);return b.jsx("ul",{className:s,ref:i,...n,children:t})});M4.displayName="MDBSideNavMenu";const C4=Y.forwardRef(({className:e,children:t,...n},i)=>{const s=I("sidenav-item",e);return b.jsx("li",{className:s,ref:i,...n,children:t})});C4.displayName="MDBSideNavItem";const P4=Y.forwardRef(({className:e,icon:t,iconClasses:n,iconAngle:i=180,shouldBeExpanded:s,children:r,active:o,tag:a="a",...l},c)=>{const{color:u}=k.useContext(S4),d=I("sidenav-link",o&&"active",e),h=I("rotate-icon",n),[f,p]=k.useState(s?i:0);return k.useEffect(()=>{p(s?i:0)},[s,i]),b.jsxs(v0,{rippleTag:a,onKeyDown:m=>{m.key==="Enter"&&m.target.click()},tabIndex:1,rippleColor:u,className:d,ref:c,...l,children:[r,t&&b.jsx(sn,{icon:t,style:{transform:`rotate(${f}deg)`},className:h})]})});P4.displayName="MDBSideNavLink";const kT=Y.forwardRef(({className:e,centered:t,children:n,size:i,scrollable:s,tag:r="div",...o},a)=>{const l=I("modal-dialog",s&&"modal-dialog-scrollable",t&&"modal-dialog-centered",i&&`modal-${i}`,e);return b.jsx(r,{className:l,...o,ref:a,children:n})});kT.displayName="MDBModalDialog";const T4=Y.forwardRef(({className:e,side:t,frame:n,position:i,children:s,tag:r="div",...o},a)=>{const l=I(t&&"modal-side",n&&"modal-frame",i&&`modal-${i}`,e);return b.jsx(kT,{className:l,...o,tag:r,ref:a,children:s})});T4.displayName="MDBModalDialog";const nf=Y.createContext({onDatetimepickerModeSwitch:()=>null,isInDatetimepicker:!1,setInputValue:null,setActiveHour:null,setActiveMinute:null,setPeriod:null,setMode:null,setHandAnimation:null,setMinuteAngle:null,setHourAngle:null,submitLabel:"",clearLabel:"",cancelLabel:"",activeHour:12,activeMinute:12,format:"12h",period:"",defaultValue:"",minHour:0,maxHour:23,minPeriod:"",maxPeriod:"",mode:"hours",handAnimation:!1,maxMinute:59,minMinute:0,minuteAngle:360,hourAngle:360,inline:!1,increment:!1,onChange:()=>null,onOpen:()=>null,onClose:()=>null,onCloseHandler:()=>null,amLabel:"AM",pmLabel:"PM",switchHoursToMinutesOnClick:!0,headId:"",bodyId:""}),ld=e=>{const t=e.split(":"),n=t[0],i=t[1].split(" ")[1],s=t[1].split(" ")[0];return{hour:parseInt(n),minute:parseInt(s),defaultPeriod:i}},X_=(e,t)=>(t==="24h"?/^([01]\d|2[0-3])(:[0-5]\d)$/:/^(0?[1-9]|1[012])(:[0-5]\d) [APap][mM]$/).test(e),Ki=(e,t,n,i,s,r)=>{let o=!1;return t&&(s!==""?e>t&&i===s&&(o=!0):e>t&&(o=!0)),n&&(r!==""?eKi(i,s,r,o,a,l)&&(n===t||n===e),D4=(e,t,n)=>{t.split(" ").forEach(i=>{e.addEventListener(i,n)})},E4=(e,t,n)=>{t.split(" ").forEach(i=>{e.removeEventListener(i,n)})},ST=(e,t)=>{const n=t.x-e.x,i=t.y-e.y;return Math.sqrt(n*n+i*i)},A4=(e,t)=>{const n=2*Math.atan2(t.y-e.y-ST(e,t),t.x-e.x);return Math.abs(n*180/Math.PI)},K_=e=>({radius:(e-32)/2-4}),O4=e=>{const t=new Date;let n=t.getHours();const i=t.getMinutes();if(e==="24h")return{hours:n,minutes:i,period:""};const s=n>=12?"PM":"AM";return n=n%12,n=n||12,{hours:n,minutes:i,period:s}},xp=(e,t)=>{const n=e.getMinutes();let i=e.getHours(),s;i===24&&(i=0);const r=i>=12?"PM":"AM";return t=="24h"?s=i<10?`0${i}:${n}`:`${i}:${n}`:t=="12h"&&(s=`${(i+24)%12||12}:${n} ${r}`),s},ig=Y.forwardRef(({...e},t)=>{const{activeHour:n,format:i,period:s,setPeriod:r,mode:o,setMode:a,activeMinute:l,setHandAnimation:c,inline:u,setActiveHour:d,setActiveMinute:h,maxHour:f,maxMinute:p,minHour:m,minMinute:v,maxPeriod:y,minPeriod:g,setInputValue:x,increment:_,submitLabel:w,onChange:S,onCloseHandler:C,amLabel:M,pmLabel:P,headId:T,show:A,onDatetimepickerModeSwitch:E,isInDatetimepicker:z}=k.useContext(nf),N=D=>{a(D),c(!0)},L=()=>{if(Ki(n,f,m,s,y,g)||Ki(l,p,v,s,y,g)||!A)return;C==null||C();const D=n===24?"00":n<10?`0${n}`:n,$=l<10?`0${l}`:l,F=`${D}:${$} ${s}`.trim();x(F),S==null||S(F)},R=(D,$)=>{const F=i==="12h"?12:24;if($.type==="click")return d(D?V=>V===F?1:V+1:V=>V===1?F:V-1);if($.type==="mousedown"){const V=setTimeout(()=>{const et=setInterval(()=>{d(D?O=>O===F?1:O+1:O=>O===1?F:O-1)},100),Z=()=>{clearInterval(et),document.removeEventListener("mouseup",Z)};document.addEventListener("mouseup",Z)},300),W=()=>{clearTimeout(V),document.removeEventListener("mouseup",W)};document.addEventListener("mouseup",W)}},B=(D,$)=>{const F=_?55:59,V=_?5:1;if($.type==="click")return h(D?W=>W>=F?0:W+V:W=>W-V<0?F:W-V);if($.type==="mousedown"){const W=setTimeout(()=>{const Z=setInterval(()=>{h(D?U=>U>=F?0:U+V:U=>U-V<0?F:U-V)},100),O=()=>{clearInterval(Z),document.removeEventListener("mouseup",O)};document.addEventListener("mouseup",O)},300),et=()=>{clearTimeout(W),document.removeEventListener("mouseup",et)};document.addEventListener("mouseup",et)}};return u?b.jsx("div",{id:T,className:"timepicker-head d-flex flex-row align-items-center justify-content-center timepicker-head-inline",style:{paddingRight:"0px"},ref:t,...e,children:b.jsxs("div",{className:"timepicker-head-content d-flex w-100 justify-content-evenly align-items-center",children:[b.jsxs("div",{className:"timepicker-current-wrapper",children:[b.jsxs("span",{className:"position-relative h-100 timepicker-inline-hour-icons",children:[b.jsx(sn,{fas:!0,icon:"chevron-up",style:{display:"flex"},className:"position-absolute text-white timepicker-icon-up timepicker-icon-inline-hour",onClick:D=>R(!0,D),onMouseDown:D=>R(!0,D)}),b.jsx(Zt,{type:"button",color:"none",onClick:()=>{N("hours")},className:`timepicker-current timepicker-current-inline timepicker-hour ${o==="hours"&&"active"}`,tabIndex:0,style:{pointerEvents:o==="hours"?"none":void 0},onFocus:()=>{N("hours")},children:n===24?"00":n<10?`0${n}`:n}),b.jsx(sn,{fas:!0,icon:"chevron-down",style:{display:"flex"},className:"position-absolute text-white timepicker-icon-down timepicker-icon-inline-hour",onClick:D=>R(!1,D),onMouseDown:D=>R(!1,D)})]}),b.jsx(Zt,{color:"none",className:"timepicker-dot timepicker-current-inline",disabled:!0,children:":"}),b.jsxs("span",{className:"position-relative h-100 timepicker-inline-minutes-icons",children:[b.jsx(sn,{fas:!0,icon:"chevron-up",style:{display:"flex"},className:"position-absolute text-white timepicker-icon-up timepicker-icon-inline-minute",onClick:D=>B(!0,D),onMouseDown:D=>B(!0,D)}),b.jsx(Zt,{onClick:()=>{N("minutes")},type:"button",color:"none",className:`timepicker-current timepicker-current-inline timepicker-minute ${o==="minutes"&&"active"}`,tabIndex:0,style:{pointerEvents:o==="minutes"?"none":void 0},onFocus:()=>{N("minutes")},children:l<10?`0${l}`:l}),b.jsx(sn,{fas:!0,icon:"chevron-down",style:{display:"flex"},className:"position-absolute text-white timepicker-icon-down timepicker-icon-inline-minute",onClick:D=>B(!1,D),onMouseDown:D=>B(!1,D)})]})]}),b.jsxs("div",{className:"d-flex justify-content-center timepicker-mode-wrapper",children:[i==="12h"&&b.jsxs(b.Fragment,{children:[b.jsx(Zt,{onClick:()=>r("AM"),type:"button",color:"none",className:`timepicker-hour-mode timepicker-am me-2 ms-4 ${s.toLowerCase()==="am"&&"active"}`,tabIndex:0,children:M}),b.jsx(Zt,{onClick:()=>r("PM"),type:"button",color:"none",className:`timepicker-hour-mode timepicker-pm ${s.toLowerCase()==="pm"&&"active"}`,tabIndex:0,children:P})]}),b.jsx(Zt,{type:"button",color:"none",className:"timepicker-button timepicker-submit timepicker-submit-inline py-1 px-2 mb-0",tabIndex:0,onClick:L,children:w})]})]})}):b.jsxs(b.Fragment,{children:[b.jsx("div",{id:T,className:"timepicker-head d-flex flex-row align-items-center justify-content-center",style:{paddingRight:"0px"},ref:t,...e,children:b.jsxs("div",{className:"timepicker-head-content d-flex w-100 justify-content-evenly",style:{paddingRight:i==="24h"?"50px":""},children:[b.jsxs("div",{className:"timepicker-current-wrapper",children:[b.jsx("span",{className:"position-relative h-100",children:b.jsx(Zt,{type:"button",color:"none",onClick:()=>{N("hours")},className:`timepicker-current timepicker-hour ${o==="hours"&&"active"}`,tabIndex:0,style:{pointerEvents:o==="hours"?"none":void 0},children:n===24?"00":n<10?`0${n}`:n})}),b.jsx(Zt,{color:"none",className:"timepicker-dot",disabled:!0,children:":"}),b.jsx("span",{className:"position-relative h-100",children:b.jsx(Zt,{onClick:()=>{N("minutes")},type:"button",color:"none",className:`timepicker-current timepicker-minute ${o==="minutes"&&"active"}`,tabIndex:0,style:{pointerEvents:o==="minutes"?"none":void 0},children:l<10?`0${l}`:l})})]}),i==="12h"&&b.jsxs("div",{className:"d-flex flex-column justify-content-center timepicker-mode-wrapper",children:[b.jsx(Zt,{onClick:()=>r("AM"),type:"button",color:"none",className:`timepicker-hour-mode timepicker-am ${s.toLowerCase()==="am"&&"active"}`,tabIndex:0,children:M}),b.jsx(Zt,{onClick:()=>r("PM"),type:"button",color:"none",className:`timepicker-hour-mode timepicker-pm ${s.toLowerCase()==="pm"&&"active"}`,tabIndex:0,children:P})]})]})}),z&&b.jsxs("div",{className:"buttons-container",children:[b.jsx("button",{type:"button",className:"datepicker-button-toggle",onClick:E,children:b.jsx("i",{className:"far fa-calendar datepicker-toggle-icon"})}),b.jsx("button",{type:"button",className:"timepicker-button-toggle",children:b.jsx("i",{className:"far fa-clock fa-sm timepicker-icon"})})]})]})});ig.displayName="MDBTimePickerHeader";const bp={hours:[{value:1,left:"169px",bottom:"209.263px",angle:30,id:`hour-1-${Math.floor(Math.random()*1001)}`},{value:2,left:"209.263px",bottom:"169px",angle:60,id:`hour-2-${Math.floor(Math.random()*1001)}`},{value:3,left:"224px",bottom:"114px",angle:90,id:`hour-3-${Math.floor(Math.random()*1001)}`},{value:4,left:"209.263px",bottom:"59px",angle:120,id:`hour-4-${Math.floor(Math.random()*1001)}`},{value:5,left:"169px",bottom:"18.7372px",angle:150,id:`hour-5-${Math.floor(Math.random()*1001)}`},{value:6,left:"114px",bottom:"4px",angle:180,id:`hour-6-${Math.floor(Math.random()*1001)}`},{value:7,left:"59px",bottom:"18.7372px",angle:210,id:`hour-7-${Math.floor(Math.random()*1001)}`},{value:8,left:"18.7372px",bottom:"59px",angle:240,id:`hour-8-${Math.floor(Math.random()*1001)}`},{value:9,left:"4px",bottom:"114px",angle:270,id:`hour-9-${Math.floor(Math.random()*1001)}`},{value:10,left:"18.7372px",bottom:"169px",angle:300,id:`hour-10-${Math.floor(Math.random()*1001)}`},{value:11,left:"59px",bottom:"209.263px",angle:330,id:`hour-11-${Math.floor(Math.random()*1001)}`},{value:12,left:"114px",bottom:"224px",angle:360,id:`hour-12-${Math.floor(Math.random()*1001)}`},{value:13,left:"94px",bottom:"115.962px",angle:30,id:`hour-13-${Math.floor(Math.random()*1001)}`},{value:14,left:"115.962px",bottom:"94px",angle:60,id:`hour-14-${Math.floor(Math.random()*1001)}`},{value:15,left:"124px",bottom:"64px",angle:90,id:`hour-15-${Math.floor(Math.random()*1001)}`},{value:16,left:"115.962px",bottom:"34px",angle:120,id:`hour-16-${Math.floor(Math.random()*1001)}`},{value:17,left:"94px",bottom:"12.0385px",angle:150,id:`hour-17-${Math.floor(Math.random()*1001)}`},{value:18,left:"64px",bottom:"4px",angle:180,id:`hour-18-${Math.floor(Math.random()*1001)}`},{value:19,left:"34px",bottom:"12.0385px",angle:210,id:`hour-19-${Math.floor(Math.random()*1001)}`},{value:20,left:"12.0385px",bottom:"34px",angle:240,id:`hour-20-${Math.floor(Math.random()*1001)}`},{value:21,left:"4px",bottom:"64px",angle:270,id:`hour-21-${Math.floor(Math.random()*1001)}`},{value:22,left:"12.0385px",bottom:"94px",angle:300,id:`hour-22-${Math.floor(Math.random()*1001)}`},{value:23,left:"34px",bottom:"115.962px",angle:330,id:`hour-23-${Math.floor(Math.random()*1001)}`},{value:24,left:"64px",bottom:"124px",angle:360,id:`hour-0-${Math.floor(Math.random()*1001)}`}],minutes:[{value:0,left:"114px",bottom:"224px",angle:360,id:`minute-0-${Math.floor(Math.random()*1001)}`},{value:5,left:"169px",bottom:"209.263px",angle:30,id:`minute-5-${Math.floor(Math.random()*1001)}`},{value:10,left:"209.263px",bottom:"169px",angle:60,id:`minute-10-${Math.floor(Math.random()*1001)}`},{value:15,left:"224px",bottom:"114px",angle:90,id:`minute-15-${Math.floor(Math.random()*1001)}`},{value:20,left:"209.263px",bottom:"59px",angle:120,id:`minute-20-${Math.floor(Math.random()*1001)}`},{value:25,left:"169px",bottom:"18.7372px",angle:150,id:`minute-25-${Math.floor(Math.random()*1001)}`},{value:30,left:"114px",bottom:"4px",angle:180,id:`minute-30-${Math.floor(Math.random()*1001)}`},{value:35,left:"59px",bottom:"18.7372px",angle:210,id:`minute-35-${Math.floor(Math.random()*1001)}`},{value:40,left:"18.7372px",bottom:"59px",angle:240,id:`minute-40-${Math.floor(Math.random()*1001)}`},{value:45,left:"4px",bottom:"114px",angle:270,id:`minute-45-${Math.floor(Math.random()*1001)}`},{value:50,left:"18.7372px",bottom:"169px",angle:300,id:`minute-50-${Math.floor(Math.random()*1001)}`},{value:55,left:"59px",bottom:"209.263px",angle:330,id:`minute-55-${Math.floor(Math.random()*1001)}`}]},MT=Y.forwardRef(({...e},t)=>{const n=k.useRef(null),i=k.useRef(null),[s,r]=k.useState(!1),[o,a]=k.useState(0),[l,c]=k.useState(0),{setActiveHour:u,format:d,activeHour:h,minHour:f,maxHour:p,minPeriod:m,maxPeriod:v,period:y,mode:g,setMode:x,activeMinute:_,setActiveMinute:w,setHandAnimation:S,handAnimation:C,maxMinute:M,minMinute:P,hourAngle:T,setHourAngle:A,minuteAngle:E,setMinuteAngle:z,increment:N,switchHoursToMinutesOnClick:L,bodyId:R}=k.useContext(nf),B=d==="24h"?bp.hours:bp.hours.filter(O=>O.value<13&&O.value!==0),D=bp.minutes,[$,F]=k.useState("calc(40% + 1px)"),V=k.useCallback(A4,[]),W=O=>{O.preventDefault(),r(!0)},et=O=>{O.preventDefault(),r(!1),g==="hours"&&(L&&x("minutes"),S(!0))},Z=k.useCallback(O=>{var U;const{width:lt,top:ct,left:kt}=(U=n.current)==null?void 0:U.getBoundingClientRect(),{clientX:it,clientY:Lt}="touches"in O?O.touches[0]:O,Ct={x:lt/2,y:-lt/2},Qt={x:it-kt,y:ct-Lt},ft=Math.round(V(Ct,Qt)+360)%360;if(g==="hours"){const wt=30*Math.round(ft/30);let dt=wt/30;if(d==="24h"){const{radius:jt}=K_(o),{radius:pt}=K_(l);ST(Ct,Qt)<(jt+pt)/2-16&&(dt+=12)}Ki(dt,p,f,y,v,m)||(u(dt),A(wt))}else if(ft===0)vp(f,p,h,0,M,P,y,v,m)||(w(0),z(360));else{const wt=N?30:6,dt=wt*Math.round(ft/wt);vp(f,p,h,dt/6,M,P,y,v,m)||(w(dt/6===60?0:dt/6),z(dt))}},[V,h,M,P,v,m,g,y,w,p,f,u,l,o,d,A,z,N]);return k.useEffect(()=>{n.current&&a(n.current.offsetWidth),i.current&&c(i.current.offsetWidth)},[]),k.useEffect(()=>(s&&D4(document,"mouseup mousemove mouseleave mouseover touchstart touchmove touchend",Z),()=>{E4(document,"mouseup mousemove mouseleave mouseover touchstart touchmove touchend",Z)}),[s,Z]),k.useEffect(()=>{const O=B.find(U=>U.value===h);O!==void 0&&(O.value>12||O.value===24?F("21.5%"):F("calc(40% + 1px)"))},[B,h]),b.jsx("div",{id:R,className:"timepicker-clock-wrapper d-flex justify-content-center flex-column align-items-center",ref:t,...e,children:b.jsxs("div",{onMouseDown:O=>W(O),onMouseUp:O=>et(O),ref:n,className:"timepicker-clock timepicker-clock-animation",children:[b.jsx("span",{className:"timepicker-middle-dot position-absolute"}),b.jsx("div",{className:`timepicker-hand-pointer position-absolute ${C&&"timepicker-transform"}`,style:{transform:`rotateZ(${g==="hours"?T:E}deg)`,height:g==="hours"?$:"calc(40% + 1px)"},children:b.jsx("div",{className:"timepicker-circle position-absolute",style:{backgroundColor:"rgb(25, 118, 210)"}})}),g==="hours"&&d==="24h"&&b.jsx("div",{ref:i,className:"timepicker-clock-inner",children:B.map(O=>{if(O.value>12||O.value===0)return b.jsx("span",{id:O.id,className:`timepicker-time-tips-inner ${Ki(O.value,p,f,y,v,m)&&"disabled"} ${O.value===h&&"active"}`,style:{left:O.left,bottom:O.bottom},children:b.jsx("span",{className:"timepicker-tips-inner-element",children:O.value===24?"00":O.value})},O.id)})}),g==="hours"&&B.map(O=>{if(d==="24h"){if(O.value<13&&O.value!==0)return b.jsx("span",{id:O.id,className:`timepicker-time-tips-hours ${Ki(O.value,p,f,y,v,m)&&"disabled"} ${O.value===h&&"active"}`,style:{left:O.left,bottom:O.bottom},children:b.jsx("span",{className:"timepicker-tips-element",children:O.value})},O.id)}else return b.jsx("span",{id:O.id,className:`timepicker-time-tips-hours ${Ki(O.value,p,f,y,v,m)&&"disabled"} ${O.value===h&&"active"}`,style:{left:O.left,bottom:O.bottom},children:b.jsx("span",{className:"timepicker-tips-element",children:O.value})},O.id)}),g==="minutes"&&D.map(O=>b.jsx("span",{id:O.id,className:`timepicker-time-tips-minutes ${vp(f,p,h,O.value,M,P,y,v,m)&&"disabled"} ${_===O.value&&"active"}`,style:{left:O.left,bottom:O.bottom},children:b.jsx("span",{className:"timepicker-tips-element",children:O.value<10?`0${O.value}`:O.value})},O.id))]})})});MT.displayName="MDBTimePickerClock";const CT=Y.forwardRef(({...e},t)=>{const{setInputValue:n,cancelLabel:i,submitLabel:s,clearLabel:r,activeHour:o,period:a,activeMinute:l,maxHour:c,maxMinute:u,minHour:d,minMinute:h,maxPeriod:f,minPeriod:p,defaultValue:m,setActiveHour:v,setActiveMinute:y,setPeriod:g,format:x,setHourAngle:_,setMinuteAngle:w,onChange:S,onCloseHandler:C,setMode:M}=k.useContext(nf);return b.jsx("div",{className:"timepicker-footer",ref:t,...e,children:b.jsxs("div",{className:"w-100 d-flex justify-content-between",children:[b.jsx(Zt,{onClick:()=>{if(m!==""&&m!==void 0){const{hour:P,minute:T,defaultPeriod:A}=ld(m);x==="24h"?(v(P===0?24:P),P===0?_(360):P>12?_((P-12)*30):_(P*30)):(v(P),_(P*30),g(A)),y(T),w(T*6),n(m),S==null||S(m)}else v(12),_(360),y(0),w(360),n(""),S==null||S(""),g(x==="24h"?"":"AM");M("hours")},type:"button",color:"none",className:"timepicker-button timepicker-clear",tabIndex:0,children:r}),b.jsx(Zt,{onClick:()=>C==null?void 0:C(),type:"button",color:"none",className:"timepicker-button timepicker-cancel",tabIndex:0,children:i}),b.jsx(Zt,{onClick:()=>{if(Ki(o,c,d,a,f,p)||Ki(l,u,h,a,f,p))return;C==null||C();const P=o===24?"00":o<10?`0${o}`:o,T=l<10?`0${l}`:l,A=`${P}:${T} ${a}`.trim();n(A),S==null||S(A)},type:"button",color:"none",className:"timepicker-button timepicker-submit",tabIndex:0,children:s})]})})});CT.displayName="MDBTimePickerFooter";const L4=({isOpen:e,inline:t})=>{k.useEffect(()=>{if(t)return;const n=window.innerWidth>document.documentElement.clientWidth&&window.innerWidth>=576,i=`${window.innerWidth-document.documentElement.clientWidth}px`;return e&&n?(document.body.style.overflow="hidden",document.body.style.paddingRight=i):(document.body.style.overflow="",document.body.style.paddingRight=""),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[e,t])},R4=({className:e,isOpen:t,wrapperRef:n,inline:i,referenceElement:s,onOpened:r,onClosed:o})=>{const[a,l]=k.useState(null),c=I("timepicker-modal",!i&&"position-fixed",e),u=I("timepicker-wrapper","animation","h-100","d-flex","align-items-center","justify-content-center","flex-column",i?"timepicker-wrapper-inline":"position-fixed","fade",t&&"show"),{styles:d,attributes:h}=Oh(s,a,{placement:"bottom-start"}),f=p=>{p.opacity===0?o():r()};return L4({isOpen:t,inline:i}),b.jsx(b.Fragment,{children:b.jsx(aa,{children:b.jsx(Zy,{children:t&&(i?b.jsx(Jo.div,{className:c,style:d.popper,...h.popper,role:"dialog",ref:l,tabIndex:-1,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onAnimationComplete:p=>f(p),children:b.jsx("div",{ref:n,className:u,children:b.jsx("div",{className:"d-flex align-items-center justify-content-center flex-column shadow timepicker-container",style:{overflowY:"inherit"},children:b.jsx("div",{className:"d-flex flex-column timepicker-elements justify-content-around timepicker-elements-inline",children:b.jsx(ig,{})})})})}):b.jsx(Jo.div,{className:c,role:"dialog",tabIndex:-1,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},onAnimationComplete:p=>f(p),children:b.jsx("div",{ref:n,className:u,children:b.jsxs("div",{className:"d-flex align-items-center justify-content-center flex-column shadow timepicker-container",children:[b.jsxs("div",{className:"d-flex flex-column timepicker-elements justify-content-around",children:[b.jsx(ig,{}),b.jsx(MT,{})]}),b.jsx(CT,{})]})})}))})})})},G_=(e,t,n,i,s)=>{const r=n?55:59,o=n?5:1;let a;s?a=i>=r?0:i+o:a=i<=0?r:i-o,e(a),t(a*6)},Au=(e,t,n,i,s,r)=>{if(r&&e==="24h"){let l=t;r==="isLeft"&&(l=t<=12?t+12:t),r==="isRight"&&(l=t>12?t-12:t),n(l),i(l*30);return}const o=e==="12h"?12:24;let a=t===1?o:t-1;s?a=t===o?1:t+1:a=t===1?o:t-1,n(a),i(a*30)},q_=(e,t,n)=>{const i=n==null?void 0:n.querySelectorAll('[tabindex="0"]');i&&i[t]&&(i[t].focus(),t===i.length-1?e(0):e(t+1))},N4=(e,t,n,i,s,r)=>{var o;!t&&e.target===n&&r&&(r==null||r()),t&&e.target!==n&&!(n!=null&&n.contains(e.target))&&e.target!==(i==null?void 0:i.parentNode)&&!((o=i==null?void 0:i.parentNode)!=null&&o.contains(e.target))&&s&&(r==null||r())},Q_="ArrowLeft",Z_="ArrowUp",J_="ArrowRight",tw="ArrowDown",ew="Enter",nw="Escape",iw="Tab",PT=k.forwardRef(({isInDatetimepicker:e,onDatetimepickerModeSwitch:t,datetimepickerRef:n,className:i,defaultValue:s,value:r,minHour:o,maxHour:a,maxTime:l,minTime:c,noIcon:u=!1,inputID:d,justInput:h=!1,inputClasses:f,inputLabel:p,invalidLabel:m,clearLabel:v,submitLabel:y,cancelLabel:g,format:x="12h",timePickerClasses:_,customIcon:w="far fa-clock",customIconSize:S="sm",btnIcon:C=!0,inline:M=!1,increment:P=!1,onChange:T,inputStyle:A,onOpen:E,onOpened:z,onClose:N,onClosed:L,disableFuture:R,disablePast:B,disabled:D=!1,amLabel:$="AM",pmLabel:F="PM",switchHoursToMinutesOnClick:V=!0,headId:W="",bodyId:et="",open:Z,style:O,...U},lt)=>{const ct=k.useMemo(()=>s instanceof Date?xp(s,x):s,[]),kt=k.useMemo(()=>r instanceof Date?xp(r,x):r,[r,x]),[it,Lt]=k.useState(!1),[Ct,Qt]=k.useState(!1),ft=ef(Ct,Z),[wt,dt]=k.useState(kt||ct||""),[jt,pt]=k.useState(!1),[xt,J]=k.useState(12),[mt,q]=k.useState(0),[ye,Dt]=k.useState(x==="24h"?"":"AM"),[he,Un]=k.useState(a||24),[Yn,Mn]=k.useState(o||1),[Si,dn]=k.useState(59),[Mi,as]=k.useState(0),[ls,Ci]=k.useState(""),[Pi,Ke]=k.useState(""),[Xn,Ti]=k.useState("hours"),[j,Q]=k.useState(!1),[It,nt]=k.useState(360),[Tt,Oe]=k.useState(360),[cs,ai]=k.useState(null),[Kn,Me]=k.useState(0);s instanceof Date&&(s=xp(s,x));const Kr=k.useId(),Gr=d??Kr,Cn={input:p??"Select a time",invalid:m??"Invalid Time Format",clear:v??"Clear",submit:y??"Ok",cancel:g??"Cancel"},ca=I("timepicker",i),Dc=I("timepicker-input",jt&&"is-invalid",f),sf=k.useRef(null),G=k.useRef(null),X=k.useRef(null),rt=k.useRef(null);k.useImperativeHandle(lt,()=>rt.current,[rt]);const ht=Rt=>{dt(Rt.target.value),T==null||T(Rt.target.value)},hn=Rt=>{h&&(Rt.target.blur(),E==null||E())},us=k.useCallback(()=>{Qt(!1),N==null||N()},[N]),Ge=k.useCallback(()=>{Qt(!0),E==null||E()},[E]),fn=k.useCallback(()=>{Lt(!1),L==null||L(),Ti("hours"),Me(0)},[L]),NT=k.useCallback(()=>{Lt(!0),z==null||z()},[z]),rf=k.useCallback(Rt=>{it&&N4(Rt,M,X.current,rt.current,ft,us)},[X,M,rt,ft,us,it]),of=k.useCallback(Rt=>{var Pn,pn;const{key:A0}=Rt,ua=document.activeElement,jT=ua===((Pn=X.current)==null?void 0:Pn.querySelector(".timepicker-hour")),$T=ua===((pn=X.current)==null?void 0:pn.querySelector(".timepicker-minute")),IT=ua==null?void 0:ua.closest('.timepicker-modal [tabindex="0"]');if(![tw,Z_,nw,iw,ew,Q_,J_].includes(A0))return;M&&!IT&&q_(Me,0,X.current),Rt.preventDefault();const Ec=!M&&Xn==="hours"||M&&jT,O0=!M&&Xn==="minutes"||M&&$T;switch(A0){case nw:return N==null?void 0:N();case Z_:if(Ec)return Au(x,xt,J,nt,!0);if(O0)return G_(q,Oe,P,mt,!0);break;case tw:if(Ec)return Au(x,xt,J,nt,!1);if(O0)return G_(q,Oe,P,mt,!1);break;case Q_:if(Ec&&!M)return Au(x,xt,J,nt,!1,"isLeft");break;case J_:if(Ec&&!M)return Au(x,xt,J,nt,!0,"isRight");break;case iw:q_(Me,Kn,X.current);break;case ew:ua.click();break}},[xt,x,Xn,mt,P,M,Kn,N]);return k.useEffect(()=>{if(!B&&!R)return;const{hours:Rt,minutes:Pn,period:pn}=O4(x);if(B)return Mn(Rt),as(Pn),Ci(pn);if(R)return Un(Rt),dn(Pn),Ke(pn)},[R,B,x]),k.useEffect(()=>(ft&&it&&(document.addEventListener("click",rf),document.addEventListener("keydown",of)),()=>{document.removeEventListener("click",rf),document.removeEventListener("keydown",of)}),[ft,it,rf,of]),k.useEffect(()=>{if(l){const{hour:Rt,minute:Pn,defaultPeriod:pn}=ld(l);Un(Rt),dn(Pn),pn!==void 0&&Ke(pn)}if(c){const{hour:Rt,minute:Pn,defaultPeriod:pn}=ld(c);Mn(Rt),as(Pn),pn!==void 0&&Ci(pn)}},[l,c]),k.useEffect(()=>{typeof r=="string"&&r&&X_(r,x)&&dt(r)},[r,x]),k.useEffect(()=>{if(X_(wt,x)||wt===""){if(pt(!1),wt!==""){const{hour:Rt,minute:Pn,defaultPeriod:pn}=ld(wt);x==="24h"?(J(Rt===0?24:Rt),Rt===0?nt(360):Rt>12?nt((Rt-12)*30):nt(Rt*30)):(J(Rt),nt(Rt*30),Dt(pn)),q(Pn),Oe(Pn*6)}}else pt(!0)},[wt,x]),k.useEffect(()=>{let Rt;return j&&(Rt=setTimeout(()=>{Q(!1)},400)),()=>{clearTimeout(Rt)}},[j]),b.jsx(b.Fragment,{children:b.jsx(nf.Provider,{value:{isInDatetimepicker:e,onDatetimepickerModeSwitch:t,show:ft,setInputValue:dt,submitLabel:Cn.submit,clearLabel:Cn.clear,cancelLabel:Cn.cancel,activeHour:xt,activeMinute:mt,setActiveHour:J,setActiveMinute:q,format:x,period:ye,setPeriod:Dt,defaultValue:s,maxHour:he,minHour:Yn,maxPeriod:Pi,minPeriod:ls,mode:Xn,setMode:Ti,setHandAnimation:Q,handAnimation:j,minMinute:Mi,maxMinute:Si,hourAngle:It,setHourAngle:nt,minuteAngle:Tt,setMinuteAngle:Oe,inline:M,increment:P,onChange:T,onOpen:E,onClose:N,onCloseHandler:us,amLabel:$,pmLabel:F,switchHoursToMinutesOnClick:V,headId:W,bodyId:et},children:b.jsxs(b.Fragment,{children:[b.jsx("div",{className:ca,ref:M?ai:sf,style:{...O,height:"fit-content"},...U,children:!e&&b.jsx(wi,{onFocus:hn,ref:rt,labelRef:G,className:Dc,label:Cn.input,id:Gr,value:wt,onChange:ht,wrapperClass:"timepicker",style:A,disabled:D,onClick:()=>{h&&Ge()},children:!h&&!u&&(C?b.jsx(Zt,{className:"timepicker-toggle-button",onClick:Ge,color:"none",tabIndex:0,type:"button",disabled:D,style:{pointerEvents:D?"none":"auto"},children:b.jsx("i",{className:`${w} ${S} timepicker-icon`})}):b.jsx("i",{onClick:Ge,className:`${w} ${S} timepicker-icon timepicker-toggle-button`}))})}),b.jsx(R4,{isOpen:ft,wrapperRef:X,referenceElement:n||cs,inline:M,className:_,onClosed:fn,onOpened:NT})]})})})});PT.displayName="MDBTimepicker";const j4=({className:e,dropdown:t,children:n,styles:i,attributes:s,setPopperElement:r,style:o,onClosed:a,onOpened:l})=>{const c={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3}},u=I("datepicker-dropdown-container",e),d=I("datepicker-modal-container",e),h=f=>{f.opacity===0?a==null||a():l==null||l()};return b.jsx(b.Fragment,{children:t?b.jsx(Jo.div,{style:{position:"absolute",zIndex:1065,...i.popper},...s.popper,ref:r,className:u,tabIndex:-1,...c,onAnimationComplete:f=>h(f),children:n}):b.jsx(Jo.div,{...c,className:d,style:o,onAnimationComplete:f=>h(f),children:n})})},Ce={closeOnEsc:!0,title:"Select date",okBtnText:"Ok",clearBtnText:"Clear",cancelBtnText:"Cancel",customIcon:"far fa-calendar",customHeader:"",inputLabel:"Select a date",monthsFull:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],views:"days",format:"dd/mm/yyyy",weekdaysFull:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysNarrow:["S","M","T","W","T","F","S"],startDay:0};function Te(e){return e.getDate()}function sw(e){return e.getDay()}function Pt(e){return e.getMonth()}function ot(e){return e.getFullYear()}function $4(e,t,n){const i=n,s=i>0?7-i:0,r=new Date(e,t).getDay()+s;return r>=7?r-7:r}function I4(e){return e.getDate()===rc(e)}function sg(e){return I4(e)?rc(new Date(ot(e),Pt(e)+1,1)):Te(e)}function rc(e){return F4(e).getDate()}function F4(e){return Or(e.getFullYear(),e.getMonth()+1,0)}function Ro(){return new Date}function Ln(e,t){return Je(e,t*12)}function Je(e,t){const n=Or(e.getFullYear(),e.getMonth()+t,e.getDate()),i=Te(e),s=Te(n);return i!==s&&n.setDate(0),n}function eo(e,t){return Or(e.getFullYear(),e.getMonth(),e.getDate()+t)}function Or(e,t,n){const i=new Date(e,t,n);return e>=0&&e<100&&i.setFullYear(i.getFullYear()-1900),i}function rg(e){return!Number.isNaN(e.getTime())}function rw(e,t){return ot(e)-ot(t)||Pt(e)-Pt(t)||Te(e)-Te(t)}function vs(e,t){return e.setHours(0,0,0,0),t.setHours(0,0,0,0),e.getTime()===t.getTime()}function ow(e){return parseInt(e,10)<10?`0${e}`:e}function og(e,t){const n=ot(e)-TT(0,null,null);return B4(n,t)}function B4(e,t){return(e%t+t)%t}function TT(e,t,n){let i=0;return n?i=ot(n)-e+1:t&&(i=ot(t)),i}function No(e,t,n,i){const s=t&&rw(e,t)<=0,r=n&&rw(e,n)>=0,o=i&&i(e)===!1;return!!(s||r||o)}function ag(e,t,n,i,s,r){const o=i&&ot(i),a=i&&Pt(i),l=n&&ot(n),c=n&&Pt(n),u=new Date().getFullYear(),d=new Date().getMonth();if(r&&u===t&&ed||r&&u>t||s&&uo||t===o&&e>a:!1,f=c&&l?tr)return!0;const o=t&&ot(t),a=n&&ot(n),l=a?e>a:!1,c=o?en===e)}function aw(e,t,n,i,s){return s?DT(e,s,t,n,i,s):!1}function lw(e,t,n,i,s){return i?DT(e,i,t,n,i,s):!1}function DT(e,t,n,i,s,r){if(n==="days")return ot(e)===ot(t)&&Pt(e)===Pt(t);if(n==="months")return ot(e)===ot(t);if(n==="years"){const o=TT(i,s,r);return Math.floor((ot(e)-o)/i)===Math.floor((ot(t)-o)/i)}return!1}function lh(e,t,n,i){let s;if(t){const r=V4(t);if(r){r[0]!==r[1]?s=r[0]+r[1]:s=r[0];const o=new RegExp(`[${s}]`),a=e.split(o),l=t==null?void 0:t.split(o),c=(t==null?void 0:t.indexOf("mmm"))!==-1,u=[];l==null||l.forEach((m,v)=>{m.indexOf("yy")!==-1&&(u[0]={value:a[v],format:m}),m.indexOf("m")!==-1&&(u[1]={value:a[v],format:m}),m.indexOf("d")!==-1&&m.length<=2&&(u[2]={value:a[v],format:m})});let d;(t==null?void 0:t.indexOf("mmmm"))!==-1?d=n:d=i;const h=Number(u[0].value),f=c?z4(u[1].value,d):Number(u[1].value)-1,p=Number(u[2].value);return Or(h,f,p)}}}function cw(e,t,n,i,s,r){const o=Te(e),a=ow(Te(e).toString()),l=n[sw(e)],c=i[sw(e)],u=Pt(e),d=ow((Pt(e)+1).toString()),h=s[Pt(e)],f=r[Pt(e)],p=ot(e).toString().length===2?ot(e):ot(e).toString().slice(2,4),m=ot(e),v=t.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g);let y="";return v.forEach(g=>{switch(g){case"dddd":g=g.replace(g,c);break;case"ddd":g=g.replace(g,l);break;case"dd":g=g.replace(g,a);break;case"d":g=g.replace(g,o.toString());break;case"mmmm":g=g.replace(g,f);break;case"mmm":g=g.replace(g,h);break;case"mm":g=g.replace(g,d);break;case"m":g=g.replace(g,u.toString());break;case"yyyy":g=g.replace(g,m.toString());break;case"yy":g=g.replace(g,p.toString());break}y+=g}),y}const ET=(e,t)=>{if(!t)return!1;const n=new Date;return n.setHours(0,0,0,0)===e.setHours(0,0,0,0)?!1:et?e>new Date:!1,ir=Y.createContext({view:"days",setView:null,activeDate:new Date,setActiveDate:null,selectedDate:new Date,setSelectedDate:null,weekdaysShort:[],monthsShort:[],monthsFull:[],min:void 0,max:void 0,weekdaysFull:[],yearScope:[],tabCount:0,inline:!1,disableFuture:!1,disablePast:!1}),W4=({clearBtnText:e="Clear",cancelBtnText:t="Cancel",okBtnText:n="Ok",setValue:i,selectDate:s,onClose:r})=>{const{setActiveDate:o,setSelectedDate:a,selectedDate:l,isInDatetimepicker:c,onDatetimepickerModeSwitch:u}=k.useContext(ir),d=h=>{h.currentTarget.blur(),o(new Date),a(void 0),i("")};return b.jsxs("div",{className:"datepicker-footer",children:[b.jsx("button",{tabIndex:0,onClick:h=>d(h),className:"datepicker-footer-btn datepicker-clear-btn",children:e}),b.jsx("button",{tabIndex:0,onClick:()=>r==null?void 0:r(),className:"datepicker-footer-btn datepicker-cancel-btn",children:t}),b.jsx("button",{tabIndex:0,onClick:()=>{s(l),c&&(u==null||u()),r==null||r()},className:"datepicker-footer-btn datepicker-ok-btn",children:n})]})},H4=(e,t,n)=>{const i=document.createElement("button"),s=document.createElement("div");i.id=`datepicker-toggle-${Math.floor(Math.random()*10001)}`,i.tabIndex=0,i.type="button",i.style.pointerEvents="auto";const r=document.createElement("i");r.className=`${e} fa-${t} datepicker-icon`,n&&i.appendChild(r);const o=n?i:r;return o.classList.add("datepicker-toggle-button"),{div:s,selector:o}},U4=(e,t,n,i,s,r)=>{const o=[],a=Pt(e),l=Pt(Je(e,-1)),c=Pt(Je(e,1)),u=ot(e),d=$4(u,a,r),h=rc(e),f=rc(Je(e,-1)),p=7;let m=1,v=!1;for(let y=1;yh&&(m=1,v=!1);const _=Or(u,v?a:c,m);g.push({date:_,currentMonth:v,isSelected:t&&vs(_,t),isToday:vs(_,Ro()),dayNumber:Te(_),disabled:No(_,n,i,s)}),m++}o.push(g)}return o},Y4=e=>{const t=[],n=e[0];let i=[];for(let s=0;s<24;s++)if(i.push(n+s),i.length===4){const r=i;t.push(r),i=[]}return t},X4=e=>{const t=[];let n=[];return e.forEach(i=>{if(n.push(i),n.length===4){const s=n;t.push(s),n=[]}}),t},K4=({filter:e,startWeekdays:t,startDay:n,inlineDayClick:i,selectOnClick:s,selectDate:r,onClose:o})=>{const{min:a,max:l,setActiveDate:c,setSelectedDate:u,activeDate:d,selectedDate:h,tabCount:f,disableFuture:p,disablePast:m}=k.useContext(ir),v=y=>{!No(y,a,l,e)&&(c(y),u(y),i(y),s&&(r(y),o==null||o()))};return b.jsxs("table",{className:"datepicker-table",children:[b.jsx("thead",{children:b.jsx("tr",{children:t.map((y,g)=>b.jsx("th",{className:"datepicker-day-heading",scope:"col",children:y},g))})}),b.jsx("tbody",{className:"datepicker-table-body",children:U4(d,h,a,l,e,n).map((y,g)=>b.jsx("tr",{children:y.map((x,_)=>b.jsx("td",{onClick:()=>v(x.date),tabIndex:vs(x.date,d)?0:void 0,className:I("datepicker-cell","datepicker-small-cell","datepicker-day-cell",x.isToday&&"current",x.isSelected&&"selected",x.disabled&&"disabled",f===3&&vs(x.date,d)&&"focused",Pt(d)!==Pt(x.date)&&"disabled",AT(x.date,p)&&"disabled",ET(x.date,m)&&"disabled"),children:b.jsx("div",{className:"datepicker-cell-content datepicker-small-cell-content",style:{display:x.currentMonth?"block":"none"},children:x.dayNumber})},_))},g))})]})},G4=()=>{const{yearScope:e,setView:t,setActiveDate:n,activeDate:i,selectedDate:s,tabCount:r,min:o,max:a,disableFuture:l,disablePast:c}=k.useContext(ir);return b.jsx("table",{className:"datepicker-table",children:b.jsx("tbody",{className:"datepicker-table-body",children:Y4(e).map((u,d)=>b.jsx("tr",{children:u.map(h=>b.jsx("td",{onClick:()=>{n(new Date(h,Pt(i),Te(i))),t("months")},tabIndex:h===ot(i)?0:void 0,className:I("datepicker-cell","datepicker-large-cell","datepicker-year-cell",s&&h===ot(s)&&"selected",r===3&&h===ot(i)&&"focused",lg(h,o,a,l,c)&&"disabled",ot(Ro())===h&&"current"),children:b.jsx("div",{className:"datepicker-cell-content datepicker-large-cell-content",children:h})},h))},d))})})},q4=()=>{const{monthsShort:e,setActiveDate:t,setView:n,activeDate:i,selectedDate:s,tabCount:r,min:o,max:a,disableFuture:l,disablePast:c}=k.useContext(ir);return b.jsx("table",{className:"datepicker-table",children:b.jsx("tbody",{className:"datepicker-table-body",children:X4(e).map((u,d)=>b.jsx("tr",{children:u.map(h=>b.jsx("td",{onClick:()=>{t(new Date(ot(i),e.indexOf(h),sg(i))),n("days")},tabIndex:e.indexOf(h)===Pt(i)?0:void 0,className:I("datepicker-cell","datepicker-large-cell","datepicker-month-cell",s&&e.indexOf(h)===Pt(s)&&ot(i)===ot(s)&&"selected",r===3&&e.indexOf(h)===Pt(i)&&"focused",Pt(Ro())===e.indexOf(h)&&ot(Ro())===ot(i)&&"current",ag(e.indexOf(h),ot(i),o,a,l,c)&&"disabled"),children:b.jsx("div",{className:"datepicker-cell-content datepicker-large-cell-content",children:h})},e.indexOf(h)))},d))})})},Q4=({title:e,customHeader:t})=>{const{weekdaysShort:n,monthsShort:i,selectedDate:s,isInDatetimepicker:r,onDatetimepickerModeSwitch:o}=k.useContext(ir),a=s||new Date;return b.jsxs("div",{className:"datepicker-header",children:[b.jsx("div",{className:"datepicker-title",children:b.jsx("span",{className:"datepicker-title-text",children:e})}),b.jsxs("div",{className:"datepicker-date",children:[!t&&b.jsxs("span",{className:"datepicker-date-text",children:[n[a.getDay()],", ",i[a.getMonth()]," ",a.getDate()]}),t&&t]}),r&&b.jsxs("div",{className:"buttons-container",children:[b.jsx("button",{type:"button",className:"datepicker-button-toggle",children:b.jsx("i",{className:"far fa-calendar datepicker-toggle-icon"})}),b.jsx("button",{type:"button",className:"timepicker-button-toggle",onClick:o,children:b.jsx("i",{className:"far fa-clock fa-sm timepicker-icon"})})]})]})},Z4=()=>{const{view:e,setView:t,activeDate:n,setActiveDate:i,monthsFull:s,min:r,max:o,yearScope:a}=k.useContext(ir),l=c=>{if(e==="days"){const u=c?new Date(ot(n),Pt(n)+1,sg(n)):new Date(ot(n),Pt(n)-1,sg(n));c?!aw(Je(u,-1),"days",1,r,o)&&i(u):!lw(Je(u,1),"days",1,r,o)&&i(u)}else if(e==="years"){const u=c?new Date(ot(n)+24,Pt(n),Te(n)):new Date(ot(n)-24,Pt(n),Te(n));c?o?a[0]+24ot(r)&&i(u):i(u)}else if(e==="months"){const u=c?new Date(ot(n)+1,Pt(n),Te(n)):new Date(ot(n)-1,Pt(n),Te(n));c?!aw(Ln(u,-1),"months",1,r,o)&&i(u):!lw(Ln(u,1),"months",1,r,o)&&i(u)}};return b.jsxs("div",{className:"datepicker-date-controls",children:[e==="days"&&b.jsxs("button",{tabIndex:0,className:"datepicker-view-change-button",onClick:()=>t("years"),children:[s[n.getMonth()]," ",n.getFullYear()]}),e==="years"&&b.jsxs("button",{tabIndex:0,className:"datepicker-view-change-button",onClick:()=>t("days"),children:[a[0]," - ",a[1]]}),e==="months"&&b.jsx("button",{tabIndex:0,className:"datepicker-view-change-button",onClick:()=>t("days"),children:ot(n)}),b.jsxs("div",{className:"datepicker-arrow-controls",children:[b.jsx("button",{tabIndex:0,className:"datepicker-previous-button",onClick:()=>l(!1)}),b.jsx("button",{tabIndex:0,className:"datepicker-next-button",onClick:()=>l(!0)})]})]})},J4=({labelText:e,inline:t,setReferenceElement:n,inputClasses:i,value:s,style:r,inputStyle:o,icon:a,input:l,inputId:c,inputToggle:u,setDatepickerValue:d,format:h,onOpenHandler:f,...p})=>{const{monthsFull:m,monthsShort:v,setSelectedDate:y,setActiveDate:g}=k.useContext(ir),x=I(s?"active":"",i),_=k.useRef(null);return k.useEffect(()=>{var w;if(u)return;const S=(w=_.current)==null?void 0:w.parentNode,{div:C,selector:M}=H4(a,"sm",!0);return S==null||S.insertBefore(C,_.current),S==null||S.insertBefore(M,_.current),M.addEventListener("click",()=>f==null?void 0:f()),()=>{M.removeEventListener("click",()=>f==null?void 0:f()),S==null||S.removeChild(M)}},[a,f,u]),b.jsx(wi,{className:x,label:e,id:c,ref:t?n:l,labelRef:_,wrapperClass:"datepicker",value:s,onChange:w=>{const S=lh(w.target.value,h,m,v);d(w.target.value),S&&rg(S)?(g(S),y(S)):(g(new Date),y(void 0))},style:o,wrapperStyle:r,onClick:()=>{u&&(f==null||f())},...p})},x0="ArrowLeft",b0="ArrowUp",_0="ArrowRight",w0="ArrowDown",k0="Home",S0="End",M0="PageUp",C0="PageDown",P0="Enter",T0=" ",t8=(e,t,n,i,s,r,o,a,l,c)=>{switch(e){case x0:t(u=>eo(u,-1));break;case _0:t(u=>eo(u,1));break;case b0:t(u=>eo(u,-7));break;case w0:t(u=>eo(u,7));break;case k0:t(u=>eo(u,1-Te(u)));break;case S0:t(u=>eo(u,rc(u)-Te(u)));break;case M0:t(u=>Je(u,-1));break;case C0:t(u=>Je(u,1));break;case P0:if(No(n,i,s,o)||ET(n,c)||AT(n,l))return;a(n),r(n);break;case T0:if(!o||o(n)){if(No(n,i,s,o))return;a(n),r(n)}break;default:return}},e8=(e,t,n,i,s,r,o,a,l)=>{switch(e){case x0:n(c=>Ln(c,-1));break;case _0:n(c=>Ln(c,1));break;case b0:n(c=>Ln(c,-4));break;case w0:n(c=>Ln(c,4));break;case k0:n(c=>Ln(c,-og(c,24)));break;case S0:n(c=>Ln(c,24-og(c,24)-1));break;case M0:n(c=>Ln(c,-24));break;case C0:n(c=>Ln(c,24));break;case P0:!lg(ot(t),i,s,a,l)&&r("months");break;case T0:!lg(ot(t),i,s,a,l)&&o(t);return;default:return}},n8=(e,t,n,i,s,r,o,a,l,c)=>{switch(e){case x0:n(u=>Je(u,-1));break;case _0:n(u=>Je(u,1));break;case b0:n(u=>Je(u,-4));break;case w0:n(u=>Je(u,4));break;case k0:n(u=>Je(u,-Pt(u)));break;case S0:n(u=>Je(u,11-Pt(u)));break;case M0:n(u=>Ln(u,-1));break;case C0:n(u=>Ln(u,1));break;case P0:!ag(Pt(t),ot(t),i,s,l,c)&&r("days");break;case T0:!ag(Pt(t),ot(t),i,s,l,c)&&o(t);return;default:return}},i8=({closeOnEsc:e,isOpen:t,activeDate:n,setActiveDate:i,min:s,max:r,view:o,setView:a,setSelectedDate:l,filter:c,setInlineDate:u,disableFuture:d,disablePast:h,onClose:f})=>{const[p,m]=k.useState(3),v=k.useRef(null),y=k.useCallback(g=>{var x,_,w;if(e&&g.key==="Escape"&&(f==null||f()),g.preventDefault(),!g.shiftKey&&g.key==="Tab"){const S=(x=v.current)==null?void 0:x.querySelectorAll('[tabindex="0"]');S&&(p===S.length-1?m(0):m(p+1))}else if(g.key==="Enter")p!==3&&document.activeElement&&document.activeElement.click();else if(g.shiftKey&&g.key==="Tab"){const S=(_=v.current)==null?void 0:_.querySelectorAll('[tabindex="0"]');S&&m(p===0?S.length-1:p-1)}(w=v.current)!=null&&w.querySelector(".focused")&&p!==4&&(o==="days"?t8(g.key,i,n,s,r,l,c,u,d,h):o==="years"?e8(g.key,n,i,s,r,a,l,d,h):o==="months"&&n8(g.key,n,i,s,r,a,l,c,d,h))},[n,o,c,r,s,e,p,a,i,l,u,d,h,f]);return k.useEffect(()=>{var g,x;const _=(g=v.current)==null?void 0:g.querySelectorAll('[tabindex="0"]');if(_){const w=_[p];if(w.tagName!=="TD"){w.focus();const S=(x=v.current)==null?void 0:x.querySelector(".focused");S==null||S.classList.remove("focused")}else _[p-1].blur(),w.classList.add("focused")}},[p]),k.useEffect(()=>{t||m(3)},[t]),k.useEffect(()=>{m(3)},[o]),k.useEffect(()=>{if(t)return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y)}},[y,t]),{tabCount:p,modalRef:v}},s8=({isOpen:e,inline:t})=>{k.useEffect(()=>{const n=window.innerWidth>document.documentElement.clientWidth&&window.innerWidth>=576;if(!t)return e&&n?(document.body.style.overflow="hidden",document.body.style.paddingRight="17px"):(document.body.style.overflow="",document.body.style.paddingRight=""),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[e,t])},r8=({isOpened:e,isOpen:t,inline:n,popperElement:i,referenceElement:s,backdropRef:r,onCloseHandler:o})=>{const a=k.useCallback(l=>{var c;n?!(i!=null&&i.contains(l.target))&&!((c=s==null?void 0:s.parentNode)!=null&&c.contains(l.target))&&!l.target.classList.contains("datepicker-view-change-button")&&!l.target.classList.contains("datepicker-large-cell-content")&&t&&o():l.target===r.current&&t&&o()},[i,s,r,n,t,o]);k.useEffect(()=>(e&&document.addEventListener("click",a),()=>{document.removeEventListener("click",a)}),[e,a])},OT=k.forwardRef(({datetimepickerRef:e,isInDatetimepicker:t,onDatetimepickerModeSwitch:n,closeOnEsc:i=Ce.closeOnEsc,customHeader:s,title:r=Ce.title,weekdaysNarrow:o=Ce.weekdaysNarrow,monthsFull:a=Ce.monthsFull,monthsShort:l=Ce.monthsShort,weekdaysFull:c=Ce.weekdaysFull,weekdaysShort:u=Ce.weekdaysShort,disableFuture:d,disablePast:h,filter:f,inline:p,className:m,min:v,max:y,format:g=Ce.format,okBtnText:x=Ce.okBtnText,clearBtnText:_=Ce.clearBtnText,cancelBtnText:w=Ce.cancelBtnText,inputToggle:S,customIcon:C=Ce.customIcon,inputId:M,inputLabel:P=Ce.inputLabel,inputStyle:T,startDay:A=Ce.startDay,views:E=Ce.views,style:z,defaultValue:N="",onChange:L,onClose:R,onClosed:B,onOpen:D,onOpened:$,getFormattedDateValues:F,value:V,wrapperClass:W,selectOnClick:et=!1,open:Z,disablePortal:O,...U},lt)=>{const[ct,kt]=k.useState(!1),[it,Lt]=k.useState(!1),Ct=ef(it,Z),[Qt,ft]=k.useState(new Date),[wt,dt]=k.useState(new Date),[jt,pt]=k.useState(E),[xt,J]=k.useState(V||N),[mt,q]=k.useState(),[ye,Dt]=k.useState(),[he,Un]=k.useState(o),[Yn,Mn]=k.useState([0,0]),Si=k.useRef(null),dn=k.useRef(null),Mi=k.useRef(N&&!0),{styles:as,attributes:ls}=Oh(e||ye,mt,{placement:"bottom-start",modifiers:[VM]});k.useImperativeHandle(lt,()=>p?ye:dn.current,[p,ye]);const Ci=nt=>{if(p&&p){const Tt=cw(nt,g,u,c,l,a);J(Tt),t&&(n==null||n()),Ke()}},Pi=nt=>{const Tt=nt&&cw(nt,g,u,c,l,a);Tt&&J(Tt)},Ke=k.useCallback(()=>{Lt(!1),R==null||R()},[R]),Xn=k.useCallback(()=>{Lt(!0),D==null||D()},[D]),Ti=k.useCallback(()=>{kt(!1),B==null||B()},[B]),j=k.useCallback(()=>{kt(!0),$==null||$()},[$]),{tabCount:Q,modalRef:It}=i8({closeOnEsc:i,isOpen:Ct,activeDate:Qt,setActiveDate:ft,min:v,max:y,view:jt,setView:pt,setSelectedDate:dt,filter:f,setInlineDate:Ci,disableFuture:d,disablePast:h});return s8({isOpen:Ct,inline:p}),r8({isOpened:ct,isOpen:Ct,inline:p,referenceElement:ye,popperElement:mt,backdropRef:Si,onCloseHandler:Ke}),k.useEffect(()=>{const nt=ot(Qt),Tt=og(Qt,24),Oe=nt-Tt;Mn([Oe,Oe+23])},[Qt]),k.useEffect(()=>{const nt=o.slice(A).concat(o.slice(0,A));Un(nt)},[o,A]),k.useEffect(()=>{if(!Ct)return;const nt=p?ye:dn.current,Tt=nt==null?void 0:nt.parentNode,Oe=Tt==null?void 0:Tt.querySelector("button");Oe?Oe.blur():nt==null||nt.blur()},[Ct,dn,ye,p,D]),k.useEffect(()=>{Z&&!Ct&&!ct&&(D==null||D(),Lt(!0))},[Z,Ct,ct,D]),k.useEffect(()=>{if(!Mi.current)return;const nt=lh(xt,g,a,l);nt&&rg(nt)&&(ft(nt),dt(nt)),Mi.current=!1},[N,xt,g,a,l]),k.useEffect(()=>{const nt=V&&lh(V,g,a,l);nt&&rg(nt)&&(ft(nt),dt(nt),J(V)),V===""&&(ft(new Date),dt(void 0),J(V))},[V,g,a,l]),k.useEffect(()=>{Ct||(pt(E),xt||(ft(new Date),dt(void 0)))},[Ct,E,xt]),k.useEffect(()=>{L==null||L(xt,Qt)},[xt]),k.useEffect(()=>{const nt=wt||new Date,Tt=String(nt.getDate()),Oe=u[nt.getDay()],cs=c[nt.getDay()],ai=l[nt.getMonth()],Kn=a[nt.getMonth()],Me=String(nt.getFullYear()),Kr=Me.slice(-2);F==null||F({dayNumber:Tt,weekdayShort:Oe,weekdayFull:cs,monthShort:ai,monthFull:Kn,yearFull:Me,yearShort:Kr})},[wt]),b.jsx(ir.Provider,{value:{isInDatetimepicker:t,onDatetimepickerModeSwitch:n,view:jt,setView:pt,activeDate:Qt,setActiveDate:ft,selectedDate:wt,setSelectedDate:dt,weekdaysShort:u,monthsShort:l,monthsFull:a,min:v,max:y,weekdaysFull:c,yearScope:Yn,tabCount:Q,isOpen:Ct,disablePast:h,disableFuture:d},children:b.jsxs(b.Fragment,{children:[!t&&b.jsx(J4,{inputClasses:m,labelText:P,inline:p,setReferenceElement:Dt,value:xt,setDatepickerValue:J,style:z,inputStyle:T,format:g,icon:C,input:dn,inputToggle:S,onOpenHandler:Xn,...U}),b.jsx(aa,{disablePortal:O,children:b.jsx(Zy,{children:Ct&&b.jsxs(b.Fragment,{children:[b.jsxs(j4,{className:W,dropdown:p,styles:as,attributes:ls,setPopperElement:q,onClosed:Ti,onOpened:j,children:[!p&&b.jsx(Q4,{title:r,customHeader:s,onClose:Ke}),b.jsxs("div",{className:"datepicker-main",ref:It,children:[b.jsx(Z4,{}),b.jsxs("div",{className:"datepicker-view",children:[jt==="days"&&b.jsx(K4,{startWeekdays:he,startDay:A,filter:f,inlineDayClick:Ci,selectDate:Pi,selectOnClick:et,onClose:Ke}),jt==="years"&&b.jsx(G4,{}),jt==="months"&&b.jsx(q4,{})]}),!p&&b.jsx(W4,{okBtnText:x,clearBtnText:_,cancelBtnText:w,setValue:J,selectDate:Pi,onClose:Ke})]})]},"datepicker-modal-container"),!p&&b.jsx(Jo.div,{className:"datepicker-backdrop",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},ref:Si})]})})})]})})});OT.displayName="MDBDatepicker";const o8=e=>{const t=/^([0-1]?[0-9]|2[0-3]):[0-5][0-9] [APap][mM]$/,n=/^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$/;return e.match(t)||e.match(n)},a8=e=>e&&Object.prototype.toString.call(e)==="[object Date]"&&!isNaN(e.getTime()),uw=300,l8=k.forwardRef(({className:e,label:t="Select Date and Time",labelStyle:n,labelClass:i,labelRef:s,inputClass:r="",inputRef:o,inline:a,disabled:l,defaultTime:c="",defaultDate:u="",value:d,invalidLabel:h,inputToggle:f=!1,timepickerOptions:p,datepickerOptions:m,showFormat:v,dateFormat:y="dd/mm/yyyy",timeFormat:g="12h",appendValidationInfo:x=!0,onChange:_,onOpen:w,onClose:S,onDatepickerOpen:C,onDatepickerClose:M,onTimepickerOpen:P,onTimepickerClose:T,...A},E)=>{const z=k.useRef(!1),[N,L]=k.useState(!1),[R,B]=k.useState(!1),[D,$]=k.useState(u),[F,V]=k.useState(c),[W,et]=k.useState(""),Z=k.useRef(),O=D?W.split(",")[0]:null,U=F?W.split(", ")[1]:null,lt=I("form-outline","datetimepicker",e),ct=()=>{const pt=O&&lh(O,y,Ce.monthsFull,Ce.monthsShort);return W&&!O&&!U||O&&!a8(pt)||U&&!o8(U)?r+" is-invalid":r},kt=k.useCallback(pt=>{$(pt)},[]),it=k.useCallback(pt=>{V(pt)},[]),Lt=k.useCallback(()=>{B(!1),z.current=!1,M==null||M()},[M]),Ct=k.useCallback(()=>{T==null||T(),L(!1),z.current=!1},[T]),Qt=k.useCallback(()=>{C==null||C()},[C]),ft=k.useCallback(()=>{P==null||P()},[P]),wt=()=>{B(!0),w==null||w(),z.current=!0},dt=k.useCallback(()=>{R?(B(!1),setTimeout(()=>{L(!0)},uw)):N&&(L(!1),setTimeout(()=>{B(!0)},uw))},[R,N]);k.useEffect(()=>{!F||!D||(_==null||_(`${D}, ${F}`),!d&&et(`${D}, ${F}`))},[F,D,_,d]),k.useEffect(()=>{d&&(et(d),_==null||_(d))},[d,_]),k.useEffect(()=>{!R&&!N&&!z.current&&(S==null||S())},[R,N,S]);const jt=pt=>{et(pt);const[xt,J]=pt.split(", ");$(xt||""),V(J||"")};return b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:lt,ref:Z,...A,children:[b.jsx(wi,{label:t,labelStyle:n,labelClass:i,ref:o||E,labelRef:s,placeholder:v?`${y}, ${g}`:void 0,value:d||W,onChange:pt=>{jt(pt.target.value),_==null||_(pt.target.value)},className:x?ct():r,disabled:l,onClick:()=>{f&&wt()},children:h&&b.jsx("div",{className:"invalid-feedback",children:h})}),!f&&b.jsx("button",{type:"button",className:"datetimepicker-toggle-button",onClick:wt,disabled:l,style:{pointerEvents:l?"none":"initial"},children:b.jsx("i",{className:"far fa-calendar datepicker-toggle-icon"})})]}),b.jsx(OT,{...m,inline:a,onChange:kt,format:y,datetimepickerRef:Z.current,defaultValue:u,value:D,onClose:Lt,onOpen:Qt,isInDatetimepicker:!0,open:R,onDatetimepickerModeSwitch:dt}),b.jsx(PT,{...p,inline:a,onChange:it,format:g,datetimepickerRef:Z.current,defaultValue:c,value:F,onClose:Ct,onOpen:ft,isInDatetimepicker:!0,open:N,onDatetimepickerModeSwitch:dt})]})});l8.displayName="MDBDateTimepicker";const c8=Y.forwardRef(({className:e,color:t,children:n,...i},s)=>{const r=I("toast-header",t&&`bg-${t}`,t&&t!=="light"&&"text-white",e);return b.jsx("div",{className:r,ref:s,...i,children:n})});c8.displayName="MDBToastHeader";const u8=Y.forwardRef(({className:e,children:t,color:n,...i},s)=>{const r=I("toast-body",n&&n!=="light"&&"text-white",e);return b.jsx("div",{className:r,ref:s,...i,children:t})});u8.displayName="MDBToastBody";const d8=Y.forwardRef(({className:e,white:t,children:n,...i},s)=>{const r=I("btn-close",t&&"btn-close-white",e);return b.jsx(Zt,{className:r,color:"none",ref:s,...i,children:n})});d8.displayName="MDBToastClose";const h8=0,f8=({selectedElements:e,optionHeight:t,data:n,multiple:i,selectAll:s,handleSelectAll:r,handleOptionClick:o,selectAllLabel:a,selectData:l,activeElementIndex:c,noResults:u,search:d})=>{const h=k.useMemo(()=>l.filter(v=>v.optgroup).map(v=>v.optgroup),[l]),f=k.useMemo(()=>{let v=0;return l.map(y=>(y.optgroup&&v++,{...y,groupIndex:v}))},[l]),p=k.useMemo(()=>l.filter(v=>!v.optgroup&&!v.hidden).length===0,[l]),m=v=>f.map(y=>{if(!y.optgroup&&v===y.groupIndex)return b.jsxs("div",{className:I("select-option",e.includes(y.elementPosition)&&"selected",y.disabled&&"disabled",y.hidden&&"d-none",c===y.elementPosition&&"active"),role:"option",style:{height:t},onClick:()=>o(y),children:[b.jsxs("span",{className:"select-option-text",children:[i&&b.jsx(oh,{disabled:y.disabled,disableWrapper:!0,checked:e.includes(y.elementPosition),readOnly:!0}),y.text,y.secondaryText&&b.jsx("span",{className:"select-option-secondary-text",children:y.secondaryText})]}),y.icon&&b.jsx("span",{className:"select-option-icon-container",children:b.jsx("img",{className:"select-option-icon rounded-circle",src:y.icon})})]},y.elementPosition)});return b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"select-options-list",children:[i&&s&&!p&&b.jsx("div",{className:I("select-option",e.length===n.filter(v=>!v.disabled).length&&"selected",c===-1&&"active"),role:"option",onClick:r,style:{height:t},children:b.jsxs("span",{className:"select-option-text",children:[b.jsx(oh,{disableWrapper:!0,checked:n.filter(v=>!v.disabled&&!v.optgroup).length===e.length,readOnly:!0}),a]})}),m(h8),!p&&(h==null?void 0:h.map((v,y)=>{const g=m(y+1).filter(x=>x!==void 0);if(g.length!==0)return b.jsxs("div",{className:"select-option-group",children:[b.jsx("label",{className:"select-option-group-label",style:{height:t},children:v}),g]},`select-option-group ${v} ${y}`)}))]}),d&&p&&b.jsx("div",{className:"select-no-results",style:{height:t},children:u})]})},_p="ArrowUp",wp="ArrowDown",dw="Enter",hw="Escape",fw="Tab",p8=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;no.includes(a))||!r.every(a=>i[a]===s[a]))return!1}return!0},m8=e=>e.map((t,n)=>({...t,elementPosition:n})),g8={open:{opacity:1,transform:"scaleY(1)",transition:{duration:.2}},closed:{opacity:0,transform:"scaleY(0.8)",transition:{duration:.2}}},Ra=-1,D0=k.forwardRef(({data:e,className:t,inputClassName:n,optionHeight:i=38,visibleOptions:s=5,disabled:r,placeholder:o,label:a,clearBtn:l,children:c,multiple:u,displayedLabels:d=5,optionsSelectedLabel:h="options selected",selectAll:f=!0,selectAllLabel:p="Select all",size:m,openRef:v,contrast:y=!1,open:g,onOpen:x,onOpened:_,onClose:w,onClosed:S,onValueChange:C,onChange:M,search:P=!1,searchLabel:T="Search...",searchFn:A,autoSelect:E=!1,noResultsText:z="No results",validation:N=!1,validFeedback:L="Valid",invalidFeedback:R="Invalid",preventFirstSelection:B=!1,value:D,animationVariants:$,disablePortal:F,...V},W)=>{const[et,Z]=k.useState(!1),O=ef(et,g),[U,lt]=k.useState(!0),[ct,kt]=k.useState(null),[it,Lt]=k.useState(),[Ct,Qt]=k.useState();k.useImperativeHandle(W,()=>it,[it]);const[ft,wt]=k.useState(""),[dt,jt]=k.useState(""),[pt,xt]=k.useState(()=>f?Ra:e.findIndex(G=>!G.disabled)),[J,mt]=k.useState([]),[q,ye]=k.useState([]),[Dt,he]=k.useState(q),[Un,Yn]=k.useState(""),[Mn,Si]=k.useState(0),[dn,Mi]=k.useState(!1),as=I("select-wrapper",t),ls=I("select-input",o&&"placeholder-active",O&&"focused",n),Ci=I(O||ct&&a?"active":"",a&&"select-label"),Pi=I("select-dropdown",O&&"open"),{styles:Ke,attributes:Xn}=Oh(it,Ct,{placement:"bottom-start"}),Ti=k.useRef(null),j=k.useRef(null),Q=k.useRef(null),It=k.useMemo(()=>u&&f?s+1:s,[f,s,u]);k.useEffect(()=>{if(!dt)return he(q);if(A&&dt){const G=A(dt,q);return he(G||[])}he(()=>q.filter(G=>{var X;return((X=G.text)==null?void 0:X.toLocaleLowerCase().includes(dt.toLocaleLowerCase()))||G.optgroup}))},[dt,q,A,ft]),k.useEffect(()=>{O&&dt&&xt(-1)},[O,dt]),k.useEffect(()=>{if(!N)return;const G=J.every(ht=>q[ht].value),X=J.every(ht=>!q[ht].disabled),rt=J.length>0;!u&&(!rt||!G||!X)||u&&(!rt||!X)?it==null||it.setCustomValidity(R):it==null||it.setCustomValidity("")},[N,R,J,it,q,ft,u]);const nt=G=>{if(q.length===0)return;const X=j.current,rt=X.offsetHeight,ht=X.scrollTop,hn=q.filter(Ge=>Ge.hidden&&Ge.elementPosition(u&&f?-2:-1)){const Ge=(us-hn)*i,fn=Ge+i>ht+rt;Ge{const G=rt=>Dt.findIndex(ht=>ht.elementPosition==rt);let X=pt;for(;X{let G=pt;for(;G>=0;){G-=1;const X=Dt.findIndex(ht=>ht.elementPosition==G)!=-1,rt=G>=0&&(q[G].disabled||q[G].hidden||q[G].optgroup);if(G<=0&&(!X||rt))return u&&f?G=-1:pt;if(X&&!rt)break}return G},cs=G=>{const{key:X}=G;if([_p,wp,dw,fw,hw].includes(X)){if(X===fw)return E&&ca(Dt[pt]),it==null||it.focus(),Z(!1);if(G.preventDefault(),G.altKey&&(X===wp||X===_p))return O?w==null||w():x==null||x(),Z(!O);if(X===wp){const rt=Tt();return O?(nt(rt),xt(rt)):u?Z(!0):mt([rt])}if(X===_p){const rt=Oe();return O?(nt(rt),xt(rt)):u?Z(!0):mt([rt])}if(X===dw){const rt=Dt.findIndex(ht=>ht.elementPosition==pt);return O?pt===Ra?Kr():ca(Dt[rt]):(x==null||x(),Z(!0))}if(X===hw)return Z(!1),it==null?void 0:it.focus()}},ai=k.useCallback(()=>{Z(G=>!G)},[]),Kn=k.useCallback(G=>{if(v&&v.current===G.target)return;const X=Ct&&Ct!==null,rt=it&&it!==null,ht=!(Ct!=null&&Ct.contains(G.target))&&!(it!=null&&it.contains(G.target)),hn=G.target===Q.current;X&&O&&rt&&ht&&!hn&&(Z(!1),w==null||w())},[Ct,it,O,w,v]);k.useEffect(()=>{const G=m8(e);p8(G,q)||ye(G)},[e,q]);const Me=k.useCallback(()=>{O&&Yn(`${it==null?void 0:it.offsetWidth}px`)},[it,O]),Kr=()=>{if(!u||!f)return;if(J.length===e.filter(X=>!X.disabled&&!X.optgroup).length)return mt([]),C==null||C([]),M==null||M([]),Cn([]);const G=q==null?void 0:q.filter(X=>!X.disabled&&!X.optgroup).map(X=>X.elementPosition);return mt(G),C==null||C(e.filter(X=>!X.disabled)),M==null||M(e.filter(X=>!X.disabled)),Cn(G)},Gr=k.useCallback(()=>{if(q.length===0)return;let G=J[0];const X=G===void 0,rt=G>=q.length;if(dn&&!u){if(X&&B||!dn||u||rt)return;X&&(G=0);const ht=q[G].value,hn=String(q[G].text);hn?(kt(ht?null:hn),wt(ht?hn:"")):(kt(null),wt(ht?" ":""))}},[u,dn,J,q,B]),Cn=k.useCallback(G=>{const X=d===-1||G.length>d;if(G.length<=0&&(kt(null),wt("")),X)return kt(null),wt(`${G.length} ${h}`);const rt=G.map(fn=>q[fn].text||"").filter(fn=>fn!==""),ht=G.map(fn=>q[fn].value||"").filter(fn=>fn!==""),hn=rt.findIndex(fn=>fn!=="")===-1,us=ht.length>0,Ge=rt.join(", ");hn?(kt(null),wt(us?" ":"")):us?(wt(Ge),kt(null)):(wt(""),kt(Ge))},[d,h,q]);k.useEffect(()=>{Gr()},[J,Gr]);const ca=G=>{if(!G||G.disabled)return;const{elementPosition:X}=G;if(u){const rt=J.includes(X)?J.filter(ht=>ht!==X):[...J,X];return mt(rt),C==null||C(rt.map(ht=>e[ht])),M==null||M(rt.map(ht=>e[ht])),Cn(rt)}return mt([X]),Z(!1),C==null||C(e[X]),M==null||M(e[X]),w==null||w(),it==null?void 0:it.focus()};k.useEffect(()=>{Mi(!0)},[]),k.useEffect(()=>{if(u){const X=q.filter(rt=>rt.defaultSelected).map(rt=>rt.elementPosition);return Cn(X),mt(X)}let G=q.findIndex(X=>X.defaultSelected);G===Ra&&!B&&(G=q.findIndex(X=>!X.disabled&&!X.hidden)),G!==Ra&&mt([G])},[q,Cn,u,B]),k.useEffect(()=>{if(O&&P&&J.length===0)return xt(Ra);O||(J.length>0?xt(Math.max(...J)):xt(0))},[Dt,O,P,J]),k.useEffect(()=>{Si(It*i)},[It,i]),k.useEffect(()=>{Me()},[Me]),k.useEffect(()=>(O&&(window.addEventListener("click",Kn),window.addEventListener("resize",Me)),()=>{window.removeEventListener("click",Kn),window.removeEventListener("resize",Me)}),[Kn,Me,O]),k.useEffect(()=>{if(v){const G=v.current;return G==null||G.addEventListener("click",ai),()=>{G==null||G.removeEventListener("click",ai)}}},[v,ai]),k.useEffect(()=>{if(!D)return;const G=Array.isArray(D)?D:[D],X=q.filter(ht=>ht.value&&G.includes(ht.value)).map(ht=>ht.elementPosition);if(X.toString()===J.toString())return;const rt=u?X.map(ht=>q[ht]):q[X[0]];C==null||C(rt),M==null||M(rt),mt(X),u?Cn(X):Gr()},[D,q,u,C,M,J,Gr,Cn]);const Dc=k.useCallback(()=>{r||(it==null||it.focus(),O?w==null||w():x==null||x(),Z(!O))},[r,O,x,w,it]),sf=k.useCallback(G=>{var X;G==="open"&&(lt(!1),_==null||_(),P&&((X=Ti.current)==null||X.focus())),G==="closed"&&(lt(!0),S==null||S(),P&&jt(""))},[_,S,P]);return b.jsx("div",{className:as,...V,children:b.jsxs(b.Fragment,{children:[b.jsxs(wi,{ref:Lt,onClick:Dc,onKeyDown:cs,className:ls,value:ft,readonly:!N,required:N,disabled:r,placeholder:ct?void 0:o,label:a,labelClass:Ci,size:m,contrast:y,children:[N&&b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"invalid-feedback",children:R}),b.jsx("div",{className:"valid-feedback",children:L})]}),ct&&b.jsx("div",{className:"form-label select-fake-value active",children:ct}),l&&(ft.length>0||ct)&&b.jsx("span",{tabIndex:0,className:`select-clear-btn d-block ${r?"pe-none":""}`,role:"button",onClick:()=>{wt(""),mt([]),C==null||C(u?[]:{}),M==null||M(u?[]:{})},children:"✕"}),b.jsx("span",{className:`select-arrow ${r?"pe-none":""}`,ref:Q,onClick:Dc,style:{cursor:"pointer"}})]}),(e==null?void 0:e.length)>0&&(O||!U)&&b.jsx(aa,{disablePortal:F,children:b.jsx("div",{style:{...Ke.popper,width:Un,zIndex:1070},...Xn.popper,ref:Qt,className:"select-dropdown-container",children:b.jsx(Zy,{children:O&&b.jsxs(Jo.div,{variants:{...g8,...$},initial:"closed",animate:"open",exit:"closed",tabIndex:0,className:Pi,onAnimationStart:()=>{lt(!1)},onAnimationComplete:sf,children:[P&&b.jsx("div",{className:"input-group",children:b.jsx("input",{onKeyDown:cs,onChange:G=>jt(G.target.value),ref:Ti,type:"text",className:"form-control select-filter-input",role:"searchbox",placeholder:T})}),b.jsx("div",{className:"select-options-wrapper",ref:j,style:{maxHeight:`${Mn}px`},children:b.jsx(f8,{data:e,selectData:Dt,selectedElements:J,optionHeight:i,visibleOptions:It,handleOptionClick:ca,handleSelectAll:Kr,selectAll:f,selectAllLabel:p,multiple:u,activeElementIndex:pt,noResults:z,search:P})}),c&&b.jsx("div",{className:"select-custom-content",children:c})]})})})})]})})});D0.displayName="MDBSelectV2";const Tc=k.createContext({isLoading:!1,activePage:0,setActivePage:null,sort:{column:"",option:""},fixedHeader:!1,handleSort:null}),y8=({fullPagination:e,rowsText:t="Rows per page:",selectValue:n,setSelectValue:i,activeDataLength:s,entriesOptions:r=[10,25,50,200],fullDataLength:o,allText:a="All",ofText:l="of"})=>{const{isLoading:c,activePage:u,setActivePage:d}=k.useContext(Tc),h=u===0||c,f=s<=n*(u+1)||c,p=u===Math.floor(s/n),m=r.map(g=>({text:g.toString(),value:g,defaultSelected:n===g}));m.push({text:a,value:o,defaultSelected:n===o});const v=g=>{g instanceof Array||(i(g.value),d(0))},y=`${u*n+1} - ${(u+1)*n>s?s:(u+1)*n} ${l} ${s}`;return b.jsxs("div",{className:"datatable-pagination",children:[b.jsxs("div",{className:"datatable-select-wrapper",children:[b.jsx("p",{className:"datatable-select-text",children:t}),b.jsx(D0,{onValueChange:v,data:m,disabled:c})]}),b.jsx("div",{className:"datatable-pagination-nav",children:y}),b.jsxs("div",{className:"datatable-pagination-buttons",children:[e&&b.jsx(Zt,{disabled:h,onClick:()=>d(0),className:"datatable-pagination-button datatable-pagination-start",color:"link",children:b.jsx(sn,{icon:"angle-double-left"})}),b.jsx(Zt,{disabled:h,onClick:()=>d(u-1),className:"datatable-pagination-button datatable-pagination-left",color:"link",children:b.jsx(sn,{icon:"chevron-left"})}),b.jsx(Zt,{disabled:f,onClick:()=>d(u+1),className:"datatable-pagination-button datatable-pagination-right",color:"link",children:b.jsx(sn,{icon:"chevron-right"})}),e&&b.jsx(Zt,{disabled:p,onClick:()=>d(Math.floor(s/n)),className:"datatable-pagination-button datatable-pagination-end",color:"link",children:b.jsx(sn,{icon:"angle-double-right"})})]})]})},pw=(e,t,n)=>{const i=s=>s.toString().toLowerCase().includes(t.toLowerCase());return e.filter(s=>{if(n&&typeof n=="string")return i(s[n]);let r=Object.values(s);return n&&Array.isArray(n)&&(r=Object.keys(s).filter(o=>n.includes(o)).map(o=>s[o])),r.filter(o=>i(o)).length>0})},v8=(e,t,n)=>Object.assign([],e).sort((i,s)=>{const r=typeof i[t]=="string"?i[t].toLowerCase():i[t],o=typeof s[t]=="string"?s[t].toLowerCase():s[t];return ro?n==="desc"?-1:1:0}),LT=e=>e.every(t=>typeof t=="string"),E0=e=>!e.every(t=>typeof t=="string"),x8=e=>Array.isArray(e),mw=e=>!Array.isArray(e),b8=({search:e,advancedSearch:t,searchValue:n,setSearchValue:i,searchInputProps:s,label:r="Search",setAdvancedSearchValue:o})=>b.jsxs(b.Fragment,{children:[e&&b.jsx(wi,{value:n,onChange:a=>i(a.target.value),label:r,className:"mb-4",...s}),t&&b.jsxs(yT,{className:"mb-4",children:[b.jsx("input",{className:"form-control",value:n,onChange:a=>i(a.target.value),...s}),b.jsx(Zt,{className:"datatable-advanced-search",onClick:()=>o(t(n)),children:b.jsx(sn,{icon:"search"})})]})]}),_8=({dataColumns:e})=>{const{sort:t,fixedHeader:n,handleSort:i}=k.useContext(Tc),[s,r]=k.useState("rotate(0deg)"),o=a=>I("datatable-sort-icon",`${a===t.column&&"active"}`);return k.useEffect(()=>{const a=t.option==="desc"?"rotate(180deg)":"rotate(0deg)";r(a)},[t.option]),b.jsx(b.Fragment,{children:e.map((a,l)=>b.jsxs("th",{className:n?"fixed-cell":"",style:{cursor:"pointer"},scope:"row",onClick:()=>i(a),children:[b.jsx(sn,{fas:!0,icon:"arrow-up",className:o(a),style:{transform:a===t.column?s:"rotate(0deg)"}}),a]},l))})},w8=({dataColumns:e})=>{const[t,n]=k.useState("rotate(0deg)"),{sort:i,fixedHeader:s,handleSort:r,isLoading:o}=k.useContext(Tc),a=l=>I("datatable-sort-icon",`${l===i.column&&"active"}`);return k.useEffect(()=>{const l=i.option==="desc"?"rotate(180deg)":"rotate(0deg)";n(l)},[i.option]),b.jsx(b.Fragment,{children:e.map((l,c)=>{const{fixedValue:u,fixed:d,label:h}=l,f=l.sort!==!1&&!o,p={cursor:I(f&&"pointer"),left:d==="left"?u||0:void 0,right:d==="right"?u||0:void 0},m=I((s||d)&&"fixed-cell");return b.jsxs("th",{className:m,style:p,scope:"row",onClick:()=>f&&r(h),children:[f&&b.jsx(sn,{fas:!0,icon:"arrow-up",className:a(h),style:{transform:i.column===h?t:"rotate(0deg)"}}),h]},c)})})},k8=({row:e,dataColumns:t,format:n,editable:i})=>b.jsx(b.Fragment,{children:t.map((s,r)=>{const{field:o,fixed:a,width:l,fixedValue:c,columnSelector:u}=s,d=e[o],h=Number(d),f=n==null?void 0:n(o,h?Number(d):String(d)),p={minWidth:l,maxWidth:l,left:a==="left"&&(c||0),right:a==="right"&&(c||0),...f},m=I(a&&"fixed-cell",u&&`mdb-datatable-${u}`);return b.jsx("td",{contentEditable:i,className:m,style:p,children:d},r)})}),S8=({row:e,editable:t})=>b.jsx(b.Fragment,{children:e.map((n,i)=>b.jsx("td",{contentEditable:t,children:n},i))}),M8=({activeData:e,dataRows:t,isOnThePage:n,noFoundMessage:i,dataColumns:s,onRowClick:r,selectable:o,handleRowSelect:a,selectedRows:l,format:c,editable:u})=>{const{isLoading:d}=k.useContext(Tc),h=e.length,f=s.length,p=(m,v)=>{m.target.nodeName!=="INPUT"&&(r==null||r(v))};return b.jsxs(H3,{className:"datatable-body",children:[e.map((m,v)=>{const y=t.indexOf(m),g=l.includes(y),x=I(g&&"active",mw(m)&&m.rowSelector&&`mdb-datatable-${m.rowSelector}`);if(n(v))return b.jsxs("tr",{onClick:_=>p(_,m),className:x,style:{cursor:r&&"pointer"},children:[o&&b.jsx("td",{children:b.jsx(oh,{checked:g,onChange:()=>a(y)})}),x8(m)&&b.jsx(S8,{editable:u,row:m}),mw(m)&&E0(s)&&b.jsx(k8,{editable:u,row:m,dataColumns:s,format:c})]},v)}),!h&&!d&&b.jsx("tr",{className:"datatable-results-info",children:b.jsx("td",{colSpan:f,className:"text-center",children:i})})]})},C8=({dataColumns:e,dataRows:t,sort:n,searchValue:i,advancedSearch:s,advancedSearchValue:r})=>{const[o,a]=k.useState(t);return k.useEffect(()=>{const{column:l,option:c}=n,{phrase:u,columns:d}=r;let h;if(l){let f,p=0;E0(e)&&(f=e.find(m=>m.label===l)),LT(e)&&(p=e.indexOf(l)),h=v8(t,f?f.field:p,c)}i&&!s&&(h=pw(h||t,i,void 0)),u&&(h=pw(h||t,u,d)),a(h||t)},[n,t,e,i,s,r]),o},P8=Y.forwardRef(({advancedSearch:e,allText:t,className:n,bordered:i,borderless:s,borderColor:r="",color:o="",dark:a,entries:l=10,editable:c,entriesOptions:u,fixedHeader:d,fullPagination:h,hover:f,format:p,loaderClass:m="bg-primary",isLoading:v,loadingMessage:y="Loading results...",maxWidth:g="",maxHeight:x="",multi:_,noFoundMessage:w="No matching results found",pagination:S=!0,selectable:C,sortField:M="",searchInputProps:P,sortOrder:T="asc",sm:A,striped:E,rowsText:z,data:N={columns:[],rows:[]},search:L,onSelectRow:R,onRowClick:B,searchLabel:D,ofText:$,...F},V)=>{const[W,et]=k.useState(0),[Z,O]=k.useState(l),[U,lt]=k.useState({column:"",option:""}),[ct,kt]=k.useState([]),[it,Lt]=k.useState(""),[Ct,Qt]=k.useState({phrase:"",columns:""}),ft=C8({dataColumns:N.columns,dataRows:N.rows,sort:U,searchValue:it,advancedSearch:e,advancedSearchValue:Ct}),wt=I("datatable",f&&"datatable-hover",o&&`bg-${o}`,a&&"datatable-dark",i&&"datatable-bordered",s&&"datatable-borderless",r&&`border-${r}`,E&&"datatable-striped",A&&"datatable-sm",v&&"datatable-loading",n),dt=J=>W*Z<=J&&J<(W+1)*Z,jt=J=>{const{column:mt,option:q}=U;lt(mt===J?q==="asc"?{...U,option:"desc"}:{column:"",option:""}:{column:J,option:"asc"})},pt=J=>{const mt=J.currentTarget.checked,q=mt?Array.from({length:N.rows.length},(Dt,he)=>he):[],ye=q.map(Dt=>ft[Dt]);R==null||R(ye,q,mt),kt(q)},xt=J=>{const mt=ct.includes(J);let q;_?mt?q=ct.filter(he=>he!==J):q=[...ct,J]:mt?q=[]:q=[J];const ye=q.map(he=>ft[he]),Dt=q.length===N.rows.length;R==null||R(ye,q,Dt),kt(q)};return k.useEffect(()=>{M&<({column:M,option:T})},[M,T]),k.useEffect(()=>{et(0)},[it]),b.jsxs(Tc.Provider,{value:{isLoading:v,activePage:W,setActivePage:et,sort:U,fixedHeader:d,handleSort:jt},children:[b.jsx(b8,{search:L,advancedSearch:e,searchValue:it,setSearchValue:Lt,searchInputProps:P,label:D,setAdvancedSearchValue:Qt}),b.jsxs("div",{className:wt,ref:V,style:{maxWidth:g},...F,children:[b.jsx(k4,{className:"datatable-inner table-responsive ps",style:{overflow:"auto",position:"relative",maxWidth:g,maxHeight:x},children:b.jsxs(z3,{className:"datatable-table",children:[b.jsx(W3,{className:"datatable-header",children:b.jsxs("tr",{children:[C&&b.jsx("th",{className:d?"fixed-cell":"",children:_&&b.jsx(oh,{checked:ct.length===N.rows.length,onChange:pt})}),LT(N.columns)&&b.jsx(_8,{dataColumns:N.columns}),E0(N.columns)&&b.jsx(w8,{dataColumns:N.columns})]})}),b.jsx(M8,{activeData:ft,dataColumns:N.columns,dataRows:N.rows,isOnThePage:dt,onRowClick:B,format:p,handleRowSelect:xt,selectedRows:ct,selectable:C,noFoundMessage:w,editable:c})]})}),v&&b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"datatable-loader bg-light}",children:b.jsx("span",{className:"datatable-loader-inner",children:b.jsx("span",{className:I("datatable-progress",m)})})}),b.jsx("p",{className:"text-center text-muted my-4",children:y})]}),S&&b.jsx(y8,{fullPagination:h,selectValue:Z,setSelectValue:O,activeDataLength:ft.length,rowsText:z,entriesOptions:u,fullDataLength:N.rows.length,allText:t,ofText:$})]})]})});P8.displayName="MDBDatatable";h0.register(...i3||[]);Y.createContext({activeItem:1,setActiveItem:null,prevActive:{current:1},setHeight:null,completed:[],noEditable:!1,isAnimating:{current:!1},linear:!1,formRef:{current:null},validate:{target:0,after:0},setValidate:null,type:"horizontal",stepsLength:0,onValid:void 0,onInvalid:void 0,mobileProgress:!1,disableHeadSteps:!1,animations:!0});Y.createContext({activeItem:0,dynamic:!1,dynamicStyle:{color:"",icon:""},setDynamicStyle:null,setActiveItem:null,hoveredItem:0,setHoveredItem:null,readonly:!1,onChange:void 0});const T8=Y.forwardRef(({backdrop:e=!0,backdropColor:t="black",backdropOpacity:n=.4,color:i,className:s,loadingText:r="Loading...",isOpen:o,fullScreen:a,overflow:l=!0,parentRef:c,spinnerElement:u=b.jsx(hT,{className:"loading-icon",role:"status"}),textClassName:d,textStyles:h,tag:f="div",...p},m)=>{const v=I("loading-text",d),y=I(a?"loading-full":"loading","loading-spinner",a?"position-fixed":"position-absolute",i&&`text-${i}`,s),g=I("loading-backdrop",!a&&"position-absolute");k.useEffect(()=>{const w=c==null?void 0:c.current;if(w)return w.classList.add("position-relative"),()=>{w.classList.remove("position-relative")}},[c]),k.useEffect(()=>{if(a&&l)return o?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}},[a,o,l]);const x=b.jsxs(f,{className:y,ref:m,...p,children:[u,b.jsx("span",{className:v,style:h,children:r})]}),_=b.jsx("div",{className:g,style:{opacity:n,backgroundColor:t}});return b.jsx(b.Fragment,{children:o!==!1&&b.jsx(b.Fragment,{children:a?b.jsxs(aa,{children:[x,_]}):b.jsxs(b.Fragment,{children:[x,e&&_]})})})});T8.displayName="MDBLoadingManagement";const D8=({isOpened:e,inputRef:t,dropdownEl:n,setOpenState:i,onClose:s})=>{const r=k.useCallback(o=>{if(!n)return;const a=t.current===o.target,l=n===o.target,c=n.contains(o.target);e&&!a&&!l&&!c&&(i(!1),s==null||s())},[e,i,n,t,s]);k.useEffect(()=>(document.addEventListener("click",r),()=>{document.removeEventListener("click",r)}),[r])},E8=({inputRef:e,dropdownEl:t})=>{const n=k.useCallback(()=>{if(!e.current||!t)return;const{width:i}=window.getComputedStyle(e.current);t.style.width=i},[t,e]);k.useEffect(()=>(n(),window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)}),[n])},A8=({isOpen:e})=>{const[t,n]=k.useState(!1);return k.useEffect(()=>{let i;return e?n(!0):i=setTimeout(()=>{n(!1)},100),()=>{clearTimeout(i)}},[e]),t},O8=({className:e,customContent:t=null,inputRef:n,isOpen:i,isOpened:s,children:r,setOpenState:o,listHeight:a="190px",onOpened:l,onClose:c,onClosed:u,...d})=>{const[h,f]=k.useState(null),[p,m]=k.useState(null),v=k.useMemo(()=>[{name:"matchReferenceWidth",enabled:!0,fn:({state:S,instance:C})=>{if(!p)return;const M=p.offsetWidth,P=S.rects.reference.width;Math.round(M)!==Math.round(P)&&(p.style.width=`${P}px`,C.update())},phase:"beforeWrite",requires:["computeStyles"]}],[p]),y=A8({isOpen:i}),{styles:g,attributes:x,update:_}=Oh(h,p,{modifiers:v}),w=I("autocomplete-dropdown",i&&"open",e);return D8({isOpened:s,setOpenState:o,dropdownEl:p,inputRef:n,onClose:c}),E8({inputRef:n,dropdownEl:p}),k.useEffect(()=>{n.current&&f(n.current)},[n]),k.useEffect(()=>{i&&(_==null||_())},[i,_,y]),b.jsx(b.Fragment,{children:b.jsx(aa,{children:b.jsx("div",{className:"autocomplete-dropdown-container",ref:m,...d,style:g.popper,...x.popper,onTransitionEnd:S=>{S.propertyName==="opacity"&&(y?l==null||l():u==null||u())},children:b.jsxs("div",{className:w,children:[b.jsx("ul",{className:"autocomplete-items-list",role:"listbox",style:{maxHeight:a,display:y?"block":"none"},children:r}),t]})})})})},L8=({className:e,isActive:t,children:n,onSelect:i,value:s,...r})=>{const o=I("autocomplete-item",t&&"active",e),a=k.useRef(null);return k.useEffect(()=>{!t||!a.current||a.current.scrollIntoView({block:"nearest"})},[t]),b.jsx("li",{className:o,onClick:()=>i(s),ref:a,...r,children:n})},R8=({isOpen:e,setOpenState:t,length:n})=>{const[i,s]=k.useState(-1),r=k.useCallback(o=>{const a=o.key==="Tab",l=o.key==="Escape",c=o.key==="ArrowUp",u=o.key==="ArrowDown",d=o.key==="Home",h=o.key==="End",f=o.key==="Enter",p=o.altKey,m=n-1;if(!e)return s(-1);if(l||f||a||p&&c)return t(!1);if(u){o.preventDefault(),s(v=>v===m?m:v+1);return}if(c){o.preventDefault(),s(v=>v===0?0:v-1);return}if(d&&i!==-1){o.preventDefault(),s(0);return}if(h&&i!==-1){o.preventDefault(),s(m);return}},[e,t,n,i]);return k.useEffect(()=>{s(-1)},[n]),k.useEffect(()=>(document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}),[r]),i},N8=Y.forwardRef(({open:e,autoSelect:t,className:n,customContent:i,data:s=[],displayValue:r,value:o,isLoading:a,listHeight:l,noResults:c="No results found",itemContent:u,onSelect:d,onSearch:h,onChange:f,onClose:p,onClosed:m,onOpen:v,onOpened:y,...g},x)=>{const _=k.useRef(null),[w,S]=k.useState(!1),[C,M]=k.useState(!1),P=ef(w,e),[T,A]=k.useState(""),E=k.useMemo(()=>o!==void 0?o:T,[o,T]),z=R8({isOpen:P,setOpenState:S,length:s.length});k.useImperativeHandle(x,()=>_.current);const N=I(P&&"focused","autocomplete-input",n),L=I((P||E)&&"active","autocomplete-label"),R=()=>{S(!0),v==null||v(),_.current&&!_.current.value&&(h==null||h(""))},B=$=>r?r($):$,D=$=>{S(!1),_.current&&(_.current.value=$,h==null||h($),d==null||d($),f==null||f($),p==null||p(),A($))};return b.jsxs(b.Fragment,{children:[b.jsx(wi,{autoComplete:"off",onKeyDown:$=>{const F=$.key==="Enter",V=$.key==="Tab";if(!w)return S(!0);z!==-1&&(F||t&&V)&&D(B(s[z]))},onChange:$=>{h==null||h($.target.value),f==null||f($.target.value),A($.target.value)},onFocus:R,className:N,labelClass:L,ref:_,role:"combobox",value:E,...g,children:a&&b.jsx("div",{className:"autocomplete-loader spinner-border",children:b.jsx("span",{className:"sr-only",children:"Loading..."})})}),b.jsxs(O8,{isOpen:P,isOpened:C,inputRef:_,setOpenState:S,customContent:i,listHeight:l,onClose:p,onOpened:()=>{y==null||y(),M(!0)},onClosed:()=>{m==null||m(),M(!1)},children:[s.length===0&&b.jsx("li",{className:"autocomplete-item autocomplete-no-results",children:c}),s.map(($,F)=>b.jsx(L8,{isActive:z===F,value:B($),onSelect:D,children:u?u($):B($)},F))]})]})});N8.displayName="MDBAutocomplete";const j8=Y.forwardRef(({className:e,icon:t,tag:n="p",children:i,...s},r)=>{const o=I("popconfirm-message",e);return b.jsxs(n,{className:o,ref:r,...s,children:[t&&b.jsx("span",{className:"popconfirm-icon-container",children:t}),b.jsx("span",{className:"popconfirm-message-text",children:i})]})});j8.displayName="MDBPopconfirmMessage";const $8=Y.forwardRef(({className:e,tag:t="div",zoomLevel:n=1,fontAwesome:i="free",children:s,lightboxRef:r,onOpen:o,onClose:a,onSlide:l,onZoomIn:c,onZoomOut:u,disablePortal:d,...h},f)=>{const p=k.useRef(null),m=k.useRef(null),v=r||m,y=k.useRef(null),[g,x]=k.useState(!1),[_,w]=k.useState(0),[S,C]=k.useState(!1),[M,P]=k.useState([]),[T,A]=k.useState(""),[E,z]=k.useState(1),[N,L]=k.useState(!1),[R,B]=k.useState(),[D,$]=k.useState(!1),F=k.useRef(!1),V=k.useRef(!1),W=k.useRef(),et=k.useRef(),Z=k.useRef(),O=k.useRef(),U=k.useRef(),lt=k.useRef(),ct=k.useRef(),kt=I("lightbox",e),it=I(i==="pro"&&"fontawesome-pro"),Lt=I("lightbox-gallery-close-btn",i==="pro"&&"fontawesome-pro"),Ct=I("lightbox-gallery-fullscreen-btn",i==="pro"&&"fontawesome-pro",S&&"active"),Qt=I("lightbox-gallery-zoom-btn",i==="pro"&&"fontawesome-pro",E>1&&"active"),ft=k.useMemo(()=>document.documentElement.dir==="rtl",[]),wt=()=>{F.current=!0,setTimeout(()=>{F.current=!1},400)},dt=k.useCallback(j=>{let Q=j;return Q>M.length-1?Q=0:Q<0&&(Q=M.length-1),M[Q].classList.contains("lightbox-disabled")?dt(Q-1):Q},[M]),jt=k.useCallback(()=>{E>=3||(z(j=>j+n),c==null||c())},[c,E,n]),pt=k.useCallback(()=>{var j;const Q=(j=p.current)==null?void 0:j.querySelector(".lightbox-gallery-item.active");Q!=null&&Q.parentElement&&(Q.parentElement.style.left="0",Q.parentElement.style.top="0",Q.style.transition="all 0.5s ease-out",Q.style.left="0",Q.style.top="0",ls(Q),setTimeout(()=>{Q.style.transition="none"},500))},[]),xt=k.useCallback(()=>{E-n===1&&pt(),!(E<=1)&&(z(j=>j-n),u==null||u())},[u,pt,E,n]),J=k.useCallback(()=>{var j;p.current&&Array.from((j=p.current)==null?void 0:j.querySelectorAll(".lightbox-gallery-item")).forEach(Q=>{ls(Q)})},[]),mt=k.useCallback(()=>{S&&document.exitFullscreen&&document.exitFullscreen(),setTimeout(()=>{document.body.classList.remove("disabled-scroll"),document.body.classList.remove("replace-scrollbar")}),x(!1),z(1),L(!1),J(),a==null||a()},[J,S,a]),q=k.useCallback(j=>{if(F.current||M.length<=1)return _;let Q=0;switch(j){case"left":Q=_-1;break;case"right":Q=_+1;break;case"last":Q=M.length-1;break;case"first":Q=0;break}wt();const It=dt(Q);w(It),z(1),L(!1),setTimeout(()=>{var nt;const Tt=(nt=p.current)==null?void 0:nt.querySelector(".lightbox-gallery-item.active");J(),A(Tt.getAttribute("data-mdb-caption"))},300),l==null||l()},[_,J,M.length,l,dt]),ye=k.useCallback(j=>{if(g)switch(j.nativeEvent.key){case"ArrowRight":q(ft?"left":"right");break;case"ArrowLeft":q(ft?"right":"left");break;case"Escape":mt();break;case"Home":q("first");break;case"End":q("last");break;case"ArrowUp":jt();break;case"ArrowDown":xt();break}},[mt,q,jt,xt,g,ft]),Dt=k.useCallback(j=>{document.body.classList.add("disabled-scroll"),document.documentElement.scrollHeight>document.documentElement.clientHeight&&document.body.classList.add("replace-scrollbar"),x(!0),w(j),L(!1),J(),setTimeout(()=>{var Q;const It=(Q=p.current)==null?void 0:Q.querySelector(".lightbox-gallery-item.active");A(It.getAttribute("data-mdb-caption"))},0),o==null||o()},[J,o]);k.useImperativeHandle(f,()=>({outsideAccess(j){Dt(j)}}));const he=k.useCallback(()=>{(document.webkitIsFullScreen||document.mozFullScreen||document.msFullscreenElement)===void 0&&C(!1)},[]),Un=()=>{var j,Q,It;if(!S){(Q=(j=p.current)==null?void 0:j.requestFullscreen)==null||Q.call(j),C(!0);return}(It=document.exitFullscreen)==null||It.call(document),C(!1)},Yn=j=>{j.nativeEvent.preventDefault();const Q=j.nativeEvent instanceof TouchEvent?j.nativeEvent.touches[0]:j.nativeEvent,It=Q.clientX,nt=Q.clientY;j.nativeEvent instanceof TouchEvent&&j.type==="touchstart"&&j.nativeEvent.touches.length>1&&($(!0),B(j.nativeEvent.touches));const Tt=j.target;Z.current=parseFloat(Tt.style.left),O.current=parseFloat(Tt.style.top),W.current=parseFloat(Tt.style.left),et.current=parseFloat(Tt.style.top),U.current=It*(1/E)-W.current,lt.current=nt*(1/E)-et.current,L(!0)},Mn=j=>{if(j.type==="touchmove"&&j.nativeEvent instanceof TouchEvent&&j.nativeEvent.targetTouches.length>1&&(j.nativeEvent.preventDefault(),as(j)),!N||D)return;const Q=j.nativeEvent instanceof TouchEvent?j.nativeEvent.touches[0]:j.nativeEvent,It=Q.clientX,nt=Q.clientY,Tt=j.target;if(E!==1){W.current=It*(1/E)-U.current,et.current=nt*(1/E)-lt.current,Tt.style.left=`${W.current}px`,Tt.style.top=`${et.current}px`;return}M.length<=1||(W.current=It*(1/E)-U.current,Tt.style.left=`${W.current}px`)},Si=k.useCallback(()=>{if(!(E!==1||M.length<=1||!W.current||D)){if(W.current-(Z.current||0)>0){q(ft?"right":"left");return}q(ft?"left":"right")}},[q,D,ft,M.length,E]),dn=k.useCallback(j=>{D||(j.nativeEvent instanceof TouchEvent&&!j.nativeEvent.touches&&Xn(j),E!==1?xt():jt())},[jt,xt,D,E]),Mi=j=>{if(L(!1),j.nativeEvent instanceof MouseEvent){Si(),L(!1);return}if(D&&j.targetTouches.length===0){$(!1),B(void 0);return}L(!1),Si()},as=j=>{if(!R)return;const Q=Math.hypot(R[1].pageX-R[0].pageX,R[1].pageY-R[0].pageY),It=Math.hypot(j.nativeEvent.touches[1].pageX-j.nativeEvent.touches[0].pageX,j.nativeEvent.touches[1].pageY-j.nativeEvent.touches[0].pageY),nt=Math.abs(Q-It),Tt=j.nativeEvent.view.screen.width;nt<=Tt*.03||(Q<=It?jt():xt(),B(j.nativeEvent.touches))},ls=j=>{j.parentElement&&(j.width>=j.height?(j.style.width="100%",j.style.maxWidth="100%",j.style.height="auto",j.style.top=`${(j.parentElement.offsetHeight-j.height)/2}px`,j.style.left="0"):(j.style.height="100%",j.style.maxHeight="100%",j.style.width="auto",j.style.left=`${(j.parentElement.offsetWidth-j.width)/2}px`,j.style.top="0"),j.width>=j.parentElement.offsetWidth&&(j.style.width=`${j.parentElement.offsetWidth}px`,j.style.height="auto",j.style.left="0",j.style.top=`${(j.parentElement.offsetHeight-j.height)/2}px`),j.height>=j.parentElement.offsetHeight&&(j.style.height=`${j.parentElement.offsetHeight}px`,j.style.width="auto",j.style.top="0",j.style.left=`${(j.parentElement.offsetWidth-j.width)/2}px`),W.current=parseFloat(j.style.left)||0,et.current=parseFloat(j.style.top)||0)},Ci=j=>{const Q=j.getAttribute("data-mdb-img")?j.getAttribute("data-mdb-img"):j.getAttribute("src")?j.getAttribute("src"):"",It=j.getAttribute("alt")?j.getAttribute("alt"):j.getAttribute("data-mdb-caption")?j.getAttribute("data-mdb-caption"):"",nt=j.getAttribute("data-mdb-caption")?j.getAttribute("data-mdb-caption"):j.getAttribute("alt")?j.getAttribute("alt"):"";return{source:Q,alt:It,caption:nt}},Pi=k.useCallback(()=>{const j=[...v.current.querySelectorAll(".lightbox-item")].filter(Q=>!Q.classList.contains("lightbox-disabled"));P(j)},[v]),Ke=k.useCallback(()=>{J()},[J]),Xn=j=>{W.current=window.innerWidth/2-j.nativeEvent.offsetX-50,et.current=window.innerHeight/2-j.nativeEvent.offsetY-50;const Q=j.target;Q.style.left=`${W.current}px`,Q.style.top=`${et.current}px`,Q.style.transition="all 0.5s ease-out",setTimeout(()=>{Q.style.transition="none"},500)},Ti=j=>{if(j.deltaY>0)return xt();E>=3||(Xn(j),jt())};return k.useEffect(()=>{Pi()},[Pi]),k.useEffect(()=>{M.length&&J()},[J,M]),k.useEffect(()=>(M.forEach((j,Q)=>{!j.classList.contains("lightbox-disabled")&&j.addEventListener("click",()=>Dt(Q))}),()=>{M.forEach((j,Q)=>{j.removeEventListener("click",()=>Dt(Q))})}),[Dt,M]),k.useEffect(()=>(window.addEventListener("resize",Ke),window.addEventListener("fullscreenchange",he),()=>{window.removeEventListener("resize",Ke),window.removeEventListener("fullscreenchange",he)}),[he,Ke]),k.useEffect(()=>{const j=document.querySelector("meta[name=viewport]");if(ct.current||(ct.current=(j==null?void 0:j.getAttribute("content"))||""),!g){V.current=!1,j==null||j.setAttribute("content",ct.current);return}setTimeout(()=>{var Q;V.current=!0,(Q=y.current)==null||Q.focus(),j==null||j.setAttribute("content",`${ct.current} user-scalable=no`)},300)},[g]),b.jsxs(b.Fragment,{children:[b.jsx(t,{ref:v,className:kt,...h,children:s}),b.jsx(aa,{disablePortal:d,children:b.jsxs("div",{className:"lightbox-gallery",onClick:j=>j.target.tagName==="DIV"&&mt(),onKeyUp:ye,ref:p,style:{opacity:g?1:0,pointerEvents:g?"initial":"none",visibility:g?"visible":"hidden"},children:[b.jsx("div",{className:"lightbox-gallery-loader"}),b.jsxs("div",{className:"lightbox-gallery-toolbar",children:[b.jsx("div",{className:"lightbox-gallery-left-tools",children:b.jsx("p",{className:"lightbox-gallery-counter",children:`${_+1} / ${M.length}`})}),b.jsxs("div",{className:"lightbox-gallery-right-tools",children:[b.jsx("button",{className:Ct,onClick:Un}),b.jsx("button",{"aria-label":E>1?"Zoom out":"Zoom in",className:Qt,onClick:()=>E>1?xt():jt()}),b.jsx("button",{className:Lt,onClick:mt})]})]}),b.jsx("div",{className:"lightbox-gallery-content",style:{transform:g?"scale(1)":"scale(0.25)",transition:"all 0.5s ease-out"},children:M.map((j,Q)=>{const{source:It,alt:nt,caption:Tt}=Ci(j),Oe=Q===_?1:0,cs=Q===_?E:0,ai=_===M.length-1&&Q===0&&M.length>1,Kn=_===0&&Q===M.length-1&&M.length>1;let Me;return _Q&&!ai||Kn?Me="-100%":Me="0%",b.jsx("div",{className:"lightbox-gallery-image",style:{position:"absolute",opacity:Oe,left:g?Me:"0%",transform:`scale(${cs})`,transition:_===Q||V.current?"all 0.5s ease-out":"none"},children:b.jsx("img",{src:It||"",alt:nt||"","data-mdb-caption":Tt||"",onMouseDown:Yn,onMouseMove:Mn,onMouseUp:Mi,onWheel:Ti,onTouchStart:Yn,onTouchMove:Mn,onTouchEnd:Mi,onDoubleClick:dn,className:`lightbox-gallery-item ${_===Q&&"active"}`})},Q)})}),b.jsx("div",{className:"lightbox-gallery-arrow-left",children:b.jsx("button",{"aria-label":"Previous",className:it,onClick:()=>q("left")})}),b.jsx("div",{className:"lightbox-gallery-arrow-right",children:b.jsx("button",{"aria-label":"Next",className:it,onClick:()=>q("right"),ref:y})}),b.jsx("div",{className:"lightbox-gallery-caption-wrapper",children:b.jsx("p",{className:"lightbox-gallery-caption",children:T})})]})})]})});$8.displayName="MDBLightbox";const I8=Y.forwardRef(({className:e,fullscreenSrc:t,disabled:n,caption:i,...s},r)=>{const o=I("lightbox-item",n&&"lightbox-disabled",e);return b.jsx("img",{ref:r,"data-mdb-caption":i,"data-mdb-img":t,className:o,...s})});I8.displayName="MDBLightboxItem";const F8=Y.forwardRef(({className:e,...t},n)=>{const[i,s]=k.useState(!1),r=k.useCallback(()=>{const a=document.documentElement.scrollTop;s(!!a)},[]),o=I(i&&"navbar-scrolled","navbar-scroll",e);return k.useEffect(()=>{window.addEventListener("scroll",r)},[r]),b.jsx(pT,{className:o,ref:n,...t})});F8.displayName="MDBAnimatedNavbar";const RT=k.forwardRef(({className:e,closeIcon:t,tag:n="div",color:i,size:s,children:r,onDelete:o,...a},l)=>{const[c,u]=k.useState(!0),d=I("chip",s&&`chip-${s}`,i&&`chip-outline btn-outline-${i}`,e);return c?b.jsxs(n,{ref:l,className:d,...a,children:[r,t&&b.jsx("i",{className:"close fas fa-times",onClick:()=>{o==null||o(r),u(!1)}})]}):null});RT.displayName="MDBChip";const B8=Y.forwardRef(({className:e,value:t="",id:n,labelId:i,labelClass:s,label:r,onChange:o,labelRef:a,labelStyle:l,readonly:c,editable:u,onAdd:d,onDelete:h,initialValues:f=[],...p},m)=>{const v=k.useRef(null),y=a??v,g=k.useRef(null);k.useImperativeHandle(m,()=>g.current);const[x,_]=k.useState(f),[w,S]=k.useState(null),[C,M]=k.useState(0),[P,T]=k.useState(null),[A,E]=k.useState(t),z=x.length>0||A.length>0,N=I("form-outline","chips-input-wrapper",x.length>0&&"chips-padding chips-transition"),L=I("form-control",z&&"active",e),R=I("form-label",s);k.useEffect(()=>{!y.current||y.current.clientWidth===0||M(y.current.clientWidth*.8+8)},[y]);const B=()=>{y.current&&M(y.current.clientWidth*.8+8)},D=O=>{E(O.target.value),o==null||o(O)},$=O=>{A.length||((O.key==="ArrowLeft"||O.key==="ArrowDown")&&T(U=>U?U-1:x.length-1),(O.key==="ArrowRight"||O.key==="ArrowUp")&&T(U=>U===x.length-1||U===null?0:U+1),O.key==="Backspace"&&P!==null&&F(P)),O.key==="Enter"&&A.trim().length&&(d==null||d(A),_([...x,{tag:A}]),E(""))},F=O=>{const U=x.find((lt,ct)=>O===ct);if(U){h==null||h(U==null?void 0:U.tag);const lt=x.filter((ct,kt)=>O!==kt);_(lt),T(null)}},V=(O,U)=>{u&&S(U)},W=(O,U)=>{if(!u)return;const lt=O.currentTarget.textContent,ct=x.map((kt,it)=>it===U&<?{tag:lt}:kt);lt?_(ct):F(U),S(null),T(null)},et=(O,U)=>{O.key==="Enter"&&u&&w!==null&&W(O,U)},Z=()=>{A.trim().length&&(d==null||d(A),_([...x,{tag:A}]),E(""))};return b.jsx("div",{className:"chips chips-placeholder",children:b.jsxs("div",{className:N,children:[x.map((O,U)=>b.jsx(RT,{contentEditable:w===U,suppressContentEditableWarning:!0,onDoubleClick:lt=>V(lt,U),onDelete:()=>F(U),onKeyDown:lt=>et(lt,U),closeIcon:w!==U,className:I("btn",U===P&&"active"),children:O.tag},`${Math.random()}-${U}`)),b.jsx("input",{type:"text",readOnly:c,className:L,onChange:D,onFocus:B,onKeyDown:$,onBlur:()=>Z(),value:A,id:n,ref:g,...p}),r&&b.jsx("label",{className:R,style:l,id:i,htmlFor:n,ref:y,children:r}),b.jsxs("div",{className:"form-notch",children:[b.jsx("div",{className:"form-notch-leading"}),b.jsx("div",{className:"form-notch-middle",style:{width:C}}),b.jsx("div",{className:"form-notch-trailing"})]})]})})});B8.displayName="MDBChipsInput";function V8(){const[e,t]=k.useState(""),[n,i]=k.useState(""),[s,r]=k.useState(""),[o,a]=k.useState(null),[l,c]=k.useState(!1),[u,d]=k.useState([]),[h,f]=k.useState(!1),[p,m]=k.useState(null),[v,y]=k.useState(null),g=k.useRef(null);k.useEffect(()=>{if(l&&o&&o.plot_data&&g&&g.current){const M=g.current.getContext("2d");M&&new by(M,{type:"line",data:{labels:o.plot_data.n,datasets:[{label:"n^log_b(a)",data:o.plot_data.n_log_b_a,borderColor:"blue",borderWidth:1,fill:!1},{label:"f(n)",data:o.plot_data.f_n,borderColor:"red",borderWidth:2,fill:!1,borderDash:[5,5]},{label:"Time Complexity",data:o.plot_data.time_complexity,borderColor:"green",borderWidth:2,fill:!1,borderDash:[10,5]}]},options:{scales:{y:{beginAtZero:!0,title:{display:!0,text:"Function Value",color:"#888",font:{size:12}},ticks:{}},x:{grid:{display:!0},ticks:{callback:function(P){return Number(P).toFixed(0)}},title:{display:!0,text:"Input Size (n)",color:"#888",font:{size:12}}}},plugins:{legend:{display:!0,position:"top",labels:{boxWidth:20,padding:10}},tooltip:{enabled:!0}},elements:{line:{borderWidth:1},point:{radius:0}},responsive:!0,maintainAspectRatio:!1}})}},[l,o]),k.useEffect(()=>{(async()=>{try{const P=await fetch("http://master-theorem-aws-test2-dev.us-west-2.elasticbeanstalk.com/api/algorithms");if(!P.ok)throw new Error("Network response was not ok");const T=await P.json();d(T)}catch(P){console.error("Failed to fetch algorithms:",P)}})()},[]);const x=M=>{if(M===-1)f(!1),t(""),i(""),r(""),y(null);else{const P=u.find(T=>T.id===M);P&&(t(P.a.toString()),i(P.b.toString()),r(P.k.toString()),f(!0),y(P))}},_=async M=>{M.preventDefault(),await w(M)},w=async M=>{M.preventDefault(),c(!1),m(v);try{const P=await fetch("http://master-theorem-aws-test2-dev.us-west-2.elasticbeanstalk.com/api/evaluate/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({a:e,b:n,k:s})});if(!P.ok)throw new Error("Network response was not ok");const T=await P.json();a(T),c(!0)}catch(P){console.error("There was a problem with your fetch operation:",P)}},S=M=>{var P;if(Array.isArray(M))console.log("Multiple selections are not supported.");else{const T=parseInt(((P=M.value)==null?void 0:P.toString())||"-1",10);x(T)}},C=[{text:"User Input",value:"-1"},...u.map(M=>({text:M.name,value:M.id.toString()}))];return b.jsxs(b.Fragment,{children:[b.jsxs(rd,{alignment:"center",children:[b.jsx(od,{children:b.jsx("h1",{className:"main-header",children:"Evaluate Master Theorem"})}),b.jsxs(eg,{children:[b.jsx(fT,{children:b.jsx("span",{className:"card-title",children:"Enter the values of a, b, and k to evaluate the Master Theorem:"})}),b.jsxs("form",{onSubmit:_,children:[b.jsx(wi,{label:"a (number of subproblems)",id:"aInput",type:"number",min:"1",className:"my-4",value:e,onChange:M=>t(M.target.value),disabled:h}),b.jsx(wi,{label:"b (factor by which problem size is reduced)",id:"bInput",type:"number",min:"2",className:"my-4",value:n,onChange:M=>i(M.target.value),disabled:h}),b.jsx(wi,{label:"k (exponent in the work outside of recursive calls)",id:"kInput",type:"number",min:"0",className:"my-4",value:s,onChange:M=>r(M.target.value),disabled:h}),b.jsx("div",{className:"my-4",children:b.jsx(D0,{data:C,label:"Choose Algorithm or Enter Values",onChange:S})}),b.jsx(Zt,{onClick:w,className:"btn-block",children:"Evaluate"})]})]})]}),l&&o&&b.jsxs(rd,{className:"my-4",children:[b.jsx(od,{children:b.jsx("h2",{children:"Evaluation"})}),b.jsxs(eg,{className:"evaluation-card-body",children:[b.jsx("canvas",{ref:g,id:"myChart",className:"mb-3"}),b.jsxs(ad,{children:[b.jsx("strong",{children:"Recurrence Relation: "}),b.jsx("span",{dangerouslySetInnerHTML:{__html:o.recurrence_relation}})]}),b.jsxs(ad,{children:[b.jsx("strong",{children:"Evaluation: "}),b.jsx("span",{dangerouslySetInnerHTML:{__html:o.case}})]}),b.jsxs(ad,{children:[b.jsx("strong",{children:"Time Complexity: "}),b.jsx("span",{dangerouslySetInnerHTML:{__html:o.complexity}})]})]}),p&&b.jsxs(b.Fragment,{children:[b.jsxs("h4",{children:[p.name," Algorithm"]}),b.jsxs(ng,{alwaysOpen:!0,initialActive:1,children:[b.jsx(oo,{className:"left-align",collapseId:1,headerTitle:b.jsxs(b.Fragment,{children:[b.jsx(sn,{fas:!0,icon:"question-circle"}),"   Algorithm Description"]}),children:b.jsx("article",{children:p.description})}),b.jsx(oo,{collapseId:2,headerTitle:b.jsxs(b.Fragment,{children:[b.jsx(sn,{fab:!0,icon:"python"}),"   Python Code"]}),children:b.jsx("pre",{className:"left-align",children:b.jsx("code",{children:p.python_code})})})]})]})]}),b.jsxs(rd,{alignment:"center",className:"my-4",children:[b.jsx(od,{children:b.jsx("h2",{children:"About the Master Theorem"})}),b.jsxs(ng,{initialActive:1,children:[b.jsx(oo,{className:"left-align",collapseId:1,headerTitle:"What is the Master Theorem?",children:b.jsxs("article",{children:[b.jsxs("p",{children:["The ",b.jsx("strong",{children:"Master Theorem"})," offers a straightforward way to determine the time complexity of recursive algorithms, especially those that follow the divide and conquer approach. This theorem simplifies the process of analyzing how efficiently an algorithm runs as the size of its input increases. It is particularly useful for computer scientists and software engineers to predict algorithm performance without the need for detailed benchmarks."]}),b.jsx("p",{children:"The following parameters are required to evaluate an algorithm using the Master Theorem:"}),b.jsxs("ul",{children:[b.jsxs("li",{children:[b.jsx("strong",{children:"a"})," = the number of recursive subproblems."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"b"})," = the factor by which the problem size is reduced."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"k"})," = the exponent in the work done outside of the recursive function."]})]})]})}),b.jsx(oo,{className:"left-align",collapseId:2,headerTitle:"Decoding the Master Recurrence",children:b.jsxs("article",{children:[b.jsx("p",{children:"The Master Theorem can only be used to evaluate recursive algorithms with the following recurrence relation:"}),b.jsx("p",{className:"text-center",children:b.jsx("strong",{children:"T(n) = aT(n/b) + f(n)"})}),b.jsxs("p",{children:["This equation is the heart of the Master Theorem. and is called the ",b.jsx("strong",{children:"Master Recurrence"}),". It captures the essence of divide and conquer algorithms:"]}),b.jsxs("ul",{children:[b.jsxs("li",{children:[b.jsx("strong",{children:"T(n)"})," is the total time complexity we aim to find."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"aT(n/b)"})," represents the time taken by the recursive subproblems."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"f(n)"})," is the time taken by the work done outside the recursive calls, such as dividing the problem or combining the results."]})]}),b.jsx("p",{children:"Evaluating the Master Theorem involves comparing the rate of growth of two separate functions:"}),b.jsxs("ul",{children:[b.jsx("p",{className:"text-center",children:b.jsxs("strong",{children:["n",b.jsx("sup",{children:"logb(a)"})," + f(n)"]})}),b.jsxs("li",{children:[b.jsxs("strong",{children:["n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})]})," ","is also known as the ",b.jsx("strong",{children:"watershed function."})]}),b.jsxs("li",{children:[b.jsx("strong",{children:"f(n)"})," is also known as the"," ",b.jsx("strong",{children:"driving function."})]})]}),b.jsx("p",{children:"Comparing the growth rate of these 2 functions results in either of 3 possible cases."})]})}),b.jsx(oo,{className:"left-align",collapseId:3,headerTitle:"The 3 Cases of the Master Theorem",children:b.jsxs("article",{children:[b.jsxs("p",{children:[b.jsx("strong",{children:"Case 1"}),": n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})," ","grows asymptotically and polynomially greater than f(n):"]}),b.jsx("p",{className:"text-center",children:b.jsxs("strong",{children:["T(n) = n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})]})}),b.jsxs("p",{children:[b.jsx("strong",{children:"Case 2:"})," n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})," ","and f(n) grow at the same rate:"]}),b.jsx("p",{className:"text-center",children:b.jsxs("strong",{children:["T(n) = n",b.jsx("sup",{children:"k"})," log(n)"]})}),b.jsxs("p",{children:[b.jsx("strong",{children:"Case 3:"})," f(n) grows assymptotically and polynomially greater than n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})," ","(and also fulfills the regularity condition",b.jsx("sup",{children:"*"}),") :"]}),b.jsx("p",{className:"text-center",children:b.jsxs("strong",{children:["T(n) = f(n",b.jsx("sup",{children:"k"}),")"]})}),b.jsxs("ul",{children:[b.jsxs("li",{children:[b.jsx("strong",{children:"Case 1"})," occurs when the split subproblems dominate the overall time complexity. It implies that as we break the problem down, the sheer number of subproblems is the primary driver of the complexity."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"Case 2"})," occurs when the work done at each level of recursion is just as significant as the number of subproblems. This balance means the time complexity is a combination of the dividing/conquering work and the depth of the recursion."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"Case 3"})," highlights scenarios where the work done outside the recursive calls (combining solutions, for instance) is the main factor determining the time complexity. This is typically seen in algorithms where merging or processing results is more intensive than breaking down the problem."]})]}),b.jsx("p",{children:b.jsxs("small",{children:[b.jsx("strong",{children:"*"})," Please note that this app evaluates n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]}),"and f(n",b.jsx("sup",{children:"k"}),") using their exponents and does not assess the regularity condition in Case 3, or whether the difference in growth between these two functions is polynomial. The regularity condition ensures that the work done at the recursive levels does not grow too quickly compared to the work done to divide the problem and combine the results. This condition helps maintain the integrity of the complexity analysis provided by the theorem."]})})]})})]})]})]})}Sp.createRoot(document.getElementById("root")).render(b.jsx(Y.StrictMode,{children:b.jsx(V8,{})})); diff --git a/static/index.html b/static/index.html index 1a6739a..efeeec2 100644 --- a/static/index.html +++ b/static/index.html @@ -7,7 +7,7 @@ Evaluate Master Theorem - + diff --git a/staticfiles/assets/index--18X3qIR.js b/staticfiles/assets/index-HE6f1_nl.js similarity index 96% rename from staticfiles/assets/index--18X3qIR.js rename to staticfiles/assets/index-HE6f1_nl.js index 93546f8..a1417ae 100644 --- a/staticfiles/assets/index--18X3qIR.js +++ b/staticfiles/assets/index-HE6f1_nl.js @@ -52,9 +52,9 @@ Error generating stack: `+r.message+` * https://www.chartjs.org * (c) 2024 Chart.js Contributors * Released under the MIT License - */let qO=class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,i,s){const r=n.listeners[s],o=n.duration;r.forEach(a=>a({chart:t,initial:n.initial,numSteps:o,currentStep:Math.min(i-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=BS.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const r=i.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),r.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),n+=r.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}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((i,s)=>Math.max(i,s._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 i=n.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};var Ai=new qO;const ux="transparent",QO={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=tx(e||ux),s=i.valid&&tx(t||ux);return s&&s.valid?s.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};let ZO=class{constructor(t,n,i,s){const r=n[i];s=Ht([t.to,s,r,t.from]);const o=Ht([t.from,r,s]);this._active=!0,this._fn=t.fn||QO[t.type||typeof o],this._easing=hl[t.easing]||hl.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=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);const s=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Ht([t.to,n,s,t.from]),this._from=Ht([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,i=this._duration,s=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||n1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){const n=t?"res":"rej",i=this._promises||[];for(let s=0;s{const r=t[s];if(!gt(r))return;const o={};for(const a of n)o[a]=r[a];(Ut(r.properties)&&r.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,o)})})}_animateOptions(t,n){const i=n.options,s=tL(t,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&JO(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,n){const i=this._properties,s=[],r=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"){s.push(...this._animateOptions(t,n));continue}const u=n[c];let d=r[c];const h=i.get(c);if(d)if(h&&d.active()){d.update(h,u,a);continue}else d.cancel();if(!h||!h.duration){t[c]=u;continue}r[c]=d=new ZO(h,t,c,u),s.push(d)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return Ai.add(this._chart,i),!0}};function JO(e,t){const n=[],i=Object.keys(t);for(let s=0;s0||!n&&r<0)return s.index}return null}function mx(e,t){const{chart:n,_cachedMeta:i}=e,s=n._stacks||(n._stacks={}),{iScale:r,vScale:o,index:a}=i,l=r.axis,c=o.axis,u=sL(r,o,i),d=t.length;let h;for(let f=0;fn[i].axis===t).shift()}function aL(e,t){return Qs(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function lL(e,t,n){return Qs(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function xa(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const s of t){const r=s._stacks;if(!r||r[i]===void 0||r[i][n]===void 0)return;delete r[i][n],r[i]._visualValues!==void 0&&r[i]._visualValues[n]!==void 0&&delete r[i]._visualValues[n]}}}const $f=e=>e==="reset"||e==="none",gx=(e,t)=>t?e:Object.assign({},e),cL=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:rM(n,!0),values:null};var Na;let Zs=(Na=class{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=fx(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&&xa(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(d,h,f,p)=>d==="x"?h:d==="r"?p:f,r=n.xAxisID=at(i.xAxisID,jf(t,"x")),o=n.yAxisID=at(i.yAxisID,jf(t,"y")),a=n.rAxisID=at(i.rAxisID,jf(t,"r")),l=n.indexAxis,c=n.iAxisID=s(l,r,o,a),u=n.vAxisID=s(l,o,r,a);n.xScale=this.getScaleForId(r),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&&Qv(this._data,this),t._stacked&&xa(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(gt(n))this._data=iL(n);else if(i!==n){if(i){Qv(i,this);const s=this._cachedMeta;xa(s),s._parsed=[]}n&&Object.isExtensible(n)&&KA(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,i=this.getDataset();let s=!1;this._dataCheck();const r=n._stacked;n._stacked=fx(n.vScale,n),n.stack!==i.stack&&(s=!0,xa(n),n.stack=i.stack),this._resyncElements(t),(s||r!==n._stacked)&&mx(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:i,_data:s}=this,{iScale:r,_stacked:o}=i,a=r.axis;let l=t===0&&n===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,d,h;if(this._parsing===!1)i._parsed=s,i._sorted=!0,h=s;else{Ut(s[t])?h=this.parseArrayData(i,s,t,n):gt(s[t])?h=this.parseObjectData(i,s,t,n):h=this.parsePrimitiveData(i,s,t,n);const f=()=>d[a]===null||c&&d[a]m||d=0;--h)if(!p()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let s,r,o;for(s=0,r=n.length;s=0&&tthis.getContext(i,s,n),m=c.resolveNamedOptions(h,f,p,d);return m.$shared&&(m.$shared=l,r[o]=Object.freeze(gx(m,l))),m}_resolveAnimations(t,n,i){const s=this.chart,r=this._cachedDataOpts,o=`animation-${n}`,a=r[o];if(a)return a;let l;if(s.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),h=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(h,this.getContext(t,i,n))}const c=new sM(s,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||$f(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),s=this._sharedOptions,r=this.getSharedOptions(i),o=this.includeOptions(n,r)||r!==s;return this.updateSharedOptions(r,n,i),{sharedOptions:r,includeOptions:o}}updateElement(t,n,i,s){$f(s)?Object.assign(t,i):this._resolveAnimations(n,s).update(t,i)}updateSharedOptions(t,n,i){t&&!$f(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,s){t.active=s;const r=this.getStyle(n,s);this._resolveAnimations(n,i,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=i.length,r=n.length,o=Math.min(r,s);o&&this.parse(0,o),r>s?this._insertElements(s,r-s,t):r{for(c.length+=n,a=c.length-1;a>=o;a--)c[a]=c[a-n]};for(l(r),a=t;as-r))}return e._cache.$bar}function dL(e){const t=e.iScale,n=uL(t,e.type);let i=t._length,s,r,o,a;const l=()=>{o===32767||o===-32768||(zl(a)&&(i=Math.min(i,Math.abs(o-a)||i)),a=o)};for(s=0,r=n.length;s0?s[e-1]:null,a=eMath.abs(a)&&(l=a,c=o),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}function oM(e,t,n,i){return Ut(e)?pL(e,t,n,i):t[n.axis]=n.parse(e,i),t}function yx(e,t,n,i){const s=e.iScale,r=e.vScale,o=s.getLabels(),a=s===r,l=[];let c,u,d,h;for(c=n,u=n+i;c=n?1:-1)}function gL(e){let t,n,i,s,r;return e.horizontal?(t=e.base>e.x,n="left",i="right"):(t=e.basel.controller.options.grouped),r=i.options.stacked,o=[],a=l=>{const c=l.controller.getParsed(n),u=c&&c[l.vScale.axis];if(bt(u)||isNaN(u))return!0};for(const l of s)if(!(n!==void 0&&a(l))&&((r===!1||o.indexOf(l.stack)===-1||r===void 0&&l.stack===void 0)&&o.push(l.stack),l.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,i){const s=this._getStacks(t,i),r=n!==void 0?s.indexOf(n):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,n=this._cachedMeta,i=n.iScale,s=[];let r,o;for(r=0,o=n.data.length;r=0;--i)n=Math.max(n,t[i].size(this.resolveDataElementOptions(i))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=n,o=this.getParsed(t),a=s.getLabelForValue(o.x),l=r.getLabelForValue(o.y),c=o._custom;return{label:i[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,i,s){const r=s==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,s),u=o.axis,d=a.axis;for(let h=n;hWl(x,a,l,!0)?1:Math.max(_,_*n,w,w*n),p=(x,_,w)=>Wl(x,a,l,!0)?-1:Math.min(_,_*n,w,w*n),m=f(0,c,d),v=f(ue,u,h),y=p(Kt,c,d),g=p(Kt+ue,u,h);i=(m-y)/2,s=(v-g)/2,r=-(m+y)/2,o=-(v+g)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:o}}var no;let vy=(no=class extends Zs{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let r=l=>+i[l];if(gt(i[t])){const{key:l="value"}=this._parsing;r=c=>+zs(i[c],l)}let o,a;for(o=t,a=t+n;o0&&!isNaN(t)?Xt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=hc(n._parsed[t],i.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let n=0;const i=this.chart;let s,r,o,a,l;if(!t){for(s=0,r=i.data.datasets.length;st!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),K(no,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return n.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}}}),no);var Ia;let kL=(Ia=class extends Zs{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=n,o=this.chart._animationsDisabled;let{start:a,count:l}=zS(n,s,o);this._drawStart=a,this._drawCount=l,WS(n)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,n,i,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,s),h=o.axis,f=a.axis,{spanGaps:p,segment:m}=this.options,v=Wo(p)?p:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||r||s==="none",g=n+i,x=t.length;let _=n>0&&this.getParsed(n-1);for(let w=0;w=g){C.skip=!0;continue}const M=this.getParsed(w),P=bt(M[f]),T=C[h]=o.getPixelForValue(M[h],w),A=C[f]=r||P?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,M,l):M[f],w);C.skip=isNaN(T)||isNaN(A)||P,C.stop=w>0&&Math.abs(M[h]-_[h])>v,m&&(C.parsed=M,C.raw=c.data[w]),d&&(C.options=u||this.resolveDataElementOptions(w,S.active?"active":s)),y||this.updateElement(S,w,C,s),_=M}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const r=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},K(Ia,"id","line"),K(Ia,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),K(Ia,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}}),Ia);var Fa;let aM=(Fa=class extends Zs{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=hc(n._parsed[t].r,i.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,n,i,s){return QS.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(rn.max&&(n.max=r))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,i=t.options,s=Math.min(n.right-n.left,n.bottom-n.top),r=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,i,s){const r=s==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,h=c.getIndexAngle(0)-.5*Kt;let f=h,p;const m=360/this.countVisibleElements();for(p=0;p{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&n++}),n}_computeAngle(t,n,i){return this.chart.getDataVisibility(t)?Jn(this.resolveDataElementOptions(t,n).angle||i):0}},K(Fa,"id","polarArea"),K(Fa,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),K(Fa,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return n.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}}),Fa);var Ou;let SL=(Ou=class extends vy{},K(Ou,"id","pie"),K(Ou,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"}),Ou);var Ba;let ML=(Ba=class extends Zs{getLabelAndValue(t){const n=this._cachedMeta.vScale,i=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(i[n.axis])}}parseObjectData(t,n,i,s){return QS.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta,i=n.dataset,s=n.data||[],r=n.iScale.getLabels();if(i.points=s,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:r.length===s.length,options:o};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,n,i,s){const r=this._cachedMeta.rScale,o=s==="reset";for(let a=n;a0&&this.getParsed(n-1);for(let _=n;_0&&Math.abs(S[f]-x[f])>y,v&&(C.parsed=S,C.raw=c.data[_]),h&&(C.options=d||this.resolveDataElementOptions(_,w.active?"active":s)),g||this.updateElement(w,_,C,s),x=S}this.updateSharedOptions(d,s,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!n.length)return s;const r=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,r,o)/2}},K(Va,"id","scatter"),K(Va,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),K(Va,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}}),Va);var PL=Object.freeze({__proto__:null,BarController:bL,BubbleController:_L,DoughnutController:vy,LineController:kL,PieController:SL,PolarAreaController:aM,RadarController:ML,ScatterController:CL});function or(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class xy{constructor(t){K(this,"options");this.options=t||{}}static override(t){Object.assign(xy.prototype,t)}init(){}formats(){return or()}parse(){return or()}format(){return or()}add(){return or()}diff(){return or()}startOf(){return or()}endOf(){return or()}}var TL={_date:xy};function DL(e,t,n,i){const{controller:s,data:r,_sorted:o}=e,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&o&&r.length){const l=a._reversePixels?YA:zi;if(i){if(s._sharedOptions){const c=r[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(r,t,n-u),h=l(r,t,n+u);return{lo:d.lo,hi:h.hi}}}}else return l(r,t,n)}return{lo:0,hi:r.length-1}}function fc(e,t,n,i,s){const r=e.getSortedVisibleDatasetMetas(),o=n[t];for(let a=0,l=r.length;a{l[o](t[n],s)&&(r.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:r}var LL={evaluateInteractionItems:fc,modes:{index(e,t,n,i){const s=fr(t,e),r=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?Ff(e,s,r,i,o):Bf(e,s,r,!1,i,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,i){const s=fr(t,e),r=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?Ff(e,s,r,i,o):Bf(e,s,r,!1,i,o);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;un.pos===t)}function _x(e,t){return e.filter(n=>lM.indexOf(n.pos)===-1&&n.box.axis===t)}function _a(e,t){return e.sort((n,i)=>{const s=t?i:n,r=t?n:i;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function RL(e){const t=[];let n,i,s,r,o,a;for(n=0,i=(e||[]).length;nc.box.fullSize),!0),i=_a(ba(t,"left"),!0),s=_a(ba(t,"right")),r=_a(ba(t,"top"),!0),o=_a(ba(t,"bottom")),a=_x(t,"x"),l=_x(t,"y");return{fullSize:n,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:ba(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}function wx(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function cM(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 IL(e,t,n,i){const{pos:s,box:r}=n,o=e.maxPadding;if(!gt(s)){n.size&&(e[s]-=n.size);const d=i[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?r.height:r.width),n.size=d.size/d.count,e[s]+=n.size}r.getPadding&&cM(o,r.getPadding());const a=Math.max(0,t.outerWidth-wx(o,e,"left","right")),l=Math.max(0,t.outerHeight-wx(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 FL(e){const t=e.maxPadding;function n(i){const s=Math.max(t[i]-e[i],0);return e[i]+=s,s}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function BL(e,t){const n=t.maxPadding;function i(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{r[o]=Math.max(t[o],n[o])}),r}return i(e?["left","right"]:["top","bottom"])}function Ga(e,t,n,i){const s=[];let r,o,a,l,c,u;for(r=0,o=e.length,c=0;r{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=l.reduce((m,v)=>v.box.options&&v.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/u,hBoxMaxHeight:o/2}),h=Object.assign({},s);cM(h,Ae(i));const f=Object.assign({maxPadding:h,w:r,h:o,x:s.left,y:s.top},s),p=jL(l.concat(c),d);Ga(a.fullSize,f,d,p),Ga(l,f,d,p),Ga(c,f,d,p)&&Ga(l,f,d,p),FL(f),kx(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,kx(a.rightAndBottom,f,d,p),e.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},Et(a.chartArea,m=>{const v=m.box;Object.assign(v,e.chartArea),v.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};let uM=class{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,s){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,s?Math.floor(n/s):i)}}isAttached(t){return!0}updateConfig(t){}},VL=class extends uM{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}};const Qu="$chartjs",zL={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Sx=e=>e===null||e==="";function WL(e,t){const n=e.style,i=e.getAttribute("height"),s=e.getAttribute("width");if(e[Qu]={initial:{height:i,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Sx(s)){const r=ox(e,"width");r!==void 0&&(e.width=r)}if(Sx(i))if(e.style.height==="")e.height=e.width/(t||2);else{const r=ox(e,"height");r!==void 0&&(e.height=r)}return e}const dM=FO?{passive:!0}:!1;function HL(e,t,n){e&&e.addEventListener(t,n,dM)}function UL(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,dM)}function YL(e,t){const n=zL[e.type]||e.type,{x:i,y:s}=fr(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Id(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function XL(e,t,n){const i=e.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||Id(a.addedNodes,i),o=o&&!Id(a.removedNodes,i);o&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function KL(e,t,n){const i=e.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||Id(a.removedNodes,i),o=o&&!Id(a.addedNodes,i);o&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const Ul=new Map;let Mx=0;function hM(){const e=window.devicePixelRatio;e!==Mx&&(Mx=e,Ul.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function GL(e,t){Ul.size||window.addEventListener("resize",hM),Ul.set(e,t)}function qL(e){Ul.delete(e),Ul.size||window.removeEventListener("resize",hM)}function QL(e,t,n){const i=e.canvas,s=i&&yy(i);if(!s)return;const r=VS((a,l)=>{const c=s.clientWidth;n(a,l),c{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return o.observe(s),GL(e,r),o}function Vf(e,t,n){n&&n.disconnect(),t==="resize"&&qL(e)}function ZL(e,t,n){const i=e.canvas,s=VS(r=>{e.ctx!==null&&n(YL(r,e))},e);return HL(i,t,s),s}let JL=class extends uM{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(WL(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[Qu])return!1;const i=n[Qu].initial;["height","width"].forEach(r=>{const o=i[r];bt(o)?n.removeAttribute(r):n.setAttribute(r,o)});const s=i.style||{};return Object.keys(s).forEach(r=>{n.style[r]=s[r]}),n.width=n.width,delete n[Qu],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const s=t.$proxies||(t.$proxies={}),o={attach:XL,detach:KL,resize:QL}[n]||ZL;s[n]=o(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),s=i[n];if(!s)return;({attach:Vf,detach:Vf,resize:Vf}[n]||UL)(t,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,s){return IO(t,n,i,s)}isAttached(t){const n=yy(t);return!!(n&&n.isConnected)}};function tR(e){return!gy()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?VL:JL}var Lu;let os=(Lu=class{constructor(){K(this,"x");K(this,"y");K(this,"active",!1);K(this,"options");K(this,"$animations")}tooltipPosition(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return Wo(this.x)&&Wo(this.y)}getProps(t,n){const i=this.$animations;if(!n||!i)return this;const s={};return t.forEach(r=>{s[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),s}},K(Lu,"defaults",{}),K(Lu,"defaultRoutes"),Lu);function eR(e,t){const n=e.options.ticks,i=nR(e),s=Math.min(n.maxTicksLimit||i,i),r=n.major.enabled?sR(t):[],o=r.length,a=r[0],l=r[o-1],c=[];if(o>s)return rR(t,c,r,o/s),c;const u=iR(r,t,s);if(o>0){let d,h;const f=o>1?Math.round((l-a)/(o-1)):null;for(eu(t,c,u,bt(f)?0:a-f,a),d=0,h=o-1;ds)return l}return Math.max(s,1)}function sR(e){const t=[];let n,i;for(n=0,i=e.length;ne==="left"?"right":e==="right"?"left":e,Cx=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Px=(e,t)=>Math.min(t||e,e);function Tx(e,t){const n=[],i=e.length/t,s=e.length;let r=0;for(;ro+a)))return l}function cR(e,t){Et(e,n=>{const i=n.gc,s=i.length/2;let r;if(s>t){for(r=0;ri?i:n,i=s&&n>i?n:i,{min:mn(n,mn(i,n)),max:mn(i,mn(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){$t(this.options.beforeUpdate,[this])}update(t,n,i){const{beginAtZero:s,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=gO(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),d=u.widest.width,h=u.highest.height,f=we(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:f/(i-1),d+6>a&&(a=f/(i-(t.offset?.5:1)),l=this.maxHeight-wa(t.grid)-n.padding-Dx(t.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),o=ly(Math.min(Math.asin(we((u.highest.height+6)/a,-1,1)),Math.asin(we(l/c,-1,1))-Math.asin(we(h/c,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){$t(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){$t(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=Dx(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=wa(r)+l):(t.height=this.maxHeight,t.width=wa(r)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),f=i.padding*2,p=Jn(this.labelRotation),m=Math.cos(p),v=Math.sin(p);if(a){const y=i.mirror?0:v*d.width+m*h.height;t.height=Math.min(this.maxHeight,t.height+y+f)}else{const y=i.mirror?0:m*d.width+v*h.height;t.width=Math.min(this.maxWidth,t.width+y+f)}this._calculatePadding(c,u,v,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,i,s){const{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,f=0;l?c?(h=s*t.width,f=i*n.height):(h=i*t.height,f=s*n.width):r==="start"?f=n.width:r==="end"?h=t.width:r!=="inner"&&(h=t.width/2,f=n.width/2),this.paddingLeft=Math.max((h-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((f-d+o)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;r==="start"?(u=0,d=t.height):r==="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(){$t(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,i;for(n=0,i=t.length;n({width:o[P]||0,height:a[P]||0});return{first:M(0),last:M(n-1),widest:M(S),highest:M(C),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 UA(this._alignToPixels?rr(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&&ta*s?a/i:l/s:l*s0}_computeGridLineItems(t){const n=this.axis,i=this.chart,s=this.options,{grid:r,position:o,border:a}=s,l=r.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),h=wa(r),f=[],p=a.setContext(this.getContext()),m=p.display?p.width:0,v=m/2,y=function(R){return rr(i,R,m)};let g,x,_,w,S,C,M,P,T,A,E,z;if(o==="top")g=y(this.bottom),C=this.bottom-h,P=g-v,A=y(t.top)+v,z=t.bottom;else if(o==="bottom")g=y(this.top),A=t.top,z=y(t.bottom)-v,C=g+v,P=this.top+h;else if(o==="left")g=y(this.right),S=this.right-h,M=g-v,T=y(t.left)+v,E=t.right;else if(o==="right")g=y(this.left),T=t.left,E=y(t.right)-v,S=g+v,M=this.left+h;else if(n==="x"){if(o==="center")g=y((t.top+t.bottom)/2+.5);else if(gt(o)){const R=Object.keys(o)[0],B=o[R];g=y(this.chart.scales[R].getPixelForValue(B))}A=t.top,z=t.bottom,C=g+v,P=C+h}else if(n==="y"){if(o==="center")g=y((t.left+t.right)/2);else if(gt(o)){const R=Object.keys(o)[0],B=o[R];g=y(this.chart.scales[R].getPixelForValue(B))}S=g-v,M=S-h,T=t.left,E=t.right}const N=at(s.ticks.maxTicksLimit,d),L=Math.max(1,Math.ceil(d/N));for(x=0;x0&&(U-=Z/2);break}V={left:U,top:O,width:Z+W.width,height:et+W.height,color:L.backdropColor}}v.push({label:_,font:P,textOffset:E,options:{rotation:m,color:B,strokeColor:D,strokeWidth:$,textAlign:F,textBaseline:z,translation:[w,S],backdrop:V}})}return v}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Jn(this.labelRotation))return t==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:i,mirror:s,padding:r}}=this.options,o=this._getLabelSizes(),a=t+r,l=o.widest.width;let c,u;return n==="left"?s?(u=this.right+r,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?s?(u=this.left+r,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,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:i,top:s,width:r,height:o}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(i,s,r,o),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(r=>r.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(n.display)for(r=0,o=s.length;r{this.draw(r)}}]:[{z:i,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let r,o;for(r=0,o=n.length;r{const i=n.split("."),s=i.pop(),r=[e].concat(i).join("."),o=t[n].split("."),a=o.pop(),l=o.join(".");ne.route(r,s,l,a)})}function gR(e){return"id"in e&&"defaults"in e}let yR=class{constructor(){this.controllers=new nu(Zs,"datasets",!0),this.elements=new nu(os,"elements"),this.plugins=new nu(Object,"plugins"),this.scales=new nu(pc,"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,i){[...n].forEach(s=>{const r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):Et(s,o=>{const a=i||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,n,i){const s=ay(t);$t(i["before"+s],[],i),n[t](i),$t(i["after"+s],[],i)}_getRegistryForType(t){for(let n=0;nr.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(s(n,i),t,"stop"),this._notify(s(i,n),t,"start")}};function xR(e){const t={},n=[],i=Object.keys(hi.plugins.items);for(let r=0;r1&&Ex(e[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Ax(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function CR(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(i=>i.xAxisID===e||i.yAxisID===e);if(n.length)return Ax(e,"x",n[0])||Ax(e,"y",n[0])}return{}}function PR(e,t){const n=Fr[e.type]||{scales:{}},i=t.scales||{},s=wm(e.type,t),r=Object.create(null);return Object.keys(i).forEach(o=>{const a=i[o];if(!gt(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=km(o,a,CR(o,e),ne.scales[a.type]),c=SR(l,s),u=n.scales||{};r[o]=ul(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(o=>{const a=o.type||e.type,l=o.indexAxis||wm(a,t),u=(Fr[a]||{}).scales||{};Object.keys(u).forEach(d=>{const h=kR(d,l),f=o[h+"AxisID"]||h;r[f]=r[f]||Object.create(null),ul(r[f],[{axis:h},i[f],u[d]])})}),Object.keys(r).forEach(o=>{const a=r[o];ul(a,[ne.scales[a.type],ne.scale])}),r}function pM(e){const t=e.options||(e.options={});t.plugins=at(t.plugins,{}),t.scales=PR(e,t)}function mM(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function TR(e){return e=e||{},e.data=mM(e.data),pM(e),e}const Ox=new Map,gM=new Set;function iu(e,t){let n=Ox.get(e);return n||(n=t(),Ox.set(e,n),gM.add(n)),n}const ka=(e,t,n)=>{const i=zs(t,n);i!==void 0&&e.add(i)};let DR=class{constructor(t){this._config=TR(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=mM(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(),pM(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return iu(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return iu(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return iu(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return iu(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let s=i.get(t);return(!s||n)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,n,i){const{options:s,type:r}=this,o=this._cachedScopes(t,i),a=o.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>ka(l,t,d))),u.forEach(d=>ka(l,s,d)),u.forEach(d=>ka(l,Fr[r]||{},d)),u.forEach(d=>ka(l,ne,d)),u.forEach(d=>ka(l,bm,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),gM.has(n)&&o.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Fr[n]||{},ne.datasets[n]||{},{type:n},ne,bm]}resolveNamedOptions(t,n,i,s=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=Lx(this._resolverCache,t,s);let l=o;if(AR(o,n)){r.$shared=!1,i=Ws(i)?i():i;const c=this.createResolver(t,i,a);l=Ho(o,i,c)}for(const c of n)r[c]=l[c];return r}createResolver(t,n,i=[""],s){const{resolver:r}=Lx(this._resolverCache,t,i);return gt(n)?Ho(r,n,void 0,s):r}};function Lx(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const s=n.join();let r=i.get(s);return r||(r={resolver:fy(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,r)),r}const ER=e=>gt(e)&&Object.getOwnPropertyNames(e).some(t=>Ws(e[t]));function AR(e,t){const{isScriptable:n,isIndexable:i}=XS(e);for(const s of t){const r=n(s),o=i(s),a=(o||r)&&e[s];if(r&&(Ws(a)||ER(a))||o&&Ut(a))return!0}return!1}var OR="4.4.2";const LR=["top","bottom","left","right","chartArea"];function Rx(e,t){return e==="top"||e==="bottom"||LR.indexOf(e)===-1&&t==="x"}function Nx(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function jx(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),$t(n&&n.onComplete,[e],t)}function RR(e){const t=e.chart,n=t.options.animation;$t(n&&n.onProgress,[e],t)}function yM(e){return gy()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Zu={},$x=e=>{const t=yM(e);return Object.values(Zu).filter(n=>n.canvas===t).pop()};function NR(e,t,n){const i=Object.keys(e);for(const s of i){const r=+s;if(r>=t){const o=e[s];delete e[s],(n>0||r>t)&&(e[r+n]=o)}}}function jR(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}function su(e,t,n){return e.options.clip?e[n]:t[n]}function $R(e,t){const{xScale:n,yScale:i}=e;return n&&i?{left:su(n,t,"left"),right:su(n,t,"right"),top:su(i,t,"top"),bottom:su(i,t,"bottom")}:t}var fs;let by=(fs=class{static register(...t){hi.add(...t),Ix()}static unregister(...t){hi.remove(...t),Ix()}constructor(t,n){const i=this.config=new DR(n),s=yM(t),r=$x(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||tR(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=LA(),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 vR,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=GA(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],Zu[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Ai.listen(this,"complete",jx),Ai.listen(this,"progress",RR),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:s,_aspectRatio:r}=this;return bt(t)?n&&r?r:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return hi}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():rx(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return nx(this.canvas,this.ctx),this}stop(){return Ai.stop(this),this}resize(t,n){Ai.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,n,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,rx(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),$t(i.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Et(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,s=Object.keys(i).reduce((o,a)=>(o[a]=!1,o),{});let r=[];n&&(r=r.concat(Object.keys(n).map(o=>{const a=n[o],l=km(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Et(r,o=>{const a=o.options,l=a.id,c=km(l,a),u=at(a.type,o.dtype);(a.position===void 0||Rx(a.position,c)!==Rx(o.dposition))&&(a.position=o.dposition),s[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{const h=hi.getScale(u);d=new h({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),Et(s,(o,a)=>{o||delete i[a]}),Et(i,o=>{Fe.configure(this,o,o.options),Fe.addBox(this,o)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((s,r)=>s.index-r.index),i>n){for(let s=n;sn.length&&delete this._stacks,t.forEach((i,s)=>{n.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Nx("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Et(this.scales,t=>{Fe.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Xv(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:r}of n){const o=i==="_removeElements"?-r:r;NR(t,s,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),s=i(0);for(let r=1;rr.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Fe.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],Et(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,i=t._clip,s=!i.disabled,r=$R(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&Ch(n,{left:i.left===!1?0:r.left-i.left,right:i.right===!1?this.width:r.right+i.right,top:i.top===!1?0:r.top-i.top,bottom:i.bottom===!1?this.height:r.bottom+i.bottom}),t.controller.draw(),s&&Ph(n),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return Wi(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,s){const r=LL.modes[n];return typeof r=="function"?r(this,t,i,s):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let s=i.filter(r=>r&&r._dataset===n).pop();return s||(s={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},i.push(s)),s}getContext(){return this.$context||(this.$context=Qs(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){const s=i?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,s);zl(n)?(r.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(r,{visible:i}),this.update(a=>a.datasetIndex===t?s: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(),Ai.remove(this),t=0,n=this.data.datasets.length;t{n.addEventListener(this,r,o),t[r]=o},s=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};Et(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,i=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",r),i("detach",o)};o=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){Et(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Et(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const s=i?"set":"remove";let r,o,a,l;for(n==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a{const a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!Ld(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,i){const s=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),o=r(n,t),a=i?t:r(t,n);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,n){const i={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},s=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const r=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(t,n,i){const{_active:s=[],options:r}=this,o=n,a=this._getActiveElements(t,s,i,o),l=FA(t),c=jR(t,this._lastEvent,i,l);i&&(this._lastEvent=null,$t(r.onHover,[t,a,this],this),l&&$t(r.onClick,[t,a,this],this));const u=!Ld(a,s);return(u||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=c,u}_getActiveElements(t,n,i,s){if(t.type==="mouseout")return[];if(!i)return n;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}},K(fs,"defaults",ne),K(fs,"instances",Zu),K(fs,"overrides",Fr),K(fs,"registry",hi),K(fs,"version",OR),K(fs,"getChart",$x),fs);function Ix(){return Et(by.instances,e=>e._plugins.invalidate())}function IR(e,t,n){const{startAngle:i,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=t;let c=s/a;e.beginPath(),e.arc(r,o,a,i-c,n+c),l>s?(c=s/l,e.arc(r,o,l,n+c,i-c,!0)):e.arc(r,o,s,n+ue,i-ue),e.closePath(),e.clip()}function FR(e){return hy(e,["outerStart","outerEnd","innerStart","innerEnd"])}function BR(e,t,n,i){const s=FR(e.options.borderRadius),r=(n-t)/2,o=Math.min(r,i*t/2),a=l=>{const c=(n-Math.min(r,l))*i/2;return we(l,0,Math.min(r,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:we(s.innerStart,0,o),innerEnd:we(s.innerEnd,0,o)}}function Zr(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function Fd(e,t,n,i,s,r){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+i+n-c,0),h=u>0?u+i+n+c:0;let f=0;const p=s-l;if(i){const L=u>0?u-i:0,R=d>0?d-i:0,B=(L+R)/2,D=B!==0?p*B/(B+i):p;f=(p-D)/2}const m=Math.max(.001,p*d-n/Kt)/d,v=(p-m)/2,y=l+v+f,g=s-v-f,{outerStart:x,outerEnd:_,innerStart:w,innerEnd:S}=BR(t,h,d,g-y),C=d-x,M=d-_,P=y+x/C,T=g-_/M,A=h+w,E=h+S,z=y+w/A,N=g-S/E;if(e.beginPath(),r){const L=(P+T)/2;if(e.arc(o,a,d,P,L),e.arc(o,a,d,L,T),_>0){const $=Zr(M,T,o,a);e.arc($.x,$.y,_,T,g+ue)}const R=Zr(E,g,o,a);if(e.lineTo(R.x,R.y),S>0){const $=Zr(E,N,o,a);e.arc($.x,$.y,S,g+ue,N+Math.PI)}const B=(g-S/h+(y+w/h))/2;if(e.arc(o,a,h,g-S/h,B,!0),e.arc(o,a,h,B,y+w/h,!0),w>0){const $=Zr(A,z,o,a);e.arc($.x,$.y,w,z+Math.PI,y-ue)}const D=Zr(C,y,o,a);if(e.lineTo(D.x,D.y),x>0){const $=Zr(C,P,o,a);e.arc($.x,$.y,x,y-ue,P)}}else{e.moveTo(o,a);const L=Math.cos(P)*d+o,R=Math.sin(P)*d+a;e.lineTo(L,R);const B=Math.cos(T)*d+o,D=Math.sin(T)*d+a;e.lineTo(B,D)}e.closePath()}function VR(e,t,n,i,s){const{fullCircles:r,startAngle:o,circumference:a}=t;let l=t.endAngle;if(r){Fd(e,t,n,i,l,s);for(let c=0;c=Xt||Wl(o,l,c),v=Vi(a,u+f,d+f);return m&&v}getCenterPoint(n){const{x:i,y:s,startAngle:r,endAngle:o,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:u}=this.options,d=(r+o)/2,h=(a+l+u+c)/2;return{x:i+Math.cos(d)*h,y:s+Math.sin(d)*h}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:i,circumference:s}=this,r=(i.offset||0)/4,o=(i.spacing||0)/2,a=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>Xt?Math.floor(s/Xt):0,s===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*r,Math.sin(l)*r);const c=1-Math.sin(Math.min(Kt,s||0)),u=r*c;n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,VR(n,this,u,o,a),zR(n,this,u,o,a),n.restore()}},K(io,"id","arc"),K(io,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),K(io,"defaultRoutes",{backgroundColor:"backgroundColor"}),K(io,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"}),io);function xM(e,t,n=t){e.lineCap=at(n.borderCapStyle,t.borderCapStyle),e.setLineDash(at(n.borderDash,t.borderDash)),e.lineDashOffset=at(n.borderDashOffset,t.borderDashOffset),e.lineJoin=at(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=at(n.borderWidth,t.borderWidth),e.strokeStyle=at(n.borderColor,t.borderColor)}function WR(e,t,n){e.lineTo(n.x,n.y)}function HR(e){return e.stepped?aO:e.tension||e.cubicInterpolationMode==="monotone"?lO:WR}function bM(e,t,n={}){const i=e.length,{start:s=0,end:r=i-1}=n,{start:o,end:a}=t,l=Math.max(s,o),c=Math.min(r,a),u=sa&&r>a;return{count:i,start:l,loop:t.loop,ilen:c(o+(c?a-_:_))%r,x=()=>{m!==v&&(e.lineTo(u,v),e.lineTo(u,m),e.lineTo(u,y))};for(l&&(f=s[g(0)],e.moveTo(f.x,f.y)),h=0;h<=a;++h){if(f=s[g(h)],f.skip)continue;const _=f.x,w=f.y,S=_|0;S===p?(wv&&(v=w),u=(d*u+_)/++d):(x(),e.lineTo(_,w),p=S,d=0,m=v=w),y=w}x()}function Sm(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?YR:UR}function XR(e){return e.stepped?BO:e.tension||e.cubicInterpolationMode==="monotone"?VO:pr}function KR(e,t,n,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,i)&&s.closePath()),xM(e,t.options),e.stroke(s)}function GR(e,t,n,i){const{segments:s,options:r}=t,o=Sm(t);for(const a of s)xM(e,r,a.style),e.beginPath(),o(e,t,a,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const qR=typeof Path2D=="function";function QR(e,t,n,i){qR&&!t.options.segment?KR(e,t,n,i):GR(e,t,n,i)}var so;let Dh=(so=class extends os{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 i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;OO(this._points,i,t,s,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=XO(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,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){const i=this.options,s=t[n],r=this.points,o=iM(this,{property:n,start:s,end:s});if(!o.length)return;const a=[],l=XR(i);let c,u;for(c=0,u=o.length;ct!=="borderDash"&&t!=="fill"}),so);function Fx(e,t,n,i){const s=e.options,{[n]:r}=e.getProps([n],i);return Math.abs(t-r)e.replace("rgb(","rgba(").replace(")",", 0.5)"));function SM(e){return Mm[e%Mm.length]}function MM(e){return Bx[e%Bx.length]}function s2(e,t){return e.borderColor=SM(t),e.backgroundColor=MM(t),++t}function r2(e,t){return e.backgroundColor=e.data.map(()=>SM(t++)),t}function o2(e,t){return e.backgroundColor=e.data.map(()=>MM(t++)),t}function a2(e){let t=0;return(n,i)=>{const s=e.getDatasetMeta(i).controller;s instanceof vy?t=r2(n,t):s instanceof aM?t=o2(n,t):s&&(t=s2(n,t))}}function Vx(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function l2(e){return e&&(e.borderColor||e.backgroundColor)}var c2={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:i},options:s}=e.config,{elements:r}=s;if(!n.forceOverride&&(Vx(i)||l2(s)||r&&Vx(r)))return;const o=a2(e);i.forEach(o)}};function u2(e,t,n,i,s){const r=s.samples||i;if(r>=n)return e.slice(t,t+n);const o=[],a=(n-2)/(r-2);let l=0;const c=t+n-1;let u=t,d,h,f,p,m;for(o[l++]=e[u],d=0;df&&(f=p,h=e[g],m=g);o[l++]=h,u=m}return o[l++]=e[c],o}function d2(e,t,n,i){let s=0,r=0,o,a,l,c,u,d,h,f,p,m;const v=[],y=t+n-1,g=e[t].x,_=e[y].x-g;for(o=t;om&&(m=c,h=o),s=(r*s+a.x)/++r;else{const S=o-1;if(!bt(d)&&!bt(h)){const C=Math.min(d,h),M=Math.max(d,h);C!==f&&C!==S&&v.push({...e[C],x:s}),M!==f&&M!==S&&v.push({...e[M],x:s})}o>0&&S!==f&&v.push(e[S]),v.push(a),u=w,r=0,p=m=c,d=h=f=o}}return v}function CM(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function zx(e){e.data.datasets.forEach(t=>{CM(t)})}function h2(e,t){const n=t.length;let i=0,s;const{iScale:r}=e,{min:o,max:a,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=we(zi(t,r.axis,o).lo,0,n-1)),c?s=we(zi(t,r.axis,a).hi+1,i,n)-i:s=n-i,{start:i,count:s}}var f2={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){zx(e);return}const i=e.width;e.data.datasets.forEach((s,r)=>{const{_data:o,indexAxis:a}=s,l=e.getDatasetMeta(r),c=o||s.data;if(Ht([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:d,count:h}=h2(l,c);const f=n.threshold||4*i;if(h<=f){CM(s);return}bt(o)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let p;switch(n.algorithm){case"lttb":p=u2(c,d,h,i,n);break;case"min-max":p=d2(c,d,h,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}s._decimated=p})},destroy(e){zx(e)}};function p2(e,t,n){const i=e.segments,s=e.points,r=t.points,o=[];for(const a of i){let{start:l,end:c}=a;c=_y(l,c,s);const u=Cm(n,s[l],s[c],a.loop);if(!t.segments){o.push({source:a,target:u,start:s[l],end:s[c]});continue}const d=iM(t,u);for(const h of d){const f=Cm(n,r[h.start],r[h.end],h.loop),p=nM(a,s,f);for(const m of p)o.push({source:m,target:h,start:{[n]:Wx(u,f,"start",Math.max)},end:{[n]:Wx(u,f,"end",Math.min)}})}}return o}function Cm(e,t,n,i){if(i)return;let s=t[e],r=n[e];return e==="angle"&&(s=yn(s),r=yn(r)),{property:e,start:s,end:r}}function m2(e,t){const{x:n=null,y:i=null}=e||{},s=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=_y(o,a,s);const l=s[o],c=s[a];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):n!==null&&(r.push({x:n,y:l.y}),r.push({x:n,y:c.y}))}),r}function _y(e,t,n){for(;t>e;t--){const i=n[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Wx(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function PM(e,t){let n=[],i=!1;return Ut(e)?(i=!0,n=e):n=m2(e,t),n.length?new Dh({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function Hx(e){return e&&e.fill!==!1}function g2(e,t,n){let s=e[t].fill;const r=[t];let o;if(!n)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!oe(s))return s;if(o=e[s],!o)return!1;if(o.visible)return s;r.push(s),s=o.fill}return!1}function y2(e,t,n){const i=_2(e);if(gt(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return oe(s)&&Math.floor(s)===s?v2(i[0],t,s,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function v2(e,t,n,i){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=i?!1:n}function x2(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:gt(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function b2(e,t,n){let i;return e==="start"?i=n:e==="end"?i=t.options.reverse?t.min:t.max:gt(e)?i=e.value:i=t.getBaseValue(),i}function _2(e){const t=e.options,n=t.fill;let i=at(n&&n.target,n);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function w2(e){const{scale:t,index:n,line:i}=e,s=[],r=i.segments,o=i.points,a=k2(t,n);a.push(PM({x:null,y:t.bottom},i));for(let l=0;l=0;--o){const a=s[o].$filler;a&&(a.line.updateControlPoints(r,a.axis),i&&a.fill&&Hf(e.ctx,a,r))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=e.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const r=i[s].$filler;Hx(r)&&Hf(e.ctx,r,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;!Hx(i)||n.drawTime!=="beforeDatasetDraw"||Hf(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Kx=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}},R2=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;let Gx=class extends os{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,i){this.maxWidth=t,this.maxHeight=n,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=$t(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,s)=>t.sort(i,s,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 i=t.labels,s=ge(i.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Kx(i,r);let c,u;n.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,r,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,s){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a;let d=t;r.textAlign="left",r.textBaseline="middle";let h=-1,f=-u;return this.legendItems.forEach((p,m)=>{const v=i+n/2+r.measureText(p.text).width;(m===0||c[c.length-1]+v+2*a>o)&&(d+=u,c[c.length-(m>0?0:1)]=0,f+=u,h++),l[m]={left:0,top:f,row:h,width:v,height:s},c[c.length-1]+=v+a}),d}_fitCols(t,n,i,s){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-t;let d=a,h=0,f=0,p=0,m=0;return this.legendItems.forEach((v,y)=>{const{itemWidth:g,itemHeight:x}=N2(i,n,r,v,s);y>0&&f+x+2*a>u&&(d+=h+a,c.push({width:h,height:f}),p+=h+a,m++,h=f=0),l[y]={left:p,top:f,col:m,width:g,height:x},h=Math.max(h,g),f+=x+a}),d+=h,c.push({width:h,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:r}}=this,o=Oo(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=Ne(i,this.left+s,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=Ne(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+s}else{let a=0,l=Ne(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=Ne(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Ch(t,this),this._draw(),Ph(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:s}=this,{align:r,labels:o}=t,a=ne.color,l=Oo(t.rtl,this.left,this.width),c=ge(o.font),{padding:u}=o,d=c.size,h=d/2;let f;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:p,boxHeight:m,itemHeight:v}=Kx(o,d),y=function(S,C,M){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;s.save();const P=at(M.lineWidth,1);if(s.fillStyle=at(M.fillStyle,a),s.lineCap=at(M.lineCap,"butt"),s.lineDashOffset=at(M.lineDashOffset,0),s.lineJoin=at(M.lineJoin,"miter"),s.lineWidth=P,s.strokeStyle=at(M.strokeStyle,a),s.setLineDash(at(M.lineDash,[])),o.usePointStyle){const T={radius:m*Math.SQRT2/2,pointStyle:M.pointStyle,rotation:M.rotation,borderWidth:P},A=l.xPlus(S,p/2),E=C+h;US(s,T,A,E,o.pointStyleWidth&&p)}else{const T=C+Math.max((d-m)/2,0),A=l.leftForLtr(S,p),E=Cr(M.borderRadius);s.beginPath(),Object.values(E).some(z=>z!==0)?Hl(s,{x:A,y:T,w:p,h:m,radius:E}):s.rect(A,T,p,m),s.fill(),P!==0&&s.stroke()}s.restore()},g=function(S,C,M){Br(s,M.text,S,C+v/2,c,{strikethrough:M.hidden,textAlign:l.textAlign(M.textAlign)})},x=this.isHorizontal(),_=this._computeTitleHeight();x?f={x:Ne(r,this.left+u,this.right-i[0]),y:this.top+u+_,line:0}:f={x:this.left+u,y:Ne(r,this.top+_+u,this.bottom-n[0].height),line:0},JS(this.ctx,t.textDirection);const w=v+u;this.legendItems.forEach((S,C)=>{s.strokeStyle=S.fontColor,s.fillStyle=S.fontColor;const M=s.measureText(S.text).width,P=l.textAlign(S.textAlign||(S.textAlign=o.textAlign)),T=p+h+M;let A=f.x,E=f.y;l.setWidth(this.width),x?C>0&&A+T+u>this.right&&(E=f.y+=w,f.line++,A=f.x=Ne(r,this.left+u,this.right-i[f.line])):C>0&&E+w>this.bottom&&(A=f.x=A+n[f.line].width+u,f.line++,E=f.y=Ne(r,this.top+_+u,this.bottom-n[f.line].height));const z=l.x(A);if(y(z,E,S),A=qA(P,A+p+h,x?A+T:this.right,t.rtl),g(l.x(A),E,S),x)f.x+=T+u;else if(typeof S.text!="string"){const N=c.lineHeight;f.y+=DM(S,N)+u}else f.y+=w}),tM(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=ge(n.font),s=Ae(n.padding);if(!n.display)return;const r=Oo(t.rtl,this.left,this.width),o=this.ctx,a=n.position,l=i.size/2,c=s.top+l;let u,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,d=Ne(t.align,d,this.right-h);else{const p=this.columnSizes.reduce((m,v)=>Math.max(m,v.height),0);u=c+Ne(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const f=Ne(a,d,d+h);o.textAlign=r.textAlign(uy(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=i.string,Br(o,n.text,f,u,i)}_computeTitleHeight(){const t=this.options.title,n=ge(t.font),i=Ae(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,s,r;if(Vi(t,this.left,this.right)&&Vi(n,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;ir.length>o.length?r:o)),t+n.size/2+i.measureText(s).width}function $2(e,t,n){let i=e;return typeof t.text!="string"&&(i=DM(t,n)),i}function DM(e,t){const n=e.text?e.text.length:0;return t*n}function I2(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var F2={id:"legend",_element:Gx,start(e,t,n){const i=e.legend=new Gx({ctx:e.ctx,options:n,chart:e});Fe.configure(e,i,n),Fe.addBox(e,i)},stop(e){Fe.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;Fe.configure(e,i,n),i.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 i=t.datasetIndex,s=n.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),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:i,textAlign:s,color:r,useBorderRadius:o,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=Ae(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:r,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};let wy=class extends os{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 i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const s=Ut(i.text)?i.text.length:1;this._padding=Ae(i.padding);const r=s*ge(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:i,bottom:s,right:r,options:o}=this,a=o.align;let l=0,c,u,d;return this.isHorizontal()?(u=Ne(a,i,r),d=n+t,c=r-i):(o.position==="left"?(u=i+t,d=Ne(a,s,n),l=Kt*-.5):(u=r-t,d=Ne(a,n,s),l=Kt*.5),c=s-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=ge(n.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);Br(t,n.text,0,0,i,{color:n.color,maxWidth:l,rotation:c,textAlign:uy(n.align),textBaseline:"middle",translation:[o,a]})}};function B2(e,t){const n=new wy({ctx:e.ctx,options:t,chart:e});Fe.configure(e,n,t),Fe.addBox(e,n),e.titleBlock=n}var V2={id:"title",_element:wy,start(e,t,n){B2(e,n)},stop(e){const t=e.titleBlock;Fe.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;Fe.configure(e,i,n),i.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 ru=new WeakMap;var z2={id:"subtitle",start(e,t,n){const i=new wy({ctx:e.ctx,options:n,chart:e});Fe.configure(e,i,n),Fe.addBox(e,i),ru.set(e,i)},stop(e){Fe.removeBox(e,ru.get(e)),ru.delete(e)},beforeUpdate(e,t,n){const i=ru.get(e);Fe.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const qa={average(e){if(!e.length)return!1;let t,n,i=new Set,s=0,r=0;for(t=0,n=e.length;ta+l)/i.size,y:s/r}},nearest(e,t){if(!e.length)return!1;let n=t.x,i=t.y,s=Number.POSITIVE_INFINITY,r,o,a;for(r=0,o=e.length;ra({chart:t,initial:n.initial,numSteps:o,currentStep:Math.min(i-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=BS.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const r=i.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),r.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),n+=r.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}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((i,s)=>Math.max(i,s._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 i=n.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};var Ai=new qO;const ux="transparent",QO={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=tx(e||ux),s=i.valid&&tx(t||ux);return s&&s.valid?s.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};let ZO=class{constructor(t,n,i,s){const r=n[i];s=Ht([t.to,s,r,t.from]);const o=Ht([t.from,r,s]);this._active=!0,this._fn=t.fn||QO[t.type||typeof o],this._easing=hl[t.easing]||hl.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=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);const s=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Ht([t.to,n,s,t.from]),this._from=Ht([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,i=this._duration,s=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||n1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){const n=t?"res":"rej",i=this._promises||[];for(let s=0;s{const r=t[s];if(!gt(r))return;const o={};for(const a of n)o[a]=r[a];(Ut(r.properties)&&r.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,o)})})}_animateOptions(t,n){const i=n.options,s=t2(t,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&JO(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,n){const i=this._properties,s=[],r=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"){s.push(...this._animateOptions(t,n));continue}const u=n[c];let d=r[c];const h=i.get(c);if(d)if(h&&d.active()){d.update(h,u,a);continue}else d.cancel();if(!h||!h.duration){t[c]=u;continue}r[c]=d=new ZO(h,t,c,u),s.push(d)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return Ai.add(this._chart,i),!0}};function JO(e,t){const n=[],i=Object.keys(t);for(let s=0;s0||!n&&r<0)return s.index}return null}function mx(e,t){const{chart:n,_cachedMeta:i}=e,s=n._stacks||(n._stacks={}),{iScale:r,vScale:o,index:a}=i,l=r.axis,c=o.axis,u=s2(r,o,i),d=t.length;let h;for(let f=0;fn[i].axis===t).shift()}function a2(e,t){return Qs(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function l2(e,t,n){return Qs(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function xa(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const s of t){const r=s._stacks;if(!r||r[i]===void 0||r[i][n]===void 0)return;delete r[i][n],r[i]._visualValues!==void 0&&r[i]._visualValues[n]!==void 0&&delete r[i]._visualValues[n]}}}const $f=e=>e==="reset"||e==="none",gx=(e,t)=>t?e:Object.assign({},e),c2=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:rM(n,!0),values:null};var Na;let Zs=(Na=class{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=fx(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&&xa(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(d,h,f,p)=>d==="x"?h:d==="r"?p:f,r=n.xAxisID=at(i.xAxisID,jf(t,"x")),o=n.yAxisID=at(i.yAxisID,jf(t,"y")),a=n.rAxisID=at(i.rAxisID,jf(t,"r")),l=n.indexAxis,c=n.iAxisID=s(l,r,o,a),u=n.vAxisID=s(l,o,r,a);n.xScale=this.getScaleForId(r),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&&Qv(this._data,this),t._stacked&&xa(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(gt(n))this._data=i2(n);else if(i!==n){if(i){Qv(i,this);const s=this._cachedMeta;xa(s),s._parsed=[]}n&&Object.isExtensible(n)&&KA(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,i=this.getDataset();let s=!1;this._dataCheck();const r=n._stacked;n._stacked=fx(n.vScale,n),n.stack!==i.stack&&(s=!0,xa(n),n.stack=i.stack),this._resyncElements(t),(s||r!==n._stacked)&&mx(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:i,_data:s}=this,{iScale:r,_stacked:o}=i,a=r.axis;let l=t===0&&n===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,d,h;if(this._parsing===!1)i._parsed=s,i._sorted=!0,h=s;else{Ut(s[t])?h=this.parseArrayData(i,s,t,n):gt(s[t])?h=this.parseObjectData(i,s,t,n):h=this.parsePrimitiveData(i,s,t,n);const f=()=>d[a]===null||c&&d[a]m||d=0;--h)if(!p()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let s,r,o;for(s=0,r=n.length;s=0&&tthis.getContext(i,s,n),m=c.resolveNamedOptions(h,f,p,d);return m.$shared&&(m.$shared=l,r[o]=Object.freeze(gx(m,l))),m}_resolveAnimations(t,n,i){const s=this.chart,r=this._cachedDataOpts,o=`animation-${n}`,a=r[o];if(a)return a;let l;if(s.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),h=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(h,this.getContext(t,i,n))}const c=new sM(s,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||$f(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),s=this._sharedOptions,r=this.getSharedOptions(i),o=this.includeOptions(n,r)||r!==s;return this.updateSharedOptions(r,n,i),{sharedOptions:r,includeOptions:o}}updateElement(t,n,i,s){$f(s)?Object.assign(t,i):this._resolveAnimations(n,s).update(t,i)}updateSharedOptions(t,n,i){t&&!$f(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,s){t.active=s;const r=this.getStyle(n,s);this._resolveAnimations(n,i,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=i.length,r=n.length,o=Math.min(r,s);o&&this.parse(0,o),r>s?this._insertElements(s,r-s,t):r{for(c.length+=n,a=c.length-1;a>=o;a--)c[a]=c[a-n]};for(l(r),a=t;as-r))}return e._cache.$bar}function d2(e){const t=e.iScale,n=u2(t,e.type);let i=t._length,s,r,o,a;const l=()=>{o===32767||o===-32768||(zl(a)&&(i=Math.min(i,Math.abs(o-a)||i)),a=o)};for(s=0,r=n.length;s0?s[e-1]:null,a=eMath.abs(a)&&(l=a,c=o),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}function oM(e,t,n,i){return Ut(e)?p2(e,t,n,i):t[n.axis]=n.parse(e,i),t}function yx(e,t,n,i){const s=e.iScale,r=e.vScale,o=s.getLabels(),a=s===r,l=[];let c,u,d,h;for(c=n,u=n+i;c=n?1:-1)}function g2(e){let t,n,i,s,r;return e.horizontal?(t=e.base>e.x,n="left",i="right"):(t=e.basel.controller.options.grouped),r=i.options.stacked,o=[],a=l=>{const c=l.controller.getParsed(n),u=c&&c[l.vScale.axis];if(bt(u)||isNaN(u))return!0};for(const l of s)if(!(n!==void 0&&a(l))&&((r===!1||o.indexOf(l.stack)===-1||r===void 0&&l.stack===void 0)&&o.push(l.stack),l.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,i){const s=this._getStacks(t,i),r=n!==void 0?s.indexOf(n):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,n=this._cachedMeta,i=n.iScale,s=[];let r,o;for(r=0,o=n.data.length;r=0;--i)n=Math.max(n,t[i].size(this.resolveDataElementOptions(i))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=n,o=this.getParsed(t),a=s.getLabelForValue(o.x),l=r.getLabelForValue(o.y),c=o._custom;return{label:i[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,i,s){const r=s==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,s),u=o.axis,d=a.axis;for(let h=n;hWl(x,a,l,!0)?1:Math.max(_,_*n,w,w*n),p=(x,_,w)=>Wl(x,a,l,!0)?-1:Math.min(_,_*n,w,w*n),m=f(0,c,d),v=f(ue,u,h),y=p(Kt,c,d),g=p(Kt+ue,u,h);i=(m-y)/2,s=(v-g)/2,r=-(m+y)/2,o=-(v+g)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:o}}var no;let vy=(no=class extends Zs{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let r=l=>+i[l];if(gt(i[t])){const{key:l="value"}=this._parsing;r=c=>+zs(i[c],l)}let o,a;for(o=t,a=t+n;o0&&!isNaN(t)?Xt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=hc(n._parsed[t],i.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let n=0;const i=this.chart;let s,r,o,a,l;if(!t){for(s=0,r=i.data.datasets.length;st!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),K(no,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return n.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}}}),no);var Ia;let k2=(Ia=class extends Zs{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=n,o=this.chart._animationsDisabled;let{start:a,count:l}=zS(n,s,o);this._drawStart=a,this._drawCount=l,WS(n)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,n,i,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,s),h=o.axis,f=a.axis,{spanGaps:p,segment:m}=this.options,v=Wo(p)?p:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||r||s==="none",g=n+i,x=t.length;let _=n>0&&this.getParsed(n-1);for(let w=0;w=g){C.skip=!0;continue}const M=this.getParsed(w),P=bt(M[f]),T=C[h]=o.getPixelForValue(M[h],w),A=C[f]=r||P?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,M,l):M[f],w);C.skip=isNaN(T)||isNaN(A)||P,C.stop=w>0&&Math.abs(M[h]-_[h])>v,m&&(C.parsed=M,C.raw=c.data[w]),d&&(C.options=u||this.resolveDataElementOptions(w,S.active?"active":s)),y||this.updateElement(S,w,C,s),_=M}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const r=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},K(Ia,"id","line"),K(Ia,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),K(Ia,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}}),Ia);var Fa;let aM=(Fa=class extends Zs{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=hc(n._parsed[t].r,i.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,n,i,s){return QS.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(rn.max&&(n.max=r))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,i=t.options,s=Math.min(n.right-n.left,n.bottom-n.top),r=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,i,s){const r=s==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,h=c.getIndexAngle(0)-.5*Kt;let f=h,p;const m=360/this.countVisibleElements();for(p=0;p{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&n++}),n}_computeAngle(t,n,i){return this.chart.getDataVisibility(t)?Jn(this.resolveDataElementOptions(t,n).angle||i):0}},K(Fa,"id","polarArea"),K(Fa,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),K(Fa,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return n.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}}),Fa);var Ou;let S2=(Ou=class extends vy{},K(Ou,"id","pie"),K(Ou,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"}),Ou);var Ba;let M2=(Ba=class extends Zs{getLabelAndValue(t){const n=this._cachedMeta.vScale,i=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(i[n.axis])}}parseObjectData(t,n,i,s){return QS.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta,i=n.dataset,s=n.data||[],r=n.iScale.getLabels();if(i.points=s,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:r.length===s.length,options:o};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,n,i,s){const r=this._cachedMeta.rScale,o=s==="reset";for(let a=n;a0&&this.getParsed(n-1);for(let _=n;_0&&Math.abs(S[f]-x[f])>y,v&&(C.parsed=S,C.raw=c.data[_]),h&&(C.options=d||this.resolveDataElementOptions(_,w.active?"active":s)),g||this.updateElement(w,_,C,s),x=S}this.updateSharedOptions(d,s,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!n.length)return s;const r=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,r,o)/2}},K(Va,"id","scatter"),K(Va,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),K(Va,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}}),Va);var P2=Object.freeze({__proto__:null,BarController:b2,BubbleController:_2,DoughnutController:vy,LineController:k2,PieController:S2,PolarAreaController:aM,RadarController:M2,ScatterController:C2});function or(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class xy{constructor(t){K(this,"options");this.options=t||{}}static override(t){Object.assign(xy.prototype,t)}init(){}formats(){return or()}parse(){return or()}format(){return or()}add(){return or()}diff(){return or()}startOf(){return or()}endOf(){return or()}}var T2={_date:xy};function D2(e,t,n,i){const{controller:s,data:r,_sorted:o}=e,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&o&&r.length){const l=a._reversePixels?YA:zi;if(i){if(s._sharedOptions){const c=r[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(r,t,n-u),h=l(r,t,n+u);return{lo:d.lo,hi:h.hi}}}}else return l(r,t,n)}return{lo:0,hi:r.length-1}}function fc(e,t,n,i,s){const r=e.getSortedVisibleDatasetMetas(),o=n[t];for(let a=0,l=r.length;a{l[o](t[n],s)&&(r.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:r}var L2={evaluateInteractionItems:fc,modes:{index(e,t,n,i){const s=fr(t,e),r=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?Ff(e,s,r,i,o):Bf(e,s,r,!1,i,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,i){const s=fr(t,e),r=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?Ff(e,s,r,i,o):Bf(e,s,r,!1,i,o);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;un.pos===t)}function _x(e,t){return e.filter(n=>lM.indexOf(n.pos)===-1&&n.box.axis===t)}function _a(e,t){return e.sort((n,i)=>{const s=t?i:n,r=t?n:i;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function R2(e){const t=[];let n,i,s,r,o,a;for(n=0,i=(e||[]).length;nc.box.fullSize),!0),i=_a(ba(t,"left"),!0),s=_a(ba(t,"right")),r=_a(ba(t,"top"),!0),o=_a(ba(t,"bottom")),a=_x(t,"x"),l=_x(t,"y");return{fullSize:n,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:ba(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}function wx(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function cM(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 I2(e,t,n,i){const{pos:s,box:r}=n,o=e.maxPadding;if(!gt(s)){n.size&&(e[s]-=n.size);const d=i[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?r.height:r.width),n.size=d.size/d.count,e[s]+=n.size}r.getPadding&&cM(o,r.getPadding());const a=Math.max(0,t.outerWidth-wx(o,e,"left","right")),l=Math.max(0,t.outerHeight-wx(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 F2(e){const t=e.maxPadding;function n(i){const s=Math.max(t[i]-e[i],0);return e[i]+=s,s}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function B2(e,t){const n=t.maxPadding;function i(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{r[o]=Math.max(t[o],n[o])}),r}return i(e?["left","right"]:["top","bottom"])}function Ga(e,t,n,i){const s=[];let r,o,a,l,c,u;for(r=0,o=e.length,c=0;r{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=l.reduce((m,v)=>v.box.options&&v.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/u,hBoxMaxHeight:o/2}),h=Object.assign({},s);cM(h,Ae(i));const f=Object.assign({maxPadding:h,w:r,h:o,x:s.left,y:s.top},s),p=j2(l.concat(c),d);Ga(a.fullSize,f,d,p),Ga(l,f,d,p),Ga(c,f,d,p)&&Ga(l,f,d,p),F2(f),kx(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,kx(a.rightAndBottom,f,d,p),e.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},Et(a.chartArea,m=>{const v=m.box;Object.assign(v,e.chartArea),v.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};let uM=class{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,s){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,s?Math.floor(n/s):i)}}isAttached(t){return!0}updateConfig(t){}},V2=class extends uM{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}};const Qu="$chartjs",z2={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Sx=e=>e===null||e==="";function W2(e,t){const n=e.style,i=e.getAttribute("height"),s=e.getAttribute("width");if(e[Qu]={initial:{height:i,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Sx(s)){const r=ox(e,"width");r!==void 0&&(e.width=r)}if(Sx(i))if(e.style.height==="")e.height=e.width/(t||2);else{const r=ox(e,"height");r!==void 0&&(e.height=r)}return e}const dM=FO?{passive:!0}:!1;function H2(e,t,n){e&&e.addEventListener(t,n,dM)}function U2(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,dM)}function Y2(e,t){const n=z2[e.type]||e.type,{x:i,y:s}=fr(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Id(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function X2(e,t,n){const i=e.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||Id(a.addedNodes,i),o=o&&!Id(a.removedNodes,i);o&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function K2(e,t,n){const i=e.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||Id(a.removedNodes,i),o=o&&!Id(a.addedNodes,i);o&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const Ul=new Map;let Mx=0;function hM(){const e=window.devicePixelRatio;e!==Mx&&(Mx=e,Ul.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function G2(e,t){Ul.size||window.addEventListener("resize",hM),Ul.set(e,t)}function q2(e){Ul.delete(e),Ul.size||window.removeEventListener("resize",hM)}function Q2(e,t,n){const i=e.canvas,s=i&&yy(i);if(!s)return;const r=VS((a,l)=>{const c=s.clientWidth;n(a,l),c{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return o.observe(s),G2(e,r),o}function Vf(e,t,n){n&&n.disconnect(),t==="resize"&&q2(e)}function Z2(e,t,n){const i=e.canvas,s=VS(r=>{e.ctx!==null&&n(Y2(r,e))},e);return H2(i,t,s),s}let J2=class extends uM{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(W2(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[Qu])return!1;const i=n[Qu].initial;["height","width"].forEach(r=>{const o=i[r];bt(o)?n.removeAttribute(r):n.setAttribute(r,o)});const s=i.style||{};return Object.keys(s).forEach(r=>{n.style[r]=s[r]}),n.width=n.width,delete n[Qu],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const s=t.$proxies||(t.$proxies={}),o={attach:X2,detach:K2,resize:Q2}[n]||Z2;s[n]=o(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),s=i[n];if(!s)return;({attach:Vf,detach:Vf,resize:Vf}[n]||U2)(t,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,s){return IO(t,n,i,s)}isAttached(t){const n=yy(t);return!!(n&&n.isConnected)}};function tL(e){return!gy()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?V2:J2}var Lu;let os=(Lu=class{constructor(){K(this,"x");K(this,"y");K(this,"active",!1);K(this,"options");K(this,"$animations")}tooltipPosition(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return Wo(this.x)&&Wo(this.y)}getProps(t,n){const i=this.$animations;if(!n||!i)return this;const s={};return t.forEach(r=>{s[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),s}},K(Lu,"defaults",{}),K(Lu,"defaultRoutes"),Lu);function eL(e,t){const n=e.options.ticks,i=nL(e),s=Math.min(n.maxTicksLimit||i,i),r=n.major.enabled?sL(t):[],o=r.length,a=r[0],l=r[o-1],c=[];if(o>s)return rL(t,c,r,o/s),c;const u=iL(r,t,s);if(o>0){let d,h;const f=o>1?Math.round((l-a)/(o-1)):null;for(eu(t,c,u,bt(f)?0:a-f,a),d=0,h=o-1;ds)return l}return Math.max(s,1)}function sL(e){const t=[];let n,i;for(n=0,i=e.length;ne==="left"?"right":e==="right"?"left":e,Cx=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Px=(e,t)=>Math.min(t||e,e);function Tx(e,t){const n=[],i=e.length/t,s=e.length;let r=0;for(;ro+a)))return l}function cL(e,t){Et(e,n=>{const i=n.gc,s=i.length/2;let r;if(s>t){for(r=0;ri?i:n,i=s&&n>i?n:i,{min:mn(n,mn(i,n)),max:mn(i,mn(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){$t(this.options.beforeUpdate,[this])}update(t,n,i){const{beginAtZero:s,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=gO(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),d=u.widest.width,h=u.highest.height,f=we(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:f/(i-1),d+6>a&&(a=f/(i-(t.offset?.5:1)),l=this.maxHeight-wa(t.grid)-n.padding-Dx(t.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),o=ly(Math.min(Math.asin(we((u.highest.height+6)/a,-1,1)),Math.asin(we(l/c,-1,1))-Math.asin(we(h/c,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){$t(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){$t(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=Dx(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=wa(r)+l):(t.height=this.maxHeight,t.width=wa(r)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),f=i.padding*2,p=Jn(this.labelRotation),m=Math.cos(p),v=Math.sin(p);if(a){const y=i.mirror?0:v*d.width+m*h.height;t.height=Math.min(this.maxHeight,t.height+y+f)}else{const y=i.mirror?0:m*d.width+v*h.height;t.width=Math.min(this.maxWidth,t.width+y+f)}this._calculatePadding(c,u,v,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,i,s){const{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,f=0;l?c?(h=s*t.width,f=i*n.height):(h=i*t.height,f=s*n.width):r==="start"?f=n.width:r==="end"?h=t.width:r!=="inner"&&(h=t.width/2,f=n.width/2),this.paddingLeft=Math.max((h-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((f-d+o)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;r==="start"?(u=0,d=t.height):r==="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(){$t(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,i;for(n=0,i=t.length;n({width:o[P]||0,height:a[P]||0});return{first:M(0),last:M(n-1),widest:M(S),highest:M(C),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 UA(this._alignToPixels?rr(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&&ta*s?a/i:l/s:l*s0}_computeGridLineItems(t){const n=this.axis,i=this.chart,s=this.options,{grid:r,position:o,border:a}=s,l=r.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),h=wa(r),f=[],p=a.setContext(this.getContext()),m=p.display?p.width:0,v=m/2,y=function(R){return rr(i,R,m)};let g,x,_,w,S,C,M,P,T,A,E,z;if(o==="top")g=y(this.bottom),C=this.bottom-h,P=g-v,A=y(t.top)+v,z=t.bottom;else if(o==="bottom")g=y(this.top),A=t.top,z=y(t.bottom)-v,C=g+v,P=this.top+h;else if(o==="left")g=y(this.right),S=this.right-h,M=g-v,T=y(t.left)+v,E=t.right;else if(o==="right")g=y(this.left),T=t.left,E=y(t.right)-v,S=g+v,M=this.left+h;else if(n==="x"){if(o==="center")g=y((t.top+t.bottom)/2+.5);else if(gt(o)){const R=Object.keys(o)[0],B=o[R];g=y(this.chart.scales[R].getPixelForValue(B))}A=t.top,z=t.bottom,C=g+v,P=C+h}else if(n==="y"){if(o==="center")g=y((t.left+t.right)/2);else if(gt(o)){const R=Object.keys(o)[0],B=o[R];g=y(this.chart.scales[R].getPixelForValue(B))}S=g-v,M=S-h,T=t.left,E=t.right}const N=at(s.ticks.maxTicksLimit,d),L=Math.max(1,Math.ceil(d/N));for(x=0;x0&&(U-=Z/2);break}V={left:U,top:O,width:Z+W.width,height:et+W.height,color:L.backdropColor}}v.push({label:_,font:P,textOffset:E,options:{rotation:m,color:B,strokeColor:D,strokeWidth:$,textAlign:F,textBaseline:z,translation:[w,S],backdrop:V}})}return v}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Jn(this.labelRotation))return t==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:i,mirror:s,padding:r}}=this.options,o=this._getLabelSizes(),a=t+r,l=o.widest.width;let c,u;return n==="left"?s?(u=this.right+r,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?s?(u=this.left+r,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,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:i,top:s,width:r,height:o}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(i,s,r,o),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(r=>r.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(n.display)for(r=0,o=s.length;r{this.draw(r)}}]:[{z:i,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let r,o;for(r=0,o=n.length;r{const i=n.split("."),s=i.pop(),r=[e].concat(i).join("."),o=t[n].split("."),a=o.pop(),l=o.join(".");ne.route(r,s,l,a)})}function gL(e){return"id"in e&&"defaults"in e}let yL=class{constructor(){this.controllers=new nu(Zs,"datasets",!0),this.elements=new nu(os,"elements"),this.plugins=new nu(Object,"plugins"),this.scales=new nu(pc,"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,i){[...n].forEach(s=>{const r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):Et(s,o=>{const a=i||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,n,i){const s=ay(t);$t(i["before"+s],[],i),n[t](i),$t(i["after"+s],[],i)}_getRegistryForType(t){for(let n=0;nr.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(s(n,i),t,"stop"),this._notify(s(i,n),t,"start")}};function xL(e){const t={},n=[],i=Object.keys(hi.plugins.items);for(let r=0;r1&&Ex(e[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Ax(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function CL(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(i=>i.xAxisID===e||i.yAxisID===e);if(n.length)return Ax(e,"x",n[0])||Ax(e,"y",n[0])}return{}}function PL(e,t){const n=Fr[e.type]||{scales:{}},i=t.scales||{},s=wm(e.type,t),r=Object.create(null);return Object.keys(i).forEach(o=>{const a=i[o];if(!gt(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=km(o,a,CL(o,e),ne.scales[a.type]),c=SL(l,s),u=n.scales||{};r[o]=ul(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(o=>{const a=o.type||e.type,l=o.indexAxis||wm(a,t),u=(Fr[a]||{}).scales||{};Object.keys(u).forEach(d=>{const h=kL(d,l),f=o[h+"AxisID"]||h;r[f]=r[f]||Object.create(null),ul(r[f],[{axis:h},i[f],u[d]])})}),Object.keys(r).forEach(o=>{const a=r[o];ul(a,[ne.scales[a.type],ne.scale])}),r}function pM(e){const t=e.options||(e.options={});t.plugins=at(t.plugins,{}),t.scales=PL(e,t)}function mM(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function TL(e){return e=e||{},e.data=mM(e.data),pM(e),e}const Ox=new Map,gM=new Set;function iu(e,t){let n=Ox.get(e);return n||(n=t(),Ox.set(e,n),gM.add(n)),n}const ka=(e,t,n)=>{const i=zs(t,n);i!==void 0&&e.add(i)};let DL=class{constructor(t){this._config=TL(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=mM(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(),pM(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return iu(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return iu(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return iu(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return iu(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let s=i.get(t);return(!s||n)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,n,i){const{options:s,type:r}=this,o=this._cachedScopes(t,i),a=o.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>ka(l,t,d))),u.forEach(d=>ka(l,s,d)),u.forEach(d=>ka(l,Fr[r]||{},d)),u.forEach(d=>ka(l,ne,d)),u.forEach(d=>ka(l,bm,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),gM.has(n)&&o.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Fr[n]||{},ne.datasets[n]||{},{type:n},ne,bm]}resolveNamedOptions(t,n,i,s=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=Lx(this._resolverCache,t,s);let l=o;if(AL(o,n)){r.$shared=!1,i=Ws(i)?i():i;const c=this.createResolver(t,i,a);l=Ho(o,i,c)}for(const c of n)r[c]=l[c];return r}createResolver(t,n,i=[""],s){const{resolver:r}=Lx(this._resolverCache,t,i);return gt(n)?Ho(r,n,void 0,s):r}};function Lx(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const s=n.join();let r=i.get(s);return r||(r={resolver:fy(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,r)),r}const EL=e=>gt(e)&&Object.getOwnPropertyNames(e).some(t=>Ws(e[t]));function AL(e,t){const{isScriptable:n,isIndexable:i}=XS(e);for(const s of t){const r=n(s),o=i(s),a=(o||r)&&e[s];if(r&&(Ws(a)||EL(a))||o&&Ut(a))return!0}return!1}var OL="4.4.2";const LL=["top","bottom","left","right","chartArea"];function Rx(e,t){return e==="top"||e==="bottom"||LL.indexOf(e)===-1&&t==="x"}function Nx(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function jx(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),$t(n&&n.onComplete,[e],t)}function RL(e){const t=e.chart,n=t.options.animation;$t(n&&n.onProgress,[e],t)}function yM(e){return gy()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Zu={},$x=e=>{const t=yM(e);return Object.values(Zu).filter(n=>n.canvas===t).pop()};function NL(e,t,n){const i=Object.keys(e);for(const s of i){const r=+s;if(r>=t){const o=e[s];delete e[s],(n>0||r>t)&&(e[r+n]=o)}}}function jL(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}function su(e,t,n){return e.options.clip?e[n]:t[n]}function $L(e,t){const{xScale:n,yScale:i}=e;return n&&i?{left:su(n,t,"left"),right:su(n,t,"right"),top:su(i,t,"top"),bottom:su(i,t,"bottom")}:t}var fs;let by=(fs=class{static register(...t){hi.add(...t),Ix()}static unregister(...t){hi.remove(...t),Ix()}constructor(t,n){const i=this.config=new DL(n),s=yM(t),r=$x(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||tL(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=LA(),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 vL,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=GA(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],Zu[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Ai.listen(this,"complete",jx),Ai.listen(this,"progress",RL),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:s,_aspectRatio:r}=this;return bt(t)?n&&r?r:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return hi}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():rx(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return nx(this.canvas,this.ctx),this}stop(){return Ai.stop(this),this}resize(t,n){Ai.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,n,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,rx(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),$t(i.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Et(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,s=Object.keys(i).reduce((o,a)=>(o[a]=!1,o),{});let r=[];n&&(r=r.concat(Object.keys(n).map(o=>{const a=n[o],l=km(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Et(r,o=>{const a=o.options,l=a.id,c=km(l,a),u=at(a.type,o.dtype);(a.position===void 0||Rx(a.position,c)!==Rx(o.dposition))&&(a.position=o.dposition),s[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{const h=hi.getScale(u);d=new h({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),Et(s,(o,a)=>{o||delete i[a]}),Et(i,o=>{Fe.configure(this,o,o.options),Fe.addBox(this,o)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((s,r)=>s.index-r.index),i>n){for(let s=n;sn.length&&delete this._stacks,t.forEach((i,s)=>{n.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Nx("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Et(this.scales,t=>{Fe.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Xv(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:r}of n){const o=i==="_removeElements"?-r:r;NL(t,s,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),s=i(0);for(let r=1;rr.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Fe.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],Et(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,i=t._clip,s=!i.disabled,r=$L(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&Ch(n,{left:i.left===!1?0:r.left-i.left,right:i.right===!1?this.width:r.right+i.right,top:i.top===!1?0:r.top-i.top,bottom:i.bottom===!1?this.height:r.bottom+i.bottom}),t.controller.draw(),s&&Ph(n),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return Wi(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,s){const r=L2.modes[n];return typeof r=="function"?r(this,t,i,s):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let s=i.filter(r=>r&&r._dataset===n).pop();return s||(s={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},i.push(s)),s}getContext(){return this.$context||(this.$context=Qs(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){const s=i?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,s);zl(n)?(r.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(r,{visible:i}),this.update(a=>a.datasetIndex===t?s: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(),Ai.remove(this),t=0,n=this.data.datasets.length;t{n.addEventListener(this,r,o),t[r]=o},s=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};Et(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,i=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",r),i("detach",o)};o=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){Et(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Et(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const s=i?"set":"remove";let r,o,a,l;for(n==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a{const a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!Ld(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,i){const s=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),o=r(n,t),a=i?t:r(t,n);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,n){const i={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},s=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const r=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(t,n,i){const{_active:s=[],options:r}=this,o=n,a=this._getActiveElements(t,s,i,o),l=FA(t),c=jL(t,this._lastEvent,i,l);i&&(this._lastEvent=null,$t(r.onHover,[t,a,this],this),l&&$t(r.onClick,[t,a,this],this));const u=!Ld(a,s);return(u||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=c,u}_getActiveElements(t,n,i,s){if(t.type==="mouseout")return[];if(!i)return n;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}},K(fs,"defaults",ne),K(fs,"instances",Zu),K(fs,"overrides",Fr),K(fs,"registry",hi),K(fs,"version",OL),K(fs,"getChart",$x),fs);function Ix(){return Et(by.instances,e=>e._plugins.invalidate())}function IL(e,t,n){const{startAngle:i,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=t;let c=s/a;e.beginPath(),e.arc(r,o,a,i-c,n+c),l>s?(c=s/l,e.arc(r,o,l,n+c,i-c,!0)):e.arc(r,o,s,n+ue,i-ue),e.closePath(),e.clip()}function FL(e){return hy(e,["outerStart","outerEnd","innerStart","innerEnd"])}function BL(e,t,n,i){const s=FL(e.options.borderRadius),r=(n-t)/2,o=Math.min(r,i*t/2),a=l=>{const c=(n-Math.min(r,l))*i/2;return we(l,0,Math.min(r,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:we(s.innerStart,0,o),innerEnd:we(s.innerEnd,0,o)}}function Zr(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function Fd(e,t,n,i,s,r){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+i+n-c,0),h=u>0?u+i+n+c:0;let f=0;const p=s-l;if(i){const L=u>0?u-i:0,R=d>0?d-i:0,B=(L+R)/2,D=B!==0?p*B/(B+i):p;f=(p-D)/2}const m=Math.max(.001,p*d-n/Kt)/d,v=(p-m)/2,y=l+v+f,g=s-v-f,{outerStart:x,outerEnd:_,innerStart:w,innerEnd:S}=BL(t,h,d,g-y),C=d-x,M=d-_,P=y+x/C,T=g-_/M,A=h+w,E=h+S,z=y+w/A,N=g-S/E;if(e.beginPath(),r){const L=(P+T)/2;if(e.arc(o,a,d,P,L),e.arc(o,a,d,L,T),_>0){const $=Zr(M,T,o,a);e.arc($.x,$.y,_,T,g+ue)}const R=Zr(E,g,o,a);if(e.lineTo(R.x,R.y),S>0){const $=Zr(E,N,o,a);e.arc($.x,$.y,S,g+ue,N+Math.PI)}const B=(g-S/h+(y+w/h))/2;if(e.arc(o,a,h,g-S/h,B,!0),e.arc(o,a,h,B,y+w/h,!0),w>0){const $=Zr(A,z,o,a);e.arc($.x,$.y,w,z+Math.PI,y-ue)}const D=Zr(C,y,o,a);if(e.lineTo(D.x,D.y),x>0){const $=Zr(C,P,o,a);e.arc($.x,$.y,x,y-ue,P)}}else{e.moveTo(o,a);const L=Math.cos(P)*d+o,R=Math.sin(P)*d+a;e.lineTo(L,R);const B=Math.cos(T)*d+o,D=Math.sin(T)*d+a;e.lineTo(B,D)}e.closePath()}function VL(e,t,n,i,s){const{fullCircles:r,startAngle:o,circumference:a}=t;let l=t.endAngle;if(r){Fd(e,t,n,i,l,s);for(let c=0;c=Xt||Wl(o,l,c),v=Vi(a,u+f,d+f);return m&&v}getCenterPoint(n){const{x:i,y:s,startAngle:r,endAngle:o,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:u}=this.options,d=(r+o)/2,h=(a+l+u+c)/2;return{x:i+Math.cos(d)*h,y:s+Math.sin(d)*h}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:i,circumference:s}=this,r=(i.offset||0)/4,o=(i.spacing||0)/2,a=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>Xt?Math.floor(s/Xt):0,s===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*r,Math.sin(l)*r);const c=1-Math.sin(Math.min(Kt,s||0)),u=r*c;n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,VL(n,this,u,o,a),zL(n,this,u,o,a),n.restore()}},K(io,"id","arc"),K(io,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),K(io,"defaultRoutes",{backgroundColor:"backgroundColor"}),K(io,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"}),io);function xM(e,t,n=t){e.lineCap=at(n.borderCapStyle,t.borderCapStyle),e.setLineDash(at(n.borderDash,t.borderDash)),e.lineDashOffset=at(n.borderDashOffset,t.borderDashOffset),e.lineJoin=at(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=at(n.borderWidth,t.borderWidth),e.strokeStyle=at(n.borderColor,t.borderColor)}function WL(e,t,n){e.lineTo(n.x,n.y)}function HL(e){return e.stepped?aO:e.tension||e.cubicInterpolationMode==="monotone"?lO:WL}function bM(e,t,n={}){const i=e.length,{start:s=0,end:r=i-1}=n,{start:o,end:a}=t,l=Math.max(s,o),c=Math.min(r,a),u=sa&&r>a;return{count:i,start:l,loop:t.loop,ilen:c(o+(c?a-_:_))%r,x=()=>{m!==v&&(e.lineTo(u,v),e.lineTo(u,m),e.lineTo(u,y))};for(l&&(f=s[g(0)],e.moveTo(f.x,f.y)),h=0;h<=a;++h){if(f=s[g(h)],f.skip)continue;const _=f.x,w=f.y,S=_|0;S===p?(wv&&(v=w),u=(d*u+_)/++d):(x(),e.lineTo(_,w),p=S,d=0,m=v=w),y=w}x()}function Sm(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?YL:UL}function XL(e){return e.stepped?BO:e.tension||e.cubicInterpolationMode==="monotone"?VO:pr}function KL(e,t,n,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,i)&&s.closePath()),xM(e,t.options),e.stroke(s)}function GL(e,t,n,i){const{segments:s,options:r}=t,o=Sm(t);for(const a of s)xM(e,r,a.style),e.beginPath(),o(e,t,a,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const qL=typeof Path2D=="function";function QL(e,t,n,i){qL&&!t.options.segment?KL(e,t,n,i):GL(e,t,n,i)}var so;let Dh=(so=class extends os{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 i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;OO(this._points,i,t,s,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=XO(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,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){const i=this.options,s=t[n],r=this.points,o=iM(this,{property:n,start:s,end:s});if(!o.length)return;const a=[],l=XL(i);let c,u;for(c=0,u=o.length;ct!=="borderDash"&&t!=="fill"}),so);function Fx(e,t,n,i){const s=e.options,{[n]:r}=e.getProps([n],i);return Math.abs(t-r)e.replace("rgb(","rgba(").replace(")",", 0.5)"));function SM(e){return Mm[e%Mm.length]}function MM(e){return Bx[e%Bx.length]}function sR(e,t){return e.borderColor=SM(t),e.backgroundColor=MM(t),++t}function rR(e,t){return e.backgroundColor=e.data.map(()=>SM(t++)),t}function oR(e,t){return e.backgroundColor=e.data.map(()=>MM(t++)),t}function aR(e){let t=0;return(n,i)=>{const s=e.getDatasetMeta(i).controller;s instanceof vy?t=rR(n,t):s instanceof aM?t=oR(n,t):s&&(t=sR(n,t))}}function Vx(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function lR(e){return e&&(e.borderColor||e.backgroundColor)}var cR={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:i},options:s}=e.config,{elements:r}=s;if(!n.forceOverride&&(Vx(i)||lR(s)||r&&Vx(r)))return;const o=aR(e);i.forEach(o)}};function uR(e,t,n,i,s){const r=s.samples||i;if(r>=n)return e.slice(t,t+n);const o=[],a=(n-2)/(r-2);let l=0;const c=t+n-1;let u=t,d,h,f,p,m;for(o[l++]=e[u],d=0;df&&(f=p,h=e[g],m=g);o[l++]=h,u=m}return o[l++]=e[c],o}function dR(e,t,n,i){let s=0,r=0,o,a,l,c,u,d,h,f,p,m;const v=[],y=t+n-1,g=e[t].x,_=e[y].x-g;for(o=t;om&&(m=c,h=o),s=(r*s+a.x)/++r;else{const S=o-1;if(!bt(d)&&!bt(h)){const C=Math.min(d,h),M=Math.max(d,h);C!==f&&C!==S&&v.push({...e[C],x:s}),M!==f&&M!==S&&v.push({...e[M],x:s})}o>0&&S!==f&&v.push(e[S]),v.push(a),u=w,r=0,p=m=c,d=h=f=o}}return v}function CM(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function zx(e){e.data.datasets.forEach(t=>{CM(t)})}function hR(e,t){const n=t.length;let i=0,s;const{iScale:r}=e,{min:o,max:a,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=we(zi(t,r.axis,o).lo,0,n-1)),c?s=we(zi(t,r.axis,a).hi+1,i,n)-i:s=n-i,{start:i,count:s}}var fR={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){zx(e);return}const i=e.width;e.data.datasets.forEach((s,r)=>{const{_data:o,indexAxis:a}=s,l=e.getDatasetMeta(r),c=o||s.data;if(Ht([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:d,count:h}=hR(l,c);const f=n.threshold||4*i;if(h<=f){CM(s);return}bt(o)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let p;switch(n.algorithm){case"lttb":p=uR(c,d,h,i,n);break;case"min-max":p=dR(c,d,h,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}s._decimated=p})},destroy(e){zx(e)}};function pR(e,t,n){const i=e.segments,s=e.points,r=t.points,o=[];for(const a of i){let{start:l,end:c}=a;c=_y(l,c,s);const u=Cm(n,s[l],s[c],a.loop);if(!t.segments){o.push({source:a,target:u,start:s[l],end:s[c]});continue}const d=iM(t,u);for(const h of d){const f=Cm(n,r[h.start],r[h.end],h.loop),p=nM(a,s,f);for(const m of p)o.push({source:m,target:h,start:{[n]:Wx(u,f,"start",Math.max)},end:{[n]:Wx(u,f,"end",Math.min)}})}}return o}function Cm(e,t,n,i){if(i)return;let s=t[e],r=n[e];return e==="angle"&&(s=yn(s),r=yn(r)),{property:e,start:s,end:r}}function mR(e,t){const{x:n=null,y:i=null}=e||{},s=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=_y(o,a,s);const l=s[o],c=s[a];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):n!==null&&(r.push({x:n,y:l.y}),r.push({x:n,y:c.y}))}),r}function _y(e,t,n){for(;t>e;t--){const i=n[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Wx(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function PM(e,t){let n=[],i=!1;return Ut(e)?(i=!0,n=e):n=mR(e,t),n.length?new Dh({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function Hx(e){return e&&e.fill!==!1}function gR(e,t,n){let s=e[t].fill;const r=[t];let o;if(!n)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!oe(s))return s;if(o=e[s],!o)return!1;if(o.visible)return s;r.push(s),s=o.fill}return!1}function yR(e,t,n){const i=_R(e);if(gt(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return oe(s)&&Math.floor(s)===s?vR(i[0],t,s,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function vR(e,t,n,i){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=i?!1:n}function xR(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:gt(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function bR(e,t,n){let i;return e==="start"?i=n:e==="end"?i=t.options.reverse?t.min:t.max:gt(e)?i=e.value:i=t.getBaseValue(),i}function _R(e){const t=e.options,n=t.fill;let i=at(n&&n.target,n);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function wR(e){const{scale:t,index:n,line:i}=e,s=[],r=i.segments,o=i.points,a=kR(t,n);a.push(PM({x:null,y:t.bottom},i));for(let l=0;l=0;--o){const a=s[o].$filler;a&&(a.line.updateControlPoints(r,a.axis),i&&a.fill&&Hf(e.ctx,a,r))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=e.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const r=i[s].$filler;Hx(r)&&Hf(e.ctx,r,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;!Hx(i)||n.drawTime!=="beforeDatasetDraw"||Hf(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Kx=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}},RR=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;let Gx=class extends os{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,i){this.maxWidth=t,this.maxHeight=n,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=$t(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,s)=>t.sort(i,s,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 i=t.labels,s=ge(i.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Kx(i,r);let c,u;n.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,r,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,s){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a;let d=t;r.textAlign="left",r.textBaseline="middle";let h=-1,f=-u;return this.legendItems.forEach((p,m)=>{const v=i+n/2+r.measureText(p.text).width;(m===0||c[c.length-1]+v+2*a>o)&&(d+=u,c[c.length-(m>0?0:1)]=0,f+=u,h++),l[m]={left:0,top:f,row:h,width:v,height:s},c[c.length-1]+=v+a}),d}_fitCols(t,n,i,s){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-t;let d=a,h=0,f=0,p=0,m=0;return this.legendItems.forEach((v,y)=>{const{itemWidth:g,itemHeight:x}=NR(i,n,r,v,s);y>0&&f+x+2*a>u&&(d+=h+a,c.push({width:h,height:f}),p+=h+a,m++,h=f=0),l[y]={left:p,top:f,col:m,width:g,height:x},h=Math.max(h,g),f+=x+a}),d+=h,c.push({width:h,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:r}}=this,o=Oo(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=Ne(i,this.left+s,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=Ne(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+s}else{let a=0,l=Ne(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=Ne(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Ch(t,this),this._draw(),Ph(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:s}=this,{align:r,labels:o}=t,a=ne.color,l=Oo(t.rtl,this.left,this.width),c=ge(o.font),{padding:u}=o,d=c.size,h=d/2;let f;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:p,boxHeight:m,itemHeight:v}=Kx(o,d),y=function(S,C,M){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;s.save();const P=at(M.lineWidth,1);if(s.fillStyle=at(M.fillStyle,a),s.lineCap=at(M.lineCap,"butt"),s.lineDashOffset=at(M.lineDashOffset,0),s.lineJoin=at(M.lineJoin,"miter"),s.lineWidth=P,s.strokeStyle=at(M.strokeStyle,a),s.setLineDash(at(M.lineDash,[])),o.usePointStyle){const T={radius:m*Math.SQRT2/2,pointStyle:M.pointStyle,rotation:M.rotation,borderWidth:P},A=l.xPlus(S,p/2),E=C+h;US(s,T,A,E,o.pointStyleWidth&&p)}else{const T=C+Math.max((d-m)/2,0),A=l.leftForLtr(S,p),E=Cr(M.borderRadius);s.beginPath(),Object.values(E).some(z=>z!==0)?Hl(s,{x:A,y:T,w:p,h:m,radius:E}):s.rect(A,T,p,m),s.fill(),P!==0&&s.stroke()}s.restore()},g=function(S,C,M){Br(s,M.text,S,C+v/2,c,{strikethrough:M.hidden,textAlign:l.textAlign(M.textAlign)})},x=this.isHorizontal(),_=this._computeTitleHeight();x?f={x:Ne(r,this.left+u,this.right-i[0]),y:this.top+u+_,line:0}:f={x:this.left+u,y:Ne(r,this.top+_+u,this.bottom-n[0].height),line:0},JS(this.ctx,t.textDirection);const w=v+u;this.legendItems.forEach((S,C)=>{s.strokeStyle=S.fontColor,s.fillStyle=S.fontColor;const M=s.measureText(S.text).width,P=l.textAlign(S.textAlign||(S.textAlign=o.textAlign)),T=p+h+M;let A=f.x,E=f.y;l.setWidth(this.width),x?C>0&&A+T+u>this.right&&(E=f.y+=w,f.line++,A=f.x=Ne(r,this.left+u,this.right-i[f.line])):C>0&&E+w>this.bottom&&(A=f.x=A+n[f.line].width+u,f.line++,E=f.y=Ne(r,this.top+_+u,this.bottom-n[f.line].height));const z=l.x(A);if(y(z,E,S),A=qA(P,A+p+h,x?A+T:this.right,t.rtl),g(l.x(A),E,S),x)f.x+=T+u;else if(typeof S.text!="string"){const N=c.lineHeight;f.y+=DM(S,N)+u}else f.y+=w}),tM(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=ge(n.font),s=Ae(n.padding);if(!n.display)return;const r=Oo(t.rtl,this.left,this.width),o=this.ctx,a=n.position,l=i.size/2,c=s.top+l;let u,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,d=Ne(t.align,d,this.right-h);else{const p=this.columnSizes.reduce((m,v)=>Math.max(m,v.height),0);u=c+Ne(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const f=Ne(a,d,d+h);o.textAlign=r.textAlign(uy(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=i.string,Br(o,n.text,f,u,i)}_computeTitleHeight(){const t=this.options.title,n=ge(t.font),i=Ae(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,s,r;if(Vi(t,this.left,this.right)&&Vi(n,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;ir.length>o.length?r:o)),t+n.size/2+i.measureText(s).width}function $R(e,t,n){let i=e;return typeof t.text!="string"&&(i=DM(t,n)),i}function DM(e,t){const n=e.text?e.text.length:0;return t*n}function IR(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var FR={id:"legend",_element:Gx,start(e,t,n){const i=e.legend=new Gx({ctx:e.ctx,options:n,chart:e});Fe.configure(e,i,n),Fe.addBox(e,i)},stop(e){Fe.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;Fe.configure(e,i,n),i.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 i=t.datasetIndex,s=n.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),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:i,textAlign:s,color:r,useBorderRadius:o,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=Ae(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:r,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};let wy=class extends os{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 i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const s=Ut(i.text)?i.text.length:1;this._padding=Ae(i.padding);const r=s*ge(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:i,bottom:s,right:r,options:o}=this,a=o.align;let l=0,c,u,d;return this.isHorizontal()?(u=Ne(a,i,r),d=n+t,c=r-i):(o.position==="left"?(u=i+t,d=Ne(a,s,n),l=Kt*-.5):(u=r-t,d=Ne(a,n,s),l=Kt*.5),c=s-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=ge(n.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);Br(t,n.text,0,0,i,{color:n.color,maxWidth:l,rotation:c,textAlign:uy(n.align),textBaseline:"middle",translation:[o,a]})}};function BR(e,t){const n=new wy({ctx:e.ctx,options:t,chart:e});Fe.configure(e,n,t),Fe.addBox(e,n),e.titleBlock=n}var VR={id:"title",_element:wy,start(e,t,n){BR(e,n)},stop(e){const t=e.titleBlock;Fe.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;Fe.configure(e,i,n),i.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 ru=new WeakMap;var zR={id:"subtitle",start(e,t,n){const i=new wy({ctx:e.ctx,options:n,chart:e});Fe.configure(e,i,n),Fe.addBox(e,i),ru.set(e,i)},stop(e){Fe.removeBox(e,ru.get(e)),ru.delete(e)},beforeUpdate(e,t,n){const i=ru.get(e);Fe.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const qa={average(e){if(!e.length)return!1;let t,n,i=new Set,s=0,r=0;for(t=0,n=e.length;ta+l)/i.size,y:s/r}},nearest(e,t){if(!e.length)return!1;let n=t.x,i=t.y,s=Number.POSITIVE_INFINITY,r,o,a;for(r=0,o=e.length;r-1?e.split(` -`):e}function W2(e,t){const{element:n,datasetIndex:i,index:s}=t,r=e.getDatasetMeta(i).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:e,label:o,parsed:r.getParsed(s),raw:e.data.datasets[i].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:n}}function qx(e,t){const n=e.chart.ctx,{body:i,footer:s,title:r}=e,{boxWidth:o,boxHeight:a}=t,l=ge(t.bodyFont),c=ge(t.titleFont),u=ge(t.footerFont),d=r.length,h=s.length,f=i.length,p=Ae(t.padding);let m=p.height,v=0,y=i.reduce((_,w)=>_+w.before.length+w.lines.length+w.after.length,0);if(y+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),y){const _=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=f*_+(y-f)*l.lineHeight+(y-1)*t.bodySpacing}h&&(m+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let g=0;const x=function(_){v=Math.max(v,n.measureText(_).width+g)};return n.save(),n.font=c.string,Et(e.title,x),n.font=l.string,Et(e.beforeBody.concat(e.afterBody),x),g=t.displayColors?o+2+t.boxPadding:0,Et(i,_=>{Et(_.before,x),Et(_.lines,x),Et(_.after,x)}),g=0,n.font=u.string,Et(e.footer,x),n.restore(),v+=p.width,{width:v,height:m}}function H2(e,t){const{y:n,height:i}=t;return ne.height-i/2?"bottom":"center"}function U2(e,t,n,i){const{x:s,width:r}=i,o=n.caretSize+n.caretPadding;if(e==="left"&&s+r+o>t.width||e==="right"&&s-r-o<0)return!0}function Y2(e,t,n,i){const{x:s,width:r}=n,{width:o,chartArea:{left:a,right:l}}=e;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),U2(c,e,t,n)&&(c="center"),c}function Qx(e,t,n){const i=n.yAlign||t.yAlign||H2(e,n);return{xAlign:n.xAlign||t.xAlign||Y2(e,t,n,i),yAlign:i}}function X2(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function K2(e,t,n){let{y:i,height:s}=e;return t==="top"?i+=n:t==="bottom"?i-=s+n:i-=s/2,i}function Zx(e,t,n,i){const{caretSize:s,caretPadding:r,cornerRadius:o}=e,{xAlign:a,yAlign:l}=n,c=s+r,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:f}=Cr(o);let p=X2(t,a);const m=K2(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,h)+s:a==="right"&&(p+=Math.max(d,f)+s),{x:we(p,0,i.width-t.width),y:we(m,0,i.height-t.height)}}function ou(e,t,n){const i=Ae(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function Jx(e){return ci([],Oi(e))}function G2(e,t,n){return Qs(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function tb(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const EM={beforeTitle:Di,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex"u"?EM[t].call(n,i):s}var kp;let eb=(kp=class extends os{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,i=this.options.setContext(this.getContext()),s=i.enabled&&n.options.animation&&i.animations,r=new sM(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=G2(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,s=qe(i,"beforeTitle",this,t),r=qe(i,"title",this,t),o=qe(i,"afterTitle",this,t);let a=[];return a=ci(a,Oi(s)),a=ci(a,Oi(r)),a=ci(a,Oi(o)),a}getBeforeBody(t,n){return Jx(qe(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,s=[];return Et(t,r=>{const o={before:[],lines:[],after:[]},a=tb(i,r);ci(o.before,Oi(qe(a,"beforeLabel",this,r))),ci(o.lines,qe(a,"label",this,r)),ci(o.after,Oi(qe(a,"afterLabel",this,r))),s.push(o)}),s}getAfterBody(t,n){return Jx(qe(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,s=qe(i,"beforeFooter",this,t),r=qe(i,"footer",this,t),o=qe(i,"afterFooter",this,t);let a=[];return a=ci(a,Oi(s)),a=ci(a,Oi(r)),a=ci(a,Oi(o)),a}_createItems(t){const n=this._active,i=this.chart.data,s=[],r=[],o=[];let a=[],l,c;for(l=0,c=n.length;lt.filter(u,d,h,i))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,i))),Et(a,u=>{const d=tb(t.callbacks,u);s.push(qe(d,"labelColor",this,u)),r.push(qe(d,"labelPointStyle",this,u)),o.push(qe(d,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,n){const i=this.options.setContext(this.getContext()),s=this._active;let r,o=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const a=qa[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const l=this._size=qx(this,i),c=Object.assign({},a,l),u=Qx(this.chart,i,c),d=Zx(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,s){const r=this.getCaretPosition(t,i,s);n.lineTo(r.x1,r.y1),n.lineTo(r.x2,r.y2),n.lineTo(r.x3,r.y3)}getCaretPosition(t,n,i){const{xAlign:s,yAlign:r}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=Cr(a),{x:h,y:f}=t,{width:p,height:m}=n;let v,y,g,x,_,w;return r==="center"?(_=f+m/2,s==="left"?(v=h,y=v-o,x=_+o,w=_-o):(v=h+p,y=v+o,x=_-o,w=_+o),g=v):(s==="left"?y=h+Math.max(l,u)+o:s==="right"?y=h+p-Math.max(c,d)-o:y=this.caretX,r==="top"?(x=f,_=x-o,v=y-o,g=y+o):(x=f+m,_=x+o,v=y+o,g=y-o),w=x),{x1:v,x2:y,x3:g,y1:x,y2:_,y3:w}}drawTitle(t,n,i){const s=this.title,r=s.length;let o,a,l;if(r){const c=Oo(i.rtl,this.x,this.width);for(t.x=ou(this,i.titleAlign,i),n.textAlign=c.textAlign(i.titleAlign),n.textBaseline="middle",o=ge(i.titleFont),a=i.titleSpacing,n.fillStyle=i.titleColor,n.font=o.string,l=0;lg!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Hl(t,{x:m,y:p,w:c,h:l,radius:y}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Hl(t,{x:v,y:p+1,w:c-2,h:l-2,radius:y}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(m,p,c,l),t.strokeRect(m,p,c,l),t.fillStyle=o.backgroundColor,t.fillRect(v,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=ge(i.bodyFont);let h=d.lineHeight,f=0;const p=Oo(i.rtl,this.x,this.width),m=function(M){n.fillText(M,p.x(t.x+f),t.y+h/2),t.y+=h+r},v=p.textAlign(o);let y,g,x,_,w,S,C;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,t.x=ou(this,v,i),n.fillStyle=i.bodyColor,Et(this.beforeBody,m),f=a&&v!=="right"?o==="center"?c/2+u:c+2+u:0,_=0,S=s.length;_0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const o=qa[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=qx(this,t),l=Object.assign({},o,this._size),c=Qx(n,t,l),u=Zx(t,l,c,n);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Ae(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=i,this.drawBackground(r,t,s,n),JS(t,n.textDirection),r.y+=o.top,this.drawTitle(r,t,n),this.drawBody(r,t,n),this.drawFooter(r,t,n),tM(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!Ld(i,s),o=this._positionChanged(s,n);(r||o)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],o=this._getActiveElements(t,r,n,i),a=this._positionChanged(o,t),l=n||!Ld(o,r)||a;return l&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,i,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)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,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:i,caretY:s,options:r}=this,o=qa[r.position].call(this,t,n);return o!==!1&&(i!==o.x||s!==o.y)}},K(kp,"positioners",qa),kp);var q2={id:"tooltip",_element:eb,positioners:qa,afterInit(e,t,n){n&&(e.tooltip=new eb({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:EM},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"]},Q2=Object.freeze({__proto__:null,Colors:c2,Decimation:f2,Filler:L2,Legend:F2,SubTitle:z2,Title:V2,Tooltip:q2});const Z2=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function J2(e,t,n,i){const s=e.indexOf(t);if(s===-1)return Z2(e,t,n,i);const r=e.lastIndexOf(t);return s!==r?n:s}const tN=(e,t)=>e===null?null:we(Math.round(e),0,t);function nb(e){const t=this.getLabels();return e>=0&&en.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}},K(Ru,"id","category"),K(Ru,"defaults",{ticks:{callback:nb}}),Ru);function nN(e,t){const n=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=e,f=r||1,p=u-1,{min:m,max:v}=t,y=!bt(o),g=!bt(a),x=!bt(c),_=(v-m)/(d+1);let w=Gv((v-m)/p/f)*f,S,C,M,P;if(w<1e-14&&!y&&!g)return[{value:m},{value:v}];P=Math.ceil(v/w)-Math.floor(m/w),P>p&&(w=Gv(P*w/p/f)*f),bt(l)||(S=Math.pow(10,l),w=Math.ceil(w*S)/S),s==="ticks"?(C=Math.floor(m/w)*w,M=Math.ceil(v/w)*w):(C=m,M=v),y&&g&&r&&WA((a-o)/r,w/1e3)?(P=Math.round(Math.min((a-o)/w,u)),w=(a-o)/P,C=o,M=a):x?(C=y?o:C,M=g?a:M,P=c-1,w=(M-C)/P):(P=(M-C)/w,dl(P,Math.round(P),w/1e3)?P=Math.round(P):P=Math.ceil(P));const T=Math.max(qv(w),qv(C));S=Math.pow(10,bt(l)?T:l),C=Math.round(C*S)/S,M=Math.round(M*S)/S;let A=0;for(y&&(h&&C!==o?(n.push({value:o}),Ca)break;n.push({value:E})}return g&&h&&M!==a?n.length&&dl(n[n.length-1].value,a,ib(a,_,e))?n[n.length-1].value=a:n.push({value:a}):(!g||M===a)&&n.push({value:M}),n}function ib(e,t,{horizontal:n,minRotation:i}){const s=Jn(i),r=(n?Math.sin(s):Math.cos(s))||.001,o=.75*t*(""+e).length;return Math.min(t/r,o)}let Bd=class extends pc{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 bt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:s,max:r}=this;const o=l=>s=n?s:l,a=l=>r=i?r:l;if(t){const l=vi(s),c=vi(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(s===r){let l=r===0?1:Math.abs(r*.05);a(r+l),t||o(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},r=this._range||this,o=nN(s,r);return t.bounds==="ticks"&&jS(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,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-n)/Math.max(t.length-1,1)/2;n-=s,i+=s}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return hc(t,this.chart.options.locale,this.options.ticks.format)}};var Nu;let iN=(Nu=class extends Bd{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=oe(t)?t:0,this.max=oe(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=Jn(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}},K(Nu,"id","linear"),K(Nu,"defaults",{ticks:{callback:Mh.formatters.numeric}}),Nu);const Yl=e=>Math.floor(Ss(e)),ar=(e,t)=>Math.pow(10,Yl(e)+t);function sb(e){return e/Math.pow(10,Yl(e))===1}function rb(e,t,n){const i=Math.pow(10,n),s=Math.floor(e/i);return Math.ceil(t/i)-s}function sN(e,t){const n=t-e;let i=Yl(n);for(;rb(e,t,i)>10;)i++;for(;rb(e,t,i)<10;)i--;return Math.min(i,Yl(e))}function rN(e,{min:t,max:n}){t=mn(e.min,t);const i=[],s=Yl(t);let r=sN(t,n),o=r<0?Math.pow(10,Math.abs(r)):1;const a=Math.pow(10,r),l=s>r?Math.pow(10,s):0,c=Math.round((t-l)*o)/o,u=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((c-u)/Math.pow(10,r)),h=mn(e.min,Math.round((l+u+d*Math.pow(10,r))*o)/o);for(;h=10?d=d<15?15:20:d++,d>=20&&(r++,d=2,o=r>=0?1:o),h=Math.round((l+u+d*Math.pow(10,r))*o)/o;const f=mn(e.max,h);return i.push({value:f,major:sb(f),significand:d}),i}var ju;let oN=(ju=class extends pc{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const i=Bd.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return oe(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=oe(t)?Math.max(0,t):null,this.max=oe(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!oe(this._userMin)&&(this.min=t===ar(this.min,0)?ar(this.min,-1):ar(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let i=this.min,s=this.max;const r=a=>i=t?i:a,o=a=>s=n?s:a;i===s&&(i<=0?(r(1),o(10)):(r(ar(i,-1)),o(ar(s,1)))),i<=0&&r(ar(s,-1)),s<=0&&o(ar(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},i=rN(n,this);return t.bounds==="ticks"&&jS(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":hc(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ss(t),this._valueRange=Ss(this.max)-Ss(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ss(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}},K(ju,"id","logarithmic"),K(ju,"defaults",{ticks:{callback:Mh.formatters.logarithmic,major:{enabled:!0}}}),ju);function Pm(e){const t=e.ticks;if(t.display&&e.display){const n=Ae(t.backdropPadding);return at(t.font&&t.font.size,ne.font.size)+n.height}return 0}function aN(e,t,n){return n=Ut(n)?n:[n],{w:oO(e,t.string,n),h:n.length*t.lineHeight}}function ob(e,t,n,i,s){return e===i||e===s?{start:t-n/2,end:t+n/2}:es?{start:t-n,end:t}:{start:t,end:t+n}}function lN(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),i=[],s=[],r=e._pointLabels.length,o=e.options.pointLabels,a=o.centerPointLabels?Kt/r:0;for(let l=0;lt.r&&(a=(i.end-t.r)/r,e.r=Math.max(e.r,t.r+a)),s.startt.b&&(l=(s.end-t.b)/o,e.b=Math.max(e.b,t.b+l))}function uN(e,t,n){const i=e.drawingArea,{extra:s,additionalAngle:r,padding:o,size:a}=n,l=e.getPointPosition(t,i+s+o,r),c=Math.round(ly(yn(l.angle+ue))),u=mN(l.y,a.h,c),d=fN(c),h=pN(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+a.w,bottom:u+a.h}}function dN(e,t){if(!t)return!0;const{left:n,top:i,right:s,bottom:r}=e;return!(Wi({x:n,y:i},t)||Wi({x:n,y:r},t)||Wi({x:s,y:i},t)||Wi({x:s,y:r},t))}function hN(e,t,n){const i=[],s=e._pointLabels.length,r=e.options,{centerPointLabels:o,display:a}=r.pointLabels,l={extra:Pm(r)/2,additionalAngle:o?Kt/s:0};let c;for(let u=0;u270||n<90)&&(e-=t),e}function gN(e,t,n){const{left:i,top:s,right:r,bottom:o}=n,{backdropColor:a}=t;if(!bt(a)){const l=Cr(t.borderRadius),c=Ae(t.backdropPadding);e.fillStyle=a;const u=i-c.left,d=s-c.top,h=r-i+c.width,f=o-s+c.height;Object.values(l).some(p=>p!==0)?(e.beginPath(),Hl(e,{x:u,y:d,w:h,h:f,radius:l}),e.fill()):e.fillRect(u,d,h,f)}}function yN(e,t){const{ctx:n,options:{pointLabels:i}}=e;for(let s=t-1;s>=0;s--){const r=e._pointLabelItems[s];if(!r.visible)continue;const o=i.setContext(e.getPointLabelContext(s));gN(n,o,r);const a=ge(o.font),{x:l,y:c,textAlign:u}=r;Br(n,e._pointLabels[s],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function AM(e,t,n,i){const{ctx:s}=e;if(n)s.arc(e.xCenter,e.yCenter,t,0,Xt);else{let r=e.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let o=1;o{const s=$t(this.options.pointLabels.callback,[n,i],this);return s||s===0?s:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?lN(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,s){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,s))}getIndexAngle(t){const n=Xt/(this._pointLabels.length||1),i=this.options.startAngle||0;return yn(t*n+Jn(i))}getDistanceFromCenterForValue(t){if(bt(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(bt(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{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(d),f=s.setContext(h),p=r.setContext(h);vN(this,f,l,o,p)}}),i.display){for(t.save(),a=o-1;a>=0;a--){const u=i.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:h}=u;!h||!d||(t.lineWidth=h,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.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,i=n.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=i.setContext(this.getContext(l)),u=ge(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=Ae(c.backdropPadding);t.fillRect(-o/2-d.left,-r-u.size/2-d.top,o+d.width,u.size+d.height)}Br(t,a.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}},K(ro,"id","radialLinear"),K(ro,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Mh.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),K(ro,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),K(ro,"descriptors",{angleLines:{_fallback:"grid"}}),ro);const Eh={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}},tn=Object.keys(Eh);function ab(e,t){return e-t}function lb(e,t){if(bt(t))return null;const n=e._adapter,{parser:i,round:s,isoWeekday:r}=e._parseOpts;let o=t;return typeof i=="function"&&(o=i(o)),oe(o)||(o=typeof i=="string"?n.parse(o,i):n.parse(o)),o===null?null:(s&&(o=s==="week"&&(Wo(r)||r===!0)?n.startOf(o,"isoWeek",r):n.startOf(o,s)),+o)}function cb(e,t,n,i){const s=tn.length;for(let r=tn.indexOf(e);r=tn.indexOf(n);r--){const o=tn[r];if(Eh[o].common&&e._adapter.diff(s,i,o)>=t-1)return o}return tn[n?tn.indexOf(n):0]}function wN(e){for(let t=tn.indexOf(e)+1,n=tn.length;t=t?n[i]:n[s];e[r]=!0}}function kN(e,t,n,i){const s=e._adapter,r=+s.startOf(t[0].value,i),o=t[t.length-1].value;let a,l;for(a=r;a<=o;a=+s.add(a,1,i))l=n[a],l>=0&&(t[l].major=!0);return t}function db(e,t,n){const i=[],s={},r=t.length;let o,a;for(o=0;o+t.value))}initOffsets(t=[]){let n=0,i=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=we(n,0,o),i=we(i,0,o),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,s=this.options,r=s.time,o=r.unit||cb(r.minUnit,n,i,this._getLabelCapacity(n)),a=at(s.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=Wo(l)||l===!0,u={};let d=n,h,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":o),t.diff(i,n,o)>1e5*a)throw new Error(n+" and "+i+" are too far apart with stepSize of "+a+" "+o);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(h=d,f=0;h+m)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){const s=this.options.time.displayFormats,r=this._unit,o=n||s[r];return this._adapter.format(t,o)}_tickFormatFunction(t,n,i,s){const r=this.options,o=r.ticks.callback;if(o)return $t(o,[t,n,i],this);const a=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],h=i[n],f=c&&d&&h&&h.major;return this._adapter.format(t,s||(f?d:u))}generateTickLabels(t){let n,i,s;for(n=0,i=t.length;n0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,i=s.length;n=e[i].pos&&t<=e[s].pos&&({lo:i,hi:s}=zi(e,"pos",t)),{pos:r,time:a}=e[i],{pos:o,time:l}=e[s]):(t>=e[i].time&&t<=e[s].time&&({lo:i,hi:s}=zi(e,"time",t)),{time:r,pos:a}=e[i],{time:o,pos:l}=e[s]);const c=o-r;return c?a+(l-a)*(t-r)/c:a}var Iu;let SN=(Iu=class extends Tm{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=au(n,this.min),this._tableRange=au(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,s=[],r=[];let o,a,l,c,u;for(o=0,a=t.length;o=n&&c<=i&&s.push(c);if(s.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(o=0,a=s.length;os-r)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?t=this.normalize(n.concat(i)):t=n.length?n:i,t=this._cache.all=t,t}getDecimalForValue(t){return(au(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return au(this._table,i*this._tableRange+this._minPos,!0)}},K(Iu,"id","timeseries"),K(Iu,"defaults",Tm.defaults),Iu);var MN=Object.freeze({__proto__:null,CategoryScale:eN,LinearScale:iN,LogarithmicScale:oN,RadialLinearScale:bN,TimeScale:Tm,TimeSeriesScale:SN});const CN=[PL,i2,Q2,MN];by.register(...CN);function OM(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t"u")return!1;var t=si(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function FN(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var i=t.styles[n]||{},s=t.attributes[n]||{},r=t.elements[n];!Fn(r)||!ki(r)||(Object.assign(r.style,i),Object.keys(s).forEach(function(o){var a=s[o];a===!1?r.removeAttribute(o):r.setAttribute(o,a===!0?"":a)}))})}function BN(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(i){var s=t.elements[i],r=t.attributes[i]||{},o=Object.keys(t.styles.hasOwnProperty(i)?t.styles[i]:n[i]),a=o.reduce(function(l,c){return l[c]="",l},{});!Fn(s)||!ki(s)||(Object.assign(s.style,a),Object.keys(r).forEach(function(l){s.removeAttribute(l)}))})}}const VN={name:"applyStyles",enabled:!0,phase:"write",fn:FN,effect:BN,requires:["computeStyles"]};function xi(e){return e.split("-")[0]}var Tr=Math.max,Vd=Math.min,Ko=Math.round;function Go(e,t){t===void 0&&(t=!1);var n=e.getBoundingClientRect(),i=1,s=1;if(Fn(e)&&t){var r=e.offsetHeight,o=e.offsetWidth;o>0&&(i=Ko(n.width)/o||1),r>0&&(s=Ko(n.height)/r||1)}return{width:n.width/i,height:n.height/s,top:n.top/s,right:n.right/i,bottom:n.bottom/s,left:n.left/i,x:n.left/i,y:n.top/s}}function My(e){var t=Go(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function NM(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Sy(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function ns(e){return si(e).getComputedStyle(e)}function zN(e){return["table","td","th"].indexOf(ki(e))>=0}function Js(e){return((Xo(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ah(e){return ki(e)==="html"?e:e.assignedSlot||e.parentNode||(Sy(e)?e.host:null)||Js(e)}function mb(e){return!Fn(e)||ns(e).position==="fixed"?null:e.offsetParent}function WN(e){var t=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,n=navigator.userAgent.indexOf("Trident")!==-1;if(n&&Fn(e)){var i=ns(e);if(i.position==="fixed")return null}var s=Ah(e);for(Sy(s)&&(s=s.host);Fn(s)&&["html","body"].indexOf(ki(s))<0;){var r=ns(s);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||t&&r.willChange==="filter"||t&&r.filter&&r.filter!=="none")return s;s=s.parentNode}return null}function gc(e){for(var t=si(e),n=mb(e);n&&zN(n)&&ns(n).position==="static";)n=mb(n);return n&&(ki(n)==="html"||ki(n)==="body"&&ns(n).position==="static")?t:n||WN(e)||t}function Cy(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function pl(e,t,n){return Tr(e,Vd(t,n))}function HN(e,t,n){var i=pl(e,t,n);return i>n?n:i}function jM(){return{top:0,right:0,bottom:0,left:0}}function $M(e){return Object.assign({},jM(),e)}function IM(e,t){return t.reduce(function(n,i){return n[i]=e,n},{})}var UN=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,$M(typeof t!="number"?t:IM(t,mc))};function YN(e){var t,n=e.state,i=e.name,s=e.options,r=n.elements.arrow,o=n.modifiersData.popperOffsets,a=xi(n.placement),l=Cy(a),c=[cn,Wn].indexOf(a)>=0,u=c?"height":"width";if(!(!r||!o)){var d=UN(s.padding,n),h=My(r),f=l==="y"?ln:cn,p=l==="y"?zn:Wn,m=n.rects.reference[u]+n.rects.reference[l]-o[l]-n.rects.popper[u],v=o[l]-n.rects.reference[l],y=gc(r),g=y?l==="y"?y.clientHeight||0:y.clientWidth||0:0,x=m/2-v/2,_=d[f],w=g-h[u]-d[p],S=g/2-h[u]/2+x,C=pl(_,S,w),M=l;n.modifiersData[i]=(t={},t[M]=C,t.centerOffset=C-S,t)}}function XN(e){var t=e.state,n=e.options,i=n.element,s=i===void 0?"[data-popper-arrow]":i;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||NM(t.elements.popper,s)&&(t.elements.arrow=s))}const KN={name:"arrow",enabled:!0,phase:"main",fn:YN,effect:XN,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function qo(e){return e.split("-")[1]}var GN={top:"auto",right:"auto",bottom:"auto",left:"auto"};function qN(e){var t=e.x,n=e.y,i=window,s=i.devicePixelRatio||1;return{x:Ko(t*s)/s||0,y:Ko(n*s)/s||0}}function gb(e){var t,n=e.popper,i=e.popperRect,s=e.placement,r=e.variation,o=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,h=o.x,f=h===void 0?0:h,p=o.y,m=p===void 0?0:p,v=typeof u=="function"?u({x:f,y:m}):{x:f,y:m};f=v.x,m=v.y;var y=o.hasOwnProperty("x"),g=o.hasOwnProperty("y"),x=cn,_=ln,w=window;if(c){var S=gc(n),C="clientHeight",M="clientWidth";if(S===si(n)&&(S=Js(n),ns(S).position!=="static"&&a==="absolute"&&(C="scrollHeight",M="scrollWidth")),S=S,s===ln||(s===cn||s===Wn)&&r===Xl){_=zn;var P=d&&S===w&&w.visualViewport?w.visualViewport.height:S[C];m-=P-i.height,m*=l?1:-1}if(s===cn||(s===ln||s===zn)&&r===Xl){x=Wn;var T=d&&S===w&&w.visualViewport?w.visualViewport.width:S[M];f-=T-i.width,f*=l?1:-1}}var A=Object.assign({position:a},c&&GN),E=u===!0?qN({x:f,y:m}):{x:f,y:m};if(f=E.x,m=E.y,l){var z;return Object.assign({},A,(z={},z[_]=g?"0":"",z[x]=y?"0":"",z.transform=(w.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",z))}return Object.assign({},A,(t={},t[_]=g?m+"px":"",t[x]=y?f+"px":"",t.transform="",t))}function QN(e){var t=e.state,n=e.options,i=n.gpuAcceleration,s=i===void 0?!0:i,r=n.adaptive,o=r===void 0?!0:r,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:xi(t.placement),variation:qo(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,gb(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,gb(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const ZN={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:QN,data:{}};var lu={passive:!0};function JN(e){var t=e.state,n=e.instance,i=e.options,s=i.scroll,r=s===void 0?!0:s,o=i.resize,a=o===void 0?!0:o,l=si(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&c.forEach(function(u){u.addEventListener("scroll",n.update,lu)}),a&&l.addEventListener("resize",n.update,lu),function(){r&&c.forEach(function(u){u.removeEventListener("scroll",n.update,lu)}),a&&l.removeEventListener("resize",n.update,lu)}}const tj={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:JN,data:{}};var ej={left:"right",right:"left",bottom:"top",top:"bottom"};function Ju(e){return e.replace(/left|right|bottom|top/g,function(t){return ej[t]})}var nj={start:"end",end:"start"};function yb(e){return e.replace(/start|end/g,function(t){return nj[t]})}function Py(e){var t=si(e),n=t.pageXOffset,i=t.pageYOffset;return{scrollLeft:n,scrollTop:i}}function Ty(e){return Go(Js(e)).left+Py(e).scrollLeft}function ij(e){var t=si(e),n=Js(e),i=t.visualViewport,s=n.clientWidth,r=n.clientHeight,o=0,a=0;return i&&(s=i.width,r=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=i.offsetLeft,a=i.offsetTop)),{width:s,height:r,x:o+Ty(e),y:a}}function sj(e){var t,n=Js(e),i=Py(e),s=(t=e.ownerDocument)==null?void 0:t.body,r=Tr(n.scrollWidth,n.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=Tr(n.scrollHeight,n.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-i.scrollLeft+Ty(e),l=-i.scrollTop;return ns(s||n).direction==="rtl"&&(a+=Tr(n.clientWidth,s?s.clientWidth:0)-r),{width:r,height:o,x:a,y:l}}function Dy(e){var t=ns(e),n=t.overflow,i=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+s+i)}function FM(e){return["html","body","#document"].indexOf(ki(e))>=0?e.ownerDocument.body:Fn(e)&&Dy(e)?e:FM(Ah(e))}function ml(e,t){var n;t===void 0&&(t=[]);var i=FM(e),s=i===((n=e.ownerDocument)==null?void 0:n.body),r=si(i),o=s?[r].concat(r.visualViewport||[],Dy(i)?i:[]):i,a=t.concat(o);return s?a:a.concat(ml(Ah(o)))}function Dm(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function rj(e){var t=Go(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}function vb(e,t){return t===LM?Dm(ij(e)):Xo(t)?rj(t):Dm(sj(Js(e)))}function oj(e){var t=ml(Ah(e)),n=["absolute","fixed"].indexOf(ns(e).position)>=0,i=n&&Fn(e)?gc(e):e;return Xo(i)?t.filter(function(s){return Xo(s)&&NM(s,i)&&ki(s)!=="body"}):[]}function aj(e,t,n){var i=t==="clippingParents"?oj(e):[].concat(t),s=[].concat(i,[n]),r=s[0],o=s.reduce(function(a,l){var c=vb(e,l);return a.top=Tr(c.top,a.top),a.right=Vd(c.right,a.right),a.bottom=Vd(c.bottom,a.bottom),a.left=Tr(c.left,a.left),a},vb(e,r));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function BM(e){var t=e.reference,n=e.element,i=e.placement,s=i?xi(i):null,r=i?qo(i):null,o=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,l;switch(s){case ln:l={x:o,y:t.y-n.height};break;case zn:l={x:o,y:t.y+t.height};break;case Wn:l={x:t.x+t.width,y:a};break;case cn:l={x:t.x-n.width,y:a};break;default:l={x:t.x,y:t.y}}var c=s?Cy(s):null;if(c!=null){var u=c==="y"?"height":"width";switch(r){case Yo:l[c]=l[c]-(t[u]/2-n[u]/2);break;case Xl:l[c]=l[c]+(t[u]/2-n[u]/2);break}}return l}function Kl(e,t){t===void 0&&(t={});var n=t,i=n.placement,s=i===void 0?e.placement:i,r=n.boundary,o=r===void 0?PN:r,a=n.rootBoundary,l=a===void 0?LM:a,c=n.elementContext,u=c===void 0?Sa:c,d=n.altBoundary,h=d===void 0?!1:d,f=n.padding,p=f===void 0?0:f,m=$M(typeof p!="number"?p:IM(p,mc)),v=u===Sa?TN:Sa,y=e.rects.popper,g=e.elements[h?v:u],x=aj(Xo(g)?g:g.contextElement||Js(e.elements.popper),o,l),_=Go(e.elements.reference),w=BM({reference:_,element:y,strategy:"absolute",placement:s}),S=Dm(Object.assign({},y,w)),C=u===Sa?S:_,M={top:x.top-C.top+m.top,bottom:C.bottom-x.bottom+m.bottom,left:x.left-C.left+m.left,right:C.right-x.right+m.right},P=e.modifiersData.offset;if(u===Sa&&P){var T=P[s];Object.keys(M).forEach(function(A){var E=[Wn,zn].indexOf(A)>=0?1:-1,z=[ln,zn].indexOf(A)>=0?"y":"x";M[A]+=T[z]*E})}return M}function lj(e,t){t===void 0&&(t={});var n=t,i=n.placement,s=n.boundary,r=n.rootBoundary,o=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?RM:l,u=qo(i),d=u?a?pb:pb.filter(function(p){return qo(p)===u}):mc,h=d.filter(function(p){return c.indexOf(p)>=0});h.length===0&&(h=d);var f=h.reduce(function(p,m){return p[m]=Kl(e,{placement:m,boundary:s,rootBoundary:r,padding:o})[xi(m)],p},{});return Object.keys(f).sort(function(p,m){return f[p]-f[m]})}function cj(e){if(xi(e)===ky)return[];var t=Ju(e);return[yb(e),t,yb(t)]}function uj(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var s=n.mainAxis,r=s===void 0?!0:s,o=n.altAxis,a=o===void 0?!0:o,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,h=n.altBoundary,f=n.flipVariations,p=f===void 0?!0:f,m=n.allowedAutoPlacements,v=t.options.placement,y=xi(v),g=y===v,x=l||(g||!p?[Ju(v)]:cj(v)),_=[v].concat(x).reduce(function(Z,O){return Z.concat(xi(O)===ky?lj(t,{placement:O,boundary:u,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:m}):O)},[]),w=t.rects.reference,S=t.rects.popper,C=new Map,M=!0,P=_[0],T=0;T<_.length;T++){var A=_[T],E=xi(A),z=qo(A)===Yo,N=[ln,zn].indexOf(E)>=0,L=N?"width":"height",R=Kl(t,{placement:A,boundary:u,rootBoundary:d,altBoundary:h,padding:c}),B=N?z?Wn:cn:z?zn:ln;w[L]>S[L]&&(B=Ju(B));var D=Ju(B),$=[];if(r&&$.push(R[E]<=0),a&&$.push(R[B]<=0,R[D]<=0),$.every(function(Z){return Z})){P=A,M=!1;break}C.set(A,$)}if(M)for(var F=p?3:1,V=function(O){var U=_.find(function(lt){var ct=C.get(lt);if(ct)return ct.slice(0,O).every(function(kt){return kt})});if(U)return P=U,"break"},W=F;W>0;W--){var et=V(W);if(et==="break")break}t.placement!==P&&(t.modifiersData[i]._skip=!0,t.placement=P,t.reset=!0)}}const VM={name:"flip",enabled:!0,phase:"main",fn:uj,requiresIfExists:["offset"],data:{_skip:!1}};function xb(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function bb(e){return[ln,Wn,zn,cn].some(function(t){return e[t]>=0})}function dj(e){var t=e.state,n=e.name,i=t.rects.reference,s=t.rects.popper,r=t.modifiersData.preventOverflow,o=Kl(t,{elementContext:"reference"}),a=Kl(t,{altBoundary:!0}),l=xb(o,i),c=xb(a,s,r),u=bb(l),d=bb(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const hj={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:dj};function fj(e,t,n){var i=xi(e),s=[cn,ln].indexOf(i)>=0?-1:1,r=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,o=r[0],a=r[1];return o=o||0,a=(a||0)*s,[cn,Wn].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}function pj(e){var t=e.state,n=e.options,i=e.name,s=n.offset,r=s===void 0?[0,0]:s,o=RM.reduce(function(u,d){return u[d]=fj(d,t.rects,r),u},{}),a=o[t.placement],l=a.x,c=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[i]=o}const mj={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:pj};function gj(e){var t=e.state,n=e.name;t.modifiersData[n]=BM({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const yj={name:"popperOffsets",enabled:!0,phase:"read",fn:gj,data:{}};function vj(e){return e==="x"?"y":"x"}function xj(e){var t=e.state,n=e.options,i=e.name,s=n.mainAxis,r=s===void 0?!0:s,o=n.altAxis,a=o===void 0?!1:o,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,h=n.tether,f=h===void 0?!0:h,p=n.tetherOffset,m=p===void 0?0:p,v=Kl(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),y=xi(t.placement),g=qo(t.placement),x=!g,_=Cy(y),w=vj(_),S=t.modifiersData.popperOffsets,C=t.rects.reference,M=t.rects.popper,P=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,T=typeof P=="number"?{mainAxis:P,altAxis:P}:Object.assign({mainAxis:0,altAxis:0},P),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,E={x:0,y:0};if(S){if(r){var z,N=_==="y"?ln:cn,L=_==="y"?zn:Wn,R=_==="y"?"height":"width",B=S[_],D=B+v[N],$=B-v[L],F=f?-M[R]/2:0,V=g===Yo?C[R]:M[R],W=g===Yo?-M[R]:-C[R],et=t.elements.arrow,Z=f&&et?My(et):{width:0,height:0},O=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:jM(),U=O[N],lt=O[L],ct=pl(0,C[R],Z[R]),kt=x?C[R]/2-F-ct-U-T.mainAxis:V-ct-U-T.mainAxis,it=x?-C[R]/2+F+ct+lt+T.mainAxis:W+ct+lt+T.mainAxis,Lt=t.elements.arrow&&gc(t.elements.arrow),Ct=Lt?_==="y"?Lt.clientTop||0:Lt.clientLeft||0:0,Qt=(z=A==null?void 0:A[_])!=null?z:0,ft=B+kt-Qt-Ct,wt=B+it-Qt,dt=pl(f?Vd(D,ft):D,B,f?Tr($,wt):$);S[_]=dt,E[_]=dt-B}if(a){var jt,pt=_==="x"?ln:cn,xt=_==="x"?zn:Wn,J=S[w],mt=w==="y"?"height":"width",q=J+v[pt],ye=J-v[xt],Dt=[ln,cn].indexOf(y)!==-1,he=(jt=A==null?void 0:A[w])!=null?jt:0,Un=Dt?q:J-C[mt]-M[mt]-he+T.altAxis,Yn=Dt?J+C[mt]+M[mt]-he-T.altAxis:ye,Mn=f&&Dt?HN(Un,J,Yn):pl(f?Un:q,J,f?Yn:ye);S[w]=Mn,E[w]=Mn-J}t.modifiersData[i]=E}}const bj={name:"preventOverflow",enabled:!0,phase:"main",fn:xj,requiresIfExists:["offset"]};function _j(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function wj(e){return e===si(e)||!Fn(e)?Py(e):_j(e)}function kj(e){var t=e.getBoundingClientRect(),n=Ko(t.width)/e.offsetWidth||1,i=Ko(t.height)/e.offsetHeight||1;return n!==1||i!==1}function Sj(e,t,n){n===void 0&&(n=!1);var i=Fn(t),s=Fn(t)&&kj(t),r=Js(t),o=Go(e,s),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!n)&&((ki(t)!=="body"||Dy(r))&&(a=wj(t)),Fn(t)?(l=Go(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):r&&(l.x=Ty(r))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function Mj(e){var t=new Map,n=new Set,i=[];e.forEach(function(r){t.set(r.name,r)});function s(r){n.add(r.name);var o=[].concat(r.requires||[],r.requiresIfExists||[]);o.forEach(function(a){if(!n.has(a)){var l=t.get(a);l&&s(l)}}),i.push(r)}return e.forEach(function(r){n.has(r.name)||s(r)}),i}function Cj(e){var t=Mj(e);return IN.reduce(function(n,i){return n.concat(t.filter(function(s){return s.phase===i}))},[])}function Pj(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Tj(e){var t=e.reduce(function(n,i){var s=n[i.name];return n[i.name]=s?Object.assign({},s,i,{options:Object.assign({},s.options,i.options),data:Object.assign({},s.data,i.data)}):i,n},{});return Object.keys(t).map(function(n){return t[n]})}var _b={placement:"bottom",modifiers:[],strategy:"absolute"};function wb(){for(var e=arguments.length,t=new Array(e),n=0;ne,isStatic:!1,reducedMotion:"never"}),Lh=k.createContext({}),Rh=k.createContext(null),Nh=typeof document<"u",Ey=Nh?k.useLayoutEffect:k.useEffect,WM=k.createContext({strict:!1}),Ay=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),Fj="framerAppearId",HM="data-"+Ay(Fj);function Bj(e,t,n,i){const{visualElement:s}=k.useContext(Lh),r=k.useContext(WM),o=k.useContext(Rh),a=k.useContext(zM).reducedMotion,l=k.useRef();i=i||r.renderer,!l.current&&i&&(l.current=i(e,{visualState:t,parent:s,props:n,presenceContext:o,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:a}));const c=l.current;k.useInsertionEffect(()=>{c&&c.update(n,o)});const u=k.useRef(!!(n[HM]&&!window.HandoffComplete));return Ey(()=>{c&&(c.render(),u.current&&c.animationState&&c.animationState.animateChanges())}),k.useEffect(()=>{c&&(c.updateFeatures(),!u.current&&c.animationState&&c.animationState.animateChanges(),u.current&&(u.current=!1,window.HandoffComplete=!0))}),c}function _o(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Vj(e,t,n){return k.useCallback(i=>{i&&e.mount&&e.mount(i),t&&(i?t.mount(i):t.unmount()),n&&(typeof n=="function"?n(i):_o(n)&&(n.current=i))},[t])}function Gl(e){return typeof e=="string"||Array.isArray(e)}function jh(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Oy=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ly=["initial",...Oy];function $h(e){return jh(e.animate)||Ly.some(t=>Gl(e[t]))}function UM(e){return!!($h(e)||e.variants)}function zj(e,t){if($h(e)){const{initial:n,animate:i}=e;return{initial:n===!1||Gl(n)?n:void 0,animate:Gl(i)?i:void 0}}return e.inherit!==!1?t:{}}function Wj(e){const{initial:t,animate:n}=zj(e,k.useContext(Lh));return k.useMemo(()=>({initial:t,animate:n}),[kb(t),kb(n)])}function kb(e){return Array.isArray(e)?e.join(" "):e}const Sb={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},ql={};for(const e in Sb)ql[e]={isEnabled:t=>Sb[e].some(n=>!!t[n])};function Hj(e){for(const t in e)ql[t]={...ql[t],...e[t]}}const Ry=k.createContext({}),YM=k.createContext({}),Uj=Symbol.for("motionComponentSymbol");function Yj({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:i,Component:s}){e&&Hj(e);function r(a,l){let c;const u={...k.useContext(zM),...a,layoutId:Xj(a)},{isStatic:d}=u,h=Wj(a),f=i(a,d);if(!d&&Nh){h.visualElement=Bj(s,f,u,t);const p=k.useContext(YM),m=k.useContext(WM).strict;h.visualElement&&(c=h.visualElement.loadFeatures(u,m,e,p))}return k.createElement(Lh.Provider,{value:h},c&&h.visualElement?k.createElement(c,{visualElement:h.visualElement,...u}):null,n(s,a,Vj(f,h.visualElement,l),f,d,h.visualElement))}const o=k.forwardRef(r);return o[Uj]=s,o}function Xj({layoutId:e}){const t=k.useContext(Ry).id;return t&&e!==void 0?t+"-"+e:e}function Kj(e){function t(i,s={}){return Yj(e(i,s))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(i,s)=>(n.has(s)||n.set(s,t(s)),n.get(s))})}const Gj=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Ny(e){return typeof e!="string"||e.includes("-")?!1:!!(Gj.indexOf(e)>-1||/[A-Z]/.test(e))}const zd={};function qj(e){Object.assign(zd,e)}const yc=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ur=new Set(yc);function XM(e,{layout:t,layoutId:n}){return Ur.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!zd[e]||e==="opacity")}const un=e=>!!(e&&e.getVelocity),Qj={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Zj=yc.length;function Jj(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},i,s){let r="";for(let o=0;ot=>typeof t=="string"&&t.startsWith(e),GM=KM("--"),Em=KM("var(--"),t$=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,e$=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Hs=(e,t,n)=>Math.min(Math.max(n,e),t),Yr={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},gl={...Yr,transform:e=>Hs(0,1,e)},cu={...Yr,default:1},yl=e=>Math.round(e*1e5)/1e5,Ih=/(-)?([\d]*\.?[\d])+/g,qM=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,n$=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function vc(e){return typeof e=="string"}const xc=e=>({test:t=>vc(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ps=xc("deg"),bi=xc("%"),st=xc("px"),i$=xc("vh"),s$=xc("vw"),Mb={...bi,parse:e=>bi.parse(e)/100,transform:e=>bi.transform(e*100)},Cb={...Yr,transform:Math.round},QM={borderWidth:st,borderTopWidth:st,borderRightWidth:st,borderBottomWidth:st,borderLeftWidth:st,borderRadius:st,radius:st,borderTopLeftRadius:st,borderTopRightRadius:st,borderBottomRightRadius:st,borderBottomLeftRadius:st,width:st,maxWidth:st,height:st,maxHeight:st,size:st,top:st,right:st,bottom:st,left:st,padding:st,paddingTop:st,paddingRight:st,paddingBottom:st,paddingLeft:st,margin:st,marginTop:st,marginRight:st,marginBottom:st,marginLeft:st,rotate:ps,rotateX:ps,rotateY:ps,rotateZ:ps,scale:cu,scaleX:cu,scaleY:cu,scaleZ:cu,skew:ps,skewX:ps,skewY:ps,distance:st,translateX:st,translateY:st,translateZ:st,x:st,y:st,z:st,perspective:st,transformPerspective:st,opacity:gl,originX:Mb,originY:Mb,originZ:st,zIndex:Cb,fillOpacity:gl,strokeOpacity:gl,numOctaves:Cb};function jy(e,t,n,i){const{style:s,vars:r,transform:o,transformOrigin:a}=e;let l=!1,c=!1,u=!0;for(const d in t){const h=t[d];if(GM(d)){r[d]=h;continue}const f=QM[d],p=e$(h,f);if(Ur.has(d)){if(l=!0,o[d]=p,!u)continue;h!==(f.default||0)&&(u=!1)}else d.startsWith("origin")?(c=!0,a[d]=p):s[d]=p}if(t.transform||(l||i?s.transform=Jj(e.transform,n,u,i):s.transform&&(s.transform="none")),c){const{originX:d="50%",originY:h="50%",originZ:f=0}=a;s.transformOrigin=`${d} ${h} ${f}`}}const $y=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ZM(e,t,n){for(const i in t)!un(t[i])&&!XM(i,n)&&(e[i]=t[i])}function r$({transformTemplate:e},t,n){return k.useMemo(()=>{const i=$y();return jy(i,t,{enableHardwareAcceleration:!n},e),Object.assign({},i.vars,i.style)},[t])}function o$(e,t,n){const i=e.style||{},s={};return ZM(s,i,e),Object.assign(s,r$(e,t,n)),e.transformValues?e.transformValues(s):s}function a$(e,t,n){const i={},s=o$(e,t,n);return e.drag&&e.dragListener!==!1&&(i.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(i.tabIndex=0),i.style=s,i}const l$=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Wd(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||l$.has(e)}let JM=e=>!Wd(e);function c$(e){e&&(JM=t=>t.startsWith("on")?!Wd(t):e(t))}try{c$(require("@emotion/is-prop-valid").default)}catch{}function u$(e,t,n){const i={};for(const s in e)s==="values"&&typeof e.values=="object"||(JM(s)||n===!0&&Wd(s)||!t&&!Wd(s)||e.draggable&&s.startsWith("onDrag"))&&(i[s]=e[s]);return i}function Pb(e,t,n){return typeof e=="string"?e:st.transform(t+n*e)}function d$(e,t,n){const i=Pb(t,e.x,e.width),s=Pb(n,e.y,e.height);return`${i} ${s}`}const h$={offset:"stroke-dashoffset",array:"stroke-dasharray"},f$={offset:"strokeDashoffset",array:"strokeDasharray"};function p$(e,t,n=1,i=0,s=!0){e.pathLength=1;const r=s?h$:f$;e[r.offset]=st.transform(-i);const o=st.transform(t),a=st.transform(n);e[r.array]=`${o} ${a}`}function Iy(e,{attrX:t,attrY:n,attrScale:i,originX:s,originY:r,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},u,d,h){if(jy(e,c,u,h),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:p,dimensions:m}=e;f.transform&&(m&&(p.transform=f.transform),delete f.transform),m&&(s!==void 0||r!==void 0||p.transform)&&(p.transformOrigin=d$(m,s!==void 0?s:.5,r!==void 0?r:.5)),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),i!==void 0&&(f.scale=i),o!==void 0&&p$(f,o,a,l,!1)}const tC=()=>({...$y(),attrs:{}}),Fy=e=>typeof e=="string"&&e.toLowerCase()==="svg";function m$(e,t,n,i){const s=k.useMemo(()=>{const r=tC();return Iy(r,t,{enableHardwareAcceleration:!1},Fy(i),e.transformTemplate),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};ZM(r,e.style,e),s.style={...r,...s.style}}return s}function g$(e=!1){return(n,i,s,{latestValues:r},o)=>{const l=(Ny(n)?m$:a$)(i,r,o,n),u={...u$(i,typeof n=="string",e),...l,ref:s},{children:d}=i,h=k.useMemo(()=>un(d)?d.get():d,[d]);return k.createElement(n,{...u,children:h})}}function eC(e,{style:t,vars:n},i,s){Object.assign(e.style,t,s&&s.getProjectionStyles(i));for(const r in n)e.style.setProperty(r,n[r])}const nC=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function iC(e,t,n,i){eC(e,t,void 0,i);for(const s in t.attrs)e.setAttribute(nC.has(s)?s:Ay(s),t.attrs[s])}function By(e,t){const{style:n}=e,i={};for(const s in n)(un(n[s])||t.style&&un(t.style[s])||XM(s,e))&&(i[s]=n[s]);return i}function sC(e,t){const n=By(e,t);for(const i in e)if(un(e[i])||un(t[i])){const s=yc.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[s]=e[i]}return n}function Vy(e,t,n,i={},s={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,i,s)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,i,s)),t}function rC(e){const t=k.useRef(null);return t.current===null&&(t.current=e()),t.current}const Hd=e=>Array.isArray(e),y$=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),v$=e=>Hd(e)?e[e.length-1]||0:e;function ed(e){const t=un(e)?e.get():e;return y$(t)?t.toValue():t}function x$({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},i,s,r){const o={latestValues:b$(i,s,r,e),renderState:t()};return n&&(o.mount=a=>n(i,a,o)),o}const oC=e=>(t,n)=>{const i=k.useContext(Lh),s=k.useContext(Rh),r=()=>x$(e,t,i,s);return n?r():rC(r)};function b$(e,t,n,i){const s={},r=i(e,{});for(const h in r)s[h]=ed(r[h]);let{initial:o,animate:a}=e;const l=$h(e),c=UM(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const d=u?a:o;return d&&typeof d!="boolean"&&!jh(d)&&(Array.isArray(d)?d:[d]).forEach(f=>{const p=Vy(e,f);if(!p)return;const{transitionEnd:m,transition:v,...y}=p;for(const g in y){let x=y[g];if(Array.isArray(x)){const _=u?x.length-1:0;x=x[_]}x!==null&&(s[g]=x)}for(const g in m)s[g]=m[g]}),s}const ce=e=>e;class Tb{constructor(){this.order=[],this.scheduled=new Set}add(t){if(!this.scheduled.has(t))return this.scheduled.add(t),this.order.push(t),!0}remove(t){const n=this.order.indexOf(t);n!==-1&&(this.order.splice(n,1),this.scheduled.delete(t))}clear(){this.order.length=0,this.scheduled.clear()}}function _$(e){let t=new Tb,n=new Tb,i=0,s=!1,r=!1;const o=new WeakSet,a={schedule:(l,c=!1,u=!1)=>{const d=u&&s,h=d?t:n;return c&&o.add(l),h.add(l)&&d&&s&&(i=t.order.length),l},cancel:l=>{n.remove(l),o.delete(l)},process:l=>{if(s){r=!0;return}if(s=!0,[t,n]=[n,t],n.clear(),i=t.order.length,i)for(let c=0;c(d[h]=_$(()=>n=!0),d),{}),o=d=>r[d].process(s),a=()=>{const d=performance.now();n=!1,s.delta=i?1e3/60:Math.max(Math.min(d-s.timestamp,w$),1),s.timestamp=d,s.isProcessing=!0,uu.forEach(o),s.isProcessing=!1,n&&t&&(i=!1,e(a))},l=()=>{n=!0,i=!0,s.isProcessing||e(a)};return{schedule:uu.reduce((d,h)=>{const f=r[h];return d[h]=(p,m=!1,v=!1)=>(n||l(),f.schedule(p,m,v)),d},{}),cancel:d=>uu.forEach(h=>r[h].cancel(d)),state:s,steps:r}}const{schedule:zt,cancel:is,state:je,steps:Uf}=k$(typeof requestAnimationFrame<"u"?requestAnimationFrame:ce,!0),S$={useVisualState:oC({scrapeMotionValuesFromProps:sC,createRenderState:tC,onMount:(e,t,{renderState:n,latestValues:i})=>{zt.read(()=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),zt.render(()=>{Iy(n,i,{enableHardwareAcceleration:!1},Fy(t.tagName),e.transformTemplate),iC(t,n)})}})},M$={useVisualState:oC({scrapeMotionValuesFromProps:By,createRenderState:$y})};function C$(e,{forwardMotionProps:t=!1},n,i){return{...Ny(e)?S$:M$,preloadedFeatures:n,useRender:g$(t),createVisualElement:i,Component:e}}function Hi(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}const aC=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Fh(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}const P$=e=>t=>aC(t)&&e(t,Fh(t));function qi(e,t,n,i){return Hi(e,t,P$(n),i)}const T$=(e,t)=>n=>t(e(n)),Is=(...e)=>e.reduce(T$);function lC(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const Db=lC("dragHorizontal"),Eb=lC("dragVertical");function cC(e){let t=!1;if(e==="y")t=Eb();else if(e==="x")t=Db();else{const n=Db(),i=Eb();n&&i?t=()=>{n(),i()}:(n&&n(),i&&i())}return t}function uC(){const e=cC(!0);return e?(e(),!1):!0}class tr{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Ab(e,t){const n="pointer"+(t?"enter":"leave"),i="onHover"+(t?"Start":"End"),s=(r,o)=>{if(r.pointerType==="touch"||uC())return;const a=e.getProps();e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",t),a[i]&&zt.update(()=>a[i](r,o))};return qi(e.current,n,s,{passive:!e.getProps()[i]})}class D$ extends tr{mount(){this.unmount=Is(Ab(this.node,!0),Ab(this.node,!1))}unmount(){}}class E$ extends tr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Is(Hi(this.node.current,"focus",()=>this.onFocus()),Hi(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const dC=(e,t)=>t?e===t?!0:dC(e,t.parentElement):!1;function Yf(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,Fh(n))}class A$ extends tr{constructor(){super(...arguments),this.removeStartListeners=ce,this.removeEndListeners=ce,this.removeAccessibleListeners=ce,this.startPointerPress=(t,n)=>{if(this.isPressing)return;this.removeEndListeners();const i=this.node.getProps(),r=qi(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:c,onTapCancel:u,globalTapTarget:d}=this.node.getProps();zt.update(()=>{!d&&!dC(this.node.current,a.target)?u&&u(a,l):c&&c(a,l)})},{passive:!(i.onTap||i.onPointerUp)}),o=qi(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(i.onTapCancel||i.onPointerCancel)});this.removeEndListeners=Is(r,o),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=r=>{if(r.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||Yf("up",(l,c)=>{const{onTap:u}=this.node.getProps();u&&zt.update(()=>u(l,c))})};this.removeEndListeners(),this.removeEndListeners=Hi(this.node.current,"keyup",o),Yf("down",(a,l)=>{this.startPress(a,l)})},n=Hi(this.node.current,"keydown",t),i=()=>{this.isPressing&&Yf("cancel",(r,o)=>this.cancelPress(r,o))},s=Hi(this.node.current,"blur",i);this.removeAccessibleListeners=Is(n,s)}}startPress(t,n){this.isPressing=!0;const{onTapStart:i,whileTap:s}=this.node.getProps();s&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),i&&zt.update(()=>i(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!uC()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:i}=this.node.getProps();i&&zt.update(()=>i(t,n))}mount(){const t=this.node.getProps(),n=qi(t.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),i=Hi(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Is(n,i)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const Am=new WeakMap,Xf=new WeakMap,O$=e=>{const t=Am.get(e.target);t&&t(e)},L$=e=>{e.forEach(O$)};function R$({root:e,...t}){const n=e||document;Xf.has(n)||Xf.set(n,{});const i=Xf.get(n),s=JSON.stringify(t);return i[s]||(i[s]=new IntersectionObserver(L$,{root:e,...t})),i[s]}function N$(e,t,n){const i=R$(t);return Am.set(e,n),i.observe(e),()=>{Am.delete(e),i.unobserve(e)}}const j$={some:0,all:1};class $$ extends tr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:i,amount:s="some",once:r}=t,o={root:n?n.current:void 0,rootMargin:i,threshold:typeof s=="number"?s:j$[s]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,r&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),h=c?u:d;h&&h(l)};return N$(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(I$(t,n))&&this.startObserver()}unmount(){}}function I$({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const F$={inView:{Feature:$$},tap:{Feature:A$},focus:{Feature:E$},hover:{Feature:D$}};function hC(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;it[i]=n.get()),t}function V$(e){const t={};return e.values.forEach((n,i)=>t[i]=n.getVelocity()),t}function Bh(e,t,n){const i=e.getProps();return Vy(i,t,n!==void 0?n:i.custom,B$(e),V$(e))}let zy=ce;const Dr=e=>e*1e3,Qi=e=>e/1e3,z$={current:!1},fC=e=>Array.isArray(e)&&typeof e[0]=="number";function pC(e){return!!(!e||typeof e=="string"&&mC[e]||fC(e)||Array.isArray(e)&&e.every(pC))}const Qa=([e,t,n,i])=>`cubic-bezier(${e}, ${t}, ${n}, ${i})`,mC={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Qa([0,.65,.55,1]),circOut:Qa([.55,0,1,.45]),backIn:Qa([.31,.01,.66,-.59]),backOut:Qa([.33,1.53,.69,.99])};function gC(e){if(e)return fC(e)?Qa(e):Array.isArray(e)?e.map(gC):mC[e]}function W$(e,t,n,{delay:i=0,duration:s,repeat:r=0,repeatType:o="loop",ease:a,times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=gC(a);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:i,duration:s,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"})}function H$(e,{repeat:t,repeatType:n="loop"}){const i=t&&n!=="loop"&&t%2===1?0:e.length-1;return e[i]}const yC=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,U$=1e-7,Y$=12;function X$(e,t,n,i,s){let r,o,a=0;do o=t+(n-t)/2,r=yC(o,i,s)-e,r>0?n=o:t=o;while(Math.abs(r)>U$&&++aX$(r,0,1,e,n);return r=>r===0||r===1?r:yC(s(r),t,i)}const K$=bc(.42,0,1,1),G$=bc(0,0,.58,1),vC=bc(.42,0,.58,1),q$=e=>Array.isArray(e)&&typeof e[0]!="number",xC=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,bC=e=>t=>1-e(1-t),Wy=e=>1-Math.sin(Math.acos(e)),_C=bC(Wy),Q$=xC(Wy),wC=bc(.33,1.53,.69,.99),Hy=bC(wC),Z$=xC(Hy),J$=e=>(e*=2)<1?.5*Hy(e):.5*(2-Math.pow(2,-10*(e-1))),tI={linear:ce,easeIn:K$,easeInOut:vC,easeOut:G$,circIn:Wy,circInOut:Q$,circOut:_C,backIn:Hy,backInOut:Z$,backOut:wC,anticipate:J$},Ob=e=>{if(Array.isArray(e)){zy(e.length===4);const[t,n,i,s]=e;return bc(t,n,i,s)}else if(typeof e=="string")return tI[e];return e},Uy=(e,t)=>n=>!!(vc(n)&&n$.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),kC=(e,t,n)=>i=>{if(!vc(i))return i;const[s,r,o,a]=i.match(Ih);return{[e]:parseFloat(s),[t]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},eI=e=>Hs(0,255,e),Kf={...Yr,transform:e=>Math.round(eI(e))},kr={test:Uy("rgb","red"),parse:kC("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+Kf.transform(e)+", "+Kf.transform(t)+", "+Kf.transform(n)+", "+yl(gl.transform(i))+")"};function nI(e){let t="",n="",i="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),i=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),i=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,i+=i,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}}const Om={test:Uy("#"),parse:nI,transform:kr.transform},wo={test:Uy("hsl","hue"),parse:kC("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+bi.transform(yl(t))+", "+bi.transform(yl(n))+", "+yl(gl.transform(i))+")"},We={test:e=>kr.test(e)||Om.test(e)||wo.test(e),parse:e=>kr.test(e)?kr.parse(e):wo.test(e)?wo.parse(e):Om.parse(e),transform:e=>vc(e)?e:e.hasOwnProperty("red")?kr.transform(e):wo.transform(e)},ee=(e,t,n)=>-n*e+n*t+e;function Gf(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function iI({hue:e,saturation:t,lightness:n,alpha:i}){e/=360,t/=100,n/=100;let s=0,r=0,o=0;if(!t)s=r=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;s=Gf(l,a,e+1/3),r=Gf(l,a,e),o=Gf(l,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:i}}const qf=(e,t,n)=>{const i=e*e;return Math.sqrt(Math.max(0,n*(t*t-i)+i))},sI=[Om,kr,wo],rI=e=>sI.find(t=>t.test(e));function Lb(e){const t=rI(e);let n=t.parse(e);return t===wo&&(n=iI(n)),n}const SC=(e,t)=>{const n=Lb(e),i=Lb(t),s={...n};return r=>(s.red=qf(n.red,i.red,r),s.green=qf(n.green,i.green,r),s.blue=qf(n.blue,i.blue,r),s.alpha=ee(n.alpha,i.alpha,r),kr.transform(s))};function oI(e){var t,n;return isNaN(e)&&vc(e)&&(((t=e.match(Ih))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(qM))===null||n===void 0?void 0:n.length)||0)>0}const MC={regex:t$,countKey:"Vars",token:"${v}",parse:ce},CC={regex:qM,countKey:"Colors",token:"${c}",parse:We.parse},PC={regex:Ih,countKey:"Numbers",token:"${n}",parse:Yr.parse};function Qf(e,{regex:t,countKey:n,token:i,parse:s}){const r=e.tokenised.match(t);r&&(e["num"+n]=r.length,e.tokenised=e.tokenised.replace(t,i),e.values.push(...r.map(s)))}function Ud(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&Qf(n,MC),Qf(n,CC),Qf(n,PC),n}function TC(e){return Ud(e).values}function DC(e){const{values:t,numColors:n,numVars:i,tokenised:s}=Ud(e),r=t.length;return o=>{let a=s;for(let l=0;ltypeof e=="number"?0:e;function lI(e){const t=TC(e);return DC(e)(t.map(aI))}const Us={test:oI,parse:TC,createTransformer:DC,getAnimatableNone:lI},EC=(e,t)=>n=>`${n>0?t:e}`;function AC(e,t){return typeof e=="number"?n=>ee(e,t,n):We.test(e)?SC(e,t):e.startsWith("var(")?EC(e,t):LC(e,t)}const OC=(e,t)=>{const n=[...e],i=n.length,s=e.map((r,o)=>AC(r,t[o]));return r=>{for(let o=0;o{const n={...e,...t},i={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(i[s]=AC(e[s],t[s]));return s=>{for(const r in i)n[r]=i[r](s);return n}},LC=(e,t)=>{const n=Us.createTransformer(t),i=Ud(e),s=Ud(t);return i.numVars===s.numVars&&i.numColors===s.numColors&&i.numNumbers>=s.numNumbers?Is(OC(i.values,s.values),n):EC(e,t)},Ql=(e,t,n)=>{const i=t-e;return i===0?1:(n-e)/i},Rb=(e,t)=>n=>ee(e,t,n);function uI(e){return typeof e=="number"?Rb:typeof e=="string"?We.test(e)?SC:LC:Array.isArray(e)?OC:typeof e=="object"?cI:Rb}function dI(e,t,n){const i=[],s=n||uI(e[0]),r=e.length-1;for(let o=0;ot[0];e[0]>e[r-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=dI(t,i,s),a=o.length,l=c=>{let u=0;if(a>1)for(;ul(Hs(e[0],e[r-1],c)):l}function hI(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const s=Ql(0,t,i);e.push(ee(n,1,s))}}function fI(e){const t=[0];return hI(t,e.length-1),t}function pI(e,t){return e.map(n=>n*t)}function mI(e,t){return e.map(()=>t||vC).splice(0,e.length-1)}function Yd({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const s=q$(i)?i.map(Ob):Ob(i),r={done:!1,value:t[0]},o=pI(n&&n.length===t.length?n:fI(t),e),a=RC(o,t,{ease:Array.isArray(s)?s:mI(t,s)});return{calculatedDuration:e,next:l=>(r.value=a(l),r.done=l>=e,r)}}function NC(e,t){return t?e*(1e3/t):0}const gI=5;function jC(e,t,n){const i=Math.max(t-gI,0);return NC(n-e(i),t-i)}const Zf=.001,yI=.01,vI=10,xI=.05,bI=1;function _I({duration:e=800,bounce:t=.25,velocity:n=0,mass:i=1}){let s,r,o=1-t;o=Hs(xI,bI,o),e=Hs(yI,vI,Qi(e)),o<1?(s=c=>{const u=c*o,d=u*e,h=u-n,f=Lm(c,o),p=Math.exp(-d);return Zf-h/f*p},r=c=>{const d=c*o*e,h=d*n+n,f=Math.pow(o,2)*Math.pow(c,2)*e,p=Math.exp(-d),m=Lm(Math.pow(c,2),o);return(-s(c)+Zf>0?-1:1)*((h-f)*p)/m}):(s=c=>{const u=Math.exp(-c*e),d=(c-n)*e+1;return-Zf+u*d},r=c=>{const u=Math.exp(-c*e),d=(n-c)*(e*e);return u*d});const a=5/e,l=kI(s,r,a);if(e=Dr(e),isNaN(l))return{stiffness:100,damping:10,duration:e};{const c=Math.pow(l,2)*i;return{stiffness:c,damping:o*2*Math.sqrt(i*c),duration:e}}}const wI=12;function kI(e,t,n){let i=n;for(let s=1;se[n]!==void 0)}function CI(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!Nb(e,MI)&&Nb(e,SI)){const n=_I(e);t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}function $C({keyframes:e,restDelta:t,restSpeed:n,...i}){const s=e[0],r=e[e.length-1],o={done:!1,value:s},{stiffness:a,damping:l,mass:c,duration:u,velocity:d,isResolvedFromDuration:h}=CI({...i,velocity:-Qi(i.velocity||0)}),f=d||0,p=l/(2*Math.sqrt(a*c)),m=r-s,v=Qi(Math.sqrt(a/c)),y=Math.abs(m)<5;n||(n=y?.01:2),t||(t=y?.005:.5);let g;if(p<1){const x=Lm(v,p);g=_=>{const w=Math.exp(-p*v*_);return r-w*((f+p*v*m)/x*Math.sin(x*_)+m*Math.cos(x*_))}}else if(p===1)g=x=>r-Math.exp(-v*x)*(m+(f+v*m)*x);else{const x=v*Math.sqrt(p*p-1);g=_=>{const w=Math.exp(-p*v*_),S=Math.min(x*_,300);return r-w*((f+p*v*m)*Math.sinh(S)+x*m*Math.cosh(S))/x}}return{calculatedDuration:h&&u||null,next:x=>{const _=g(x);if(h)o.done=x>=u;else{let w=f;x!==0&&(p<1?w=jC(g,x,_):w=0);const S=Math.abs(w)<=n,C=Math.abs(r-_)<=t;o.done=S&&C}return o.value=o.done?r:_,o}}}function jb({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],h={done:!1,value:d},f=M=>a!==void 0&&Ml,p=M=>a===void 0?l:l===void 0||Math.abs(a-M)-m*Math.exp(-M/i),x=M=>y+g(M),_=M=>{const P=g(M),T=x(M);h.done=Math.abs(P)<=c,h.value=h.done?y:T};let w,S;const C=M=>{f(h.value)&&(w=M,S=$C({keyframes:[h.value,p(h.value)],velocity:jC(x,M,h.value),damping:s,stiffness:r,restDelta:c,restSpeed:u}))};return C(0),{calculatedDuration:null,next:M=>{let P=!1;return!S&&w===void 0&&(P=!0,_(M),C(M)),w!==void 0&&M>w?S.next(M-w):(!P&&_(M),h)}}}const PI=e=>{const t=({timestamp:n})=>e(n);return{start:()=>zt.update(t,!0),stop:()=>is(t),now:()=>je.isProcessing?je.timestamp:performance.now()}},$b=2e4;function Ib(e){let t=0;const n=50;let i=e.next(t);for(;!i.done&&t<$b;)t+=n,i=e.next(t);return t>=$b?1/0:t}const TI={decay:jb,inertia:jb,tween:Yd,keyframes:Yd,spring:$C};function Xd({autoplay:e=!0,delay:t=0,driver:n=PI,keyframes:i,type:s="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:a="loop",onPlay:l,onStop:c,onComplete:u,onUpdate:d,...h}){let f=1,p=!1,m,v;const y=()=>{v=new Promise(V=>{m=V})};y();let g;const x=TI[s]||Yd;let _;x!==Yd&&typeof i[0]!="number"&&(_=RC([0,100],i,{clamp:!1}),i=[0,100]);const w=x({...h,keyframes:i});let S;a==="mirror"&&(S=x({...h,keyframes:[...i].reverse(),velocity:-(h.velocity||0)}));let C="idle",M=null,P=null,T=null;w.calculatedDuration===null&&r&&(w.calculatedDuration=Ib(w));const{calculatedDuration:A}=w;let E=1/0,z=1/0;A!==null&&(E=A+o,z=E*(r+1)-o);let N=0;const L=V=>{if(P===null)return;f>0&&(P=Math.min(P,V)),f<0&&(P=Math.min(V-z/f,P)),M!==null?N=M:N=Math.round(V-P)*f;const W=N-t*(f>=0?1:-1),et=f>=0?W<0:W>z;N=Math.max(W,0),C==="finished"&&M===null&&(N=z);let Z=N,O=w;if(r){const kt=Math.min(N,z)/E;let it=Math.floor(kt),Lt=kt%1;!Lt&&kt>=1&&(Lt=1),Lt===1&&it--,it=Math.min(it,r+1),!!(it%2)&&(a==="reverse"?(Lt=1-Lt,o&&(Lt-=o/E)):a==="mirror"&&(O=S)),Z=Hs(0,1,Lt)*E}const U=et?{done:!1,value:i[0]}:O.next(Z);_&&(U.value=_(U.value));let{done:lt}=U;!et&&A!==null&&(lt=f>=0?N>=z:N<=0);const ct=M===null&&(C==="finished"||C==="running"&<);return d&&d(U.value),ct&&D(),U},R=()=>{g&&g.stop(),g=void 0},B=()=>{C="idle",R(),m(),y(),P=T=null},D=()=>{C="finished",u&&u(),R(),m()},$=()=>{if(p)return;g||(g=n(L));const V=g.now();l&&l(),M!==null?P=V-M:(!P||C==="finished")&&(P=V),C==="finished"&&y(),T=P,M=null,C="running",g.start()};e&&$();const F={then(V,W){return v.then(V,W)},get time(){return Qi(N)},set time(V){V=Dr(V),N=V,M!==null||!g||f===0?M=V:P=g.now()-V/f},get duration(){const V=w.calculatedDuration===null?Ib(w):w.calculatedDuration;return Qi(V)},get speed(){return f},set speed(V){V===f||!g||(f=V,F.time=Qi(N))},get state(){return C},play:$,pause:()=>{C="paused",M=N},stop:()=>{p=!0,C!=="idle"&&(C="idle",c&&c(),B())},cancel:()=>{T!==null&&L(T),B()},complete:()=>{C="finished"},sample:V=>(P=0,L(V))};return F}function DI(e){let t;return()=>(t===void 0&&(t=e()),t)}const EI=DI(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),AI=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),du=10,OI=2e4,LI=(e,t)=>t.type==="spring"||e==="backgroundColor"||!pC(t.ease);function RI(e,t,{onUpdate:n,onComplete:i,...s}){if(!(EI()&&AI.has(t)&&!s.repeatDelay&&s.repeatType!=="mirror"&&s.damping!==0&&s.type!=="inertia"))return!1;let o=!1,a,l,c=!1;const u=()=>{l=new Promise(x=>{a=x})};u();let{keyframes:d,duration:h=300,ease:f,times:p}=s;if(LI(t,s)){const x=Xd({...s,repeat:0,delay:0});let _={done:!1,value:d[0]};const w=[];let S=0;for(;!_.done&&S{c=!1,m.cancel()},y=()=>{c=!0,zt.update(v),a(),u()};return m.onfinish=()=>{c||(e.set(H$(d,s)),i&&i(),y())},{then(x,_){return l.then(x,_)},attachTimeline(x){return m.timeline=x,m.onfinish=null,ce},get time(){return Qi(m.currentTime||0)},set time(x){m.currentTime=Dr(x)},get speed(){return m.playbackRate},set speed(x){m.playbackRate=x},get duration(){return Qi(h)},play:()=>{o||(m.play(),is(v))},pause:()=>m.pause(),stop:()=>{if(o=!0,m.playState==="idle")return;const{currentTime:x}=m;if(x){const _=Xd({...s,autoplay:!1});e.setWithVelocity(_.sample(x-du).value,_.sample(x).value,du)}y()},complete:()=>{c||m.finish()},cancel:y}}function NI({keyframes:e,delay:t,onUpdate:n,onComplete:i}){const s=()=>(n&&n(e[e.length-1]),i&&i(),{time:0,speed:1,duration:0,play:ce,pause:ce,stop:ce,then:r=>(r(),Promise.resolve()),cancel:ce,complete:ce});return t?Xd({keyframes:[0,1],duration:0,delay:t,onComplete:s}):s()}const jI={type:"spring",stiffness:500,damping:25,restSpeed:10},$I=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),II={type:"keyframes",duration:.8},FI={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},BI=(e,{keyframes:t})=>t.length>2?II:Ur.has(e)?e.startsWith("scale")?$I(t[1]):jI:FI,Rm=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Us.test(t)||t==="0")&&!t.startsWith("url(")),VI=new Set(["brightness","contrast","saturate","opacity"]);function zI(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=n.match(Ih)||[];if(!i)return e;const s=n.replace(i,"");let r=VI.has(t)?1:0;return i!==n&&(r*=100),t+"("+r+s+")"}const WI=/([a-z-]*)\(.*?\)/g,Nm={...Us,getAnimatableNone:e=>{const t=e.match(WI);return t?t.map(zI).join(" "):e}},HI={...QM,color:We,backgroundColor:We,outlineColor:We,fill:We,stroke:We,borderColor:We,borderTopColor:We,borderRightColor:We,borderBottomColor:We,borderLeftColor:We,filter:Nm,WebkitFilter:Nm},Yy=e=>HI[e];function IC(e,t){let n=Yy(e);return n!==Nm&&(n=Us),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const FC=e=>/^0[^.\s]+$/.test(e);function UI(e){if(typeof e=="number")return e===0;if(e!==null)return e==="none"||e==="0"||FC(e)}function YI(e,t,n,i){const s=Rm(t,n);let r;Array.isArray(n)?r=[...n]:r=[null,n];const o=i.from!==void 0?i.from:e.get();let a;const l=[];for(let c=0;cs=>{const r=Xy(i,e)||{},o=r.delay||i.delay||0;let{elapsed:a=0}=i;a=a-Dr(o);const l=YI(t,e,n,r),c=l[0],u=l[l.length-1],d=Rm(e,c),h=Rm(e,u);let f={keyframes:l,velocity:t.getVelocity(),ease:"easeOut",...r,delay:-a,onUpdate:p=>{t.set(p),r.onUpdate&&r.onUpdate(p)},onComplete:()=>{s(),r.onComplete&&r.onComplete()}};if(XI(r)||(f={...f,...BI(e,f)}),f.duration&&(f.duration=Dr(f.duration)),f.repeatDelay&&(f.repeatDelay=Dr(f.repeatDelay)),!d||!h||z$.current||r.type===!1||KI.skipAnimations)return NI(f);if(!i.isHandoff&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const p=RI(t,e,f);if(p)return p}return Xd(f)};function Kd(e){return!!(un(e)&&e.add)}const BC=e=>/^\-?\d*\.?\d+$/.test(e);function Gy(e,t){e.indexOf(t)===-1&&e.push(t)}function qy(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Qy{constructor(){this.subscriptions=[]}add(t){return Gy(this.subscriptions,t),()=>qy(this.subscriptions,t)}notify(t,n,i){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,i);else for(let r=0;r!isNaN(parseFloat(e));class qI{constructor(t,n={}){this.version="10.18.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(i,s=!0)=>{this.prev=this.current,this.current=i;const{delta:r,timestamp:o}=je;this.lastUpdated!==o&&(this.timeDelta=r,this.lastUpdated=o,zt.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),s&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>zt.postRender(this.velocityCheck),this.velocityCheck=({timestamp:i})=>{i!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=GI(this.current),this.owner=n.owner}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Qy);const i=this.events[t].add(n);return t==="change"?()=>{i(),zt.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,i){this.set(n),this.prev=t,this.timeDelta=i}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?NC(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Qo(e,t){return new qI(e,t)}const VC=e=>t=>t.test(e),QI={test:e=>e==="auto",parse:e=>e},zC=[Yr,st,bi,ps,s$,i$,QI],Ma=e=>zC.find(VC(e)),ZI=[...zC,We,Us],JI=e=>ZI.find(VC(e));function tF(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Qo(n))}function eF(e,t){const n=Bh(e,t);let{transitionEnd:i={},transition:s={},...r}=n?e.makeTargetAnimatable(n,!1):{};r={...r,...i};for(const o in r){const a=v$(r[o]);tF(e,o,a)}}function nF(e,t,n){var i,s;const r=Object.keys(t).filter(a=>!e.hasValue(a)),o=r.length;if(o)for(let a=0;al.remove(d))),c.push(v)}return o&&Promise.all(c).then(()=>{o&&eF(e,o)}),c}function jm(e,t,n={}){const i=Bh(e,t,n.custom);let{transition:s=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const r=i?()=>Promise.all(WC(e,i,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:u,staggerDirection:d}=s;return aF(e,t,c+l,u,d,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[l,c]=a==="beforeChildren"?[r,o]:[o,r];return l().then(()=>c())}else return Promise.all([r(),o(n.delay)])}function aF(e,t,n=0,i=0,s=1,r){const o=[],a=(e.variantChildren.size-1)*i,l=s===1?(c=0)=>c*i:(c=0)=>a-c*i;return Array.from(e.variantChildren).sort(lF).forEach((c,u)=>{c.notify("AnimationStart",t),o.push(jm(c,t,{...r,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function lF(e,t){return e.sortNodePosition(t)}function cF(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const s=t.map(r=>jm(e,r,n));i=Promise.all(s)}else if(typeof t=="string")i=jm(e,t,n);else{const s=typeof t=="function"?Bh(e,t,n.custom):t;i=Promise.all(WC(e,s,n))}return i.then(()=>e.notify("AnimationComplete",t))}const uF=[...Oy].reverse(),dF=Oy.length;function hF(e){return t=>Promise.all(t.map(({animation:n,options:i})=>cF(e,n,i)))}function fF(e){let t=hF(e);const n=mF();let i=!0;const s=(l,c)=>{const u=Bh(e,c);if(u){const{transition:d,transitionEnd:h,...f}=u;l={...l,...f,...h}}return l};function r(l){t=l(e)}function o(l,c){const u=e.getProps(),d=e.getVariantContext(!0)||{},h=[],f=new Set;let p={},m=1/0;for(let y=0;ym&&w,T=!1;const A=Array.isArray(_)?_:[_];let E=A.reduce(s,{});S===!1&&(E={});const{prevResolvedValues:z={}}=x,N={...z,...E},L=R=>{P=!0,f.has(R)&&(T=!0,f.delete(R)),x.needsAnimating[R]=!0};for(const R in N){const B=E[R],D=z[R];if(p.hasOwnProperty(R))continue;let $=!1;Hd(B)&&Hd(D)?$=!hC(B,D):$=B!==D,$?B!==void 0?L(R):f.add(R):B!==void 0&&f.has(R)?L(R):x.protectedKeys[R]=!0}x.prevProp=_,x.prevResolvedValues=E,x.isActive&&(p={...p,...E}),i&&e.blockInitialAnimation&&(P=!1),P&&(!C||T)&&h.push(...A.map(R=>({animation:R,options:{type:g,...l}})))}if(f.size){const y={};f.forEach(g=>{const x=e.getBaseTarget(g);x!==void 0&&(y[g]=x)}),h.push({animation:y})}let v=!!h.length;return i&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(v=!1),i=!1,v?t(h):Promise.resolve()}function a(l,c,u){var d;if(n[l].isActive===c)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(f=>{var p;return(p=f.animationState)===null||p===void 0?void 0:p.setActive(l,c)}),n[l].isActive=c;const h=o(u,l);for(const f in n)n[f].protectedKeys={};return h}return{animateChanges:o,setActive:a,setAnimateFunction:r,getState:()=>n}}function pF(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!hC(t,e):!1}function lr(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function mF(){return{animate:lr(!0),whileInView:lr(),whileHover:lr(),whileTap:lr(),whileDrag:lr(),whileFocus:lr(),exit:lr()}}class gF extends tr{constructor(t){super(t),t.animationState||(t.animationState=fF(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),jh(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){}}let yF=0;class vF extends tr{constructor(){super(...arguments),this.id=yF++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n,custom:i}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const r=this.node.animationState.setActive("exit",!t,{custom:i??this.node.getProps().custom});n&&!t&&r.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const xF={animation:{Feature:gF},exit:{Feature:vF}},Fb=(e,t)=>Math.abs(e-t);function bF(e,t){const n=Fb(e.x,t.x),i=Fb(e.y,t.y);return Math.sqrt(n**2+i**2)}class HC{constructor(t,n,{transformPagePoint:i,contextWindow:s,dragSnapToOrigin:r=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=tp(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,f=bF(d.offset,{x:0,y:0})>=3;if(!h&&!f)return;const{point:p}=d,{timestamp:m}=je;this.history.push({...p,timestamp:m});const{onStart:v,onMove:y}=this.handlers;h||(v&&v(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,h)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Jf(h,this.transformPagePoint),zt.update(this.updatePoint,!0)},this.handlePointerUp=(d,h)=>{this.end();const{onEnd:f,onSessionEnd:p,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=tp(d.type==="pointercancel"?this.lastMoveEventInfo:Jf(h,this.transformPagePoint),this.history);this.startEvent&&f&&f(d,v),p&&p(d,v)},!aC(t))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=i,this.contextWindow=s||window;const o=Fh(t),a=Jf(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=je;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=n;u&&u(t,tp(a,this.history)),this.removeListeners=Is(qi(this.contextWindow,"pointermove",this.handlePointerMove),qi(this.contextWindow,"pointerup",this.handlePointerUp),qi(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),is(this.updatePoint)}}function Jf(e,t){return t?{point:t(e.point)}:e}function Bb(e,t){return{x:e.x-t.x,y:e.y-t.y}}function tp({point:e},t){return{point:e,delta:Bb(e,UC(t)),offset:Bb(e,_F(t)),velocity:wF(t,.1)}}function _F(e){return e[0]}function UC(e){return e[e.length-1]}function wF(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const s=UC(e);for(;n>=0&&(i=e[n],!(s.timestamp-i.timestamp>Dr(t)));)n--;if(!i)return{x:0,y:0};const r=Qi(s.timestamp-i.timestamp);if(r===0)return{x:0,y:0};const o={x:(s.x-i.x)/r,y:(s.y-i.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function wn(e){return e.max-e.min}function $m(e,t=0,n=.01){return Math.abs(e-t)<=n}function Vb(e,t,n,i=.5){e.origin=i,e.originPoint=ee(t.min,t.max,e.origin),e.scale=wn(n)/wn(t),($m(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=ee(n.min,n.max,e.origin)-e.originPoint,($m(e.translate)||isNaN(e.translate))&&(e.translate=0)}function vl(e,t,n,i){Vb(e.x,t.x,n.x,i?i.originX:void 0),Vb(e.y,t.y,n.y,i?i.originY:void 0)}function zb(e,t,n){e.min=n.min+t.min,e.max=e.min+wn(t)}function kF(e,t,n){zb(e.x,t.x,n.x),zb(e.y,t.y,n.y)}function Wb(e,t,n){e.min=t.min-n.min,e.max=e.min+wn(t)}function xl(e,t,n){Wb(e.x,t.x,n.x),Wb(e.y,t.y,n.y)}function SF(e,{min:t,max:n},i){return t!==void 0&&en&&(e=i?ee(n,e,i.max):Math.min(e,n)),e}function Hb(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function MF(e,{top:t,left:n,bottom:i,right:s}){return{x:Hb(e.x,n,s),y:Hb(e.y,t,i)}}function Ub(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.mini?n=Ql(t.min,t.max-i,e.min):i>s&&(n=Ql(e.min,e.max-s,t.min)),Hs(0,1,n)}function TF(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Im=.35;function DF(e=Im){return e===!1?e=0:e===!0&&(e=Im),{x:Yb(e,"left","right"),y:Yb(e,"top","bottom")}}function Yb(e,t,n){return{min:Xb(e,t),max:Xb(e,n)}}function Xb(e,t){return typeof e=="number"?e:e[t]||0}const Kb=()=>({translate:0,scale:1,origin:0,originPoint:0}),ko=()=>({x:Kb(),y:Kb()}),Gb=()=>({min:0,max:0}),fe=()=>({x:Gb(),y:Gb()});function An(e){return[e("x"),e("y")]}function YC({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function EF({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function AF(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function ep(e){return e===void 0||e===1}function Fm({scale:e,scaleX:t,scaleY:n}){return!ep(e)||!ep(t)||!ep(n)}function mr(e){return Fm(e)||XC(e)||e.z||e.rotate||e.rotateX||e.rotateY}function XC(e){return qb(e.x)||qb(e.y)}function qb(e){return e&&e!=="0%"}function Gd(e,t,n){const i=e-n,s=t*i;return n+s}function Qb(e,t,n,i,s){return s!==void 0&&(e=Gd(e,s,i)),Gd(e,n,i)+t}function Bm(e,t=0,n=1,i,s){e.min=Qb(e.min,t,n,i,s),e.max=Qb(e.max,t,n,i,s)}function KC(e,{x:t,y:n}){Bm(e.x,t.translate,t.scale,t.originPoint),Bm(e.y,n.translate,n.scale,n.originPoint)}function OF(e,t,n,i=!1){const s=n.length;if(!s)return;t.x=t.y=1;let r,o;for(let a=0;a1.0000000000001||e<.999999999999?e:1}function ys(e,t){e.min=e.min+t,e.max=e.max+t}function Jb(e,t,[n,i,s]){const r=t[s]!==void 0?t[s]:.5,o=ee(e.min,e.max,r);Bm(e,t[n],t[i],o,t.scale)}const LF=["x","scaleX","originX"],RF=["y","scaleY","originY"];function So(e,t){Jb(e.x,t,LF),Jb(e.y,t,RF)}function GC(e,t){return YC(AF(e.getBoundingClientRect(),t))}function NF(e,t,n){const i=GC(e,n),{scroll:s}=t;return s&&(ys(i.x,s.offset.x),ys(i.y,s.offset.y)),i}const qC=({current:e})=>e?e.ownerDocument.defaultView:null,jF=new WeakMap;class $F{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=fe(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const s=u=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Fh(u,"page").point)},r=(u,d)=>{const{drag:h,dragPropagation:f,onDragStart:p}=this.getProps();if(h&&!f&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=cC(h),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),An(v=>{let y=this.getAxisMotionValue(v).get()||0;if(bi.test(y)){const{projection:g}=this.visualElement;if(g&&g.layout){const x=g.layout.layoutBox[v];x&&(y=wn(x)*(parseFloat(y)/100))}}this.originPoint[v]=y}),p&&zt.update(()=>p(u,d),!1,!0);const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},o=(u,d)=>{const{dragPropagation:h,dragDirectionLock:f,onDirectionLock:p,onDrag:m}=this.getProps();if(!h&&!this.openGlobalLock)return;const{offset:v}=d;if(f&&this.currentDirection===null){this.currentDirection=IF(v),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",d.point,v),this.updateAxis("y",d.point,v),this.visualElement.render(),m&&m(u,d)},a=(u,d)=>this.stop(u,d),l=()=>An(u=>{var d;return this.getAnimationState(u)==="paused"&&((d=this.getAxisMotionValue(u).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new HC(t,{onSessionStart:s,onStart:r,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:qC(this.visualElement)})}stop(t,n){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:r}=this.getProps();r&&zt.update(()=>r(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,i){const{drag:s}=this.getProps();if(!i||!hu(t,s,this.currentDirection))return;const r=this.getAxisMotionValue(t);let o=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(o=SF(o,this.constraints[t],this.elastic[t])),r.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:i}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,r=this.constraints;n&&_o(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=MF(s.layoutBox,n):this.constraints=!1,this.elastic=DF(i),r!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&An(o=>{this.getAxisMotionValue(o)&&(this.constraints[o]=TF(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!_o(t))return!1;const i=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const r=NF(i,s.root,this.visualElement.getTransformPagePoint());let o=CF(s.layout.layoutBox,r);if(n){const a=n(EF(o));this.hasMutatedConstraints=!!a,a&&(o=YC(a))}return o}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:s,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=An(u=>{if(!hu(u,n,this.currentDirection))return;let d=l&&l[u]||{};o&&(d={min:0,max:0});const h=s?200:1e6,f=s?40:1e7,p={type:"inertia",velocity:i?t[u]:0,bounceStiffness:h,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...r,...d};return this.startAxisValueAnimation(u,p)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const i=this.getAxisMotionValue(t);return i.start(Ky(t,i,0,n))}stopAnimation(){An(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){An(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n="_drag"+t.toUpperCase(),i=this.visualElement.getProps(),s=i[n];return s||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){An(n=>{const{drag:i}=this.getProps();if(!hu(n,i,this.currentDirection))return;const{projection:s}=this.visualElement,r=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n];r.set(t[n]-ee(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!_o(n)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};An(o=>{const a=this.getAxisMotionValue(o);if(a){const l=a.get();s[o]=PF({min:l,max:l},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),An(o=>{if(!hu(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(ee(l,c,s[o]))})}addListeners(){if(!this.visualElement.current)return;jF.set(this.visualElement,this);const t=this.visualElement.current,n=qi(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),i=()=>{const{dragConstraints:l}=this.getProps();_o(l)&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,r=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),i();const o=Hi(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(An(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())});return()=>{o(),n(),r(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:s=!1,dragConstraints:r=!1,dragElastic:o=Im,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:s,dragConstraints:r,dragElastic:o,dragMomentum:a}}}function hu(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function IF(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class FF extends tr{constructor(t){super(t),this.removeGroupControls=ce,this.removeListeners=ce,this.controls=new $F(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ce}unmount(){this.removeGroupControls(),this.removeListeners()}}const t1=e=>(t,n)=>{e&&zt.update(()=>e(t,n))};class BF extends tr{constructor(){super(...arguments),this.removePointerDownListener=ce}onPointerDown(t){this.session=new HC(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:qC(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:s}=this.node.getProps();return{onSessionStart:t1(t),onStart:t1(n),onMove:i,onEnd:(r,o)=>{delete this.session,s&&zt.update(()=>s(r,o))}}}mount(){this.removePointerDownListener=qi(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function VF(){const e=k.useContext(Rh);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:i}=e,s=k.useId();return k.useEffect(()=>i(s),[]),!t&&n?[!1,()=>n&&n(s)]:[!0]}const nd={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function e1(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Ca={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(st.test(e))e=parseFloat(e);else return e;const n=e1(e,t.target.x),i=e1(e,t.target.y);return`${n}% ${i}%`}},zF={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,s=Us.parse(e);if(s.length>5)return i;const r=Us.createTransformer(e),o=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;s[0+o]/=a,s[1+o]/=l;const c=ee(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=c),typeof s[3+o]=="number"&&(s[3+o]/=c),r(s)}};class WF extends Y.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i,layoutId:s}=this.props,{projection:r}=t;qj(HF),r&&(n.group&&n.group.add(r),i&&i.register&&s&&i.register(r),r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),nd.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:i,drag:s,isPresent:r}=this.props,o=i.projection;return o&&(o.isPresent=r,s||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==r&&(r?o.promote():o.relegate()||zt.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),queueMicrotask(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),i&&i.deregister&&i.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function QC(e){const[t,n]=VF(),i=k.useContext(Ry);return Y.createElement(WF,{...e,layoutGroup:i,switchLayoutGroup:k.useContext(YM),isPresent:t,safeToRemove:n})}const HF={borderRadius:{...Ca,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ca,borderTopRightRadius:Ca,borderBottomLeftRadius:Ca,borderBottomRightRadius:Ca,boxShadow:zF},ZC=["TopLeft","TopRight","BottomLeft","BottomRight"],UF=ZC.length,n1=e=>typeof e=="string"?parseFloat(e):e,i1=e=>typeof e=="number"||st.test(e);function YF(e,t,n,i,s,r){s?(e.opacity=ee(0,n.opacity!==void 0?n.opacity:1,XF(i)),e.opacityExit=ee(t.opacity!==void 0?t.opacity:1,0,KF(i))):r&&(e.opacity=ee(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,i));for(let o=0;oit?1:n(Ql(e,t,i))}function r1(e,t){e.min=t.min,e.max=t.max}function Dn(e,t){r1(e.x,t.x),r1(e.y,t.y)}function o1(e,t,n,i,s){return e-=t,e=Gd(e,1/n,i),s!==void 0&&(e=Gd(e,1/s,i)),e}function GF(e,t=0,n=1,i=.5,s,r=e,o=e){if(bi.test(t)&&(t=parseFloat(t),t=ee(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=ee(r.min,r.max,i);e===r&&(a-=t),e.min=o1(e.min,t,n,a,s),e.max=o1(e.max,t,n,a,s)}function a1(e,t,[n,i,s],r,o){GF(e,t[n],t[i],t[s],t.scale,r,o)}const qF=["x","scaleX","originX"],QF=["y","scaleY","originY"];function l1(e,t,n,i){a1(e.x,t,qF,n?n.x:void 0,i?i.x:void 0),a1(e.y,t,QF,n?n.y:void 0,i?i.y:void 0)}function c1(e){return e.translate===0&&e.scale===1}function tP(e){return c1(e.x)&&c1(e.y)}function ZF(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function eP(e,t){return Math.round(e.x.min)===Math.round(t.x.min)&&Math.round(e.x.max)===Math.round(t.x.max)&&Math.round(e.y.min)===Math.round(t.y.min)&&Math.round(e.y.max)===Math.round(t.y.max)}function u1(e){return wn(e.x)/wn(e.y)}class JF{constructor(){this.members=[]}add(t){Gy(this.members,t),t.scheduleRender()}remove(t){if(qy(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let i;for(let s=n;s>=0;s--){const r=this.members[s];if(r.isPresent!==!1){i=r;break}}return i?(this.promote(i),!0):!1}promote(t,n){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,n&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:i}=t;n.onExitComplete&&n.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function d1(e,t,n){let i="";const s=e.x.translate/t.x,r=e.y.translate/t.y;if((s||r)&&(i=`translate3d(${s}px, ${r}px, 0) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:l,rotateX:c,rotateY:u}=n;l&&(i+=`rotate(${l}deg) `),c&&(i+=`rotateX(${c}deg) `),u&&(i+=`rotateY(${u}deg) `)}const o=e.x.scale*t.x,a=e.y.scale*t.y;return(o!==1||a!==1)&&(i+=`scale(${o}, ${a})`),i||"none"}const tB=(e,t)=>e.depth-t.depth;class eB{constructor(){this.children=[],this.isDirty=!1}add(t){Gy(this.children,t),this.isDirty=!0}remove(t){qy(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(tB),this.isDirty=!1,this.children.forEach(t)}}function nB(e,t){const n=performance.now(),i=({timestamp:s})=>{const r=s-n;r>=t&&(is(i),e(r-t))};return zt.read(i,!0),()=>is(i)}function iB(e){window.MotionDebug&&window.MotionDebug.record(e)}function sB(e){return e instanceof SVGElement&&e.tagName!=="svg"}function rB(e,t,n){const i=un(e)?e:Qo(e);return i.start(Ky("",i,t,n)),i.animation}const h1=["","X","Y","Z"],oB={visibility:"hidden"},f1=1e3;let aB=0;const gr={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function nP({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(o={},a=t==null?void 0:t()){this.id=aB++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,gr.totalNodes=gr.resolvedTargetDeltas=gr.recalculatedProjection=0,this.nodes.forEach(uB),this.nodes.forEach(mB),this.nodes.forEach(gB),this.nodes.forEach(dB),iB(gr)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=nB(h,250),nd.hasAnimatedSinceResize&&(nd.hasAnimatedSinceResize=!1,this.nodes.forEach(m1))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeTargetChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||u.getDefaultTransition()||_B,{onLayoutAnimationStart:v,onLayoutAnimationComplete:y}=u.getProps(),g=!this.targetLayout||!eP(this.targetLayout,p)||f,x=!h&&f;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||h&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,x);const _={...Xy(m,"layout"),onPlay:v,onComplete:y};(u.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_)}else h||m1(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,is(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(yB),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;uthis.update()))}clearAllSnapshots(){this.nodes.forEach(hB),this.sharedNodes.forEach(vB)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,zt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){zt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const w=_/1e3;g1(d.x,o.x,w),g1(d.y,o.y,w),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(xl(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),xB(this.relativeTarget,this.relativeTargetOrigin,h,w),x&&ZF(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=fe()),Dn(x,this.relativeTarget)),m&&(this.animationValues=u,YF(u,c,this.latestValues,w,g,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(is(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=zt.update(()=>{nd.hasAnimatedSinceResize=!0,this.currentAnimation=rB(0,f1,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(f1),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&iP(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||fe();const d=wn(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+d;const h=wn(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}Dn(a,l),So(a,u),vl(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new JF),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(a=!0),!a)return;const c={};for(let u=0;u{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(p1),this.root.sharedNodes.clear()}}}function lB(e){e.updateLayout()}function cB(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:s}=e.layout,{animationType:r}=e.options,o=n.source!==e.layout.source;r==="size"?An(d=>{const h=o?n.measuredBox[d]:n.layoutBox[d],f=wn(h);h.min=i[d].min,h.max=h.min+f}):iP(r,n.layoutBox,i)&&An(d=>{const h=o?n.measuredBox[d]:n.layoutBox[d],f=wn(i[d]);h.max=h.min+f,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+f)});const a=ko();vl(a,i,n.layoutBox);const l=ko();o?vl(l,e.applyTransform(s,!0),n.measuredBox):vl(l,i,n.layoutBox);const c=!tP(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:h,layout:f}=d;if(h&&f){const p=fe();xl(p,n.layoutBox,h.layoutBox);const m=fe();xl(m,i,f.layoutBox),eP(p,m)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=p,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:i,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeTargetChanged:u})}else if(e.isLead()){const{onExitComplete:i}=e.options;i&&i()}e.options.transition=void 0}function uB(e){gr.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function dB(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function hB(e){e.clearSnapshot()}function p1(e){e.clearMeasurements()}function fB(e){e.isLayoutDirty=!1}function pB(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function m1(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function mB(e){e.resolveTargetDelta()}function gB(e){e.calcProjection()}function yB(e){e.resetRotation()}function vB(e){e.removeLeadSnapshot()}function g1(e,t,n){e.translate=ee(t.translate,0,n),e.scale=ee(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function y1(e,t,n,i){e.min=ee(t.min,n.min,i),e.max=ee(t.max,n.max,i)}function xB(e,t,n,i){y1(e.x,t.x,n.x,i),y1(e.y,t.y,n.y,i)}function bB(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const _B={duration:.45,ease:[.4,0,.1,1]},v1=e=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(e),x1=v1("applewebkit/")&&!v1("chrome/")?Math.round:ce;function b1(e){e.min=x1(e.min),e.max=x1(e.max)}function wB(e){b1(e.x),b1(e.y)}function iP(e,t,n){return e==="position"||e==="preserve-aspect"&&!$m(u1(t),u1(n),.2)}const kB=nP({attachResizeListener:(e,t)=>Hi(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),np={current:void 0},sP=nP({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!np.current){const e=new kB({});e.mount(window),e.setOptions({layoutScroll:!0}),np.current=e}return np.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),SB={pan:{Feature:BF},drag:{Feature:FF,ProjectionNode:sP,MeasureLayout:QC}},MB=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function CB(e){const t=MB.exec(e);if(!t)return[,];const[,n,i]=t;return[n,i]}function Vm(e,t,n=1){const[i,s]=CB(e);if(!i)return;const r=window.getComputedStyle(t).getPropertyValue(i);if(r){const o=r.trim();return BC(o)?parseFloat(o):o}else return Em(s)?Vm(s,t,n+1):s}function PB(e,{...t},n){const i=e.current;if(!(i instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(s=>{const r=s.get();if(!Em(r))return;const o=Vm(r,i);o&&s.set(o)});for(const s in t){const r=t[s];if(!Em(r))continue;const o=Vm(r,i);o&&(t[s]=o,n||(n={}),n[s]===void 0&&(n[s]=r))}return{target:t,transitionEnd:n}}const TB=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),rP=e=>TB.has(e),DB=e=>Object.keys(e).some(rP),_1=e=>e===Yr||e===st,w1=(e,t)=>parseFloat(e.split(", ")[t]),k1=(e,t)=>(n,{transform:i})=>{if(i==="none"||!i)return 0;const s=i.match(/^matrix3d\((.+)\)$/);if(s)return w1(s[1],t);{const r=i.match(/^matrix\((.+)\)$/);return r?w1(r[1],e):0}},EB=new Set(["x","y","z"]),AB=yc.filter(e=>!EB.has(e));function OB(e){const t=[];return AB.forEach(n=>{const i=e.getValue(n);i!==void 0&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const Zo={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:k1(4,13),y:k1(5,14)};Zo.translateX=Zo.x;Zo.translateY=Zo.y;const LB=(e,t,n)=>{const i=t.measureViewportBox(),s=t.current,r=getComputedStyle(s),{display:o}=r,a={};o==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(c=>{a[c]=Zo[c](i,r)}),t.render();const l=t.measureViewportBox();return n.forEach(c=>{const u=t.getValue(c);u&&u.jump(a[c]),e[c]=Zo[c](l,r)}),e},RB=(e,t,n={},i={})=>{t={...t},i={...i};const s=Object.keys(t).filter(rP);let r=[],o=!1;const a=[];if(s.forEach(l=>{const c=e.getValue(l);if(!e.hasValue(l))return;let u=n[l],d=Ma(u);const h=t[l];let f;if(Hd(h)){const p=h.length,m=h[0]===null?1:0;u=h[m],d=Ma(u);for(let v=m;v=0?window.pageYOffset:null,c=LB(t,e,a);return r.length&&r.forEach(([u,d])=>{e.getValue(u).set(d)}),e.render(),Nh&&l!==null&&window.scrollTo({top:l}),{target:c,transitionEnd:i}}else return{target:t,transitionEnd:i}};function NB(e,t,n,i){return DB(t)?RB(e,t,n,i):{target:t,transitionEnd:i}}const jB=(e,t,n,i)=>{const s=PB(e,t,i);return t=s.target,i=s.transitionEnd,NB(e,t,n,i)},zm={current:null},oP={current:!1};function $B(){if(oP.current=!0,!!Nh)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>zm.current=e.matches;e.addListener(t),t()}else zm.current=!1}function IB(e,t,n){const{willChange:i}=t;for(const s in t){const r=t[s],o=n[s];if(un(r))e.addValue(s,r),Kd(i)&&i.add(s);else if(un(o))e.addValue(s,Qo(r,{owner:e})),Kd(i)&&i.remove(s);else if(o!==r)if(e.hasValue(s)){const a=e.getValue(s);!a.hasAnimated&&a.set(r)}else{const a=e.getStaticValue(s);e.addValue(s,Qo(a!==void 0?a:r,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const S1=new WeakMap,aP=Object.keys(ql),FB=aP.length,M1=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],BB=Ly.length;class VB{constructor({parent:t,props:n,presenceContext:i,reducedMotionConfig:s,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>zt.render(this.render,!1,!0);const{latestValues:a,renderState:l}=r;this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=o,this.isControllingVariants=$h(n),this.isVariantNode=UM(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:c,...u}=this.scrapeMotionValuesFromProps(n,{});for(const d in u){const h=u[d];a[d]!==void 0&&un(h)&&(h.set(a[d],!1),Kd(c)&&c.add(d))}}scrapeMotionValuesFromProps(t,n){return{}}mount(t){this.current=t,S1.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,i)=>this.bindToMotionValue(i,n)),oP.current||$B(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:zm.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){S1.delete(this.current),this.projection&&this.projection.unmount(),is(this.notifyUpdate),is(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,n){const i=Ur.has(t),s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&zt.update(this.notifyUpdate,!1,!0),i&&this.projection&&(this.projection.isTransformDirty=!0)}),r=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{s(),r()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures({children:t,...n},i,s,r){let o,a;for(let l=0;lthis.scheduleRender(),animationType:typeof c=="string"?c:"both",initialPromotionConfig:r,layoutScroll:h,layoutRoot:f})}return a}updateFeatures(){for(const t in this.features){const n=this.features[t];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):fe()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;in.variantChildren.delete(t)}addValue(t,n){n!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,n)),this.values.set(t,n),this.latestValues[t]=n.get()}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return i===void 0&&n!==void 0&&(i=Qo(n,{owner:this}),this.addValue(t,i)),i}readValue(t){var n;return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(n=this.getBaseTargetFromProps(this.props,t))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:i}=this.props,s=typeof i=="string"||typeof i=="object"?(n=Vy(this.props,i))===null||n===void 0?void 0:n[t]:void 0;if(i&&s!==void 0)return s;const r=this.getBaseTargetFromProps(this.props,t);return r!==void 0&&!un(r)?r:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Qy),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class lP extends VB{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:i}){delete n[t],delete i[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...i},{transformValues:s},r){let o=sF(i,t||{},this);if(s&&(n&&(n=s(n)),i&&(i=s(i)),o&&(o=s(o))),r){nF(this,i,o);const a=jB(this,i,o,n);n=a.transitionEnd,i=a.target}return{transition:t,transitionEnd:n,...i}}}function zB(e){return window.getComputedStyle(e)}class WB extends lP{constructor(){super(...arguments),this.type="html"}readValueFromInstance(t,n){if(Ur.has(n)){const i=Yy(n);return i&&i.default||0}else{const i=zB(t),s=(GM(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return GC(t,n)}build(t,n,i,s){jy(t,n,i,s.transformTemplate)}scrapeMotionValuesFromProps(t,n){return By(t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;un(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(t,n,i,s){eC(t,n,i,s)}}class HB extends lP{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ur.has(n)){const i=Yy(n);return i&&i.default||0}return n=nC.has(n)?n:Ay(n),t.getAttribute(n)}measureInstanceViewportBox(){return fe()}scrapeMotionValuesFromProps(t,n){return sC(t,n)}build(t,n,i,s){Iy(t,n,i,this.isSVGTag,s.transformTemplate)}renderInstance(t,n,i,s){iC(t,n,i,s)}mount(t){this.isSVGTag=Fy(t.tagName),super.mount(t)}}const UB=(e,t)=>Ny(e)?new HB(t,{enableHardwareAcceleration:!1}):new WB(t,{enableHardwareAcceleration:!0}),YB={layout:{ProjectionNode:sP,MeasureLayout:QC}},XB={...xF,...F$,...SB,...YB},Jo=Kj((e,t)=>C$(e,t,XB,UB));function cP(){const e=k.useRef(!1);return Ey(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function KB(){const e=cP(),[t,n]=k.useState(0),i=k.useCallback(()=>{e.current&&n(t+1)},[t]);return[k.useCallback(()=>zt.postRender(i),[i]),t]}class GB extends k.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function qB({children:e,isPresent:t}){const n=k.useId(),i=k.useRef(null),s=k.useRef({width:0,height:0,top:0,left:0});return k.useInsertionEffect(()=>{const{width:r,height:o,top:a,left:l}=s.current;if(t||!i.current||!r||!o)return;i.current.dataset.motionPopId=n;const c=document.createElement("style");return document.head.appendChild(c),c.sheet&&c.sheet.insertRule(` +`):e}function WR(e,t){const{element:n,datasetIndex:i,index:s}=t,r=e.getDatasetMeta(i).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:e,label:o,parsed:r.getParsed(s),raw:e.data.datasets[i].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:n}}function qx(e,t){const n=e.chart.ctx,{body:i,footer:s,title:r}=e,{boxWidth:o,boxHeight:a}=t,l=ge(t.bodyFont),c=ge(t.titleFont),u=ge(t.footerFont),d=r.length,h=s.length,f=i.length,p=Ae(t.padding);let m=p.height,v=0,y=i.reduce((_,w)=>_+w.before.length+w.lines.length+w.after.length,0);if(y+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),y){const _=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=f*_+(y-f)*l.lineHeight+(y-1)*t.bodySpacing}h&&(m+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let g=0;const x=function(_){v=Math.max(v,n.measureText(_).width+g)};return n.save(),n.font=c.string,Et(e.title,x),n.font=l.string,Et(e.beforeBody.concat(e.afterBody),x),g=t.displayColors?o+2+t.boxPadding:0,Et(i,_=>{Et(_.before,x),Et(_.lines,x),Et(_.after,x)}),g=0,n.font=u.string,Et(e.footer,x),n.restore(),v+=p.width,{width:v,height:m}}function HR(e,t){const{y:n,height:i}=t;return ne.height-i/2?"bottom":"center"}function UR(e,t,n,i){const{x:s,width:r}=i,o=n.caretSize+n.caretPadding;if(e==="left"&&s+r+o>t.width||e==="right"&&s-r-o<0)return!0}function YR(e,t,n,i){const{x:s,width:r}=n,{width:o,chartArea:{left:a,right:l}}=e;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),UR(c,e,t,n)&&(c="center"),c}function Qx(e,t,n){const i=n.yAlign||t.yAlign||HR(e,n);return{xAlign:n.xAlign||t.xAlign||YR(e,t,n,i),yAlign:i}}function XR(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function KR(e,t,n){let{y:i,height:s}=e;return t==="top"?i+=n:t==="bottom"?i-=s+n:i-=s/2,i}function Zx(e,t,n,i){const{caretSize:s,caretPadding:r,cornerRadius:o}=e,{xAlign:a,yAlign:l}=n,c=s+r,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:f}=Cr(o);let p=XR(t,a);const m=KR(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,h)+s:a==="right"&&(p+=Math.max(d,f)+s),{x:we(p,0,i.width-t.width),y:we(m,0,i.height-t.height)}}function ou(e,t,n){const i=Ae(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function Jx(e){return ci([],Oi(e))}function GR(e,t,n){return Qs(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function tb(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const EM={beforeTitle:Di,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex"u"?EM[t].call(n,i):s}var kp;let eb=(kp=class extends os{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,i=this.options.setContext(this.getContext()),s=i.enabled&&n.options.animation&&i.animations,r=new sM(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=GR(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,s=qe(i,"beforeTitle",this,t),r=qe(i,"title",this,t),o=qe(i,"afterTitle",this,t);let a=[];return a=ci(a,Oi(s)),a=ci(a,Oi(r)),a=ci(a,Oi(o)),a}getBeforeBody(t,n){return Jx(qe(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,s=[];return Et(t,r=>{const o={before:[],lines:[],after:[]},a=tb(i,r);ci(o.before,Oi(qe(a,"beforeLabel",this,r))),ci(o.lines,qe(a,"label",this,r)),ci(o.after,Oi(qe(a,"afterLabel",this,r))),s.push(o)}),s}getAfterBody(t,n){return Jx(qe(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,s=qe(i,"beforeFooter",this,t),r=qe(i,"footer",this,t),o=qe(i,"afterFooter",this,t);let a=[];return a=ci(a,Oi(s)),a=ci(a,Oi(r)),a=ci(a,Oi(o)),a}_createItems(t){const n=this._active,i=this.chart.data,s=[],r=[],o=[];let a=[],l,c;for(l=0,c=n.length;lt.filter(u,d,h,i))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,i))),Et(a,u=>{const d=tb(t.callbacks,u);s.push(qe(d,"labelColor",this,u)),r.push(qe(d,"labelPointStyle",this,u)),o.push(qe(d,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,n){const i=this.options.setContext(this.getContext()),s=this._active;let r,o=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const a=qa[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const l=this._size=qx(this,i),c=Object.assign({},a,l),u=Qx(this.chart,i,c),d=Zx(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,s){const r=this.getCaretPosition(t,i,s);n.lineTo(r.x1,r.y1),n.lineTo(r.x2,r.y2),n.lineTo(r.x3,r.y3)}getCaretPosition(t,n,i){const{xAlign:s,yAlign:r}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=Cr(a),{x:h,y:f}=t,{width:p,height:m}=n;let v,y,g,x,_,w;return r==="center"?(_=f+m/2,s==="left"?(v=h,y=v-o,x=_+o,w=_-o):(v=h+p,y=v+o,x=_-o,w=_+o),g=v):(s==="left"?y=h+Math.max(l,u)+o:s==="right"?y=h+p-Math.max(c,d)-o:y=this.caretX,r==="top"?(x=f,_=x-o,v=y-o,g=y+o):(x=f+m,_=x+o,v=y+o,g=y-o),w=x),{x1:v,x2:y,x3:g,y1:x,y2:_,y3:w}}drawTitle(t,n,i){const s=this.title,r=s.length;let o,a,l;if(r){const c=Oo(i.rtl,this.x,this.width);for(t.x=ou(this,i.titleAlign,i),n.textAlign=c.textAlign(i.titleAlign),n.textBaseline="middle",o=ge(i.titleFont),a=i.titleSpacing,n.fillStyle=i.titleColor,n.font=o.string,l=0;lg!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Hl(t,{x:m,y:p,w:c,h:l,radius:y}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Hl(t,{x:v,y:p+1,w:c-2,h:l-2,radius:y}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(m,p,c,l),t.strokeRect(m,p,c,l),t.fillStyle=o.backgroundColor,t.fillRect(v,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=ge(i.bodyFont);let h=d.lineHeight,f=0;const p=Oo(i.rtl,this.x,this.width),m=function(M){n.fillText(M,p.x(t.x+f),t.y+h/2),t.y+=h+r},v=p.textAlign(o);let y,g,x,_,w,S,C;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,t.x=ou(this,v,i),n.fillStyle=i.bodyColor,Et(this.beforeBody,m),f=a&&v!=="right"?o==="center"?c/2+u:c+2+u:0,_=0,S=s.length;_0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const o=qa[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=qx(this,t),l=Object.assign({},o,this._size),c=Qx(n,t,l),u=Zx(t,l,c,n);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Ae(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=i,this.drawBackground(r,t,s,n),JS(t,n.textDirection),r.y+=o.top,this.drawTitle(r,t,n),this.drawBody(r,t,n),this.drawFooter(r,t,n),tM(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!Ld(i,s),o=this._positionChanged(s,n);(r||o)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],o=this._getActiveElements(t,r,n,i),a=this._positionChanged(o,t),l=n||!Ld(o,r)||a;return l&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,i,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)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,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:i,caretY:s,options:r}=this,o=qa[r.position].call(this,t,n);return o!==!1&&(i!==o.x||s!==o.y)}},K(kp,"positioners",qa),kp);var qR={id:"tooltip",_element:eb,positioners:qa,afterInit(e,t,n){n&&(e.tooltip=new eb({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:EM},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"]},QR=Object.freeze({__proto__:null,Colors:cR,Decimation:fR,Filler:LR,Legend:FR,SubTitle:zR,Title:VR,Tooltip:qR});const ZR=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function JR(e,t,n,i){const s=e.indexOf(t);if(s===-1)return ZR(e,t,n,i);const r=e.lastIndexOf(t);return s!==r?n:s}const tN=(e,t)=>e===null?null:we(Math.round(e),0,t);function nb(e){const t=this.getLabels();return e>=0&&en.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}},K(Ru,"id","category"),K(Ru,"defaults",{ticks:{callback:nb}}),Ru);function nN(e,t){const n=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=e,f=r||1,p=u-1,{min:m,max:v}=t,y=!bt(o),g=!bt(a),x=!bt(c),_=(v-m)/(d+1);let w=Gv((v-m)/p/f)*f,S,C,M,P;if(w<1e-14&&!y&&!g)return[{value:m},{value:v}];P=Math.ceil(v/w)-Math.floor(m/w),P>p&&(w=Gv(P*w/p/f)*f),bt(l)||(S=Math.pow(10,l),w=Math.ceil(w*S)/S),s==="ticks"?(C=Math.floor(m/w)*w,M=Math.ceil(v/w)*w):(C=m,M=v),y&&g&&r&&WA((a-o)/r,w/1e3)?(P=Math.round(Math.min((a-o)/w,u)),w=(a-o)/P,C=o,M=a):x?(C=y?o:C,M=g?a:M,P=c-1,w=(M-C)/P):(P=(M-C)/w,dl(P,Math.round(P),w/1e3)?P=Math.round(P):P=Math.ceil(P));const T=Math.max(qv(w),qv(C));S=Math.pow(10,bt(l)?T:l),C=Math.round(C*S)/S,M=Math.round(M*S)/S;let A=0;for(y&&(h&&C!==o?(n.push({value:o}),Ca)break;n.push({value:E})}return g&&h&&M!==a?n.length&&dl(n[n.length-1].value,a,ib(a,_,e))?n[n.length-1].value=a:n.push({value:a}):(!g||M===a)&&n.push({value:M}),n}function ib(e,t,{horizontal:n,minRotation:i}){const s=Jn(i),r=(n?Math.sin(s):Math.cos(s))||.001,o=.75*t*(""+e).length;return Math.min(t/r,o)}let Bd=class extends pc{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 bt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:s,max:r}=this;const o=l=>s=n?s:l,a=l=>r=i?r:l;if(t){const l=vi(s),c=vi(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(s===r){let l=r===0?1:Math.abs(r*.05);a(r+l),t||o(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},r=this._range||this,o=nN(s,r);return t.bounds==="ticks"&&jS(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,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-n)/Math.max(t.length-1,1)/2;n-=s,i+=s}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return hc(t,this.chart.options.locale,this.options.ticks.format)}};var Nu;let iN=(Nu=class extends Bd{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=oe(t)?t:0,this.max=oe(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=Jn(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}},K(Nu,"id","linear"),K(Nu,"defaults",{ticks:{callback:Mh.formatters.numeric}}),Nu);const Yl=e=>Math.floor(Ss(e)),ar=(e,t)=>Math.pow(10,Yl(e)+t);function sb(e){return e/Math.pow(10,Yl(e))===1}function rb(e,t,n){const i=Math.pow(10,n),s=Math.floor(e/i);return Math.ceil(t/i)-s}function sN(e,t){const n=t-e;let i=Yl(n);for(;rb(e,t,i)>10;)i++;for(;rb(e,t,i)<10;)i--;return Math.min(i,Yl(e))}function rN(e,{min:t,max:n}){t=mn(e.min,t);const i=[],s=Yl(t);let r=sN(t,n),o=r<0?Math.pow(10,Math.abs(r)):1;const a=Math.pow(10,r),l=s>r?Math.pow(10,s):0,c=Math.round((t-l)*o)/o,u=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((c-u)/Math.pow(10,r)),h=mn(e.min,Math.round((l+u+d*Math.pow(10,r))*o)/o);for(;h=10?d=d<15?15:20:d++,d>=20&&(r++,d=2,o=r>=0?1:o),h=Math.round((l+u+d*Math.pow(10,r))*o)/o;const f=mn(e.max,h);return i.push({value:f,major:sb(f),significand:d}),i}var ju;let oN=(ju=class extends pc{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const i=Bd.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return oe(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=oe(t)?Math.max(0,t):null,this.max=oe(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!oe(this._userMin)&&(this.min=t===ar(this.min,0)?ar(this.min,-1):ar(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let i=this.min,s=this.max;const r=a=>i=t?i:a,o=a=>s=n?s:a;i===s&&(i<=0?(r(1),o(10)):(r(ar(i,-1)),o(ar(s,1)))),i<=0&&r(ar(s,-1)),s<=0&&o(ar(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},i=rN(n,this);return t.bounds==="ticks"&&jS(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":hc(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ss(t),this._valueRange=Ss(this.max)-Ss(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ss(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}},K(ju,"id","logarithmic"),K(ju,"defaults",{ticks:{callback:Mh.formatters.logarithmic,major:{enabled:!0}}}),ju);function Pm(e){const t=e.ticks;if(t.display&&e.display){const n=Ae(t.backdropPadding);return at(t.font&&t.font.size,ne.font.size)+n.height}return 0}function aN(e,t,n){return n=Ut(n)?n:[n],{w:oO(e,t.string,n),h:n.length*t.lineHeight}}function ob(e,t,n,i,s){return e===i||e===s?{start:t-n/2,end:t+n/2}:es?{start:t-n,end:t}:{start:t,end:t+n}}function lN(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),i=[],s=[],r=e._pointLabels.length,o=e.options.pointLabels,a=o.centerPointLabels?Kt/r:0;for(let l=0;lt.r&&(a=(i.end-t.r)/r,e.r=Math.max(e.r,t.r+a)),s.startt.b&&(l=(s.end-t.b)/o,e.b=Math.max(e.b,t.b+l))}function uN(e,t,n){const i=e.drawingArea,{extra:s,additionalAngle:r,padding:o,size:a}=n,l=e.getPointPosition(t,i+s+o,r),c=Math.round(ly(yn(l.angle+ue))),u=mN(l.y,a.h,c),d=fN(c),h=pN(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+a.w,bottom:u+a.h}}function dN(e,t){if(!t)return!0;const{left:n,top:i,right:s,bottom:r}=e;return!(Wi({x:n,y:i},t)||Wi({x:n,y:r},t)||Wi({x:s,y:i},t)||Wi({x:s,y:r},t))}function hN(e,t,n){const i=[],s=e._pointLabels.length,r=e.options,{centerPointLabels:o,display:a}=r.pointLabels,l={extra:Pm(r)/2,additionalAngle:o?Kt/s:0};let c;for(let u=0;u270||n<90)&&(e-=t),e}function gN(e,t,n){const{left:i,top:s,right:r,bottom:o}=n,{backdropColor:a}=t;if(!bt(a)){const l=Cr(t.borderRadius),c=Ae(t.backdropPadding);e.fillStyle=a;const u=i-c.left,d=s-c.top,h=r-i+c.width,f=o-s+c.height;Object.values(l).some(p=>p!==0)?(e.beginPath(),Hl(e,{x:u,y:d,w:h,h:f,radius:l}),e.fill()):e.fillRect(u,d,h,f)}}function yN(e,t){const{ctx:n,options:{pointLabels:i}}=e;for(let s=t-1;s>=0;s--){const r=e._pointLabelItems[s];if(!r.visible)continue;const o=i.setContext(e.getPointLabelContext(s));gN(n,o,r);const a=ge(o.font),{x:l,y:c,textAlign:u}=r;Br(n,e._pointLabels[s],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function AM(e,t,n,i){const{ctx:s}=e;if(n)s.arc(e.xCenter,e.yCenter,t,0,Xt);else{let r=e.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let o=1;o{const s=$t(this.options.pointLabels.callback,[n,i],this);return s||s===0?s:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?lN(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,s){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,s))}getIndexAngle(t){const n=Xt/(this._pointLabels.length||1),i=this.options.startAngle||0;return yn(t*n+Jn(i))}getDistanceFromCenterForValue(t){if(bt(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(bt(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{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(d),f=s.setContext(h),p=r.setContext(h);vN(this,f,l,o,p)}}),i.display){for(t.save(),a=o-1;a>=0;a--){const u=i.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:h}=u;!h||!d||(t.lineWidth=h,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.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,i=n.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=i.setContext(this.getContext(l)),u=ge(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=Ae(c.backdropPadding);t.fillRect(-o/2-d.left,-r-u.size/2-d.top,o+d.width,u.size+d.height)}Br(t,a.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}},K(ro,"id","radialLinear"),K(ro,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Mh.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),K(ro,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),K(ro,"descriptors",{angleLines:{_fallback:"grid"}}),ro);const Eh={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}},tn=Object.keys(Eh);function ab(e,t){return e-t}function lb(e,t){if(bt(t))return null;const n=e._adapter,{parser:i,round:s,isoWeekday:r}=e._parseOpts;let o=t;return typeof i=="function"&&(o=i(o)),oe(o)||(o=typeof i=="string"?n.parse(o,i):n.parse(o)),o===null?null:(s&&(o=s==="week"&&(Wo(r)||r===!0)?n.startOf(o,"isoWeek",r):n.startOf(o,s)),+o)}function cb(e,t,n,i){const s=tn.length;for(let r=tn.indexOf(e);r=tn.indexOf(n);r--){const o=tn[r];if(Eh[o].common&&e._adapter.diff(s,i,o)>=t-1)return o}return tn[n?tn.indexOf(n):0]}function wN(e){for(let t=tn.indexOf(e)+1,n=tn.length;t=t?n[i]:n[s];e[r]=!0}}function kN(e,t,n,i){const s=e._adapter,r=+s.startOf(t[0].value,i),o=t[t.length-1].value;let a,l;for(a=r;a<=o;a=+s.add(a,1,i))l=n[a],l>=0&&(t[l].major=!0);return t}function db(e,t,n){const i=[],s={},r=t.length;let o,a;for(o=0;o+t.value))}initOffsets(t=[]){let n=0,i=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=we(n,0,o),i=we(i,0,o),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,s=this.options,r=s.time,o=r.unit||cb(r.minUnit,n,i,this._getLabelCapacity(n)),a=at(s.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=Wo(l)||l===!0,u={};let d=n,h,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":o),t.diff(i,n,o)>1e5*a)throw new Error(n+" and "+i+" are too far apart with stepSize of "+a+" "+o);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(h=d,f=0;h+m)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){const s=this.options.time.displayFormats,r=this._unit,o=n||s[r];return this._adapter.format(t,o)}_tickFormatFunction(t,n,i,s){const r=this.options,o=r.ticks.callback;if(o)return $t(o,[t,n,i],this);const a=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],h=i[n],f=c&&d&&h&&h.major;return this._adapter.format(t,s||(f?d:u))}generateTickLabels(t){let n,i,s;for(n=0,i=t.length;n0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,i=s.length;n=e[i].pos&&t<=e[s].pos&&({lo:i,hi:s}=zi(e,"pos",t)),{pos:r,time:a}=e[i],{pos:o,time:l}=e[s]):(t>=e[i].time&&t<=e[s].time&&({lo:i,hi:s}=zi(e,"time",t)),{time:r,pos:a}=e[i],{time:o,pos:l}=e[s]);const c=o-r;return c?a+(l-a)*(t-r)/c:a}var Iu;let SN=(Iu=class extends Tm{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=au(n,this.min),this._tableRange=au(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,s=[],r=[];let o,a,l,c,u;for(o=0,a=t.length;o=n&&c<=i&&s.push(c);if(s.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(o=0,a=s.length;os-r)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?t=this.normalize(n.concat(i)):t=n.length?n:i,t=this._cache.all=t,t}getDecimalForValue(t){return(au(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return au(this._table,i*this._tableRange+this._minPos,!0)}},K(Iu,"id","timeseries"),K(Iu,"defaults",Tm.defaults),Iu);var MN=Object.freeze({__proto__:null,CategoryScale:eN,LinearScale:iN,LogarithmicScale:oN,RadialLinearScale:bN,TimeScale:Tm,TimeSeriesScale:SN});const CN=[P2,iR,QR,MN];by.register(...CN);function OM(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t"u")return!1;var t=si(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function FN(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var i=t.styles[n]||{},s=t.attributes[n]||{},r=t.elements[n];!Fn(r)||!ki(r)||(Object.assign(r.style,i),Object.keys(s).forEach(function(o){var a=s[o];a===!1?r.removeAttribute(o):r.setAttribute(o,a===!0?"":a)}))})}function BN(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(i){var s=t.elements[i],r=t.attributes[i]||{},o=Object.keys(t.styles.hasOwnProperty(i)?t.styles[i]:n[i]),a=o.reduce(function(l,c){return l[c]="",l},{});!Fn(s)||!ki(s)||(Object.assign(s.style,a),Object.keys(r).forEach(function(l){s.removeAttribute(l)}))})}}const VN={name:"applyStyles",enabled:!0,phase:"write",fn:FN,effect:BN,requires:["computeStyles"]};function xi(e){return e.split("-")[0]}var Tr=Math.max,Vd=Math.min,Ko=Math.round;function Go(e,t){t===void 0&&(t=!1);var n=e.getBoundingClientRect(),i=1,s=1;if(Fn(e)&&t){var r=e.offsetHeight,o=e.offsetWidth;o>0&&(i=Ko(n.width)/o||1),r>0&&(s=Ko(n.height)/r||1)}return{width:n.width/i,height:n.height/s,top:n.top/s,right:n.right/i,bottom:n.bottom/s,left:n.left/i,x:n.left/i,y:n.top/s}}function My(e){var t=Go(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function NM(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Sy(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function ns(e){return si(e).getComputedStyle(e)}function zN(e){return["table","td","th"].indexOf(ki(e))>=0}function Js(e){return((Xo(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ah(e){return ki(e)==="html"?e:e.assignedSlot||e.parentNode||(Sy(e)?e.host:null)||Js(e)}function mb(e){return!Fn(e)||ns(e).position==="fixed"?null:e.offsetParent}function WN(e){var t=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,n=navigator.userAgent.indexOf("Trident")!==-1;if(n&&Fn(e)){var i=ns(e);if(i.position==="fixed")return null}var s=Ah(e);for(Sy(s)&&(s=s.host);Fn(s)&&["html","body"].indexOf(ki(s))<0;){var r=ns(s);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||t&&r.willChange==="filter"||t&&r.filter&&r.filter!=="none")return s;s=s.parentNode}return null}function gc(e){for(var t=si(e),n=mb(e);n&&zN(n)&&ns(n).position==="static";)n=mb(n);return n&&(ki(n)==="html"||ki(n)==="body"&&ns(n).position==="static")?t:n||WN(e)||t}function Cy(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function pl(e,t,n){return Tr(e,Vd(t,n))}function HN(e,t,n){var i=pl(e,t,n);return i>n?n:i}function jM(){return{top:0,right:0,bottom:0,left:0}}function $M(e){return Object.assign({},jM(),e)}function IM(e,t){return t.reduce(function(n,i){return n[i]=e,n},{})}var UN=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,$M(typeof t!="number"?t:IM(t,mc))};function YN(e){var t,n=e.state,i=e.name,s=e.options,r=n.elements.arrow,o=n.modifiersData.popperOffsets,a=xi(n.placement),l=Cy(a),c=[cn,Wn].indexOf(a)>=0,u=c?"height":"width";if(!(!r||!o)){var d=UN(s.padding,n),h=My(r),f=l==="y"?ln:cn,p=l==="y"?zn:Wn,m=n.rects.reference[u]+n.rects.reference[l]-o[l]-n.rects.popper[u],v=o[l]-n.rects.reference[l],y=gc(r),g=y?l==="y"?y.clientHeight||0:y.clientWidth||0:0,x=m/2-v/2,_=d[f],w=g-h[u]-d[p],S=g/2-h[u]/2+x,C=pl(_,S,w),M=l;n.modifiersData[i]=(t={},t[M]=C,t.centerOffset=C-S,t)}}function XN(e){var t=e.state,n=e.options,i=n.element,s=i===void 0?"[data-popper-arrow]":i;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||NM(t.elements.popper,s)&&(t.elements.arrow=s))}const KN={name:"arrow",enabled:!0,phase:"main",fn:YN,effect:XN,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function qo(e){return e.split("-")[1]}var GN={top:"auto",right:"auto",bottom:"auto",left:"auto"};function qN(e){var t=e.x,n=e.y,i=window,s=i.devicePixelRatio||1;return{x:Ko(t*s)/s||0,y:Ko(n*s)/s||0}}function gb(e){var t,n=e.popper,i=e.popperRect,s=e.placement,r=e.variation,o=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,h=o.x,f=h===void 0?0:h,p=o.y,m=p===void 0?0:p,v=typeof u=="function"?u({x:f,y:m}):{x:f,y:m};f=v.x,m=v.y;var y=o.hasOwnProperty("x"),g=o.hasOwnProperty("y"),x=cn,_=ln,w=window;if(c){var S=gc(n),C="clientHeight",M="clientWidth";if(S===si(n)&&(S=Js(n),ns(S).position!=="static"&&a==="absolute"&&(C="scrollHeight",M="scrollWidth")),S=S,s===ln||(s===cn||s===Wn)&&r===Xl){_=zn;var P=d&&S===w&&w.visualViewport?w.visualViewport.height:S[C];m-=P-i.height,m*=l?1:-1}if(s===cn||(s===ln||s===zn)&&r===Xl){x=Wn;var T=d&&S===w&&w.visualViewport?w.visualViewport.width:S[M];f-=T-i.width,f*=l?1:-1}}var A=Object.assign({position:a},c&&GN),E=u===!0?qN({x:f,y:m}):{x:f,y:m};if(f=E.x,m=E.y,l){var z;return Object.assign({},A,(z={},z[_]=g?"0":"",z[x]=y?"0":"",z.transform=(w.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",z))}return Object.assign({},A,(t={},t[_]=g?m+"px":"",t[x]=y?f+"px":"",t.transform="",t))}function QN(e){var t=e.state,n=e.options,i=n.gpuAcceleration,s=i===void 0?!0:i,r=n.adaptive,o=r===void 0?!0:r,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:xi(t.placement),variation:qo(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,gb(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,gb(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const ZN={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:QN,data:{}};var lu={passive:!0};function JN(e){var t=e.state,n=e.instance,i=e.options,s=i.scroll,r=s===void 0?!0:s,o=i.resize,a=o===void 0?!0:o,l=si(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&c.forEach(function(u){u.addEventListener("scroll",n.update,lu)}),a&&l.addEventListener("resize",n.update,lu),function(){r&&c.forEach(function(u){u.removeEventListener("scroll",n.update,lu)}),a&&l.removeEventListener("resize",n.update,lu)}}const tj={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:JN,data:{}};var ej={left:"right",right:"left",bottom:"top",top:"bottom"};function Ju(e){return e.replace(/left|right|bottom|top/g,function(t){return ej[t]})}var nj={start:"end",end:"start"};function yb(e){return e.replace(/start|end/g,function(t){return nj[t]})}function Py(e){var t=si(e),n=t.pageXOffset,i=t.pageYOffset;return{scrollLeft:n,scrollTop:i}}function Ty(e){return Go(Js(e)).left+Py(e).scrollLeft}function ij(e){var t=si(e),n=Js(e),i=t.visualViewport,s=n.clientWidth,r=n.clientHeight,o=0,a=0;return i&&(s=i.width,r=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=i.offsetLeft,a=i.offsetTop)),{width:s,height:r,x:o+Ty(e),y:a}}function sj(e){var t,n=Js(e),i=Py(e),s=(t=e.ownerDocument)==null?void 0:t.body,r=Tr(n.scrollWidth,n.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=Tr(n.scrollHeight,n.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-i.scrollLeft+Ty(e),l=-i.scrollTop;return ns(s||n).direction==="rtl"&&(a+=Tr(n.clientWidth,s?s.clientWidth:0)-r),{width:r,height:o,x:a,y:l}}function Dy(e){var t=ns(e),n=t.overflow,i=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+s+i)}function FM(e){return["html","body","#document"].indexOf(ki(e))>=0?e.ownerDocument.body:Fn(e)&&Dy(e)?e:FM(Ah(e))}function ml(e,t){var n;t===void 0&&(t=[]);var i=FM(e),s=i===((n=e.ownerDocument)==null?void 0:n.body),r=si(i),o=s?[r].concat(r.visualViewport||[],Dy(i)?i:[]):i,a=t.concat(o);return s?a:a.concat(ml(Ah(o)))}function Dm(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function rj(e){var t=Go(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}function vb(e,t){return t===LM?Dm(ij(e)):Xo(t)?rj(t):Dm(sj(Js(e)))}function oj(e){var t=ml(Ah(e)),n=["absolute","fixed"].indexOf(ns(e).position)>=0,i=n&&Fn(e)?gc(e):e;return Xo(i)?t.filter(function(s){return Xo(s)&&NM(s,i)&&ki(s)!=="body"}):[]}function aj(e,t,n){var i=t==="clippingParents"?oj(e):[].concat(t),s=[].concat(i,[n]),r=s[0],o=s.reduce(function(a,l){var c=vb(e,l);return a.top=Tr(c.top,a.top),a.right=Vd(c.right,a.right),a.bottom=Vd(c.bottom,a.bottom),a.left=Tr(c.left,a.left),a},vb(e,r));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function BM(e){var t=e.reference,n=e.element,i=e.placement,s=i?xi(i):null,r=i?qo(i):null,o=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,l;switch(s){case ln:l={x:o,y:t.y-n.height};break;case zn:l={x:o,y:t.y+t.height};break;case Wn:l={x:t.x+t.width,y:a};break;case cn:l={x:t.x-n.width,y:a};break;default:l={x:t.x,y:t.y}}var c=s?Cy(s):null;if(c!=null){var u=c==="y"?"height":"width";switch(r){case Yo:l[c]=l[c]-(t[u]/2-n[u]/2);break;case Xl:l[c]=l[c]+(t[u]/2-n[u]/2);break}}return l}function Kl(e,t){t===void 0&&(t={});var n=t,i=n.placement,s=i===void 0?e.placement:i,r=n.boundary,o=r===void 0?PN:r,a=n.rootBoundary,l=a===void 0?LM:a,c=n.elementContext,u=c===void 0?Sa:c,d=n.altBoundary,h=d===void 0?!1:d,f=n.padding,p=f===void 0?0:f,m=$M(typeof p!="number"?p:IM(p,mc)),v=u===Sa?TN:Sa,y=e.rects.popper,g=e.elements[h?v:u],x=aj(Xo(g)?g:g.contextElement||Js(e.elements.popper),o,l),_=Go(e.elements.reference),w=BM({reference:_,element:y,strategy:"absolute",placement:s}),S=Dm(Object.assign({},y,w)),C=u===Sa?S:_,M={top:x.top-C.top+m.top,bottom:C.bottom-x.bottom+m.bottom,left:x.left-C.left+m.left,right:C.right-x.right+m.right},P=e.modifiersData.offset;if(u===Sa&&P){var T=P[s];Object.keys(M).forEach(function(A){var E=[Wn,zn].indexOf(A)>=0?1:-1,z=[ln,zn].indexOf(A)>=0?"y":"x";M[A]+=T[z]*E})}return M}function lj(e,t){t===void 0&&(t={});var n=t,i=n.placement,s=n.boundary,r=n.rootBoundary,o=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?RM:l,u=qo(i),d=u?a?pb:pb.filter(function(p){return qo(p)===u}):mc,h=d.filter(function(p){return c.indexOf(p)>=0});h.length===0&&(h=d);var f=h.reduce(function(p,m){return p[m]=Kl(e,{placement:m,boundary:s,rootBoundary:r,padding:o})[xi(m)],p},{});return Object.keys(f).sort(function(p,m){return f[p]-f[m]})}function cj(e){if(xi(e)===ky)return[];var t=Ju(e);return[yb(e),t,yb(t)]}function uj(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var s=n.mainAxis,r=s===void 0?!0:s,o=n.altAxis,a=o===void 0?!0:o,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,h=n.altBoundary,f=n.flipVariations,p=f===void 0?!0:f,m=n.allowedAutoPlacements,v=t.options.placement,y=xi(v),g=y===v,x=l||(g||!p?[Ju(v)]:cj(v)),_=[v].concat(x).reduce(function(Z,O){return Z.concat(xi(O)===ky?lj(t,{placement:O,boundary:u,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:m}):O)},[]),w=t.rects.reference,S=t.rects.popper,C=new Map,M=!0,P=_[0],T=0;T<_.length;T++){var A=_[T],E=xi(A),z=qo(A)===Yo,N=[ln,zn].indexOf(E)>=0,L=N?"width":"height",R=Kl(t,{placement:A,boundary:u,rootBoundary:d,altBoundary:h,padding:c}),B=N?z?Wn:cn:z?zn:ln;w[L]>S[L]&&(B=Ju(B));var D=Ju(B),$=[];if(r&&$.push(R[E]<=0),a&&$.push(R[B]<=0,R[D]<=0),$.every(function(Z){return Z})){P=A,M=!1;break}C.set(A,$)}if(M)for(var F=p?3:1,V=function(O){var U=_.find(function(lt){var ct=C.get(lt);if(ct)return ct.slice(0,O).every(function(kt){return kt})});if(U)return P=U,"break"},W=F;W>0;W--){var et=V(W);if(et==="break")break}t.placement!==P&&(t.modifiersData[i]._skip=!0,t.placement=P,t.reset=!0)}}const VM={name:"flip",enabled:!0,phase:"main",fn:uj,requiresIfExists:["offset"],data:{_skip:!1}};function xb(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function bb(e){return[ln,Wn,zn,cn].some(function(t){return e[t]>=0})}function dj(e){var t=e.state,n=e.name,i=t.rects.reference,s=t.rects.popper,r=t.modifiersData.preventOverflow,o=Kl(t,{elementContext:"reference"}),a=Kl(t,{altBoundary:!0}),l=xb(o,i),c=xb(a,s,r),u=bb(l),d=bb(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const hj={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:dj};function fj(e,t,n){var i=xi(e),s=[cn,ln].indexOf(i)>=0?-1:1,r=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,o=r[0],a=r[1];return o=o||0,a=(a||0)*s,[cn,Wn].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}function pj(e){var t=e.state,n=e.options,i=e.name,s=n.offset,r=s===void 0?[0,0]:s,o=RM.reduce(function(u,d){return u[d]=fj(d,t.rects,r),u},{}),a=o[t.placement],l=a.x,c=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[i]=o}const mj={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:pj};function gj(e){var t=e.state,n=e.name;t.modifiersData[n]=BM({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const yj={name:"popperOffsets",enabled:!0,phase:"read",fn:gj,data:{}};function vj(e){return e==="x"?"y":"x"}function xj(e){var t=e.state,n=e.options,i=e.name,s=n.mainAxis,r=s===void 0?!0:s,o=n.altAxis,a=o===void 0?!1:o,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,h=n.tether,f=h===void 0?!0:h,p=n.tetherOffset,m=p===void 0?0:p,v=Kl(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),y=xi(t.placement),g=qo(t.placement),x=!g,_=Cy(y),w=vj(_),S=t.modifiersData.popperOffsets,C=t.rects.reference,M=t.rects.popper,P=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,T=typeof P=="number"?{mainAxis:P,altAxis:P}:Object.assign({mainAxis:0,altAxis:0},P),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,E={x:0,y:0};if(S){if(r){var z,N=_==="y"?ln:cn,L=_==="y"?zn:Wn,R=_==="y"?"height":"width",B=S[_],D=B+v[N],$=B-v[L],F=f?-M[R]/2:0,V=g===Yo?C[R]:M[R],W=g===Yo?-M[R]:-C[R],et=t.elements.arrow,Z=f&&et?My(et):{width:0,height:0},O=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:jM(),U=O[N],lt=O[L],ct=pl(0,C[R],Z[R]),kt=x?C[R]/2-F-ct-U-T.mainAxis:V-ct-U-T.mainAxis,it=x?-C[R]/2+F+ct+lt+T.mainAxis:W+ct+lt+T.mainAxis,Lt=t.elements.arrow&&gc(t.elements.arrow),Ct=Lt?_==="y"?Lt.clientTop||0:Lt.clientLeft||0:0,Qt=(z=A==null?void 0:A[_])!=null?z:0,ft=B+kt-Qt-Ct,wt=B+it-Qt,dt=pl(f?Vd(D,ft):D,B,f?Tr($,wt):$);S[_]=dt,E[_]=dt-B}if(a){var jt,pt=_==="x"?ln:cn,xt=_==="x"?zn:Wn,J=S[w],mt=w==="y"?"height":"width",q=J+v[pt],ye=J-v[xt],Dt=[ln,cn].indexOf(y)!==-1,he=(jt=A==null?void 0:A[w])!=null?jt:0,Un=Dt?q:J-C[mt]-M[mt]-he+T.altAxis,Yn=Dt?J+C[mt]+M[mt]-he-T.altAxis:ye,Mn=f&&Dt?HN(Un,J,Yn):pl(f?Un:q,J,f?Yn:ye);S[w]=Mn,E[w]=Mn-J}t.modifiersData[i]=E}}const bj={name:"preventOverflow",enabled:!0,phase:"main",fn:xj,requiresIfExists:["offset"]};function _j(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function wj(e){return e===si(e)||!Fn(e)?Py(e):_j(e)}function kj(e){var t=e.getBoundingClientRect(),n=Ko(t.width)/e.offsetWidth||1,i=Ko(t.height)/e.offsetHeight||1;return n!==1||i!==1}function Sj(e,t,n){n===void 0&&(n=!1);var i=Fn(t),s=Fn(t)&&kj(t),r=Js(t),o=Go(e,s),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!n)&&((ki(t)!=="body"||Dy(r))&&(a=wj(t)),Fn(t)?(l=Go(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):r&&(l.x=Ty(r))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function Mj(e){var t=new Map,n=new Set,i=[];e.forEach(function(r){t.set(r.name,r)});function s(r){n.add(r.name);var o=[].concat(r.requires||[],r.requiresIfExists||[]);o.forEach(function(a){if(!n.has(a)){var l=t.get(a);l&&s(l)}}),i.push(r)}return e.forEach(function(r){n.has(r.name)||s(r)}),i}function Cj(e){var t=Mj(e);return IN.reduce(function(n,i){return n.concat(t.filter(function(s){return s.phase===i}))},[])}function Pj(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Tj(e){var t=e.reduce(function(n,i){var s=n[i.name];return n[i.name]=s?Object.assign({},s,i,{options:Object.assign({},s.options,i.options),data:Object.assign({},s.data,i.data)}):i,n},{});return Object.keys(t).map(function(n){return t[n]})}var _b={placement:"bottom",modifiers:[],strategy:"absolute"};function wb(){for(var e=arguments.length,t=new Array(e),n=0;ne,isStatic:!1,reducedMotion:"never"}),Lh=k.createContext({}),Rh=k.createContext(null),Nh=typeof document<"u",Ey=Nh?k.useLayoutEffect:k.useEffect,WM=k.createContext({strict:!1}),Ay=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),Fj="framerAppearId",HM="data-"+Ay(Fj);function Bj(e,t,n,i){const{visualElement:s}=k.useContext(Lh),r=k.useContext(WM),o=k.useContext(Rh),a=k.useContext(zM).reducedMotion,l=k.useRef();i=i||r.renderer,!l.current&&i&&(l.current=i(e,{visualState:t,parent:s,props:n,presenceContext:o,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:a}));const c=l.current;k.useInsertionEffect(()=>{c&&c.update(n,o)});const u=k.useRef(!!(n[HM]&&!window.HandoffComplete));return Ey(()=>{c&&(c.render(),u.current&&c.animationState&&c.animationState.animateChanges())}),k.useEffect(()=>{c&&(c.updateFeatures(),!u.current&&c.animationState&&c.animationState.animateChanges(),u.current&&(u.current=!1,window.HandoffComplete=!0))}),c}function _o(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Vj(e,t,n){return k.useCallback(i=>{i&&e.mount&&e.mount(i),t&&(i?t.mount(i):t.unmount()),n&&(typeof n=="function"?n(i):_o(n)&&(n.current=i))},[t])}function Gl(e){return typeof e=="string"||Array.isArray(e)}function jh(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Oy=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ly=["initial",...Oy];function $h(e){return jh(e.animate)||Ly.some(t=>Gl(e[t]))}function UM(e){return!!($h(e)||e.variants)}function zj(e,t){if($h(e)){const{initial:n,animate:i}=e;return{initial:n===!1||Gl(n)?n:void 0,animate:Gl(i)?i:void 0}}return e.inherit!==!1?t:{}}function Wj(e){const{initial:t,animate:n}=zj(e,k.useContext(Lh));return k.useMemo(()=>({initial:t,animate:n}),[kb(t),kb(n)])}function kb(e){return Array.isArray(e)?e.join(" "):e}const Sb={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},ql={};for(const e in Sb)ql[e]={isEnabled:t=>Sb[e].some(n=>!!t[n])};function Hj(e){for(const t in e)ql[t]={...ql[t],...e[t]}}const Ry=k.createContext({}),YM=k.createContext({}),Uj=Symbol.for("motionComponentSymbol");function Yj({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:i,Component:s}){e&&Hj(e);function r(a,l){let c;const u={...k.useContext(zM),...a,layoutId:Xj(a)},{isStatic:d}=u,h=Wj(a),f=i(a,d);if(!d&&Nh){h.visualElement=Bj(s,f,u,t);const p=k.useContext(YM),m=k.useContext(WM).strict;h.visualElement&&(c=h.visualElement.loadFeatures(u,m,e,p))}return k.createElement(Lh.Provider,{value:h},c&&h.visualElement?k.createElement(c,{visualElement:h.visualElement,...u}):null,n(s,a,Vj(f,h.visualElement,l),f,d,h.visualElement))}const o=k.forwardRef(r);return o[Uj]=s,o}function Xj({layoutId:e}){const t=k.useContext(Ry).id;return t&&e!==void 0?t+"-"+e:e}function Kj(e){function t(i,s={}){return Yj(e(i,s))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(i,s)=>(n.has(s)||n.set(s,t(s)),n.get(s))})}const Gj=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Ny(e){return typeof e!="string"||e.includes("-")?!1:!!(Gj.indexOf(e)>-1||/[A-Z]/.test(e))}const zd={};function qj(e){Object.assign(zd,e)}const yc=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ur=new Set(yc);function XM(e,{layout:t,layoutId:n}){return Ur.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!zd[e]||e==="opacity")}const un=e=>!!(e&&e.getVelocity),Qj={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Zj=yc.length;function Jj(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},i,s){let r="";for(let o=0;ot=>typeof t=="string"&&t.startsWith(e),GM=KM("--"),Em=KM("var(--"),t$=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,e$=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Hs=(e,t,n)=>Math.min(Math.max(n,e),t),Yr={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},gl={...Yr,transform:e=>Hs(0,1,e)},cu={...Yr,default:1},yl=e=>Math.round(e*1e5)/1e5,Ih=/(-)?([\d]*\.?[\d])+/g,qM=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,n$=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function vc(e){return typeof e=="string"}const xc=e=>({test:t=>vc(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ps=xc("deg"),bi=xc("%"),st=xc("px"),i$=xc("vh"),s$=xc("vw"),Mb={...bi,parse:e=>bi.parse(e)/100,transform:e=>bi.transform(e*100)},Cb={...Yr,transform:Math.round},QM={borderWidth:st,borderTopWidth:st,borderRightWidth:st,borderBottomWidth:st,borderLeftWidth:st,borderRadius:st,radius:st,borderTopLeftRadius:st,borderTopRightRadius:st,borderBottomRightRadius:st,borderBottomLeftRadius:st,width:st,maxWidth:st,height:st,maxHeight:st,size:st,top:st,right:st,bottom:st,left:st,padding:st,paddingTop:st,paddingRight:st,paddingBottom:st,paddingLeft:st,margin:st,marginTop:st,marginRight:st,marginBottom:st,marginLeft:st,rotate:ps,rotateX:ps,rotateY:ps,rotateZ:ps,scale:cu,scaleX:cu,scaleY:cu,scaleZ:cu,skew:ps,skewX:ps,skewY:ps,distance:st,translateX:st,translateY:st,translateZ:st,x:st,y:st,z:st,perspective:st,transformPerspective:st,opacity:gl,originX:Mb,originY:Mb,originZ:st,zIndex:Cb,fillOpacity:gl,strokeOpacity:gl,numOctaves:Cb};function jy(e,t,n,i){const{style:s,vars:r,transform:o,transformOrigin:a}=e;let l=!1,c=!1,u=!0;for(const d in t){const h=t[d];if(GM(d)){r[d]=h;continue}const f=QM[d],p=e$(h,f);if(Ur.has(d)){if(l=!0,o[d]=p,!u)continue;h!==(f.default||0)&&(u=!1)}else d.startsWith("origin")?(c=!0,a[d]=p):s[d]=p}if(t.transform||(l||i?s.transform=Jj(e.transform,n,u,i):s.transform&&(s.transform="none")),c){const{originX:d="50%",originY:h="50%",originZ:f=0}=a;s.transformOrigin=`${d} ${h} ${f}`}}const $y=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ZM(e,t,n){for(const i in t)!un(t[i])&&!XM(i,n)&&(e[i]=t[i])}function r$({transformTemplate:e},t,n){return k.useMemo(()=>{const i=$y();return jy(i,t,{enableHardwareAcceleration:!n},e),Object.assign({},i.vars,i.style)},[t])}function o$(e,t,n){const i=e.style||{},s={};return ZM(s,i,e),Object.assign(s,r$(e,t,n)),e.transformValues?e.transformValues(s):s}function a$(e,t,n){const i={},s=o$(e,t,n);return e.drag&&e.dragListener!==!1&&(i.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(i.tabIndex=0),i.style=s,i}const l$=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Wd(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||l$.has(e)}let JM=e=>!Wd(e);function c$(e){e&&(JM=t=>t.startsWith("on")?!Wd(t):e(t))}try{c$(require("@emotion/is-prop-valid").default)}catch{}function u$(e,t,n){const i={};for(const s in e)s==="values"&&typeof e.values=="object"||(JM(s)||n===!0&&Wd(s)||!t&&!Wd(s)||e.draggable&&s.startsWith("onDrag"))&&(i[s]=e[s]);return i}function Pb(e,t,n){return typeof e=="string"?e:st.transform(t+n*e)}function d$(e,t,n){const i=Pb(t,e.x,e.width),s=Pb(n,e.y,e.height);return`${i} ${s}`}const h$={offset:"stroke-dashoffset",array:"stroke-dasharray"},f$={offset:"strokeDashoffset",array:"strokeDasharray"};function p$(e,t,n=1,i=0,s=!0){e.pathLength=1;const r=s?h$:f$;e[r.offset]=st.transform(-i);const o=st.transform(t),a=st.transform(n);e[r.array]=`${o} ${a}`}function Iy(e,{attrX:t,attrY:n,attrScale:i,originX:s,originY:r,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},u,d,h){if(jy(e,c,u,h),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:p,dimensions:m}=e;f.transform&&(m&&(p.transform=f.transform),delete f.transform),m&&(s!==void 0||r!==void 0||p.transform)&&(p.transformOrigin=d$(m,s!==void 0?s:.5,r!==void 0?r:.5)),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),i!==void 0&&(f.scale=i),o!==void 0&&p$(f,o,a,l,!1)}const tC=()=>({...$y(),attrs:{}}),Fy=e=>typeof e=="string"&&e.toLowerCase()==="svg";function m$(e,t,n,i){const s=k.useMemo(()=>{const r=tC();return Iy(r,t,{enableHardwareAcceleration:!1},Fy(i),e.transformTemplate),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};ZM(r,e.style,e),s.style={...r,...s.style}}return s}function g$(e=!1){return(n,i,s,{latestValues:r},o)=>{const l=(Ny(n)?m$:a$)(i,r,o,n),u={...u$(i,typeof n=="string",e),...l,ref:s},{children:d}=i,h=k.useMemo(()=>un(d)?d.get():d,[d]);return k.createElement(n,{...u,children:h})}}function eC(e,{style:t,vars:n},i,s){Object.assign(e.style,t,s&&s.getProjectionStyles(i));for(const r in n)e.style.setProperty(r,n[r])}const nC=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function iC(e,t,n,i){eC(e,t,void 0,i);for(const s in t.attrs)e.setAttribute(nC.has(s)?s:Ay(s),t.attrs[s])}function By(e,t){const{style:n}=e,i={};for(const s in n)(un(n[s])||t.style&&un(t.style[s])||XM(s,e))&&(i[s]=n[s]);return i}function sC(e,t){const n=By(e,t);for(const i in e)if(un(e[i])||un(t[i])){const s=yc.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[s]=e[i]}return n}function Vy(e,t,n,i={},s={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,i,s)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,i,s)),t}function rC(e){const t=k.useRef(null);return t.current===null&&(t.current=e()),t.current}const Hd=e=>Array.isArray(e),y$=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),v$=e=>Hd(e)?e[e.length-1]||0:e;function ed(e){const t=un(e)?e.get():e;return y$(t)?t.toValue():t}function x$({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},i,s,r){const o={latestValues:b$(i,s,r,e),renderState:t()};return n&&(o.mount=a=>n(i,a,o)),o}const oC=e=>(t,n)=>{const i=k.useContext(Lh),s=k.useContext(Rh),r=()=>x$(e,t,i,s);return n?r():rC(r)};function b$(e,t,n,i){const s={},r=i(e,{});for(const h in r)s[h]=ed(r[h]);let{initial:o,animate:a}=e;const l=$h(e),c=UM(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const d=u?a:o;return d&&typeof d!="boolean"&&!jh(d)&&(Array.isArray(d)?d:[d]).forEach(f=>{const p=Vy(e,f);if(!p)return;const{transitionEnd:m,transition:v,...y}=p;for(const g in y){let x=y[g];if(Array.isArray(x)){const _=u?x.length-1:0;x=x[_]}x!==null&&(s[g]=x)}for(const g in m)s[g]=m[g]}),s}const ce=e=>e;class Tb{constructor(){this.order=[],this.scheduled=new Set}add(t){if(!this.scheduled.has(t))return this.scheduled.add(t),this.order.push(t),!0}remove(t){const n=this.order.indexOf(t);n!==-1&&(this.order.splice(n,1),this.scheduled.delete(t))}clear(){this.order.length=0,this.scheduled.clear()}}function _$(e){let t=new Tb,n=new Tb,i=0,s=!1,r=!1;const o=new WeakSet,a={schedule:(l,c=!1,u=!1)=>{const d=u&&s,h=d?t:n;return c&&o.add(l),h.add(l)&&d&&s&&(i=t.order.length),l},cancel:l=>{n.remove(l),o.delete(l)},process:l=>{if(s){r=!0;return}if(s=!0,[t,n]=[n,t],n.clear(),i=t.order.length,i)for(let c=0;c(d[h]=_$(()=>n=!0),d),{}),o=d=>r[d].process(s),a=()=>{const d=performance.now();n=!1,s.delta=i?1e3/60:Math.max(Math.min(d-s.timestamp,w$),1),s.timestamp=d,s.isProcessing=!0,uu.forEach(o),s.isProcessing=!1,n&&t&&(i=!1,e(a))},l=()=>{n=!0,i=!0,s.isProcessing||e(a)};return{schedule:uu.reduce((d,h)=>{const f=r[h];return d[h]=(p,m=!1,v=!1)=>(n||l(),f.schedule(p,m,v)),d},{}),cancel:d=>uu.forEach(h=>r[h].cancel(d)),state:s,steps:r}}const{schedule:zt,cancel:is,state:je,steps:Uf}=k$(typeof requestAnimationFrame<"u"?requestAnimationFrame:ce,!0),S$={useVisualState:oC({scrapeMotionValuesFromProps:sC,createRenderState:tC,onMount:(e,t,{renderState:n,latestValues:i})=>{zt.read(()=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),zt.render(()=>{Iy(n,i,{enableHardwareAcceleration:!1},Fy(t.tagName),e.transformTemplate),iC(t,n)})}})},M$={useVisualState:oC({scrapeMotionValuesFromProps:By,createRenderState:$y})};function C$(e,{forwardMotionProps:t=!1},n,i){return{...Ny(e)?S$:M$,preloadedFeatures:n,useRender:g$(t),createVisualElement:i,Component:e}}function Hi(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}const aC=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Fh(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}const P$=e=>t=>aC(t)&&e(t,Fh(t));function qi(e,t,n,i){return Hi(e,t,P$(n),i)}const T$=(e,t)=>n=>t(e(n)),Is=(...e)=>e.reduce(T$);function lC(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const Db=lC("dragHorizontal"),Eb=lC("dragVertical");function cC(e){let t=!1;if(e==="y")t=Eb();else if(e==="x")t=Db();else{const n=Db(),i=Eb();n&&i?t=()=>{n(),i()}:(n&&n(),i&&i())}return t}function uC(){const e=cC(!0);return e?(e(),!1):!0}class tr{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Ab(e,t){const n="pointer"+(t?"enter":"leave"),i="onHover"+(t?"Start":"End"),s=(r,o)=>{if(r.pointerType==="touch"||uC())return;const a=e.getProps();e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",t),a[i]&&zt.update(()=>a[i](r,o))};return qi(e.current,n,s,{passive:!e.getProps()[i]})}class D$ extends tr{mount(){this.unmount=Is(Ab(this.node,!0),Ab(this.node,!1))}unmount(){}}class E$ extends tr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Is(Hi(this.node.current,"focus",()=>this.onFocus()),Hi(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const dC=(e,t)=>t?e===t?!0:dC(e,t.parentElement):!1;function Yf(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,Fh(n))}class A$ extends tr{constructor(){super(...arguments),this.removeStartListeners=ce,this.removeEndListeners=ce,this.removeAccessibleListeners=ce,this.startPointerPress=(t,n)=>{if(this.isPressing)return;this.removeEndListeners();const i=this.node.getProps(),r=qi(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:c,onTapCancel:u,globalTapTarget:d}=this.node.getProps();zt.update(()=>{!d&&!dC(this.node.current,a.target)?u&&u(a,l):c&&c(a,l)})},{passive:!(i.onTap||i.onPointerUp)}),o=qi(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(i.onTapCancel||i.onPointerCancel)});this.removeEndListeners=Is(r,o),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=r=>{if(r.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||Yf("up",(l,c)=>{const{onTap:u}=this.node.getProps();u&&zt.update(()=>u(l,c))})};this.removeEndListeners(),this.removeEndListeners=Hi(this.node.current,"keyup",o),Yf("down",(a,l)=>{this.startPress(a,l)})},n=Hi(this.node.current,"keydown",t),i=()=>{this.isPressing&&Yf("cancel",(r,o)=>this.cancelPress(r,o))},s=Hi(this.node.current,"blur",i);this.removeAccessibleListeners=Is(n,s)}}startPress(t,n){this.isPressing=!0;const{onTapStart:i,whileTap:s}=this.node.getProps();s&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),i&&zt.update(()=>i(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!uC()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:i}=this.node.getProps();i&&zt.update(()=>i(t,n))}mount(){const t=this.node.getProps(),n=qi(t.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),i=Hi(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Is(n,i)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const Am=new WeakMap,Xf=new WeakMap,O$=e=>{const t=Am.get(e.target);t&&t(e)},L$=e=>{e.forEach(O$)};function R$({root:e,...t}){const n=e||document;Xf.has(n)||Xf.set(n,{});const i=Xf.get(n),s=JSON.stringify(t);return i[s]||(i[s]=new IntersectionObserver(L$,{root:e,...t})),i[s]}function N$(e,t,n){const i=R$(t);return Am.set(e,n),i.observe(e),()=>{Am.delete(e),i.unobserve(e)}}const j$={some:0,all:1};class $$ extends tr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:i,amount:s="some",once:r}=t,o={root:n?n.current:void 0,rootMargin:i,threshold:typeof s=="number"?s:j$[s]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,r&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),h=c?u:d;h&&h(l)};return N$(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(I$(t,n))&&this.startObserver()}unmount(){}}function I$({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const F$={inView:{Feature:$$},tap:{Feature:A$},focus:{Feature:E$},hover:{Feature:D$}};function hC(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;it[i]=n.get()),t}function V$(e){const t={};return e.values.forEach((n,i)=>t[i]=n.getVelocity()),t}function Bh(e,t,n){const i=e.getProps();return Vy(i,t,n!==void 0?n:i.custom,B$(e),V$(e))}let zy=ce;const Dr=e=>e*1e3,Qi=e=>e/1e3,z$={current:!1},fC=e=>Array.isArray(e)&&typeof e[0]=="number";function pC(e){return!!(!e||typeof e=="string"&&mC[e]||fC(e)||Array.isArray(e)&&e.every(pC))}const Qa=([e,t,n,i])=>`cubic-bezier(${e}, ${t}, ${n}, ${i})`,mC={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Qa([0,.65,.55,1]),circOut:Qa([.55,0,1,.45]),backIn:Qa([.31,.01,.66,-.59]),backOut:Qa([.33,1.53,.69,.99])};function gC(e){if(e)return fC(e)?Qa(e):Array.isArray(e)?e.map(gC):mC[e]}function W$(e,t,n,{delay:i=0,duration:s,repeat:r=0,repeatType:o="loop",ease:a,times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=gC(a);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:i,duration:s,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"})}function H$(e,{repeat:t,repeatType:n="loop"}){const i=t&&n!=="loop"&&t%2===1?0:e.length-1;return e[i]}const yC=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,U$=1e-7,Y$=12;function X$(e,t,n,i,s){let r,o,a=0;do o=t+(n-t)/2,r=yC(o,i,s)-e,r>0?n=o:t=o;while(Math.abs(r)>U$&&++aX$(r,0,1,e,n);return r=>r===0||r===1?r:yC(s(r),t,i)}const K$=bc(.42,0,1,1),G$=bc(0,0,.58,1),vC=bc(.42,0,.58,1),q$=e=>Array.isArray(e)&&typeof e[0]!="number",xC=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,bC=e=>t=>1-e(1-t),Wy=e=>1-Math.sin(Math.acos(e)),_C=bC(Wy),Q$=xC(Wy),wC=bc(.33,1.53,.69,.99),Hy=bC(wC),Z$=xC(Hy),J$=e=>(e*=2)<1?.5*Hy(e):.5*(2-Math.pow(2,-10*(e-1))),tI={linear:ce,easeIn:K$,easeInOut:vC,easeOut:G$,circIn:Wy,circInOut:Q$,circOut:_C,backIn:Hy,backInOut:Z$,backOut:wC,anticipate:J$},Ob=e=>{if(Array.isArray(e)){zy(e.length===4);const[t,n,i,s]=e;return bc(t,n,i,s)}else if(typeof e=="string")return tI[e];return e},Uy=(e,t)=>n=>!!(vc(n)&&n$.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),kC=(e,t,n)=>i=>{if(!vc(i))return i;const[s,r,o,a]=i.match(Ih);return{[e]:parseFloat(s),[t]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},eI=e=>Hs(0,255,e),Kf={...Yr,transform:e=>Math.round(eI(e))},kr={test:Uy("rgb","red"),parse:kC("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+Kf.transform(e)+", "+Kf.transform(t)+", "+Kf.transform(n)+", "+yl(gl.transform(i))+")"};function nI(e){let t="",n="",i="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),i=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),i=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,i+=i,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}}const Om={test:Uy("#"),parse:nI,transform:kr.transform},wo={test:Uy("hsl","hue"),parse:kC("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+bi.transform(yl(t))+", "+bi.transform(yl(n))+", "+yl(gl.transform(i))+")"},We={test:e=>kr.test(e)||Om.test(e)||wo.test(e),parse:e=>kr.test(e)?kr.parse(e):wo.test(e)?wo.parse(e):Om.parse(e),transform:e=>vc(e)?e:e.hasOwnProperty("red")?kr.transform(e):wo.transform(e)},ee=(e,t,n)=>-n*e+n*t+e;function Gf(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function iI({hue:e,saturation:t,lightness:n,alpha:i}){e/=360,t/=100,n/=100;let s=0,r=0,o=0;if(!t)s=r=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;s=Gf(l,a,e+1/3),r=Gf(l,a,e),o=Gf(l,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:i}}const qf=(e,t,n)=>{const i=e*e;return Math.sqrt(Math.max(0,n*(t*t-i)+i))},sI=[Om,kr,wo],rI=e=>sI.find(t=>t.test(e));function Lb(e){const t=rI(e);let n=t.parse(e);return t===wo&&(n=iI(n)),n}const SC=(e,t)=>{const n=Lb(e),i=Lb(t),s={...n};return r=>(s.red=qf(n.red,i.red,r),s.green=qf(n.green,i.green,r),s.blue=qf(n.blue,i.blue,r),s.alpha=ee(n.alpha,i.alpha,r),kr.transform(s))};function oI(e){var t,n;return isNaN(e)&&vc(e)&&(((t=e.match(Ih))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(qM))===null||n===void 0?void 0:n.length)||0)>0}const MC={regex:t$,countKey:"Vars",token:"${v}",parse:ce},CC={regex:qM,countKey:"Colors",token:"${c}",parse:We.parse},PC={regex:Ih,countKey:"Numbers",token:"${n}",parse:Yr.parse};function Qf(e,{regex:t,countKey:n,token:i,parse:s}){const r=e.tokenised.match(t);r&&(e["num"+n]=r.length,e.tokenised=e.tokenised.replace(t,i),e.values.push(...r.map(s)))}function Ud(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&Qf(n,MC),Qf(n,CC),Qf(n,PC),n}function TC(e){return Ud(e).values}function DC(e){const{values:t,numColors:n,numVars:i,tokenised:s}=Ud(e),r=t.length;return o=>{let a=s;for(let l=0;ltypeof e=="number"?0:e;function lI(e){const t=TC(e);return DC(e)(t.map(aI))}const Us={test:oI,parse:TC,createTransformer:DC,getAnimatableNone:lI},EC=(e,t)=>n=>`${n>0?t:e}`;function AC(e,t){return typeof e=="number"?n=>ee(e,t,n):We.test(e)?SC(e,t):e.startsWith("var(")?EC(e,t):LC(e,t)}const OC=(e,t)=>{const n=[...e],i=n.length,s=e.map((r,o)=>AC(r,t[o]));return r=>{for(let o=0;o{const n={...e,...t},i={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(i[s]=AC(e[s],t[s]));return s=>{for(const r in i)n[r]=i[r](s);return n}},LC=(e,t)=>{const n=Us.createTransformer(t),i=Ud(e),s=Ud(t);return i.numVars===s.numVars&&i.numColors===s.numColors&&i.numNumbers>=s.numNumbers?Is(OC(i.values,s.values),n):EC(e,t)},Ql=(e,t,n)=>{const i=t-e;return i===0?1:(n-e)/i},Rb=(e,t)=>n=>ee(e,t,n);function uI(e){return typeof e=="number"?Rb:typeof e=="string"?We.test(e)?SC:LC:Array.isArray(e)?OC:typeof e=="object"?cI:Rb}function dI(e,t,n){const i=[],s=n||uI(e[0]),r=e.length-1;for(let o=0;ot[0];e[0]>e[r-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=dI(t,i,s),a=o.length,l=c=>{let u=0;if(a>1)for(;ul(Hs(e[0],e[r-1],c)):l}function hI(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const s=Ql(0,t,i);e.push(ee(n,1,s))}}function fI(e){const t=[0];return hI(t,e.length-1),t}function pI(e,t){return e.map(n=>n*t)}function mI(e,t){return e.map(()=>t||vC).splice(0,e.length-1)}function Yd({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const s=q$(i)?i.map(Ob):Ob(i),r={done:!1,value:t[0]},o=pI(n&&n.length===t.length?n:fI(t),e),a=RC(o,t,{ease:Array.isArray(s)?s:mI(t,s)});return{calculatedDuration:e,next:l=>(r.value=a(l),r.done=l>=e,r)}}function NC(e,t){return t?e*(1e3/t):0}const gI=5;function jC(e,t,n){const i=Math.max(t-gI,0);return NC(n-e(i),t-i)}const Zf=.001,yI=.01,vI=10,xI=.05,bI=1;function _I({duration:e=800,bounce:t=.25,velocity:n=0,mass:i=1}){let s,r,o=1-t;o=Hs(xI,bI,o),e=Hs(yI,vI,Qi(e)),o<1?(s=c=>{const u=c*o,d=u*e,h=u-n,f=Lm(c,o),p=Math.exp(-d);return Zf-h/f*p},r=c=>{const d=c*o*e,h=d*n+n,f=Math.pow(o,2)*Math.pow(c,2)*e,p=Math.exp(-d),m=Lm(Math.pow(c,2),o);return(-s(c)+Zf>0?-1:1)*((h-f)*p)/m}):(s=c=>{const u=Math.exp(-c*e),d=(c-n)*e+1;return-Zf+u*d},r=c=>{const u=Math.exp(-c*e),d=(n-c)*(e*e);return u*d});const a=5/e,l=kI(s,r,a);if(e=Dr(e),isNaN(l))return{stiffness:100,damping:10,duration:e};{const c=Math.pow(l,2)*i;return{stiffness:c,damping:o*2*Math.sqrt(i*c),duration:e}}}const wI=12;function kI(e,t,n){let i=n;for(let s=1;se[n]!==void 0)}function CI(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!Nb(e,MI)&&Nb(e,SI)){const n=_I(e);t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}function $C({keyframes:e,restDelta:t,restSpeed:n,...i}){const s=e[0],r=e[e.length-1],o={done:!1,value:s},{stiffness:a,damping:l,mass:c,duration:u,velocity:d,isResolvedFromDuration:h}=CI({...i,velocity:-Qi(i.velocity||0)}),f=d||0,p=l/(2*Math.sqrt(a*c)),m=r-s,v=Qi(Math.sqrt(a/c)),y=Math.abs(m)<5;n||(n=y?.01:2),t||(t=y?.005:.5);let g;if(p<1){const x=Lm(v,p);g=_=>{const w=Math.exp(-p*v*_);return r-w*((f+p*v*m)/x*Math.sin(x*_)+m*Math.cos(x*_))}}else if(p===1)g=x=>r-Math.exp(-v*x)*(m+(f+v*m)*x);else{const x=v*Math.sqrt(p*p-1);g=_=>{const w=Math.exp(-p*v*_),S=Math.min(x*_,300);return r-w*((f+p*v*m)*Math.sinh(S)+x*m*Math.cosh(S))/x}}return{calculatedDuration:h&&u||null,next:x=>{const _=g(x);if(h)o.done=x>=u;else{let w=f;x!==0&&(p<1?w=jC(g,x,_):w=0);const S=Math.abs(w)<=n,C=Math.abs(r-_)<=t;o.done=S&&C}return o.value=o.done?r:_,o}}}function jb({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],h={done:!1,value:d},f=M=>a!==void 0&&Ml,p=M=>a===void 0?l:l===void 0||Math.abs(a-M)-m*Math.exp(-M/i),x=M=>y+g(M),_=M=>{const P=g(M),T=x(M);h.done=Math.abs(P)<=c,h.value=h.done?y:T};let w,S;const C=M=>{f(h.value)&&(w=M,S=$C({keyframes:[h.value,p(h.value)],velocity:jC(x,M,h.value),damping:s,stiffness:r,restDelta:c,restSpeed:u}))};return C(0),{calculatedDuration:null,next:M=>{let P=!1;return!S&&w===void 0&&(P=!0,_(M),C(M)),w!==void 0&&M>w?S.next(M-w):(!P&&_(M),h)}}}const PI=e=>{const t=({timestamp:n})=>e(n);return{start:()=>zt.update(t,!0),stop:()=>is(t),now:()=>je.isProcessing?je.timestamp:performance.now()}},$b=2e4;function Ib(e){let t=0;const n=50;let i=e.next(t);for(;!i.done&&t<$b;)t+=n,i=e.next(t);return t>=$b?1/0:t}const TI={decay:jb,inertia:jb,tween:Yd,keyframes:Yd,spring:$C};function Xd({autoplay:e=!0,delay:t=0,driver:n=PI,keyframes:i,type:s="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:a="loop",onPlay:l,onStop:c,onComplete:u,onUpdate:d,...h}){let f=1,p=!1,m,v;const y=()=>{v=new Promise(V=>{m=V})};y();let g;const x=TI[s]||Yd;let _;x!==Yd&&typeof i[0]!="number"&&(_=RC([0,100],i,{clamp:!1}),i=[0,100]);const w=x({...h,keyframes:i});let S;a==="mirror"&&(S=x({...h,keyframes:[...i].reverse(),velocity:-(h.velocity||0)}));let C="idle",M=null,P=null,T=null;w.calculatedDuration===null&&r&&(w.calculatedDuration=Ib(w));const{calculatedDuration:A}=w;let E=1/0,z=1/0;A!==null&&(E=A+o,z=E*(r+1)-o);let N=0;const L=V=>{if(P===null)return;f>0&&(P=Math.min(P,V)),f<0&&(P=Math.min(V-z/f,P)),M!==null?N=M:N=Math.round(V-P)*f;const W=N-t*(f>=0?1:-1),et=f>=0?W<0:W>z;N=Math.max(W,0),C==="finished"&&M===null&&(N=z);let Z=N,O=w;if(r){const kt=Math.min(N,z)/E;let it=Math.floor(kt),Lt=kt%1;!Lt&&kt>=1&&(Lt=1),Lt===1&&it--,it=Math.min(it,r+1),!!(it%2)&&(a==="reverse"?(Lt=1-Lt,o&&(Lt-=o/E)):a==="mirror"&&(O=S)),Z=Hs(0,1,Lt)*E}const U=et?{done:!1,value:i[0]}:O.next(Z);_&&(U.value=_(U.value));let{done:lt}=U;!et&&A!==null&&(lt=f>=0?N>=z:N<=0);const ct=M===null&&(C==="finished"||C==="running"&<);return d&&d(U.value),ct&&D(),U},R=()=>{g&&g.stop(),g=void 0},B=()=>{C="idle",R(),m(),y(),P=T=null},D=()=>{C="finished",u&&u(),R(),m()},$=()=>{if(p)return;g||(g=n(L));const V=g.now();l&&l(),M!==null?P=V-M:(!P||C==="finished")&&(P=V),C==="finished"&&y(),T=P,M=null,C="running",g.start()};e&&$();const F={then(V,W){return v.then(V,W)},get time(){return Qi(N)},set time(V){V=Dr(V),N=V,M!==null||!g||f===0?M=V:P=g.now()-V/f},get duration(){const V=w.calculatedDuration===null?Ib(w):w.calculatedDuration;return Qi(V)},get speed(){return f},set speed(V){V===f||!g||(f=V,F.time=Qi(N))},get state(){return C},play:$,pause:()=>{C="paused",M=N},stop:()=>{p=!0,C!=="idle"&&(C="idle",c&&c(),B())},cancel:()=>{T!==null&&L(T),B()},complete:()=>{C="finished"},sample:V=>(P=0,L(V))};return F}function DI(e){let t;return()=>(t===void 0&&(t=e()),t)}const EI=DI(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),AI=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),du=10,OI=2e4,LI=(e,t)=>t.type==="spring"||e==="backgroundColor"||!pC(t.ease);function RI(e,t,{onUpdate:n,onComplete:i,...s}){if(!(EI()&&AI.has(t)&&!s.repeatDelay&&s.repeatType!=="mirror"&&s.damping!==0&&s.type!=="inertia"))return!1;let o=!1,a,l,c=!1;const u=()=>{l=new Promise(x=>{a=x})};u();let{keyframes:d,duration:h=300,ease:f,times:p}=s;if(LI(t,s)){const x=Xd({...s,repeat:0,delay:0});let _={done:!1,value:d[0]};const w=[];let S=0;for(;!_.done&&S{c=!1,m.cancel()},y=()=>{c=!0,zt.update(v),a(),u()};return m.onfinish=()=>{c||(e.set(H$(d,s)),i&&i(),y())},{then(x,_){return l.then(x,_)},attachTimeline(x){return m.timeline=x,m.onfinish=null,ce},get time(){return Qi(m.currentTime||0)},set time(x){m.currentTime=Dr(x)},get speed(){return m.playbackRate},set speed(x){m.playbackRate=x},get duration(){return Qi(h)},play:()=>{o||(m.play(),is(v))},pause:()=>m.pause(),stop:()=>{if(o=!0,m.playState==="idle")return;const{currentTime:x}=m;if(x){const _=Xd({...s,autoplay:!1});e.setWithVelocity(_.sample(x-du).value,_.sample(x).value,du)}y()},complete:()=>{c||m.finish()},cancel:y}}function NI({keyframes:e,delay:t,onUpdate:n,onComplete:i}){const s=()=>(n&&n(e[e.length-1]),i&&i(),{time:0,speed:1,duration:0,play:ce,pause:ce,stop:ce,then:r=>(r(),Promise.resolve()),cancel:ce,complete:ce});return t?Xd({keyframes:[0,1],duration:0,delay:t,onComplete:s}):s()}const jI={type:"spring",stiffness:500,damping:25,restSpeed:10},$I=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),II={type:"keyframes",duration:.8},FI={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},BI=(e,{keyframes:t})=>t.length>2?II:Ur.has(e)?e.startsWith("scale")?$I(t[1]):jI:FI,Rm=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Us.test(t)||t==="0")&&!t.startsWith("url(")),VI=new Set(["brightness","contrast","saturate","opacity"]);function zI(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=n.match(Ih)||[];if(!i)return e;const s=n.replace(i,"");let r=VI.has(t)?1:0;return i!==n&&(r*=100),t+"("+r+s+")"}const WI=/([a-z-]*)\(.*?\)/g,Nm={...Us,getAnimatableNone:e=>{const t=e.match(WI);return t?t.map(zI).join(" "):e}},HI={...QM,color:We,backgroundColor:We,outlineColor:We,fill:We,stroke:We,borderColor:We,borderTopColor:We,borderRightColor:We,borderBottomColor:We,borderLeftColor:We,filter:Nm,WebkitFilter:Nm},Yy=e=>HI[e];function IC(e,t){let n=Yy(e);return n!==Nm&&(n=Us),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const FC=e=>/^0[^.\s]+$/.test(e);function UI(e){if(typeof e=="number")return e===0;if(e!==null)return e==="none"||e==="0"||FC(e)}function YI(e,t,n,i){const s=Rm(t,n);let r;Array.isArray(n)?r=[...n]:r=[null,n];const o=i.from!==void 0?i.from:e.get();let a;const l=[];for(let c=0;cs=>{const r=Xy(i,e)||{},o=r.delay||i.delay||0;let{elapsed:a=0}=i;a=a-Dr(o);const l=YI(t,e,n,r),c=l[0],u=l[l.length-1],d=Rm(e,c),h=Rm(e,u);let f={keyframes:l,velocity:t.getVelocity(),ease:"easeOut",...r,delay:-a,onUpdate:p=>{t.set(p),r.onUpdate&&r.onUpdate(p)},onComplete:()=>{s(),r.onComplete&&r.onComplete()}};if(XI(r)||(f={...f,...BI(e,f)}),f.duration&&(f.duration=Dr(f.duration)),f.repeatDelay&&(f.repeatDelay=Dr(f.repeatDelay)),!d||!h||z$.current||r.type===!1||KI.skipAnimations)return NI(f);if(!i.isHandoff&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const p=RI(t,e,f);if(p)return p}return Xd(f)};function Kd(e){return!!(un(e)&&e.add)}const BC=e=>/^\-?\d*\.?\d+$/.test(e);function Gy(e,t){e.indexOf(t)===-1&&e.push(t)}function qy(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Qy{constructor(){this.subscriptions=[]}add(t){return Gy(this.subscriptions,t),()=>qy(this.subscriptions,t)}notify(t,n,i){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,i);else for(let r=0;r!isNaN(parseFloat(e));class qI{constructor(t,n={}){this.version="10.18.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(i,s=!0)=>{this.prev=this.current,this.current=i;const{delta:r,timestamp:o}=je;this.lastUpdated!==o&&(this.timeDelta=r,this.lastUpdated=o,zt.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),s&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>zt.postRender(this.velocityCheck),this.velocityCheck=({timestamp:i})=>{i!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=GI(this.current),this.owner=n.owner}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Qy);const i=this.events[t].add(n);return t==="change"?()=>{i(),zt.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,i){this.set(n),this.prev=t,this.timeDelta=i}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?NC(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Qo(e,t){return new qI(e,t)}const VC=e=>t=>t.test(e),QI={test:e=>e==="auto",parse:e=>e},zC=[Yr,st,bi,ps,s$,i$,QI],Ma=e=>zC.find(VC(e)),ZI=[...zC,We,Us],JI=e=>ZI.find(VC(e));function tF(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Qo(n))}function eF(e,t){const n=Bh(e,t);let{transitionEnd:i={},transition:s={},...r}=n?e.makeTargetAnimatable(n,!1):{};r={...r,...i};for(const o in r){const a=v$(r[o]);tF(e,o,a)}}function nF(e,t,n){var i,s;const r=Object.keys(t).filter(a=>!e.hasValue(a)),o=r.length;if(o)for(let a=0;al.remove(d))),c.push(v)}return o&&Promise.all(c).then(()=>{o&&eF(e,o)}),c}function jm(e,t,n={}){const i=Bh(e,t,n.custom);let{transition:s=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const r=i?()=>Promise.all(WC(e,i,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:u,staggerDirection:d}=s;return aF(e,t,c+l,u,d,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[l,c]=a==="beforeChildren"?[r,o]:[o,r];return l().then(()=>c())}else return Promise.all([r(),o(n.delay)])}function aF(e,t,n=0,i=0,s=1,r){const o=[],a=(e.variantChildren.size-1)*i,l=s===1?(c=0)=>c*i:(c=0)=>a-c*i;return Array.from(e.variantChildren).sort(lF).forEach((c,u)=>{c.notify("AnimationStart",t),o.push(jm(c,t,{...r,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function lF(e,t){return e.sortNodePosition(t)}function cF(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const s=t.map(r=>jm(e,r,n));i=Promise.all(s)}else if(typeof t=="string")i=jm(e,t,n);else{const s=typeof t=="function"?Bh(e,t,n.custom):t;i=Promise.all(WC(e,s,n))}return i.then(()=>e.notify("AnimationComplete",t))}const uF=[...Oy].reverse(),dF=Oy.length;function hF(e){return t=>Promise.all(t.map(({animation:n,options:i})=>cF(e,n,i)))}function fF(e){let t=hF(e);const n=mF();let i=!0;const s=(l,c)=>{const u=Bh(e,c);if(u){const{transition:d,transitionEnd:h,...f}=u;l={...l,...f,...h}}return l};function r(l){t=l(e)}function o(l,c){const u=e.getProps(),d=e.getVariantContext(!0)||{},h=[],f=new Set;let p={},m=1/0;for(let y=0;ym&&w,T=!1;const A=Array.isArray(_)?_:[_];let E=A.reduce(s,{});S===!1&&(E={});const{prevResolvedValues:z={}}=x,N={...z,...E},L=R=>{P=!0,f.has(R)&&(T=!0,f.delete(R)),x.needsAnimating[R]=!0};for(const R in N){const B=E[R],D=z[R];if(p.hasOwnProperty(R))continue;let $=!1;Hd(B)&&Hd(D)?$=!hC(B,D):$=B!==D,$?B!==void 0?L(R):f.add(R):B!==void 0&&f.has(R)?L(R):x.protectedKeys[R]=!0}x.prevProp=_,x.prevResolvedValues=E,x.isActive&&(p={...p,...E}),i&&e.blockInitialAnimation&&(P=!1),P&&(!C||T)&&h.push(...A.map(R=>({animation:R,options:{type:g,...l}})))}if(f.size){const y={};f.forEach(g=>{const x=e.getBaseTarget(g);x!==void 0&&(y[g]=x)}),h.push({animation:y})}let v=!!h.length;return i&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(v=!1),i=!1,v?t(h):Promise.resolve()}function a(l,c,u){var d;if(n[l].isActive===c)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(f=>{var p;return(p=f.animationState)===null||p===void 0?void 0:p.setActive(l,c)}),n[l].isActive=c;const h=o(u,l);for(const f in n)n[f].protectedKeys={};return h}return{animateChanges:o,setActive:a,setAnimateFunction:r,getState:()=>n}}function pF(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!hC(t,e):!1}function lr(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function mF(){return{animate:lr(!0),whileInView:lr(),whileHover:lr(),whileTap:lr(),whileDrag:lr(),whileFocus:lr(),exit:lr()}}class gF extends tr{constructor(t){super(t),t.animationState||(t.animationState=fF(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),jh(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){}}let yF=0;class vF extends tr{constructor(){super(...arguments),this.id=yF++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n,custom:i}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const r=this.node.animationState.setActive("exit",!t,{custom:i??this.node.getProps().custom});n&&!t&&r.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const xF={animation:{Feature:gF},exit:{Feature:vF}},Fb=(e,t)=>Math.abs(e-t);function bF(e,t){const n=Fb(e.x,t.x),i=Fb(e.y,t.y);return Math.sqrt(n**2+i**2)}class HC{constructor(t,n,{transformPagePoint:i,contextWindow:s,dragSnapToOrigin:r=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=tp(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,f=bF(d.offset,{x:0,y:0})>=3;if(!h&&!f)return;const{point:p}=d,{timestamp:m}=je;this.history.push({...p,timestamp:m});const{onStart:v,onMove:y}=this.handlers;h||(v&&v(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,h)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Jf(h,this.transformPagePoint),zt.update(this.updatePoint,!0)},this.handlePointerUp=(d,h)=>{this.end();const{onEnd:f,onSessionEnd:p,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=tp(d.type==="pointercancel"?this.lastMoveEventInfo:Jf(h,this.transformPagePoint),this.history);this.startEvent&&f&&f(d,v),p&&p(d,v)},!aC(t))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=i,this.contextWindow=s||window;const o=Fh(t),a=Jf(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=je;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=n;u&&u(t,tp(a,this.history)),this.removeListeners=Is(qi(this.contextWindow,"pointermove",this.handlePointerMove),qi(this.contextWindow,"pointerup",this.handlePointerUp),qi(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),is(this.updatePoint)}}function Jf(e,t){return t?{point:t(e.point)}:e}function Bb(e,t){return{x:e.x-t.x,y:e.y-t.y}}function tp({point:e},t){return{point:e,delta:Bb(e,UC(t)),offset:Bb(e,_F(t)),velocity:wF(t,.1)}}function _F(e){return e[0]}function UC(e){return e[e.length-1]}function wF(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const s=UC(e);for(;n>=0&&(i=e[n],!(s.timestamp-i.timestamp>Dr(t)));)n--;if(!i)return{x:0,y:0};const r=Qi(s.timestamp-i.timestamp);if(r===0)return{x:0,y:0};const o={x:(s.x-i.x)/r,y:(s.y-i.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function wn(e){return e.max-e.min}function $m(e,t=0,n=.01){return Math.abs(e-t)<=n}function Vb(e,t,n,i=.5){e.origin=i,e.originPoint=ee(t.min,t.max,e.origin),e.scale=wn(n)/wn(t),($m(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=ee(n.min,n.max,e.origin)-e.originPoint,($m(e.translate)||isNaN(e.translate))&&(e.translate=0)}function vl(e,t,n,i){Vb(e.x,t.x,n.x,i?i.originX:void 0),Vb(e.y,t.y,n.y,i?i.originY:void 0)}function zb(e,t,n){e.min=n.min+t.min,e.max=e.min+wn(t)}function kF(e,t,n){zb(e.x,t.x,n.x),zb(e.y,t.y,n.y)}function Wb(e,t,n){e.min=t.min-n.min,e.max=e.min+wn(t)}function xl(e,t,n){Wb(e.x,t.x,n.x),Wb(e.y,t.y,n.y)}function SF(e,{min:t,max:n},i){return t!==void 0&&en&&(e=i?ee(n,e,i.max):Math.min(e,n)),e}function Hb(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function MF(e,{top:t,left:n,bottom:i,right:s}){return{x:Hb(e.x,n,s),y:Hb(e.y,t,i)}}function Ub(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.mini?n=Ql(t.min,t.max-i,e.min):i>s&&(n=Ql(e.min,e.max-s,t.min)),Hs(0,1,n)}function TF(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Im=.35;function DF(e=Im){return e===!1?e=0:e===!0&&(e=Im),{x:Yb(e,"left","right"),y:Yb(e,"top","bottom")}}function Yb(e,t,n){return{min:Xb(e,t),max:Xb(e,n)}}function Xb(e,t){return typeof e=="number"?e:e[t]||0}const Kb=()=>({translate:0,scale:1,origin:0,originPoint:0}),ko=()=>({x:Kb(),y:Kb()}),Gb=()=>({min:0,max:0}),fe=()=>({x:Gb(),y:Gb()});function An(e){return[e("x"),e("y")]}function YC({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function EF({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function AF(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function ep(e){return e===void 0||e===1}function Fm({scale:e,scaleX:t,scaleY:n}){return!ep(e)||!ep(t)||!ep(n)}function mr(e){return Fm(e)||XC(e)||e.z||e.rotate||e.rotateX||e.rotateY}function XC(e){return qb(e.x)||qb(e.y)}function qb(e){return e&&e!=="0%"}function Gd(e,t,n){const i=e-n,s=t*i;return n+s}function Qb(e,t,n,i,s){return s!==void 0&&(e=Gd(e,s,i)),Gd(e,n,i)+t}function Bm(e,t=0,n=1,i,s){e.min=Qb(e.min,t,n,i,s),e.max=Qb(e.max,t,n,i,s)}function KC(e,{x:t,y:n}){Bm(e.x,t.translate,t.scale,t.originPoint),Bm(e.y,n.translate,n.scale,n.originPoint)}function OF(e,t,n,i=!1){const s=n.length;if(!s)return;t.x=t.y=1;let r,o;for(let a=0;a1.0000000000001||e<.999999999999?e:1}function ys(e,t){e.min=e.min+t,e.max=e.max+t}function Jb(e,t,[n,i,s]){const r=t[s]!==void 0?t[s]:.5,o=ee(e.min,e.max,r);Bm(e,t[n],t[i],o,t.scale)}const LF=["x","scaleX","originX"],RF=["y","scaleY","originY"];function So(e,t){Jb(e.x,t,LF),Jb(e.y,t,RF)}function GC(e,t){return YC(AF(e.getBoundingClientRect(),t))}function NF(e,t,n){const i=GC(e,n),{scroll:s}=t;return s&&(ys(i.x,s.offset.x),ys(i.y,s.offset.y)),i}const qC=({current:e})=>e?e.ownerDocument.defaultView:null,jF=new WeakMap;class $F{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=fe(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const s=u=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Fh(u,"page").point)},r=(u,d)=>{const{drag:h,dragPropagation:f,onDragStart:p}=this.getProps();if(h&&!f&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=cC(h),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),An(v=>{let y=this.getAxisMotionValue(v).get()||0;if(bi.test(y)){const{projection:g}=this.visualElement;if(g&&g.layout){const x=g.layout.layoutBox[v];x&&(y=wn(x)*(parseFloat(y)/100))}}this.originPoint[v]=y}),p&&zt.update(()=>p(u,d),!1,!0);const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},o=(u,d)=>{const{dragPropagation:h,dragDirectionLock:f,onDirectionLock:p,onDrag:m}=this.getProps();if(!h&&!this.openGlobalLock)return;const{offset:v}=d;if(f&&this.currentDirection===null){this.currentDirection=IF(v),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",d.point,v),this.updateAxis("y",d.point,v),this.visualElement.render(),m&&m(u,d)},a=(u,d)=>this.stop(u,d),l=()=>An(u=>{var d;return this.getAnimationState(u)==="paused"&&((d=this.getAxisMotionValue(u).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new HC(t,{onSessionStart:s,onStart:r,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:qC(this.visualElement)})}stop(t,n){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:r}=this.getProps();r&&zt.update(()=>r(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,i){const{drag:s}=this.getProps();if(!i||!hu(t,s,this.currentDirection))return;const r=this.getAxisMotionValue(t);let o=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(o=SF(o,this.constraints[t],this.elastic[t])),r.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:i}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,r=this.constraints;n&&_o(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=MF(s.layoutBox,n):this.constraints=!1,this.elastic=DF(i),r!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&An(o=>{this.getAxisMotionValue(o)&&(this.constraints[o]=TF(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!_o(t))return!1;const i=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const r=NF(i,s.root,this.visualElement.getTransformPagePoint());let o=CF(s.layout.layoutBox,r);if(n){const a=n(EF(o));this.hasMutatedConstraints=!!a,a&&(o=YC(a))}return o}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:s,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=An(u=>{if(!hu(u,n,this.currentDirection))return;let d=l&&l[u]||{};o&&(d={min:0,max:0});const h=s?200:1e6,f=s?40:1e7,p={type:"inertia",velocity:i?t[u]:0,bounceStiffness:h,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...r,...d};return this.startAxisValueAnimation(u,p)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const i=this.getAxisMotionValue(t);return i.start(Ky(t,i,0,n))}stopAnimation(){An(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){An(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n="_drag"+t.toUpperCase(),i=this.visualElement.getProps(),s=i[n];return s||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){An(n=>{const{drag:i}=this.getProps();if(!hu(n,i,this.currentDirection))return;const{projection:s}=this.visualElement,r=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n];r.set(t[n]-ee(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!_o(n)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};An(o=>{const a=this.getAxisMotionValue(o);if(a){const l=a.get();s[o]=PF({min:l,max:l},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),An(o=>{if(!hu(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(ee(l,c,s[o]))})}addListeners(){if(!this.visualElement.current)return;jF.set(this.visualElement,this);const t=this.visualElement.current,n=qi(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),i=()=>{const{dragConstraints:l}=this.getProps();_o(l)&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,r=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),i();const o=Hi(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(An(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())});return()=>{o(),n(),r(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:s=!1,dragConstraints:r=!1,dragElastic:o=Im,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:s,dragConstraints:r,dragElastic:o,dragMomentum:a}}}function hu(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function IF(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class FF extends tr{constructor(t){super(t),this.removeGroupControls=ce,this.removeListeners=ce,this.controls=new $F(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ce}unmount(){this.removeGroupControls(),this.removeListeners()}}const t1=e=>(t,n)=>{e&&zt.update(()=>e(t,n))};class BF extends tr{constructor(){super(...arguments),this.removePointerDownListener=ce}onPointerDown(t){this.session=new HC(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:qC(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:s}=this.node.getProps();return{onSessionStart:t1(t),onStart:t1(n),onMove:i,onEnd:(r,o)=>{delete this.session,s&&zt.update(()=>s(r,o))}}}mount(){this.removePointerDownListener=qi(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function VF(){const e=k.useContext(Rh);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:i}=e,s=k.useId();return k.useEffect(()=>i(s),[]),!t&&n?[!1,()=>n&&n(s)]:[!0]}const nd={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function e1(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Ca={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(st.test(e))e=parseFloat(e);else return e;const n=e1(e,t.target.x),i=e1(e,t.target.y);return`${n}% ${i}%`}},zF={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,s=Us.parse(e);if(s.length>5)return i;const r=Us.createTransformer(e),o=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;s[0+o]/=a,s[1+o]/=l;const c=ee(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=c),typeof s[3+o]=="number"&&(s[3+o]/=c),r(s)}};class WF extends Y.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i,layoutId:s}=this.props,{projection:r}=t;qj(HF),r&&(n.group&&n.group.add(r),i&&i.register&&s&&i.register(r),r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),nd.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:i,drag:s,isPresent:r}=this.props,o=i.projection;return o&&(o.isPresent=r,s||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==r&&(r?o.promote():o.relegate()||zt.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),queueMicrotask(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),i&&i.deregister&&i.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function QC(e){const[t,n]=VF(),i=k.useContext(Ry);return Y.createElement(WF,{...e,layoutGroup:i,switchLayoutGroup:k.useContext(YM),isPresent:t,safeToRemove:n})}const HF={borderRadius:{...Ca,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ca,borderTopRightRadius:Ca,borderBottomLeftRadius:Ca,borderBottomRightRadius:Ca,boxShadow:zF},ZC=["TopLeft","TopRight","BottomLeft","BottomRight"],UF=ZC.length,n1=e=>typeof e=="string"?parseFloat(e):e,i1=e=>typeof e=="number"||st.test(e);function YF(e,t,n,i,s,r){s?(e.opacity=ee(0,n.opacity!==void 0?n.opacity:1,XF(i)),e.opacityExit=ee(t.opacity!==void 0?t.opacity:1,0,KF(i))):r&&(e.opacity=ee(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,i));for(let o=0;oit?1:n(Ql(e,t,i))}function r1(e,t){e.min=t.min,e.max=t.max}function Dn(e,t){r1(e.x,t.x),r1(e.y,t.y)}function o1(e,t,n,i,s){return e-=t,e=Gd(e,1/n,i),s!==void 0&&(e=Gd(e,1/s,i)),e}function GF(e,t=0,n=1,i=.5,s,r=e,o=e){if(bi.test(t)&&(t=parseFloat(t),t=ee(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=ee(r.min,r.max,i);e===r&&(a-=t),e.min=o1(e.min,t,n,a,s),e.max=o1(e.max,t,n,a,s)}function a1(e,t,[n,i,s],r,o){GF(e,t[n],t[i],t[s],t.scale,r,o)}const qF=["x","scaleX","originX"],QF=["y","scaleY","originY"];function l1(e,t,n,i){a1(e.x,t,qF,n?n.x:void 0,i?i.x:void 0),a1(e.y,t,QF,n?n.y:void 0,i?i.y:void 0)}function c1(e){return e.translate===0&&e.scale===1}function tP(e){return c1(e.x)&&c1(e.y)}function ZF(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function eP(e,t){return Math.round(e.x.min)===Math.round(t.x.min)&&Math.round(e.x.max)===Math.round(t.x.max)&&Math.round(e.y.min)===Math.round(t.y.min)&&Math.round(e.y.max)===Math.round(t.y.max)}function u1(e){return wn(e.x)/wn(e.y)}class JF{constructor(){this.members=[]}add(t){Gy(this.members,t),t.scheduleRender()}remove(t){if(qy(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let i;for(let s=n;s>=0;s--){const r=this.members[s];if(r.isPresent!==!1){i=r;break}}return i?(this.promote(i),!0):!1}promote(t,n){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,n&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:i}=t;n.onExitComplete&&n.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function d1(e,t,n){let i="";const s=e.x.translate/t.x,r=e.y.translate/t.y;if((s||r)&&(i=`translate3d(${s}px, ${r}px, 0) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:l,rotateX:c,rotateY:u}=n;l&&(i+=`rotate(${l}deg) `),c&&(i+=`rotateX(${c}deg) `),u&&(i+=`rotateY(${u}deg) `)}const o=e.x.scale*t.x,a=e.y.scale*t.y;return(o!==1||a!==1)&&(i+=`scale(${o}, ${a})`),i||"none"}const tB=(e,t)=>e.depth-t.depth;class eB{constructor(){this.children=[],this.isDirty=!1}add(t){Gy(this.children,t),this.isDirty=!0}remove(t){qy(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(tB),this.isDirty=!1,this.children.forEach(t)}}function nB(e,t){const n=performance.now(),i=({timestamp:s})=>{const r=s-n;r>=t&&(is(i),e(r-t))};return zt.read(i,!0),()=>is(i)}function iB(e){window.MotionDebug&&window.MotionDebug.record(e)}function sB(e){return e instanceof SVGElement&&e.tagName!=="svg"}function rB(e,t,n){const i=un(e)?e:Qo(e);return i.start(Ky("",i,t,n)),i.animation}const h1=["","X","Y","Z"],oB={visibility:"hidden"},f1=1e3;let aB=0;const gr={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function nP({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(o={},a=t==null?void 0:t()){this.id=aB++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,gr.totalNodes=gr.resolvedTargetDeltas=gr.recalculatedProjection=0,this.nodes.forEach(uB),this.nodes.forEach(mB),this.nodes.forEach(gB),this.nodes.forEach(dB),iB(gr)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=nB(h,250),nd.hasAnimatedSinceResize&&(nd.hasAnimatedSinceResize=!1,this.nodes.forEach(m1))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeTargetChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||u.getDefaultTransition()||_B,{onLayoutAnimationStart:v,onLayoutAnimationComplete:y}=u.getProps(),g=!this.targetLayout||!eP(this.targetLayout,p)||f,x=!h&&f;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||h&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,x);const _={...Xy(m,"layout"),onPlay:v,onComplete:y};(u.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_)}else h||m1(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,is(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(yB),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;uthis.update()))}clearAllSnapshots(){this.nodes.forEach(hB),this.sharedNodes.forEach(vB)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,zt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){zt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const w=_/1e3;g1(d.x,o.x,w),g1(d.y,o.y,w),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(xl(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),xB(this.relativeTarget,this.relativeTargetOrigin,h,w),x&&ZF(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=fe()),Dn(x,this.relativeTarget)),m&&(this.animationValues=u,YF(u,c,this.latestValues,w,g,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(is(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=zt.update(()=>{nd.hasAnimatedSinceResize=!0,this.currentAnimation=rB(0,f1,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(f1),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&iP(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||fe();const d=wn(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+d;const h=wn(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}Dn(a,l),So(a,u),vl(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new JF),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(a=!0),!a)return;const c={};for(let u=0;u{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(p1),this.root.sharedNodes.clear()}}}function lB(e){e.updateLayout()}function cB(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:s}=e.layout,{animationType:r}=e.options,o=n.source!==e.layout.source;r==="size"?An(d=>{const h=o?n.measuredBox[d]:n.layoutBox[d],f=wn(h);h.min=i[d].min,h.max=h.min+f}):iP(r,n.layoutBox,i)&&An(d=>{const h=o?n.measuredBox[d]:n.layoutBox[d],f=wn(i[d]);h.max=h.min+f,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+f)});const a=ko();vl(a,i,n.layoutBox);const l=ko();o?vl(l,e.applyTransform(s,!0),n.measuredBox):vl(l,i,n.layoutBox);const c=!tP(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:h,layout:f}=d;if(h&&f){const p=fe();xl(p,n.layoutBox,h.layoutBox);const m=fe();xl(m,i,f.layoutBox),eP(p,m)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=p,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:i,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeTargetChanged:u})}else if(e.isLead()){const{onExitComplete:i}=e.options;i&&i()}e.options.transition=void 0}function uB(e){gr.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function dB(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function hB(e){e.clearSnapshot()}function p1(e){e.clearMeasurements()}function fB(e){e.isLayoutDirty=!1}function pB(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function m1(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function mB(e){e.resolveTargetDelta()}function gB(e){e.calcProjection()}function yB(e){e.resetRotation()}function vB(e){e.removeLeadSnapshot()}function g1(e,t,n){e.translate=ee(t.translate,0,n),e.scale=ee(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function y1(e,t,n,i){e.min=ee(t.min,n.min,i),e.max=ee(t.max,n.max,i)}function xB(e,t,n,i){y1(e.x,t.x,n.x,i),y1(e.y,t.y,n.y,i)}function bB(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const _B={duration:.45,ease:[.4,0,.1,1]},v1=e=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(e),x1=v1("applewebkit/")&&!v1("chrome/")?Math.round:ce;function b1(e){e.min=x1(e.min),e.max=x1(e.max)}function wB(e){b1(e.x),b1(e.y)}function iP(e,t,n){return e==="position"||e==="preserve-aspect"&&!$m(u1(t),u1(n),.2)}const kB=nP({attachResizeListener:(e,t)=>Hi(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),np={current:void 0},sP=nP({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!np.current){const e=new kB({});e.mount(window),e.setOptions({layoutScroll:!0}),np.current=e}return np.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),SB={pan:{Feature:BF},drag:{Feature:FF,ProjectionNode:sP,MeasureLayout:QC}},MB=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function CB(e){const t=MB.exec(e);if(!t)return[,];const[,n,i]=t;return[n,i]}function Vm(e,t,n=1){const[i,s]=CB(e);if(!i)return;const r=window.getComputedStyle(t).getPropertyValue(i);if(r){const o=r.trim();return BC(o)?parseFloat(o):o}else return Em(s)?Vm(s,t,n+1):s}function PB(e,{...t},n){const i=e.current;if(!(i instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(s=>{const r=s.get();if(!Em(r))return;const o=Vm(r,i);o&&s.set(o)});for(const s in t){const r=t[s];if(!Em(r))continue;const o=Vm(r,i);o&&(t[s]=o,n||(n={}),n[s]===void 0&&(n[s]=r))}return{target:t,transitionEnd:n}}const TB=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),rP=e=>TB.has(e),DB=e=>Object.keys(e).some(rP),_1=e=>e===Yr||e===st,w1=(e,t)=>parseFloat(e.split(", ")[t]),k1=(e,t)=>(n,{transform:i})=>{if(i==="none"||!i)return 0;const s=i.match(/^matrix3d\((.+)\)$/);if(s)return w1(s[1],t);{const r=i.match(/^matrix\((.+)\)$/);return r?w1(r[1],e):0}},EB=new Set(["x","y","z"]),AB=yc.filter(e=>!EB.has(e));function OB(e){const t=[];return AB.forEach(n=>{const i=e.getValue(n);i!==void 0&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const Zo={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:k1(4,13),y:k1(5,14)};Zo.translateX=Zo.x;Zo.translateY=Zo.y;const LB=(e,t,n)=>{const i=t.measureViewportBox(),s=t.current,r=getComputedStyle(s),{display:o}=r,a={};o==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(c=>{a[c]=Zo[c](i,r)}),t.render();const l=t.measureViewportBox();return n.forEach(c=>{const u=t.getValue(c);u&&u.jump(a[c]),e[c]=Zo[c](l,r)}),e},RB=(e,t,n={},i={})=>{t={...t},i={...i};const s=Object.keys(t).filter(rP);let r=[],o=!1;const a=[];if(s.forEach(l=>{const c=e.getValue(l);if(!e.hasValue(l))return;let u=n[l],d=Ma(u);const h=t[l];let f;if(Hd(h)){const p=h.length,m=h[0]===null?1:0;u=h[m],d=Ma(u);for(let v=m;v=0?window.pageYOffset:null,c=LB(t,e,a);return r.length&&r.forEach(([u,d])=>{e.getValue(u).set(d)}),e.render(),Nh&&l!==null&&window.scrollTo({top:l}),{target:c,transitionEnd:i}}else return{target:t,transitionEnd:i}};function NB(e,t,n,i){return DB(t)?RB(e,t,n,i):{target:t,transitionEnd:i}}const jB=(e,t,n,i)=>{const s=PB(e,t,i);return t=s.target,i=s.transitionEnd,NB(e,t,n,i)},zm={current:null},oP={current:!1};function $B(){if(oP.current=!0,!!Nh)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>zm.current=e.matches;e.addListener(t),t()}else zm.current=!1}function IB(e,t,n){const{willChange:i}=t;for(const s in t){const r=t[s],o=n[s];if(un(r))e.addValue(s,r),Kd(i)&&i.add(s);else if(un(o))e.addValue(s,Qo(r,{owner:e})),Kd(i)&&i.remove(s);else if(o!==r)if(e.hasValue(s)){const a=e.getValue(s);!a.hasAnimated&&a.set(r)}else{const a=e.getStaticValue(s);e.addValue(s,Qo(a!==void 0?a:r,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const S1=new WeakMap,aP=Object.keys(ql),FB=aP.length,M1=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],BB=Ly.length;class VB{constructor({parent:t,props:n,presenceContext:i,reducedMotionConfig:s,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>zt.render(this.render,!1,!0);const{latestValues:a,renderState:l}=r;this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=o,this.isControllingVariants=$h(n),this.isVariantNode=UM(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:c,...u}=this.scrapeMotionValuesFromProps(n,{});for(const d in u){const h=u[d];a[d]!==void 0&&un(h)&&(h.set(a[d],!1),Kd(c)&&c.add(d))}}scrapeMotionValuesFromProps(t,n){return{}}mount(t){this.current=t,S1.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,i)=>this.bindToMotionValue(i,n)),oP.current||$B(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:zm.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){S1.delete(this.current),this.projection&&this.projection.unmount(),is(this.notifyUpdate),is(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,n){const i=Ur.has(t),s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&zt.update(this.notifyUpdate,!1,!0),i&&this.projection&&(this.projection.isTransformDirty=!0)}),r=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{s(),r()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures({children:t,...n},i,s,r){let o,a;for(let l=0;lthis.scheduleRender(),animationType:typeof c=="string"?c:"both",initialPromotionConfig:r,layoutScroll:h,layoutRoot:f})}return a}updateFeatures(){for(const t in this.features){const n=this.features[t];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):fe()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;in.variantChildren.delete(t)}addValue(t,n){n!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,n)),this.values.set(t,n),this.latestValues[t]=n.get()}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return i===void 0&&n!==void 0&&(i=Qo(n,{owner:this}),this.addValue(t,i)),i}readValue(t){var n;return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(n=this.getBaseTargetFromProps(this.props,t))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:i}=this.props,s=typeof i=="string"||typeof i=="object"?(n=Vy(this.props,i))===null||n===void 0?void 0:n[t]:void 0;if(i&&s!==void 0)return s;const r=this.getBaseTargetFromProps(this.props,t);return r!==void 0&&!un(r)?r:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Qy),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class lP extends VB{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:i}){delete n[t],delete i[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...i},{transformValues:s},r){let o=sF(i,t||{},this);if(s&&(n&&(n=s(n)),i&&(i=s(i)),o&&(o=s(o))),r){nF(this,i,o);const a=jB(this,i,o,n);n=a.transitionEnd,i=a.target}return{transition:t,transitionEnd:n,...i}}}function zB(e){return window.getComputedStyle(e)}class WB extends lP{constructor(){super(...arguments),this.type="html"}readValueFromInstance(t,n){if(Ur.has(n)){const i=Yy(n);return i&&i.default||0}else{const i=zB(t),s=(GM(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return GC(t,n)}build(t,n,i,s){jy(t,n,i,s.transformTemplate)}scrapeMotionValuesFromProps(t,n){return By(t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;un(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(t,n,i,s){eC(t,n,i,s)}}class HB extends lP{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ur.has(n)){const i=Yy(n);return i&&i.default||0}return n=nC.has(n)?n:Ay(n),t.getAttribute(n)}measureInstanceViewportBox(){return fe()}scrapeMotionValuesFromProps(t,n){return sC(t,n)}build(t,n,i,s){Iy(t,n,i,this.isSVGTag,s.transformTemplate)}renderInstance(t,n,i,s){iC(t,n,i,s)}mount(t){this.isSVGTag=Fy(t.tagName),super.mount(t)}}const UB=(e,t)=>Ny(e)?new HB(t,{enableHardwareAcceleration:!1}):new WB(t,{enableHardwareAcceleration:!0}),YB={layout:{ProjectionNode:sP,MeasureLayout:QC}},XB={...xF,...F$,...SB,...YB},Jo=Kj((e,t)=>C$(e,t,XB,UB));function cP(){const e=k.useRef(!1);return Ey(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function KB(){const e=cP(),[t,n]=k.useState(0),i=k.useCallback(()=>{e.current&&n(t+1)},[t]);return[k.useCallback(()=>zt.postRender(i),[i]),t]}class GB extends k.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function qB({children:e,isPresent:t}){const n=k.useId(),i=k.useRef(null),s=k.useRef({width:0,height:0,top:0,left:0});return k.useInsertionEffect(()=>{const{width:r,height:o,top:a,left:l}=s.current;if(t||!i.current||!r||!o)return;i.current.dataset.motionPopId=n;const c=document.createElement("style");return document.head.appendChild(c),c.sheet&&c.sheet.insertRule(` [data-motion-pop-id="${n}"] { position: absolute !important; width: ${r}px !important; @@ -89,4 +89,4 @@ Error generating stack: `+r.message+` * perfect-scrollbar v1.5.3 * Copyright 2021 Hyunje Jun, MDBootstrap and Contributors * Licensed under MIT - */function mi(e){return getComputedStyle(e)}function Ze(e,t){for(var n in t){var i=t[n];typeof i=="number"&&(i=i+"px"),e.style[n]=i}return e}function Du(e){var t=document.createElement("div");return t.className=e,t}var W_=typeof Element<"u"&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector);function Ts(e,t){if(!W_)throw new Error("No element matching method supported");return W_.call(e,t)}function Mo(e){e.remove?e.remove():e.parentNode&&e.parentNode.removeChild(e)}function H_(e,t){return Array.prototype.filter.call(e.children,function(n){return Ts(n,t)})}var pe={main:"ps",rtl:"ps__rtl",element:{thumb:function(e){return"ps__thumb-"+e},rail:function(e){return"ps__rail-"+e},consuming:"ps__child--consume"},state:{focus:"ps--focus",clicking:"ps--clicking",active:function(e){return"ps--active-"+e},scrolling:function(e){return"ps--scrolling-"+e}}},xT={x:null,y:null};function bT(e,t){var n=e.element.classList,i=pe.state.scrolling(t);n.contains(i)?clearTimeout(xT[t]):n.add(i)}function _T(e,t){xT[t]=setTimeout(function(){return e.isAlive&&e.element.classList.remove(pe.state.scrolling(t))},e.settings.scrollingThreshold)}function d4(e,t){bT(e,t),_T(e,t)}var Cc=function(e){this.element=e,this.handlers={}},wT={isEmpty:{configurable:!0}};Cc.prototype.bind=function(e,t){typeof this.handlers[e]>"u"&&(this.handlers[e]=[]),this.handlers[e].push(t),this.element.addEventListener(e,t,!1)};Cc.prototype.unbind=function(e,t){var n=this;this.handlers[e]=this.handlers[e].filter(function(i){return t&&i!==t?!0:(n.element.removeEventListener(e,i,!1),!1)})};Cc.prototype.unbindAll=function(){for(var e in this.handlers)this.unbind(e)};wT.isEmpty.get=function(){var e=this;return Object.keys(this.handlers).every(function(t){return e.handlers[t].length===0})};Object.defineProperties(Cc.prototype,wT);var la=function(){this.eventElements=[]};la.prototype.eventElement=function(e){var t=this.eventElements.filter(function(n){return n.element===e})[0];return t||(t=new Cc(e),this.eventElements.push(t)),t};la.prototype.bind=function(e,t,n){this.eventElement(e).bind(t,n)};la.prototype.unbind=function(e,t,n){var i=this.eventElement(e);i.unbind(t,n),i.isEmpty&&this.eventElements.splice(this.eventElements.indexOf(i),1)};la.prototype.unbindAll=function(){this.eventElements.forEach(function(e){return e.unbindAll()}),this.eventElements=[]};la.prototype.once=function(e,t,n){var i=this.eventElement(e),s=function(r){i.unbind(t,s),n(r)};i.bind(t,s)};function Eu(e){if(typeof window.CustomEvent=="function")return new CustomEvent(e);var t=document.createEvent("CustomEvent");return t.initCustomEvent(e,!1,!1,void 0),t}function ah(e,t,n,i,s){i===void 0&&(i=!0),s===void 0&&(s=!1);var r;if(t==="top")r=["contentHeight","containerHeight","scrollTop","y","up","down"];else if(t==="left")r=["contentWidth","containerWidth","scrollLeft","x","left","right"];else throw new Error("A proper axis should be provided");h4(e,n,r,i,s)}function h4(e,t,n,i,s){var r=n[0],o=n[1],a=n[2],l=n[3],c=n[4],u=n[5];i===void 0&&(i=!0),s===void 0&&(s=!1);var d=e.element;e.reach[l]=null,d[a]<1&&(e.reach[l]="start"),d[a]>e[r]-e[o]-1&&(e.reach[l]="end"),t&&(d.dispatchEvent(Eu("ps-scroll-"+l)),t<0?d.dispatchEvent(Eu("ps-scroll-"+c)):t>0&&d.dispatchEvent(Eu("ps-scroll-"+u)),i&&d4(e,l)),e.reach[l]&&(t||s)&&d.dispatchEvent(Eu("ps-"+l+"-reach-"+e.reach[l]))}function Jt(e){return parseInt(e,10)||0}function f4(e){return Ts(e,"input,[contenteditable]")||Ts(e,"select,[contenteditable]")||Ts(e,"textarea,[contenteditable]")||Ts(e,"button,[contenteditable]")}function p4(e){var t=mi(e);return Jt(t.width)+Jt(t.paddingLeft)+Jt(t.paddingRight)+Jt(t.borderLeftWidth)+Jt(t.borderRightWidth)}var ao={isWebKit:typeof document<"u"&&"WebkitAppearance"in document.documentElement.style,supportsTouch:typeof window<"u"&&("ontouchstart"in window||"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>0||window.DocumentTouch&&document instanceof window.DocumentTouch),supportsIePointer:typeof navigator<"u"&&navigator.msMaxTouchPoints,isChrome:typeof navigator<"u"&&/Chrome/i.test(navigator&&navigator.userAgent)};function ss(e){var t=e.element,n=Math.floor(t.scrollTop),i=t.getBoundingClientRect();e.containerWidth=Math.round(i.width),e.containerHeight=Math.round(i.height),e.contentWidth=t.scrollWidth,e.contentHeight=t.scrollHeight,t.contains(e.scrollbarXRail)||(H_(t,pe.element.rail("x")).forEach(function(s){return Mo(s)}),t.appendChild(e.scrollbarXRail)),t.contains(e.scrollbarYRail)||(H_(t,pe.element.rail("y")).forEach(function(s){return Mo(s)}),t.appendChild(e.scrollbarYRail)),!e.settings.suppressScrollX&&e.containerWidth+e.settings.scrollXMarginOffset=e.railXWidth-e.scrollbarXWidth&&(e.scrollbarXLeft=e.railXWidth-e.scrollbarXWidth),e.scrollbarYTop>=e.railYHeight-e.scrollbarYHeight&&(e.scrollbarYTop=e.railYHeight-e.scrollbarYHeight),m4(t,e),e.scrollbarXActive?t.classList.add(pe.state.active("x")):(t.classList.remove(pe.state.active("x")),e.scrollbarXWidth=0,e.scrollbarXLeft=0,t.scrollLeft=e.isRtl===!0?e.contentWidth:0),e.scrollbarYActive?t.classList.add(pe.state.active("y")):(t.classList.remove(pe.state.active("y")),e.scrollbarYHeight=0,e.scrollbarYTop=0,t.scrollTop=0)}function U_(e,t){return e.settings.minScrollbarLength&&(t=Math.max(t,e.settings.minScrollbarLength)),e.settings.maxScrollbarLength&&(t=Math.min(t,e.settings.maxScrollbarLength)),t}function m4(e,t){var n={width:t.railXWidth},i=Math.floor(e.scrollTop);t.isRtl?n.left=t.negativeScrollAdjustment+e.scrollLeft+t.containerWidth-t.contentWidth:n.left=e.scrollLeft,t.isScrollbarXUsingBottom?n.bottom=t.scrollbarXBottom-i:n.top=t.scrollbarXTop+i,Ze(t.scrollbarXRail,n);var s={top:i,height:t.railYHeight};t.isScrollbarYUsingRight?t.isRtl?s.right=t.contentWidth-(t.negativeScrollAdjustment+e.scrollLeft)-t.scrollbarYRight-t.scrollbarYOuterWidth-9:s.right=t.scrollbarYRight-e.scrollLeft:t.isRtl?s.left=t.negativeScrollAdjustment+e.scrollLeft+t.containerWidth*2-t.contentWidth-t.scrollbarYLeft-t.scrollbarYOuterWidth:s.left=t.scrollbarYLeft+e.scrollLeft,Ze(t.scrollbarYRail,s),Ze(t.scrollbarX,{left:t.scrollbarXLeft,width:t.scrollbarXWidth-t.railBorderXWidth}),Ze(t.scrollbarY,{top:t.scrollbarYTop,height:t.scrollbarYHeight-t.railBorderYWidth})}function g4(e){e.element,e.event.bind(e.scrollbarY,"mousedown",function(t){return t.stopPropagation()}),e.event.bind(e.scrollbarYRail,"mousedown",function(t){var n=t.pageY-window.pageYOffset-e.scrollbarYRail.getBoundingClientRect().top,i=n>e.scrollbarYTop?1:-1;e.element.scrollTop+=i*e.containerHeight,ss(e),t.stopPropagation()}),e.event.bind(e.scrollbarX,"mousedown",function(t){return t.stopPropagation()}),e.event.bind(e.scrollbarXRail,"mousedown",function(t){var n=t.pageX-window.pageXOffset-e.scrollbarXRail.getBoundingClientRect().left,i=n>e.scrollbarXLeft?1:-1;e.element.scrollLeft+=i*e.containerWidth,ss(e),t.stopPropagation()})}function y4(e){Y_(e,["containerWidth","contentWidth","pageX","railXWidth","scrollbarX","scrollbarXWidth","scrollLeft","x","scrollbarXRail"]),Y_(e,["containerHeight","contentHeight","pageY","railYHeight","scrollbarY","scrollbarYHeight","scrollTop","y","scrollbarYRail"])}function Y_(e,t){var n=t[0],i=t[1],s=t[2],r=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8],d=e.element,h=null,f=null,p=null;function m(g){g.touches&&g.touches[0]&&(g[s]=g.touches[0].pageY),d[l]=h+p*(g[s]-f),bT(e,c),ss(e),g.stopPropagation(),g.type.startsWith("touch")&&g.changedTouches.length>1&&g.preventDefault()}function v(){_T(e,c),e[u].classList.remove(pe.state.clicking),e.event.unbind(e.ownerDocument,"mousemove",m)}function y(g,x){h=d[l],x&&g.touches&&(g[s]=g.touches[0].pageY),f=g[s],p=(e[i]-e[n])/(e[r]-e[a]),x?e.event.bind(e.ownerDocument,"touchmove",m):(e.event.bind(e.ownerDocument,"mousemove",m),e.event.once(e.ownerDocument,"mouseup",v),g.preventDefault()),e[u].classList.add(pe.state.clicking),g.stopPropagation()}e.event.bind(e[o],"mousedown",function(g){y(g)}),e.event.bind(e[o],"touchstart",function(g){y(g,!0)})}function v4(e){var t=e.element,n=function(){return Ts(t,":hover")},i=function(){return Ts(e.scrollbarX,":focus")||Ts(e.scrollbarY,":focus")};function s(r,o){var a=Math.floor(t.scrollTop);if(r===0){if(!e.scrollbarYActive)return!1;if(a===0&&o>0||a>=e.contentHeight-e.containerHeight&&o<0)return!e.settings.wheelPropagation}var l=t.scrollLeft;if(o===0){if(!e.scrollbarXActive)return!1;if(l===0&&r<0||l>=e.contentWidth-e.containerWidth&&r>0)return!e.settings.wheelPropagation}return!0}e.event.bind(e.ownerDocument,"keydown",function(r){if(!(r.isDefaultPrevented&&r.isDefaultPrevented()||r.defaultPrevented)&&!(!n()&&!i())){var o=document.activeElement?document.activeElement:e.ownerDocument.activeElement;if(o){if(o.tagName==="IFRAME")o=o.contentDocument.activeElement;else for(;o.shadowRoot;)o=o.shadowRoot.activeElement;if(f4(o))return}var a=0,l=0;switch(r.which){case 37:r.metaKey?a=-e.contentWidth:r.altKey?a=-e.containerWidth:a=-30;break;case 38:r.metaKey?l=e.contentHeight:r.altKey?l=e.containerHeight:l=30;break;case 39:r.metaKey?a=e.contentWidth:r.altKey?a=e.containerWidth:a=30;break;case 40:r.metaKey?l=-e.contentHeight:r.altKey?l=-e.containerHeight:l=-30;break;case 32:r.shiftKey?l=e.containerHeight:l=-e.containerHeight;break;case 33:l=e.containerHeight;break;case 34:l=-e.containerHeight;break;case 36:l=e.contentHeight;break;case 35:l=-e.contentHeight;break;default:return}e.settings.suppressScrollX&&a!==0||e.settings.suppressScrollY&&l!==0||(t.scrollTop-=l,t.scrollLeft+=a,ss(e),s(a,l)&&r.preventDefault())}})}function x4(e){var t=e.element;function n(o,a){var l=Math.floor(t.scrollTop),c=t.scrollTop===0,u=l+t.offsetHeight===t.scrollHeight,d=t.scrollLeft===0,h=t.scrollLeft+t.offsetWidth===t.scrollWidth,f;return Math.abs(a)>Math.abs(o)?f=c||u:f=d||h,f?!e.settings.wheelPropagation:!0}function i(o){var a=o.deltaX,l=-1*o.deltaY;return(typeof a>"u"||typeof l>"u")&&(a=-1*o.wheelDeltaX/6,l=o.wheelDeltaY/6),o.deltaMode&&o.deltaMode===1&&(a*=10,l*=10),a!==a&&l!==l&&(a=0,l=o.wheelDelta),o.shiftKey?[-l,-a]:[a,l]}function s(o,a,l){if(!ao.isWebKit&&t.querySelector("select:focus"))return!0;if(!t.contains(o))return!1;for(var c=o;c&&c!==t;){if(c.classList.contains(pe.element.consuming))return!0;var u=mi(c);if(l&&u.overflowY.match(/(scroll|auto)/)){var d=c.scrollHeight-c.clientHeight;if(d>0&&(c.scrollTop>0&&l<0||c.scrollTop0))return!0}if(a&&u.overflowX.match(/(scroll|auto)/)){var h=c.scrollWidth-c.clientWidth;if(h>0&&(c.scrollLeft>0&&a<0||c.scrollLeft0))return!0}c=c.parentNode}return!1}function r(o){var a=i(o),l=a[0],c=a[1];if(!s(o.target,l,c)){var u=!1;e.settings.useBothWheelAxes?e.scrollbarYActive&&!e.scrollbarXActive?(c?t.scrollTop-=c*e.settings.wheelSpeed:t.scrollTop+=l*e.settings.wheelSpeed,u=!0):e.scrollbarXActive&&!e.scrollbarYActive&&(l?t.scrollLeft+=l*e.settings.wheelSpeed:t.scrollLeft-=c*e.settings.wheelSpeed,u=!0):(t.scrollTop-=c*e.settings.wheelSpeed,t.scrollLeft+=l*e.settings.wheelSpeed),ss(e),u=u||n(l,c),u&&!o.ctrlKey&&(o.stopPropagation(),o.preventDefault())}}typeof window.onwheel<"u"?e.event.bind(t,"wheel",r):typeof window.onmousewheel<"u"&&e.event.bind(t,"mousewheel",r)}function b4(e){if(!ao.supportsTouch&&!ao.supportsIePointer)return;var t=e.element;function n(p,m){var v=Math.floor(t.scrollTop),y=t.scrollLeft,g=Math.abs(p),x=Math.abs(m);if(x>g){if(m<0&&v===e.contentHeight-e.containerHeight||m>0&&v===0)return window.scrollY===0&&m>0&&ao.isChrome}else if(g>x&&(p<0&&y===e.contentWidth-e.containerWidth||p>0&&y===0))return!0;return!0}function i(p,m){t.scrollTop-=m,t.scrollLeft-=p,ss(e)}var s={},r=0,o={},a=null;function l(p){return p.targetTouches?p.targetTouches[0]:p}function c(p){return p.pointerType&&p.pointerType==="pen"&&p.buttons===0?!1:!!(p.targetTouches&&p.targetTouches.length===1||p.pointerType&&p.pointerType!=="mouse"&&p.pointerType!==p.MSPOINTER_TYPE_MOUSE)}function u(p){if(c(p)){var m=l(p);s.pageX=m.pageX,s.pageY=m.pageY,r=new Date().getTime(),a!==null&&clearInterval(a)}}function d(p,m,v){if(!t.contains(p))return!1;for(var y=p;y&&y!==t;){if(y.classList.contains(pe.element.consuming))return!0;var g=mi(y);if(v&&g.overflowY.match(/(scroll|auto)/)){var x=y.scrollHeight-y.clientHeight;if(x>0&&(y.scrollTop>0&&v<0||y.scrollTop0))return!0}if(m&&g.overflowX.match(/(scroll|auto)/)){var _=y.scrollWidth-y.clientWidth;if(_>0&&(y.scrollLeft>0&&m<0||y.scrollLeft<_&&m>0))return!0}y=y.parentNode}return!1}function h(p){if(c(p)){var m=l(p),v={pageX:m.pageX,pageY:m.pageY},y=v.pageX-s.pageX,g=v.pageY-s.pageY;if(d(p.target,y,g))return;i(y,g),s=v;var x=new Date().getTime(),_=x-r;_>0&&(o.x=y/_,o.y=g/_,r=x),n(y,g)&&p.preventDefault()}}function f(){e.settings.swipeEasing&&(clearInterval(a),a=setInterval(function(){if(e.isInitialized){clearInterval(a);return}if(!o.x&&!o.y){clearInterval(a);return}if(Math.abs(o.x)<.01&&Math.abs(o.y)<.01){clearInterval(a);return}if(!e.element){clearInterval(a);return}i(o.x*30,o.y*30),o.x*=.8,o.y*=.8},10))}ao.supportsTouch?(e.event.bind(t,"touchstart",u),e.event.bind(t,"touchmove",h),e.event.bind(t,"touchend",f)):ao.supportsIePointer&&(window.PointerEvent?(e.event.bind(t,"pointerdown",u),e.event.bind(t,"pointermove",h),e.event.bind(t,"pointerup",f)):window.MSPointerEvent&&(e.event.bind(t,"MSPointerDown",u),e.event.bind(t,"MSPointerMove",h),e.event.bind(t,"MSPointerUp",f)))}var _4=function(){return{handlers:["click-rail","drag-thumb","keyboard","wheel","touch"],maxScrollbarLength:null,minScrollbarLength:null,scrollingThreshold:1e3,scrollXMarginOffset:0,scrollYMarginOffset:0,suppressScrollX:!1,suppressScrollY:!1,swipeEasing:!0,useBothWheelAxes:!1,wheelPropagation:!0,wheelSpeed:1}},w4={"click-rail":g4,"drag-thumb":y4,keyboard:v4,wheel:x4,touch:b4},Pc=function(e,t){var n=this;if(t===void 0&&(t={}),typeof e=="string"&&(e=document.querySelector(e)),!e||!e.nodeName)throw new Error("no element is specified to initialize PerfectScrollbar");this.element=e,e.classList.add(pe.main),this.settings=_4();for(var i in t)this.settings[i]=t[i];this.containerWidth=null,this.containerHeight=null,this.contentWidth=null,this.contentHeight=null;var s=function(){return e.classList.add(pe.state.focus)},r=function(){return e.classList.remove(pe.state.focus)};this.isRtl=mi(e).direction==="rtl",this.isRtl===!0&&e.classList.add(pe.rtl),this.isNegativeScroll=function(){var l=e.scrollLeft,c=null;return e.scrollLeft=-1,c=e.scrollLeft<0,e.scrollLeft=l,c}(),this.negativeScrollAdjustment=this.isNegativeScroll?e.scrollWidth-e.clientWidth:0,this.event=new la,this.ownerDocument=e.ownerDocument||document,this.scrollbarXRail=Du(pe.element.rail("x")),e.appendChild(this.scrollbarXRail),this.scrollbarX=Du(pe.element.thumb("x")),this.scrollbarXRail.appendChild(this.scrollbarX),this.scrollbarX.setAttribute("tabindex",0),this.event.bind(this.scrollbarX,"focus",s),this.event.bind(this.scrollbarX,"blur",r),this.scrollbarXActive=null,this.scrollbarXWidth=null,this.scrollbarXLeft=null;var o=mi(this.scrollbarXRail);this.scrollbarXBottom=parseInt(o.bottom,10),isNaN(this.scrollbarXBottom)?(this.isScrollbarXUsingBottom=!1,this.scrollbarXTop=Jt(o.top)):this.isScrollbarXUsingBottom=!0,this.railBorderXWidth=Jt(o.borderLeftWidth)+Jt(o.borderRightWidth),Ze(this.scrollbarXRail,{display:"block"}),this.railXMarginWidth=Jt(o.marginLeft)+Jt(o.marginRight),Ze(this.scrollbarXRail,{display:""}),this.railXWidth=null,this.railXRatio=null,this.scrollbarYRail=Du(pe.element.rail("y")),e.appendChild(this.scrollbarYRail),this.scrollbarY=Du(pe.element.thumb("y")),this.scrollbarYRail.appendChild(this.scrollbarY),this.scrollbarY.setAttribute("tabindex",0),this.event.bind(this.scrollbarY,"focus",s),this.event.bind(this.scrollbarY,"blur",r),this.scrollbarYActive=null,this.scrollbarYHeight=null,this.scrollbarYTop=null;var a=mi(this.scrollbarYRail);this.scrollbarYRight=parseInt(a.right,10),isNaN(this.scrollbarYRight)?(this.isScrollbarYUsingRight=!1,this.scrollbarYLeft=Jt(a.left)):this.isScrollbarYUsingRight=!0,this.scrollbarYOuterWidth=this.isRtl?p4(this.scrollbarY):null,this.railBorderYWidth=Jt(a.borderTopWidth)+Jt(a.borderBottomWidth),Ze(this.scrollbarYRail,{display:"block"}),this.railYMarginHeight=Jt(a.marginTop)+Jt(a.marginBottom),Ze(this.scrollbarYRail,{display:""}),this.railYHeight=null,this.railYRatio=null,this.reach={x:e.scrollLeft<=0?"start":e.scrollLeft>=this.contentWidth-this.containerWidth?"end":null,y:e.scrollTop<=0?"start":e.scrollTop>=this.contentHeight-this.containerHeight?"end":null},this.isAlive=!0,this.settings.handlers.forEach(function(l){return w4[l](n)}),this.lastScrollTop=Math.floor(e.scrollTop),this.lastScrollLeft=e.scrollLeft,this.event.bind(this.element,"scroll",function(l){return n.onScroll(l)}),ss(this)};Pc.prototype.update=function(){this.isAlive&&(this.negativeScrollAdjustment=this.isNegativeScroll?this.element.scrollWidth-this.element.clientWidth:0,Ze(this.scrollbarXRail,{display:"block"}),Ze(this.scrollbarYRail,{display:"block"}),this.railXMarginWidth=Jt(mi(this.scrollbarXRail).marginLeft)+Jt(mi(this.scrollbarXRail).marginRight),this.railYMarginHeight=Jt(mi(this.scrollbarYRail).marginTop)+Jt(mi(this.scrollbarYRail).marginBottom),Ze(this.scrollbarXRail,{display:"none"}),Ze(this.scrollbarYRail,{display:"none"}),ss(this),ah(this,"top",0,!1,!0),ah(this,"left",0,!1,!0),Ze(this.scrollbarXRail,{display:""}),Ze(this.scrollbarYRail,{display:""}))};Pc.prototype.onScroll=function(e){this.isAlive&&(ss(this),ah(this,"top",this.element.scrollTop-this.lastScrollTop),ah(this,"left",this.element.scrollLeft-this.lastScrollLeft),this.lastScrollTop=Math.floor(this.element.scrollTop),this.lastScrollLeft=this.element.scrollLeft)};Pc.prototype.destroy=function(){this.isAlive&&(this.event.unbindAll(),Mo(this.scrollbarX),Mo(this.scrollbarY),Mo(this.scrollbarXRail),Mo(this.scrollbarYRail),this.removePsClasses(),this.element=null,this.scrollbarX=null,this.scrollbarY=null,this.scrollbarXRail=null,this.scrollbarYRail=null,this.isAlive=!1)};Pc.prototype.removePsClasses=function(){this.element.className=this.element.className.split(" ").filter(function(e){return!e.match(/^ps([-_].+|)$/)}).join(" ")};const k4=({className:e,sidenav:t,tag:n="div",handlers:i=["click-rail","drag-thumb","keyboard","wheel","touch"],wheelSpeed:s=1,wheelPropagation:r=!0,swipeEasing:o=!0,minScrollbarLength:a,maxScrollbarLength:l,scrollingThreshold:c=1e3,useBothWheelAxes:u=!1,suppressScrollX:d=!1,suppressScrollY:h=!1,scrollXMarginOffset:f=0,scrollYMarginOffset:p=0,scrollBarRef:m,onScrollY:v,onScrollX:y,onScrollUp:g,onScrollDown:x,onScrollLeft:_,onScrollRight:w,onYReachStart:S,onYReachEnd:C,onXReachStart:M,onXReachEnd:P,children:T,options:A,...E})=>{const z=I(t&&"sidenav-menu",e),N=k.useRef(null),L=k.useRef(null);return k.useEffect(()=>{let R=null;const B=[],D={handlers:i,wheelSpeed:s,wheelPropagation:r,swipeEasing:o,minScrollbarLength:a,maxScrollbarLength:l,scrollingThreshold:c,useBothWheelAxes:u,suppressScrollX:d,suppressScrollY:h,scrollXMarginOffset:f,scrollYMarginOffset:p,...A};if(!N.current)return;R=N.current,L.current=new Pc(R,D);const $={"ps-scroll-y":v,"ps-scroll-x":y,"ps-scroll-up":g,"ps-scroll-down":x,"ps-scroll-left":_,"ps-scroll-right":w,"ps-y-reach-start":S,"ps-y-reach-end":C,"ps-x-reach-start":M,"ps-x-reach-end":P};return Object.keys($).forEach(F=>{const V=$[F];if(typeof V=="function"&&R){const W=()=>V(R);B.push({eventName:F,handler:W}),R.addEventListener(F,W)}}),m&&m(L.current),()=>{var F;B.forEach(V=>{R==null||R.removeEventListener(V.eventName,V.handler)}),(F=L.current)==null||F.destroy(),L.current=null}},[i,s,r,o,a,l,c,u,d,h,f,p,m,v,y,g,x,_,w,S,C,M,P,A]),b.jsx(n,{className:z,ref:N,...E,children:T})},S4=Y.createContext({color:"primary"}),M4=Y.forwardRef(({className:e,children:t,...n},i)=>{const s=I("sidenav-menu",e);return b.jsx("ul",{className:s,ref:i,...n,children:t})});M4.displayName="MDBSideNavMenu";const C4=Y.forwardRef(({className:e,children:t,...n},i)=>{const s=I("sidenav-item",e);return b.jsx("li",{className:s,ref:i,...n,children:t})});C4.displayName="MDBSideNavItem";const P4=Y.forwardRef(({className:e,icon:t,iconClasses:n,iconAngle:i=180,shouldBeExpanded:s,children:r,active:o,tag:a="a",...l},c)=>{const{color:u}=k.useContext(S4),d=I("sidenav-link",o&&"active",e),h=I("rotate-icon",n),[f,p]=k.useState(s?i:0);return k.useEffect(()=>{p(s?i:0)},[s,i]),b.jsxs(v0,{rippleTag:a,onKeyDown:m=>{m.key==="Enter"&&m.target.click()},tabIndex:1,rippleColor:u,className:d,ref:c,...l,children:[r,t&&b.jsx(sn,{icon:t,style:{transform:`rotate(${f}deg)`},className:h})]})});P4.displayName="MDBSideNavLink";const kT=Y.forwardRef(({className:e,centered:t,children:n,size:i,scrollable:s,tag:r="div",...o},a)=>{const l=I("modal-dialog",s&&"modal-dialog-scrollable",t&&"modal-dialog-centered",i&&`modal-${i}`,e);return b.jsx(r,{className:l,...o,ref:a,children:n})});kT.displayName="MDBModalDialog";const T4=Y.forwardRef(({className:e,side:t,frame:n,position:i,children:s,tag:r="div",...o},a)=>{const l=I(t&&"modal-side",n&&"modal-frame",i&&`modal-${i}`,e);return b.jsx(kT,{className:l,...o,tag:r,ref:a,children:s})});T4.displayName="MDBModalDialog";const nf=Y.createContext({onDatetimepickerModeSwitch:()=>null,isInDatetimepicker:!1,setInputValue:null,setActiveHour:null,setActiveMinute:null,setPeriod:null,setMode:null,setHandAnimation:null,setMinuteAngle:null,setHourAngle:null,submitLabel:"",clearLabel:"",cancelLabel:"",activeHour:12,activeMinute:12,format:"12h",period:"",defaultValue:"",minHour:0,maxHour:23,minPeriod:"",maxPeriod:"",mode:"hours",handAnimation:!1,maxMinute:59,minMinute:0,minuteAngle:360,hourAngle:360,inline:!1,increment:!1,onChange:()=>null,onOpen:()=>null,onClose:()=>null,onCloseHandler:()=>null,amLabel:"AM",pmLabel:"PM",switchHoursToMinutesOnClick:!0,headId:"",bodyId:""}),ld=e=>{const t=e.split(":"),n=t[0],i=t[1].split(" ")[1],s=t[1].split(" ")[0];return{hour:parseInt(n),minute:parseInt(s),defaultPeriod:i}},X_=(e,t)=>(t==="24h"?/^([01]\d|2[0-3])(:[0-5]\d)$/:/^(0?[1-9]|1[012])(:[0-5]\d) [APap][mM]$/).test(e),Ki=(e,t,n,i,s,r)=>{let o=!1;return t&&(s!==""?e>t&&i===s&&(o=!0):e>t&&(o=!0)),n&&(r!==""?eKi(i,s,r,o,a,l)&&(n===t||n===e),D4=(e,t,n)=>{t.split(" ").forEach(i=>{e.addEventListener(i,n)})},E4=(e,t,n)=>{t.split(" ").forEach(i=>{e.removeEventListener(i,n)})},ST=(e,t)=>{const n=t.x-e.x,i=t.y-e.y;return Math.sqrt(n*n+i*i)},A4=(e,t)=>{const n=2*Math.atan2(t.y-e.y-ST(e,t),t.x-e.x);return Math.abs(n*180/Math.PI)},K_=e=>({radius:(e-32)/2-4}),O4=e=>{const t=new Date;let n=t.getHours();const i=t.getMinutes();if(e==="24h")return{hours:n,minutes:i,period:""};const s=n>=12?"PM":"AM";return n=n%12,n=n||12,{hours:n,minutes:i,period:s}},xp=(e,t)=>{const n=e.getMinutes();let i=e.getHours(),s;i===24&&(i=0);const r=i>=12?"PM":"AM";return t=="24h"?s=i<10?`0${i}:${n}`:`${i}:${n}`:t=="12h"&&(s=`${(i+24)%12||12}:${n} ${r}`),s},ig=Y.forwardRef(({...e},t)=>{const{activeHour:n,format:i,period:s,setPeriod:r,mode:o,setMode:a,activeMinute:l,setHandAnimation:c,inline:u,setActiveHour:d,setActiveMinute:h,maxHour:f,maxMinute:p,minHour:m,minMinute:v,maxPeriod:y,minPeriod:g,setInputValue:x,increment:_,submitLabel:w,onChange:S,onCloseHandler:C,amLabel:M,pmLabel:P,headId:T,show:A,onDatetimepickerModeSwitch:E,isInDatetimepicker:z}=k.useContext(nf),N=D=>{a(D),c(!0)},L=()=>{if(Ki(n,f,m,s,y,g)||Ki(l,p,v,s,y,g)||!A)return;C==null||C();const D=n===24?"00":n<10?`0${n}`:n,$=l<10?`0${l}`:l,F=`${D}:${$} ${s}`.trim();x(F),S==null||S(F)},R=(D,$)=>{const F=i==="12h"?12:24;if($.type==="click")return d(D?V=>V===F?1:V+1:V=>V===1?F:V-1);if($.type==="mousedown"){const V=setTimeout(()=>{const et=setInterval(()=>{d(D?O=>O===F?1:O+1:O=>O===1?F:O-1)},100),Z=()=>{clearInterval(et),document.removeEventListener("mouseup",Z)};document.addEventListener("mouseup",Z)},300),W=()=>{clearTimeout(V),document.removeEventListener("mouseup",W)};document.addEventListener("mouseup",W)}},B=(D,$)=>{const F=_?55:59,V=_?5:1;if($.type==="click")return h(D?W=>W>=F?0:W+V:W=>W-V<0?F:W-V);if($.type==="mousedown"){const W=setTimeout(()=>{const Z=setInterval(()=>{h(D?U=>U>=F?0:U+V:U=>U-V<0?F:U-V)},100),O=()=>{clearInterval(Z),document.removeEventListener("mouseup",O)};document.addEventListener("mouseup",O)},300),et=()=>{clearTimeout(W),document.removeEventListener("mouseup",et)};document.addEventListener("mouseup",et)}};return u?b.jsx("div",{id:T,className:"timepicker-head d-flex flex-row align-items-center justify-content-center timepicker-head-inline",style:{paddingRight:"0px"},ref:t,...e,children:b.jsxs("div",{className:"timepicker-head-content d-flex w-100 justify-content-evenly align-items-center",children:[b.jsxs("div",{className:"timepicker-current-wrapper",children:[b.jsxs("span",{className:"position-relative h-100 timepicker-inline-hour-icons",children:[b.jsx(sn,{fas:!0,icon:"chevron-up",style:{display:"flex"},className:"position-absolute text-white timepicker-icon-up timepicker-icon-inline-hour",onClick:D=>R(!0,D),onMouseDown:D=>R(!0,D)}),b.jsx(Zt,{type:"button",color:"none",onClick:()=>{N("hours")},className:`timepicker-current timepicker-current-inline timepicker-hour ${o==="hours"&&"active"}`,tabIndex:0,style:{pointerEvents:o==="hours"?"none":void 0},onFocus:()=>{N("hours")},children:n===24?"00":n<10?`0${n}`:n}),b.jsx(sn,{fas:!0,icon:"chevron-down",style:{display:"flex"},className:"position-absolute text-white timepicker-icon-down timepicker-icon-inline-hour",onClick:D=>R(!1,D),onMouseDown:D=>R(!1,D)})]}),b.jsx(Zt,{color:"none",className:"timepicker-dot timepicker-current-inline",disabled:!0,children:":"}),b.jsxs("span",{className:"position-relative h-100 timepicker-inline-minutes-icons",children:[b.jsx(sn,{fas:!0,icon:"chevron-up",style:{display:"flex"},className:"position-absolute text-white timepicker-icon-up timepicker-icon-inline-minute",onClick:D=>B(!0,D),onMouseDown:D=>B(!0,D)}),b.jsx(Zt,{onClick:()=>{N("minutes")},type:"button",color:"none",className:`timepicker-current timepicker-current-inline timepicker-minute ${o==="minutes"&&"active"}`,tabIndex:0,style:{pointerEvents:o==="minutes"?"none":void 0},onFocus:()=>{N("minutes")},children:l<10?`0${l}`:l}),b.jsx(sn,{fas:!0,icon:"chevron-down",style:{display:"flex"},className:"position-absolute text-white timepicker-icon-down timepicker-icon-inline-minute",onClick:D=>B(!1,D),onMouseDown:D=>B(!1,D)})]})]}),b.jsxs("div",{className:"d-flex justify-content-center timepicker-mode-wrapper",children:[i==="12h"&&b.jsxs(b.Fragment,{children:[b.jsx(Zt,{onClick:()=>r("AM"),type:"button",color:"none",className:`timepicker-hour-mode timepicker-am me-2 ms-4 ${s.toLowerCase()==="am"&&"active"}`,tabIndex:0,children:M}),b.jsx(Zt,{onClick:()=>r("PM"),type:"button",color:"none",className:`timepicker-hour-mode timepicker-pm ${s.toLowerCase()==="pm"&&"active"}`,tabIndex:0,children:P})]}),b.jsx(Zt,{type:"button",color:"none",className:"timepicker-button timepicker-submit timepicker-submit-inline py-1 px-2 mb-0",tabIndex:0,onClick:L,children:w})]})]})}):b.jsxs(b.Fragment,{children:[b.jsx("div",{id:T,className:"timepicker-head d-flex flex-row align-items-center justify-content-center",style:{paddingRight:"0px"},ref:t,...e,children:b.jsxs("div",{className:"timepicker-head-content d-flex w-100 justify-content-evenly",style:{paddingRight:i==="24h"?"50px":""},children:[b.jsxs("div",{className:"timepicker-current-wrapper",children:[b.jsx("span",{className:"position-relative h-100",children:b.jsx(Zt,{type:"button",color:"none",onClick:()=>{N("hours")},className:`timepicker-current timepicker-hour ${o==="hours"&&"active"}`,tabIndex:0,style:{pointerEvents:o==="hours"?"none":void 0},children:n===24?"00":n<10?`0${n}`:n})}),b.jsx(Zt,{color:"none",className:"timepicker-dot",disabled:!0,children:":"}),b.jsx("span",{className:"position-relative h-100",children:b.jsx(Zt,{onClick:()=>{N("minutes")},type:"button",color:"none",className:`timepicker-current timepicker-minute ${o==="minutes"&&"active"}`,tabIndex:0,style:{pointerEvents:o==="minutes"?"none":void 0},children:l<10?`0${l}`:l})})]}),i==="12h"&&b.jsxs("div",{className:"d-flex flex-column justify-content-center timepicker-mode-wrapper",children:[b.jsx(Zt,{onClick:()=>r("AM"),type:"button",color:"none",className:`timepicker-hour-mode timepicker-am ${s.toLowerCase()==="am"&&"active"}`,tabIndex:0,children:M}),b.jsx(Zt,{onClick:()=>r("PM"),type:"button",color:"none",className:`timepicker-hour-mode timepicker-pm ${s.toLowerCase()==="pm"&&"active"}`,tabIndex:0,children:P})]})]})}),z&&b.jsxs("div",{className:"buttons-container",children:[b.jsx("button",{type:"button",className:"datepicker-button-toggle",onClick:E,children:b.jsx("i",{className:"far fa-calendar datepicker-toggle-icon"})}),b.jsx("button",{type:"button",className:"timepicker-button-toggle",children:b.jsx("i",{className:"far fa-clock fa-sm timepicker-icon"})})]})]})});ig.displayName="MDBTimePickerHeader";const bp={hours:[{value:1,left:"169px",bottom:"209.263px",angle:30,id:`hour-1-${Math.floor(Math.random()*1001)}`},{value:2,left:"209.263px",bottom:"169px",angle:60,id:`hour-2-${Math.floor(Math.random()*1001)}`},{value:3,left:"224px",bottom:"114px",angle:90,id:`hour-3-${Math.floor(Math.random()*1001)}`},{value:4,left:"209.263px",bottom:"59px",angle:120,id:`hour-4-${Math.floor(Math.random()*1001)}`},{value:5,left:"169px",bottom:"18.7372px",angle:150,id:`hour-5-${Math.floor(Math.random()*1001)}`},{value:6,left:"114px",bottom:"4px",angle:180,id:`hour-6-${Math.floor(Math.random()*1001)}`},{value:7,left:"59px",bottom:"18.7372px",angle:210,id:`hour-7-${Math.floor(Math.random()*1001)}`},{value:8,left:"18.7372px",bottom:"59px",angle:240,id:`hour-8-${Math.floor(Math.random()*1001)}`},{value:9,left:"4px",bottom:"114px",angle:270,id:`hour-9-${Math.floor(Math.random()*1001)}`},{value:10,left:"18.7372px",bottom:"169px",angle:300,id:`hour-10-${Math.floor(Math.random()*1001)}`},{value:11,left:"59px",bottom:"209.263px",angle:330,id:`hour-11-${Math.floor(Math.random()*1001)}`},{value:12,left:"114px",bottom:"224px",angle:360,id:`hour-12-${Math.floor(Math.random()*1001)}`},{value:13,left:"94px",bottom:"115.962px",angle:30,id:`hour-13-${Math.floor(Math.random()*1001)}`},{value:14,left:"115.962px",bottom:"94px",angle:60,id:`hour-14-${Math.floor(Math.random()*1001)}`},{value:15,left:"124px",bottom:"64px",angle:90,id:`hour-15-${Math.floor(Math.random()*1001)}`},{value:16,left:"115.962px",bottom:"34px",angle:120,id:`hour-16-${Math.floor(Math.random()*1001)}`},{value:17,left:"94px",bottom:"12.0385px",angle:150,id:`hour-17-${Math.floor(Math.random()*1001)}`},{value:18,left:"64px",bottom:"4px",angle:180,id:`hour-18-${Math.floor(Math.random()*1001)}`},{value:19,left:"34px",bottom:"12.0385px",angle:210,id:`hour-19-${Math.floor(Math.random()*1001)}`},{value:20,left:"12.0385px",bottom:"34px",angle:240,id:`hour-20-${Math.floor(Math.random()*1001)}`},{value:21,left:"4px",bottom:"64px",angle:270,id:`hour-21-${Math.floor(Math.random()*1001)}`},{value:22,left:"12.0385px",bottom:"94px",angle:300,id:`hour-22-${Math.floor(Math.random()*1001)}`},{value:23,left:"34px",bottom:"115.962px",angle:330,id:`hour-23-${Math.floor(Math.random()*1001)}`},{value:24,left:"64px",bottom:"124px",angle:360,id:`hour-0-${Math.floor(Math.random()*1001)}`}],minutes:[{value:0,left:"114px",bottom:"224px",angle:360,id:`minute-0-${Math.floor(Math.random()*1001)}`},{value:5,left:"169px",bottom:"209.263px",angle:30,id:`minute-5-${Math.floor(Math.random()*1001)}`},{value:10,left:"209.263px",bottom:"169px",angle:60,id:`minute-10-${Math.floor(Math.random()*1001)}`},{value:15,left:"224px",bottom:"114px",angle:90,id:`minute-15-${Math.floor(Math.random()*1001)}`},{value:20,left:"209.263px",bottom:"59px",angle:120,id:`minute-20-${Math.floor(Math.random()*1001)}`},{value:25,left:"169px",bottom:"18.7372px",angle:150,id:`minute-25-${Math.floor(Math.random()*1001)}`},{value:30,left:"114px",bottom:"4px",angle:180,id:`minute-30-${Math.floor(Math.random()*1001)}`},{value:35,left:"59px",bottom:"18.7372px",angle:210,id:`minute-35-${Math.floor(Math.random()*1001)}`},{value:40,left:"18.7372px",bottom:"59px",angle:240,id:`minute-40-${Math.floor(Math.random()*1001)}`},{value:45,left:"4px",bottom:"114px",angle:270,id:`minute-45-${Math.floor(Math.random()*1001)}`},{value:50,left:"18.7372px",bottom:"169px",angle:300,id:`minute-50-${Math.floor(Math.random()*1001)}`},{value:55,left:"59px",bottom:"209.263px",angle:330,id:`minute-55-${Math.floor(Math.random()*1001)}`}]},MT=Y.forwardRef(({...e},t)=>{const n=k.useRef(null),i=k.useRef(null),[s,r]=k.useState(!1),[o,a]=k.useState(0),[l,c]=k.useState(0),{setActiveHour:u,format:d,activeHour:h,minHour:f,maxHour:p,minPeriod:m,maxPeriod:v,period:y,mode:g,setMode:x,activeMinute:_,setActiveMinute:w,setHandAnimation:S,handAnimation:C,maxMinute:M,minMinute:P,hourAngle:T,setHourAngle:A,minuteAngle:E,setMinuteAngle:z,increment:N,switchHoursToMinutesOnClick:L,bodyId:R}=k.useContext(nf),B=d==="24h"?bp.hours:bp.hours.filter(O=>O.value<13&&O.value!==0),D=bp.minutes,[$,F]=k.useState("calc(40% + 1px)"),V=k.useCallback(A4,[]),W=O=>{O.preventDefault(),r(!0)},et=O=>{O.preventDefault(),r(!1),g==="hours"&&(L&&x("minutes"),S(!0))},Z=k.useCallback(O=>{var U;const{width:lt,top:ct,left:kt}=(U=n.current)==null?void 0:U.getBoundingClientRect(),{clientX:it,clientY:Lt}="touches"in O?O.touches[0]:O,Ct={x:lt/2,y:-lt/2},Qt={x:it-kt,y:ct-Lt},ft=Math.round(V(Ct,Qt)+360)%360;if(g==="hours"){const wt=30*Math.round(ft/30);let dt=wt/30;if(d==="24h"){const{radius:jt}=K_(o),{radius:pt}=K_(l);ST(Ct,Qt)<(jt+pt)/2-16&&(dt+=12)}Ki(dt,p,f,y,v,m)||(u(dt),A(wt))}else if(ft===0)vp(f,p,h,0,M,P,y,v,m)||(w(0),z(360));else{const wt=N?30:6,dt=wt*Math.round(ft/wt);vp(f,p,h,dt/6,M,P,y,v,m)||(w(dt/6===60?0:dt/6),z(dt))}},[V,h,M,P,v,m,g,y,w,p,f,u,l,o,d,A,z,N]);return k.useEffect(()=>{n.current&&a(n.current.offsetWidth),i.current&&c(i.current.offsetWidth)},[]),k.useEffect(()=>(s&&D4(document,"mouseup mousemove mouseleave mouseover touchstart touchmove touchend",Z),()=>{E4(document,"mouseup mousemove mouseleave mouseover touchstart touchmove touchend",Z)}),[s,Z]),k.useEffect(()=>{const O=B.find(U=>U.value===h);O!==void 0&&(O.value>12||O.value===24?F("21.5%"):F("calc(40% + 1px)"))},[B,h]),b.jsx("div",{id:R,className:"timepicker-clock-wrapper d-flex justify-content-center flex-column align-items-center",ref:t,...e,children:b.jsxs("div",{onMouseDown:O=>W(O),onMouseUp:O=>et(O),ref:n,className:"timepicker-clock timepicker-clock-animation",children:[b.jsx("span",{className:"timepicker-middle-dot position-absolute"}),b.jsx("div",{className:`timepicker-hand-pointer position-absolute ${C&&"timepicker-transform"}`,style:{transform:`rotateZ(${g==="hours"?T:E}deg)`,height:g==="hours"?$:"calc(40% + 1px)"},children:b.jsx("div",{className:"timepicker-circle position-absolute",style:{backgroundColor:"rgb(25, 118, 210)"}})}),g==="hours"&&d==="24h"&&b.jsx("div",{ref:i,className:"timepicker-clock-inner",children:B.map(O=>{if(O.value>12||O.value===0)return b.jsx("span",{id:O.id,className:`timepicker-time-tips-inner ${Ki(O.value,p,f,y,v,m)&&"disabled"} ${O.value===h&&"active"}`,style:{left:O.left,bottom:O.bottom},children:b.jsx("span",{className:"timepicker-tips-inner-element",children:O.value===24?"00":O.value})},O.id)})}),g==="hours"&&B.map(O=>{if(d==="24h"){if(O.value<13&&O.value!==0)return b.jsx("span",{id:O.id,className:`timepicker-time-tips-hours ${Ki(O.value,p,f,y,v,m)&&"disabled"} ${O.value===h&&"active"}`,style:{left:O.left,bottom:O.bottom},children:b.jsx("span",{className:"timepicker-tips-element",children:O.value})},O.id)}else return b.jsx("span",{id:O.id,className:`timepicker-time-tips-hours ${Ki(O.value,p,f,y,v,m)&&"disabled"} ${O.value===h&&"active"}`,style:{left:O.left,bottom:O.bottom},children:b.jsx("span",{className:"timepicker-tips-element",children:O.value})},O.id)}),g==="minutes"&&D.map(O=>b.jsx("span",{id:O.id,className:`timepicker-time-tips-minutes ${vp(f,p,h,O.value,M,P,y,v,m)&&"disabled"} ${_===O.value&&"active"}`,style:{left:O.left,bottom:O.bottom},children:b.jsx("span",{className:"timepicker-tips-element",children:O.value<10?`0${O.value}`:O.value})},O.id))]})})});MT.displayName="MDBTimePickerClock";const CT=Y.forwardRef(({...e},t)=>{const{setInputValue:n,cancelLabel:i,submitLabel:s,clearLabel:r,activeHour:o,period:a,activeMinute:l,maxHour:c,maxMinute:u,minHour:d,minMinute:h,maxPeriod:f,minPeriod:p,defaultValue:m,setActiveHour:v,setActiveMinute:y,setPeriod:g,format:x,setHourAngle:_,setMinuteAngle:w,onChange:S,onCloseHandler:C,setMode:M}=k.useContext(nf);return b.jsx("div",{className:"timepicker-footer",ref:t,...e,children:b.jsxs("div",{className:"w-100 d-flex justify-content-between",children:[b.jsx(Zt,{onClick:()=>{if(m!==""&&m!==void 0){const{hour:P,minute:T,defaultPeriod:A}=ld(m);x==="24h"?(v(P===0?24:P),P===0?_(360):P>12?_((P-12)*30):_(P*30)):(v(P),_(P*30),g(A)),y(T),w(T*6),n(m),S==null||S(m)}else v(12),_(360),y(0),w(360),n(""),S==null||S(""),g(x==="24h"?"":"AM");M("hours")},type:"button",color:"none",className:"timepicker-button timepicker-clear",tabIndex:0,children:r}),b.jsx(Zt,{onClick:()=>C==null?void 0:C(),type:"button",color:"none",className:"timepicker-button timepicker-cancel",tabIndex:0,children:i}),b.jsx(Zt,{onClick:()=>{if(Ki(o,c,d,a,f,p)||Ki(l,u,h,a,f,p))return;C==null||C();const P=o===24?"00":o<10?`0${o}`:o,T=l<10?`0${l}`:l,A=`${P}:${T} ${a}`.trim();n(A),S==null||S(A)},type:"button",color:"none",className:"timepicker-button timepicker-submit",tabIndex:0,children:s})]})})});CT.displayName="MDBTimePickerFooter";const L4=({isOpen:e,inline:t})=>{k.useEffect(()=>{if(t)return;const n=window.innerWidth>document.documentElement.clientWidth&&window.innerWidth>=576,i=`${window.innerWidth-document.documentElement.clientWidth}px`;return e&&n?(document.body.style.overflow="hidden",document.body.style.paddingRight=i):(document.body.style.overflow="",document.body.style.paddingRight=""),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[e,t])},R4=({className:e,isOpen:t,wrapperRef:n,inline:i,referenceElement:s,onOpened:r,onClosed:o})=>{const[a,l]=k.useState(null),c=I("timepicker-modal",!i&&"position-fixed",e),u=I("timepicker-wrapper","animation","h-100","d-flex","align-items-center","justify-content-center","flex-column",i?"timepicker-wrapper-inline":"position-fixed","fade",t&&"show"),{styles:d,attributes:h}=Oh(s,a,{placement:"bottom-start"}),f=p=>{p.opacity===0?o():r()};return L4({isOpen:t,inline:i}),b.jsx(b.Fragment,{children:b.jsx(aa,{children:b.jsx(Zy,{children:t&&(i?b.jsx(Jo.div,{className:c,style:d.popper,...h.popper,role:"dialog",ref:l,tabIndex:-1,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onAnimationComplete:p=>f(p),children:b.jsx("div",{ref:n,className:u,children:b.jsx("div",{className:"d-flex align-items-center justify-content-center flex-column shadow timepicker-container",style:{overflowY:"inherit"},children:b.jsx("div",{className:"d-flex flex-column timepicker-elements justify-content-around timepicker-elements-inline",children:b.jsx(ig,{})})})})}):b.jsx(Jo.div,{className:c,role:"dialog",tabIndex:-1,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},onAnimationComplete:p=>f(p),children:b.jsx("div",{ref:n,className:u,children:b.jsxs("div",{className:"d-flex align-items-center justify-content-center flex-column shadow timepicker-container",children:[b.jsxs("div",{className:"d-flex flex-column timepicker-elements justify-content-around",children:[b.jsx(ig,{}),b.jsx(MT,{})]}),b.jsx(CT,{})]})})}))})})})},G_=(e,t,n,i,s)=>{const r=n?55:59,o=n?5:1;let a;s?a=i>=r?0:i+o:a=i<=0?r:i-o,e(a),t(a*6)},Au=(e,t,n,i,s,r)=>{if(r&&e==="24h"){let l=t;r==="isLeft"&&(l=t<=12?t+12:t),r==="isRight"&&(l=t>12?t-12:t),n(l),i(l*30);return}const o=e==="12h"?12:24;let a=t===1?o:t-1;s?a=t===o?1:t+1:a=t===1?o:t-1,n(a),i(a*30)},q_=(e,t,n)=>{const i=n==null?void 0:n.querySelectorAll('[tabindex="0"]');i&&i[t]&&(i[t].focus(),t===i.length-1?e(0):e(t+1))},N4=(e,t,n,i,s,r)=>{var o;!t&&e.target===n&&r&&(r==null||r()),t&&e.target!==n&&!(n!=null&&n.contains(e.target))&&e.target!==(i==null?void 0:i.parentNode)&&!((o=i==null?void 0:i.parentNode)!=null&&o.contains(e.target))&&s&&(r==null||r())},Q_="ArrowLeft",Z_="ArrowUp",J_="ArrowRight",tw="ArrowDown",ew="Enter",nw="Escape",iw="Tab",PT=k.forwardRef(({isInDatetimepicker:e,onDatetimepickerModeSwitch:t,datetimepickerRef:n,className:i,defaultValue:s,value:r,minHour:o,maxHour:a,maxTime:l,minTime:c,noIcon:u=!1,inputID:d,justInput:h=!1,inputClasses:f,inputLabel:p,invalidLabel:m,clearLabel:v,submitLabel:y,cancelLabel:g,format:x="12h",timePickerClasses:_,customIcon:w="far fa-clock",customIconSize:S="sm",btnIcon:C=!0,inline:M=!1,increment:P=!1,onChange:T,inputStyle:A,onOpen:E,onOpened:z,onClose:N,onClosed:L,disableFuture:R,disablePast:B,disabled:D=!1,amLabel:$="AM",pmLabel:F="PM",switchHoursToMinutesOnClick:V=!0,headId:W="",bodyId:et="",open:Z,style:O,...U},lt)=>{const ct=k.useMemo(()=>s instanceof Date?xp(s,x):s,[]),kt=k.useMemo(()=>r instanceof Date?xp(r,x):r,[r,x]),[it,Lt]=k.useState(!1),[Ct,Qt]=k.useState(!1),ft=ef(Ct,Z),[wt,dt]=k.useState(kt||ct||""),[jt,pt]=k.useState(!1),[xt,J]=k.useState(12),[mt,q]=k.useState(0),[ye,Dt]=k.useState(x==="24h"?"":"AM"),[he,Un]=k.useState(a||24),[Yn,Mn]=k.useState(o||1),[Si,dn]=k.useState(59),[Mi,as]=k.useState(0),[ls,Ci]=k.useState(""),[Pi,Ke]=k.useState(""),[Xn,Ti]=k.useState("hours"),[j,Q]=k.useState(!1),[It,nt]=k.useState(360),[Tt,Oe]=k.useState(360),[cs,ai]=k.useState(null),[Kn,Me]=k.useState(0);s instanceof Date&&(s=xp(s,x));const Kr=k.useId(),Gr=d??Kr,Cn={input:p??"Select a time",invalid:m??"Invalid Time Format",clear:v??"Clear",submit:y??"Ok",cancel:g??"Cancel"},ca=I("timepicker",i),Dc=I("timepicker-input",jt&&"is-invalid",f),sf=k.useRef(null),G=k.useRef(null),X=k.useRef(null),rt=k.useRef(null);k.useImperativeHandle(lt,()=>rt.current,[rt]);const ht=Rt=>{dt(Rt.target.value),T==null||T(Rt.target.value)},hn=Rt=>{h&&(Rt.target.blur(),E==null||E())},us=k.useCallback(()=>{Qt(!1),N==null||N()},[N]),Ge=k.useCallback(()=>{Qt(!0),E==null||E()},[E]),fn=k.useCallback(()=>{Lt(!1),L==null||L(),Ti("hours"),Me(0)},[L]),NT=k.useCallback(()=>{Lt(!0),z==null||z()},[z]),rf=k.useCallback(Rt=>{it&&N4(Rt,M,X.current,rt.current,ft,us)},[X,M,rt,ft,us,it]),of=k.useCallback(Rt=>{var Pn,pn;const{key:A0}=Rt,ua=document.activeElement,jT=ua===((Pn=X.current)==null?void 0:Pn.querySelector(".timepicker-hour")),$T=ua===((pn=X.current)==null?void 0:pn.querySelector(".timepicker-minute")),IT=ua==null?void 0:ua.closest('.timepicker-modal [tabindex="0"]');if(![tw,Z_,nw,iw,ew,Q_,J_].includes(A0))return;M&&!IT&&q_(Me,0,X.current),Rt.preventDefault();const Ec=!M&&Xn==="hours"||M&&jT,O0=!M&&Xn==="minutes"||M&&$T;switch(A0){case nw:return N==null?void 0:N();case Z_:if(Ec)return Au(x,xt,J,nt,!0);if(O0)return G_(q,Oe,P,mt,!0);break;case tw:if(Ec)return Au(x,xt,J,nt,!1);if(O0)return G_(q,Oe,P,mt,!1);break;case Q_:if(Ec&&!M)return Au(x,xt,J,nt,!1,"isLeft");break;case J_:if(Ec&&!M)return Au(x,xt,J,nt,!0,"isRight");break;case iw:q_(Me,Kn,X.current);break;case ew:ua.click();break}},[xt,x,Xn,mt,P,M,Kn,N]);return k.useEffect(()=>{if(!B&&!R)return;const{hours:Rt,minutes:Pn,period:pn}=O4(x);if(B)return Mn(Rt),as(Pn),Ci(pn);if(R)return Un(Rt),dn(Pn),Ke(pn)},[R,B,x]),k.useEffect(()=>(ft&&it&&(document.addEventListener("click",rf),document.addEventListener("keydown",of)),()=>{document.removeEventListener("click",rf),document.removeEventListener("keydown",of)}),[ft,it,rf,of]),k.useEffect(()=>{if(l){const{hour:Rt,minute:Pn,defaultPeriod:pn}=ld(l);Un(Rt),dn(Pn),pn!==void 0&&Ke(pn)}if(c){const{hour:Rt,minute:Pn,defaultPeriod:pn}=ld(c);Mn(Rt),as(Pn),pn!==void 0&&Ci(pn)}},[l,c]),k.useEffect(()=>{typeof r=="string"&&r&&X_(r,x)&&dt(r)},[r,x]),k.useEffect(()=>{if(X_(wt,x)||wt===""){if(pt(!1),wt!==""){const{hour:Rt,minute:Pn,defaultPeriod:pn}=ld(wt);x==="24h"?(J(Rt===0?24:Rt),Rt===0?nt(360):Rt>12?nt((Rt-12)*30):nt(Rt*30)):(J(Rt),nt(Rt*30),Dt(pn)),q(Pn),Oe(Pn*6)}}else pt(!0)},[wt,x]),k.useEffect(()=>{let Rt;return j&&(Rt=setTimeout(()=>{Q(!1)},400)),()=>{clearTimeout(Rt)}},[j]),b.jsx(b.Fragment,{children:b.jsx(nf.Provider,{value:{isInDatetimepicker:e,onDatetimepickerModeSwitch:t,show:ft,setInputValue:dt,submitLabel:Cn.submit,clearLabel:Cn.clear,cancelLabel:Cn.cancel,activeHour:xt,activeMinute:mt,setActiveHour:J,setActiveMinute:q,format:x,period:ye,setPeriod:Dt,defaultValue:s,maxHour:he,minHour:Yn,maxPeriod:Pi,minPeriod:ls,mode:Xn,setMode:Ti,setHandAnimation:Q,handAnimation:j,minMinute:Mi,maxMinute:Si,hourAngle:It,setHourAngle:nt,minuteAngle:Tt,setMinuteAngle:Oe,inline:M,increment:P,onChange:T,onOpen:E,onClose:N,onCloseHandler:us,amLabel:$,pmLabel:F,switchHoursToMinutesOnClick:V,headId:W,bodyId:et},children:b.jsxs(b.Fragment,{children:[b.jsx("div",{className:ca,ref:M?ai:sf,style:{...O,height:"fit-content"},...U,children:!e&&b.jsx(wi,{onFocus:hn,ref:rt,labelRef:G,className:Dc,label:Cn.input,id:Gr,value:wt,onChange:ht,wrapperClass:"timepicker",style:A,disabled:D,onClick:()=>{h&&Ge()},children:!h&&!u&&(C?b.jsx(Zt,{className:"timepicker-toggle-button",onClick:Ge,color:"none",tabIndex:0,type:"button",disabled:D,style:{pointerEvents:D?"none":"auto"},children:b.jsx("i",{className:`${w} ${S} timepicker-icon`})}):b.jsx("i",{onClick:Ge,className:`${w} ${S} timepicker-icon timepicker-toggle-button`}))})}),b.jsx(R4,{isOpen:ft,wrapperRef:X,referenceElement:n||cs,inline:M,className:_,onClosed:fn,onOpened:NT})]})})})});PT.displayName="MDBTimepicker";const j4=({className:e,dropdown:t,children:n,styles:i,attributes:s,setPopperElement:r,style:o,onClosed:a,onOpened:l})=>{const c={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3}},u=I("datepicker-dropdown-container",e),d=I("datepicker-modal-container",e),h=f=>{f.opacity===0?a==null||a():l==null||l()};return b.jsx(b.Fragment,{children:t?b.jsx(Jo.div,{style:{position:"absolute",zIndex:1065,...i.popper},...s.popper,ref:r,className:u,tabIndex:-1,...c,onAnimationComplete:f=>h(f),children:n}):b.jsx(Jo.div,{...c,className:d,style:o,onAnimationComplete:f=>h(f),children:n})})},Ce={closeOnEsc:!0,title:"Select date",okBtnText:"Ok",clearBtnText:"Clear",cancelBtnText:"Cancel",customIcon:"far fa-calendar",customHeader:"",inputLabel:"Select a date",monthsFull:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],views:"days",format:"dd/mm/yyyy",weekdaysFull:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysNarrow:["S","M","T","W","T","F","S"],startDay:0};function Te(e){return e.getDate()}function sw(e){return e.getDay()}function Pt(e){return e.getMonth()}function ot(e){return e.getFullYear()}function $4(e,t,n){const i=n,s=i>0?7-i:0,r=new Date(e,t).getDay()+s;return r>=7?r-7:r}function I4(e){return e.getDate()===rc(e)}function sg(e){return I4(e)?rc(new Date(ot(e),Pt(e)+1,1)):Te(e)}function rc(e){return F4(e).getDate()}function F4(e){return Or(e.getFullYear(),e.getMonth()+1,0)}function Ro(){return new Date}function Ln(e,t){return Je(e,t*12)}function Je(e,t){const n=Or(e.getFullYear(),e.getMonth()+t,e.getDate()),i=Te(e),s=Te(n);return i!==s&&n.setDate(0),n}function eo(e,t){return Or(e.getFullYear(),e.getMonth(),e.getDate()+t)}function Or(e,t,n){const i=new Date(e,t,n);return e>=0&&e<100&&i.setFullYear(i.getFullYear()-1900),i}function rg(e){return!Number.isNaN(e.getTime())}function rw(e,t){return ot(e)-ot(t)||Pt(e)-Pt(t)||Te(e)-Te(t)}function vs(e,t){return e.setHours(0,0,0,0),t.setHours(0,0,0,0),e.getTime()===t.getTime()}function ow(e){return parseInt(e,10)<10?`0${e}`:e}function og(e,t){const n=ot(e)-TT(0,null,null);return B4(n,t)}function B4(e,t){return(e%t+t)%t}function TT(e,t,n){let i=0;return n?i=ot(n)-e+1:t&&(i=ot(t)),i}function No(e,t,n,i){const s=t&&rw(e,t)<=0,r=n&&rw(e,n)>=0,o=i&&i(e)===!1;return!!(s||r||o)}function ag(e,t,n,i,s,r){const o=i&&ot(i),a=i&&Pt(i),l=n&&ot(n),c=n&&Pt(n),u=new Date().getFullYear(),d=new Date().getMonth();if(r&&u===t&&ed||r&&u>t||s&&uo||t===o&&e>a:!1,f=c&&l?tr)return!0;const o=t&&ot(t),a=n&&ot(n),l=a?e>a:!1,c=o?en===e)}function aw(e,t,n,i,s){return s?DT(e,s,t,n,i,s):!1}function lw(e,t,n,i,s){return i?DT(e,i,t,n,i,s):!1}function DT(e,t,n,i,s,r){if(n==="days")return ot(e)===ot(t)&&Pt(e)===Pt(t);if(n==="months")return ot(e)===ot(t);if(n==="years"){const o=TT(i,s,r);return Math.floor((ot(e)-o)/i)===Math.floor((ot(t)-o)/i)}return!1}function lh(e,t,n,i){let s;if(t){const r=V4(t);if(r){r[0]!==r[1]?s=r[0]+r[1]:s=r[0];const o=new RegExp(`[${s}]`),a=e.split(o),l=t==null?void 0:t.split(o),c=(t==null?void 0:t.indexOf("mmm"))!==-1,u=[];l==null||l.forEach((m,v)=>{m.indexOf("yy")!==-1&&(u[0]={value:a[v],format:m}),m.indexOf("m")!==-1&&(u[1]={value:a[v],format:m}),m.indexOf("d")!==-1&&m.length<=2&&(u[2]={value:a[v],format:m})});let d;(t==null?void 0:t.indexOf("mmmm"))!==-1?d=n:d=i;const h=Number(u[0].value),f=c?z4(u[1].value,d):Number(u[1].value)-1,p=Number(u[2].value);return Or(h,f,p)}}}function cw(e,t,n,i,s,r){const o=Te(e),a=ow(Te(e).toString()),l=n[sw(e)],c=i[sw(e)],u=Pt(e),d=ow((Pt(e)+1).toString()),h=s[Pt(e)],f=r[Pt(e)],p=ot(e).toString().length===2?ot(e):ot(e).toString().slice(2,4),m=ot(e),v=t.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g);let y="";return v.forEach(g=>{switch(g){case"dddd":g=g.replace(g,c);break;case"ddd":g=g.replace(g,l);break;case"dd":g=g.replace(g,a);break;case"d":g=g.replace(g,o.toString());break;case"mmmm":g=g.replace(g,f);break;case"mmm":g=g.replace(g,h);break;case"mm":g=g.replace(g,d);break;case"m":g=g.replace(g,u.toString());break;case"yyyy":g=g.replace(g,m.toString());break;case"yy":g=g.replace(g,p.toString());break}y+=g}),y}const ET=(e,t)=>{if(!t)return!1;const n=new Date;return n.setHours(0,0,0,0)===e.setHours(0,0,0,0)?!1:et?e>new Date:!1,ir=Y.createContext({view:"days",setView:null,activeDate:new Date,setActiveDate:null,selectedDate:new Date,setSelectedDate:null,weekdaysShort:[],monthsShort:[],monthsFull:[],min:void 0,max:void 0,weekdaysFull:[],yearScope:[],tabCount:0,inline:!1,disableFuture:!1,disablePast:!1}),W4=({clearBtnText:e="Clear",cancelBtnText:t="Cancel",okBtnText:n="Ok",setValue:i,selectDate:s,onClose:r})=>{const{setActiveDate:o,setSelectedDate:a,selectedDate:l,isInDatetimepicker:c,onDatetimepickerModeSwitch:u}=k.useContext(ir),d=h=>{h.currentTarget.blur(),o(new Date),a(void 0),i("")};return b.jsxs("div",{className:"datepicker-footer",children:[b.jsx("button",{tabIndex:0,onClick:h=>d(h),className:"datepicker-footer-btn datepicker-clear-btn",children:e}),b.jsx("button",{tabIndex:0,onClick:()=>r==null?void 0:r(),className:"datepicker-footer-btn datepicker-cancel-btn",children:t}),b.jsx("button",{tabIndex:0,onClick:()=>{s(l),c&&(u==null||u()),r==null||r()},className:"datepicker-footer-btn datepicker-ok-btn",children:n})]})},H4=(e,t,n)=>{const i=document.createElement("button"),s=document.createElement("div");i.id=`datepicker-toggle-${Math.floor(Math.random()*10001)}`,i.tabIndex=0,i.type="button",i.style.pointerEvents="auto";const r=document.createElement("i");r.className=`${e} fa-${t} datepicker-icon`,n&&i.appendChild(r);const o=n?i:r;return o.classList.add("datepicker-toggle-button"),{div:s,selector:o}},U4=(e,t,n,i,s,r)=>{const o=[],a=Pt(e),l=Pt(Je(e,-1)),c=Pt(Je(e,1)),u=ot(e),d=$4(u,a,r),h=rc(e),f=rc(Je(e,-1)),p=7;let m=1,v=!1;for(let y=1;yh&&(m=1,v=!1);const _=Or(u,v?a:c,m);g.push({date:_,currentMonth:v,isSelected:t&&vs(_,t),isToday:vs(_,Ro()),dayNumber:Te(_),disabled:No(_,n,i,s)}),m++}o.push(g)}return o},Y4=e=>{const t=[],n=e[0];let i=[];for(let s=0;s<24;s++)if(i.push(n+s),i.length===4){const r=i;t.push(r),i=[]}return t},X4=e=>{const t=[];let n=[];return e.forEach(i=>{if(n.push(i),n.length===4){const s=n;t.push(s),n=[]}}),t},K4=({filter:e,startWeekdays:t,startDay:n,inlineDayClick:i,selectOnClick:s,selectDate:r,onClose:o})=>{const{min:a,max:l,setActiveDate:c,setSelectedDate:u,activeDate:d,selectedDate:h,tabCount:f,disableFuture:p,disablePast:m}=k.useContext(ir),v=y=>{!No(y,a,l,e)&&(c(y),u(y),i(y),s&&(r(y),o==null||o()))};return b.jsxs("table",{className:"datepicker-table",children:[b.jsx("thead",{children:b.jsx("tr",{children:t.map((y,g)=>b.jsx("th",{className:"datepicker-day-heading",scope:"col",children:y},g))})}),b.jsx("tbody",{className:"datepicker-table-body",children:U4(d,h,a,l,e,n).map((y,g)=>b.jsx("tr",{children:y.map((x,_)=>b.jsx("td",{onClick:()=>v(x.date),tabIndex:vs(x.date,d)?0:void 0,className:I("datepicker-cell","datepicker-small-cell","datepicker-day-cell",x.isToday&&"current",x.isSelected&&"selected",x.disabled&&"disabled",f===3&&vs(x.date,d)&&"focused",Pt(d)!==Pt(x.date)&&"disabled",AT(x.date,p)&&"disabled",ET(x.date,m)&&"disabled"),children:b.jsx("div",{className:"datepicker-cell-content datepicker-small-cell-content",style:{display:x.currentMonth?"block":"none"},children:x.dayNumber})},_))},g))})]})},G4=()=>{const{yearScope:e,setView:t,setActiveDate:n,activeDate:i,selectedDate:s,tabCount:r,min:o,max:a,disableFuture:l,disablePast:c}=k.useContext(ir);return b.jsx("table",{className:"datepicker-table",children:b.jsx("tbody",{className:"datepicker-table-body",children:Y4(e).map((u,d)=>b.jsx("tr",{children:u.map(h=>b.jsx("td",{onClick:()=>{n(new Date(h,Pt(i),Te(i))),t("months")},tabIndex:h===ot(i)?0:void 0,className:I("datepicker-cell","datepicker-large-cell","datepicker-year-cell",s&&h===ot(s)&&"selected",r===3&&h===ot(i)&&"focused",lg(h,o,a,l,c)&&"disabled",ot(Ro())===h&&"current"),children:b.jsx("div",{className:"datepicker-cell-content datepicker-large-cell-content",children:h})},h))},d))})})},q4=()=>{const{monthsShort:e,setActiveDate:t,setView:n,activeDate:i,selectedDate:s,tabCount:r,min:o,max:a,disableFuture:l,disablePast:c}=k.useContext(ir);return b.jsx("table",{className:"datepicker-table",children:b.jsx("tbody",{className:"datepicker-table-body",children:X4(e).map((u,d)=>b.jsx("tr",{children:u.map(h=>b.jsx("td",{onClick:()=>{t(new Date(ot(i),e.indexOf(h),sg(i))),n("days")},tabIndex:e.indexOf(h)===Pt(i)?0:void 0,className:I("datepicker-cell","datepicker-large-cell","datepicker-month-cell",s&&e.indexOf(h)===Pt(s)&&ot(i)===ot(s)&&"selected",r===3&&e.indexOf(h)===Pt(i)&&"focused",Pt(Ro())===e.indexOf(h)&&ot(Ro())===ot(i)&&"current",ag(e.indexOf(h),ot(i),o,a,l,c)&&"disabled"),children:b.jsx("div",{className:"datepicker-cell-content datepicker-large-cell-content",children:h})},e.indexOf(h)))},d))})})},Q4=({title:e,customHeader:t})=>{const{weekdaysShort:n,monthsShort:i,selectedDate:s,isInDatetimepicker:r,onDatetimepickerModeSwitch:o}=k.useContext(ir),a=s||new Date;return b.jsxs("div",{className:"datepicker-header",children:[b.jsx("div",{className:"datepicker-title",children:b.jsx("span",{className:"datepicker-title-text",children:e})}),b.jsxs("div",{className:"datepicker-date",children:[!t&&b.jsxs("span",{className:"datepicker-date-text",children:[n[a.getDay()],", ",i[a.getMonth()]," ",a.getDate()]}),t&&t]}),r&&b.jsxs("div",{className:"buttons-container",children:[b.jsx("button",{type:"button",className:"datepicker-button-toggle",children:b.jsx("i",{className:"far fa-calendar datepicker-toggle-icon"})}),b.jsx("button",{type:"button",className:"timepicker-button-toggle",onClick:o,children:b.jsx("i",{className:"far fa-clock fa-sm timepicker-icon"})})]})]})},Z4=()=>{const{view:e,setView:t,activeDate:n,setActiveDate:i,monthsFull:s,min:r,max:o,yearScope:a}=k.useContext(ir),l=c=>{if(e==="days"){const u=c?new Date(ot(n),Pt(n)+1,sg(n)):new Date(ot(n),Pt(n)-1,sg(n));c?!aw(Je(u,-1),"days",1,r,o)&&i(u):!lw(Je(u,1),"days",1,r,o)&&i(u)}else if(e==="years"){const u=c?new Date(ot(n)+24,Pt(n),Te(n)):new Date(ot(n)-24,Pt(n),Te(n));c?o?a[0]+24ot(r)&&i(u):i(u)}else if(e==="months"){const u=c?new Date(ot(n)+1,Pt(n),Te(n)):new Date(ot(n)-1,Pt(n),Te(n));c?!aw(Ln(u,-1),"months",1,r,o)&&i(u):!lw(Ln(u,1),"months",1,r,o)&&i(u)}};return b.jsxs("div",{className:"datepicker-date-controls",children:[e==="days"&&b.jsxs("button",{tabIndex:0,className:"datepicker-view-change-button",onClick:()=>t("years"),children:[s[n.getMonth()]," ",n.getFullYear()]}),e==="years"&&b.jsxs("button",{tabIndex:0,className:"datepicker-view-change-button",onClick:()=>t("days"),children:[a[0]," - ",a[1]]}),e==="months"&&b.jsx("button",{tabIndex:0,className:"datepicker-view-change-button",onClick:()=>t("days"),children:ot(n)}),b.jsxs("div",{className:"datepicker-arrow-controls",children:[b.jsx("button",{tabIndex:0,className:"datepicker-previous-button",onClick:()=>l(!1)}),b.jsx("button",{tabIndex:0,className:"datepicker-next-button",onClick:()=>l(!0)})]})]})},J4=({labelText:e,inline:t,setReferenceElement:n,inputClasses:i,value:s,style:r,inputStyle:o,icon:a,input:l,inputId:c,inputToggle:u,setDatepickerValue:d,format:h,onOpenHandler:f,...p})=>{const{monthsFull:m,monthsShort:v,setSelectedDate:y,setActiveDate:g}=k.useContext(ir),x=I(s?"active":"",i),_=k.useRef(null);return k.useEffect(()=>{var w;if(u)return;const S=(w=_.current)==null?void 0:w.parentNode,{div:C,selector:M}=H4(a,"sm",!0);return S==null||S.insertBefore(C,_.current),S==null||S.insertBefore(M,_.current),M.addEventListener("click",()=>f==null?void 0:f()),()=>{M.removeEventListener("click",()=>f==null?void 0:f()),S==null||S.removeChild(M)}},[a,f,u]),b.jsx(wi,{className:x,label:e,id:c,ref:t?n:l,labelRef:_,wrapperClass:"datepicker",value:s,onChange:w=>{const S=lh(w.target.value,h,m,v);d(w.target.value),S&&rg(S)?(g(S),y(S)):(g(new Date),y(void 0))},style:o,wrapperStyle:r,onClick:()=>{u&&(f==null||f())},...p})},x0="ArrowLeft",b0="ArrowUp",_0="ArrowRight",w0="ArrowDown",k0="Home",S0="End",M0="PageUp",C0="PageDown",P0="Enter",T0=" ",t8=(e,t,n,i,s,r,o,a,l,c)=>{switch(e){case x0:t(u=>eo(u,-1));break;case _0:t(u=>eo(u,1));break;case b0:t(u=>eo(u,-7));break;case w0:t(u=>eo(u,7));break;case k0:t(u=>eo(u,1-Te(u)));break;case S0:t(u=>eo(u,rc(u)-Te(u)));break;case M0:t(u=>Je(u,-1));break;case C0:t(u=>Je(u,1));break;case P0:if(No(n,i,s,o)||ET(n,c)||AT(n,l))return;a(n),r(n);break;case T0:if(!o||o(n)){if(No(n,i,s,o))return;a(n),r(n)}break;default:return}},e8=(e,t,n,i,s,r,o,a,l)=>{switch(e){case x0:n(c=>Ln(c,-1));break;case _0:n(c=>Ln(c,1));break;case b0:n(c=>Ln(c,-4));break;case w0:n(c=>Ln(c,4));break;case k0:n(c=>Ln(c,-og(c,24)));break;case S0:n(c=>Ln(c,24-og(c,24)-1));break;case M0:n(c=>Ln(c,-24));break;case C0:n(c=>Ln(c,24));break;case P0:!lg(ot(t),i,s,a,l)&&r("months");break;case T0:!lg(ot(t),i,s,a,l)&&o(t);return;default:return}},n8=(e,t,n,i,s,r,o,a,l,c)=>{switch(e){case x0:n(u=>Je(u,-1));break;case _0:n(u=>Je(u,1));break;case b0:n(u=>Je(u,-4));break;case w0:n(u=>Je(u,4));break;case k0:n(u=>Je(u,-Pt(u)));break;case S0:n(u=>Je(u,11-Pt(u)));break;case M0:n(u=>Ln(u,-1));break;case C0:n(u=>Ln(u,1));break;case P0:!ag(Pt(t),ot(t),i,s,l,c)&&r("days");break;case T0:!ag(Pt(t),ot(t),i,s,l,c)&&o(t);return;default:return}},i8=({closeOnEsc:e,isOpen:t,activeDate:n,setActiveDate:i,min:s,max:r,view:o,setView:a,setSelectedDate:l,filter:c,setInlineDate:u,disableFuture:d,disablePast:h,onClose:f})=>{const[p,m]=k.useState(3),v=k.useRef(null),y=k.useCallback(g=>{var x,_,w;if(e&&g.key==="Escape"&&(f==null||f()),g.preventDefault(),!g.shiftKey&&g.key==="Tab"){const S=(x=v.current)==null?void 0:x.querySelectorAll('[tabindex="0"]');S&&(p===S.length-1?m(0):m(p+1))}else if(g.key==="Enter")p!==3&&document.activeElement&&document.activeElement.click();else if(g.shiftKey&&g.key==="Tab"){const S=(_=v.current)==null?void 0:_.querySelectorAll('[tabindex="0"]');S&&m(p===0?S.length-1:p-1)}(w=v.current)!=null&&w.querySelector(".focused")&&p!==4&&(o==="days"?t8(g.key,i,n,s,r,l,c,u,d,h):o==="years"?e8(g.key,n,i,s,r,a,l,d,h):o==="months"&&n8(g.key,n,i,s,r,a,l,c,d,h))},[n,o,c,r,s,e,p,a,i,l,u,d,h,f]);return k.useEffect(()=>{var g,x;const _=(g=v.current)==null?void 0:g.querySelectorAll('[tabindex="0"]');if(_){const w=_[p];if(w.tagName!=="TD"){w.focus();const S=(x=v.current)==null?void 0:x.querySelector(".focused");S==null||S.classList.remove("focused")}else _[p-1].blur(),w.classList.add("focused")}},[p]),k.useEffect(()=>{t||m(3)},[t]),k.useEffect(()=>{m(3)},[o]),k.useEffect(()=>{if(t)return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y)}},[y,t]),{tabCount:p,modalRef:v}},s8=({isOpen:e,inline:t})=>{k.useEffect(()=>{const n=window.innerWidth>document.documentElement.clientWidth&&window.innerWidth>=576;if(!t)return e&&n?(document.body.style.overflow="hidden",document.body.style.paddingRight="17px"):(document.body.style.overflow="",document.body.style.paddingRight=""),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[e,t])},r8=({isOpened:e,isOpen:t,inline:n,popperElement:i,referenceElement:s,backdropRef:r,onCloseHandler:o})=>{const a=k.useCallback(l=>{var c;n?!(i!=null&&i.contains(l.target))&&!((c=s==null?void 0:s.parentNode)!=null&&c.contains(l.target))&&!l.target.classList.contains("datepicker-view-change-button")&&!l.target.classList.contains("datepicker-large-cell-content")&&t&&o():l.target===r.current&&t&&o()},[i,s,r,n,t,o]);k.useEffect(()=>(e&&document.addEventListener("click",a),()=>{document.removeEventListener("click",a)}),[e,a])},OT=k.forwardRef(({datetimepickerRef:e,isInDatetimepicker:t,onDatetimepickerModeSwitch:n,closeOnEsc:i=Ce.closeOnEsc,customHeader:s,title:r=Ce.title,weekdaysNarrow:o=Ce.weekdaysNarrow,monthsFull:a=Ce.monthsFull,monthsShort:l=Ce.monthsShort,weekdaysFull:c=Ce.weekdaysFull,weekdaysShort:u=Ce.weekdaysShort,disableFuture:d,disablePast:h,filter:f,inline:p,className:m,min:v,max:y,format:g=Ce.format,okBtnText:x=Ce.okBtnText,clearBtnText:_=Ce.clearBtnText,cancelBtnText:w=Ce.cancelBtnText,inputToggle:S,customIcon:C=Ce.customIcon,inputId:M,inputLabel:P=Ce.inputLabel,inputStyle:T,startDay:A=Ce.startDay,views:E=Ce.views,style:z,defaultValue:N="",onChange:L,onClose:R,onClosed:B,onOpen:D,onOpened:$,getFormattedDateValues:F,value:V,wrapperClass:W,selectOnClick:et=!1,open:Z,disablePortal:O,...U},lt)=>{const[ct,kt]=k.useState(!1),[it,Lt]=k.useState(!1),Ct=ef(it,Z),[Qt,ft]=k.useState(new Date),[wt,dt]=k.useState(new Date),[jt,pt]=k.useState(E),[xt,J]=k.useState(V||N),[mt,q]=k.useState(),[ye,Dt]=k.useState(),[he,Un]=k.useState(o),[Yn,Mn]=k.useState([0,0]),Si=k.useRef(null),dn=k.useRef(null),Mi=k.useRef(N&&!0),{styles:as,attributes:ls}=Oh(e||ye,mt,{placement:"bottom-start",modifiers:[VM]});k.useImperativeHandle(lt,()=>p?ye:dn.current,[p,ye]);const Ci=nt=>{if(p&&p){const Tt=cw(nt,g,u,c,l,a);J(Tt),t&&(n==null||n()),Ke()}},Pi=nt=>{const Tt=nt&&cw(nt,g,u,c,l,a);Tt&&J(Tt)},Ke=k.useCallback(()=>{Lt(!1),R==null||R()},[R]),Xn=k.useCallback(()=>{Lt(!0),D==null||D()},[D]),Ti=k.useCallback(()=>{kt(!1),B==null||B()},[B]),j=k.useCallback(()=>{kt(!0),$==null||$()},[$]),{tabCount:Q,modalRef:It}=i8({closeOnEsc:i,isOpen:Ct,activeDate:Qt,setActiveDate:ft,min:v,max:y,view:jt,setView:pt,setSelectedDate:dt,filter:f,setInlineDate:Ci,disableFuture:d,disablePast:h});return s8({isOpen:Ct,inline:p}),r8({isOpened:ct,isOpen:Ct,inline:p,referenceElement:ye,popperElement:mt,backdropRef:Si,onCloseHandler:Ke}),k.useEffect(()=>{const nt=ot(Qt),Tt=og(Qt,24),Oe=nt-Tt;Mn([Oe,Oe+23])},[Qt]),k.useEffect(()=>{const nt=o.slice(A).concat(o.slice(0,A));Un(nt)},[o,A]),k.useEffect(()=>{if(!Ct)return;const nt=p?ye:dn.current,Tt=nt==null?void 0:nt.parentNode,Oe=Tt==null?void 0:Tt.querySelector("button");Oe?Oe.blur():nt==null||nt.blur()},[Ct,dn,ye,p,D]),k.useEffect(()=>{Z&&!Ct&&!ct&&(D==null||D(),Lt(!0))},[Z,Ct,ct,D]),k.useEffect(()=>{if(!Mi.current)return;const nt=lh(xt,g,a,l);nt&&rg(nt)&&(ft(nt),dt(nt)),Mi.current=!1},[N,xt,g,a,l]),k.useEffect(()=>{const nt=V&&lh(V,g,a,l);nt&&rg(nt)&&(ft(nt),dt(nt),J(V)),V===""&&(ft(new Date),dt(void 0),J(V))},[V,g,a,l]),k.useEffect(()=>{Ct||(pt(E),xt||(ft(new Date),dt(void 0)))},[Ct,E,xt]),k.useEffect(()=>{L==null||L(xt,Qt)},[xt]),k.useEffect(()=>{const nt=wt||new Date,Tt=String(nt.getDate()),Oe=u[nt.getDay()],cs=c[nt.getDay()],ai=l[nt.getMonth()],Kn=a[nt.getMonth()],Me=String(nt.getFullYear()),Kr=Me.slice(-2);F==null||F({dayNumber:Tt,weekdayShort:Oe,weekdayFull:cs,monthShort:ai,monthFull:Kn,yearFull:Me,yearShort:Kr})},[wt]),b.jsx(ir.Provider,{value:{isInDatetimepicker:t,onDatetimepickerModeSwitch:n,view:jt,setView:pt,activeDate:Qt,setActiveDate:ft,selectedDate:wt,setSelectedDate:dt,weekdaysShort:u,monthsShort:l,monthsFull:a,min:v,max:y,weekdaysFull:c,yearScope:Yn,tabCount:Q,isOpen:Ct,disablePast:h,disableFuture:d},children:b.jsxs(b.Fragment,{children:[!t&&b.jsx(J4,{inputClasses:m,labelText:P,inline:p,setReferenceElement:Dt,value:xt,setDatepickerValue:J,style:z,inputStyle:T,format:g,icon:C,input:dn,inputToggle:S,onOpenHandler:Xn,...U}),b.jsx(aa,{disablePortal:O,children:b.jsx(Zy,{children:Ct&&b.jsxs(b.Fragment,{children:[b.jsxs(j4,{className:W,dropdown:p,styles:as,attributes:ls,setPopperElement:q,onClosed:Ti,onOpened:j,children:[!p&&b.jsx(Q4,{title:r,customHeader:s,onClose:Ke}),b.jsxs("div",{className:"datepicker-main",ref:It,children:[b.jsx(Z4,{}),b.jsxs("div",{className:"datepicker-view",children:[jt==="days"&&b.jsx(K4,{startWeekdays:he,startDay:A,filter:f,inlineDayClick:Ci,selectDate:Pi,selectOnClick:et,onClose:Ke}),jt==="years"&&b.jsx(G4,{}),jt==="months"&&b.jsx(q4,{})]}),!p&&b.jsx(W4,{okBtnText:x,clearBtnText:_,cancelBtnText:w,setValue:J,selectDate:Pi,onClose:Ke})]})]},"datepicker-modal-container"),!p&&b.jsx(Jo.div,{className:"datepicker-backdrop",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},ref:Si})]})})})]})})});OT.displayName="MDBDatepicker";const o8=e=>{const t=/^([0-1]?[0-9]|2[0-3]):[0-5][0-9] [APap][mM]$/,n=/^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$/;return e.match(t)||e.match(n)},a8=e=>e&&Object.prototype.toString.call(e)==="[object Date]"&&!isNaN(e.getTime()),uw=300,l8=k.forwardRef(({className:e,label:t="Select Date and Time",labelStyle:n,labelClass:i,labelRef:s,inputClass:r="",inputRef:o,inline:a,disabled:l,defaultTime:c="",defaultDate:u="",value:d,invalidLabel:h,inputToggle:f=!1,timepickerOptions:p,datepickerOptions:m,showFormat:v,dateFormat:y="dd/mm/yyyy",timeFormat:g="12h",appendValidationInfo:x=!0,onChange:_,onOpen:w,onClose:S,onDatepickerOpen:C,onDatepickerClose:M,onTimepickerOpen:P,onTimepickerClose:T,...A},E)=>{const z=k.useRef(!1),[N,L]=k.useState(!1),[R,B]=k.useState(!1),[D,$]=k.useState(u),[F,V]=k.useState(c),[W,et]=k.useState(""),Z=k.useRef(),O=D?W.split(",")[0]:null,U=F?W.split(", ")[1]:null,lt=I("form-outline","datetimepicker",e),ct=()=>{const pt=O&&lh(O,y,Ce.monthsFull,Ce.monthsShort);return W&&!O&&!U||O&&!a8(pt)||U&&!o8(U)?r+" is-invalid":r},kt=k.useCallback(pt=>{$(pt)},[]),it=k.useCallback(pt=>{V(pt)},[]),Lt=k.useCallback(()=>{B(!1),z.current=!1,M==null||M()},[M]),Ct=k.useCallback(()=>{T==null||T(),L(!1),z.current=!1},[T]),Qt=k.useCallback(()=>{C==null||C()},[C]),ft=k.useCallback(()=>{P==null||P()},[P]),wt=()=>{B(!0),w==null||w(),z.current=!0},dt=k.useCallback(()=>{R?(B(!1),setTimeout(()=>{L(!0)},uw)):N&&(L(!1),setTimeout(()=>{B(!0)},uw))},[R,N]);k.useEffect(()=>{!F||!D||(_==null||_(`${D}, ${F}`),!d&&et(`${D}, ${F}`))},[F,D,_,d]),k.useEffect(()=>{d&&(et(d),_==null||_(d))},[d,_]),k.useEffect(()=>{!R&&!N&&!z.current&&(S==null||S())},[R,N,S]);const jt=pt=>{et(pt);const[xt,J]=pt.split(", ");$(xt||""),V(J||"")};return b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:lt,ref:Z,...A,children:[b.jsx(wi,{label:t,labelStyle:n,labelClass:i,ref:o||E,labelRef:s,placeholder:v?`${y}, ${g}`:void 0,value:d||W,onChange:pt=>{jt(pt.target.value),_==null||_(pt.target.value)},className:x?ct():r,disabled:l,onClick:()=>{f&&wt()},children:h&&b.jsx("div",{className:"invalid-feedback",children:h})}),!f&&b.jsx("button",{type:"button",className:"datetimepicker-toggle-button",onClick:wt,disabled:l,style:{pointerEvents:l?"none":"initial"},children:b.jsx("i",{className:"far fa-calendar datepicker-toggle-icon"})})]}),b.jsx(OT,{...m,inline:a,onChange:kt,format:y,datetimepickerRef:Z.current,defaultValue:u,value:D,onClose:Lt,onOpen:Qt,isInDatetimepicker:!0,open:R,onDatetimepickerModeSwitch:dt}),b.jsx(PT,{...p,inline:a,onChange:it,format:g,datetimepickerRef:Z.current,defaultValue:c,value:F,onClose:Ct,onOpen:ft,isInDatetimepicker:!0,open:N,onDatetimepickerModeSwitch:dt})]})});l8.displayName="MDBDateTimepicker";const c8=Y.forwardRef(({className:e,color:t,children:n,...i},s)=>{const r=I("toast-header",t&&`bg-${t}`,t&&t!=="light"&&"text-white",e);return b.jsx("div",{className:r,ref:s,...i,children:n})});c8.displayName="MDBToastHeader";const u8=Y.forwardRef(({className:e,children:t,color:n,...i},s)=>{const r=I("toast-body",n&&n!=="light"&&"text-white",e);return b.jsx("div",{className:r,ref:s,...i,children:t})});u8.displayName="MDBToastBody";const d8=Y.forwardRef(({className:e,white:t,children:n,...i},s)=>{const r=I("btn-close",t&&"btn-close-white",e);return b.jsx(Zt,{className:r,color:"none",ref:s,...i,children:n})});d8.displayName="MDBToastClose";const h8=0,f8=({selectedElements:e,optionHeight:t,data:n,multiple:i,selectAll:s,handleSelectAll:r,handleOptionClick:o,selectAllLabel:a,selectData:l,activeElementIndex:c,noResults:u,search:d})=>{const h=k.useMemo(()=>l.filter(v=>v.optgroup).map(v=>v.optgroup),[l]),f=k.useMemo(()=>{let v=0;return l.map(y=>(y.optgroup&&v++,{...y,groupIndex:v}))},[l]),p=k.useMemo(()=>l.filter(v=>!v.optgroup&&!v.hidden).length===0,[l]),m=v=>f.map(y=>{if(!y.optgroup&&v===y.groupIndex)return b.jsxs("div",{className:I("select-option",e.includes(y.elementPosition)&&"selected",y.disabled&&"disabled",y.hidden&&"d-none",c===y.elementPosition&&"active"),role:"option",style:{height:t},onClick:()=>o(y),children:[b.jsxs("span",{className:"select-option-text",children:[i&&b.jsx(oh,{disabled:y.disabled,disableWrapper:!0,checked:e.includes(y.elementPosition),readOnly:!0}),y.text,y.secondaryText&&b.jsx("span",{className:"select-option-secondary-text",children:y.secondaryText})]}),y.icon&&b.jsx("span",{className:"select-option-icon-container",children:b.jsx("img",{className:"select-option-icon rounded-circle",src:y.icon})})]},y.elementPosition)});return b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"select-options-list",children:[i&&s&&!p&&b.jsx("div",{className:I("select-option",e.length===n.filter(v=>!v.disabled).length&&"selected",c===-1&&"active"),role:"option",onClick:r,style:{height:t},children:b.jsxs("span",{className:"select-option-text",children:[b.jsx(oh,{disableWrapper:!0,checked:n.filter(v=>!v.disabled&&!v.optgroup).length===e.length,readOnly:!0}),a]})}),m(h8),!p&&(h==null?void 0:h.map((v,y)=>{const g=m(y+1).filter(x=>x!==void 0);if(g.length!==0)return b.jsxs("div",{className:"select-option-group",children:[b.jsx("label",{className:"select-option-group-label",style:{height:t},children:v}),g]},`select-option-group ${v} ${y}`)}))]}),d&&p&&b.jsx("div",{className:"select-no-results",style:{height:t},children:u})]})},_p="ArrowUp",wp="ArrowDown",dw="Enter",hw="Escape",fw="Tab",p8=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;no.includes(a))||!r.every(a=>i[a]===s[a]))return!1}return!0},m8=e=>e.map((t,n)=>({...t,elementPosition:n})),g8={open:{opacity:1,transform:"scaleY(1)",transition:{duration:.2}},closed:{opacity:0,transform:"scaleY(0.8)",transition:{duration:.2}}},Ra=-1,D0=k.forwardRef(({data:e,className:t,inputClassName:n,optionHeight:i=38,visibleOptions:s=5,disabled:r,placeholder:o,label:a,clearBtn:l,children:c,multiple:u,displayedLabels:d=5,optionsSelectedLabel:h="options selected",selectAll:f=!0,selectAllLabel:p="Select all",size:m,openRef:v,contrast:y=!1,open:g,onOpen:x,onOpened:_,onClose:w,onClosed:S,onValueChange:C,onChange:M,search:P=!1,searchLabel:T="Search...",searchFn:A,autoSelect:E=!1,noResultsText:z="No results",validation:N=!1,validFeedback:L="Valid",invalidFeedback:R="Invalid",preventFirstSelection:B=!1,value:D,animationVariants:$,disablePortal:F,...V},W)=>{const[et,Z]=k.useState(!1),O=ef(et,g),[U,lt]=k.useState(!0),[ct,kt]=k.useState(null),[it,Lt]=k.useState(),[Ct,Qt]=k.useState();k.useImperativeHandle(W,()=>it,[it]);const[ft,wt]=k.useState(""),[dt,jt]=k.useState(""),[pt,xt]=k.useState(()=>f?Ra:e.findIndex(G=>!G.disabled)),[J,mt]=k.useState([]),[q,ye]=k.useState([]),[Dt,he]=k.useState(q),[Un,Yn]=k.useState(""),[Mn,Si]=k.useState(0),[dn,Mi]=k.useState(!1),as=I("select-wrapper",t),ls=I("select-input",o&&"placeholder-active",O&&"focused",n),Ci=I(O||ct&&a?"active":"",a&&"select-label"),Pi=I("select-dropdown",O&&"open"),{styles:Ke,attributes:Xn}=Oh(it,Ct,{placement:"bottom-start"}),Ti=k.useRef(null),j=k.useRef(null),Q=k.useRef(null),It=k.useMemo(()=>u&&f?s+1:s,[f,s,u]);k.useEffect(()=>{if(!dt)return he(q);if(A&&dt){const G=A(dt,q);return he(G||[])}he(()=>q.filter(G=>{var X;return((X=G.text)==null?void 0:X.toLocaleLowerCase().includes(dt.toLocaleLowerCase()))||G.optgroup}))},[dt,q,A,ft]),k.useEffect(()=>{O&&dt&&xt(-1)},[O,dt]),k.useEffect(()=>{if(!N)return;const G=J.every(ht=>q[ht].value),X=J.every(ht=>!q[ht].disabled),rt=J.length>0;!u&&(!rt||!G||!X)||u&&(!rt||!X)?it==null||it.setCustomValidity(R):it==null||it.setCustomValidity("")},[N,R,J,it,q,ft,u]);const nt=G=>{if(q.length===0)return;const X=j.current,rt=X.offsetHeight,ht=X.scrollTop,hn=q.filter(Ge=>Ge.hidden&&Ge.elementPosition(u&&f?-2:-1)){const Ge=(us-hn)*i,fn=Ge+i>ht+rt;Ge{const G=rt=>Dt.findIndex(ht=>ht.elementPosition==rt);let X=pt;for(;X{let G=pt;for(;G>=0;){G-=1;const X=Dt.findIndex(ht=>ht.elementPosition==G)!=-1,rt=G>=0&&(q[G].disabled||q[G].hidden||q[G].optgroup);if(G<=0&&(!X||rt))return u&&f?G=-1:pt;if(X&&!rt)break}return G},cs=G=>{const{key:X}=G;if([_p,wp,dw,fw,hw].includes(X)){if(X===fw)return E&&ca(Dt[pt]),it==null||it.focus(),Z(!1);if(G.preventDefault(),G.altKey&&(X===wp||X===_p))return O?w==null||w():x==null||x(),Z(!O);if(X===wp){const rt=Tt();return O?(nt(rt),xt(rt)):u?Z(!0):mt([rt])}if(X===_p){const rt=Oe();return O?(nt(rt),xt(rt)):u?Z(!0):mt([rt])}if(X===dw){const rt=Dt.findIndex(ht=>ht.elementPosition==pt);return O?pt===Ra?Kr():ca(Dt[rt]):(x==null||x(),Z(!0))}if(X===hw)return Z(!1),it==null?void 0:it.focus()}},ai=k.useCallback(()=>{Z(G=>!G)},[]),Kn=k.useCallback(G=>{if(v&&v.current===G.target)return;const X=Ct&&Ct!==null,rt=it&&it!==null,ht=!(Ct!=null&&Ct.contains(G.target))&&!(it!=null&&it.contains(G.target)),hn=G.target===Q.current;X&&O&&rt&&ht&&!hn&&(Z(!1),w==null||w())},[Ct,it,O,w,v]);k.useEffect(()=>{const G=m8(e);p8(G,q)||ye(G)},[e,q]);const Me=k.useCallback(()=>{O&&Yn(`${it==null?void 0:it.offsetWidth}px`)},[it,O]),Kr=()=>{if(!u||!f)return;if(J.length===e.filter(X=>!X.disabled&&!X.optgroup).length)return mt([]),C==null||C([]),M==null||M([]),Cn([]);const G=q==null?void 0:q.filter(X=>!X.disabled&&!X.optgroup).map(X=>X.elementPosition);return mt(G),C==null||C(e.filter(X=>!X.disabled)),M==null||M(e.filter(X=>!X.disabled)),Cn(G)},Gr=k.useCallback(()=>{if(q.length===0)return;let G=J[0];const X=G===void 0,rt=G>=q.length;if(dn&&!u){if(X&&B||!dn||u||rt)return;X&&(G=0);const ht=q[G].value,hn=String(q[G].text);hn?(kt(ht?null:hn),wt(ht?hn:"")):(kt(null),wt(ht?" ":""))}},[u,dn,J,q,B]),Cn=k.useCallback(G=>{const X=d===-1||G.length>d;if(G.length<=0&&(kt(null),wt("")),X)return kt(null),wt(`${G.length} ${h}`);const rt=G.map(fn=>q[fn].text||"").filter(fn=>fn!==""),ht=G.map(fn=>q[fn].value||"").filter(fn=>fn!==""),hn=rt.findIndex(fn=>fn!=="")===-1,us=ht.length>0,Ge=rt.join(", ");hn?(kt(null),wt(us?" ":"")):us?(wt(Ge),kt(null)):(wt(""),kt(Ge))},[d,h,q]);k.useEffect(()=>{Gr()},[J,Gr]);const ca=G=>{if(!G||G.disabled)return;const{elementPosition:X}=G;if(u){const rt=J.includes(X)?J.filter(ht=>ht!==X):[...J,X];return mt(rt),C==null||C(rt.map(ht=>e[ht])),M==null||M(rt.map(ht=>e[ht])),Cn(rt)}return mt([X]),Z(!1),C==null||C(e[X]),M==null||M(e[X]),w==null||w(),it==null?void 0:it.focus()};k.useEffect(()=>{Mi(!0)},[]),k.useEffect(()=>{if(u){const X=q.filter(rt=>rt.defaultSelected).map(rt=>rt.elementPosition);return Cn(X),mt(X)}let G=q.findIndex(X=>X.defaultSelected);G===Ra&&!B&&(G=q.findIndex(X=>!X.disabled&&!X.hidden)),G!==Ra&&mt([G])},[q,Cn,u,B]),k.useEffect(()=>{if(O&&P&&J.length===0)return xt(Ra);O||(J.length>0?xt(Math.max(...J)):xt(0))},[Dt,O,P,J]),k.useEffect(()=>{Si(It*i)},[It,i]),k.useEffect(()=>{Me()},[Me]),k.useEffect(()=>(O&&(window.addEventListener("click",Kn),window.addEventListener("resize",Me)),()=>{window.removeEventListener("click",Kn),window.removeEventListener("resize",Me)}),[Kn,Me,O]),k.useEffect(()=>{if(v){const G=v.current;return G==null||G.addEventListener("click",ai),()=>{G==null||G.removeEventListener("click",ai)}}},[v,ai]),k.useEffect(()=>{if(!D)return;const G=Array.isArray(D)?D:[D],X=q.filter(ht=>ht.value&&G.includes(ht.value)).map(ht=>ht.elementPosition);if(X.toString()===J.toString())return;const rt=u?X.map(ht=>q[ht]):q[X[0]];C==null||C(rt),M==null||M(rt),mt(X),u?Cn(X):Gr()},[D,q,u,C,M,J,Gr,Cn]);const Dc=k.useCallback(()=>{r||(it==null||it.focus(),O?w==null||w():x==null||x(),Z(!O))},[r,O,x,w,it]),sf=k.useCallback(G=>{var X;G==="open"&&(lt(!1),_==null||_(),P&&((X=Ti.current)==null||X.focus())),G==="closed"&&(lt(!0),S==null||S(),P&&jt(""))},[_,S,P]);return b.jsx("div",{className:as,...V,children:b.jsxs(b.Fragment,{children:[b.jsxs(wi,{ref:Lt,onClick:Dc,onKeyDown:cs,className:ls,value:ft,readonly:!N,required:N,disabled:r,placeholder:ct?void 0:o,label:a,labelClass:Ci,size:m,contrast:y,children:[N&&b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"invalid-feedback",children:R}),b.jsx("div",{className:"valid-feedback",children:L})]}),ct&&b.jsx("div",{className:"form-label select-fake-value active",children:ct}),l&&(ft.length>0||ct)&&b.jsx("span",{tabIndex:0,className:`select-clear-btn d-block ${r?"pe-none":""}`,role:"button",onClick:()=>{wt(""),mt([]),C==null||C(u?[]:{}),M==null||M(u?[]:{})},children:"✕"}),b.jsx("span",{className:`select-arrow ${r?"pe-none":""}`,ref:Q,onClick:Dc,style:{cursor:"pointer"}})]}),(e==null?void 0:e.length)>0&&(O||!U)&&b.jsx(aa,{disablePortal:F,children:b.jsx("div",{style:{...Ke.popper,width:Un,zIndex:1070},...Xn.popper,ref:Qt,className:"select-dropdown-container",children:b.jsx(Zy,{children:O&&b.jsxs(Jo.div,{variants:{...g8,...$},initial:"closed",animate:"open",exit:"closed",tabIndex:0,className:Pi,onAnimationStart:()=>{lt(!1)},onAnimationComplete:sf,children:[P&&b.jsx("div",{className:"input-group",children:b.jsx("input",{onKeyDown:cs,onChange:G=>jt(G.target.value),ref:Ti,type:"text",className:"form-control select-filter-input",role:"searchbox",placeholder:T})}),b.jsx("div",{className:"select-options-wrapper",ref:j,style:{maxHeight:`${Mn}px`},children:b.jsx(f8,{data:e,selectData:Dt,selectedElements:J,optionHeight:i,visibleOptions:It,handleOptionClick:ca,handleSelectAll:Kr,selectAll:f,selectAllLabel:p,multiple:u,activeElementIndex:pt,noResults:z,search:P})}),c&&b.jsx("div",{className:"select-custom-content",children:c})]})})})})]})})});D0.displayName="MDBSelectV2";const Tc=k.createContext({isLoading:!1,activePage:0,setActivePage:null,sort:{column:"",option:""},fixedHeader:!1,handleSort:null}),y8=({fullPagination:e,rowsText:t="Rows per page:",selectValue:n,setSelectValue:i,activeDataLength:s,entriesOptions:r=[10,25,50,200],fullDataLength:o,allText:a="All",ofText:l="of"})=>{const{isLoading:c,activePage:u,setActivePage:d}=k.useContext(Tc),h=u===0||c,f=s<=n*(u+1)||c,p=u===Math.floor(s/n),m=r.map(g=>({text:g.toString(),value:g,defaultSelected:n===g}));m.push({text:a,value:o,defaultSelected:n===o});const v=g=>{g instanceof Array||(i(g.value),d(0))},y=`${u*n+1} - ${(u+1)*n>s?s:(u+1)*n} ${l} ${s}`;return b.jsxs("div",{className:"datatable-pagination",children:[b.jsxs("div",{className:"datatable-select-wrapper",children:[b.jsx("p",{className:"datatable-select-text",children:t}),b.jsx(D0,{onValueChange:v,data:m,disabled:c})]}),b.jsx("div",{className:"datatable-pagination-nav",children:y}),b.jsxs("div",{className:"datatable-pagination-buttons",children:[e&&b.jsx(Zt,{disabled:h,onClick:()=>d(0),className:"datatable-pagination-button datatable-pagination-start",color:"link",children:b.jsx(sn,{icon:"angle-double-left"})}),b.jsx(Zt,{disabled:h,onClick:()=>d(u-1),className:"datatable-pagination-button datatable-pagination-left",color:"link",children:b.jsx(sn,{icon:"chevron-left"})}),b.jsx(Zt,{disabled:f,onClick:()=>d(u+1),className:"datatable-pagination-button datatable-pagination-right",color:"link",children:b.jsx(sn,{icon:"chevron-right"})}),e&&b.jsx(Zt,{disabled:p,onClick:()=>d(Math.floor(s/n)),className:"datatable-pagination-button datatable-pagination-end",color:"link",children:b.jsx(sn,{icon:"angle-double-right"})})]})]})},pw=(e,t,n)=>{const i=s=>s.toString().toLowerCase().includes(t.toLowerCase());return e.filter(s=>{if(n&&typeof n=="string")return i(s[n]);let r=Object.values(s);return n&&Array.isArray(n)&&(r=Object.keys(s).filter(o=>n.includes(o)).map(o=>s[o])),r.filter(o=>i(o)).length>0})},v8=(e,t,n)=>Object.assign([],e).sort((i,s)=>{const r=typeof i[t]=="string"?i[t].toLowerCase():i[t],o=typeof s[t]=="string"?s[t].toLowerCase():s[t];return ro?n==="desc"?-1:1:0}),LT=e=>e.every(t=>typeof t=="string"),E0=e=>!e.every(t=>typeof t=="string"),x8=e=>Array.isArray(e),mw=e=>!Array.isArray(e),b8=({search:e,advancedSearch:t,searchValue:n,setSearchValue:i,searchInputProps:s,label:r="Search",setAdvancedSearchValue:o})=>b.jsxs(b.Fragment,{children:[e&&b.jsx(wi,{value:n,onChange:a=>i(a.target.value),label:r,className:"mb-4",...s}),t&&b.jsxs(yT,{className:"mb-4",children:[b.jsx("input",{className:"form-control",value:n,onChange:a=>i(a.target.value),...s}),b.jsx(Zt,{className:"datatable-advanced-search",onClick:()=>o(t(n)),children:b.jsx(sn,{icon:"search"})})]})]}),_8=({dataColumns:e})=>{const{sort:t,fixedHeader:n,handleSort:i}=k.useContext(Tc),[s,r]=k.useState("rotate(0deg)"),o=a=>I("datatable-sort-icon",`${a===t.column&&"active"}`);return k.useEffect(()=>{const a=t.option==="desc"?"rotate(180deg)":"rotate(0deg)";r(a)},[t.option]),b.jsx(b.Fragment,{children:e.map((a,l)=>b.jsxs("th",{className:n?"fixed-cell":"",style:{cursor:"pointer"},scope:"row",onClick:()=>i(a),children:[b.jsx(sn,{fas:!0,icon:"arrow-up",className:o(a),style:{transform:a===t.column?s:"rotate(0deg)"}}),a]},l))})},w8=({dataColumns:e})=>{const[t,n]=k.useState("rotate(0deg)"),{sort:i,fixedHeader:s,handleSort:r,isLoading:o}=k.useContext(Tc),a=l=>I("datatable-sort-icon",`${l===i.column&&"active"}`);return k.useEffect(()=>{const l=i.option==="desc"?"rotate(180deg)":"rotate(0deg)";n(l)},[i.option]),b.jsx(b.Fragment,{children:e.map((l,c)=>{const{fixedValue:u,fixed:d,label:h}=l,f=l.sort!==!1&&!o,p={cursor:I(f&&"pointer"),left:d==="left"?u||0:void 0,right:d==="right"?u||0:void 0},m=I((s||d)&&"fixed-cell");return b.jsxs("th",{className:m,style:p,scope:"row",onClick:()=>f&&r(h),children:[f&&b.jsx(sn,{fas:!0,icon:"arrow-up",className:a(h),style:{transform:i.column===h?t:"rotate(0deg)"}}),h]},c)})})},k8=({row:e,dataColumns:t,format:n,editable:i})=>b.jsx(b.Fragment,{children:t.map((s,r)=>{const{field:o,fixed:a,width:l,fixedValue:c,columnSelector:u}=s,d=e[o],h=Number(d),f=n==null?void 0:n(o,h?Number(d):String(d)),p={minWidth:l,maxWidth:l,left:a==="left"&&(c||0),right:a==="right"&&(c||0),...f},m=I(a&&"fixed-cell",u&&`mdb-datatable-${u}`);return b.jsx("td",{contentEditable:i,className:m,style:p,children:d},r)})}),S8=({row:e,editable:t})=>b.jsx(b.Fragment,{children:e.map((n,i)=>b.jsx("td",{contentEditable:t,children:n},i))}),M8=({activeData:e,dataRows:t,isOnThePage:n,noFoundMessage:i,dataColumns:s,onRowClick:r,selectable:o,handleRowSelect:a,selectedRows:l,format:c,editable:u})=>{const{isLoading:d}=k.useContext(Tc),h=e.length,f=s.length,p=(m,v)=>{m.target.nodeName!=="INPUT"&&(r==null||r(v))};return b.jsxs(H3,{className:"datatable-body",children:[e.map((m,v)=>{const y=t.indexOf(m),g=l.includes(y),x=I(g&&"active",mw(m)&&m.rowSelector&&`mdb-datatable-${m.rowSelector}`);if(n(v))return b.jsxs("tr",{onClick:_=>p(_,m),className:x,style:{cursor:r&&"pointer"},children:[o&&b.jsx("td",{children:b.jsx(oh,{checked:g,onChange:()=>a(y)})}),x8(m)&&b.jsx(S8,{editable:u,row:m}),mw(m)&&E0(s)&&b.jsx(k8,{editable:u,row:m,dataColumns:s,format:c})]},v)}),!h&&!d&&b.jsx("tr",{className:"datatable-results-info",children:b.jsx("td",{colSpan:f,className:"text-center",children:i})})]})},C8=({dataColumns:e,dataRows:t,sort:n,searchValue:i,advancedSearch:s,advancedSearchValue:r})=>{const[o,a]=k.useState(t);return k.useEffect(()=>{const{column:l,option:c}=n,{phrase:u,columns:d}=r;let h;if(l){let f,p=0;E0(e)&&(f=e.find(m=>m.label===l)),LT(e)&&(p=e.indexOf(l)),h=v8(t,f?f.field:p,c)}i&&!s&&(h=pw(h||t,i,void 0)),u&&(h=pw(h||t,u,d)),a(h||t)},[n,t,e,i,s,r]),o},P8=Y.forwardRef(({advancedSearch:e,allText:t,className:n,bordered:i,borderless:s,borderColor:r="",color:o="",dark:a,entries:l=10,editable:c,entriesOptions:u,fixedHeader:d,fullPagination:h,hover:f,format:p,loaderClass:m="bg-primary",isLoading:v,loadingMessage:y="Loading results...",maxWidth:g="",maxHeight:x="",multi:_,noFoundMessage:w="No matching results found",pagination:S=!0,selectable:C,sortField:M="",searchInputProps:P,sortOrder:T="asc",sm:A,striped:E,rowsText:z,data:N={columns:[],rows:[]},search:L,onSelectRow:R,onRowClick:B,searchLabel:D,ofText:$,...F},V)=>{const[W,et]=k.useState(0),[Z,O]=k.useState(l),[U,lt]=k.useState({column:"",option:""}),[ct,kt]=k.useState([]),[it,Lt]=k.useState(""),[Ct,Qt]=k.useState({phrase:"",columns:""}),ft=C8({dataColumns:N.columns,dataRows:N.rows,sort:U,searchValue:it,advancedSearch:e,advancedSearchValue:Ct}),wt=I("datatable",f&&"datatable-hover",o&&`bg-${o}`,a&&"datatable-dark",i&&"datatable-bordered",s&&"datatable-borderless",r&&`border-${r}`,E&&"datatable-striped",A&&"datatable-sm",v&&"datatable-loading",n),dt=J=>W*Z<=J&&J<(W+1)*Z,jt=J=>{const{column:mt,option:q}=U;lt(mt===J?q==="asc"?{...U,option:"desc"}:{column:"",option:""}:{column:J,option:"asc"})},pt=J=>{const mt=J.currentTarget.checked,q=mt?Array.from({length:N.rows.length},(Dt,he)=>he):[],ye=q.map(Dt=>ft[Dt]);R==null||R(ye,q,mt),kt(q)},xt=J=>{const mt=ct.includes(J);let q;_?mt?q=ct.filter(he=>he!==J):q=[...ct,J]:mt?q=[]:q=[J];const ye=q.map(he=>ft[he]),Dt=q.length===N.rows.length;R==null||R(ye,q,Dt),kt(q)};return k.useEffect(()=>{M&<({column:M,option:T})},[M,T]),k.useEffect(()=>{et(0)},[it]),b.jsxs(Tc.Provider,{value:{isLoading:v,activePage:W,setActivePage:et,sort:U,fixedHeader:d,handleSort:jt},children:[b.jsx(b8,{search:L,advancedSearch:e,searchValue:it,setSearchValue:Lt,searchInputProps:P,label:D,setAdvancedSearchValue:Qt}),b.jsxs("div",{className:wt,ref:V,style:{maxWidth:g},...F,children:[b.jsx(k4,{className:"datatable-inner table-responsive ps",style:{overflow:"auto",position:"relative",maxWidth:g,maxHeight:x},children:b.jsxs(z3,{className:"datatable-table",children:[b.jsx(W3,{className:"datatable-header",children:b.jsxs("tr",{children:[C&&b.jsx("th",{className:d?"fixed-cell":"",children:_&&b.jsx(oh,{checked:ct.length===N.rows.length,onChange:pt})}),LT(N.columns)&&b.jsx(_8,{dataColumns:N.columns}),E0(N.columns)&&b.jsx(w8,{dataColumns:N.columns})]})}),b.jsx(M8,{activeData:ft,dataColumns:N.columns,dataRows:N.rows,isOnThePage:dt,onRowClick:B,format:p,handleRowSelect:xt,selectedRows:ct,selectable:C,noFoundMessage:w,editable:c})]})}),v&&b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"datatable-loader bg-light}",children:b.jsx("span",{className:"datatable-loader-inner",children:b.jsx("span",{className:I("datatable-progress",m)})})}),b.jsx("p",{className:"text-center text-muted my-4",children:y})]}),S&&b.jsx(y8,{fullPagination:h,selectValue:Z,setSelectValue:O,activeDataLength:ft.length,rowsText:z,entriesOptions:u,fullDataLength:N.rows.length,allText:t,ofText:$})]})]})});P8.displayName="MDBDatatable";h0.register(...i3||[]);Y.createContext({activeItem:1,setActiveItem:null,prevActive:{current:1},setHeight:null,completed:[],noEditable:!1,isAnimating:{current:!1},linear:!1,formRef:{current:null},validate:{target:0,after:0},setValidate:null,type:"horizontal",stepsLength:0,onValid:void 0,onInvalid:void 0,mobileProgress:!1,disableHeadSteps:!1,animations:!0});Y.createContext({activeItem:0,dynamic:!1,dynamicStyle:{color:"",icon:""},setDynamicStyle:null,setActiveItem:null,hoveredItem:0,setHoveredItem:null,readonly:!1,onChange:void 0});const T8=Y.forwardRef(({backdrop:e=!0,backdropColor:t="black",backdropOpacity:n=.4,color:i,className:s,loadingText:r="Loading...",isOpen:o,fullScreen:a,overflow:l=!0,parentRef:c,spinnerElement:u=b.jsx(hT,{className:"loading-icon",role:"status"}),textClassName:d,textStyles:h,tag:f="div",...p},m)=>{const v=I("loading-text",d),y=I(a?"loading-full":"loading","loading-spinner",a?"position-fixed":"position-absolute",i&&`text-${i}`,s),g=I("loading-backdrop",!a&&"position-absolute");k.useEffect(()=>{const w=c==null?void 0:c.current;if(w)return w.classList.add("position-relative"),()=>{w.classList.remove("position-relative")}},[c]),k.useEffect(()=>{if(a&&l)return o?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}},[a,o,l]);const x=b.jsxs(f,{className:y,ref:m,...p,children:[u,b.jsx("span",{className:v,style:h,children:r})]}),_=b.jsx("div",{className:g,style:{opacity:n,backgroundColor:t}});return b.jsx(b.Fragment,{children:o!==!1&&b.jsx(b.Fragment,{children:a?b.jsxs(aa,{children:[x,_]}):b.jsxs(b.Fragment,{children:[x,e&&_]})})})});T8.displayName="MDBLoadingManagement";const D8=({isOpened:e,inputRef:t,dropdownEl:n,setOpenState:i,onClose:s})=>{const r=k.useCallback(o=>{if(!n)return;const a=t.current===o.target,l=n===o.target,c=n.contains(o.target);e&&!a&&!l&&!c&&(i(!1),s==null||s())},[e,i,n,t,s]);k.useEffect(()=>(document.addEventListener("click",r),()=>{document.removeEventListener("click",r)}),[r])},E8=({inputRef:e,dropdownEl:t})=>{const n=k.useCallback(()=>{if(!e.current||!t)return;const{width:i}=window.getComputedStyle(e.current);t.style.width=i},[t,e]);k.useEffect(()=>(n(),window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)}),[n])},A8=({isOpen:e})=>{const[t,n]=k.useState(!1);return k.useEffect(()=>{let i;return e?n(!0):i=setTimeout(()=>{n(!1)},100),()=>{clearTimeout(i)}},[e]),t},O8=({className:e,customContent:t=null,inputRef:n,isOpen:i,isOpened:s,children:r,setOpenState:o,listHeight:a="190px",onOpened:l,onClose:c,onClosed:u,...d})=>{const[h,f]=k.useState(null),[p,m]=k.useState(null),v=k.useMemo(()=>[{name:"matchReferenceWidth",enabled:!0,fn:({state:S,instance:C})=>{if(!p)return;const M=p.offsetWidth,P=S.rects.reference.width;Math.round(M)!==Math.round(P)&&(p.style.width=`${P}px`,C.update())},phase:"beforeWrite",requires:["computeStyles"]}],[p]),y=A8({isOpen:i}),{styles:g,attributes:x,update:_}=Oh(h,p,{modifiers:v}),w=I("autocomplete-dropdown",i&&"open",e);return D8({isOpened:s,setOpenState:o,dropdownEl:p,inputRef:n,onClose:c}),E8({inputRef:n,dropdownEl:p}),k.useEffect(()=>{n.current&&f(n.current)},[n]),k.useEffect(()=>{i&&(_==null||_())},[i,_,y]),b.jsx(b.Fragment,{children:b.jsx(aa,{children:b.jsx("div",{className:"autocomplete-dropdown-container",ref:m,...d,style:g.popper,...x.popper,onTransitionEnd:S=>{S.propertyName==="opacity"&&(y?l==null||l():u==null||u())},children:b.jsxs("div",{className:w,children:[b.jsx("ul",{className:"autocomplete-items-list",role:"listbox",style:{maxHeight:a,display:y?"block":"none"},children:r}),t]})})})})},L8=({className:e,isActive:t,children:n,onSelect:i,value:s,...r})=>{const o=I("autocomplete-item",t&&"active",e),a=k.useRef(null);return k.useEffect(()=>{!t||!a.current||a.current.scrollIntoView({block:"nearest"})},[t]),b.jsx("li",{className:o,onClick:()=>i(s),ref:a,...r,children:n})},R8=({isOpen:e,setOpenState:t,length:n})=>{const[i,s]=k.useState(-1),r=k.useCallback(o=>{const a=o.key==="Tab",l=o.key==="Escape",c=o.key==="ArrowUp",u=o.key==="ArrowDown",d=o.key==="Home",h=o.key==="End",f=o.key==="Enter",p=o.altKey,m=n-1;if(!e)return s(-1);if(l||f||a||p&&c)return t(!1);if(u){o.preventDefault(),s(v=>v===m?m:v+1);return}if(c){o.preventDefault(),s(v=>v===0?0:v-1);return}if(d&&i!==-1){o.preventDefault(),s(0);return}if(h&&i!==-1){o.preventDefault(),s(m);return}},[e,t,n,i]);return k.useEffect(()=>{s(-1)},[n]),k.useEffect(()=>(document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}),[r]),i},N8=Y.forwardRef(({open:e,autoSelect:t,className:n,customContent:i,data:s=[],displayValue:r,value:o,isLoading:a,listHeight:l,noResults:c="No results found",itemContent:u,onSelect:d,onSearch:h,onChange:f,onClose:p,onClosed:m,onOpen:v,onOpened:y,...g},x)=>{const _=k.useRef(null),[w,S]=k.useState(!1),[C,M]=k.useState(!1),P=ef(w,e),[T,A]=k.useState(""),E=k.useMemo(()=>o!==void 0?o:T,[o,T]),z=R8({isOpen:P,setOpenState:S,length:s.length});k.useImperativeHandle(x,()=>_.current);const N=I(P&&"focused","autocomplete-input",n),L=I((P||E)&&"active","autocomplete-label"),R=()=>{S(!0),v==null||v(),_.current&&!_.current.value&&(h==null||h(""))},B=$=>r?r($):$,D=$=>{S(!1),_.current&&(_.current.value=$,h==null||h($),d==null||d($),f==null||f($),p==null||p(),A($))};return b.jsxs(b.Fragment,{children:[b.jsx(wi,{autoComplete:"off",onKeyDown:$=>{const F=$.key==="Enter",V=$.key==="Tab";if(!w)return S(!0);z!==-1&&(F||t&&V)&&D(B(s[z]))},onChange:$=>{h==null||h($.target.value),f==null||f($.target.value),A($.target.value)},onFocus:R,className:N,labelClass:L,ref:_,role:"combobox",value:E,...g,children:a&&b.jsx("div",{className:"autocomplete-loader spinner-border",children:b.jsx("span",{className:"sr-only",children:"Loading..."})})}),b.jsxs(O8,{isOpen:P,isOpened:C,inputRef:_,setOpenState:S,customContent:i,listHeight:l,onClose:p,onOpened:()=>{y==null||y(),M(!0)},onClosed:()=>{m==null||m(),M(!1)},children:[s.length===0&&b.jsx("li",{className:"autocomplete-item autocomplete-no-results",children:c}),s.map(($,F)=>b.jsx(L8,{isActive:z===F,value:B($),onSelect:D,children:u?u($):B($)},F))]})]})});N8.displayName="MDBAutocomplete";const j8=Y.forwardRef(({className:e,icon:t,tag:n="p",children:i,...s},r)=>{const o=I("popconfirm-message",e);return b.jsxs(n,{className:o,ref:r,...s,children:[t&&b.jsx("span",{className:"popconfirm-icon-container",children:t}),b.jsx("span",{className:"popconfirm-message-text",children:i})]})});j8.displayName="MDBPopconfirmMessage";const $8=Y.forwardRef(({className:e,tag:t="div",zoomLevel:n=1,fontAwesome:i="free",children:s,lightboxRef:r,onOpen:o,onClose:a,onSlide:l,onZoomIn:c,onZoomOut:u,disablePortal:d,...h},f)=>{const p=k.useRef(null),m=k.useRef(null),v=r||m,y=k.useRef(null),[g,x]=k.useState(!1),[_,w]=k.useState(0),[S,C]=k.useState(!1),[M,P]=k.useState([]),[T,A]=k.useState(""),[E,z]=k.useState(1),[N,L]=k.useState(!1),[R,B]=k.useState(),[D,$]=k.useState(!1),F=k.useRef(!1),V=k.useRef(!1),W=k.useRef(),et=k.useRef(),Z=k.useRef(),O=k.useRef(),U=k.useRef(),lt=k.useRef(),ct=k.useRef(),kt=I("lightbox",e),it=I(i==="pro"&&"fontawesome-pro"),Lt=I("lightbox-gallery-close-btn",i==="pro"&&"fontawesome-pro"),Ct=I("lightbox-gallery-fullscreen-btn",i==="pro"&&"fontawesome-pro",S&&"active"),Qt=I("lightbox-gallery-zoom-btn",i==="pro"&&"fontawesome-pro",E>1&&"active"),ft=k.useMemo(()=>document.documentElement.dir==="rtl",[]),wt=()=>{F.current=!0,setTimeout(()=>{F.current=!1},400)},dt=k.useCallback(j=>{let Q=j;return Q>M.length-1?Q=0:Q<0&&(Q=M.length-1),M[Q].classList.contains("lightbox-disabled")?dt(Q-1):Q},[M]),jt=k.useCallback(()=>{E>=3||(z(j=>j+n),c==null||c())},[c,E,n]),pt=k.useCallback(()=>{var j;const Q=(j=p.current)==null?void 0:j.querySelector(".lightbox-gallery-item.active");Q!=null&&Q.parentElement&&(Q.parentElement.style.left="0",Q.parentElement.style.top="0",Q.style.transition="all 0.5s ease-out",Q.style.left="0",Q.style.top="0",ls(Q),setTimeout(()=>{Q.style.transition="none"},500))},[]),xt=k.useCallback(()=>{E-n===1&&pt(),!(E<=1)&&(z(j=>j-n),u==null||u())},[u,pt,E,n]),J=k.useCallback(()=>{var j;p.current&&Array.from((j=p.current)==null?void 0:j.querySelectorAll(".lightbox-gallery-item")).forEach(Q=>{ls(Q)})},[]),mt=k.useCallback(()=>{S&&document.exitFullscreen&&document.exitFullscreen(),setTimeout(()=>{document.body.classList.remove("disabled-scroll"),document.body.classList.remove("replace-scrollbar")}),x(!1),z(1),L(!1),J(),a==null||a()},[J,S,a]),q=k.useCallback(j=>{if(F.current||M.length<=1)return _;let Q=0;switch(j){case"left":Q=_-1;break;case"right":Q=_+1;break;case"last":Q=M.length-1;break;case"first":Q=0;break}wt();const It=dt(Q);w(It),z(1),L(!1),setTimeout(()=>{var nt;const Tt=(nt=p.current)==null?void 0:nt.querySelector(".lightbox-gallery-item.active");J(),A(Tt.getAttribute("data-mdb-caption"))},300),l==null||l()},[_,J,M.length,l,dt]),ye=k.useCallback(j=>{if(g)switch(j.nativeEvent.key){case"ArrowRight":q(ft?"left":"right");break;case"ArrowLeft":q(ft?"right":"left");break;case"Escape":mt();break;case"Home":q("first");break;case"End":q("last");break;case"ArrowUp":jt();break;case"ArrowDown":xt();break}},[mt,q,jt,xt,g,ft]),Dt=k.useCallback(j=>{document.body.classList.add("disabled-scroll"),document.documentElement.scrollHeight>document.documentElement.clientHeight&&document.body.classList.add("replace-scrollbar"),x(!0),w(j),L(!1),J(),setTimeout(()=>{var Q;const It=(Q=p.current)==null?void 0:Q.querySelector(".lightbox-gallery-item.active");A(It.getAttribute("data-mdb-caption"))},0),o==null||o()},[J,o]);k.useImperativeHandle(f,()=>({outsideAccess(j){Dt(j)}}));const he=k.useCallback(()=>{(document.webkitIsFullScreen||document.mozFullScreen||document.msFullscreenElement)===void 0&&C(!1)},[]),Un=()=>{var j,Q,It;if(!S){(Q=(j=p.current)==null?void 0:j.requestFullscreen)==null||Q.call(j),C(!0);return}(It=document.exitFullscreen)==null||It.call(document),C(!1)},Yn=j=>{j.nativeEvent.preventDefault();const Q=j.nativeEvent instanceof TouchEvent?j.nativeEvent.touches[0]:j.nativeEvent,It=Q.clientX,nt=Q.clientY;j.nativeEvent instanceof TouchEvent&&j.type==="touchstart"&&j.nativeEvent.touches.length>1&&($(!0),B(j.nativeEvent.touches));const Tt=j.target;Z.current=parseFloat(Tt.style.left),O.current=parseFloat(Tt.style.top),W.current=parseFloat(Tt.style.left),et.current=parseFloat(Tt.style.top),U.current=It*(1/E)-W.current,lt.current=nt*(1/E)-et.current,L(!0)},Mn=j=>{if(j.type==="touchmove"&&j.nativeEvent instanceof TouchEvent&&j.nativeEvent.targetTouches.length>1&&(j.nativeEvent.preventDefault(),as(j)),!N||D)return;const Q=j.nativeEvent instanceof TouchEvent?j.nativeEvent.touches[0]:j.nativeEvent,It=Q.clientX,nt=Q.clientY,Tt=j.target;if(E!==1){W.current=It*(1/E)-U.current,et.current=nt*(1/E)-lt.current,Tt.style.left=`${W.current}px`,Tt.style.top=`${et.current}px`;return}M.length<=1||(W.current=It*(1/E)-U.current,Tt.style.left=`${W.current}px`)},Si=k.useCallback(()=>{if(!(E!==1||M.length<=1||!W.current||D)){if(W.current-(Z.current||0)>0){q(ft?"right":"left");return}q(ft?"left":"right")}},[q,D,ft,M.length,E]),dn=k.useCallback(j=>{D||(j.nativeEvent instanceof TouchEvent&&!j.nativeEvent.touches&&Xn(j),E!==1?xt():jt())},[jt,xt,D,E]),Mi=j=>{if(L(!1),j.nativeEvent instanceof MouseEvent){Si(),L(!1);return}if(D&&j.targetTouches.length===0){$(!1),B(void 0);return}L(!1),Si()},as=j=>{if(!R)return;const Q=Math.hypot(R[1].pageX-R[0].pageX,R[1].pageY-R[0].pageY),It=Math.hypot(j.nativeEvent.touches[1].pageX-j.nativeEvent.touches[0].pageX,j.nativeEvent.touches[1].pageY-j.nativeEvent.touches[0].pageY),nt=Math.abs(Q-It),Tt=j.nativeEvent.view.screen.width;nt<=Tt*.03||(Q<=It?jt():xt(),B(j.nativeEvent.touches))},ls=j=>{j.parentElement&&(j.width>=j.height?(j.style.width="100%",j.style.maxWidth="100%",j.style.height="auto",j.style.top=`${(j.parentElement.offsetHeight-j.height)/2}px`,j.style.left="0"):(j.style.height="100%",j.style.maxHeight="100%",j.style.width="auto",j.style.left=`${(j.parentElement.offsetWidth-j.width)/2}px`,j.style.top="0"),j.width>=j.parentElement.offsetWidth&&(j.style.width=`${j.parentElement.offsetWidth}px`,j.style.height="auto",j.style.left="0",j.style.top=`${(j.parentElement.offsetHeight-j.height)/2}px`),j.height>=j.parentElement.offsetHeight&&(j.style.height=`${j.parentElement.offsetHeight}px`,j.style.width="auto",j.style.top="0",j.style.left=`${(j.parentElement.offsetWidth-j.width)/2}px`),W.current=parseFloat(j.style.left)||0,et.current=parseFloat(j.style.top)||0)},Ci=j=>{const Q=j.getAttribute("data-mdb-img")?j.getAttribute("data-mdb-img"):j.getAttribute("src")?j.getAttribute("src"):"",It=j.getAttribute("alt")?j.getAttribute("alt"):j.getAttribute("data-mdb-caption")?j.getAttribute("data-mdb-caption"):"",nt=j.getAttribute("data-mdb-caption")?j.getAttribute("data-mdb-caption"):j.getAttribute("alt")?j.getAttribute("alt"):"";return{source:Q,alt:It,caption:nt}},Pi=k.useCallback(()=>{const j=[...v.current.querySelectorAll(".lightbox-item")].filter(Q=>!Q.classList.contains("lightbox-disabled"));P(j)},[v]),Ke=k.useCallback(()=>{J()},[J]),Xn=j=>{W.current=window.innerWidth/2-j.nativeEvent.offsetX-50,et.current=window.innerHeight/2-j.nativeEvent.offsetY-50;const Q=j.target;Q.style.left=`${W.current}px`,Q.style.top=`${et.current}px`,Q.style.transition="all 0.5s ease-out",setTimeout(()=>{Q.style.transition="none"},500)},Ti=j=>{if(j.deltaY>0)return xt();E>=3||(Xn(j),jt())};return k.useEffect(()=>{Pi()},[Pi]),k.useEffect(()=>{M.length&&J()},[J,M]),k.useEffect(()=>(M.forEach((j,Q)=>{!j.classList.contains("lightbox-disabled")&&j.addEventListener("click",()=>Dt(Q))}),()=>{M.forEach((j,Q)=>{j.removeEventListener("click",()=>Dt(Q))})}),[Dt,M]),k.useEffect(()=>(window.addEventListener("resize",Ke),window.addEventListener("fullscreenchange",he),()=>{window.removeEventListener("resize",Ke),window.removeEventListener("fullscreenchange",he)}),[he,Ke]),k.useEffect(()=>{const j=document.querySelector("meta[name=viewport]");if(ct.current||(ct.current=(j==null?void 0:j.getAttribute("content"))||""),!g){V.current=!1,j==null||j.setAttribute("content",ct.current);return}setTimeout(()=>{var Q;V.current=!0,(Q=y.current)==null||Q.focus(),j==null||j.setAttribute("content",`${ct.current} user-scalable=no`)},300)},[g]),b.jsxs(b.Fragment,{children:[b.jsx(t,{ref:v,className:kt,...h,children:s}),b.jsx(aa,{disablePortal:d,children:b.jsxs("div",{className:"lightbox-gallery",onClick:j=>j.target.tagName==="DIV"&&mt(),onKeyUp:ye,ref:p,style:{opacity:g?1:0,pointerEvents:g?"initial":"none",visibility:g?"visible":"hidden"},children:[b.jsx("div",{className:"lightbox-gallery-loader"}),b.jsxs("div",{className:"lightbox-gallery-toolbar",children:[b.jsx("div",{className:"lightbox-gallery-left-tools",children:b.jsx("p",{className:"lightbox-gallery-counter",children:`${_+1} / ${M.length}`})}),b.jsxs("div",{className:"lightbox-gallery-right-tools",children:[b.jsx("button",{className:Ct,onClick:Un}),b.jsx("button",{"aria-label":E>1?"Zoom out":"Zoom in",className:Qt,onClick:()=>E>1?xt():jt()}),b.jsx("button",{className:Lt,onClick:mt})]})]}),b.jsx("div",{className:"lightbox-gallery-content",style:{transform:g?"scale(1)":"scale(0.25)",transition:"all 0.5s ease-out"},children:M.map((j,Q)=>{const{source:It,alt:nt,caption:Tt}=Ci(j),Oe=Q===_?1:0,cs=Q===_?E:0,ai=_===M.length-1&&Q===0&&M.length>1,Kn=_===0&&Q===M.length-1&&M.length>1;let Me;return _Q&&!ai||Kn?Me="-100%":Me="0%",b.jsx("div",{className:"lightbox-gallery-image",style:{position:"absolute",opacity:Oe,left:g?Me:"0%",transform:`scale(${cs})`,transition:_===Q||V.current?"all 0.5s ease-out":"none"},children:b.jsx("img",{src:It||"",alt:nt||"","data-mdb-caption":Tt||"",onMouseDown:Yn,onMouseMove:Mn,onMouseUp:Mi,onWheel:Ti,onTouchStart:Yn,onTouchMove:Mn,onTouchEnd:Mi,onDoubleClick:dn,className:`lightbox-gallery-item ${_===Q&&"active"}`})},Q)})}),b.jsx("div",{className:"lightbox-gallery-arrow-left",children:b.jsx("button",{"aria-label":"Previous",className:it,onClick:()=>q("left")})}),b.jsx("div",{className:"lightbox-gallery-arrow-right",children:b.jsx("button",{"aria-label":"Next",className:it,onClick:()=>q("right"),ref:y})}),b.jsx("div",{className:"lightbox-gallery-caption-wrapper",children:b.jsx("p",{className:"lightbox-gallery-caption",children:T})})]})})]})});$8.displayName="MDBLightbox";const I8=Y.forwardRef(({className:e,fullscreenSrc:t,disabled:n,caption:i,...s},r)=>{const o=I("lightbox-item",n&&"lightbox-disabled",e);return b.jsx("img",{ref:r,"data-mdb-caption":i,"data-mdb-img":t,className:o,...s})});I8.displayName="MDBLightboxItem";const F8=Y.forwardRef(({className:e,...t},n)=>{const[i,s]=k.useState(!1),r=k.useCallback(()=>{const a=document.documentElement.scrollTop;s(!!a)},[]),o=I(i&&"navbar-scrolled","navbar-scroll",e);return k.useEffect(()=>{window.addEventListener("scroll",r)},[r]),b.jsx(pT,{className:o,ref:n,...t})});F8.displayName="MDBAnimatedNavbar";const RT=k.forwardRef(({className:e,closeIcon:t,tag:n="div",color:i,size:s,children:r,onDelete:o,...a},l)=>{const[c,u]=k.useState(!0),d=I("chip",s&&`chip-${s}`,i&&`chip-outline btn-outline-${i}`,e);return c?b.jsxs(n,{ref:l,className:d,...a,children:[r,t&&b.jsx("i",{className:"close fas fa-times",onClick:()=>{o==null||o(r),u(!1)}})]}):null});RT.displayName="MDBChip";const B8=Y.forwardRef(({className:e,value:t="",id:n,labelId:i,labelClass:s,label:r,onChange:o,labelRef:a,labelStyle:l,readonly:c,editable:u,onAdd:d,onDelete:h,initialValues:f=[],...p},m)=>{const v=k.useRef(null),y=a??v,g=k.useRef(null);k.useImperativeHandle(m,()=>g.current);const[x,_]=k.useState(f),[w,S]=k.useState(null),[C,M]=k.useState(0),[P,T]=k.useState(null),[A,E]=k.useState(t),z=x.length>0||A.length>0,N=I("form-outline","chips-input-wrapper",x.length>0&&"chips-padding chips-transition"),L=I("form-control",z&&"active",e),R=I("form-label",s);k.useEffect(()=>{!y.current||y.current.clientWidth===0||M(y.current.clientWidth*.8+8)},[y]);const B=()=>{y.current&&M(y.current.clientWidth*.8+8)},D=O=>{E(O.target.value),o==null||o(O)},$=O=>{A.length||((O.key==="ArrowLeft"||O.key==="ArrowDown")&&T(U=>U?U-1:x.length-1),(O.key==="ArrowRight"||O.key==="ArrowUp")&&T(U=>U===x.length-1||U===null?0:U+1),O.key==="Backspace"&&P!==null&&F(P)),O.key==="Enter"&&A.trim().length&&(d==null||d(A),_([...x,{tag:A}]),E(""))},F=O=>{const U=x.find((lt,ct)=>O===ct);if(U){h==null||h(U==null?void 0:U.tag);const lt=x.filter((ct,kt)=>O!==kt);_(lt),T(null)}},V=(O,U)=>{u&&S(U)},W=(O,U)=>{if(!u)return;const lt=O.currentTarget.textContent,ct=x.map((kt,it)=>it===U&<?{tag:lt}:kt);lt?_(ct):F(U),S(null),T(null)},et=(O,U)=>{O.key==="Enter"&&u&&w!==null&&W(O,U)},Z=()=>{A.trim().length&&(d==null||d(A),_([...x,{tag:A}]),E(""))};return b.jsx("div",{className:"chips chips-placeholder",children:b.jsxs("div",{className:N,children:[x.map((O,U)=>b.jsx(RT,{contentEditable:w===U,suppressContentEditableWarning:!0,onDoubleClick:lt=>V(lt,U),onDelete:()=>F(U),onKeyDown:lt=>et(lt,U),closeIcon:w!==U,className:I("btn",U===P&&"active"),children:O.tag},`${Math.random()}-${U}`)),b.jsx("input",{type:"text",readOnly:c,className:L,onChange:D,onFocus:B,onKeyDown:$,onBlur:()=>Z(),value:A,id:n,ref:g,...p}),r&&b.jsx("label",{className:R,style:l,id:i,htmlFor:n,ref:y,children:r}),b.jsxs("div",{className:"form-notch",children:[b.jsx("div",{className:"form-notch-leading"}),b.jsx("div",{className:"form-notch-middle",style:{width:C}}),b.jsx("div",{className:"form-notch-trailing"})]})]})})});B8.displayName="MDBChipsInput";function V8(){const[e,t]=k.useState(""),[n,i]=k.useState(""),[s,r]=k.useState(""),[o,a]=k.useState(null),[l,c]=k.useState(!1),[u,d]=k.useState([]),[h,f]=k.useState(!1),[p,m]=k.useState(null),[v,y]=k.useState(null),g=k.useRef(null);k.useEffect(()=>{if(l&&o&&o.plot_data&&g&&g.current){const M=g.current.getContext("2d");M&&new by(M,{type:"line",data:{labels:o.plot_data.n,datasets:[{label:"n^log_b(a)",data:o.plot_data.n_log_b_a,borderColor:"blue",borderWidth:1,fill:!1},{label:"f(n)",data:o.plot_data.f_n,borderColor:"red",borderWidth:2,fill:!1,borderDash:[5,5]},{label:"Time Complexity",data:o.plot_data.time_complexity,borderColor:"green",borderWidth:2,fill:!1,borderDash:[10,5]}]},options:{scales:{y:{beginAtZero:!0,title:{display:!0,text:"Function Value",color:"#888",font:{size:12}},ticks:{}},x:{grid:{display:!0},ticks:{callback:function(P){return Number(P).toFixed(0)}},title:{display:!0,text:"Input Size (n)",color:"#888",font:{size:12}}}},plugins:{legend:{display:!0,position:"top",labels:{boxWidth:20,padding:10}},tooltip:{enabled:!0}},elements:{line:{borderWidth:1},point:{radius:0}},responsive:!0,maintainAspectRatio:!1}})}},[l,o]),k.useEffect(()=>{(async()=>{try{const P=await fetch("http://localhost:8000/api/algorithms");if(!P.ok)throw new Error("Network response was not ok");const T=await P.json();d(T)}catch(P){console.error("Failed to fetch algorithms:",P)}})()},[]);const x=M=>{if(M===-1)f(!1),t(""),i(""),r(""),y(null);else{const P=u.find(T=>T.id===M);P&&(t(P.a.toString()),i(P.b.toString()),r(P.k.toString()),f(!0),y(P))}},_=async M=>{M.preventDefault(),await w(M)},w=async M=>{M.preventDefault(),c(!1),m(v);try{const P=await fetch("http://localhost:8000/api/evaluate/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({a:e,b:n,k:s})});if(!P.ok)throw new Error("Network response was not ok");const T=await P.json();a(T),c(!0)}catch(P){console.error("There was a problem with your fetch operation:",P)}},S=M=>{var P;if(Array.isArray(M))console.log("Multiple selections are not supported.");else{const T=parseInt(((P=M.value)==null?void 0:P.toString())||"-1",10);x(T)}},C=[{text:"User Input",value:"-1"},...u.map(M=>({text:M.name,value:M.id.toString()}))];return b.jsxs(b.Fragment,{children:[b.jsxs(rd,{alignment:"center",children:[b.jsx(od,{children:b.jsx("h1",{className:"main-header",children:"Evaluate Master Theorem"})}),b.jsxs(eg,{children:[b.jsx(fT,{children:b.jsx("span",{className:"card-title",children:"Enter the values of a, b, and k to evaluate the Master Theorem:"})}),b.jsxs("form",{onSubmit:_,children:[b.jsx(wi,{label:"a (number of subproblems)",id:"aInput",type:"number",min:"1",className:"my-4",value:e,onChange:M=>t(M.target.value),disabled:h}),b.jsx(wi,{label:"b (factor by which problem size is reduced)",id:"bInput",type:"number",min:"2",className:"my-4",value:n,onChange:M=>i(M.target.value),disabled:h}),b.jsx(wi,{label:"k (exponent in the work outside of recursive calls)",id:"kInput",type:"number",min:"0",className:"my-4",value:s,onChange:M=>r(M.target.value),disabled:h}),b.jsx("div",{className:"my-4",children:b.jsx(D0,{data:C,label:"Choose Algorithm or Enter Values",onChange:S})}),b.jsx(Zt,{onClick:w,className:"btn-block",children:"Evaluate"})]})]})]}),l&&o&&b.jsxs(rd,{className:"my-4",children:[b.jsx(od,{children:b.jsx("h2",{children:"Evaluation"})}),b.jsxs(eg,{className:"evaluation-card-body",children:[b.jsx("canvas",{ref:g,id:"myChart",className:"mb-3"}),b.jsxs(ad,{children:[b.jsx("strong",{children:"Recurrence Relation: "}),b.jsx("span",{dangerouslySetInnerHTML:{__html:o.recurrence_relation}})]}),b.jsxs(ad,{children:[b.jsx("strong",{children:"Evaluation: "}),b.jsx("span",{dangerouslySetInnerHTML:{__html:o.case}})]}),b.jsxs(ad,{children:[b.jsx("strong",{children:"Time Complexity: "}),b.jsx("span",{dangerouslySetInnerHTML:{__html:o.complexity}})]})]}),p&&b.jsxs(b.Fragment,{children:[b.jsxs("h4",{children:[p.name," Algorithm"]}),b.jsxs(ng,{alwaysOpen:!0,initialActive:1,children:[b.jsx(oo,{className:"left-align",collapseId:1,headerTitle:b.jsxs(b.Fragment,{children:[b.jsx(sn,{fas:!0,icon:"question-circle"}),"   Algorithm Description"]}),children:b.jsx("article",{children:p.description})}),b.jsx(oo,{collapseId:2,headerTitle:b.jsxs(b.Fragment,{children:[b.jsx(sn,{fab:!0,icon:"python"}),"   Python Code"]}),children:b.jsx("pre",{className:"left-align",children:b.jsx("code",{children:p.python_code})})})]})]})]}),b.jsxs(rd,{alignment:"center",className:"my-4",children:[b.jsx(od,{children:b.jsx("h2",{children:"About the Master Theorem"})}),b.jsxs(ng,{initialActive:1,children:[b.jsx(oo,{className:"left-align",collapseId:1,headerTitle:"What is the Master Theorem?",children:b.jsxs("article",{children:[b.jsxs("p",{children:["The ",b.jsx("strong",{children:"Master Theorem"})," offers a straightforward way to determine the time complexity of recursive algorithms, especially those that follow the divide and conquer approach. This theorem simplifies the process of analyzing how efficiently an algorithm runs as the size of its input increases. It is particularly useful for computer scientists and software engineers to predict algorithm performance without the need for detailed benchmarks."]}),b.jsx("p",{children:"The following parameters are required to evaluate an algorithm using the Master Theorem:"}),b.jsxs("ul",{children:[b.jsxs("li",{children:[b.jsx("strong",{children:"a"})," = the number of recursive subproblems."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"b"})," = the factor by which the problem size is reduced."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"k"})," = the exponent in the work done outside of the recursive function."]})]})]})}),b.jsx(oo,{className:"left-align",collapseId:2,headerTitle:"Decoding the Master Recurrence",children:b.jsxs("article",{children:[b.jsx("p",{children:"The Master Theorem can only be used to evaluate recursive algorithms with the following recurrence relation:"}),b.jsx("p",{className:"text-center",children:b.jsx("strong",{children:"T(n) = aT(n/b) + f(n)"})}),b.jsxs("p",{children:["This equation is the heart of the Master Theorem. and is called the ",b.jsx("strong",{children:"Master Recurrence"}),". It captures the essence of divide and conquer algorithms:"]}),b.jsxs("ul",{children:[b.jsxs("li",{children:[b.jsx("strong",{children:"T(n)"})," is the total time complexity we aim to find."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"aT(n/b)"})," represents the time taken by the recursive subproblems."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"f(n)"})," is the time taken by the work done outside the recursive calls, such as dividing the problem or combining the results."]})]}),b.jsx("p",{children:"Evaluating the Master Theorem involves comparing the rate of growth of two separate functions:"}),b.jsxs("ul",{children:[b.jsx("p",{className:"text-center",children:b.jsxs("strong",{children:["n",b.jsx("sup",{children:"logb(a)"})," + f(n)"]})}),b.jsxs("li",{children:[b.jsxs("strong",{children:["n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})]})," ","is also known as the ",b.jsx("strong",{children:"watershed function."})]}),b.jsxs("li",{children:[b.jsx("strong",{children:"f(n)"})," is also known as the"," ",b.jsx("strong",{children:"driving function."})]})]}),b.jsx("p",{children:"Comparing the growth rate of these 2 functions results in either of 3 possible cases."})]})}),b.jsx(oo,{className:"left-align",collapseId:3,headerTitle:"The 3 Cases of the Master Theorem",children:b.jsxs("article",{children:[b.jsxs("p",{children:[b.jsx("strong",{children:"Case 1"}),": n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})," ","grows asymptotically and polynomially greater than f(n):"]}),b.jsx("p",{className:"text-center",children:b.jsxs("strong",{children:["T(n) = n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})]})}),b.jsxs("p",{children:[b.jsx("strong",{children:"Case 2:"})," n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})," ","and f(n) grow at the same rate:"]}),b.jsx("p",{className:"text-center",children:b.jsxs("strong",{children:["T(n) = n",b.jsx("sup",{children:"k"})," log(n)"]})}),b.jsxs("p",{children:[b.jsx("strong",{children:"Case 3:"})," f(n) grows assymptotically and polynomially greater than n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})," ","(and also fulfills the regularity condition",b.jsx("sup",{children:"*"}),") :"]}),b.jsx("p",{className:"text-center",children:b.jsxs("strong",{children:["T(n) = f(n",b.jsx("sup",{children:"k"}),")"]})}),b.jsxs("ul",{children:[b.jsxs("li",{children:[b.jsx("strong",{children:"Case 1"})," occurs when the split subproblems dominate the overall time complexity. It implies that as we break the problem down, the sheer number of subproblems is the primary driver of the complexity."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"Case 2"})," occurs when the work done at each level of recursion is just as significant as the number of subproblems. This balance means the time complexity is a combination of the dividing/conquering work and the depth of the recursion."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"Case 3"})," highlights scenarios where the work done outside the recursive calls (combining solutions, for instance) is the main factor determining the time complexity. This is typically seen in algorithms where merging or processing results is more intensive than breaking down the problem."]})]}),b.jsx("p",{children:b.jsxs("small",{children:[b.jsx("strong",{children:"*"})," Please note that this app evaluates n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]}),"and f(n",b.jsx("sup",{children:"k"}),") using their exponents and does not assess the regularity condition in Case 3, or whether the difference in growth between these two functions is polynomial. The regularity condition ensures that the work done at the recursive levels does not grow too quickly compared to the work done to divide the problem and combine the results. This condition helps maintain the integrity of the complexity analysis provided by the theorem."]})})]})})]})]})]})}Sp.createRoot(document.getElementById("root")).render(b.jsx(Y.StrictMode,{children:b.jsx(V8,{})})); + */function mi(e){return getComputedStyle(e)}function Ze(e,t){for(var n in t){var i=t[n];typeof i=="number"&&(i=i+"px"),e.style[n]=i}return e}function Du(e){var t=document.createElement("div");return t.className=e,t}var W_=typeof Element<"u"&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector);function Ts(e,t){if(!W_)throw new Error("No element matching method supported");return W_.call(e,t)}function Mo(e){e.remove?e.remove():e.parentNode&&e.parentNode.removeChild(e)}function H_(e,t){return Array.prototype.filter.call(e.children,function(n){return Ts(n,t)})}var pe={main:"ps",rtl:"ps__rtl",element:{thumb:function(e){return"ps__thumb-"+e},rail:function(e){return"ps__rail-"+e},consuming:"ps__child--consume"},state:{focus:"ps--focus",clicking:"ps--clicking",active:function(e){return"ps--active-"+e},scrolling:function(e){return"ps--scrolling-"+e}}},xT={x:null,y:null};function bT(e,t){var n=e.element.classList,i=pe.state.scrolling(t);n.contains(i)?clearTimeout(xT[t]):n.add(i)}function _T(e,t){xT[t]=setTimeout(function(){return e.isAlive&&e.element.classList.remove(pe.state.scrolling(t))},e.settings.scrollingThreshold)}function d4(e,t){bT(e,t),_T(e,t)}var Cc=function(e){this.element=e,this.handlers={}},wT={isEmpty:{configurable:!0}};Cc.prototype.bind=function(e,t){typeof this.handlers[e]>"u"&&(this.handlers[e]=[]),this.handlers[e].push(t),this.element.addEventListener(e,t,!1)};Cc.prototype.unbind=function(e,t){var n=this;this.handlers[e]=this.handlers[e].filter(function(i){return t&&i!==t?!0:(n.element.removeEventListener(e,i,!1),!1)})};Cc.prototype.unbindAll=function(){for(var e in this.handlers)this.unbind(e)};wT.isEmpty.get=function(){var e=this;return Object.keys(this.handlers).every(function(t){return e.handlers[t].length===0})};Object.defineProperties(Cc.prototype,wT);var la=function(){this.eventElements=[]};la.prototype.eventElement=function(e){var t=this.eventElements.filter(function(n){return n.element===e})[0];return t||(t=new Cc(e),this.eventElements.push(t)),t};la.prototype.bind=function(e,t,n){this.eventElement(e).bind(t,n)};la.prototype.unbind=function(e,t,n){var i=this.eventElement(e);i.unbind(t,n),i.isEmpty&&this.eventElements.splice(this.eventElements.indexOf(i),1)};la.prototype.unbindAll=function(){this.eventElements.forEach(function(e){return e.unbindAll()}),this.eventElements=[]};la.prototype.once=function(e,t,n){var i=this.eventElement(e),s=function(r){i.unbind(t,s),n(r)};i.bind(t,s)};function Eu(e){if(typeof window.CustomEvent=="function")return new CustomEvent(e);var t=document.createEvent("CustomEvent");return t.initCustomEvent(e,!1,!1,void 0),t}function ah(e,t,n,i,s){i===void 0&&(i=!0),s===void 0&&(s=!1);var r;if(t==="top")r=["contentHeight","containerHeight","scrollTop","y","up","down"];else if(t==="left")r=["contentWidth","containerWidth","scrollLeft","x","left","right"];else throw new Error("A proper axis should be provided");h4(e,n,r,i,s)}function h4(e,t,n,i,s){var r=n[0],o=n[1],a=n[2],l=n[3],c=n[4],u=n[5];i===void 0&&(i=!0),s===void 0&&(s=!1);var d=e.element;e.reach[l]=null,d[a]<1&&(e.reach[l]="start"),d[a]>e[r]-e[o]-1&&(e.reach[l]="end"),t&&(d.dispatchEvent(Eu("ps-scroll-"+l)),t<0?d.dispatchEvent(Eu("ps-scroll-"+c)):t>0&&d.dispatchEvent(Eu("ps-scroll-"+u)),i&&d4(e,l)),e.reach[l]&&(t||s)&&d.dispatchEvent(Eu("ps-"+l+"-reach-"+e.reach[l]))}function Jt(e){return parseInt(e,10)||0}function f4(e){return Ts(e,"input,[contenteditable]")||Ts(e,"select,[contenteditable]")||Ts(e,"textarea,[contenteditable]")||Ts(e,"button,[contenteditable]")}function p4(e){var t=mi(e);return Jt(t.width)+Jt(t.paddingLeft)+Jt(t.paddingRight)+Jt(t.borderLeftWidth)+Jt(t.borderRightWidth)}var ao={isWebKit:typeof document<"u"&&"WebkitAppearance"in document.documentElement.style,supportsTouch:typeof window<"u"&&("ontouchstart"in window||"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>0||window.DocumentTouch&&document instanceof window.DocumentTouch),supportsIePointer:typeof navigator<"u"&&navigator.msMaxTouchPoints,isChrome:typeof navigator<"u"&&/Chrome/i.test(navigator&&navigator.userAgent)};function ss(e){var t=e.element,n=Math.floor(t.scrollTop),i=t.getBoundingClientRect();e.containerWidth=Math.round(i.width),e.containerHeight=Math.round(i.height),e.contentWidth=t.scrollWidth,e.contentHeight=t.scrollHeight,t.contains(e.scrollbarXRail)||(H_(t,pe.element.rail("x")).forEach(function(s){return Mo(s)}),t.appendChild(e.scrollbarXRail)),t.contains(e.scrollbarYRail)||(H_(t,pe.element.rail("y")).forEach(function(s){return Mo(s)}),t.appendChild(e.scrollbarYRail)),!e.settings.suppressScrollX&&e.containerWidth+e.settings.scrollXMarginOffset=e.railXWidth-e.scrollbarXWidth&&(e.scrollbarXLeft=e.railXWidth-e.scrollbarXWidth),e.scrollbarYTop>=e.railYHeight-e.scrollbarYHeight&&(e.scrollbarYTop=e.railYHeight-e.scrollbarYHeight),m4(t,e),e.scrollbarXActive?t.classList.add(pe.state.active("x")):(t.classList.remove(pe.state.active("x")),e.scrollbarXWidth=0,e.scrollbarXLeft=0,t.scrollLeft=e.isRtl===!0?e.contentWidth:0),e.scrollbarYActive?t.classList.add(pe.state.active("y")):(t.classList.remove(pe.state.active("y")),e.scrollbarYHeight=0,e.scrollbarYTop=0,t.scrollTop=0)}function U_(e,t){return e.settings.minScrollbarLength&&(t=Math.max(t,e.settings.minScrollbarLength)),e.settings.maxScrollbarLength&&(t=Math.min(t,e.settings.maxScrollbarLength)),t}function m4(e,t){var n={width:t.railXWidth},i=Math.floor(e.scrollTop);t.isRtl?n.left=t.negativeScrollAdjustment+e.scrollLeft+t.containerWidth-t.contentWidth:n.left=e.scrollLeft,t.isScrollbarXUsingBottom?n.bottom=t.scrollbarXBottom-i:n.top=t.scrollbarXTop+i,Ze(t.scrollbarXRail,n);var s={top:i,height:t.railYHeight};t.isScrollbarYUsingRight?t.isRtl?s.right=t.contentWidth-(t.negativeScrollAdjustment+e.scrollLeft)-t.scrollbarYRight-t.scrollbarYOuterWidth-9:s.right=t.scrollbarYRight-e.scrollLeft:t.isRtl?s.left=t.negativeScrollAdjustment+e.scrollLeft+t.containerWidth*2-t.contentWidth-t.scrollbarYLeft-t.scrollbarYOuterWidth:s.left=t.scrollbarYLeft+e.scrollLeft,Ze(t.scrollbarYRail,s),Ze(t.scrollbarX,{left:t.scrollbarXLeft,width:t.scrollbarXWidth-t.railBorderXWidth}),Ze(t.scrollbarY,{top:t.scrollbarYTop,height:t.scrollbarYHeight-t.railBorderYWidth})}function g4(e){e.element,e.event.bind(e.scrollbarY,"mousedown",function(t){return t.stopPropagation()}),e.event.bind(e.scrollbarYRail,"mousedown",function(t){var n=t.pageY-window.pageYOffset-e.scrollbarYRail.getBoundingClientRect().top,i=n>e.scrollbarYTop?1:-1;e.element.scrollTop+=i*e.containerHeight,ss(e),t.stopPropagation()}),e.event.bind(e.scrollbarX,"mousedown",function(t){return t.stopPropagation()}),e.event.bind(e.scrollbarXRail,"mousedown",function(t){var n=t.pageX-window.pageXOffset-e.scrollbarXRail.getBoundingClientRect().left,i=n>e.scrollbarXLeft?1:-1;e.element.scrollLeft+=i*e.containerWidth,ss(e),t.stopPropagation()})}function y4(e){Y_(e,["containerWidth","contentWidth","pageX","railXWidth","scrollbarX","scrollbarXWidth","scrollLeft","x","scrollbarXRail"]),Y_(e,["containerHeight","contentHeight","pageY","railYHeight","scrollbarY","scrollbarYHeight","scrollTop","y","scrollbarYRail"])}function Y_(e,t){var n=t[0],i=t[1],s=t[2],r=t[3],o=t[4],a=t[5],l=t[6],c=t[7],u=t[8],d=e.element,h=null,f=null,p=null;function m(g){g.touches&&g.touches[0]&&(g[s]=g.touches[0].pageY),d[l]=h+p*(g[s]-f),bT(e,c),ss(e),g.stopPropagation(),g.type.startsWith("touch")&&g.changedTouches.length>1&&g.preventDefault()}function v(){_T(e,c),e[u].classList.remove(pe.state.clicking),e.event.unbind(e.ownerDocument,"mousemove",m)}function y(g,x){h=d[l],x&&g.touches&&(g[s]=g.touches[0].pageY),f=g[s],p=(e[i]-e[n])/(e[r]-e[a]),x?e.event.bind(e.ownerDocument,"touchmove",m):(e.event.bind(e.ownerDocument,"mousemove",m),e.event.once(e.ownerDocument,"mouseup",v),g.preventDefault()),e[u].classList.add(pe.state.clicking),g.stopPropagation()}e.event.bind(e[o],"mousedown",function(g){y(g)}),e.event.bind(e[o],"touchstart",function(g){y(g,!0)})}function v4(e){var t=e.element,n=function(){return Ts(t,":hover")},i=function(){return Ts(e.scrollbarX,":focus")||Ts(e.scrollbarY,":focus")};function s(r,o){var a=Math.floor(t.scrollTop);if(r===0){if(!e.scrollbarYActive)return!1;if(a===0&&o>0||a>=e.contentHeight-e.containerHeight&&o<0)return!e.settings.wheelPropagation}var l=t.scrollLeft;if(o===0){if(!e.scrollbarXActive)return!1;if(l===0&&r<0||l>=e.contentWidth-e.containerWidth&&r>0)return!e.settings.wheelPropagation}return!0}e.event.bind(e.ownerDocument,"keydown",function(r){if(!(r.isDefaultPrevented&&r.isDefaultPrevented()||r.defaultPrevented)&&!(!n()&&!i())){var o=document.activeElement?document.activeElement:e.ownerDocument.activeElement;if(o){if(o.tagName==="IFRAME")o=o.contentDocument.activeElement;else for(;o.shadowRoot;)o=o.shadowRoot.activeElement;if(f4(o))return}var a=0,l=0;switch(r.which){case 37:r.metaKey?a=-e.contentWidth:r.altKey?a=-e.containerWidth:a=-30;break;case 38:r.metaKey?l=e.contentHeight:r.altKey?l=e.containerHeight:l=30;break;case 39:r.metaKey?a=e.contentWidth:r.altKey?a=e.containerWidth:a=30;break;case 40:r.metaKey?l=-e.contentHeight:r.altKey?l=-e.containerHeight:l=-30;break;case 32:r.shiftKey?l=e.containerHeight:l=-e.containerHeight;break;case 33:l=e.containerHeight;break;case 34:l=-e.containerHeight;break;case 36:l=e.contentHeight;break;case 35:l=-e.contentHeight;break;default:return}e.settings.suppressScrollX&&a!==0||e.settings.suppressScrollY&&l!==0||(t.scrollTop-=l,t.scrollLeft+=a,ss(e),s(a,l)&&r.preventDefault())}})}function x4(e){var t=e.element;function n(o,a){var l=Math.floor(t.scrollTop),c=t.scrollTop===0,u=l+t.offsetHeight===t.scrollHeight,d=t.scrollLeft===0,h=t.scrollLeft+t.offsetWidth===t.scrollWidth,f;return Math.abs(a)>Math.abs(o)?f=c||u:f=d||h,f?!e.settings.wheelPropagation:!0}function i(o){var a=o.deltaX,l=-1*o.deltaY;return(typeof a>"u"||typeof l>"u")&&(a=-1*o.wheelDeltaX/6,l=o.wheelDeltaY/6),o.deltaMode&&o.deltaMode===1&&(a*=10,l*=10),a!==a&&l!==l&&(a=0,l=o.wheelDelta),o.shiftKey?[-l,-a]:[a,l]}function s(o,a,l){if(!ao.isWebKit&&t.querySelector("select:focus"))return!0;if(!t.contains(o))return!1;for(var c=o;c&&c!==t;){if(c.classList.contains(pe.element.consuming))return!0;var u=mi(c);if(l&&u.overflowY.match(/(scroll|auto)/)){var d=c.scrollHeight-c.clientHeight;if(d>0&&(c.scrollTop>0&&l<0||c.scrollTop0))return!0}if(a&&u.overflowX.match(/(scroll|auto)/)){var h=c.scrollWidth-c.clientWidth;if(h>0&&(c.scrollLeft>0&&a<0||c.scrollLeft0))return!0}c=c.parentNode}return!1}function r(o){var a=i(o),l=a[0],c=a[1];if(!s(o.target,l,c)){var u=!1;e.settings.useBothWheelAxes?e.scrollbarYActive&&!e.scrollbarXActive?(c?t.scrollTop-=c*e.settings.wheelSpeed:t.scrollTop+=l*e.settings.wheelSpeed,u=!0):e.scrollbarXActive&&!e.scrollbarYActive&&(l?t.scrollLeft+=l*e.settings.wheelSpeed:t.scrollLeft-=c*e.settings.wheelSpeed,u=!0):(t.scrollTop-=c*e.settings.wheelSpeed,t.scrollLeft+=l*e.settings.wheelSpeed),ss(e),u=u||n(l,c),u&&!o.ctrlKey&&(o.stopPropagation(),o.preventDefault())}}typeof window.onwheel<"u"?e.event.bind(t,"wheel",r):typeof window.onmousewheel<"u"&&e.event.bind(t,"mousewheel",r)}function b4(e){if(!ao.supportsTouch&&!ao.supportsIePointer)return;var t=e.element;function n(p,m){var v=Math.floor(t.scrollTop),y=t.scrollLeft,g=Math.abs(p),x=Math.abs(m);if(x>g){if(m<0&&v===e.contentHeight-e.containerHeight||m>0&&v===0)return window.scrollY===0&&m>0&&ao.isChrome}else if(g>x&&(p<0&&y===e.contentWidth-e.containerWidth||p>0&&y===0))return!0;return!0}function i(p,m){t.scrollTop-=m,t.scrollLeft-=p,ss(e)}var s={},r=0,o={},a=null;function l(p){return p.targetTouches?p.targetTouches[0]:p}function c(p){return p.pointerType&&p.pointerType==="pen"&&p.buttons===0?!1:!!(p.targetTouches&&p.targetTouches.length===1||p.pointerType&&p.pointerType!=="mouse"&&p.pointerType!==p.MSPOINTER_TYPE_MOUSE)}function u(p){if(c(p)){var m=l(p);s.pageX=m.pageX,s.pageY=m.pageY,r=new Date().getTime(),a!==null&&clearInterval(a)}}function d(p,m,v){if(!t.contains(p))return!1;for(var y=p;y&&y!==t;){if(y.classList.contains(pe.element.consuming))return!0;var g=mi(y);if(v&&g.overflowY.match(/(scroll|auto)/)){var x=y.scrollHeight-y.clientHeight;if(x>0&&(y.scrollTop>0&&v<0||y.scrollTop0))return!0}if(m&&g.overflowX.match(/(scroll|auto)/)){var _=y.scrollWidth-y.clientWidth;if(_>0&&(y.scrollLeft>0&&m<0||y.scrollLeft<_&&m>0))return!0}y=y.parentNode}return!1}function h(p){if(c(p)){var m=l(p),v={pageX:m.pageX,pageY:m.pageY},y=v.pageX-s.pageX,g=v.pageY-s.pageY;if(d(p.target,y,g))return;i(y,g),s=v;var x=new Date().getTime(),_=x-r;_>0&&(o.x=y/_,o.y=g/_,r=x),n(y,g)&&p.preventDefault()}}function f(){e.settings.swipeEasing&&(clearInterval(a),a=setInterval(function(){if(e.isInitialized){clearInterval(a);return}if(!o.x&&!o.y){clearInterval(a);return}if(Math.abs(o.x)<.01&&Math.abs(o.y)<.01){clearInterval(a);return}if(!e.element){clearInterval(a);return}i(o.x*30,o.y*30),o.x*=.8,o.y*=.8},10))}ao.supportsTouch?(e.event.bind(t,"touchstart",u),e.event.bind(t,"touchmove",h),e.event.bind(t,"touchend",f)):ao.supportsIePointer&&(window.PointerEvent?(e.event.bind(t,"pointerdown",u),e.event.bind(t,"pointermove",h),e.event.bind(t,"pointerup",f)):window.MSPointerEvent&&(e.event.bind(t,"MSPointerDown",u),e.event.bind(t,"MSPointerMove",h),e.event.bind(t,"MSPointerUp",f)))}var _4=function(){return{handlers:["click-rail","drag-thumb","keyboard","wheel","touch"],maxScrollbarLength:null,minScrollbarLength:null,scrollingThreshold:1e3,scrollXMarginOffset:0,scrollYMarginOffset:0,suppressScrollX:!1,suppressScrollY:!1,swipeEasing:!0,useBothWheelAxes:!1,wheelPropagation:!0,wheelSpeed:1}},w4={"click-rail":g4,"drag-thumb":y4,keyboard:v4,wheel:x4,touch:b4},Pc=function(e,t){var n=this;if(t===void 0&&(t={}),typeof e=="string"&&(e=document.querySelector(e)),!e||!e.nodeName)throw new Error("no element is specified to initialize PerfectScrollbar");this.element=e,e.classList.add(pe.main),this.settings=_4();for(var i in t)this.settings[i]=t[i];this.containerWidth=null,this.containerHeight=null,this.contentWidth=null,this.contentHeight=null;var s=function(){return e.classList.add(pe.state.focus)},r=function(){return e.classList.remove(pe.state.focus)};this.isRtl=mi(e).direction==="rtl",this.isRtl===!0&&e.classList.add(pe.rtl),this.isNegativeScroll=function(){var l=e.scrollLeft,c=null;return e.scrollLeft=-1,c=e.scrollLeft<0,e.scrollLeft=l,c}(),this.negativeScrollAdjustment=this.isNegativeScroll?e.scrollWidth-e.clientWidth:0,this.event=new la,this.ownerDocument=e.ownerDocument||document,this.scrollbarXRail=Du(pe.element.rail("x")),e.appendChild(this.scrollbarXRail),this.scrollbarX=Du(pe.element.thumb("x")),this.scrollbarXRail.appendChild(this.scrollbarX),this.scrollbarX.setAttribute("tabindex",0),this.event.bind(this.scrollbarX,"focus",s),this.event.bind(this.scrollbarX,"blur",r),this.scrollbarXActive=null,this.scrollbarXWidth=null,this.scrollbarXLeft=null;var o=mi(this.scrollbarXRail);this.scrollbarXBottom=parseInt(o.bottom,10),isNaN(this.scrollbarXBottom)?(this.isScrollbarXUsingBottom=!1,this.scrollbarXTop=Jt(o.top)):this.isScrollbarXUsingBottom=!0,this.railBorderXWidth=Jt(o.borderLeftWidth)+Jt(o.borderRightWidth),Ze(this.scrollbarXRail,{display:"block"}),this.railXMarginWidth=Jt(o.marginLeft)+Jt(o.marginRight),Ze(this.scrollbarXRail,{display:""}),this.railXWidth=null,this.railXRatio=null,this.scrollbarYRail=Du(pe.element.rail("y")),e.appendChild(this.scrollbarYRail),this.scrollbarY=Du(pe.element.thumb("y")),this.scrollbarYRail.appendChild(this.scrollbarY),this.scrollbarY.setAttribute("tabindex",0),this.event.bind(this.scrollbarY,"focus",s),this.event.bind(this.scrollbarY,"blur",r),this.scrollbarYActive=null,this.scrollbarYHeight=null,this.scrollbarYTop=null;var a=mi(this.scrollbarYRail);this.scrollbarYRight=parseInt(a.right,10),isNaN(this.scrollbarYRight)?(this.isScrollbarYUsingRight=!1,this.scrollbarYLeft=Jt(a.left)):this.isScrollbarYUsingRight=!0,this.scrollbarYOuterWidth=this.isRtl?p4(this.scrollbarY):null,this.railBorderYWidth=Jt(a.borderTopWidth)+Jt(a.borderBottomWidth),Ze(this.scrollbarYRail,{display:"block"}),this.railYMarginHeight=Jt(a.marginTop)+Jt(a.marginBottom),Ze(this.scrollbarYRail,{display:""}),this.railYHeight=null,this.railYRatio=null,this.reach={x:e.scrollLeft<=0?"start":e.scrollLeft>=this.contentWidth-this.containerWidth?"end":null,y:e.scrollTop<=0?"start":e.scrollTop>=this.contentHeight-this.containerHeight?"end":null},this.isAlive=!0,this.settings.handlers.forEach(function(l){return w4[l](n)}),this.lastScrollTop=Math.floor(e.scrollTop),this.lastScrollLeft=e.scrollLeft,this.event.bind(this.element,"scroll",function(l){return n.onScroll(l)}),ss(this)};Pc.prototype.update=function(){this.isAlive&&(this.negativeScrollAdjustment=this.isNegativeScroll?this.element.scrollWidth-this.element.clientWidth:0,Ze(this.scrollbarXRail,{display:"block"}),Ze(this.scrollbarYRail,{display:"block"}),this.railXMarginWidth=Jt(mi(this.scrollbarXRail).marginLeft)+Jt(mi(this.scrollbarXRail).marginRight),this.railYMarginHeight=Jt(mi(this.scrollbarYRail).marginTop)+Jt(mi(this.scrollbarYRail).marginBottom),Ze(this.scrollbarXRail,{display:"none"}),Ze(this.scrollbarYRail,{display:"none"}),ss(this),ah(this,"top",0,!1,!0),ah(this,"left",0,!1,!0),Ze(this.scrollbarXRail,{display:""}),Ze(this.scrollbarYRail,{display:""}))};Pc.prototype.onScroll=function(e){this.isAlive&&(ss(this),ah(this,"top",this.element.scrollTop-this.lastScrollTop),ah(this,"left",this.element.scrollLeft-this.lastScrollLeft),this.lastScrollTop=Math.floor(this.element.scrollTop),this.lastScrollLeft=this.element.scrollLeft)};Pc.prototype.destroy=function(){this.isAlive&&(this.event.unbindAll(),Mo(this.scrollbarX),Mo(this.scrollbarY),Mo(this.scrollbarXRail),Mo(this.scrollbarYRail),this.removePsClasses(),this.element=null,this.scrollbarX=null,this.scrollbarY=null,this.scrollbarXRail=null,this.scrollbarYRail=null,this.isAlive=!1)};Pc.prototype.removePsClasses=function(){this.element.className=this.element.className.split(" ").filter(function(e){return!e.match(/^ps([-_].+|)$/)}).join(" ")};const k4=({className:e,sidenav:t,tag:n="div",handlers:i=["click-rail","drag-thumb","keyboard","wheel","touch"],wheelSpeed:s=1,wheelPropagation:r=!0,swipeEasing:o=!0,minScrollbarLength:a,maxScrollbarLength:l,scrollingThreshold:c=1e3,useBothWheelAxes:u=!1,suppressScrollX:d=!1,suppressScrollY:h=!1,scrollXMarginOffset:f=0,scrollYMarginOffset:p=0,scrollBarRef:m,onScrollY:v,onScrollX:y,onScrollUp:g,onScrollDown:x,onScrollLeft:_,onScrollRight:w,onYReachStart:S,onYReachEnd:C,onXReachStart:M,onXReachEnd:P,children:T,options:A,...E})=>{const z=I(t&&"sidenav-menu",e),N=k.useRef(null),L=k.useRef(null);return k.useEffect(()=>{let R=null;const B=[],D={handlers:i,wheelSpeed:s,wheelPropagation:r,swipeEasing:o,minScrollbarLength:a,maxScrollbarLength:l,scrollingThreshold:c,useBothWheelAxes:u,suppressScrollX:d,suppressScrollY:h,scrollXMarginOffset:f,scrollYMarginOffset:p,...A};if(!N.current)return;R=N.current,L.current=new Pc(R,D);const $={"ps-scroll-y":v,"ps-scroll-x":y,"ps-scroll-up":g,"ps-scroll-down":x,"ps-scroll-left":_,"ps-scroll-right":w,"ps-y-reach-start":S,"ps-y-reach-end":C,"ps-x-reach-start":M,"ps-x-reach-end":P};return Object.keys($).forEach(F=>{const V=$[F];if(typeof V=="function"&&R){const W=()=>V(R);B.push({eventName:F,handler:W}),R.addEventListener(F,W)}}),m&&m(L.current),()=>{var F;B.forEach(V=>{R==null||R.removeEventListener(V.eventName,V.handler)}),(F=L.current)==null||F.destroy(),L.current=null}},[i,s,r,o,a,l,c,u,d,h,f,p,m,v,y,g,x,_,w,S,C,M,P,A]),b.jsx(n,{className:z,ref:N,...E,children:T})},S4=Y.createContext({color:"primary"}),M4=Y.forwardRef(({className:e,children:t,...n},i)=>{const s=I("sidenav-menu",e);return b.jsx("ul",{className:s,ref:i,...n,children:t})});M4.displayName="MDBSideNavMenu";const C4=Y.forwardRef(({className:e,children:t,...n},i)=>{const s=I("sidenav-item",e);return b.jsx("li",{className:s,ref:i,...n,children:t})});C4.displayName="MDBSideNavItem";const P4=Y.forwardRef(({className:e,icon:t,iconClasses:n,iconAngle:i=180,shouldBeExpanded:s,children:r,active:o,tag:a="a",...l},c)=>{const{color:u}=k.useContext(S4),d=I("sidenav-link",o&&"active",e),h=I("rotate-icon",n),[f,p]=k.useState(s?i:0);return k.useEffect(()=>{p(s?i:0)},[s,i]),b.jsxs(v0,{rippleTag:a,onKeyDown:m=>{m.key==="Enter"&&m.target.click()},tabIndex:1,rippleColor:u,className:d,ref:c,...l,children:[r,t&&b.jsx(sn,{icon:t,style:{transform:`rotate(${f}deg)`},className:h})]})});P4.displayName="MDBSideNavLink";const kT=Y.forwardRef(({className:e,centered:t,children:n,size:i,scrollable:s,tag:r="div",...o},a)=>{const l=I("modal-dialog",s&&"modal-dialog-scrollable",t&&"modal-dialog-centered",i&&`modal-${i}`,e);return b.jsx(r,{className:l,...o,ref:a,children:n})});kT.displayName="MDBModalDialog";const T4=Y.forwardRef(({className:e,side:t,frame:n,position:i,children:s,tag:r="div",...o},a)=>{const l=I(t&&"modal-side",n&&"modal-frame",i&&`modal-${i}`,e);return b.jsx(kT,{className:l,...o,tag:r,ref:a,children:s})});T4.displayName="MDBModalDialog";const nf=Y.createContext({onDatetimepickerModeSwitch:()=>null,isInDatetimepicker:!1,setInputValue:null,setActiveHour:null,setActiveMinute:null,setPeriod:null,setMode:null,setHandAnimation:null,setMinuteAngle:null,setHourAngle:null,submitLabel:"",clearLabel:"",cancelLabel:"",activeHour:12,activeMinute:12,format:"12h",period:"",defaultValue:"",minHour:0,maxHour:23,minPeriod:"",maxPeriod:"",mode:"hours",handAnimation:!1,maxMinute:59,minMinute:0,minuteAngle:360,hourAngle:360,inline:!1,increment:!1,onChange:()=>null,onOpen:()=>null,onClose:()=>null,onCloseHandler:()=>null,amLabel:"AM",pmLabel:"PM",switchHoursToMinutesOnClick:!0,headId:"",bodyId:""}),ld=e=>{const t=e.split(":"),n=t[0],i=t[1].split(" ")[1],s=t[1].split(" ")[0];return{hour:parseInt(n),minute:parseInt(s),defaultPeriod:i}},X_=(e,t)=>(t==="24h"?/^([01]\d|2[0-3])(:[0-5]\d)$/:/^(0?[1-9]|1[012])(:[0-5]\d) [APap][mM]$/).test(e),Ki=(e,t,n,i,s,r)=>{let o=!1;return t&&(s!==""?e>t&&i===s&&(o=!0):e>t&&(o=!0)),n&&(r!==""?eKi(i,s,r,o,a,l)&&(n===t||n===e),D4=(e,t,n)=>{t.split(" ").forEach(i=>{e.addEventListener(i,n)})},E4=(e,t,n)=>{t.split(" ").forEach(i=>{e.removeEventListener(i,n)})},ST=(e,t)=>{const n=t.x-e.x,i=t.y-e.y;return Math.sqrt(n*n+i*i)},A4=(e,t)=>{const n=2*Math.atan2(t.y-e.y-ST(e,t),t.x-e.x);return Math.abs(n*180/Math.PI)},K_=e=>({radius:(e-32)/2-4}),O4=e=>{const t=new Date;let n=t.getHours();const i=t.getMinutes();if(e==="24h")return{hours:n,minutes:i,period:""};const s=n>=12?"PM":"AM";return n=n%12,n=n||12,{hours:n,minutes:i,period:s}},xp=(e,t)=>{const n=e.getMinutes();let i=e.getHours(),s;i===24&&(i=0);const r=i>=12?"PM":"AM";return t=="24h"?s=i<10?`0${i}:${n}`:`${i}:${n}`:t=="12h"&&(s=`${(i+24)%12||12}:${n} ${r}`),s},ig=Y.forwardRef(({...e},t)=>{const{activeHour:n,format:i,period:s,setPeriod:r,mode:o,setMode:a,activeMinute:l,setHandAnimation:c,inline:u,setActiveHour:d,setActiveMinute:h,maxHour:f,maxMinute:p,minHour:m,minMinute:v,maxPeriod:y,minPeriod:g,setInputValue:x,increment:_,submitLabel:w,onChange:S,onCloseHandler:C,amLabel:M,pmLabel:P,headId:T,show:A,onDatetimepickerModeSwitch:E,isInDatetimepicker:z}=k.useContext(nf),N=D=>{a(D),c(!0)},L=()=>{if(Ki(n,f,m,s,y,g)||Ki(l,p,v,s,y,g)||!A)return;C==null||C();const D=n===24?"00":n<10?`0${n}`:n,$=l<10?`0${l}`:l,F=`${D}:${$} ${s}`.trim();x(F),S==null||S(F)},R=(D,$)=>{const F=i==="12h"?12:24;if($.type==="click")return d(D?V=>V===F?1:V+1:V=>V===1?F:V-1);if($.type==="mousedown"){const V=setTimeout(()=>{const et=setInterval(()=>{d(D?O=>O===F?1:O+1:O=>O===1?F:O-1)},100),Z=()=>{clearInterval(et),document.removeEventListener("mouseup",Z)};document.addEventListener("mouseup",Z)},300),W=()=>{clearTimeout(V),document.removeEventListener("mouseup",W)};document.addEventListener("mouseup",W)}},B=(D,$)=>{const F=_?55:59,V=_?5:1;if($.type==="click")return h(D?W=>W>=F?0:W+V:W=>W-V<0?F:W-V);if($.type==="mousedown"){const W=setTimeout(()=>{const Z=setInterval(()=>{h(D?U=>U>=F?0:U+V:U=>U-V<0?F:U-V)},100),O=()=>{clearInterval(Z),document.removeEventListener("mouseup",O)};document.addEventListener("mouseup",O)},300),et=()=>{clearTimeout(W),document.removeEventListener("mouseup",et)};document.addEventListener("mouseup",et)}};return u?b.jsx("div",{id:T,className:"timepicker-head d-flex flex-row align-items-center justify-content-center timepicker-head-inline",style:{paddingRight:"0px"},ref:t,...e,children:b.jsxs("div",{className:"timepicker-head-content d-flex w-100 justify-content-evenly align-items-center",children:[b.jsxs("div",{className:"timepicker-current-wrapper",children:[b.jsxs("span",{className:"position-relative h-100 timepicker-inline-hour-icons",children:[b.jsx(sn,{fas:!0,icon:"chevron-up",style:{display:"flex"},className:"position-absolute text-white timepicker-icon-up timepicker-icon-inline-hour",onClick:D=>R(!0,D),onMouseDown:D=>R(!0,D)}),b.jsx(Zt,{type:"button",color:"none",onClick:()=>{N("hours")},className:`timepicker-current timepicker-current-inline timepicker-hour ${o==="hours"&&"active"}`,tabIndex:0,style:{pointerEvents:o==="hours"?"none":void 0},onFocus:()=>{N("hours")},children:n===24?"00":n<10?`0${n}`:n}),b.jsx(sn,{fas:!0,icon:"chevron-down",style:{display:"flex"},className:"position-absolute text-white timepicker-icon-down timepicker-icon-inline-hour",onClick:D=>R(!1,D),onMouseDown:D=>R(!1,D)})]}),b.jsx(Zt,{color:"none",className:"timepicker-dot timepicker-current-inline",disabled:!0,children:":"}),b.jsxs("span",{className:"position-relative h-100 timepicker-inline-minutes-icons",children:[b.jsx(sn,{fas:!0,icon:"chevron-up",style:{display:"flex"},className:"position-absolute text-white timepicker-icon-up timepicker-icon-inline-minute",onClick:D=>B(!0,D),onMouseDown:D=>B(!0,D)}),b.jsx(Zt,{onClick:()=>{N("minutes")},type:"button",color:"none",className:`timepicker-current timepicker-current-inline timepicker-minute ${o==="minutes"&&"active"}`,tabIndex:0,style:{pointerEvents:o==="minutes"?"none":void 0},onFocus:()=>{N("minutes")},children:l<10?`0${l}`:l}),b.jsx(sn,{fas:!0,icon:"chevron-down",style:{display:"flex"},className:"position-absolute text-white timepicker-icon-down timepicker-icon-inline-minute",onClick:D=>B(!1,D),onMouseDown:D=>B(!1,D)})]})]}),b.jsxs("div",{className:"d-flex justify-content-center timepicker-mode-wrapper",children:[i==="12h"&&b.jsxs(b.Fragment,{children:[b.jsx(Zt,{onClick:()=>r("AM"),type:"button",color:"none",className:`timepicker-hour-mode timepicker-am me-2 ms-4 ${s.toLowerCase()==="am"&&"active"}`,tabIndex:0,children:M}),b.jsx(Zt,{onClick:()=>r("PM"),type:"button",color:"none",className:`timepicker-hour-mode timepicker-pm ${s.toLowerCase()==="pm"&&"active"}`,tabIndex:0,children:P})]}),b.jsx(Zt,{type:"button",color:"none",className:"timepicker-button timepicker-submit timepicker-submit-inline py-1 px-2 mb-0",tabIndex:0,onClick:L,children:w})]})]})}):b.jsxs(b.Fragment,{children:[b.jsx("div",{id:T,className:"timepicker-head d-flex flex-row align-items-center justify-content-center",style:{paddingRight:"0px"},ref:t,...e,children:b.jsxs("div",{className:"timepicker-head-content d-flex w-100 justify-content-evenly",style:{paddingRight:i==="24h"?"50px":""},children:[b.jsxs("div",{className:"timepicker-current-wrapper",children:[b.jsx("span",{className:"position-relative h-100",children:b.jsx(Zt,{type:"button",color:"none",onClick:()=>{N("hours")},className:`timepicker-current timepicker-hour ${o==="hours"&&"active"}`,tabIndex:0,style:{pointerEvents:o==="hours"?"none":void 0},children:n===24?"00":n<10?`0${n}`:n})}),b.jsx(Zt,{color:"none",className:"timepicker-dot",disabled:!0,children:":"}),b.jsx("span",{className:"position-relative h-100",children:b.jsx(Zt,{onClick:()=>{N("minutes")},type:"button",color:"none",className:`timepicker-current timepicker-minute ${o==="minutes"&&"active"}`,tabIndex:0,style:{pointerEvents:o==="minutes"?"none":void 0},children:l<10?`0${l}`:l})})]}),i==="12h"&&b.jsxs("div",{className:"d-flex flex-column justify-content-center timepicker-mode-wrapper",children:[b.jsx(Zt,{onClick:()=>r("AM"),type:"button",color:"none",className:`timepicker-hour-mode timepicker-am ${s.toLowerCase()==="am"&&"active"}`,tabIndex:0,children:M}),b.jsx(Zt,{onClick:()=>r("PM"),type:"button",color:"none",className:`timepicker-hour-mode timepicker-pm ${s.toLowerCase()==="pm"&&"active"}`,tabIndex:0,children:P})]})]})}),z&&b.jsxs("div",{className:"buttons-container",children:[b.jsx("button",{type:"button",className:"datepicker-button-toggle",onClick:E,children:b.jsx("i",{className:"far fa-calendar datepicker-toggle-icon"})}),b.jsx("button",{type:"button",className:"timepicker-button-toggle",children:b.jsx("i",{className:"far fa-clock fa-sm timepicker-icon"})})]})]})});ig.displayName="MDBTimePickerHeader";const bp={hours:[{value:1,left:"169px",bottom:"209.263px",angle:30,id:`hour-1-${Math.floor(Math.random()*1001)}`},{value:2,left:"209.263px",bottom:"169px",angle:60,id:`hour-2-${Math.floor(Math.random()*1001)}`},{value:3,left:"224px",bottom:"114px",angle:90,id:`hour-3-${Math.floor(Math.random()*1001)}`},{value:4,left:"209.263px",bottom:"59px",angle:120,id:`hour-4-${Math.floor(Math.random()*1001)}`},{value:5,left:"169px",bottom:"18.7372px",angle:150,id:`hour-5-${Math.floor(Math.random()*1001)}`},{value:6,left:"114px",bottom:"4px",angle:180,id:`hour-6-${Math.floor(Math.random()*1001)}`},{value:7,left:"59px",bottom:"18.7372px",angle:210,id:`hour-7-${Math.floor(Math.random()*1001)}`},{value:8,left:"18.7372px",bottom:"59px",angle:240,id:`hour-8-${Math.floor(Math.random()*1001)}`},{value:9,left:"4px",bottom:"114px",angle:270,id:`hour-9-${Math.floor(Math.random()*1001)}`},{value:10,left:"18.7372px",bottom:"169px",angle:300,id:`hour-10-${Math.floor(Math.random()*1001)}`},{value:11,left:"59px",bottom:"209.263px",angle:330,id:`hour-11-${Math.floor(Math.random()*1001)}`},{value:12,left:"114px",bottom:"224px",angle:360,id:`hour-12-${Math.floor(Math.random()*1001)}`},{value:13,left:"94px",bottom:"115.962px",angle:30,id:`hour-13-${Math.floor(Math.random()*1001)}`},{value:14,left:"115.962px",bottom:"94px",angle:60,id:`hour-14-${Math.floor(Math.random()*1001)}`},{value:15,left:"124px",bottom:"64px",angle:90,id:`hour-15-${Math.floor(Math.random()*1001)}`},{value:16,left:"115.962px",bottom:"34px",angle:120,id:`hour-16-${Math.floor(Math.random()*1001)}`},{value:17,left:"94px",bottom:"12.0385px",angle:150,id:`hour-17-${Math.floor(Math.random()*1001)}`},{value:18,left:"64px",bottom:"4px",angle:180,id:`hour-18-${Math.floor(Math.random()*1001)}`},{value:19,left:"34px",bottom:"12.0385px",angle:210,id:`hour-19-${Math.floor(Math.random()*1001)}`},{value:20,left:"12.0385px",bottom:"34px",angle:240,id:`hour-20-${Math.floor(Math.random()*1001)}`},{value:21,left:"4px",bottom:"64px",angle:270,id:`hour-21-${Math.floor(Math.random()*1001)}`},{value:22,left:"12.0385px",bottom:"94px",angle:300,id:`hour-22-${Math.floor(Math.random()*1001)}`},{value:23,left:"34px",bottom:"115.962px",angle:330,id:`hour-23-${Math.floor(Math.random()*1001)}`},{value:24,left:"64px",bottom:"124px",angle:360,id:`hour-0-${Math.floor(Math.random()*1001)}`}],minutes:[{value:0,left:"114px",bottom:"224px",angle:360,id:`minute-0-${Math.floor(Math.random()*1001)}`},{value:5,left:"169px",bottom:"209.263px",angle:30,id:`minute-5-${Math.floor(Math.random()*1001)}`},{value:10,left:"209.263px",bottom:"169px",angle:60,id:`minute-10-${Math.floor(Math.random()*1001)}`},{value:15,left:"224px",bottom:"114px",angle:90,id:`minute-15-${Math.floor(Math.random()*1001)}`},{value:20,left:"209.263px",bottom:"59px",angle:120,id:`minute-20-${Math.floor(Math.random()*1001)}`},{value:25,left:"169px",bottom:"18.7372px",angle:150,id:`minute-25-${Math.floor(Math.random()*1001)}`},{value:30,left:"114px",bottom:"4px",angle:180,id:`minute-30-${Math.floor(Math.random()*1001)}`},{value:35,left:"59px",bottom:"18.7372px",angle:210,id:`minute-35-${Math.floor(Math.random()*1001)}`},{value:40,left:"18.7372px",bottom:"59px",angle:240,id:`minute-40-${Math.floor(Math.random()*1001)}`},{value:45,left:"4px",bottom:"114px",angle:270,id:`minute-45-${Math.floor(Math.random()*1001)}`},{value:50,left:"18.7372px",bottom:"169px",angle:300,id:`minute-50-${Math.floor(Math.random()*1001)}`},{value:55,left:"59px",bottom:"209.263px",angle:330,id:`minute-55-${Math.floor(Math.random()*1001)}`}]},MT=Y.forwardRef(({...e},t)=>{const n=k.useRef(null),i=k.useRef(null),[s,r]=k.useState(!1),[o,a]=k.useState(0),[l,c]=k.useState(0),{setActiveHour:u,format:d,activeHour:h,minHour:f,maxHour:p,minPeriod:m,maxPeriod:v,period:y,mode:g,setMode:x,activeMinute:_,setActiveMinute:w,setHandAnimation:S,handAnimation:C,maxMinute:M,minMinute:P,hourAngle:T,setHourAngle:A,minuteAngle:E,setMinuteAngle:z,increment:N,switchHoursToMinutesOnClick:L,bodyId:R}=k.useContext(nf),B=d==="24h"?bp.hours:bp.hours.filter(O=>O.value<13&&O.value!==0),D=bp.minutes,[$,F]=k.useState("calc(40% + 1px)"),V=k.useCallback(A4,[]),W=O=>{O.preventDefault(),r(!0)},et=O=>{O.preventDefault(),r(!1),g==="hours"&&(L&&x("minutes"),S(!0))},Z=k.useCallback(O=>{var U;const{width:lt,top:ct,left:kt}=(U=n.current)==null?void 0:U.getBoundingClientRect(),{clientX:it,clientY:Lt}="touches"in O?O.touches[0]:O,Ct={x:lt/2,y:-lt/2},Qt={x:it-kt,y:ct-Lt},ft=Math.round(V(Ct,Qt)+360)%360;if(g==="hours"){const wt=30*Math.round(ft/30);let dt=wt/30;if(d==="24h"){const{radius:jt}=K_(o),{radius:pt}=K_(l);ST(Ct,Qt)<(jt+pt)/2-16&&(dt+=12)}Ki(dt,p,f,y,v,m)||(u(dt),A(wt))}else if(ft===0)vp(f,p,h,0,M,P,y,v,m)||(w(0),z(360));else{const wt=N?30:6,dt=wt*Math.round(ft/wt);vp(f,p,h,dt/6,M,P,y,v,m)||(w(dt/6===60?0:dt/6),z(dt))}},[V,h,M,P,v,m,g,y,w,p,f,u,l,o,d,A,z,N]);return k.useEffect(()=>{n.current&&a(n.current.offsetWidth),i.current&&c(i.current.offsetWidth)},[]),k.useEffect(()=>(s&&D4(document,"mouseup mousemove mouseleave mouseover touchstart touchmove touchend",Z),()=>{E4(document,"mouseup mousemove mouseleave mouseover touchstart touchmove touchend",Z)}),[s,Z]),k.useEffect(()=>{const O=B.find(U=>U.value===h);O!==void 0&&(O.value>12||O.value===24?F("21.5%"):F("calc(40% + 1px)"))},[B,h]),b.jsx("div",{id:R,className:"timepicker-clock-wrapper d-flex justify-content-center flex-column align-items-center",ref:t,...e,children:b.jsxs("div",{onMouseDown:O=>W(O),onMouseUp:O=>et(O),ref:n,className:"timepicker-clock timepicker-clock-animation",children:[b.jsx("span",{className:"timepicker-middle-dot position-absolute"}),b.jsx("div",{className:`timepicker-hand-pointer position-absolute ${C&&"timepicker-transform"}`,style:{transform:`rotateZ(${g==="hours"?T:E}deg)`,height:g==="hours"?$:"calc(40% + 1px)"},children:b.jsx("div",{className:"timepicker-circle position-absolute",style:{backgroundColor:"rgb(25, 118, 210)"}})}),g==="hours"&&d==="24h"&&b.jsx("div",{ref:i,className:"timepicker-clock-inner",children:B.map(O=>{if(O.value>12||O.value===0)return b.jsx("span",{id:O.id,className:`timepicker-time-tips-inner ${Ki(O.value,p,f,y,v,m)&&"disabled"} ${O.value===h&&"active"}`,style:{left:O.left,bottom:O.bottom},children:b.jsx("span",{className:"timepicker-tips-inner-element",children:O.value===24?"00":O.value})},O.id)})}),g==="hours"&&B.map(O=>{if(d==="24h"){if(O.value<13&&O.value!==0)return b.jsx("span",{id:O.id,className:`timepicker-time-tips-hours ${Ki(O.value,p,f,y,v,m)&&"disabled"} ${O.value===h&&"active"}`,style:{left:O.left,bottom:O.bottom},children:b.jsx("span",{className:"timepicker-tips-element",children:O.value})},O.id)}else return b.jsx("span",{id:O.id,className:`timepicker-time-tips-hours ${Ki(O.value,p,f,y,v,m)&&"disabled"} ${O.value===h&&"active"}`,style:{left:O.left,bottom:O.bottom},children:b.jsx("span",{className:"timepicker-tips-element",children:O.value})},O.id)}),g==="minutes"&&D.map(O=>b.jsx("span",{id:O.id,className:`timepicker-time-tips-minutes ${vp(f,p,h,O.value,M,P,y,v,m)&&"disabled"} ${_===O.value&&"active"}`,style:{left:O.left,bottom:O.bottom},children:b.jsx("span",{className:"timepicker-tips-element",children:O.value<10?`0${O.value}`:O.value})},O.id))]})})});MT.displayName="MDBTimePickerClock";const CT=Y.forwardRef(({...e},t)=>{const{setInputValue:n,cancelLabel:i,submitLabel:s,clearLabel:r,activeHour:o,period:a,activeMinute:l,maxHour:c,maxMinute:u,minHour:d,minMinute:h,maxPeriod:f,minPeriod:p,defaultValue:m,setActiveHour:v,setActiveMinute:y,setPeriod:g,format:x,setHourAngle:_,setMinuteAngle:w,onChange:S,onCloseHandler:C,setMode:M}=k.useContext(nf);return b.jsx("div",{className:"timepicker-footer",ref:t,...e,children:b.jsxs("div",{className:"w-100 d-flex justify-content-between",children:[b.jsx(Zt,{onClick:()=>{if(m!==""&&m!==void 0){const{hour:P,minute:T,defaultPeriod:A}=ld(m);x==="24h"?(v(P===0?24:P),P===0?_(360):P>12?_((P-12)*30):_(P*30)):(v(P),_(P*30),g(A)),y(T),w(T*6),n(m),S==null||S(m)}else v(12),_(360),y(0),w(360),n(""),S==null||S(""),g(x==="24h"?"":"AM");M("hours")},type:"button",color:"none",className:"timepicker-button timepicker-clear",tabIndex:0,children:r}),b.jsx(Zt,{onClick:()=>C==null?void 0:C(),type:"button",color:"none",className:"timepicker-button timepicker-cancel",tabIndex:0,children:i}),b.jsx(Zt,{onClick:()=>{if(Ki(o,c,d,a,f,p)||Ki(l,u,h,a,f,p))return;C==null||C();const P=o===24?"00":o<10?`0${o}`:o,T=l<10?`0${l}`:l,A=`${P}:${T} ${a}`.trim();n(A),S==null||S(A)},type:"button",color:"none",className:"timepicker-button timepicker-submit",tabIndex:0,children:s})]})})});CT.displayName="MDBTimePickerFooter";const L4=({isOpen:e,inline:t})=>{k.useEffect(()=>{if(t)return;const n=window.innerWidth>document.documentElement.clientWidth&&window.innerWidth>=576,i=`${window.innerWidth-document.documentElement.clientWidth}px`;return e&&n?(document.body.style.overflow="hidden",document.body.style.paddingRight=i):(document.body.style.overflow="",document.body.style.paddingRight=""),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[e,t])},R4=({className:e,isOpen:t,wrapperRef:n,inline:i,referenceElement:s,onOpened:r,onClosed:o})=>{const[a,l]=k.useState(null),c=I("timepicker-modal",!i&&"position-fixed",e),u=I("timepicker-wrapper","animation","h-100","d-flex","align-items-center","justify-content-center","flex-column",i?"timepicker-wrapper-inline":"position-fixed","fade",t&&"show"),{styles:d,attributes:h}=Oh(s,a,{placement:"bottom-start"}),f=p=>{p.opacity===0?o():r()};return L4({isOpen:t,inline:i}),b.jsx(b.Fragment,{children:b.jsx(aa,{children:b.jsx(Zy,{children:t&&(i?b.jsx(Jo.div,{className:c,style:d.popper,...h.popper,role:"dialog",ref:l,tabIndex:-1,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onAnimationComplete:p=>f(p),children:b.jsx("div",{ref:n,className:u,children:b.jsx("div",{className:"d-flex align-items-center justify-content-center flex-column shadow timepicker-container",style:{overflowY:"inherit"},children:b.jsx("div",{className:"d-flex flex-column timepicker-elements justify-content-around timepicker-elements-inline",children:b.jsx(ig,{})})})})}):b.jsx(Jo.div,{className:c,role:"dialog",tabIndex:-1,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},onAnimationComplete:p=>f(p),children:b.jsx("div",{ref:n,className:u,children:b.jsxs("div",{className:"d-flex align-items-center justify-content-center flex-column shadow timepicker-container",children:[b.jsxs("div",{className:"d-flex flex-column timepicker-elements justify-content-around",children:[b.jsx(ig,{}),b.jsx(MT,{})]}),b.jsx(CT,{})]})})}))})})})},G_=(e,t,n,i,s)=>{const r=n?55:59,o=n?5:1;let a;s?a=i>=r?0:i+o:a=i<=0?r:i-o,e(a),t(a*6)},Au=(e,t,n,i,s,r)=>{if(r&&e==="24h"){let l=t;r==="isLeft"&&(l=t<=12?t+12:t),r==="isRight"&&(l=t>12?t-12:t),n(l),i(l*30);return}const o=e==="12h"?12:24;let a=t===1?o:t-1;s?a=t===o?1:t+1:a=t===1?o:t-1,n(a),i(a*30)},q_=(e,t,n)=>{const i=n==null?void 0:n.querySelectorAll('[tabindex="0"]');i&&i[t]&&(i[t].focus(),t===i.length-1?e(0):e(t+1))},N4=(e,t,n,i,s,r)=>{var o;!t&&e.target===n&&r&&(r==null||r()),t&&e.target!==n&&!(n!=null&&n.contains(e.target))&&e.target!==(i==null?void 0:i.parentNode)&&!((o=i==null?void 0:i.parentNode)!=null&&o.contains(e.target))&&s&&(r==null||r())},Q_="ArrowLeft",Z_="ArrowUp",J_="ArrowRight",tw="ArrowDown",ew="Enter",nw="Escape",iw="Tab",PT=k.forwardRef(({isInDatetimepicker:e,onDatetimepickerModeSwitch:t,datetimepickerRef:n,className:i,defaultValue:s,value:r,minHour:o,maxHour:a,maxTime:l,minTime:c,noIcon:u=!1,inputID:d,justInput:h=!1,inputClasses:f,inputLabel:p,invalidLabel:m,clearLabel:v,submitLabel:y,cancelLabel:g,format:x="12h",timePickerClasses:_,customIcon:w="far fa-clock",customIconSize:S="sm",btnIcon:C=!0,inline:M=!1,increment:P=!1,onChange:T,inputStyle:A,onOpen:E,onOpened:z,onClose:N,onClosed:L,disableFuture:R,disablePast:B,disabled:D=!1,amLabel:$="AM",pmLabel:F="PM",switchHoursToMinutesOnClick:V=!0,headId:W="",bodyId:et="",open:Z,style:O,...U},lt)=>{const ct=k.useMemo(()=>s instanceof Date?xp(s,x):s,[]),kt=k.useMemo(()=>r instanceof Date?xp(r,x):r,[r,x]),[it,Lt]=k.useState(!1),[Ct,Qt]=k.useState(!1),ft=ef(Ct,Z),[wt,dt]=k.useState(kt||ct||""),[jt,pt]=k.useState(!1),[xt,J]=k.useState(12),[mt,q]=k.useState(0),[ye,Dt]=k.useState(x==="24h"?"":"AM"),[he,Un]=k.useState(a||24),[Yn,Mn]=k.useState(o||1),[Si,dn]=k.useState(59),[Mi,as]=k.useState(0),[ls,Ci]=k.useState(""),[Pi,Ke]=k.useState(""),[Xn,Ti]=k.useState("hours"),[j,Q]=k.useState(!1),[It,nt]=k.useState(360),[Tt,Oe]=k.useState(360),[cs,ai]=k.useState(null),[Kn,Me]=k.useState(0);s instanceof Date&&(s=xp(s,x));const Kr=k.useId(),Gr=d??Kr,Cn={input:p??"Select a time",invalid:m??"Invalid Time Format",clear:v??"Clear",submit:y??"Ok",cancel:g??"Cancel"},ca=I("timepicker",i),Dc=I("timepicker-input",jt&&"is-invalid",f),sf=k.useRef(null),G=k.useRef(null),X=k.useRef(null),rt=k.useRef(null);k.useImperativeHandle(lt,()=>rt.current,[rt]);const ht=Rt=>{dt(Rt.target.value),T==null||T(Rt.target.value)},hn=Rt=>{h&&(Rt.target.blur(),E==null||E())},us=k.useCallback(()=>{Qt(!1),N==null||N()},[N]),Ge=k.useCallback(()=>{Qt(!0),E==null||E()},[E]),fn=k.useCallback(()=>{Lt(!1),L==null||L(),Ti("hours"),Me(0)},[L]),NT=k.useCallback(()=>{Lt(!0),z==null||z()},[z]),rf=k.useCallback(Rt=>{it&&N4(Rt,M,X.current,rt.current,ft,us)},[X,M,rt,ft,us,it]),of=k.useCallback(Rt=>{var Pn,pn;const{key:A0}=Rt,ua=document.activeElement,jT=ua===((Pn=X.current)==null?void 0:Pn.querySelector(".timepicker-hour")),$T=ua===((pn=X.current)==null?void 0:pn.querySelector(".timepicker-minute")),IT=ua==null?void 0:ua.closest('.timepicker-modal [tabindex="0"]');if(![tw,Z_,nw,iw,ew,Q_,J_].includes(A0))return;M&&!IT&&q_(Me,0,X.current),Rt.preventDefault();const Ec=!M&&Xn==="hours"||M&&jT,O0=!M&&Xn==="minutes"||M&&$T;switch(A0){case nw:return N==null?void 0:N();case Z_:if(Ec)return Au(x,xt,J,nt,!0);if(O0)return G_(q,Oe,P,mt,!0);break;case tw:if(Ec)return Au(x,xt,J,nt,!1);if(O0)return G_(q,Oe,P,mt,!1);break;case Q_:if(Ec&&!M)return Au(x,xt,J,nt,!1,"isLeft");break;case J_:if(Ec&&!M)return Au(x,xt,J,nt,!0,"isRight");break;case iw:q_(Me,Kn,X.current);break;case ew:ua.click();break}},[xt,x,Xn,mt,P,M,Kn,N]);return k.useEffect(()=>{if(!B&&!R)return;const{hours:Rt,minutes:Pn,period:pn}=O4(x);if(B)return Mn(Rt),as(Pn),Ci(pn);if(R)return Un(Rt),dn(Pn),Ke(pn)},[R,B,x]),k.useEffect(()=>(ft&&it&&(document.addEventListener("click",rf),document.addEventListener("keydown",of)),()=>{document.removeEventListener("click",rf),document.removeEventListener("keydown",of)}),[ft,it,rf,of]),k.useEffect(()=>{if(l){const{hour:Rt,minute:Pn,defaultPeriod:pn}=ld(l);Un(Rt),dn(Pn),pn!==void 0&&Ke(pn)}if(c){const{hour:Rt,minute:Pn,defaultPeriod:pn}=ld(c);Mn(Rt),as(Pn),pn!==void 0&&Ci(pn)}},[l,c]),k.useEffect(()=>{typeof r=="string"&&r&&X_(r,x)&&dt(r)},[r,x]),k.useEffect(()=>{if(X_(wt,x)||wt===""){if(pt(!1),wt!==""){const{hour:Rt,minute:Pn,defaultPeriod:pn}=ld(wt);x==="24h"?(J(Rt===0?24:Rt),Rt===0?nt(360):Rt>12?nt((Rt-12)*30):nt(Rt*30)):(J(Rt),nt(Rt*30),Dt(pn)),q(Pn),Oe(Pn*6)}}else pt(!0)},[wt,x]),k.useEffect(()=>{let Rt;return j&&(Rt=setTimeout(()=>{Q(!1)},400)),()=>{clearTimeout(Rt)}},[j]),b.jsx(b.Fragment,{children:b.jsx(nf.Provider,{value:{isInDatetimepicker:e,onDatetimepickerModeSwitch:t,show:ft,setInputValue:dt,submitLabel:Cn.submit,clearLabel:Cn.clear,cancelLabel:Cn.cancel,activeHour:xt,activeMinute:mt,setActiveHour:J,setActiveMinute:q,format:x,period:ye,setPeriod:Dt,defaultValue:s,maxHour:he,minHour:Yn,maxPeriod:Pi,minPeriod:ls,mode:Xn,setMode:Ti,setHandAnimation:Q,handAnimation:j,minMinute:Mi,maxMinute:Si,hourAngle:It,setHourAngle:nt,minuteAngle:Tt,setMinuteAngle:Oe,inline:M,increment:P,onChange:T,onOpen:E,onClose:N,onCloseHandler:us,amLabel:$,pmLabel:F,switchHoursToMinutesOnClick:V,headId:W,bodyId:et},children:b.jsxs(b.Fragment,{children:[b.jsx("div",{className:ca,ref:M?ai:sf,style:{...O,height:"fit-content"},...U,children:!e&&b.jsx(wi,{onFocus:hn,ref:rt,labelRef:G,className:Dc,label:Cn.input,id:Gr,value:wt,onChange:ht,wrapperClass:"timepicker",style:A,disabled:D,onClick:()=>{h&&Ge()},children:!h&&!u&&(C?b.jsx(Zt,{className:"timepicker-toggle-button",onClick:Ge,color:"none",tabIndex:0,type:"button",disabled:D,style:{pointerEvents:D?"none":"auto"},children:b.jsx("i",{className:`${w} ${S} timepicker-icon`})}):b.jsx("i",{onClick:Ge,className:`${w} ${S} timepicker-icon timepicker-toggle-button`}))})}),b.jsx(R4,{isOpen:ft,wrapperRef:X,referenceElement:n||cs,inline:M,className:_,onClosed:fn,onOpened:NT})]})})})});PT.displayName="MDBTimepicker";const j4=({className:e,dropdown:t,children:n,styles:i,attributes:s,setPopperElement:r,style:o,onClosed:a,onOpened:l})=>{const c={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3}},u=I("datepicker-dropdown-container",e),d=I("datepicker-modal-container",e),h=f=>{f.opacity===0?a==null||a():l==null||l()};return b.jsx(b.Fragment,{children:t?b.jsx(Jo.div,{style:{position:"absolute",zIndex:1065,...i.popper},...s.popper,ref:r,className:u,tabIndex:-1,...c,onAnimationComplete:f=>h(f),children:n}):b.jsx(Jo.div,{...c,className:d,style:o,onAnimationComplete:f=>h(f),children:n})})},Ce={closeOnEsc:!0,title:"Select date",okBtnText:"Ok",clearBtnText:"Clear",cancelBtnText:"Cancel",customIcon:"far fa-calendar",customHeader:"",inputLabel:"Select a date",monthsFull:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],views:"days",format:"dd/mm/yyyy",weekdaysFull:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysNarrow:["S","M","T","W","T","F","S"],startDay:0};function Te(e){return e.getDate()}function sw(e){return e.getDay()}function Pt(e){return e.getMonth()}function ot(e){return e.getFullYear()}function $4(e,t,n){const i=n,s=i>0?7-i:0,r=new Date(e,t).getDay()+s;return r>=7?r-7:r}function I4(e){return e.getDate()===rc(e)}function sg(e){return I4(e)?rc(new Date(ot(e),Pt(e)+1,1)):Te(e)}function rc(e){return F4(e).getDate()}function F4(e){return Or(e.getFullYear(),e.getMonth()+1,0)}function Ro(){return new Date}function Ln(e,t){return Je(e,t*12)}function Je(e,t){const n=Or(e.getFullYear(),e.getMonth()+t,e.getDate()),i=Te(e),s=Te(n);return i!==s&&n.setDate(0),n}function eo(e,t){return Or(e.getFullYear(),e.getMonth(),e.getDate()+t)}function Or(e,t,n){const i=new Date(e,t,n);return e>=0&&e<100&&i.setFullYear(i.getFullYear()-1900),i}function rg(e){return!Number.isNaN(e.getTime())}function rw(e,t){return ot(e)-ot(t)||Pt(e)-Pt(t)||Te(e)-Te(t)}function vs(e,t){return e.setHours(0,0,0,0),t.setHours(0,0,0,0),e.getTime()===t.getTime()}function ow(e){return parseInt(e,10)<10?`0${e}`:e}function og(e,t){const n=ot(e)-TT(0,null,null);return B4(n,t)}function B4(e,t){return(e%t+t)%t}function TT(e,t,n){let i=0;return n?i=ot(n)-e+1:t&&(i=ot(t)),i}function No(e,t,n,i){const s=t&&rw(e,t)<=0,r=n&&rw(e,n)>=0,o=i&&i(e)===!1;return!!(s||r||o)}function ag(e,t,n,i,s,r){const o=i&&ot(i),a=i&&Pt(i),l=n&&ot(n),c=n&&Pt(n),u=new Date().getFullYear(),d=new Date().getMonth();if(r&&u===t&&ed||r&&u>t||s&&uo||t===o&&e>a:!1,f=c&&l?tr)return!0;const o=t&&ot(t),a=n&&ot(n),l=a?e>a:!1,c=o?en===e)}function aw(e,t,n,i,s){return s?DT(e,s,t,n,i,s):!1}function lw(e,t,n,i,s){return i?DT(e,i,t,n,i,s):!1}function DT(e,t,n,i,s,r){if(n==="days")return ot(e)===ot(t)&&Pt(e)===Pt(t);if(n==="months")return ot(e)===ot(t);if(n==="years"){const o=TT(i,s,r);return Math.floor((ot(e)-o)/i)===Math.floor((ot(t)-o)/i)}return!1}function lh(e,t,n,i){let s;if(t){const r=V4(t);if(r){r[0]!==r[1]?s=r[0]+r[1]:s=r[0];const o=new RegExp(`[${s}]`),a=e.split(o),l=t==null?void 0:t.split(o),c=(t==null?void 0:t.indexOf("mmm"))!==-1,u=[];l==null||l.forEach((m,v)=>{m.indexOf("yy")!==-1&&(u[0]={value:a[v],format:m}),m.indexOf("m")!==-1&&(u[1]={value:a[v],format:m}),m.indexOf("d")!==-1&&m.length<=2&&(u[2]={value:a[v],format:m})});let d;(t==null?void 0:t.indexOf("mmmm"))!==-1?d=n:d=i;const h=Number(u[0].value),f=c?z4(u[1].value,d):Number(u[1].value)-1,p=Number(u[2].value);return Or(h,f,p)}}}function cw(e,t,n,i,s,r){const o=Te(e),a=ow(Te(e).toString()),l=n[sw(e)],c=i[sw(e)],u=Pt(e),d=ow((Pt(e)+1).toString()),h=s[Pt(e)],f=r[Pt(e)],p=ot(e).toString().length===2?ot(e):ot(e).toString().slice(2,4),m=ot(e),v=t.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g);let y="";return v.forEach(g=>{switch(g){case"dddd":g=g.replace(g,c);break;case"ddd":g=g.replace(g,l);break;case"dd":g=g.replace(g,a);break;case"d":g=g.replace(g,o.toString());break;case"mmmm":g=g.replace(g,f);break;case"mmm":g=g.replace(g,h);break;case"mm":g=g.replace(g,d);break;case"m":g=g.replace(g,u.toString());break;case"yyyy":g=g.replace(g,m.toString());break;case"yy":g=g.replace(g,p.toString());break}y+=g}),y}const ET=(e,t)=>{if(!t)return!1;const n=new Date;return n.setHours(0,0,0,0)===e.setHours(0,0,0,0)?!1:et?e>new Date:!1,ir=Y.createContext({view:"days",setView:null,activeDate:new Date,setActiveDate:null,selectedDate:new Date,setSelectedDate:null,weekdaysShort:[],monthsShort:[],monthsFull:[],min:void 0,max:void 0,weekdaysFull:[],yearScope:[],tabCount:0,inline:!1,disableFuture:!1,disablePast:!1}),W4=({clearBtnText:e="Clear",cancelBtnText:t="Cancel",okBtnText:n="Ok",setValue:i,selectDate:s,onClose:r})=>{const{setActiveDate:o,setSelectedDate:a,selectedDate:l,isInDatetimepicker:c,onDatetimepickerModeSwitch:u}=k.useContext(ir),d=h=>{h.currentTarget.blur(),o(new Date),a(void 0),i("")};return b.jsxs("div",{className:"datepicker-footer",children:[b.jsx("button",{tabIndex:0,onClick:h=>d(h),className:"datepicker-footer-btn datepicker-clear-btn",children:e}),b.jsx("button",{tabIndex:0,onClick:()=>r==null?void 0:r(),className:"datepicker-footer-btn datepicker-cancel-btn",children:t}),b.jsx("button",{tabIndex:0,onClick:()=>{s(l),c&&(u==null||u()),r==null||r()},className:"datepicker-footer-btn datepicker-ok-btn",children:n})]})},H4=(e,t,n)=>{const i=document.createElement("button"),s=document.createElement("div");i.id=`datepicker-toggle-${Math.floor(Math.random()*10001)}`,i.tabIndex=0,i.type="button",i.style.pointerEvents="auto";const r=document.createElement("i");r.className=`${e} fa-${t} datepicker-icon`,n&&i.appendChild(r);const o=n?i:r;return o.classList.add("datepicker-toggle-button"),{div:s,selector:o}},U4=(e,t,n,i,s,r)=>{const o=[],a=Pt(e),l=Pt(Je(e,-1)),c=Pt(Je(e,1)),u=ot(e),d=$4(u,a,r),h=rc(e),f=rc(Je(e,-1)),p=7;let m=1,v=!1;for(let y=1;yh&&(m=1,v=!1);const _=Or(u,v?a:c,m);g.push({date:_,currentMonth:v,isSelected:t&&vs(_,t),isToday:vs(_,Ro()),dayNumber:Te(_),disabled:No(_,n,i,s)}),m++}o.push(g)}return o},Y4=e=>{const t=[],n=e[0];let i=[];for(let s=0;s<24;s++)if(i.push(n+s),i.length===4){const r=i;t.push(r),i=[]}return t},X4=e=>{const t=[];let n=[];return e.forEach(i=>{if(n.push(i),n.length===4){const s=n;t.push(s),n=[]}}),t},K4=({filter:e,startWeekdays:t,startDay:n,inlineDayClick:i,selectOnClick:s,selectDate:r,onClose:o})=>{const{min:a,max:l,setActiveDate:c,setSelectedDate:u,activeDate:d,selectedDate:h,tabCount:f,disableFuture:p,disablePast:m}=k.useContext(ir),v=y=>{!No(y,a,l,e)&&(c(y),u(y),i(y),s&&(r(y),o==null||o()))};return b.jsxs("table",{className:"datepicker-table",children:[b.jsx("thead",{children:b.jsx("tr",{children:t.map((y,g)=>b.jsx("th",{className:"datepicker-day-heading",scope:"col",children:y},g))})}),b.jsx("tbody",{className:"datepicker-table-body",children:U4(d,h,a,l,e,n).map((y,g)=>b.jsx("tr",{children:y.map((x,_)=>b.jsx("td",{onClick:()=>v(x.date),tabIndex:vs(x.date,d)?0:void 0,className:I("datepicker-cell","datepicker-small-cell","datepicker-day-cell",x.isToday&&"current",x.isSelected&&"selected",x.disabled&&"disabled",f===3&&vs(x.date,d)&&"focused",Pt(d)!==Pt(x.date)&&"disabled",AT(x.date,p)&&"disabled",ET(x.date,m)&&"disabled"),children:b.jsx("div",{className:"datepicker-cell-content datepicker-small-cell-content",style:{display:x.currentMonth?"block":"none"},children:x.dayNumber})},_))},g))})]})},G4=()=>{const{yearScope:e,setView:t,setActiveDate:n,activeDate:i,selectedDate:s,tabCount:r,min:o,max:a,disableFuture:l,disablePast:c}=k.useContext(ir);return b.jsx("table",{className:"datepicker-table",children:b.jsx("tbody",{className:"datepicker-table-body",children:Y4(e).map((u,d)=>b.jsx("tr",{children:u.map(h=>b.jsx("td",{onClick:()=>{n(new Date(h,Pt(i),Te(i))),t("months")},tabIndex:h===ot(i)?0:void 0,className:I("datepicker-cell","datepicker-large-cell","datepicker-year-cell",s&&h===ot(s)&&"selected",r===3&&h===ot(i)&&"focused",lg(h,o,a,l,c)&&"disabled",ot(Ro())===h&&"current"),children:b.jsx("div",{className:"datepicker-cell-content datepicker-large-cell-content",children:h})},h))},d))})})},q4=()=>{const{monthsShort:e,setActiveDate:t,setView:n,activeDate:i,selectedDate:s,tabCount:r,min:o,max:a,disableFuture:l,disablePast:c}=k.useContext(ir);return b.jsx("table",{className:"datepicker-table",children:b.jsx("tbody",{className:"datepicker-table-body",children:X4(e).map((u,d)=>b.jsx("tr",{children:u.map(h=>b.jsx("td",{onClick:()=>{t(new Date(ot(i),e.indexOf(h),sg(i))),n("days")},tabIndex:e.indexOf(h)===Pt(i)?0:void 0,className:I("datepicker-cell","datepicker-large-cell","datepicker-month-cell",s&&e.indexOf(h)===Pt(s)&&ot(i)===ot(s)&&"selected",r===3&&e.indexOf(h)===Pt(i)&&"focused",Pt(Ro())===e.indexOf(h)&&ot(Ro())===ot(i)&&"current",ag(e.indexOf(h),ot(i),o,a,l,c)&&"disabled"),children:b.jsx("div",{className:"datepicker-cell-content datepicker-large-cell-content",children:h})},e.indexOf(h)))},d))})})},Q4=({title:e,customHeader:t})=>{const{weekdaysShort:n,monthsShort:i,selectedDate:s,isInDatetimepicker:r,onDatetimepickerModeSwitch:o}=k.useContext(ir),a=s||new Date;return b.jsxs("div",{className:"datepicker-header",children:[b.jsx("div",{className:"datepicker-title",children:b.jsx("span",{className:"datepicker-title-text",children:e})}),b.jsxs("div",{className:"datepicker-date",children:[!t&&b.jsxs("span",{className:"datepicker-date-text",children:[n[a.getDay()],", ",i[a.getMonth()]," ",a.getDate()]}),t&&t]}),r&&b.jsxs("div",{className:"buttons-container",children:[b.jsx("button",{type:"button",className:"datepicker-button-toggle",children:b.jsx("i",{className:"far fa-calendar datepicker-toggle-icon"})}),b.jsx("button",{type:"button",className:"timepicker-button-toggle",onClick:o,children:b.jsx("i",{className:"far fa-clock fa-sm timepicker-icon"})})]})]})},Z4=()=>{const{view:e,setView:t,activeDate:n,setActiveDate:i,monthsFull:s,min:r,max:o,yearScope:a}=k.useContext(ir),l=c=>{if(e==="days"){const u=c?new Date(ot(n),Pt(n)+1,sg(n)):new Date(ot(n),Pt(n)-1,sg(n));c?!aw(Je(u,-1),"days",1,r,o)&&i(u):!lw(Je(u,1),"days",1,r,o)&&i(u)}else if(e==="years"){const u=c?new Date(ot(n)+24,Pt(n),Te(n)):new Date(ot(n)-24,Pt(n),Te(n));c?o?a[0]+24ot(r)&&i(u):i(u)}else if(e==="months"){const u=c?new Date(ot(n)+1,Pt(n),Te(n)):new Date(ot(n)-1,Pt(n),Te(n));c?!aw(Ln(u,-1),"months",1,r,o)&&i(u):!lw(Ln(u,1),"months",1,r,o)&&i(u)}};return b.jsxs("div",{className:"datepicker-date-controls",children:[e==="days"&&b.jsxs("button",{tabIndex:0,className:"datepicker-view-change-button",onClick:()=>t("years"),children:[s[n.getMonth()]," ",n.getFullYear()]}),e==="years"&&b.jsxs("button",{tabIndex:0,className:"datepicker-view-change-button",onClick:()=>t("days"),children:[a[0]," - ",a[1]]}),e==="months"&&b.jsx("button",{tabIndex:0,className:"datepicker-view-change-button",onClick:()=>t("days"),children:ot(n)}),b.jsxs("div",{className:"datepicker-arrow-controls",children:[b.jsx("button",{tabIndex:0,className:"datepicker-previous-button",onClick:()=>l(!1)}),b.jsx("button",{tabIndex:0,className:"datepicker-next-button",onClick:()=>l(!0)})]})]})},J4=({labelText:e,inline:t,setReferenceElement:n,inputClasses:i,value:s,style:r,inputStyle:o,icon:a,input:l,inputId:c,inputToggle:u,setDatepickerValue:d,format:h,onOpenHandler:f,...p})=>{const{monthsFull:m,monthsShort:v,setSelectedDate:y,setActiveDate:g}=k.useContext(ir),x=I(s?"active":"",i),_=k.useRef(null);return k.useEffect(()=>{var w;if(u)return;const S=(w=_.current)==null?void 0:w.parentNode,{div:C,selector:M}=H4(a,"sm",!0);return S==null||S.insertBefore(C,_.current),S==null||S.insertBefore(M,_.current),M.addEventListener("click",()=>f==null?void 0:f()),()=>{M.removeEventListener("click",()=>f==null?void 0:f()),S==null||S.removeChild(M)}},[a,f,u]),b.jsx(wi,{className:x,label:e,id:c,ref:t?n:l,labelRef:_,wrapperClass:"datepicker",value:s,onChange:w=>{const S=lh(w.target.value,h,m,v);d(w.target.value),S&&rg(S)?(g(S),y(S)):(g(new Date),y(void 0))},style:o,wrapperStyle:r,onClick:()=>{u&&(f==null||f())},...p})},x0="ArrowLeft",b0="ArrowUp",_0="ArrowRight",w0="ArrowDown",k0="Home",S0="End",M0="PageUp",C0="PageDown",P0="Enter",T0=" ",t8=(e,t,n,i,s,r,o,a,l,c)=>{switch(e){case x0:t(u=>eo(u,-1));break;case _0:t(u=>eo(u,1));break;case b0:t(u=>eo(u,-7));break;case w0:t(u=>eo(u,7));break;case k0:t(u=>eo(u,1-Te(u)));break;case S0:t(u=>eo(u,rc(u)-Te(u)));break;case M0:t(u=>Je(u,-1));break;case C0:t(u=>Je(u,1));break;case P0:if(No(n,i,s,o)||ET(n,c)||AT(n,l))return;a(n),r(n);break;case T0:if(!o||o(n)){if(No(n,i,s,o))return;a(n),r(n)}break;default:return}},e8=(e,t,n,i,s,r,o,a,l)=>{switch(e){case x0:n(c=>Ln(c,-1));break;case _0:n(c=>Ln(c,1));break;case b0:n(c=>Ln(c,-4));break;case w0:n(c=>Ln(c,4));break;case k0:n(c=>Ln(c,-og(c,24)));break;case S0:n(c=>Ln(c,24-og(c,24)-1));break;case M0:n(c=>Ln(c,-24));break;case C0:n(c=>Ln(c,24));break;case P0:!lg(ot(t),i,s,a,l)&&r("months");break;case T0:!lg(ot(t),i,s,a,l)&&o(t);return;default:return}},n8=(e,t,n,i,s,r,o,a,l,c)=>{switch(e){case x0:n(u=>Je(u,-1));break;case _0:n(u=>Je(u,1));break;case b0:n(u=>Je(u,-4));break;case w0:n(u=>Je(u,4));break;case k0:n(u=>Je(u,-Pt(u)));break;case S0:n(u=>Je(u,11-Pt(u)));break;case M0:n(u=>Ln(u,-1));break;case C0:n(u=>Ln(u,1));break;case P0:!ag(Pt(t),ot(t),i,s,l,c)&&r("days");break;case T0:!ag(Pt(t),ot(t),i,s,l,c)&&o(t);return;default:return}},i8=({closeOnEsc:e,isOpen:t,activeDate:n,setActiveDate:i,min:s,max:r,view:o,setView:a,setSelectedDate:l,filter:c,setInlineDate:u,disableFuture:d,disablePast:h,onClose:f})=>{const[p,m]=k.useState(3),v=k.useRef(null),y=k.useCallback(g=>{var x,_,w;if(e&&g.key==="Escape"&&(f==null||f()),g.preventDefault(),!g.shiftKey&&g.key==="Tab"){const S=(x=v.current)==null?void 0:x.querySelectorAll('[tabindex="0"]');S&&(p===S.length-1?m(0):m(p+1))}else if(g.key==="Enter")p!==3&&document.activeElement&&document.activeElement.click();else if(g.shiftKey&&g.key==="Tab"){const S=(_=v.current)==null?void 0:_.querySelectorAll('[tabindex="0"]');S&&m(p===0?S.length-1:p-1)}(w=v.current)!=null&&w.querySelector(".focused")&&p!==4&&(o==="days"?t8(g.key,i,n,s,r,l,c,u,d,h):o==="years"?e8(g.key,n,i,s,r,a,l,d,h):o==="months"&&n8(g.key,n,i,s,r,a,l,c,d,h))},[n,o,c,r,s,e,p,a,i,l,u,d,h,f]);return k.useEffect(()=>{var g,x;const _=(g=v.current)==null?void 0:g.querySelectorAll('[tabindex="0"]');if(_){const w=_[p];if(w.tagName!=="TD"){w.focus();const S=(x=v.current)==null?void 0:x.querySelector(".focused");S==null||S.classList.remove("focused")}else _[p-1].blur(),w.classList.add("focused")}},[p]),k.useEffect(()=>{t||m(3)},[t]),k.useEffect(()=>{m(3)},[o]),k.useEffect(()=>{if(t)return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y)}},[y,t]),{tabCount:p,modalRef:v}},s8=({isOpen:e,inline:t})=>{k.useEffect(()=>{const n=window.innerWidth>document.documentElement.clientWidth&&window.innerWidth>=576;if(!t)return e&&n?(document.body.style.overflow="hidden",document.body.style.paddingRight="17px"):(document.body.style.overflow="",document.body.style.paddingRight=""),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[e,t])},r8=({isOpened:e,isOpen:t,inline:n,popperElement:i,referenceElement:s,backdropRef:r,onCloseHandler:o})=>{const a=k.useCallback(l=>{var c;n?!(i!=null&&i.contains(l.target))&&!((c=s==null?void 0:s.parentNode)!=null&&c.contains(l.target))&&!l.target.classList.contains("datepicker-view-change-button")&&!l.target.classList.contains("datepicker-large-cell-content")&&t&&o():l.target===r.current&&t&&o()},[i,s,r,n,t,o]);k.useEffect(()=>(e&&document.addEventListener("click",a),()=>{document.removeEventListener("click",a)}),[e,a])},OT=k.forwardRef(({datetimepickerRef:e,isInDatetimepicker:t,onDatetimepickerModeSwitch:n,closeOnEsc:i=Ce.closeOnEsc,customHeader:s,title:r=Ce.title,weekdaysNarrow:o=Ce.weekdaysNarrow,monthsFull:a=Ce.monthsFull,monthsShort:l=Ce.monthsShort,weekdaysFull:c=Ce.weekdaysFull,weekdaysShort:u=Ce.weekdaysShort,disableFuture:d,disablePast:h,filter:f,inline:p,className:m,min:v,max:y,format:g=Ce.format,okBtnText:x=Ce.okBtnText,clearBtnText:_=Ce.clearBtnText,cancelBtnText:w=Ce.cancelBtnText,inputToggle:S,customIcon:C=Ce.customIcon,inputId:M,inputLabel:P=Ce.inputLabel,inputStyle:T,startDay:A=Ce.startDay,views:E=Ce.views,style:z,defaultValue:N="",onChange:L,onClose:R,onClosed:B,onOpen:D,onOpened:$,getFormattedDateValues:F,value:V,wrapperClass:W,selectOnClick:et=!1,open:Z,disablePortal:O,...U},lt)=>{const[ct,kt]=k.useState(!1),[it,Lt]=k.useState(!1),Ct=ef(it,Z),[Qt,ft]=k.useState(new Date),[wt,dt]=k.useState(new Date),[jt,pt]=k.useState(E),[xt,J]=k.useState(V||N),[mt,q]=k.useState(),[ye,Dt]=k.useState(),[he,Un]=k.useState(o),[Yn,Mn]=k.useState([0,0]),Si=k.useRef(null),dn=k.useRef(null),Mi=k.useRef(N&&!0),{styles:as,attributes:ls}=Oh(e||ye,mt,{placement:"bottom-start",modifiers:[VM]});k.useImperativeHandle(lt,()=>p?ye:dn.current,[p,ye]);const Ci=nt=>{if(p&&p){const Tt=cw(nt,g,u,c,l,a);J(Tt),t&&(n==null||n()),Ke()}},Pi=nt=>{const Tt=nt&&cw(nt,g,u,c,l,a);Tt&&J(Tt)},Ke=k.useCallback(()=>{Lt(!1),R==null||R()},[R]),Xn=k.useCallback(()=>{Lt(!0),D==null||D()},[D]),Ti=k.useCallback(()=>{kt(!1),B==null||B()},[B]),j=k.useCallback(()=>{kt(!0),$==null||$()},[$]),{tabCount:Q,modalRef:It}=i8({closeOnEsc:i,isOpen:Ct,activeDate:Qt,setActiveDate:ft,min:v,max:y,view:jt,setView:pt,setSelectedDate:dt,filter:f,setInlineDate:Ci,disableFuture:d,disablePast:h});return s8({isOpen:Ct,inline:p}),r8({isOpened:ct,isOpen:Ct,inline:p,referenceElement:ye,popperElement:mt,backdropRef:Si,onCloseHandler:Ke}),k.useEffect(()=>{const nt=ot(Qt),Tt=og(Qt,24),Oe=nt-Tt;Mn([Oe,Oe+23])},[Qt]),k.useEffect(()=>{const nt=o.slice(A).concat(o.slice(0,A));Un(nt)},[o,A]),k.useEffect(()=>{if(!Ct)return;const nt=p?ye:dn.current,Tt=nt==null?void 0:nt.parentNode,Oe=Tt==null?void 0:Tt.querySelector("button");Oe?Oe.blur():nt==null||nt.blur()},[Ct,dn,ye,p,D]),k.useEffect(()=>{Z&&!Ct&&!ct&&(D==null||D(),Lt(!0))},[Z,Ct,ct,D]),k.useEffect(()=>{if(!Mi.current)return;const nt=lh(xt,g,a,l);nt&&rg(nt)&&(ft(nt),dt(nt)),Mi.current=!1},[N,xt,g,a,l]),k.useEffect(()=>{const nt=V&&lh(V,g,a,l);nt&&rg(nt)&&(ft(nt),dt(nt),J(V)),V===""&&(ft(new Date),dt(void 0),J(V))},[V,g,a,l]),k.useEffect(()=>{Ct||(pt(E),xt||(ft(new Date),dt(void 0)))},[Ct,E,xt]),k.useEffect(()=>{L==null||L(xt,Qt)},[xt]),k.useEffect(()=>{const nt=wt||new Date,Tt=String(nt.getDate()),Oe=u[nt.getDay()],cs=c[nt.getDay()],ai=l[nt.getMonth()],Kn=a[nt.getMonth()],Me=String(nt.getFullYear()),Kr=Me.slice(-2);F==null||F({dayNumber:Tt,weekdayShort:Oe,weekdayFull:cs,monthShort:ai,monthFull:Kn,yearFull:Me,yearShort:Kr})},[wt]),b.jsx(ir.Provider,{value:{isInDatetimepicker:t,onDatetimepickerModeSwitch:n,view:jt,setView:pt,activeDate:Qt,setActiveDate:ft,selectedDate:wt,setSelectedDate:dt,weekdaysShort:u,monthsShort:l,monthsFull:a,min:v,max:y,weekdaysFull:c,yearScope:Yn,tabCount:Q,isOpen:Ct,disablePast:h,disableFuture:d},children:b.jsxs(b.Fragment,{children:[!t&&b.jsx(J4,{inputClasses:m,labelText:P,inline:p,setReferenceElement:Dt,value:xt,setDatepickerValue:J,style:z,inputStyle:T,format:g,icon:C,input:dn,inputToggle:S,onOpenHandler:Xn,...U}),b.jsx(aa,{disablePortal:O,children:b.jsx(Zy,{children:Ct&&b.jsxs(b.Fragment,{children:[b.jsxs(j4,{className:W,dropdown:p,styles:as,attributes:ls,setPopperElement:q,onClosed:Ti,onOpened:j,children:[!p&&b.jsx(Q4,{title:r,customHeader:s,onClose:Ke}),b.jsxs("div",{className:"datepicker-main",ref:It,children:[b.jsx(Z4,{}),b.jsxs("div",{className:"datepicker-view",children:[jt==="days"&&b.jsx(K4,{startWeekdays:he,startDay:A,filter:f,inlineDayClick:Ci,selectDate:Pi,selectOnClick:et,onClose:Ke}),jt==="years"&&b.jsx(G4,{}),jt==="months"&&b.jsx(q4,{})]}),!p&&b.jsx(W4,{okBtnText:x,clearBtnText:_,cancelBtnText:w,setValue:J,selectDate:Pi,onClose:Ke})]})]},"datepicker-modal-container"),!p&&b.jsx(Jo.div,{className:"datepicker-backdrop",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},ref:Si})]})})})]})})});OT.displayName="MDBDatepicker";const o8=e=>{const t=/^([0-1]?[0-9]|2[0-3]):[0-5][0-9] [APap][mM]$/,n=/^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$/;return e.match(t)||e.match(n)},a8=e=>e&&Object.prototype.toString.call(e)==="[object Date]"&&!isNaN(e.getTime()),uw=300,l8=k.forwardRef(({className:e,label:t="Select Date and Time",labelStyle:n,labelClass:i,labelRef:s,inputClass:r="",inputRef:o,inline:a,disabled:l,defaultTime:c="",defaultDate:u="",value:d,invalidLabel:h,inputToggle:f=!1,timepickerOptions:p,datepickerOptions:m,showFormat:v,dateFormat:y="dd/mm/yyyy",timeFormat:g="12h",appendValidationInfo:x=!0,onChange:_,onOpen:w,onClose:S,onDatepickerOpen:C,onDatepickerClose:M,onTimepickerOpen:P,onTimepickerClose:T,...A},E)=>{const z=k.useRef(!1),[N,L]=k.useState(!1),[R,B]=k.useState(!1),[D,$]=k.useState(u),[F,V]=k.useState(c),[W,et]=k.useState(""),Z=k.useRef(),O=D?W.split(",")[0]:null,U=F?W.split(", ")[1]:null,lt=I("form-outline","datetimepicker",e),ct=()=>{const pt=O&&lh(O,y,Ce.monthsFull,Ce.monthsShort);return W&&!O&&!U||O&&!a8(pt)||U&&!o8(U)?r+" is-invalid":r},kt=k.useCallback(pt=>{$(pt)},[]),it=k.useCallback(pt=>{V(pt)},[]),Lt=k.useCallback(()=>{B(!1),z.current=!1,M==null||M()},[M]),Ct=k.useCallback(()=>{T==null||T(),L(!1),z.current=!1},[T]),Qt=k.useCallback(()=>{C==null||C()},[C]),ft=k.useCallback(()=>{P==null||P()},[P]),wt=()=>{B(!0),w==null||w(),z.current=!0},dt=k.useCallback(()=>{R?(B(!1),setTimeout(()=>{L(!0)},uw)):N&&(L(!1),setTimeout(()=>{B(!0)},uw))},[R,N]);k.useEffect(()=>{!F||!D||(_==null||_(`${D}, ${F}`),!d&&et(`${D}, ${F}`))},[F,D,_,d]),k.useEffect(()=>{d&&(et(d),_==null||_(d))},[d,_]),k.useEffect(()=>{!R&&!N&&!z.current&&(S==null||S())},[R,N,S]);const jt=pt=>{et(pt);const[xt,J]=pt.split(", ");$(xt||""),V(J||"")};return b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:lt,ref:Z,...A,children:[b.jsx(wi,{label:t,labelStyle:n,labelClass:i,ref:o||E,labelRef:s,placeholder:v?`${y}, ${g}`:void 0,value:d||W,onChange:pt=>{jt(pt.target.value),_==null||_(pt.target.value)},className:x?ct():r,disabled:l,onClick:()=>{f&&wt()},children:h&&b.jsx("div",{className:"invalid-feedback",children:h})}),!f&&b.jsx("button",{type:"button",className:"datetimepicker-toggle-button",onClick:wt,disabled:l,style:{pointerEvents:l?"none":"initial"},children:b.jsx("i",{className:"far fa-calendar datepicker-toggle-icon"})})]}),b.jsx(OT,{...m,inline:a,onChange:kt,format:y,datetimepickerRef:Z.current,defaultValue:u,value:D,onClose:Lt,onOpen:Qt,isInDatetimepicker:!0,open:R,onDatetimepickerModeSwitch:dt}),b.jsx(PT,{...p,inline:a,onChange:it,format:g,datetimepickerRef:Z.current,defaultValue:c,value:F,onClose:Ct,onOpen:ft,isInDatetimepicker:!0,open:N,onDatetimepickerModeSwitch:dt})]})});l8.displayName="MDBDateTimepicker";const c8=Y.forwardRef(({className:e,color:t,children:n,...i},s)=>{const r=I("toast-header",t&&`bg-${t}`,t&&t!=="light"&&"text-white",e);return b.jsx("div",{className:r,ref:s,...i,children:n})});c8.displayName="MDBToastHeader";const u8=Y.forwardRef(({className:e,children:t,color:n,...i},s)=>{const r=I("toast-body",n&&n!=="light"&&"text-white",e);return b.jsx("div",{className:r,ref:s,...i,children:t})});u8.displayName="MDBToastBody";const d8=Y.forwardRef(({className:e,white:t,children:n,...i},s)=>{const r=I("btn-close",t&&"btn-close-white",e);return b.jsx(Zt,{className:r,color:"none",ref:s,...i,children:n})});d8.displayName="MDBToastClose";const h8=0,f8=({selectedElements:e,optionHeight:t,data:n,multiple:i,selectAll:s,handleSelectAll:r,handleOptionClick:o,selectAllLabel:a,selectData:l,activeElementIndex:c,noResults:u,search:d})=>{const h=k.useMemo(()=>l.filter(v=>v.optgroup).map(v=>v.optgroup),[l]),f=k.useMemo(()=>{let v=0;return l.map(y=>(y.optgroup&&v++,{...y,groupIndex:v}))},[l]),p=k.useMemo(()=>l.filter(v=>!v.optgroup&&!v.hidden).length===0,[l]),m=v=>f.map(y=>{if(!y.optgroup&&v===y.groupIndex)return b.jsxs("div",{className:I("select-option",e.includes(y.elementPosition)&&"selected",y.disabled&&"disabled",y.hidden&&"d-none",c===y.elementPosition&&"active"),role:"option",style:{height:t},onClick:()=>o(y),children:[b.jsxs("span",{className:"select-option-text",children:[i&&b.jsx(oh,{disabled:y.disabled,disableWrapper:!0,checked:e.includes(y.elementPosition),readOnly:!0}),y.text,y.secondaryText&&b.jsx("span",{className:"select-option-secondary-text",children:y.secondaryText})]}),y.icon&&b.jsx("span",{className:"select-option-icon-container",children:b.jsx("img",{className:"select-option-icon rounded-circle",src:y.icon})})]},y.elementPosition)});return b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"select-options-list",children:[i&&s&&!p&&b.jsx("div",{className:I("select-option",e.length===n.filter(v=>!v.disabled).length&&"selected",c===-1&&"active"),role:"option",onClick:r,style:{height:t},children:b.jsxs("span",{className:"select-option-text",children:[b.jsx(oh,{disableWrapper:!0,checked:n.filter(v=>!v.disabled&&!v.optgroup).length===e.length,readOnly:!0}),a]})}),m(h8),!p&&(h==null?void 0:h.map((v,y)=>{const g=m(y+1).filter(x=>x!==void 0);if(g.length!==0)return b.jsxs("div",{className:"select-option-group",children:[b.jsx("label",{className:"select-option-group-label",style:{height:t},children:v}),g]},`select-option-group ${v} ${y}`)}))]}),d&&p&&b.jsx("div",{className:"select-no-results",style:{height:t},children:u})]})},_p="ArrowUp",wp="ArrowDown",dw="Enter",hw="Escape",fw="Tab",p8=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;no.includes(a))||!r.every(a=>i[a]===s[a]))return!1}return!0},m8=e=>e.map((t,n)=>({...t,elementPosition:n})),g8={open:{opacity:1,transform:"scaleY(1)",transition:{duration:.2}},closed:{opacity:0,transform:"scaleY(0.8)",transition:{duration:.2}}},Ra=-1,D0=k.forwardRef(({data:e,className:t,inputClassName:n,optionHeight:i=38,visibleOptions:s=5,disabled:r,placeholder:o,label:a,clearBtn:l,children:c,multiple:u,displayedLabels:d=5,optionsSelectedLabel:h="options selected",selectAll:f=!0,selectAllLabel:p="Select all",size:m,openRef:v,contrast:y=!1,open:g,onOpen:x,onOpened:_,onClose:w,onClosed:S,onValueChange:C,onChange:M,search:P=!1,searchLabel:T="Search...",searchFn:A,autoSelect:E=!1,noResultsText:z="No results",validation:N=!1,validFeedback:L="Valid",invalidFeedback:R="Invalid",preventFirstSelection:B=!1,value:D,animationVariants:$,disablePortal:F,...V},W)=>{const[et,Z]=k.useState(!1),O=ef(et,g),[U,lt]=k.useState(!0),[ct,kt]=k.useState(null),[it,Lt]=k.useState(),[Ct,Qt]=k.useState();k.useImperativeHandle(W,()=>it,[it]);const[ft,wt]=k.useState(""),[dt,jt]=k.useState(""),[pt,xt]=k.useState(()=>f?Ra:e.findIndex(G=>!G.disabled)),[J,mt]=k.useState([]),[q,ye]=k.useState([]),[Dt,he]=k.useState(q),[Un,Yn]=k.useState(""),[Mn,Si]=k.useState(0),[dn,Mi]=k.useState(!1),as=I("select-wrapper",t),ls=I("select-input",o&&"placeholder-active",O&&"focused",n),Ci=I(O||ct&&a?"active":"",a&&"select-label"),Pi=I("select-dropdown",O&&"open"),{styles:Ke,attributes:Xn}=Oh(it,Ct,{placement:"bottom-start"}),Ti=k.useRef(null),j=k.useRef(null),Q=k.useRef(null),It=k.useMemo(()=>u&&f?s+1:s,[f,s,u]);k.useEffect(()=>{if(!dt)return he(q);if(A&&dt){const G=A(dt,q);return he(G||[])}he(()=>q.filter(G=>{var X;return((X=G.text)==null?void 0:X.toLocaleLowerCase().includes(dt.toLocaleLowerCase()))||G.optgroup}))},[dt,q,A,ft]),k.useEffect(()=>{O&&dt&&xt(-1)},[O,dt]),k.useEffect(()=>{if(!N)return;const G=J.every(ht=>q[ht].value),X=J.every(ht=>!q[ht].disabled),rt=J.length>0;!u&&(!rt||!G||!X)||u&&(!rt||!X)?it==null||it.setCustomValidity(R):it==null||it.setCustomValidity("")},[N,R,J,it,q,ft,u]);const nt=G=>{if(q.length===0)return;const X=j.current,rt=X.offsetHeight,ht=X.scrollTop,hn=q.filter(Ge=>Ge.hidden&&Ge.elementPosition(u&&f?-2:-1)){const Ge=(us-hn)*i,fn=Ge+i>ht+rt;Ge{const G=rt=>Dt.findIndex(ht=>ht.elementPosition==rt);let X=pt;for(;X{let G=pt;for(;G>=0;){G-=1;const X=Dt.findIndex(ht=>ht.elementPosition==G)!=-1,rt=G>=0&&(q[G].disabled||q[G].hidden||q[G].optgroup);if(G<=0&&(!X||rt))return u&&f?G=-1:pt;if(X&&!rt)break}return G},cs=G=>{const{key:X}=G;if([_p,wp,dw,fw,hw].includes(X)){if(X===fw)return E&&ca(Dt[pt]),it==null||it.focus(),Z(!1);if(G.preventDefault(),G.altKey&&(X===wp||X===_p))return O?w==null||w():x==null||x(),Z(!O);if(X===wp){const rt=Tt();return O?(nt(rt),xt(rt)):u?Z(!0):mt([rt])}if(X===_p){const rt=Oe();return O?(nt(rt),xt(rt)):u?Z(!0):mt([rt])}if(X===dw){const rt=Dt.findIndex(ht=>ht.elementPosition==pt);return O?pt===Ra?Kr():ca(Dt[rt]):(x==null||x(),Z(!0))}if(X===hw)return Z(!1),it==null?void 0:it.focus()}},ai=k.useCallback(()=>{Z(G=>!G)},[]),Kn=k.useCallback(G=>{if(v&&v.current===G.target)return;const X=Ct&&Ct!==null,rt=it&&it!==null,ht=!(Ct!=null&&Ct.contains(G.target))&&!(it!=null&&it.contains(G.target)),hn=G.target===Q.current;X&&O&&rt&&ht&&!hn&&(Z(!1),w==null||w())},[Ct,it,O,w,v]);k.useEffect(()=>{const G=m8(e);p8(G,q)||ye(G)},[e,q]);const Me=k.useCallback(()=>{O&&Yn(`${it==null?void 0:it.offsetWidth}px`)},[it,O]),Kr=()=>{if(!u||!f)return;if(J.length===e.filter(X=>!X.disabled&&!X.optgroup).length)return mt([]),C==null||C([]),M==null||M([]),Cn([]);const G=q==null?void 0:q.filter(X=>!X.disabled&&!X.optgroup).map(X=>X.elementPosition);return mt(G),C==null||C(e.filter(X=>!X.disabled)),M==null||M(e.filter(X=>!X.disabled)),Cn(G)},Gr=k.useCallback(()=>{if(q.length===0)return;let G=J[0];const X=G===void 0,rt=G>=q.length;if(dn&&!u){if(X&&B||!dn||u||rt)return;X&&(G=0);const ht=q[G].value,hn=String(q[G].text);hn?(kt(ht?null:hn),wt(ht?hn:"")):(kt(null),wt(ht?" ":""))}},[u,dn,J,q,B]),Cn=k.useCallback(G=>{const X=d===-1||G.length>d;if(G.length<=0&&(kt(null),wt("")),X)return kt(null),wt(`${G.length} ${h}`);const rt=G.map(fn=>q[fn].text||"").filter(fn=>fn!==""),ht=G.map(fn=>q[fn].value||"").filter(fn=>fn!==""),hn=rt.findIndex(fn=>fn!=="")===-1,us=ht.length>0,Ge=rt.join(", ");hn?(kt(null),wt(us?" ":"")):us?(wt(Ge),kt(null)):(wt(""),kt(Ge))},[d,h,q]);k.useEffect(()=>{Gr()},[J,Gr]);const ca=G=>{if(!G||G.disabled)return;const{elementPosition:X}=G;if(u){const rt=J.includes(X)?J.filter(ht=>ht!==X):[...J,X];return mt(rt),C==null||C(rt.map(ht=>e[ht])),M==null||M(rt.map(ht=>e[ht])),Cn(rt)}return mt([X]),Z(!1),C==null||C(e[X]),M==null||M(e[X]),w==null||w(),it==null?void 0:it.focus()};k.useEffect(()=>{Mi(!0)},[]),k.useEffect(()=>{if(u){const X=q.filter(rt=>rt.defaultSelected).map(rt=>rt.elementPosition);return Cn(X),mt(X)}let G=q.findIndex(X=>X.defaultSelected);G===Ra&&!B&&(G=q.findIndex(X=>!X.disabled&&!X.hidden)),G!==Ra&&mt([G])},[q,Cn,u,B]),k.useEffect(()=>{if(O&&P&&J.length===0)return xt(Ra);O||(J.length>0?xt(Math.max(...J)):xt(0))},[Dt,O,P,J]),k.useEffect(()=>{Si(It*i)},[It,i]),k.useEffect(()=>{Me()},[Me]),k.useEffect(()=>(O&&(window.addEventListener("click",Kn),window.addEventListener("resize",Me)),()=>{window.removeEventListener("click",Kn),window.removeEventListener("resize",Me)}),[Kn,Me,O]),k.useEffect(()=>{if(v){const G=v.current;return G==null||G.addEventListener("click",ai),()=>{G==null||G.removeEventListener("click",ai)}}},[v,ai]),k.useEffect(()=>{if(!D)return;const G=Array.isArray(D)?D:[D],X=q.filter(ht=>ht.value&&G.includes(ht.value)).map(ht=>ht.elementPosition);if(X.toString()===J.toString())return;const rt=u?X.map(ht=>q[ht]):q[X[0]];C==null||C(rt),M==null||M(rt),mt(X),u?Cn(X):Gr()},[D,q,u,C,M,J,Gr,Cn]);const Dc=k.useCallback(()=>{r||(it==null||it.focus(),O?w==null||w():x==null||x(),Z(!O))},[r,O,x,w,it]),sf=k.useCallback(G=>{var X;G==="open"&&(lt(!1),_==null||_(),P&&((X=Ti.current)==null||X.focus())),G==="closed"&&(lt(!0),S==null||S(),P&&jt(""))},[_,S,P]);return b.jsx("div",{className:as,...V,children:b.jsxs(b.Fragment,{children:[b.jsxs(wi,{ref:Lt,onClick:Dc,onKeyDown:cs,className:ls,value:ft,readonly:!N,required:N,disabled:r,placeholder:ct?void 0:o,label:a,labelClass:Ci,size:m,contrast:y,children:[N&&b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"invalid-feedback",children:R}),b.jsx("div",{className:"valid-feedback",children:L})]}),ct&&b.jsx("div",{className:"form-label select-fake-value active",children:ct}),l&&(ft.length>0||ct)&&b.jsx("span",{tabIndex:0,className:`select-clear-btn d-block ${r?"pe-none":""}`,role:"button",onClick:()=>{wt(""),mt([]),C==null||C(u?[]:{}),M==null||M(u?[]:{})},children:"✕"}),b.jsx("span",{className:`select-arrow ${r?"pe-none":""}`,ref:Q,onClick:Dc,style:{cursor:"pointer"}})]}),(e==null?void 0:e.length)>0&&(O||!U)&&b.jsx(aa,{disablePortal:F,children:b.jsx("div",{style:{...Ke.popper,width:Un,zIndex:1070},...Xn.popper,ref:Qt,className:"select-dropdown-container",children:b.jsx(Zy,{children:O&&b.jsxs(Jo.div,{variants:{...g8,...$},initial:"closed",animate:"open",exit:"closed",tabIndex:0,className:Pi,onAnimationStart:()=>{lt(!1)},onAnimationComplete:sf,children:[P&&b.jsx("div",{className:"input-group",children:b.jsx("input",{onKeyDown:cs,onChange:G=>jt(G.target.value),ref:Ti,type:"text",className:"form-control select-filter-input",role:"searchbox",placeholder:T})}),b.jsx("div",{className:"select-options-wrapper",ref:j,style:{maxHeight:`${Mn}px`},children:b.jsx(f8,{data:e,selectData:Dt,selectedElements:J,optionHeight:i,visibleOptions:It,handleOptionClick:ca,handleSelectAll:Kr,selectAll:f,selectAllLabel:p,multiple:u,activeElementIndex:pt,noResults:z,search:P})}),c&&b.jsx("div",{className:"select-custom-content",children:c})]})})})})]})})});D0.displayName="MDBSelectV2";const Tc=k.createContext({isLoading:!1,activePage:0,setActivePage:null,sort:{column:"",option:""},fixedHeader:!1,handleSort:null}),y8=({fullPagination:e,rowsText:t="Rows per page:",selectValue:n,setSelectValue:i,activeDataLength:s,entriesOptions:r=[10,25,50,200],fullDataLength:o,allText:a="All",ofText:l="of"})=>{const{isLoading:c,activePage:u,setActivePage:d}=k.useContext(Tc),h=u===0||c,f=s<=n*(u+1)||c,p=u===Math.floor(s/n),m=r.map(g=>({text:g.toString(),value:g,defaultSelected:n===g}));m.push({text:a,value:o,defaultSelected:n===o});const v=g=>{g instanceof Array||(i(g.value),d(0))},y=`${u*n+1} - ${(u+1)*n>s?s:(u+1)*n} ${l} ${s}`;return b.jsxs("div",{className:"datatable-pagination",children:[b.jsxs("div",{className:"datatable-select-wrapper",children:[b.jsx("p",{className:"datatable-select-text",children:t}),b.jsx(D0,{onValueChange:v,data:m,disabled:c})]}),b.jsx("div",{className:"datatable-pagination-nav",children:y}),b.jsxs("div",{className:"datatable-pagination-buttons",children:[e&&b.jsx(Zt,{disabled:h,onClick:()=>d(0),className:"datatable-pagination-button datatable-pagination-start",color:"link",children:b.jsx(sn,{icon:"angle-double-left"})}),b.jsx(Zt,{disabled:h,onClick:()=>d(u-1),className:"datatable-pagination-button datatable-pagination-left",color:"link",children:b.jsx(sn,{icon:"chevron-left"})}),b.jsx(Zt,{disabled:f,onClick:()=>d(u+1),className:"datatable-pagination-button datatable-pagination-right",color:"link",children:b.jsx(sn,{icon:"chevron-right"})}),e&&b.jsx(Zt,{disabled:p,onClick:()=>d(Math.floor(s/n)),className:"datatable-pagination-button datatable-pagination-end",color:"link",children:b.jsx(sn,{icon:"angle-double-right"})})]})]})},pw=(e,t,n)=>{const i=s=>s.toString().toLowerCase().includes(t.toLowerCase());return e.filter(s=>{if(n&&typeof n=="string")return i(s[n]);let r=Object.values(s);return n&&Array.isArray(n)&&(r=Object.keys(s).filter(o=>n.includes(o)).map(o=>s[o])),r.filter(o=>i(o)).length>0})},v8=(e,t,n)=>Object.assign([],e).sort((i,s)=>{const r=typeof i[t]=="string"?i[t].toLowerCase():i[t],o=typeof s[t]=="string"?s[t].toLowerCase():s[t];return ro?n==="desc"?-1:1:0}),LT=e=>e.every(t=>typeof t=="string"),E0=e=>!e.every(t=>typeof t=="string"),x8=e=>Array.isArray(e),mw=e=>!Array.isArray(e),b8=({search:e,advancedSearch:t,searchValue:n,setSearchValue:i,searchInputProps:s,label:r="Search",setAdvancedSearchValue:o})=>b.jsxs(b.Fragment,{children:[e&&b.jsx(wi,{value:n,onChange:a=>i(a.target.value),label:r,className:"mb-4",...s}),t&&b.jsxs(yT,{className:"mb-4",children:[b.jsx("input",{className:"form-control",value:n,onChange:a=>i(a.target.value),...s}),b.jsx(Zt,{className:"datatable-advanced-search",onClick:()=>o(t(n)),children:b.jsx(sn,{icon:"search"})})]})]}),_8=({dataColumns:e})=>{const{sort:t,fixedHeader:n,handleSort:i}=k.useContext(Tc),[s,r]=k.useState("rotate(0deg)"),o=a=>I("datatable-sort-icon",`${a===t.column&&"active"}`);return k.useEffect(()=>{const a=t.option==="desc"?"rotate(180deg)":"rotate(0deg)";r(a)},[t.option]),b.jsx(b.Fragment,{children:e.map((a,l)=>b.jsxs("th",{className:n?"fixed-cell":"",style:{cursor:"pointer"},scope:"row",onClick:()=>i(a),children:[b.jsx(sn,{fas:!0,icon:"arrow-up",className:o(a),style:{transform:a===t.column?s:"rotate(0deg)"}}),a]},l))})},w8=({dataColumns:e})=>{const[t,n]=k.useState("rotate(0deg)"),{sort:i,fixedHeader:s,handleSort:r,isLoading:o}=k.useContext(Tc),a=l=>I("datatable-sort-icon",`${l===i.column&&"active"}`);return k.useEffect(()=>{const l=i.option==="desc"?"rotate(180deg)":"rotate(0deg)";n(l)},[i.option]),b.jsx(b.Fragment,{children:e.map((l,c)=>{const{fixedValue:u,fixed:d,label:h}=l,f=l.sort!==!1&&!o,p={cursor:I(f&&"pointer"),left:d==="left"?u||0:void 0,right:d==="right"?u||0:void 0},m=I((s||d)&&"fixed-cell");return b.jsxs("th",{className:m,style:p,scope:"row",onClick:()=>f&&r(h),children:[f&&b.jsx(sn,{fas:!0,icon:"arrow-up",className:a(h),style:{transform:i.column===h?t:"rotate(0deg)"}}),h]},c)})})},k8=({row:e,dataColumns:t,format:n,editable:i})=>b.jsx(b.Fragment,{children:t.map((s,r)=>{const{field:o,fixed:a,width:l,fixedValue:c,columnSelector:u}=s,d=e[o],h=Number(d),f=n==null?void 0:n(o,h?Number(d):String(d)),p={minWidth:l,maxWidth:l,left:a==="left"&&(c||0),right:a==="right"&&(c||0),...f},m=I(a&&"fixed-cell",u&&`mdb-datatable-${u}`);return b.jsx("td",{contentEditable:i,className:m,style:p,children:d},r)})}),S8=({row:e,editable:t})=>b.jsx(b.Fragment,{children:e.map((n,i)=>b.jsx("td",{contentEditable:t,children:n},i))}),M8=({activeData:e,dataRows:t,isOnThePage:n,noFoundMessage:i,dataColumns:s,onRowClick:r,selectable:o,handleRowSelect:a,selectedRows:l,format:c,editable:u})=>{const{isLoading:d}=k.useContext(Tc),h=e.length,f=s.length,p=(m,v)=>{m.target.nodeName!=="INPUT"&&(r==null||r(v))};return b.jsxs(H3,{className:"datatable-body",children:[e.map((m,v)=>{const y=t.indexOf(m),g=l.includes(y),x=I(g&&"active",mw(m)&&m.rowSelector&&`mdb-datatable-${m.rowSelector}`);if(n(v))return b.jsxs("tr",{onClick:_=>p(_,m),className:x,style:{cursor:r&&"pointer"},children:[o&&b.jsx("td",{children:b.jsx(oh,{checked:g,onChange:()=>a(y)})}),x8(m)&&b.jsx(S8,{editable:u,row:m}),mw(m)&&E0(s)&&b.jsx(k8,{editable:u,row:m,dataColumns:s,format:c})]},v)}),!h&&!d&&b.jsx("tr",{className:"datatable-results-info",children:b.jsx("td",{colSpan:f,className:"text-center",children:i})})]})},C8=({dataColumns:e,dataRows:t,sort:n,searchValue:i,advancedSearch:s,advancedSearchValue:r})=>{const[o,a]=k.useState(t);return k.useEffect(()=>{const{column:l,option:c}=n,{phrase:u,columns:d}=r;let h;if(l){let f,p=0;E0(e)&&(f=e.find(m=>m.label===l)),LT(e)&&(p=e.indexOf(l)),h=v8(t,f?f.field:p,c)}i&&!s&&(h=pw(h||t,i,void 0)),u&&(h=pw(h||t,u,d)),a(h||t)},[n,t,e,i,s,r]),o},P8=Y.forwardRef(({advancedSearch:e,allText:t,className:n,bordered:i,borderless:s,borderColor:r="",color:o="",dark:a,entries:l=10,editable:c,entriesOptions:u,fixedHeader:d,fullPagination:h,hover:f,format:p,loaderClass:m="bg-primary",isLoading:v,loadingMessage:y="Loading results...",maxWidth:g="",maxHeight:x="",multi:_,noFoundMessage:w="No matching results found",pagination:S=!0,selectable:C,sortField:M="",searchInputProps:P,sortOrder:T="asc",sm:A,striped:E,rowsText:z,data:N={columns:[],rows:[]},search:L,onSelectRow:R,onRowClick:B,searchLabel:D,ofText:$,...F},V)=>{const[W,et]=k.useState(0),[Z,O]=k.useState(l),[U,lt]=k.useState({column:"",option:""}),[ct,kt]=k.useState([]),[it,Lt]=k.useState(""),[Ct,Qt]=k.useState({phrase:"",columns:""}),ft=C8({dataColumns:N.columns,dataRows:N.rows,sort:U,searchValue:it,advancedSearch:e,advancedSearchValue:Ct}),wt=I("datatable",f&&"datatable-hover",o&&`bg-${o}`,a&&"datatable-dark",i&&"datatable-bordered",s&&"datatable-borderless",r&&`border-${r}`,E&&"datatable-striped",A&&"datatable-sm",v&&"datatable-loading",n),dt=J=>W*Z<=J&&J<(W+1)*Z,jt=J=>{const{column:mt,option:q}=U;lt(mt===J?q==="asc"?{...U,option:"desc"}:{column:"",option:""}:{column:J,option:"asc"})},pt=J=>{const mt=J.currentTarget.checked,q=mt?Array.from({length:N.rows.length},(Dt,he)=>he):[],ye=q.map(Dt=>ft[Dt]);R==null||R(ye,q,mt),kt(q)},xt=J=>{const mt=ct.includes(J);let q;_?mt?q=ct.filter(he=>he!==J):q=[...ct,J]:mt?q=[]:q=[J];const ye=q.map(he=>ft[he]),Dt=q.length===N.rows.length;R==null||R(ye,q,Dt),kt(q)};return k.useEffect(()=>{M&<({column:M,option:T})},[M,T]),k.useEffect(()=>{et(0)},[it]),b.jsxs(Tc.Provider,{value:{isLoading:v,activePage:W,setActivePage:et,sort:U,fixedHeader:d,handleSort:jt},children:[b.jsx(b8,{search:L,advancedSearch:e,searchValue:it,setSearchValue:Lt,searchInputProps:P,label:D,setAdvancedSearchValue:Qt}),b.jsxs("div",{className:wt,ref:V,style:{maxWidth:g},...F,children:[b.jsx(k4,{className:"datatable-inner table-responsive ps",style:{overflow:"auto",position:"relative",maxWidth:g,maxHeight:x},children:b.jsxs(z3,{className:"datatable-table",children:[b.jsx(W3,{className:"datatable-header",children:b.jsxs("tr",{children:[C&&b.jsx("th",{className:d?"fixed-cell":"",children:_&&b.jsx(oh,{checked:ct.length===N.rows.length,onChange:pt})}),LT(N.columns)&&b.jsx(_8,{dataColumns:N.columns}),E0(N.columns)&&b.jsx(w8,{dataColumns:N.columns})]})}),b.jsx(M8,{activeData:ft,dataColumns:N.columns,dataRows:N.rows,isOnThePage:dt,onRowClick:B,format:p,handleRowSelect:xt,selectedRows:ct,selectable:C,noFoundMessage:w,editable:c})]})}),v&&b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"datatable-loader bg-light}",children:b.jsx("span",{className:"datatable-loader-inner",children:b.jsx("span",{className:I("datatable-progress",m)})})}),b.jsx("p",{className:"text-center text-muted my-4",children:y})]}),S&&b.jsx(y8,{fullPagination:h,selectValue:Z,setSelectValue:O,activeDataLength:ft.length,rowsText:z,entriesOptions:u,fullDataLength:N.rows.length,allText:t,ofText:$})]})]})});P8.displayName="MDBDatatable";h0.register(...i3||[]);Y.createContext({activeItem:1,setActiveItem:null,prevActive:{current:1},setHeight:null,completed:[],noEditable:!1,isAnimating:{current:!1},linear:!1,formRef:{current:null},validate:{target:0,after:0},setValidate:null,type:"horizontal",stepsLength:0,onValid:void 0,onInvalid:void 0,mobileProgress:!1,disableHeadSteps:!1,animations:!0});Y.createContext({activeItem:0,dynamic:!1,dynamicStyle:{color:"",icon:""},setDynamicStyle:null,setActiveItem:null,hoveredItem:0,setHoveredItem:null,readonly:!1,onChange:void 0});const T8=Y.forwardRef(({backdrop:e=!0,backdropColor:t="black",backdropOpacity:n=.4,color:i,className:s,loadingText:r="Loading...",isOpen:o,fullScreen:a,overflow:l=!0,parentRef:c,spinnerElement:u=b.jsx(hT,{className:"loading-icon",role:"status"}),textClassName:d,textStyles:h,tag:f="div",...p},m)=>{const v=I("loading-text",d),y=I(a?"loading-full":"loading","loading-spinner",a?"position-fixed":"position-absolute",i&&`text-${i}`,s),g=I("loading-backdrop",!a&&"position-absolute");k.useEffect(()=>{const w=c==null?void 0:c.current;if(w)return w.classList.add("position-relative"),()=>{w.classList.remove("position-relative")}},[c]),k.useEffect(()=>{if(a&&l)return o?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}},[a,o,l]);const x=b.jsxs(f,{className:y,ref:m,...p,children:[u,b.jsx("span",{className:v,style:h,children:r})]}),_=b.jsx("div",{className:g,style:{opacity:n,backgroundColor:t}});return b.jsx(b.Fragment,{children:o!==!1&&b.jsx(b.Fragment,{children:a?b.jsxs(aa,{children:[x,_]}):b.jsxs(b.Fragment,{children:[x,e&&_]})})})});T8.displayName="MDBLoadingManagement";const D8=({isOpened:e,inputRef:t,dropdownEl:n,setOpenState:i,onClose:s})=>{const r=k.useCallback(o=>{if(!n)return;const a=t.current===o.target,l=n===o.target,c=n.contains(o.target);e&&!a&&!l&&!c&&(i(!1),s==null||s())},[e,i,n,t,s]);k.useEffect(()=>(document.addEventListener("click",r),()=>{document.removeEventListener("click",r)}),[r])},E8=({inputRef:e,dropdownEl:t})=>{const n=k.useCallback(()=>{if(!e.current||!t)return;const{width:i}=window.getComputedStyle(e.current);t.style.width=i},[t,e]);k.useEffect(()=>(n(),window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)}),[n])},A8=({isOpen:e})=>{const[t,n]=k.useState(!1);return k.useEffect(()=>{let i;return e?n(!0):i=setTimeout(()=>{n(!1)},100),()=>{clearTimeout(i)}},[e]),t},O8=({className:e,customContent:t=null,inputRef:n,isOpen:i,isOpened:s,children:r,setOpenState:o,listHeight:a="190px",onOpened:l,onClose:c,onClosed:u,...d})=>{const[h,f]=k.useState(null),[p,m]=k.useState(null),v=k.useMemo(()=>[{name:"matchReferenceWidth",enabled:!0,fn:({state:S,instance:C})=>{if(!p)return;const M=p.offsetWidth,P=S.rects.reference.width;Math.round(M)!==Math.round(P)&&(p.style.width=`${P}px`,C.update())},phase:"beforeWrite",requires:["computeStyles"]}],[p]),y=A8({isOpen:i}),{styles:g,attributes:x,update:_}=Oh(h,p,{modifiers:v}),w=I("autocomplete-dropdown",i&&"open",e);return D8({isOpened:s,setOpenState:o,dropdownEl:p,inputRef:n,onClose:c}),E8({inputRef:n,dropdownEl:p}),k.useEffect(()=>{n.current&&f(n.current)},[n]),k.useEffect(()=>{i&&(_==null||_())},[i,_,y]),b.jsx(b.Fragment,{children:b.jsx(aa,{children:b.jsx("div",{className:"autocomplete-dropdown-container",ref:m,...d,style:g.popper,...x.popper,onTransitionEnd:S=>{S.propertyName==="opacity"&&(y?l==null||l():u==null||u())},children:b.jsxs("div",{className:w,children:[b.jsx("ul",{className:"autocomplete-items-list",role:"listbox",style:{maxHeight:a,display:y?"block":"none"},children:r}),t]})})})})},L8=({className:e,isActive:t,children:n,onSelect:i,value:s,...r})=>{const o=I("autocomplete-item",t&&"active",e),a=k.useRef(null);return k.useEffect(()=>{!t||!a.current||a.current.scrollIntoView({block:"nearest"})},[t]),b.jsx("li",{className:o,onClick:()=>i(s),ref:a,...r,children:n})},R8=({isOpen:e,setOpenState:t,length:n})=>{const[i,s]=k.useState(-1),r=k.useCallback(o=>{const a=o.key==="Tab",l=o.key==="Escape",c=o.key==="ArrowUp",u=o.key==="ArrowDown",d=o.key==="Home",h=o.key==="End",f=o.key==="Enter",p=o.altKey,m=n-1;if(!e)return s(-1);if(l||f||a||p&&c)return t(!1);if(u){o.preventDefault(),s(v=>v===m?m:v+1);return}if(c){o.preventDefault(),s(v=>v===0?0:v-1);return}if(d&&i!==-1){o.preventDefault(),s(0);return}if(h&&i!==-1){o.preventDefault(),s(m);return}},[e,t,n,i]);return k.useEffect(()=>{s(-1)},[n]),k.useEffect(()=>(document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}),[r]),i},N8=Y.forwardRef(({open:e,autoSelect:t,className:n,customContent:i,data:s=[],displayValue:r,value:o,isLoading:a,listHeight:l,noResults:c="No results found",itemContent:u,onSelect:d,onSearch:h,onChange:f,onClose:p,onClosed:m,onOpen:v,onOpened:y,...g},x)=>{const _=k.useRef(null),[w,S]=k.useState(!1),[C,M]=k.useState(!1),P=ef(w,e),[T,A]=k.useState(""),E=k.useMemo(()=>o!==void 0?o:T,[o,T]),z=R8({isOpen:P,setOpenState:S,length:s.length});k.useImperativeHandle(x,()=>_.current);const N=I(P&&"focused","autocomplete-input",n),L=I((P||E)&&"active","autocomplete-label"),R=()=>{S(!0),v==null||v(),_.current&&!_.current.value&&(h==null||h(""))},B=$=>r?r($):$,D=$=>{S(!1),_.current&&(_.current.value=$,h==null||h($),d==null||d($),f==null||f($),p==null||p(),A($))};return b.jsxs(b.Fragment,{children:[b.jsx(wi,{autoComplete:"off",onKeyDown:$=>{const F=$.key==="Enter",V=$.key==="Tab";if(!w)return S(!0);z!==-1&&(F||t&&V)&&D(B(s[z]))},onChange:$=>{h==null||h($.target.value),f==null||f($.target.value),A($.target.value)},onFocus:R,className:N,labelClass:L,ref:_,role:"combobox",value:E,...g,children:a&&b.jsx("div",{className:"autocomplete-loader spinner-border",children:b.jsx("span",{className:"sr-only",children:"Loading..."})})}),b.jsxs(O8,{isOpen:P,isOpened:C,inputRef:_,setOpenState:S,customContent:i,listHeight:l,onClose:p,onOpened:()=>{y==null||y(),M(!0)},onClosed:()=>{m==null||m(),M(!1)},children:[s.length===0&&b.jsx("li",{className:"autocomplete-item autocomplete-no-results",children:c}),s.map(($,F)=>b.jsx(L8,{isActive:z===F,value:B($),onSelect:D,children:u?u($):B($)},F))]})]})});N8.displayName="MDBAutocomplete";const j8=Y.forwardRef(({className:e,icon:t,tag:n="p",children:i,...s},r)=>{const o=I("popconfirm-message",e);return b.jsxs(n,{className:o,ref:r,...s,children:[t&&b.jsx("span",{className:"popconfirm-icon-container",children:t}),b.jsx("span",{className:"popconfirm-message-text",children:i})]})});j8.displayName="MDBPopconfirmMessage";const $8=Y.forwardRef(({className:e,tag:t="div",zoomLevel:n=1,fontAwesome:i="free",children:s,lightboxRef:r,onOpen:o,onClose:a,onSlide:l,onZoomIn:c,onZoomOut:u,disablePortal:d,...h},f)=>{const p=k.useRef(null),m=k.useRef(null),v=r||m,y=k.useRef(null),[g,x]=k.useState(!1),[_,w]=k.useState(0),[S,C]=k.useState(!1),[M,P]=k.useState([]),[T,A]=k.useState(""),[E,z]=k.useState(1),[N,L]=k.useState(!1),[R,B]=k.useState(),[D,$]=k.useState(!1),F=k.useRef(!1),V=k.useRef(!1),W=k.useRef(),et=k.useRef(),Z=k.useRef(),O=k.useRef(),U=k.useRef(),lt=k.useRef(),ct=k.useRef(),kt=I("lightbox",e),it=I(i==="pro"&&"fontawesome-pro"),Lt=I("lightbox-gallery-close-btn",i==="pro"&&"fontawesome-pro"),Ct=I("lightbox-gallery-fullscreen-btn",i==="pro"&&"fontawesome-pro",S&&"active"),Qt=I("lightbox-gallery-zoom-btn",i==="pro"&&"fontawesome-pro",E>1&&"active"),ft=k.useMemo(()=>document.documentElement.dir==="rtl",[]),wt=()=>{F.current=!0,setTimeout(()=>{F.current=!1},400)},dt=k.useCallback(j=>{let Q=j;return Q>M.length-1?Q=0:Q<0&&(Q=M.length-1),M[Q].classList.contains("lightbox-disabled")?dt(Q-1):Q},[M]),jt=k.useCallback(()=>{E>=3||(z(j=>j+n),c==null||c())},[c,E,n]),pt=k.useCallback(()=>{var j;const Q=(j=p.current)==null?void 0:j.querySelector(".lightbox-gallery-item.active");Q!=null&&Q.parentElement&&(Q.parentElement.style.left="0",Q.parentElement.style.top="0",Q.style.transition="all 0.5s ease-out",Q.style.left="0",Q.style.top="0",ls(Q),setTimeout(()=>{Q.style.transition="none"},500))},[]),xt=k.useCallback(()=>{E-n===1&&pt(),!(E<=1)&&(z(j=>j-n),u==null||u())},[u,pt,E,n]),J=k.useCallback(()=>{var j;p.current&&Array.from((j=p.current)==null?void 0:j.querySelectorAll(".lightbox-gallery-item")).forEach(Q=>{ls(Q)})},[]),mt=k.useCallback(()=>{S&&document.exitFullscreen&&document.exitFullscreen(),setTimeout(()=>{document.body.classList.remove("disabled-scroll"),document.body.classList.remove("replace-scrollbar")}),x(!1),z(1),L(!1),J(),a==null||a()},[J,S,a]),q=k.useCallback(j=>{if(F.current||M.length<=1)return _;let Q=0;switch(j){case"left":Q=_-1;break;case"right":Q=_+1;break;case"last":Q=M.length-1;break;case"first":Q=0;break}wt();const It=dt(Q);w(It),z(1),L(!1),setTimeout(()=>{var nt;const Tt=(nt=p.current)==null?void 0:nt.querySelector(".lightbox-gallery-item.active");J(),A(Tt.getAttribute("data-mdb-caption"))},300),l==null||l()},[_,J,M.length,l,dt]),ye=k.useCallback(j=>{if(g)switch(j.nativeEvent.key){case"ArrowRight":q(ft?"left":"right");break;case"ArrowLeft":q(ft?"right":"left");break;case"Escape":mt();break;case"Home":q("first");break;case"End":q("last");break;case"ArrowUp":jt();break;case"ArrowDown":xt();break}},[mt,q,jt,xt,g,ft]),Dt=k.useCallback(j=>{document.body.classList.add("disabled-scroll"),document.documentElement.scrollHeight>document.documentElement.clientHeight&&document.body.classList.add("replace-scrollbar"),x(!0),w(j),L(!1),J(),setTimeout(()=>{var Q;const It=(Q=p.current)==null?void 0:Q.querySelector(".lightbox-gallery-item.active");A(It.getAttribute("data-mdb-caption"))},0),o==null||o()},[J,o]);k.useImperativeHandle(f,()=>({outsideAccess(j){Dt(j)}}));const he=k.useCallback(()=>{(document.webkitIsFullScreen||document.mozFullScreen||document.msFullscreenElement)===void 0&&C(!1)},[]),Un=()=>{var j,Q,It;if(!S){(Q=(j=p.current)==null?void 0:j.requestFullscreen)==null||Q.call(j),C(!0);return}(It=document.exitFullscreen)==null||It.call(document),C(!1)},Yn=j=>{j.nativeEvent.preventDefault();const Q=j.nativeEvent instanceof TouchEvent?j.nativeEvent.touches[0]:j.nativeEvent,It=Q.clientX,nt=Q.clientY;j.nativeEvent instanceof TouchEvent&&j.type==="touchstart"&&j.nativeEvent.touches.length>1&&($(!0),B(j.nativeEvent.touches));const Tt=j.target;Z.current=parseFloat(Tt.style.left),O.current=parseFloat(Tt.style.top),W.current=parseFloat(Tt.style.left),et.current=parseFloat(Tt.style.top),U.current=It*(1/E)-W.current,lt.current=nt*(1/E)-et.current,L(!0)},Mn=j=>{if(j.type==="touchmove"&&j.nativeEvent instanceof TouchEvent&&j.nativeEvent.targetTouches.length>1&&(j.nativeEvent.preventDefault(),as(j)),!N||D)return;const Q=j.nativeEvent instanceof TouchEvent?j.nativeEvent.touches[0]:j.nativeEvent,It=Q.clientX,nt=Q.clientY,Tt=j.target;if(E!==1){W.current=It*(1/E)-U.current,et.current=nt*(1/E)-lt.current,Tt.style.left=`${W.current}px`,Tt.style.top=`${et.current}px`;return}M.length<=1||(W.current=It*(1/E)-U.current,Tt.style.left=`${W.current}px`)},Si=k.useCallback(()=>{if(!(E!==1||M.length<=1||!W.current||D)){if(W.current-(Z.current||0)>0){q(ft?"right":"left");return}q(ft?"left":"right")}},[q,D,ft,M.length,E]),dn=k.useCallback(j=>{D||(j.nativeEvent instanceof TouchEvent&&!j.nativeEvent.touches&&Xn(j),E!==1?xt():jt())},[jt,xt,D,E]),Mi=j=>{if(L(!1),j.nativeEvent instanceof MouseEvent){Si(),L(!1);return}if(D&&j.targetTouches.length===0){$(!1),B(void 0);return}L(!1),Si()},as=j=>{if(!R)return;const Q=Math.hypot(R[1].pageX-R[0].pageX,R[1].pageY-R[0].pageY),It=Math.hypot(j.nativeEvent.touches[1].pageX-j.nativeEvent.touches[0].pageX,j.nativeEvent.touches[1].pageY-j.nativeEvent.touches[0].pageY),nt=Math.abs(Q-It),Tt=j.nativeEvent.view.screen.width;nt<=Tt*.03||(Q<=It?jt():xt(),B(j.nativeEvent.touches))},ls=j=>{j.parentElement&&(j.width>=j.height?(j.style.width="100%",j.style.maxWidth="100%",j.style.height="auto",j.style.top=`${(j.parentElement.offsetHeight-j.height)/2}px`,j.style.left="0"):(j.style.height="100%",j.style.maxHeight="100%",j.style.width="auto",j.style.left=`${(j.parentElement.offsetWidth-j.width)/2}px`,j.style.top="0"),j.width>=j.parentElement.offsetWidth&&(j.style.width=`${j.parentElement.offsetWidth}px`,j.style.height="auto",j.style.left="0",j.style.top=`${(j.parentElement.offsetHeight-j.height)/2}px`),j.height>=j.parentElement.offsetHeight&&(j.style.height=`${j.parentElement.offsetHeight}px`,j.style.width="auto",j.style.top="0",j.style.left=`${(j.parentElement.offsetWidth-j.width)/2}px`),W.current=parseFloat(j.style.left)||0,et.current=parseFloat(j.style.top)||0)},Ci=j=>{const Q=j.getAttribute("data-mdb-img")?j.getAttribute("data-mdb-img"):j.getAttribute("src")?j.getAttribute("src"):"",It=j.getAttribute("alt")?j.getAttribute("alt"):j.getAttribute("data-mdb-caption")?j.getAttribute("data-mdb-caption"):"",nt=j.getAttribute("data-mdb-caption")?j.getAttribute("data-mdb-caption"):j.getAttribute("alt")?j.getAttribute("alt"):"";return{source:Q,alt:It,caption:nt}},Pi=k.useCallback(()=>{const j=[...v.current.querySelectorAll(".lightbox-item")].filter(Q=>!Q.classList.contains("lightbox-disabled"));P(j)},[v]),Ke=k.useCallback(()=>{J()},[J]),Xn=j=>{W.current=window.innerWidth/2-j.nativeEvent.offsetX-50,et.current=window.innerHeight/2-j.nativeEvent.offsetY-50;const Q=j.target;Q.style.left=`${W.current}px`,Q.style.top=`${et.current}px`,Q.style.transition="all 0.5s ease-out",setTimeout(()=>{Q.style.transition="none"},500)},Ti=j=>{if(j.deltaY>0)return xt();E>=3||(Xn(j),jt())};return k.useEffect(()=>{Pi()},[Pi]),k.useEffect(()=>{M.length&&J()},[J,M]),k.useEffect(()=>(M.forEach((j,Q)=>{!j.classList.contains("lightbox-disabled")&&j.addEventListener("click",()=>Dt(Q))}),()=>{M.forEach((j,Q)=>{j.removeEventListener("click",()=>Dt(Q))})}),[Dt,M]),k.useEffect(()=>(window.addEventListener("resize",Ke),window.addEventListener("fullscreenchange",he),()=>{window.removeEventListener("resize",Ke),window.removeEventListener("fullscreenchange",he)}),[he,Ke]),k.useEffect(()=>{const j=document.querySelector("meta[name=viewport]");if(ct.current||(ct.current=(j==null?void 0:j.getAttribute("content"))||""),!g){V.current=!1,j==null||j.setAttribute("content",ct.current);return}setTimeout(()=>{var Q;V.current=!0,(Q=y.current)==null||Q.focus(),j==null||j.setAttribute("content",`${ct.current} user-scalable=no`)},300)},[g]),b.jsxs(b.Fragment,{children:[b.jsx(t,{ref:v,className:kt,...h,children:s}),b.jsx(aa,{disablePortal:d,children:b.jsxs("div",{className:"lightbox-gallery",onClick:j=>j.target.tagName==="DIV"&&mt(),onKeyUp:ye,ref:p,style:{opacity:g?1:0,pointerEvents:g?"initial":"none",visibility:g?"visible":"hidden"},children:[b.jsx("div",{className:"lightbox-gallery-loader"}),b.jsxs("div",{className:"lightbox-gallery-toolbar",children:[b.jsx("div",{className:"lightbox-gallery-left-tools",children:b.jsx("p",{className:"lightbox-gallery-counter",children:`${_+1} / ${M.length}`})}),b.jsxs("div",{className:"lightbox-gallery-right-tools",children:[b.jsx("button",{className:Ct,onClick:Un}),b.jsx("button",{"aria-label":E>1?"Zoom out":"Zoom in",className:Qt,onClick:()=>E>1?xt():jt()}),b.jsx("button",{className:Lt,onClick:mt})]})]}),b.jsx("div",{className:"lightbox-gallery-content",style:{transform:g?"scale(1)":"scale(0.25)",transition:"all 0.5s ease-out"},children:M.map((j,Q)=>{const{source:It,alt:nt,caption:Tt}=Ci(j),Oe=Q===_?1:0,cs=Q===_?E:0,ai=_===M.length-1&&Q===0&&M.length>1,Kn=_===0&&Q===M.length-1&&M.length>1;let Me;return _Q&&!ai||Kn?Me="-100%":Me="0%",b.jsx("div",{className:"lightbox-gallery-image",style:{position:"absolute",opacity:Oe,left:g?Me:"0%",transform:`scale(${cs})`,transition:_===Q||V.current?"all 0.5s ease-out":"none"},children:b.jsx("img",{src:It||"",alt:nt||"","data-mdb-caption":Tt||"",onMouseDown:Yn,onMouseMove:Mn,onMouseUp:Mi,onWheel:Ti,onTouchStart:Yn,onTouchMove:Mn,onTouchEnd:Mi,onDoubleClick:dn,className:`lightbox-gallery-item ${_===Q&&"active"}`})},Q)})}),b.jsx("div",{className:"lightbox-gallery-arrow-left",children:b.jsx("button",{"aria-label":"Previous",className:it,onClick:()=>q("left")})}),b.jsx("div",{className:"lightbox-gallery-arrow-right",children:b.jsx("button",{"aria-label":"Next",className:it,onClick:()=>q("right"),ref:y})}),b.jsx("div",{className:"lightbox-gallery-caption-wrapper",children:b.jsx("p",{className:"lightbox-gallery-caption",children:T})})]})})]})});$8.displayName="MDBLightbox";const I8=Y.forwardRef(({className:e,fullscreenSrc:t,disabled:n,caption:i,...s},r)=>{const o=I("lightbox-item",n&&"lightbox-disabled",e);return b.jsx("img",{ref:r,"data-mdb-caption":i,"data-mdb-img":t,className:o,...s})});I8.displayName="MDBLightboxItem";const F8=Y.forwardRef(({className:e,...t},n)=>{const[i,s]=k.useState(!1),r=k.useCallback(()=>{const a=document.documentElement.scrollTop;s(!!a)},[]),o=I(i&&"navbar-scrolled","navbar-scroll",e);return k.useEffect(()=>{window.addEventListener("scroll",r)},[r]),b.jsx(pT,{className:o,ref:n,...t})});F8.displayName="MDBAnimatedNavbar";const RT=k.forwardRef(({className:e,closeIcon:t,tag:n="div",color:i,size:s,children:r,onDelete:o,...a},l)=>{const[c,u]=k.useState(!0),d=I("chip",s&&`chip-${s}`,i&&`chip-outline btn-outline-${i}`,e);return c?b.jsxs(n,{ref:l,className:d,...a,children:[r,t&&b.jsx("i",{className:"close fas fa-times",onClick:()=>{o==null||o(r),u(!1)}})]}):null});RT.displayName="MDBChip";const B8=Y.forwardRef(({className:e,value:t="",id:n,labelId:i,labelClass:s,label:r,onChange:o,labelRef:a,labelStyle:l,readonly:c,editable:u,onAdd:d,onDelete:h,initialValues:f=[],...p},m)=>{const v=k.useRef(null),y=a??v,g=k.useRef(null);k.useImperativeHandle(m,()=>g.current);const[x,_]=k.useState(f),[w,S]=k.useState(null),[C,M]=k.useState(0),[P,T]=k.useState(null),[A,E]=k.useState(t),z=x.length>0||A.length>0,N=I("form-outline","chips-input-wrapper",x.length>0&&"chips-padding chips-transition"),L=I("form-control",z&&"active",e),R=I("form-label",s);k.useEffect(()=>{!y.current||y.current.clientWidth===0||M(y.current.clientWidth*.8+8)},[y]);const B=()=>{y.current&&M(y.current.clientWidth*.8+8)},D=O=>{E(O.target.value),o==null||o(O)},$=O=>{A.length||((O.key==="ArrowLeft"||O.key==="ArrowDown")&&T(U=>U?U-1:x.length-1),(O.key==="ArrowRight"||O.key==="ArrowUp")&&T(U=>U===x.length-1||U===null?0:U+1),O.key==="Backspace"&&P!==null&&F(P)),O.key==="Enter"&&A.trim().length&&(d==null||d(A),_([...x,{tag:A}]),E(""))},F=O=>{const U=x.find((lt,ct)=>O===ct);if(U){h==null||h(U==null?void 0:U.tag);const lt=x.filter((ct,kt)=>O!==kt);_(lt),T(null)}},V=(O,U)=>{u&&S(U)},W=(O,U)=>{if(!u)return;const lt=O.currentTarget.textContent,ct=x.map((kt,it)=>it===U&<?{tag:lt}:kt);lt?_(ct):F(U),S(null),T(null)},et=(O,U)=>{O.key==="Enter"&&u&&w!==null&&W(O,U)},Z=()=>{A.trim().length&&(d==null||d(A),_([...x,{tag:A}]),E(""))};return b.jsx("div",{className:"chips chips-placeholder",children:b.jsxs("div",{className:N,children:[x.map((O,U)=>b.jsx(RT,{contentEditable:w===U,suppressContentEditableWarning:!0,onDoubleClick:lt=>V(lt,U),onDelete:()=>F(U),onKeyDown:lt=>et(lt,U),closeIcon:w!==U,className:I("btn",U===P&&"active"),children:O.tag},`${Math.random()}-${U}`)),b.jsx("input",{type:"text",readOnly:c,className:L,onChange:D,onFocus:B,onKeyDown:$,onBlur:()=>Z(),value:A,id:n,ref:g,...p}),r&&b.jsx("label",{className:R,style:l,id:i,htmlFor:n,ref:y,children:r}),b.jsxs("div",{className:"form-notch",children:[b.jsx("div",{className:"form-notch-leading"}),b.jsx("div",{className:"form-notch-middle",style:{width:C}}),b.jsx("div",{className:"form-notch-trailing"})]})]})})});B8.displayName="MDBChipsInput";function V8(){const[e,t]=k.useState(""),[n,i]=k.useState(""),[s,r]=k.useState(""),[o,a]=k.useState(null),[l,c]=k.useState(!1),[u,d]=k.useState([]),[h,f]=k.useState(!1),[p,m]=k.useState(null),[v,y]=k.useState(null),g=k.useRef(null);k.useEffect(()=>{if(l&&o&&o.plot_data&&g&&g.current){const M=g.current.getContext("2d");M&&new by(M,{type:"line",data:{labels:o.plot_data.n,datasets:[{label:"n^log_b(a)",data:o.plot_data.n_log_b_a,borderColor:"blue",borderWidth:1,fill:!1},{label:"f(n)",data:o.plot_data.f_n,borderColor:"red",borderWidth:2,fill:!1,borderDash:[5,5]},{label:"Time Complexity",data:o.plot_data.time_complexity,borderColor:"green",borderWidth:2,fill:!1,borderDash:[10,5]}]},options:{scales:{y:{beginAtZero:!0,title:{display:!0,text:"Function Value",color:"#888",font:{size:12}},ticks:{}},x:{grid:{display:!0},ticks:{callback:function(P){return Number(P).toFixed(0)}},title:{display:!0,text:"Input Size (n)",color:"#888",font:{size:12}}}},plugins:{legend:{display:!0,position:"top",labels:{boxWidth:20,padding:10}},tooltip:{enabled:!0}},elements:{line:{borderWidth:1},point:{radius:0}},responsive:!0,maintainAspectRatio:!1}})}},[l,o]),k.useEffect(()=>{(async()=>{try{const P=await fetch("http://master-theorem-aws-test2-dev.us-west-2.elasticbeanstalk.com/api/algorithms");if(!P.ok)throw new Error("Network response was not ok");const T=await P.json();d(T)}catch(P){console.error("Failed to fetch algorithms:",P)}})()},[]);const x=M=>{if(M===-1)f(!1),t(""),i(""),r(""),y(null);else{const P=u.find(T=>T.id===M);P&&(t(P.a.toString()),i(P.b.toString()),r(P.k.toString()),f(!0),y(P))}},_=async M=>{M.preventDefault(),await w(M)},w=async M=>{M.preventDefault(),c(!1),m(v);try{const P=await fetch("http://master-theorem-aws-test2-dev.us-west-2.elasticbeanstalk.com/api/evaluate/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({a:e,b:n,k:s})});if(!P.ok)throw new Error("Network response was not ok");const T=await P.json();a(T),c(!0)}catch(P){console.error("There was a problem with your fetch operation:",P)}},S=M=>{var P;if(Array.isArray(M))console.log("Multiple selections are not supported.");else{const T=parseInt(((P=M.value)==null?void 0:P.toString())||"-1",10);x(T)}},C=[{text:"User Input",value:"-1"},...u.map(M=>({text:M.name,value:M.id.toString()}))];return b.jsxs(b.Fragment,{children:[b.jsxs(rd,{alignment:"center",children:[b.jsx(od,{children:b.jsx("h1",{className:"main-header",children:"Evaluate Master Theorem"})}),b.jsxs(eg,{children:[b.jsx(fT,{children:b.jsx("span",{className:"card-title",children:"Enter the values of a, b, and k to evaluate the Master Theorem:"})}),b.jsxs("form",{onSubmit:_,children:[b.jsx(wi,{label:"a (number of subproblems)",id:"aInput",type:"number",min:"1",className:"my-4",value:e,onChange:M=>t(M.target.value),disabled:h}),b.jsx(wi,{label:"b (factor by which problem size is reduced)",id:"bInput",type:"number",min:"2",className:"my-4",value:n,onChange:M=>i(M.target.value),disabled:h}),b.jsx(wi,{label:"k (exponent in the work outside of recursive calls)",id:"kInput",type:"number",min:"0",className:"my-4",value:s,onChange:M=>r(M.target.value),disabled:h}),b.jsx("div",{className:"my-4",children:b.jsx(D0,{data:C,label:"Choose Algorithm or Enter Values",onChange:S})}),b.jsx(Zt,{onClick:w,className:"btn-block",children:"Evaluate"})]})]})]}),l&&o&&b.jsxs(rd,{className:"my-4",children:[b.jsx(od,{children:b.jsx("h2",{children:"Evaluation"})}),b.jsxs(eg,{className:"evaluation-card-body",children:[b.jsx("canvas",{ref:g,id:"myChart",className:"mb-3"}),b.jsxs(ad,{children:[b.jsx("strong",{children:"Recurrence Relation: "}),b.jsx("span",{dangerouslySetInnerHTML:{__html:o.recurrence_relation}})]}),b.jsxs(ad,{children:[b.jsx("strong",{children:"Evaluation: "}),b.jsx("span",{dangerouslySetInnerHTML:{__html:o.case}})]}),b.jsxs(ad,{children:[b.jsx("strong",{children:"Time Complexity: "}),b.jsx("span",{dangerouslySetInnerHTML:{__html:o.complexity}})]})]}),p&&b.jsxs(b.Fragment,{children:[b.jsxs("h4",{children:[p.name," Algorithm"]}),b.jsxs(ng,{alwaysOpen:!0,initialActive:1,children:[b.jsx(oo,{className:"left-align",collapseId:1,headerTitle:b.jsxs(b.Fragment,{children:[b.jsx(sn,{fas:!0,icon:"question-circle"}),"   Algorithm Description"]}),children:b.jsx("article",{children:p.description})}),b.jsx(oo,{collapseId:2,headerTitle:b.jsxs(b.Fragment,{children:[b.jsx(sn,{fab:!0,icon:"python"}),"   Python Code"]}),children:b.jsx("pre",{className:"left-align",children:b.jsx("code",{children:p.python_code})})})]})]})]}),b.jsxs(rd,{alignment:"center",className:"my-4",children:[b.jsx(od,{children:b.jsx("h2",{children:"About the Master Theorem"})}),b.jsxs(ng,{initialActive:1,children:[b.jsx(oo,{className:"left-align",collapseId:1,headerTitle:"What is the Master Theorem?",children:b.jsxs("article",{children:[b.jsxs("p",{children:["The ",b.jsx("strong",{children:"Master Theorem"})," offers a straightforward way to determine the time complexity of recursive algorithms, especially those that follow the divide and conquer approach. This theorem simplifies the process of analyzing how efficiently an algorithm runs as the size of its input increases. It is particularly useful for computer scientists and software engineers to predict algorithm performance without the need for detailed benchmarks."]}),b.jsx("p",{children:"The following parameters are required to evaluate an algorithm using the Master Theorem:"}),b.jsxs("ul",{children:[b.jsxs("li",{children:[b.jsx("strong",{children:"a"})," = the number of recursive subproblems."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"b"})," = the factor by which the problem size is reduced."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"k"})," = the exponent in the work done outside of the recursive function."]})]})]})}),b.jsx(oo,{className:"left-align",collapseId:2,headerTitle:"Decoding the Master Recurrence",children:b.jsxs("article",{children:[b.jsx("p",{children:"The Master Theorem can only be used to evaluate recursive algorithms with the following recurrence relation:"}),b.jsx("p",{className:"text-center",children:b.jsx("strong",{children:"T(n) = aT(n/b) + f(n)"})}),b.jsxs("p",{children:["This equation is the heart of the Master Theorem. and is called the ",b.jsx("strong",{children:"Master Recurrence"}),". It captures the essence of divide and conquer algorithms:"]}),b.jsxs("ul",{children:[b.jsxs("li",{children:[b.jsx("strong",{children:"T(n)"})," is the total time complexity we aim to find."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"aT(n/b)"})," represents the time taken by the recursive subproblems."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"f(n)"})," is the time taken by the work done outside the recursive calls, such as dividing the problem or combining the results."]})]}),b.jsx("p",{children:"Evaluating the Master Theorem involves comparing the rate of growth of two separate functions:"}),b.jsxs("ul",{children:[b.jsx("p",{className:"text-center",children:b.jsxs("strong",{children:["n",b.jsx("sup",{children:"logb(a)"})," + f(n)"]})}),b.jsxs("li",{children:[b.jsxs("strong",{children:["n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})]})," ","is also known as the ",b.jsx("strong",{children:"watershed function."})]}),b.jsxs("li",{children:[b.jsx("strong",{children:"f(n)"})," is also known as the"," ",b.jsx("strong",{children:"driving function."})]})]}),b.jsx("p",{children:"Comparing the growth rate of these 2 functions results in either of 3 possible cases."})]})}),b.jsx(oo,{className:"left-align",collapseId:3,headerTitle:"The 3 Cases of the Master Theorem",children:b.jsxs("article",{children:[b.jsxs("p",{children:[b.jsx("strong",{children:"Case 1"}),": n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})," ","grows asymptotically and polynomially greater than f(n):"]}),b.jsx("p",{className:"text-center",children:b.jsxs("strong",{children:["T(n) = n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})]})}),b.jsxs("p",{children:[b.jsx("strong",{children:"Case 2:"})," n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})," ","and f(n) grow at the same rate:"]}),b.jsx("p",{className:"text-center",children:b.jsxs("strong",{children:["T(n) = n",b.jsx("sup",{children:"k"})," log(n)"]})}),b.jsxs("p",{children:[b.jsx("strong",{children:"Case 3:"})," f(n) grows assymptotically and polynomially greater than n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]})," ","(and also fulfills the regularity condition",b.jsx("sup",{children:"*"}),") :"]}),b.jsx("p",{className:"text-center",children:b.jsxs("strong",{children:["T(n) = f(n",b.jsx("sup",{children:"k"}),")"]})}),b.jsxs("ul",{children:[b.jsxs("li",{children:[b.jsx("strong",{children:"Case 1"})," occurs when the split subproblems dominate the overall time complexity. It implies that as we break the problem down, the sheer number of subproblems is the primary driver of the complexity."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"Case 2"})," occurs when the work done at each level of recursion is just as significant as the number of subproblems. This balance means the time complexity is a combination of the dividing/conquering work and the depth of the recursion."]}),b.jsxs("li",{children:[b.jsx("strong",{children:"Case 3"})," highlights scenarios where the work done outside the recursive calls (combining solutions, for instance) is the main factor determining the time complexity. This is typically seen in algorithms where merging or processing results is more intensive than breaking down the problem."]})]}),b.jsx("p",{children:b.jsxs("small",{children:[b.jsx("strong",{children:"*"})," Please note that this app evaluates n",b.jsxs("sup",{children:["log",b.jsx("sub",{children:"b"}),"(a)"]}),"and f(n",b.jsx("sup",{children:"k"}),") using their exponents and does not assess the regularity condition in Case 3, or whether the difference in growth between these two functions is polynomial. The regularity condition ensures that the work done at the recursive levels does not grow too quickly compared to the work done to divide the problem and combine the results. This condition helps maintain the integrity of the complexity analysis provided by the theorem."]})})]})})]})]})]})}Sp.createRoot(document.getElementById("root")).render(b.jsx(Y.StrictMode,{children:b.jsx(V8,{})})); diff --git a/staticfiles/index.html b/staticfiles/index.html index 1a6739a..efeeec2 100644 --- a/staticfiles/index.html +++ b/staticfiles/index.html @@ -7,7 +7,7 @@ Evaluate Master Theorem - +