anarock-widgets 1.0.79 → 1.0.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -343,4 +343,4 @@ Take a look at the reducer(s) handling this action type: ${h.type}.
343
343
  * Released under the MIT License
344
344
  */class MJ{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,i){const o=n.listeners[i],a=n.duration;o.forEach(s=>s({chart:t,initial:n.initial,numSteps:a,currentStep:Math.min(r-n.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=Ok.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const o=r.items;let a=o.length-1,s=!1,l;for(;a>=0;--a)l=o[a],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),s=!0):(o[a]=o[o.length-1],o.pop());s&&(i.draw(),this._notify(i,r,t,"progress")),o.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,i)=>Math.max(r,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Ur=new MJ;const SS="transparent",jJ={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=fS(e||SS),i=r.valid&&fS(t||SS);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class NJ{constructor(t,n,r,i){const o=n[r];i=Ic([t.to,i,o,t.from]);const a=Ic([t.from,o,i]);this._active=!0,this._fn=t.fn||jJ[t.type||typeof a],this._easing=zs[t.easing]||zs.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=a,this._to=i,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],o=r-this._start,a=this._duration-o;this._start=r,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Ic([t.to,n,i,t.from]),this._from=Ic([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,i=this._prop,o=this._from,a=this._loop,s=this._to;let l;if(this._active=o!==s&&(a||n<r),!this._active){this._target[i]=s,this._notify(!0);return}if(n<0){this._target[i]=o;return}l=n/r%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(o,s,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let i=0;i<r.length;i++)r[i][n]()}}class Ik{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Ae(t))return;const n=Object.keys(Ct.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const o=t[i];if(!Ae(o))return;const a={};for(const s of n)a[s]=o[s];(Wt(o.properties)&&o.properties||[i]).forEach(s=>{(s===i||!r.has(s))&&r.set(s,a)})})}_animateOptions(t,n){const r=n.options,i=DJ(t,r);if(!i)return[];const o=this._createAnimations(i,r);return r.$shared&&RJ(t.options.$animations,r).then(()=>{t.options=r},()=>{}),o}_createAnimations(t,n){const r=this._properties,i=[],o=t.$animations||(t.$animations={}),a=Object.keys(n),s=Date.now();let l;for(l=a.length-1;l>=0;--l){const c=a[l];if(c.charAt(0)==="$")continue;if(c==="options"){i.push(...this._animateOptions(t,n));continue}const u=n[c];let d=o[c];const p=r.get(c);if(d)if(p&&d.active()){d.update(p,u,s);continue}else d.cancel();if(!p||!p.duration){t[c]=u;continue}o[c]=d=new NJ(p,t,c,u),i.push(d)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return Ur.add(this._chart,r),!0}}function RJ(e,t){const n=[],r=Object.keys(t);for(let i=0;i<r.length;i++){const o=e[r[i]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function DJ(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function ES(e,t){const n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,o=n.max===void 0?t:0;return{start:r?o:i,end:r?i:o}}function IJ(e,t,n){if(n===!1)return!1;const r=ES(e,n),i=ES(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function $J(e){let t,n,r,i;return Ae(e)?(t=e.top,n=e.right,r=e.bottom,i=e.left):t=n=r=i=e,{top:t,right:n,bottom:r,left:i,disabled:e===!1}}function $k(e,t){const n=[],r=e._getSortedDatasetMetas(t);let i,o;for(i=0,o=r.length;i<o;++i)n.push(r[i].index);return n}function _S(e,t,n,r={}){const i=e.keys,o=r.mode==="single";let a,s,l,c;if(t===null)return;let u=!1;for(a=0,s=i.length;a<s;++a){if(l=+i[a],l===n){if(u=!0,r.all)continue;break}c=e.values[l],sr(c)&&(o||t===0||Mr(t)===Mr(c))&&(t+=c)}return!u&&!r.all?0:t}function LJ(e,t){const{iScale:n,vScale:r}=t,i=n.axis==="x"?"x":"y",o=r.axis==="x"?"x":"y",a=Object.keys(e),s=new Array(a.length);let l,c,u;for(l=0,c=a.length;l<c;++l)u=a[l],s[l]={[i]:u,[o]:e[u]};return s}function jh(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function FJ(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function BJ(e){const{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function zJ(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function PS(e,t,n,r){for(const i of t.getMatchingVisibleMetas(r).reverse()){const o=e[i.index];if(n&&o>0||!n&&o<0)return i.index}return null}function CS(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:o,vScale:a,index:s}=r,l=o.axis,c=a.axis,u=FJ(o,a,r),d=t.length;let p;for(let h=0;h<d;++h){const g=t[h],{[l]:m,[c]:v}=g,y=g._stacks||(g._stacks={});p=y[c]=zJ(i,u,m),p[s]=v,p._top=PS(p,a,!0,r.type),p._bottom=PS(p,a,!1,r.type);const S=p._visualValues||(p._visualValues={});S[s]=v}}function Nh(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function VJ(e,t){return Uo(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function WJ(e,t,n){return Uo(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function hs(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const i of t){const o=i._stacks;if(!o||o[r]===void 0||o[r][n]===void 0)return;delete o[r][n],o[r]._visualValues!==void 0&&o[r]._visualValues[n]!==void 0&&delete o[r]._visualValues[n]}}}const Rh=e=>e==="reset"||e==="none",TS=(e,t)=>t?e:Object.assign({},e),UJ=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:$k(n,!0),values:null};class Cf{static defaults={};static datasetElementType=null;static dataElementType=null;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=jh(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&&hs(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(d,p,h,g)=>d==="x"?p:d==="r"?g:h,o=n.xAxisID=Oe(r.xAxisID,Nh(t,"x")),a=n.yAxisID=Oe(r.yAxisID,Nh(t,"y")),s=n.rAxisID=Oe(r.rAxisID,Nh(t,"r")),l=n.indexAxis,c=n.iAxisID=i(l,o,a,s),u=n.vAxisID=i(l,a,o,s);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(a),n.rScale=this.getScaleForId(s),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&&cS(this._data,this),t._stacked&&hs(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Ae(n)){const i=this._cachedMeta;this._data=LJ(n,i)}else if(r!==n){if(r){cS(r,this);const i=this._cachedMeta;hs(i),i._parsed=[]}n&&Object.isExtensible(n)&&SZ(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let i=!1;this._dataCheck();const o=n._stacked;n._stacked=jh(n.vScale,n),n.stack!==r.stack&&(i=!0,hs(n),n.stack=r.stack),this._resyncElements(t),(i||o!==n._stacked)&&(CS(this,n._parsed),n._stacked=jh(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:i}=this,{iScale:o,_stacked:a}=r,s=o.axis;let l=t===0&&n===i.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,d,p;if(this._parsing===!1)r._parsed=i,r._sorted=!0,p=i;else{Wt(i[t])?p=this.parseArrayData(r,i,t,n):Ae(i[t])?p=this.parseObjectData(r,i,t,n):p=this.parsePrimitiveData(r,i,t,n);const h=()=>d[s]===null||c&&d[s]<c[s];for(u=0;u<n;++u)r._parsed[u+t]=d=p[u],l&&(h()&&(l=!1),c=d);r._sorted=l}a&&CS(this,p)}parsePrimitiveData(t,n,r,i){const{iScale:o,vScale:a}=t,s=o.axis,l=a.axis,c=o.getLabels(),u=o===a,d=new Array(i);let p,h,g;for(p=0,h=i;p<h;++p)g=p+r,d[p]={[s]:u||o.parse(c[g],g),[l]:a.parse(n[g],g)};return d}parseArrayData(t,n,r,i){const{xScale:o,yScale:a}=t,s=new Array(i);let l,c,u,d;for(l=0,c=i;l<c;++l)u=l+r,d=n[u],s[l]={x:o.parse(d[0],u),y:a.parse(d[1],u)};return s}parseObjectData(t,n,r,i){const{xScale:o,yScale:a}=t,{xAxisKey:s="x",yAxisKey:l="y"}=this._parsing,c=new Array(i);let u,d,p,h;for(u=0,d=i;u<d;++u)p=u+r,h=n[p],c[u]={x:o.parse(Do(h,s),p),y:a.parse(Do(h,l),p)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const i=this.chart,o=this._cachedMeta,a=n[t.axis],s={keys:$k(i,!0),values:n._stacks[t.axis]._visualValues};return _S(s,a,o.index,{mode:r})}updateRangeFromParsed(t,n,r,i){const o=r[n.axis];let a=o===null?NaN:o;const s=i&&r._stacks[n.axis];i&&s&&(i.values=s,a=_S(i,o,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,n){const r=this._cachedMeta,i=r._parsed,o=r._sorted&&t===r.iScale,a=i.length,s=this._getOtherScale(t),l=UJ(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=BJ(s);let p,h;function g(){h=i[p];const m=h[s.axis];return!sr(h[t.axis])||u>m||d<m}for(p=0;p<a&&!(!g()&&(this.updateRangeFromParsed(c,t,h,l),o));++p);if(o){for(p=a-1;p>=0;--p)if(!g()){this.updateRangeFromParsed(c,t,h,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let i,o,a;for(i=0,o=n.length;i<o;++i)a=n[i][t.axis],sr(a)&&r.push(a);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,i=n.vScale,o=this.getParsed(t);return{label:r?""+r.getLabelForValue(o[r.axis]):"",value:i?""+i.getLabelForValue(o[i.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=$J(Oe(this.options.clip,IJ(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,i=r.data||[],o=n.chartArea,a=[],s=this._drawStart||0,l=this._drawCount||i.length-s,c=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,o,s,l),u=s;u<s+l;++u){const d=i[u];d.hidden||(d.active&&c?a.push(d):d.draw(t,o))}for(u=0;u<a.length;++u)a[u].draw(t,o)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const i=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];o=a.$context||(a.$context=WJ(this.getContext(),t,a)),o.parsed=this.getParsed(t),o.raw=i.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=VJ(this.chart.getContext(),this.index)),o.dataset=i,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=r,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const i=n==="active",o=this._cachedDataOpts,a=t+"-"+n,s=o[a],l=this.enableOptionSharing&&hl(r);if(s)return TS(s,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=i?[`${t}Hover`,"hover",t,""]:[t,""],p=c.getOptionScopes(this.getDataset(),u),h=Object.keys(Ct.elements[t]),g=()=>this.getContext(r,i,n),m=c.resolveNamedOptions(p,h,g,d);return m.$shared&&(m.$shared=l,o[a]=Object.freeze(TS(m,l))),m}_resolveAnimations(t,n,r){const i=this.chart,o=this._cachedDataOpts,a=`animation-${n}`,s=o[a];if(s)return s;let l;if(i.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),p=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(p,this.getContext(t,r,n))}const c=new Ik(i,l&&l.animations);return l&&l._cacheable&&(o[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Rh(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),i=this._sharedOptions,o=this.getSharedOptions(r),a=this.includeOptions(n,o)||o!==i;return this.updateSharedOptions(o,n,r),{sharedOptions:o,includeOptions:a}}updateElement(t,n,r,i){Rh(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!Rh(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,i){t.active=i;const o=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(t,{options:!i&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[s,l,c]of this._syncList)this[s](l,c);this._syncList=[];const i=r.length,o=n.length,a=Math.min(o,i);a&&this.parse(0,a),o>i?this._insertElements(i,o-i,t):o<i&&this._removeElements(o,i-o)}_insertElements(t,n,r=!0){const i=this._cachedMeta,o=i.data,a=t+n;let s;const l=c=>{for(c.length+=n,s=c.length-1;s>=a;s--)c[s]=c[s-n]};for(l(o),s=t;s<a;++s)o[s]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,n),r&&this.updateElements(o,t,n,"reset")}updateElements(t,n,r,i){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const i=r._parsed.splice(t,n);r._stacked&&hs(r,i)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,i]=t;this[n](r,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function HJ(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let i=0,o=n.length;i<o;i++)r=r.concat(n[i].controller.getAllParsedValues(e));e._cache.$bar=wk(r.sort((i,o)=>i-o))}return e._cache.$bar}function qJ(e){const t=e.iScale,n=HJ(t,e.type);let r=t._length,i,o,a,s;const l=()=>{a===32767||a===-32768||(hl(s)&&(r=Math.min(r,Math.abs(a-s)||r)),s=a)};for(i=0,o=n.length;i<o;++i)a=t.getPixelForValue(n[i]),l();for(s=void 0,i=0,o=t.ticks.length;i<o;++i)a=t.getPixelForTick(i),l();return r}function KJ(e,t,n,r){const i=n.barThickness;let o,a;return ze(i)?(o=t.min*n.categoryPercentage,a=n.barPercentage):(o=i*r,a=1),{chunk:o/r,ratio:a,start:t.pixels[e]-o/2}}function YJ(e,t,n,r){const i=t.pixels,o=i[e];let a=e>0?i[e-1]:null,s=e<i.length-1?i[e+1]:null;const l=n.categoryPercentage;a===null&&(a=o-(s===null?t.end-t.start:s-o)),s===null&&(s=o+o-a);const c=o-(o-Math.min(a,s))/2*l;return{chunk:Math.abs(s-a)/2*l/r,ratio:n.barPercentage,start:c}}function GJ(e,t,n,r){const i=n.parse(e[0],r),o=n.parse(e[1],r),a=Math.min(i,o),s=Math.max(i,o);let l=a,c=s;Math.abs(a)>Math.abs(s)&&(l=s,c=a),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:i,end:o,min:a,max:s}}function Lk(e,t,n,r){return Wt(e)?GJ(e,t,n,r):t[n.axis]=n.parse(e,r),t}function AS(e,t,n,r){const i=e.iScale,o=e.vScale,a=i.getLabels(),s=i===o,l=[];let c,u,d,p;for(c=n,u=n+r;c<u;++c)p=t[c],d={},d[i.axis]=s||i.parse(a[c],c),l.push(Lk(p,d,o,c));return l}function Dh(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function XJ(e,t,n){return e!==0?Mr(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function ZJ(e){let t,n,r,i,o;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(i="end",o="start"):(i="start",o="end"),{start:n,end:r,reverse:t,top:i,bottom:o}}function JJ(e,t,n,r){let i=t.borderSkipped;const o={};if(!i){e.borderSkipped=o;return}if(i===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:s,reverse:l,top:c,bottom:u}=ZJ(e);i==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?i=c:(n._bottom||0)===r?i=u:(o[kS(u,a,s,l)]=!0,i=c)),o[kS(i,a,s,l)]=!0,e.borderSkipped=o}function kS(e,t,n,r){return r?(e=QJ(e,t,n),e=MS(e,n,t)):e=MS(e,t,n),e}function QJ(e,t,n){return e===t?n:e===n?t:e}function MS(e,t,n){return e==="start"?t:e==="end"?n:e}function eQ(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class tQ extends Cf{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,n,r,i){return AS(t,n,r,i)}parseArrayData(t,n,r,i){return AS(t,n,r,i)}parseObjectData(t,n,r,i){const{iScale:o,vScale:a}=t,{xAxisKey:s="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?s:l,u=a.axis==="x"?s:l,d=[];let p,h,g,m;for(p=r,h=r+i;p<h;++p)m=n[p],g={},g[o.axis]=o.parse(Do(m,c),p),d.push(Lk(Do(m,u),g,a,p));return d}updateRangeFromParsed(t,n,r,i){super.updateRangeFromParsed(t,n,r,i);const o=r._custom;o&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:i}=n,o=this.getParsed(t),a=o._custom,s=Dh(a)?"["+a.start+", "+a.end+"]":""+i.getLabelForValue(o[i.axis]);return{label:""+r.getLabelForValue(o[r.axis]),value:s}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,i){const o=i==="reset",{index:a,_cachedMeta:{vScale:s}}=this,l=s.getBasePixel(),c=s.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:p}=this._getSharedOptions(n,i);for(let h=n;h<n+r;h++){const g=this.getParsed(h),m=o||ze(g[s.axis])?{base:l,head:l}:this._calculateBarValuePixels(h),v=this._calculateBarIndexPixels(h,u),y=(g._stacks||{})[s.axis],S={horizontal:c,base:m.base,enableBorderRadius:!y||Dh(g._custom)||a===y._top||a===y._bottom,x:c?m.head:v.center,y:c?v.center:m.head,height:c?v.size:Math.abs(m.size),width:c?Math.abs(m.size):v.size};p&&(S.options=d||this.resolveDataElementOptions(h,t[h].active?"active":i));const x=S.options||t[h].options;JJ(S,x,y,a),eQ(S,x,u.ratio),this.updateElement(t[h],h,S,i)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,i=r.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),o=r.options.stacked,a=[],s=this._cachedMeta.controller.getParsed(n),l=s&&s[r.axis],c=u=>{const d=u._parsed.find(h=>h[r.axis]===l),p=d&&d[u.vScale.axis];if(ze(p)||isNaN(p))return!0};for(const u of i)if(!(n!==void 0&&c(u))&&((o===!1||a.indexOf(u.stack)===-1||o===void 0&&u.stack===void 0)&&a.push(u.stack),u.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(t).filter(r=>t[r].axis===n).shift()}_getAxis(){const t={},n=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)t[Oe(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,r){const i=this._getStacks(t,r),o=n!==void 0?i.indexOf(n):-1;return o===-1?i.length-1:o}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,i=[];let o,a;for(o=0,a=n.data.length;o<a;++o)i.push(r.getPixelForValue(this.getParsed(o)[r.axis],o));const s=t.barThickness;return{min:s||qJ(n),pixels:i,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:s?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:i},options:{base:o,minBarLength:a}}=this,s=o||0,l=this.getParsed(t),c=l._custom,u=Dh(c);let d=l[n.axis],p=0,h=r?this.applyStack(n,l,r):d,g,m;h!==d&&(p=h-d,h=d),u&&(d=c.barStart,h=c.barEnd-c.barStart,d!==0&&Mr(d)!==Mr(c.barEnd)&&(p=0),p+=d);const v=!ze(o)&&!u?o:p;let y=n.getPixelForValue(v);if(this.chart.getDataVisibility(t)?g=n.getPixelForValue(p+h):g=y,m=g-y,Math.abs(m)<a){m=XJ(m,n,s)*a,d===s&&(y-=m/2);const S=n.getPixelForDecimal(0),x=n.getPixelForDecimal(1),b=Math.min(S,x),O=Math.max(S,x);y=Math.max(Math.min(y,O),b),g=y+m,r&&!u&&(l._stacks[n.axis]._visualValues[i]=n.getValueForPixel(g)-n.getValueForPixel(y))}if(y===n.getPixelForValue(s)){const S=Mr(m)*n.getLineWidthForValue(s)/2;y+=S,m-=S}return{size:m,base:y,head:g,center:g+m/2}}_calculateBarIndexPixels(t,n){const r=n.scale,i=this.options,o=i.skipNull,a=Oe(i.maxBarThickness,1/0);let s,l;const c=this._getAxisCount();if(n.grouped){const u=o?this._getStackCount(t):n.stackCount,d=i.barThickness==="flex"?YJ(t,n,i,u*c):KJ(t,n,i,u*c),p=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,h=this._getAxis().indexOf(Oe(p,this.getFirstScaleIdForIndexAxis())),g=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+h;s=d.start+d.chunk*g+d.chunk/2,l=Math.min(a,d.chunk*d.ratio)}else s=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(a,n.min*n.ratio);return{base:s-l/2,head:s+l/2,center:s,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,i=r.length;let o=0;for(;o<i;++o)this.getParsed(o)[n.axis]!==null&&!r[o].hidden&&r[o].draw(this._ctx)}}function nQ(e,t,n){let r=1,i=1,o=0,a=0;if(t<Ot){const s=e,l=s+t,c=Math.cos(s),u=Math.sin(s),d=Math.cos(l),p=Math.sin(l),h=(x,b,O)=>gl(x,s,l,!0)?1:Math.max(b,b*n,O,O*n),g=(x,b,O)=>gl(x,s,l,!0)?-1:Math.min(b,b*n,O,O*n),m=h(0,c,d),v=h(It,u,p),y=g(tt,c,d),S=g(tt+It,u,p);r=(m-y)/2,i=(v-S)/2,o=-(m+y)/2,a=-(v+S)/2}return{ratioX:r,ratioY:i,offsetX:o,offsetY:a}}class rQ extends Cf{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:i}}=t.legend.options;return n.labels.map((o,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}};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 r=this.getDataset().data,i=this._cachedMeta;if(this._parsing===!1)i._parsed=r;else{let o=l=>+r[l];if(Ae(r[t])){const{key:l="value"}=this._parsing;o=c=>+Do(r[c],l)}let a,s;for(a=t,s=t+n;a<s;++a)i._parsed[a]=o(a)}}_getRotation(){return Jr(this.options.rotation-90)}_getCircumference(){return Jr(this.options.circumference)}_getRotationExtents(){let t=Ot,n=-Ot;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const i=this.chart.getDatasetMeta(r).controller,o=i._getRotation(),a=i._getCircumference();t=Math.min(t,o),n=Math.max(n,o+a)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,i=this._cachedMeta,o=i.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,s=Math.max((Math.min(r.width,r.height)-a)/2,0),l=Math.min(aZ(this.options.cutout,s),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:p,ratioY:h,offsetX:g,offsetY:m}=nQ(d,u,l),v=(r.width-a)/p,y=(r.height-a)/h,S=Math.max(Math.min(v,y)/2,0),x=gk(this.options.radius,S),b=Math.max(x*l,0),O=(x-b)/this._getVisibleDatasetWeightTotal();this.offsetX=g*x,this.offsetY=m*x,i.total=this.calculateTotal(),this.outerRadius=x-O*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-O*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,n){const r=this.options,i=this._cachedMeta,o=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||i._parsed[t]===null||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*o/Ot)}updateElements(t,n,r,i){const o=i==="reset",a=this.chart,s=a.chartArea,c=a.options.animation,u=(s.left+s.right)/2,d=(s.top+s.bottom)/2,p=o&&c.animateScale,h=p?0:this.innerRadius,g=p?0:this.outerRadius,{sharedOptions:m,includeOptions:v}=this._getSharedOptions(n,i);let y=this._getRotation(),S;for(S=0;S<n;++S)y+=this._circumference(S,o);for(S=n;S<n+r;++S){const x=this._circumference(S,o),b=t[S],O={x:u+this.offsetX,y:d+this.offsetY,startAngle:y,endAngle:y+x,circumference:x,outerRadius:g,innerRadius:h};v&&(O.options=m||this.resolveDataElementOptions(S,b.active?"active":i)),y+=x,this.updateElement(b,S,O,i)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,i;for(i=0;i<n.length;i++){const o=t._parsed[i];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(i)&&!n[i].hidden&&(r+=Math.abs(o))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?Ot*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],o=Wy(n._parsed[t],r.options.locale);return{label:i[t]||"",value:o}}getMaxBorderWidth(t){let n=0;const r=this.chart;let i,o,a,s,l;if(!t){for(i=0,o=r.data.datasets.length;i<o;++i)if(r.isDatasetVisible(i)){a=r.getDatasetMeta(i),t=a.data,s=a.controller;break}}if(!t)return 0;for(i=0,o=t.length;i<o;++i)l=s.resolveDataElementOptions(i),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,i=t.length;r<i;++r){const o=this.resolveDataElementOptions(r);n=Math.max(n,o.offset||0,o.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(Oe(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class iQ extends Cf{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:i=[],_dataset:o}=n,a=this.chart._animationsDisabled;let{start:s,count:l}=PZ(n,i,a);this._drawStart=s,this._drawCount=l,CZ(n)&&(s=0,l=i.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!o._decimated,r.points=i;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!a,options:c},t),this.updateElements(i,s,l,t)}updateElements(t,n,r,i){const o=i==="reset",{iScale:a,vScale:s,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,i),p=a.axis,h=s.axis,{spanGaps:g,segment:m}=this.options,v=ml(g)?g:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||o||i==="none",S=n+r,x=t.length;let b=n>0&&this.getParsed(n-1);for(let O=0;O<x;++O){const E=t[O],C=y?E:{};if(O<n||O>=S){C.skip=!0;continue}const T=this.getParsed(O),k=ze(T[h]),R=C[p]=a.getPixelForValue(T[p],O),M=C[h]=o||k?s.getBasePixel():s.getPixelForValue(l?this.applyStack(s,T,l):T[h],O);C.skip=isNaN(R)||isNaN(M)||k,C.stop=O>0&&Math.abs(T[p]-b[p])>v,m&&(C.parsed=T,C.raw=c.data[O]),d&&(C.options=u||this.resolveDataElementOptions(O,E.active?"active":i)),y||this.updateElement(E,O,C,i),b=T}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const o=i[0].size(this.resolveDataElementOptions(0)),a=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,o,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}function no(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Jy{static override(t){Object.assign(Jy.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return no()}parse(){return no()}format(){return no()}add(){return no()}diff(){return no()}startOf(){return no()}endOf(){return no()}}var oQ={_date:Jy};function aQ(e,t,n,r){const{controller:i,data:o,_sorted:a}=e,s=i._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(s&&t===s.axis&&t!=="r"&&a&&o.length){const c=s._reversePixels?wZ:bo;if(r){if(i._sharedOptions){const u=o[0],d=typeof u.getRange=="function"&&u.getRange(t);if(d){const p=c(o,t,n-d),h=c(o,t,n+d);return{lo:p.lo,hi:h.hi}}}}else{const u=c(o,t,n);if(l){const{vScale:d}=i._cachedMeta,{_parsed:p}=e,h=p.slice(0,u.lo+1).reverse().findIndex(m=>!ze(m[d.axis]));u.lo-=Math.max(0,h);const g=p.slice(u.hi).findIndex(m=>!ze(m[d.axis]));u.hi+=Math.max(0,g)}return u}}return{lo:0,hi:o.length-1}}function Tf(e,t,n,r,i){const o=e.getSortedVisibleDatasetMetas(),a=n[t];for(let s=0,l=o.length;s<l;++s){const{index:c,data:u}=o[s],{lo:d,hi:p}=aQ(o[s],t,a,i);for(let h=d;h<=p;++h){const g=u[h];g.skip||r(g,c,h)}}}function sQ(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,i){const o=t?Math.abs(r.x-i.x):0,a=n?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function Ih(e,t,n,r,i){const o=[];return!i&&!e.isPointInArea(t)||Tf(e,n,t,function(s,l,c){!i&&!vl(s,e.chartArea,0)||s.inRange(t.x,t.y,r)&&o.push({element:s,datasetIndex:l,index:c})},!0),o}function lQ(e,t,n,r){let i=[];function o(a,s,l){const{startAngle:c,endAngle:u}=a.getProps(["startAngle","endAngle"],r),{angle:d}=bk(a,{x:t.x,y:t.y});gl(d,c,u)&&i.push({element:a,datasetIndex:s,index:l})}return Tf(e,n,t,o),i}function cQ(e,t,n,r,i,o){let a=[];const s=sQ(n);let l=Number.POSITIVE_INFINITY;function c(u,d,p){const h=u.inRange(t.x,t.y,i);if(r&&!h)return;const g=u.getCenterPoint(i);if(!(!!o||e.isPointInArea(g))&&!h)return;const v=s(t,g);v<l?(a=[{element:u,datasetIndex:d,index:p}],l=v):v===l&&a.push({element:u,datasetIndex:d,index:p})}return Tf(e,n,t,c),a}function $h(e,t,n,r,i,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!r?lQ(e,t,n,i):cQ(e,t,n,r,i,o)}function jS(e,t,n,r,i){const o=[],a=n==="x"?"inXRange":"inYRange";let s=!1;return Tf(e,n,t,(l,c,u)=>{l[a]&&l[a](t[n],i)&&(o.push({element:l,datasetIndex:c,index:u}),s=s||l.inRange(t.x,t.y,i))}),r&&!s?[]:o}var uQ={modes:{index(e,t,n,r){const i=co(t,e),o=n.axis||"x",a=n.includeInvisible||!1,s=n.intersect?Ih(e,i,o,r,a):$h(e,i,o,!1,r,a),l=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=s[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,r){const i=co(t,e),o=n.axis||"xy",a=n.includeInvisible||!1;let s=n.intersect?Ih(e,i,o,r,a):$h(e,i,o,!1,r,a);if(s.length>0){const l=s[0].datasetIndex,c=e.getDatasetMeta(l).data;s=[];for(let u=0;u<c.length;++u)s.push({element:c[u],datasetIndex:l,index:u})}return s},point(e,t,n,r){const i=co(t,e),o=n.axis||"xy",a=n.includeInvisible||!1;return Ih(e,i,o,r,a)},nearest(e,t,n,r){const i=co(t,e),o=n.axis||"xy",a=n.includeInvisible||!1;return $h(e,i,o,n.intersect,r,a)},x(e,t,n,r){const i=co(t,e);return jS(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=co(t,e);return jS(e,i,"y",n.intersect,r)}}};const Fk=["left","top","right","bottom"];function ms(e,t){return e.filter(n=>n.pos===t)}function NS(e,t){return e.filter(n=>Fk.indexOf(n.pos)===-1&&n.box.axis===t)}function gs(e,t){return e.sort((n,r)=>{const i=t?r:n,o=t?n:r;return i.weight===o.weight?i.index-o.index:i.weight-o.weight})}function dQ(e){const t=[];let n,r,i,o,a,s;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:o,options:{stack:a,stackWeight:s=1}}=i,t.push({index:n,box:i,pos:o,horizontal:i.isHorizontal(),weight:i.weight,stack:a&&o+a,stackWeight:s});return t}function fQ(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:o}=n;if(!r||!Fk.includes(i))continue;const a=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return t}function pQ(e,t){const n=fQ(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t;let o,a,s;for(o=0,a=e.length;o<a;++o){s=e[o];const{fullSize:l}=s.box,c=n[s.stack],u=c&&s.stackWeight/c.weight;s.horizontal?(s.width=u?u*r:l&&t.availableWidth,s.height=i):(s.width=r,s.height=u?u*i:l&&t.availableHeight)}return n}function hQ(e){const t=dQ(e),n=gs(t.filter(c=>c.box.fullSize),!0),r=gs(ms(t,"left"),!0),i=gs(ms(t,"right")),o=gs(ms(t,"top"),!0),a=gs(ms(t,"bottom")),s=NS(t,"x"),l=NS(t,"y");return{fullSize:n,leftAndTop:r.concat(o),rightAndBottom:i.concat(l).concat(a).concat(s),chartArea:ms(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:o.concat(a).concat(s)}}function RS(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function Bk(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 mQ(e,t,n,r){const{pos:i,box:o}=n,a=e.maxPadding;if(!Ae(i)){n.size&&(e[i]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?o.height:o.width),n.size=d.size/d.count,e[i]+=n.size}o.getPadding&&Bk(a,o.getPadding());const s=Math.max(0,t.outerWidth-RS(a,e,"left","right")),l=Math.max(0,t.outerHeight-RS(a,e,"top","bottom")),c=s!==e.w,u=l!==e.h;return e.w=s,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function gQ(e){const t=e.maxPadding;function n(r){const i=Math.max(t[r]-e[r],0);return e[r]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function vQ(e,t){const n=t.maxPadding;function r(i){const o={left:0,top:0,right:0,bottom:0};return i.forEach(a=>{o[a]=Math.max(t[a],n[a])}),o}return r(e?["left","right"]:["top","bottom"])}function As(e,t,n,r){const i=[];let o,a,s,l,c,u;for(o=0,a=e.length,c=0;o<a;++o){s=e[o],l=s.box,l.update(s.width||t.w,s.height||t.h,vQ(s.horizontal,t));const{same:d,other:p}=mQ(t,n,s,r);c|=d&&i.length,u=u||p,l.fullSize||i.push(s)}return c&&As(i,t,n,r)||u}function Bc(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function DS(e,t,n,r){const i=n.padding;let{x:o,y:a}=t;for(const s of e){const l=s.box,c=r[s.stack]||{placed:0,weight:1},u=s.stackWeight/c.weight||1;if(s.horizontal){const d=t.w*u,p=c.size||l.height;hl(c.start)&&(a=c.start),l.fullSize?Bc(l,i.left,a,n.outerWidth-i.right-i.left,p):Bc(l,t.left+c.placed,a,d,p),c.start=a,c.placed+=d,a=l.bottom}else{const d=t.h*u,p=c.size||l.width;hl(c.start)&&(o=c.start),l.fullSize?Bc(l,o,i.top,p,n.outerHeight-i.bottom-i.top):Bc(l,o,t.top+c.placed,p,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=a}var _i={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const i=pr(e.options.layout.padding),o=Math.max(t-i.width,0),a=Math.max(n-i.height,0),s=hQ(e.boxes),l=s.vertical,c=s.horizontal;Ue(e.boxes,m=>{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:i,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/u,hBoxMaxHeight:a/2}),p=Object.assign({},i);Bk(p,pr(r));const h=Object.assign({maxPadding:p,w:o,h:a,x:i.left,y:i.top},i),g=pQ(l.concat(c),d);As(s.fullSize,h,d,g),As(l,h,d,g),As(c,h,d,g)&&As(l,h,d,g),gQ(h),DS(s.leftAndTop,h,d,g),h.x+=h.w,h.y+=h.h,DS(s.rightAndBottom,h,d,g),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Ue(s.chartArea,m=>{const v=m.box;Object.assign(v,e.chartArea),v.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class zk{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,i){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(t){return!0}updateConfig(t){}}class yQ extends zk{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const nu="$chartjs",bQ={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},IS=e=>e===null||e==="";function xQ(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[nu]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",IS(i)){const o=bS(e,"width");o!==void 0&&(e.width=o)}if(IS(r))if(e.style.height==="")e.height=e.width/(t||2);else{const o=bS(e,"height");o!==void 0&&(e.height=o)}return e}const Vk=gJ?{passive:!0}:!1;function wQ(e,t,n){e&&e.addEventListener(t,n,Vk)}function OQ(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,Vk)}function SQ(e,t){const n=bQ[e.type]||e.type,{x:r,y:i}=co(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function fd(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function EQ(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let a=!1;for(const s of o)a=a||fd(s.addedNodes,r),a=a&&!fd(s.removedNodes,r);a&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function _Q(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let a=!1;for(const s of o)a=a||fd(s.removedNodes,r),a=a&&!fd(s.addedNodes,r);a&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const yl=new Map;let $S=0;function Wk(){const e=window.devicePixelRatio;e!==$S&&($S=e,yl.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function PQ(e,t){yl.size||window.addEventListener("resize",Wk),yl.set(e,t)}function CQ(e){yl.delete(e),yl.size||window.removeEventListener("resize",Wk)}function TQ(e,t,n){const r=e.canvas,i=r&&Zy(r);if(!i)return;const o=Sk((s,l)=>{const c=i.clientWidth;n(s,l),c<i.clientWidth&&n()},window),a=new ResizeObserver(s=>{const l=s[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||o(c,u)});return a.observe(i),PQ(e,o),a}function Lh(e,t,n){n&&n.disconnect(),t==="resize"&&CQ(e)}function AQ(e,t,n){const r=e.canvas,i=Sk(o=>{e.ctx!==null&&n(SQ(o,e))},e);return wQ(r,t,i),i}class kQ extends zk{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(xQ(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[nu])return!1;const r=n[nu].initial;["height","width"].forEach(o=>{const a=r[o];ze(a)?n.removeAttribute(o):n.setAttribute(o,a)});const i=r.style||{};return Object.keys(i).forEach(o=>{n.style[o]=i[o]}),n.width=n.width,delete n[nu],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),a={attach:EQ,detach:_Q,resize:TQ}[n]||AQ;i[n]=a(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:Lh,detach:Lh,resize:Lh}[n]||OQ)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return mJ(t,n,r,i)}isAttached(t){const n=t&&Zy(t);return!!(n&&n.isConnected)}}function MQ(e){return!Xy()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?yQ:kQ}let qi=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return ml(this.x)&&ml(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const i={};return t.forEach(o=>{i[o]=r[o]&&r[o].active()?r[o]._to:this[o]}),i}};function jQ(e,t){const n=e.options.ticks,r=NQ(e),i=Math.min(n.maxTicksLimit||r,r),o=n.major.enabled?DQ(t):[],a=o.length,s=o[0],l=o[a-1],c=[];if(a>i)return IQ(t,c,o,a/i),c;const u=RQ(o,t,i);if(a>0){let d,p;const h=a>1?Math.round((l-s)/(a-1)):null;for(zc(t,c,u,ze(h)?0:s-h,s),d=0,p=a-1;d<p;d++)zc(t,c,u,o[d],o[d+1]);return zc(t,c,u,l,ze(h)?t.length:l+h),c}return zc(t,c,u),c}function NQ(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),i=e._maxLength/n;return Math.floor(Math.min(r,i))}function RQ(e,t,n){const r=$Q(e),i=t.length/n;if(!r)return Math.max(i,1);const o=hZ(r);for(let a=0,s=o.length-1;a<s;a++){const l=o[a];if(l>i)return l}return Math.max(i,1)}function DQ(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function IQ(e,t,n,r){let i=0,o=n[0],a;for(r=Math.ceil(r),a=0;a<e.length;a++)a===o&&(t.push(e[a]),i++,o=n[i*r])}function zc(e,t,n,r,i){const o=Oe(r,0),a=Math.min(Oe(i,e.length),e.length);let s=0,l,c,u;for(n=Math.ceil(n),i&&(l=i-r,n=l/Math.floor(l/n)),u=o;u<0;)s++,u=Math.round(o+s*n);for(c=Math.max(o,0);c<a;c++)c===u&&(t.push(e[c]),s++,u=Math.round(o+s*n))}function $Q(e){const t=e.length;let n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}const LQ=e=>e==="left"?"right":e==="right"?"left":e,LS=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,FS=(e,t)=>Math.min(t||e,e);function BS(e,t){const n=[],r=e.length/t,i=e.length;let o=0;for(;o<i;o+=r)n.push(e[Math.floor(o)]);return n}function FQ(e,t,n){const r=e.ticks.length,i=Math.min(t,r-1),o=e._startPixel,a=e._endPixel,s=1e-6;let l=e.getPixelForTick(i),c;if(!(n&&(r===1?c=Math.max(l-o,a-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(i-1))/2,l+=i<t?c:-c,l<o-s||l>a+s)))return l}function BQ(e,t){Ue(e,n=>{const r=n.gc,i=r.length/2;let o;if(i>t){for(o=0;o<i;++o)delete n.data[r[o]];r.splice(0,i)}})}function vs(e){return e.drawTicks?e.tickLength:0}function zS(e,t){if(!e.display)return 0;const n=Sn(e.font,t),r=pr(e.padding);return(Wt(e.text)?e.text.length:1)*n.lineHeight+r.height}function zQ(e,t){return Uo(e,{scale:t,type:"scale"})}function VQ(e,t,n){return Uo(e,{tick:n,index:t,type:"tick"})}function WQ(e,t,n){let r=Ek(e);return(n&&t!=="right"||!n&&t==="right")&&(r=LQ(r)),r}function UQ(e,t,n,r){const{top:i,left:o,bottom:a,right:s,chart:l}=e,{chartArea:c,scales:u}=l;let d=0,p,h,g;const m=a-i,v=s-o;if(e.isHorizontal()){if(h=Mn(r,o,s),Ae(n)){const y=Object.keys(n)[0],S=n[y];g=u[y].getPixelForValue(S)+m-t}else n==="center"?g=(c.bottom+c.top)/2+m-t:g=LS(e,n,t);p=s-o}else{if(Ae(n)){const y=Object.keys(n)[0],S=n[y];h=u[y].getPixelForValue(S)-v+t}else n==="center"?h=(c.left+c.right)/2-v+t:h=LS(e,n,t);g=Mn(r,a,i),d=n==="left"?-It:It}return{titleX:h,titleY:g,maxWidth:p,rotation:d}}class Ga extends qi{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:i}=this;return t=xr(t,Number.POSITIVE_INFINITY),n=xr(n,Number.NEGATIVE_INFINITY),r=xr(r,Number.POSITIVE_INFINITY),i=xr(i,Number.NEGATIVE_INFINITY),{min:xr(t,r),max:xr(n,i),minDefined:sr(t),maxDefined:sr(n)}}getMinMax(t){let{min:n,max:r,minDefined:i,maxDefined:o}=this.getUserBounds(),a;if(i&&o)return{min:n,max:r};const s=this.getMatchingVisibleMetas();for(let l=0,c=s.length;l<c;++l)a=s[l].controller.getMinMax(this,t),i||(n=Math.min(n,a.min)),o||(r=Math.max(r,a.max));return n=o&&n>r?r:n,r=i&&n>r?n:r,{min:xr(n,xr(r,n)),max:xr(r,xr(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){lt(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:i,grace:o,ticks:a}=this.options,s=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=KZ(this,o,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=s<this.ticks.length;this._convertTicksToLabels(l?BS(this.ticks,s):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=jQ(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,t=!t),this._startPixel=n,this._endPixel=r,this._reversePixels=t,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){lt(this.options.afterUpdate,[this])}beforeSetDimensions(){lt(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){lt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),lt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){lt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,i,o;for(r=0,i=t.length;r<i;r++)o=t[r],o.label=lt(n.callback,[o.value,r,t],this)}afterTickToLabelConversion(){lt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){lt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=FS(this.ticks.length,t.ticks.maxTicksLimit),i=n.minRotation||0,o=n.maxRotation;let a=i,s,l,c;if(!this._isVisible()||!n.display||i>=o||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const u=this._getLabelSizes(),d=u.widest.width,p=u.highest.height,h=ln(this.chart.width-d,0,this.maxWidth);s=t.offset?this.maxWidth/r:h/(r-1),d+6>s&&(s=h/(r-(t.offset?.5:1)),l=this.maxHeight-vs(t.grid)-n.padding-zS(t.title,this.chart.options.font),c=Math.sqrt(d*d+p*p),a=yZ(Math.min(Math.asin(ln((u.highest.height+6)/s,-1,1)),Math.asin(ln(l/c,-1,1))-Math.asin(ln(p/c,-1,1)))),a=Math.max(i,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){lt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){lt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:o}}=this,a=this._isVisible(),s=this.isHorizontal();if(a){const l=zS(i,n.options.font);if(s?(t.width=this.maxWidth,t.height=vs(o)+l):(t.height=this.maxHeight,t.width=vs(o)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:p}=this._getLabelSizes(),h=r.padding*2,g=Jr(this.labelRotation),m=Math.cos(g),v=Math.sin(g);if(s){const y=r.mirror?0:v*d.width+m*p.height;t.height=Math.min(this.maxHeight,t.height+y+h)}else{const y=r.mirror?0:m*d.width+v*p.height;t.width=Math.min(this.maxWidth,t.width+y+h)}this._calculatePadding(c,u,v,m)}}this._handleMargins(),s?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,i){const{ticks:{align:o,padding:a},position:s}=this.options,l=this.labelRotation!==0,c=s!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let p=0,h=0;l?c?(p=i*t.width,h=r*n.height):(p=r*t.height,h=i*n.width):o==="start"?h=n.width:o==="end"?p=t.width:o!=="inner"&&(p=t.width/2,h=n.width/2),this.paddingLeft=Math.max((p-u+a)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-d+a)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;o==="start"?(u=0,d=t.height):o==="end"&&(u=n.height,d=0),this.paddingTop=u+a,this.paddingBottom=d+a}}_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(){lt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)ze(t[n].label)&&(t.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=BS(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:i,_longestTextCache:o}=this,a=[],s=[],l=Math.floor(n/FS(n,r));let c=0,u=0,d,p,h,g,m,v,y,S,x,b,O;for(d=0;d<n;d+=l){if(g=t[d].label,m=this._resolveTickFontOptions(d),i.font=v=m.string,y=o[v]=o[v]||{data:{},gc:[]},S=m.lineHeight,x=b=0,!ze(g)&&!Wt(g))x=hS(i,y.data,y.gc,x,g),b=S;else if(Wt(g))for(p=0,h=g.length;p<h;++p)O=g[p],!ze(O)&&!Wt(O)&&(x=hS(i,y.data,y.gc,x,O),b+=S);a.push(x),s.push(b),c=Math.max(x,c),u=Math.max(b,u)}BQ(o,n);const E=a.indexOf(c),C=s.indexOf(u),T=k=>({width:a[k]||0,height:s[k]||0});return{first:T(0),last:T(n-1),widest:T(E),highest:T(C),widths:a,heights:s}}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 xZ(this._alignToPixels?to(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const r=n[t];return r.$context||(r.$context=VQ(this.getContext(),t,r))}return this.$context||(this.$context=zQ(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Jr(this.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),o=this._getLabelSizes(),a=t.autoSkipPadding||0,s=o?o.widest.width+a:0,l=o?o.highest.height+a:0;return this.isHorizontal()?l*r>s*i?s/r:l/i:l*i<s*r?l/r:s/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,i=this.options,{grid:o,position:a,border:s}=i,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),p=vs(o),h=[],g=s.setContext(this.getContext()),m=g.display?g.width:0,v=m/2,y=function(L){return to(r,L,m)};let S,x,b,O,E,C,T,k,R,M,P,D;if(a==="top")S=y(this.bottom),C=this.bottom-p,k=S-v,M=y(t.top)+v,D=t.bottom;else if(a==="bottom")S=y(this.top),M=t.top,D=y(t.bottom)-v,C=S+v,k=this.top+p;else if(a==="left")S=y(this.right),E=this.right-p,T=S-v,R=y(t.left)+v,P=t.right;else if(a==="right")S=y(this.left),R=t.left,P=y(t.right)-v,E=S+v,T=this.left+p;else if(n==="x"){if(a==="center")S=y((t.top+t.bottom)/2+.5);else if(Ae(a)){const L=Object.keys(a)[0],B=a[L];S=y(this.chart.scales[L].getPixelForValue(B))}M=t.top,D=t.bottom,C=S+v,k=C+p}else if(n==="y"){if(a==="center")S=y((t.left+t.right)/2);else if(Ae(a)){const L=Object.keys(a)[0],B=a[L];S=y(this.chart.scales[L].getPixelForValue(B))}E=S-v,T=E-p,R=t.left,P=t.right}const j=Oe(i.ticks.maxTicksLimit,d),N=Math.max(1,Math.ceil(d/j));for(x=0;x<d;x+=N){const L=this.getContext(x),B=o.setContext(L),K=s.setContext(L),z=B.lineWidth,F=B.color,G=K.dash||[],Y=K.dashOffset,ne=B.tickWidth,Q=B.tickColor,X=B.tickBorderDash||[],te=B.tickBorderDashOffset;b=FQ(this,x,l),b!==void 0&&(O=to(r,b,z),c?E=T=R=P=O:C=k=M=D=O,h.push({tx1:E,ty1:C,tx2:T,ty2:k,x1:R,y1:M,x2:P,y2:D,width:z,color:F,borderDash:G,borderDashOffset:Y,tickWidth:ne,tickColor:Q,tickBorderDash:X,tickBorderDashOffset:te}))}return this._ticksLength=d,this._borderValue=S,h}_computeLabelItems(t){const n=this.axis,r=this.options,{position:i,ticks:o}=r,a=this.isHorizontal(),s=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=o,p=vs(r.grid),h=p+u,g=d?-u:h,m=-Jr(this.labelRotation),v=[];let y,S,x,b,O,E,C,T,k,R,M,P,D="middle";if(i==="top")E=this.bottom-g,C=this._getXAxisLabelAlignment();else if(i==="bottom")E=this.top+g,C=this._getXAxisLabelAlignment();else if(i==="left"){const N=this._getYAxisLabelAlignment(p);C=N.textAlign,O=N.x}else if(i==="right"){const N=this._getYAxisLabelAlignment(p);C=N.textAlign,O=N.x}else if(n==="x"){if(i==="center")E=(t.top+t.bottom)/2+h;else if(Ae(i)){const N=Object.keys(i)[0],L=i[N];E=this.chart.scales[N].getPixelForValue(L)+h}C=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")O=(t.left+t.right)/2-h;else if(Ae(i)){const N=Object.keys(i)[0],L=i[N];O=this.chart.scales[N].getPixelForValue(L)}C=this._getYAxisLabelAlignment(p).textAlign}n==="y"&&(l==="start"?D="top":l==="end"&&(D="bottom"));const j=this._getLabelSizes();for(y=0,S=s.length;y<S;++y){x=s[y],b=x.label;const N=o.setContext(this.getContext(y));T=this.getPixelForTick(y)+o.labelOffset,k=this._resolveTickFontOptions(y),R=k.lineHeight,M=Wt(b)?b.length:1;const L=M/2,B=N.color,K=N.textStrokeColor,z=N.textStrokeWidth;let F=C;a?(O=T,C==="inner"&&(y===S-1?F=this.options.reverse?"left":"right":y===0?F=this.options.reverse?"right":"left":F="center"),i==="top"?c==="near"||m!==0?P=-M*R+R/2:c==="center"?P=-j.highest.height/2-L*R+R:P=-j.highest.height+R/2:c==="near"||m!==0?P=R/2:c==="center"?P=j.highest.height/2-L*R:P=j.highest.height-M*R,d&&(P*=-1),m!==0&&!N.showLabelBackdrop&&(O+=R/2*Math.sin(m))):(E=T,P=(1-M)*R/2);let G;if(N.showLabelBackdrop){const Y=pr(N.backdropPadding),ne=j.heights[y],Q=j.widths[y];let X=P-Y.top,te=0-Y.left;switch(D){case"middle":X-=ne/2;break;case"bottom":X-=ne;break}switch(C){case"center":te-=Q/2;break;case"right":te-=Q;break;case"inner":y===S-1?te-=Q:y>0&&(te-=Q/2);break}G={left:te,top:X,width:Q+Y.width,height:ne+Y.height,color:N.backdropColor}}v.push({label:b,font:k,textOffset:P,options:{rotation:m,color:B,strokeColor:K,strokeWidth:z,textAlign:F,textBaseline:D,translation:[O,E],backdrop:G}})}return v}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Jr(this.labelRotation))return t==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:i,padding:o}}=this.options,a=this._getLabelSizes(),s=t+o,l=a.widest.width;let c,u;return n==="left"?i?(u=this.right+o,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-s,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?i?(u=this.left+o,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+s,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:i,width:o,height:a}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,i,o,a),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(o=>o.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,a;const s=(l,c,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(o=0,a=i.length;o<a;++o){const l=i[o];n.drawOnChartArea&&s({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&s({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:i}}=this,o=r.setContext(this.getContext()),a=r.display?o.width:0;if(!a)return;const s=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,p;this.isHorizontal()?(c=to(t,this.left,a)-a/2,u=to(t,this.right,s)+s/2,d=p=l):(d=to(t,this.top,a)-a/2,p=to(t,this.bottom,s)+s/2,c=u=l),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(c,d),n.lineTo(u,p),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&Uy(r,i);const o=this.getLabelItems(t);for(const a of o){const s=a.options,l=a.font,c=a.label,u=a.textOffset;cd(r,c,0,u,l,s)}i&&Hy(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const o=Sn(r.font),a=pr(r.padding),s=r.align;let l=o.lineHeight/2;n==="bottom"||n==="center"||Ae(n)?(l+=a.bottom,Wt(r.text)&&(l+=o.lineHeight*(r.text.length-1))):l+=a.top;const{titleX:c,titleY:u,maxWidth:d,rotation:p}=UQ(this,l,n,s);cd(t,r.text,0,0,o,{color:r.color,maxWidth:d,rotation:p,textAlign:WQ(s,n,i),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=Oe(t.grid&&t.grid.z,-1),i=Oe(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Ga.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:r,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let o,a;for(o=0,a=n.length;o<a;++o){const s=n[o];s[r]===this.id&&(!t||s.type===t)&&i.push(s)}return i}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return Sn(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Vc{constructor(t,n,r){this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let r;KQ(n)&&(r=this.register(n));const i=this.items,o=t.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in i||(i[o]=t,HQ(t,a,r),this.override&&Ct.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,i=this.scope;r in n&&delete n[r],i&&r in Ct[i]&&(delete Ct[i][r],this.override&&delete Io[r])}}function HQ(e,t,n){const r=pl(Object.create(null),[n?Ct.get(n):{},Ct.get(t),e.defaults]);Ct.set(t,r),e.defaultRoutes&&qQ(t,e.defaultRoutes),e.descriptors&&Ct.describe(t,e.descriptors)}function qQ(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),i=r.pop(),o=[e].concat(r).join("."),a=t[n].split("."),s=a.pop(),l=a.join(".");Ct.route(o,i,l,s)})}function KQ(e){return"id"in e&&"defaults"in e}class YQ{constructor(){this.controllers=new Vc(Cf,"datasets",!0),this.elements=new Vc(qi,"elements"),this.plugins=new Vc(Object,"plugins"),this.scales=new Vc(Ga,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(i=>{const o=r||this._getRegistryForType(i);r||o.isForType(i)||o===this.plugins&&i.id?this._exec(t,o,i):Ue(i,a=>{const s=r||this._getRegistryForType(a);this._exec(t,s,a)})})}_exec(t,n,r){const i=By(t);lt(r["before"+i],[],r),n[t](r),lt(r["after"+i],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const i=n.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return i}}var Or=new YQ;class GQ{constructor(){this._init=[]}notify(t,n,r,i){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=i?this._descriptors(t).filter(i):this._descriptors(t),a=this._notify(o,t,n,r);return n==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,n,r,i){i=i||{};for(const o of t){const a=o.plugin,s=a[r],l=[n,i,o.options];if(lt(s,l,a)===!1&&i.cancelable)return!1}return!0}invalidate(){ze(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,i=Oe(r.options&&r.options.plugins,{}),o=XQ(r);return i===!1&&!n?[]:JQ(t,o,i,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,i=(o,a)=>o.filter(s=>!a.some(l=>s.plugin.id===l.plugin.id));this._notify(i(n,r),t,"stop"),this._notify(i(r,n),t,"start")}}function XQ(e){const t={},n=[],r=Object.keys(Or.plugins.items);for(let o=0;o<r.length;o++)n.push(Or.getPlugin(r[o]));const i=e.plugins||[];for(let o=0;o<i.length;o++){const a=i[o];n.indexOf(a)===-1&&(n.push(a),t[a.id]=!0)}return{plugins:n,localIds:t}}function ZQ(e,t){return!t&&e===!1?null:e===!0?{}:e}function JQ(e,{plugins:t,localIds:n},r,i){const o=[],a=e.getContext();for(const s of t){const l=s.id,c=ZQ(r[l],i);c!==null&&o.push({plugin:s,options:QQ(e.config,{plugin:s,local:n[l]},c,a)})}return o}function QQ(e,{plugin:t,local:n},r,i){const o=e.pluginScopeKeys(t),a=e.getOptionScopes(r,o);return n&&t.defaults&&a.push(t.defaults),e.createResolver(a,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ig(e,t){const n=Ct.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function eee(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function tee(e,t){return e===t?"_index_":"_value_"}function VS(e){if(e==="x"||e==="y"||e==="r")return e}function nee(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function og(e,...t){if(VS(e))return e;for(const n of t){const r=n.axis||nee(n.position)||e.length>1&&VS(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function WS(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function ree(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return WS(e,"x",n[0])||WS(e,"y",n[0])}return{}}function iee(e,t){const n=Io[e.type]||{scales:{}},r=t.scales||{},i=ig(e.type,t),o=Object.create(null);return Object.keys(r).forEach(a=>{const s=r[a];if(!Ae(s))return console.error(`Invalid scale configuration for scale: ${a}`);if(s._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const l=og(a,s,ree(a,e),Ct.scales[s.type]),c=tee(l,i),u=n.scales||{};o[a]=Fs(Object.create(null),[{axis:l},s,u[l],u[c]])}),e.data.datasets.forEach(a=>{const s=a.type||e.type,l=a.indexAxis||ig(s,t),u=(Io[s]||{}).scales||{};Object.keys(u).forEach(d=>{const p=eee(d,l),h=a[p+"AxisID"]||p;o[h]=o[h]||Object.create(null),Fs(o[h],[{axis:p},r[h],u[d]])})}),Object.keys(o).forEach(a=>{const s=o[a];Fs(s,[Ct.scales[s.type],Ct.scale])}),o}function Uk(e){const t=e.options||(e.options={});t.plugins=Oe(t.plugins,{}),t.scales=iee(e,t)}function Hk(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function oee(e){return e=e||{},e.data=Hk(e.data),Uk(e),e}const US=new Map,qk=new Set;function Wc(e,t){let n=US.get(e);return n||(n=t(),US.set(e,n),qk.add(n)),n}const ys=(e,t,n)=>{const r=Do(t,n);r!==void 0&&e.add(r)};class aee{constructor(t){this._config=oee(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=Hk(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(),Uk(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Wc(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Wc(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Wc(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return Wc(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let i=r.get(t);return(!i||n)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,n,r){const{options:i,type:o}=this,a=this._cachedScopes(t,r),s=a.get(n);if(s)return s;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>ys(l,t,d))),u.forEach(d=>ys(l,i,d)),u.forEach(d=>ys(l,Io[o]||{},d)),u.forEach(d=>ys(l,Ct,d)),u.forEach(d=>ys(l,ng,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),qk.has(n)&&a.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Io[n]||{},Ct.datasets[n]||{},{type:n},Ct,ng]}resolveNamedOptions(t,n,r,i=[""]){const o={$shared:!0},{resolver:a,subPrefixes:s}=HS(this._resolverCache,t,i);let l=a;if(lee(a,n)){o.$shared=!1,r=$i(r)?r():r;const c=this.createResolver(t,r,s);l=Ma(a,r,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,r=[""],i){const{resolver:o}=HS(this._resolverCache,t,r);return Ae(n)?Ma(o,n,void 0,i):o}}function HS(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const i=n.join();let o=r.get(i);return o||(o={resolver:Ky(t,n),subPrefixes:n.filter(s=>!s.toLowerCase().includes("hover"))},r.set(i,o)),o}const see=e=>Ae(e)&&Object.getOwnPropertyNames(e).some(t=>$i(e[t]));function lee(e,t){const{isScriptable:n,isIndexable:r}=Tk(e);for(const i of t){const o=n(i),a=r(i),s=(a||o)&&e[i];if(o&&($i(s)||see(s))||a&&Wt(s))return!0}return!1}var cee="4.5.0";const uee=["top","bottom","left","right","chartArea"];function qS(e,t){return e==="top"||e==="bottom"||uee.indexOf(e)===-1&&t==="x"}function KS(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function YS(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),lt(n&&n.onComplete,[e],t)}function dee(e){const t=e.chart,n=t.options.animation;lt(n&&n.onProgress,[e],t)}function Kk(e){return Xy()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const ru={},GS=e=>{const t=Kk(e);return Object.values(ru).filter(n=>n.canvas===t).pop()};function fee(e,t,n){const r=Object.keys(e);for(const i of r){const o=+i;if(o>=t){const a=e[i];delete e[i],(n>0||o>t)&&(e[o+n]=a)}}}function pee(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}let Tn=class{static defaults=Ct;static instances=ru;static overrides=Io;static registry=Or;static version=cee;static getChart=GS;static register(...t){Or.add(...t),XS()}static unregister(...t){Or.remove(...t),XS()}constructor(t,n){const r=this.config=new aee(n),i=Kk(t),o=GS(i);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const a=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||MQ(i)),this.platform.updateConfig(r);const s=this.platform.acquireContext(i,a.aspectRatio),l=s&&s.canvas,c=l&&l.height,u=l&&l.width;if(this.id=oZ(),this.ctx=s,this.canvas=l,this.width=u,this.height=c,this._options=a,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 GQ,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=EZ(d=>this.update(d),a.resizeDelay||0),this._dataChanges=[],ru[this.id]=this,!s||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Ur.listen(this,"complete",YS),Ur.listen(this,"progress",dee),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:o}=this;return ze(t)?n&&o?o:i?r/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Or}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():yS(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return mS(this.canvas,this.ctx),this}stop(){return Ur.stop(this),this}resize(t,n){Ur.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,i=this.canvas,o=r.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(i,t,n,o),s=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,yS(this,s,!0)&&(this.notifyPlugins("resize",{size:a}),lt(r.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Ue(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,i=Object.keys(r).reduce((a,s)=>(a[s]=!1,a),{});let o=[];n&&(o=o.concat(Object.keys(n).map(a=>{const s=n[a],l=og(a,s),c=l==="r",u=l==="x";return{options:s,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Ue(o,a=>{const s=a.options,l=s.id,c=og(l,s),u=Oe(s.type,a.dtype);(s.position===void 0||qS(s.position,c)!==qS(a.dposition))&&(s.position=a.dposition),i[l]=!0;let d=null;if(l in r&&r[l].type===u)d=r[l];else{const p=Or.getScale(u);d=new p({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(s,t)}),Ue(i,(a,s)=>{a||delete r[s]}),Ue(r,a=>{_i.configure(this,a,a.options),_i.addBox(this,a)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((i,o)=>i.index-o.index),r>n){for(let i=n;i<r;++i)this._destroyDatasetMeta(i);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(KS("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,i)=>{n.filter(o=>o===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r<i;r++){const o=n[r];let a=this.getDatasetMeta(r);const s=o.type||this.config.type;if(a.type&&a.type!==s&&(this._destroyDatasetMeta(r),a=this.getDatasetMeta(r)),a.type=s,a.indexAxis=o.indexAxis||ig(s,this.options),a.order=o.order||0,a.index=r,a.label=""+o.label,a.visible=this.isDatasetVisible(r),a.controller)a.controller.updateIndex(r),a.controller.linkScales();else{const l=Or.getController(s),{datasetElementType:c,dataElementType:u}=Ct.datasets[s];Object.assign(l,{dataElementType:Or.getElement(u),datasetElementType:c&&Or.getElement(c)}),a.controller=new l(this,r),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){Ue(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),p=!i&&o.indexOf(d)===-1;d.buildOrUpdateElements(p),a=Math.max(+d.getMaxOverflow(),a)}a=this._minPadding=r.layout.autoPadding?a:0,this._updateLayout(a),i||Ue(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(KS("z","_idx"));const{_active:s,_lastEvent:l}=this;l?this._eventHandler(l,!0):s.length&&this._updateHoverStyles(s,s,!0),this.render()}_updateScales(){Ue(this.scales,t=>{_i.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!oS(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:o}of n){const a=r==="_removeElements"?-o:o;fee(t,i,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=o=>new Set(t.filter(a=>a[0]===o).map((a,s)=>s+","+a.splice(1).join(","))),i=r(0);for(let o=1;o<n;o++)if(!oS(i,r(o)))return;return Array.from(i).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;_i.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Ue(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,o)=>{i._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,$i(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),i={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(r.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Ur.has(this)?this.attached&&!Ur.running(this)&&Ur.start(this):(this.draw(),YS({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,i)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let i,o;for(i=0,o=n.length;i<o;++i){const a=n[i];(!t||a.visible)&&r.push(a)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r={meta:t,index:t.index,cancelable:!0},i=kJ(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(i&&Uy(n,i),t.controller.draw(),i&&Hy(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return vl(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const o=uQ.modes[n];return typeof o=="function"?o(this,t,r,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let i=r.filter(o=>o&&o._dataset===n).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(i)),i}getContext(){return this.$context||(this.$context=Uo(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const i=r?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,i);hl(n)?(o.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),a.update(o,{visible:r}),this.update(s=>s.datasetIndex===t?i:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),Ur.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),mS(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete ru[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,r=(o,a)=>{n.addEventListener(this,o,a),t[o]=a},i=(o,a,s)=>{o.offsetX=a,o.offsetY=s,this._eventHandler(o)};Ue(this.options.events,o=>r(o,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},i=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let a;const s=()=>{i("attach",s),this.attached=!0,this.resize(),r("resize",o),r("detach",a)};a=()=>{this.attached=!1,i("resize",o),this._stop(),this._resize(0,0),r("attach",s)},n.isAttached(this.canvas)?s():a()}unbindEvents(){Ue(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Ue(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const i=r?"set":"remove";let o,a,s,l;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+i+"DatasetHoverStyle"]()),s=0,l=t.length;s<l;++s){a=t[s];const c=a&&this.getDatasetMeta(a.datasetIndex).controller;c&&c[i+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:o,index:a})=>{const s=this.getDatasetMeta(o);if(!s)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:s.data[a],index:a}});!ad(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const i=this.options.hover,o=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),a=o(n,t),s=r?t:o(t,n);a.length&&this.updateHoverStyle(a,i.mode,!1),s.length&&i.mode&&this.updateHoverStyle(s,i.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const o=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(o||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:i=[],options:o}=this,a=n,s=this._getActiveElements(t,i,r,a),l=dZ(t),c=pee(t,this._lastEvent,r,l);r&&(this._lastEvent=null,lt(o.onHover,[t,s,this],this),l&&lt(o.onClick,[t,s,this],this));const u=!ad(s,i);return(u||n)&&(this._active=s,this._updateHoverStyles(s,i,n)),this._lastEvent=c,u}_getActiveElements(t,n,r,i){if(t.type==="mouseout")return[];if(!r)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,i)}};function XS(){return Ue(Tn.instances,e=>e._plugins.invalidate())}function hee(e,t,n){const{startAngle:r,x:i,y:o,outerRadius:a,innerRadius:s,options:l}=t,{borderWidth:c,borderJoinStyle:u}=l,d=Math.min(c/a,dr(r-n));if(e.beginPath(),e.arc(i,o,a-c/2,r+d/2,n-d/2),s>0){const p=Math.min(c/s,dr(r-n));e.arc(i,o,s+c/2,n-p/2,r+p/2,!0)}else{const p=Math.min(c/2,a*dr(r-n));if(u==="round")e.arc(i,o,p,n-tt/2,r+tt/2,!0);else if(u==="bevel"){const h=2*p*p,g=-h*Math.cos(n+tt/2)+i,m=-h*Math.sin(n+tt/2)+o,v=h*Math.cos(r+tt/2)+i,y=h*Math.sin(r+tt/2)+o;e.lineTo(g,m),e.lineTo(v,y)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function mee(e,t,n){const{startAngle:r,pixelMargin:i,x:o,y:a,outerRadius:s,innerRadius:l}=t;let c=i/s;e.beginPath(),e.arc(o,a,s,r-c,n+c),l>i?(c=i/l,e.arc(o,a,l,n+c,r-c,!0)):e.arc(o,a,i,n+It,r-It),e.closePath(),e.clip()}function gee(e){return qy(e,["outerStart","outerEnd","innerStart","innerEnd"])}function vee(e,t,n,r){const i=gee(e.options.borderRadius),o=(n-t)/2,a=Math.min(o,r*t/2),s=l=>{const c=(n-Math.min(o,l))*r/2;return ln(l,0,Math.min(o,c))};return{outerStart:s(i.outerStart),outerEnd:s(i.outerEnd),innerStart:ln(i.innerStart,0,a),innerEnd:ln(i.innerEnd,0,a)}}function ra(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function pd(e,t,n,r,i,o){const{x:a,y:s,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-c,0),p=u>0?u+r+n+c:0;let h=0;const g=i-l;if(r){const N=u>0?u-r:0,L=d>0?d-r:0,B=(N+L)/2,K=B!==0?g*B/(B+r):g;h=(g-K)/2}const m=Math.max(.001,g*d-n/tt)/d,v=(g-m)/2,y=l+v+h,S=i-v-h,{outerStart:x,outerEnd:b,innerStart:O,innerEnd:E}=vee(t,p,d,S-y),C=d-x,T=d-b,k=y+x/C,R=S-b/T,M=p+O,P=p+E,D=y+O/M,j=S-E/P;if(e.beginPath(),o){const N=(k+R)/2;if(e.arc(a,s,d,k,N),e.arc(a,s,d,N,R),b>0){const z=ra(T,R,a,s);e.arc(z.x,z.y,b,R,S+It)}const L=ra(P,S,a,s);if(e.lineTo(L.x,L.y),E>0){const z=ra(P,j,a,s);e.arc(z.x,z.y,E,S+It,j+Math.PI)}const B=(S-E/p+(y+O/p))/2;if(e.arc(a,s,p,S-E/p,B,!0),e.arc(a,s,p,B,y+O/p,!0),O>0){const z=ra(M,D,a,s);e.arc(z.x,z.y,O,D+Math.PI,y-It)}const K=ra(C,y,a,s);if(e.lineTo(K.x,K.y),x>0){const z=ra(C,k,a,s);e.arc(z.x,z.y,x,y-It,k)}}else{e.moveTo(a,s);const N=Math.cos(k)*d+a,L=Math.sin(k)*d+s;e.lineTo(N,L);const B=Math.cos(R)*d+a,K=Math.sin(R)*d+s;e.lineTo(B,K)}e.closePath()}function yee(e,t,n,r,i){const{fullCircles:o,startAngle:a,circumference:s}=t;let l=t.endAngle;if(o){pd(e,t,n,r,l,i);for(let c=0;c<o;++c)e.fill();isNaN(s)||(l=a+(s%Ot||Ot))}return pd(e,t,n,r,l,i),e.fill(),l}function bee(e,t,n,r,i){const{fullCircles:o,startAngle:a,circumference:s,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:p,borderRadius:h}=l,g=l.borderAlign==="inner";if(!c)return;e.setLineDash(d||[]),e.lineDashOffset=p,g?(e.lineWidth=c*2,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let m=t.endAngle;if(o){pd(e,t,n,r,m,i);for(let v=0;v<o;++v)e.stroke();isNaN(s)||(m=a+(s%Ot||Ot))}g&&mee(e,t,m),l.selfJoin&&m-a>=tt&&h===0&&u!=="miter"&&hee(e,t,m),o||(pd(e,t,n,r,m,i),e.stroke())}class Qy extends qi{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,n,r){const i=this.getProps(["x","y"],r),{angle:o,distance:a}=bk(i,{x:t,y:n}),{startAngle:s,endAngle:l,innerRadius:c,outerRadius:u,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],r),p=(this.options.spacing+this.options.borderWidth)/2,h=Oe(d,l-s),g=gl(o,s,l)&&s!==l,m=h>=Ot||g,v=Ei(a,c+p,u+p);return m&&v}getCenterPoint(t){const{x:n,y:r,startAngle:i,endAngle:o,innerRadius:a,outerRadius:s}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:l,spacing:c}=this.options,u=(i+o)/2,d=(a+s+c+l)/2;return{x:n+Math.cos(u)*d,y:r+Math.sin(u)*d}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:n,circumference:r}=this,i=(n.offset||0)/4,o=(n.spacing||0)/2,a=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=r>Ot?Math.floor(r/Ot):0,r===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const s=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(s)*i,Math.sin(s)*i);const l=1-Math.sin(Math.min(tt,r||0)),c=i*l;t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,yee(t,this,c,o,a),bee(t,this,c,o,a),t.restore()}}function Yk(e,t,n=t){e.lineCap=Oe(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Oe(n.borderDash,t.borderDash)),e.lineDashOffset=Oe(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Oe(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Oe(n.borderWidth,t.borderWidth),e.strokeStyle=Oe(n.borderColor,t.borderColor)}function xee(e,t,n){e.lineTo(n.x,n.y)}function wee(e){return e.stepped?LZ:e.tension||e.cubicInterpolationMode==="monotone"?FZ:xee}function Gk(e,t,n={}){const r=e.length,{start:i=0,end:o=r-1}=n,{start:a,end:s}=t,l=Math.max(i,a),c=Math.min(o,s),u=i<a&&o<a||i>s&&o>s;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function Oee(e,t,n,r){const{points:i,options:o}=t,{count:a,start:s,loop:l,ilen:c}=Gk(i,n,r),u=wee(o);let{move:d=!0,reverse:p}=r||{},h,g,m;for(h=0;h<=c;++h)g=i[(s+(p?c-h:h))%a],!g.skip&&(d?(e.moveTo(g.x,g.y),d=!1):u(e,m,g,p,o.stepped),m=g);return l&&(g=i[(s+(p?c:0))%a],u(e,m,g,p,o.stepped)),!!l}function See(e,t,n,r){const i=t.points,{count:o,start:a,ilen:s}=Gk(i,n,r),{move:l=!0,reverse:c}=r||{};let u=0,d=0,p,h,g,m,v,y;const S=b=>(a+(c?s-b:b))%o,x=()=>{m!==v&&(e.lineTo(u,v),e.lineTo(u,m),e.lineTo(u,y))};for(l&&(h=i[S(0)],e.moveTo(h.x,h.y)),p=0;p<=s;++p){if(h=i[S(p)],h.skip)continue;const b=h.x,O=h.y,E=b|0;E===g?(O<m?m=O:O>v&&(v=O),u=(d*u+b)/++d):(x(),e.lineTo(b,O),g=E,d=0,m=v=O),y=O}x()}function ag(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?See:Oee}function Eee(e){return e.stepped?vJ:e.tension||e.cubicInterpolationMode==="monotone"?yJ:uo}function _ee(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),Yk(e,t.options),e.stroke(i)}function Pee(e,t,n,r){const{segments:i,options:o}=t,a=ag(t);for(const s of i)Yk(e,o,s.style),e.beginPath(),a(e,t,s,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const Cee=typeof Path2D=="function";function Tee(e,t,n,r){Cee&&!t.options.segment?_ee(e,t,n,r):Pee(e,t,n,r)}class eb extends qi{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const i=r.spanGaps?this._loop:this._fullLoop;cJ(this._points,r,t,i,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=PJ(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,i=t[n],o=this.points,a=SJ(this,{property:n,start:i,end:i});if(!a.length)return;const s=[],l=Eee(r);let c,u;for(c=0,u=a.length;c<u;++c){const{start:d,end:p}=a[c],h=o[d],g=o[p];if(h===g){s.push(h);continue}const m=Math.abs((i-h[n])/(g[n]-h[n])),v=l(h,g,m,r.stepped);v[n]=t[n],s.push(v)}return s.length===1?s[0]:s}pathSegment(t,n,r){return ag(this)(t,this,n,r)}path(t,n,r){const i=this.segments,o=ag(this);let a=this._loop;n=n||0,r=r||this.points.length-n;for(const s of i)a&=o(t,this,s,{start:n,end:n+r-1});return!!a}draw(t,n,r,i){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Tee(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function ZS(e,t,n,r){const i=e.options,{[n]:o}=e.getProps([n],r);return Math.abs(t-o)<i.radius+i.hitRadius}class tb extends qi{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,n,r){const i=this.options,{x:o,y:a}=this.getProps(["x","y"],r);return Math.pow(t-o,2)+Math.pow(n-a,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(t,n){return ZS(this,t,"x",n)}inYRange(t,n){return ZS(this,t,"y",n)}getCenterPoint(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}size(t){t=t||this.options||{};let n=t.radius||0;n=Math.max(n,n&&t.hoverRadius||0);const r=n&&t.borderWidth||0;return(n+r)*2}draw(t,n){const r=this.options;this.skip||r.radius<.1||!vl(this,n,this.size(r)/2)||(t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.fillStyle=r.backgroundColor,rg(t,r,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function Xk(e,t){const{x:n,y:r,base:i,width:o,height:a}=e.getProps(["x","y","base","width","height"],t);let s,l,c,u,d;return e.horizontal?(d=a/2,s=Math.min(n,i),l=Math.max(n,i),c=r-d,u=r+d):(d=o/2,s=n-d,l=n+d,c=Math.min(r,i),u=Math.max(r,i)),{left:s,top:c,right:l,bottom:u}}function Pi(e,t,n,r){return e?0:ln(t,n,r)}function Aee(e,t,n){const r=e.options.borderWidth,i=e.borderSkipped,o=Ck(r);return{t:Pi(i.top,o.top,0,n),r:Pi(i.right,o.right,0,t),b:Pi(i.bottom,o.bottom,0,n),l:Pi(i.left,o.left,0,t)}}function kee(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),i=e.options.borderRadius,o=ha(i),a=Math.min(t,n),s=e.borderSkipped,l=r||Ae(i);return{topLeft:Pi(!l||s.top||s.left,o.topLeft,0,a),topRight:Pi(!l||s.top||s.right,o.topRight,0,a),bottomLeft:Pi(!l||s.bottom||s.left,o.bottomLeft,0,a),bottomRight:Pi(!l||s.bottom||s.right,o.bottomRight,0,a)}}function Mee(e){const t=Xk(e),n=t.right-t.left,r=t.bottom-t.top,i=Aee(e,n/2,r/2),o=kee(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:o},inner:{x:t.left+i.l,y:t.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,o.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(i.b,i.r))}}}}function Fh(e,t,n,r){const i=t===null,o=n===null,s=e&&!(i&&o)&&Xk(e,r);return s&&(i||Ei(t,s.left,s.right))&&(o||Ei(n,s.top,s.bottom))}function jee(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function Nee(e,t){e.rect(t.x,t.y,t.w,t.h)}function Bh(e,t,n={}){const r=e.x!==n.x?-t:0,i=e.y!==n.y?-t:0,o=(e.x+e.w!==n.x+n.w?t:0)-r,a=(e.y+e.h!==n.y+n.h?t:0)-i;return{x:e.x+r,y:e.y+i,w:e.w+o,h:e.h+a,radius:e.radius}}class Zl extends qi{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:r,backgroundColor:i}}=this,{inner:o,outer:a}=Mee(this),s=jee(a.radius)?ud:Nee;t.save(),(a.w!==o.w||a.h!==o.h)&&(t.beginPath(),s(t,Bh(a,n,o)),t.clip(),s(t,Bh(o,-n,a)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),s(t,Bh(o,n)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,n,r){return Fh(this,t,n,r)}inXRange(t,n){return Fh(this,t,null,n)}inYRange(t,n){return Fh(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:i,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(n+i)/2:n,y:o?r:(r+i)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}const JS=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},Ree=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class QS extends qi{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=lt(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,i)=>t.sort(r,i,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,i=Sn(r.font),o=i.size,a=this._computeTitleHeight(),{boxWidth:s,itemHeight:l}=JS(r,o);let c,u;n.font=i.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(a,o,s,l)+10):(u=this.maxHeight,c=this._fitCols(a,i,s,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,i){const{ctx:o,maxWidth:a,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=i+s;let d=t;o.textAlign="left",o.textBaseline="middle";let p=-1,h=-u;return this.legendItems.forEach((g,m)=>{const v=r+n/2+o.measureText(g.text).width;(m===0||c[c.length-1]+v+2*s>a)&&(d+=u,c[c.length-(m>0?0:1)]=0,h+=u,p++),l[m]={left:0,top:h,row:p,width:v,height:i},c[c.length-1]+=v+s}),d}_fitCols(t,n,r,i){const{ctx:o,maxHeight:a,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=a-t;let d=s,p=0,h=0,g=0,m=0;return this.legendItems.forEach((v,y)=>{const{itemWidth:S,itemHeight:x}=Dee(r,n,o,v,i);y>0&&h+x+2*s>u&&(d+=p+s,c.push({width:p,height:h}),g+=p+s,m++,p=h=0),l[y]={left:g,top:h,col:m,width:S,height:x},p=Math.max(p,S),h+=x+s}),d+=p,c.push({width:p,height:h}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:o}}=this,a=ma(o,this.left,this.width);if(this.isHorizontal()){let s=0,l=Mn(r,this.left+i,this.right-this.lineWidths[s]);for(const c of n)s!==c.row&&(s=c.row,l=Mn(r,this.left+i,this.right-this.lineWidths[s])),c.top+=this.top+t+i,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+i}else{let s=0,l=Mn(r,this.top+t+i,this.bottom-this.columnSizes[s].height);for(const c of n)c.col!==s&&(s=c.col,l=Mn(r,this.top+t+i,this.bottom-this.columnSizes[s].height)),c.top=l,c.left+=this.left+i,c.left=a.leftForLtr(a.x(c.left),c.width),l+=c.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Uy(t,this),this._draw(),Hy(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:o,labels:a}=t,s=Ct.color,l=ma(t.rtl,this.left,this.width),c=Sn(a.font),{padding:u}=a,d=c.size,p=d/2;let h;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;const{boxWidth:g,boxHeight:m,itemHeight:v}=JS(a,d),y=function(E,C,T){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;i.save();const k=Oe(T.lineWidth,1);if(i.fillStyle=Oe(T.fillStyle,s),i.lineCap=Oe(T.lineCap,"butt"),i.lineDashOffset=Oe(T.lineDashOffset,0),i.lineJoin=Oe(T.lineJoin,"miter"),i.lineWidth=k,i.strokeStyle=Oe(T.strokeStyle,s),i.setLineDash(Oe(T.lineDash,[])),a.usePointStyle){const R={radius:m*Math.SQRT2/2,pointStyle:T.pointStyle,rotation:T.rotation,borderWidth:k},M=l.xPlus(E,g/2),P=C+p;Pk(i,R,M,P,a.pointStyleWidth&&g)}else{const R=C+Math.max((d-m)/2,0),M=l.leftForLtr(E,g),P=ha(T.borderRadius);i.beginPath(),Object.values(P).some(D=>D!==0)?ud(i,{x:M,y:R,w:g,h:m,radius:P}):i.rect(M,R,g,m),i.fill(),k!==0&&i.stroke()}i.restore()},S=function(E,C,T){cd(i,T.text,E,C+v/2,c,{strikethrough:T.hidden,textAlign:l.textAlign(T.textAlign)})},x=this.isHorizontal(),b=this._computeTitleHeight();x?h={x:Mn(o,this.left+u,this.right-r[0]),y:this.top+u+b,line:0}:h={x:this.left+u,y:Mn(o,this.top+b+u,this.bottom-n[0].height),line:0},Nk(this.ctx,t.textDirection);const O=v+u;this.legendItems.forEach((E,C)=>{i.strokeStyle=E.fontColor,i.fillStyle=E.fontColor;const T=i.measureText(E.text).width,k=l.textAlign(E.textAlign||(E.textAlign=a.textAlign)),R=g+p+T;let M=h.x,P=h.y;l.setWidth(this.width),x?C>0&&M+R+u>this.right&&(P=h.y+=O,h.line++,M=h.x=Mn(o,this.left+u,this.right-r[h.line])):C>0&&P+O>this.bottom&&(M=h.x=M+n[h.line].width+u,h.line++,P=h.y=Mn(o,this.top+b+u,this.bottom-n[h.line].height));const D=l.x(M);if(y(D,P,E),M=_Z(k,M+g+p,x?M+R:this.right,t.rtl),S(l.x(M),P,E),x)h.x+=R+u;else if(typeof E.text!="string"){const j=c.lineHeight;h.y+=Zk(E,j)+u}else h.y+=O}),Rk(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=Sn(n.font),i=pr(n.padding);if(!n.display)return;const o=ma(t.rtl,this.left,this.width),a=this.ctx,s=n.position,l=r.size/2,c=i.top+l;let u,d=this.left,p=this.width;if(this.isHorizontal())p=Math.max(...this.lineWidths),u=this.top+c,d=Mn(t.align,d,this.right-p);else{const g=this.columnSizes.reduce((m,v)=>Math.max(m,v.height),0);u=c+Mn(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const h=Mn(s,d,d+p);a.textAlign=o.textAlign(Ek(s)),a.textBaseline="middle",a.strokeStyle=n.color,a.fillStyle=n.color,a.font=r.string,cd(a,n.text,h,u,r)}_computeTitleHeight(){const t=this.options.title,n=Sn(t.font),r=pr(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,o;if(Ei(t,this.left,this.right)&&Ei(n,this.top,this.bottom)){for(o=this.legendHitBoxes,r=0;r<o.length;++r)if(i=o[r],Ei(t,i.left,i.left+i.width)&&Ei(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!Lee(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,o=Ree(i,r);i&&!o&&lt(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!o&&lt(n.onHover,[t,r,this],this)}else r&&lt(n.onClick,[t,r,this],this)}}function Dee(e,t,n,r,i){const o=Iee(r,e,t,n),a=$ee(i,r,t.lineHeight);return{itemWidth:o,itemHeight:a}}function Iee(e,t,n,r){let i=e.text;return i&&typeof i!="string"&&(i=i.reduce((o,a)=>o.length>a.length?o:a)),t+n.size/2+r.measureText(i).width}function $ee(e,t,n){let r=e;return typeof t.text!="string"&&(r=Zk(t,n)),r}function Zk(e,t){const n=e.text?e.text.length:0;return t*n}function Lee(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var mr={id:"legend",_element:QS,start(e,t,n){const r=e.legend=new QS({ctx:e.ctx,options:n,chart:e});_i.configure(e,r,n),_i.addBox(e,r)},stop(e){_i.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;_i.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:o,useBorderRadius:a,borderRadius:s}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=pr(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:a&&(s||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)}}};const ks={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,o=0;for(t=0,n=e.length;t<n;++t){const s=e[t].element;if(s&&s.hasValue()){const l=s.tooltipPosition();r.add(l.x),i+=l.y,++o}}return o===0||r.size===0?!1:{x:[...r].reduce((s,l)=>s+l)/r.size,y:i/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=Number.POSITIVE_INFINITY,o,a,s;for(o=0,a=e.length;o<a;++o){const l=e[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=tg(t,c);u<i&&(i=u,s=l)}}if(s){const l=s.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function wr(e,t){return t&&(Wt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Hr(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
345
345
  `)>-1?e.split(`
346
- `):e}function Fee(e,t){const{element:n,datasetIndex:r,index:i}=t,o=e.getDatasetMeta(r).controller,{label:a,value:s}=o.getLabelAndValue(i);return{chart:e,label:a,parsed:o.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:s,dataset:o.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function eE(e,t){const n=e.chart.ctx,{body:r,footer:i,title:o}=e,{boxWidth:a,boxHeight:s}=t,l=Sn(t.bodyFont),c=Sn(t.titleFont),u=Sn(t.footerFont),d=o.length,p=i.length,h=r.length,g=pr(t.padding);let m=g.height,v=0,y=r.reduce((b,O)=>b+O.before.length+O.lines.length+O.after.length,0);if(y+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),y){const b=t.displayColors?Math.max(s,l.lineHeight):l.lineHeight;m+=h*b+(y-h)*l.lineHeight+(y-1)*t.bodySpacing}p&&(m+=t.footerMarginTop+p*u.lineHeight+(p-1)*t.footerSpacing);let S=0;const x=function(b){v=Math.max(v,n.measureText(b).width+S)};return n.save(),n.font=c.string,Ue(e.title,x),n.font=l.string,Ue(e.beforeBody.concat(e.afterBody),x),S=t.displayColors?a+2+t.boxPadding:0,Ue(r,b=>{Ue(b.before,x),Ue(b.lines,x),Ue(b.after,x)}),S=0,n.font=u.string,Ue(e.footer,x),n.restore(),v+=g.width,{width:v,height:m}}function Bee(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function zee(e,t,n,r){const{x:i,width:o}=r,a=n.caretSize+n.caretPadding;if(e==="left"&&i+o+a>t.width||e==="right"&&i-o-a<0)return!0}function Vee(e,t,n,r){const{x:i,width:o}=n,{width:a,chartArea:{left:s,right:l}}=e;let c="center";return r==="center"?c=i<=(s+l)/2?"left":"right":i<=o/2?c="left":i>=a-o/2&&(c="right"),zee(c,e,t,n)&&(c="center"),c}function tE(e,t,n){const r=n.yAlign||t.yAlign||Bee(e,n);return{xAlign:n.xAlign||t.xAlign||Vee(e,t,n,r),yAlign:r}}function Wee(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function Uee(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function nE(e,t,n,r){const{caretSize:i,caretPadding:o,cornerRadius:a}=e,{xAlign:s,yAlign:l}=n,c=i+o,{topLeft:u,topRight:d,bottomLeft:p,bottomRight:h}=ha(a);let g=Wee(t,s);const m=Uee(t,l,c);return l==="center"?s==="left"?g+=c:s==="right"&&(g-=c):s==="left"?g-=Math.max(u,p)+i:s==="right"&&(g+=Math.max(d,h)+i),{x:ln(g,0,r.width-t.width),y:ln(m,0,r.height-t.height)}}function Uc(e,t,n){const r=pr(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function rE(e){return wr([],Hr(e))}function Hee(e,t,n){return Uo(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function iE(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const Jk={beforeTitle:Wr,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:Wr,beforeBody:Wr,beforeLabel:Wr,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return ze(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Wr,afterBody:Wr,beforeFooter:Wr,footer:Wr,afterFooter:Wr};function yn(e,t,n,r){const i=e[t].call(n,r);return typeof i>"u"?Jk[t].call(n,r):i}class oE extends qi{static positioners=ks;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,o=new Ik(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Hee(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=yn(r,"beforeTitle",this,t),o=yn(r,"title",this,t),a=yn(r,"afterTitle",this,t);let s=[];return s=wr(s,Hr(i)),s=wr(s,Hr(o)),s=wr(s,Hr(a)),s}getBeforeBody(t,n){return rE(yn(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return Ue(t,o=>{const a={before:[],lines:[],after:[]},s=iE(r,o);wr(a.before,Hr(yn(s,"beforeLabel",this,o))),wr(a.lines,yn(s,"label",this,o)),wr(a.after,Hr(yn(s,"afterLabel",this,o))),i.push(a)}),i}getAfterBody(t,n){return rE(yn(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=yn(r,"beforeFooter",this,t),o=yn(r,"footer",this,t),a=yn(r,"afterFooter",this,t);let s=[];return s=wr(s,Hr(i)),s=wr(s,Hr(o)),s=wr(s,Hr(a)),s}_createItems(t){const n=this._active,r=this.chart.data,i=[],o=[],a=[];let s=[],l,c;for(l=0,c=n.length;l<c;++l)s.push(Fee(this.chart,n[l]));return t.filter&&(s=s.filter((u,d,p)=>t.filter(u,d,p,r))),t.itemSort&&(s=s.sort((u,d)=>t.itemSort(u,d,r))),Ue(s,u=>{const d=iE(t.callbacks,u);i.push(yn(d,"labelColor",this,u)),o.push(yn(d,"labelPointStyle",this,u)),a.push(yn(d,"labelTextColor",this,u))}),this.labelColors=i,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=s,s}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let o,a=[];if(!i.length)this.opacity!==0&&(o={opacity:0});else{const s=ks[r.position].call(this,i,this._eventPosition);a=this._createItems(r),this.title=this.getTitle(a,r),this.beforeBody=this.getBeforeBody(a,r),this.body=this.getBody(a,r),this.afterBody=this.getAfterBody(a,r),this.footer=this.getFooter(a,r);const l=this._size=eE(this,r),c=Object.assign({},s,l),u=tE(this.chart,r,c),d=nE(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:s.x,caretY:s.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const o=this.getCaretPosition(t,r,i);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:o}=this,{caretSize:a,cornerRadius:s}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=ha(s),{x:p,y:h}=t,{width:g,height:m}=n;let v,y,S,x,b,O;return o==="center"?(b=h+m/2,i==="left"?(v=p,y=v-a,x=b+a,O=b-a):(v=p+g,y=v+a,x=b-a,O=b+a),S=v):(i==="left"?y=p+Math.max(l,u)+a:i==="right"?y=p+g-Math.max(c,d)-a:y=this.caretX,o==="top"?(x=h,b=x-a,v=y-a,S=y+a):(x=h+m,b=x+a,v=y+a,S=y-a),O=x),{x1:v,x2:y,x3:S,y1:x,y2:b,y3:O}}drawTitle(t,n,r){const i=this.title,o=i.length;let a,s,l;if(o){const c=ma(r.rtl,this.x,this.width);for(t.x=Uc(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",a=Sn(r.titleFont),s=r.titleSpacing,n.fillStyle=r.titleColor,n.font=a.string,l=0;l<o;++l)n.fillText(i[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+s,l+1===o&&(t.y+=r.titleMarginBottom-s)}}_drawColorBox(t,n,r,i,o){const a=this.labelColors[r],s=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=o,u=Sn(o.bodyFont),d=Uc(this,"left",o),p=i.x(d),h=l<u.lineHeight?(u.lineHeight-l)/2:0,g=n.y+h;if(o.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},v=i.leftForLtr(p,c)+c/2,y=g+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,rg(t,m,v,y),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,rg(t,m,v,y)}else{t.lineWidth=Ae(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const m=i.leftForLtr(p,c),v=i.leftForLtr(i.xPlus(p,1),c-2),y=ha(a.borderRadius);Object.values(y).some(S=>S!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ud(t,{x:m,y:g,w:c,h:l,radius:y}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),ud(t,{x:v,y:g+1,w:c-2,h:l-2,radius:y}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,g,c,l),t.strokeRect(m,g,c,l),t.fillStyle=a.backgroundColor,t.fillRect(v,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:o,bodyAlign:a,displayColors:s,boxHeight:l,boxWidth:c,boxPadding:u}=r,d=Sn(r.bodyFont);let p=d.lineHeight,h=0;const g=ma(r.rtl,this.x,this.width),m=function(T){n.fillText(T,g.x(t.x+h),t.y+p/2),t.y+=p+o},v=g.textAlign(a);let y,S,x,b,O,E,C;for(n.textAlign=a,n.textBaseline="middle",n.font=d.string,t.x=Uc(this,v,r),n.fillStyle=r.bodyColor,Ue(this.beforeBody,m),h=s&&v!=="right"?a==="center"?c/2+u:c+2+u:0,b=0,E=i.length;b<E;++b){for(y=i[b],S=this.labelTextColors[b],n.fillStyle=S,Ue(y.before,m),x=y.lines,s&&x.length&&(this._drawColorBox(n,t,b,g,r),p=Math.max(d.lineHeight,l)),O=0,C=x.length;O<C;++O)m(x[O]),p=d.lineHeight;Ue(y.after,m)}h=0,p=d.lineHeight,Ue(this.afterBody,m),t.y-=o}drawFooter(t,n,r){const i=this.footer,o=i.length;let a,s;if(o){const l=ma(r.rtl,this.x,this.width);for(t.x=Uc(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",a=Sn(r.footerFont),n.fillStyle=r.footerColor,n.font=a.string,s=0;s<o;++s)n.fillText(i[s],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r.footerSpacing}}drawBackground(t,n,r,i){const{xAlign:o,yAlign:a}=this,{x:s,y:l}=t,{width:c,height:u}=r,{topLeft:d,topRight:p,bottomLeft:h,bottomRight:g}=ha(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(s+d,l),a==="top"&&this.drawCaret(t,n,r,i),n.lineTo(s+c-p,l),n.quadraticCurveTo(s+c,l,s+c,l+p),a==="center"&&o==="right"&&this.drawCaret(t,n,r,i),n.lineTo(s+c,l+u-g),n.quadraticCurveTo(s+c,l+u,s+c-g,l+u),a==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(s+h,l+u),n.quadraticCurveTo(s,l+u,s,l+u-h),a==="center"&&o==="left"&&this.drawCaret(t,n,r,i),n.lineTo(s,l+d),n.quadraticCurveTo(s,l,s+d,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,o=r&&r.y;if(i||o){const a=ks[t.position].call(this,this._active,this._eventPosition);if(!a)return;const s=this._size=eE(this,t),l=Object.assign({},a,this._size),c=tE(n,t,l),u=nE(t,l,c,n);(i._to!==u.x||o._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=s.width,this.height=s.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},o={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const a=pr(n.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&s&&(t.save(),t.globalAlpha=r,this.drawBackground(o,t,i,n),Nk(t,n.textDirection),o.y+=a.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),Rk(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=t.map(({datasetIndex:s,index:l})=>{const c=this.chart.getDatasetMeta(s);if(!c)throw new Error("Cannot find a dataset at index "+s);return{datasetIndex:s,element:c.data[l],index:l}}),o=!ad(r,i),a=this._positionChanged(i,n);(o||a)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,o=this._active||[],a=this._getActiveElements(t,o,n,r),s=this._positionChanged(a,t),l=n||!ad(a,o)||s;return l&&(this._active=a,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,i){const o=this.options;if(t.type==="mouseout")return[];if(!i)return n.filter(s=>this.chart.data.datasets[s.datasetIndex]&&this.chart.getDatasetMeta(s.datasetIndex).controller.getParsed(s.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,o.mode,o,r);return o.reverse&&a.reverse(),a}_positionChanged(t,n){const{caretX:r,caretY:i,options:o}=this,a=ks[o.position].call(this,t,n);return a!==!1&&(r!==a.x||i!==a.y)}}var gr={id:"tooltip",_element:oE,positioners:ks,afterInit(e,t,n){n&&(e.tooltip=new oE({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:Jk},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const qee=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function Kee(e,t,n,r){const i=e.indexOf(t);if(i===-1)return qee(e,t,n,r);const o=e.lastIndexOf(t);return i!==o?n:i}const Yee=(e,t)=>e===null?null:ln(Math.round(e),0,t);function aE(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Ki extends Ga{static id="category";static defaults={ticks:{callback:aE}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:i,label:o}of n)r[i]===o&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(ze(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:Kee(r,t,Oe(n,t),this._addedLabels),Yee(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,i=[];let o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let a=t;a<=n;a++)i.push({value:a});return i}getLabelForValue(t){return aE.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function Gee(e,t){const n=[],{bounds:i,step:o,min:a,max:s,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:p}=e,h=o||1,g=u-1,{min:m,max:v}=t,y=!ze(a),S=!ze(s),x=!ze(c),b=(v-m)/(d+1);let O=sS((v-m)/g/h)*h,E,C,T,k;if(O<1e-14&&!y&&!S)return[{value:m},{value:v}];k=Math.ceil(v/O)-Math.floor(m/O),k>g&&(O=sS(k*O/g/h)*h),ze(l)||(E=Math.pow(10,l),O=Math.ceil(O*E)/E),i==="ticks"?(C=Math.floor(m/O)*O,T=Math.ceil(v/O)*O):(C=m,T=v),y&&S&&o&&gZ((s-a)/o,O/1e3)?(k=Math.round(Math.min((s-a)/O,u)),O=(s-a)/k,C=a,T=s):x?(C=y?a:C,T=S?s:T,k=c-1,O=(T-C)/k):(k=(T-C)/O,Bs(k,Math.round(k),O/1e3)?k=Math.round(k):k=Math.ceil(k));const R=Math.max(lS(O),lS(C));E=Math.pow(10,ze(l)?R:l),C=Math.round(C*E)/E,T=Math.round(T*E)/E;let M=0;for(y&&(p&&C!==a?(n.push({value:a}),C<a&&M++,Bs(Math.round((C+M*O)*E)/E,a,sE(a,b,e))&&M++):C<a&&M++);M<k;++M){const P=Math.round((C+M*O)*E)/E;if(S&&P>s)break;n.push({value:P})}return S&&p&&T!==s?n.length&&Bs(n[n.length-1].value,s,sE(s,b,e))?n[n.length-1].value=s:n.push({value:s}):(!S||T===s)&&n.push({value:T}),n}function sE(e,t,{horizontal:n,minRotation:r}){const i=Jr(r),o=(n?Math.sin(i):Math.cos(i))||.001,a=.75*t*(""+e).length;return Math.min(t/o,a)}class Xee extends Ga{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 ze(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:o}=this;const a=l=>i=n?i:l,s=l=>o=r?o:l;if(t){const l=Mr(i),c=Mr(o);l<0&&c<0?s(0):l>0&&c>0&&a(0)}if(i===o){let l=o===0?1:Math.abs(o*.05);s(o+l),t||a(i-l)}this.min=i,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,a=Gee(i,o);return t.bounds==="ticks"&&vZ(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return Wy(t,this.chart.options.locale,this.options.ticks.format)}}class Yi extends Xee{static id="linear";static defaults={ticks:{callback:_k.formatters.numeric}};determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=sr(t)?t:0,this.max=sr(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Jr(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const Af={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}},wn=Object.keys(Af);function lE(e,t){return e-t}function cE(e,t){if(ze(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:o}=e._parseOpts;let a=t;return typeof r=="function"&&(a=r(a)),sr(a)||(a=typeof r=="string"?n.parse(a,r):n.parse(a)),a===null?null:(i&&(a=i==="week"&&(ml(o)||o===!0)?n.startOf(a,"isoWeek",o):n.startOf(a,i)),+a)}function uE(e,t,n,r){const i=wn.length;for(let o=wn.indexOf(e);o<i-1;++o){const a=Af[wn[o]],s=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-t)/(s*a.size))<=r)return wn[o]}return wn[i-1]}function Zee(e,t,n,r,i){for(let o=wn.length-1;o>=wn.indexOf(n);o--){const a=wn[o];if(Af[a].common&&e._adapter.diff(i,r,a)>=t-1)return a}return wn[n?wn.indexOf(n):0]}function Jee(e){for(let t=wn.indexOf(e)+1,n=wn.length;t<n;++t)if(Af[wn[t]].common)return wn[t]}function dE(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=zy(n,t),o=n[r]>=t?n[r]:n[i];e[o]=!0}}function Qee(e,t,n,r){const i=e._adapter,o=+i.startOf(t[0].value,r),a=t[t.length-1].value;let s,l;for(s=o;s<=a;s=+i.add(s,1,r))l=n[s],l>=0&&(t[l].major=!0);return t}function fE(e,t,n){const r=[],i={},o=t.length;let a,s;for(a=0;a<o;++a)s=t[a],i[s]=a,r.push({value:s,major:!1});return o===0||!n?r:Qee(e,r,i,n)}class pE extends Ga{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),i=this._adapter=new oQ._date(t.adapters.date);i.init(n),Fs(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:cE(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:i,max:o,minDefined:a,maxDefined:s}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!s&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!a||!s)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=sr(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),o=sr(o)&&!isNaN(o)?o:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,o-1),this.max=Math.max(i+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const o=this.min,a=this.max,s=OZ(i,o,a);return this._unit=n.unit||(r.autoSkip?uE(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):Zee(this,s.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:Jee(this._unit),this.initOffsets(i),t.reverse&&s.reverse(),fE(this,s,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,i,o;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?r=o:r=(o-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;n=ln(n,0,a),r=ln(r,0,a),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,o=i.time,a=o.unit||uE(o.minUnit,n,r,this._getLabelCapacity(n)),s=Oe(i.ticks.stepSize,1),l=a==="week"?o.isoWeekday:!1,c=ml(l)||l===!0,u={};let d=n,p,h;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":a),t.diff(r,n,a)>1e5*s)throw new Error(n+" and "+r+" are too far apart with stepSize of "+s+" "+a);const g=i.ticks.source==="data"&&this.getDataTimestamps();for(p=d,h=0;p<r;p=+t.add(p,s,a),h++)dE(u,p,g);return(p===r||i.bounds==="ticks"||h===1)&&dE(u,p,g),Object.keys(u).sort(lE).map(m=>+m)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const i=this.options.time.displayFormats,o=this._unit,a=n||i[o];return this._adapter.format(t,a)}_tickFormatFunction(t,n,r,i){const o=this.options,a=o.ticks.callback;if(a)return lt(a,[t,n,r],this);const s=o.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&s[l],d=c&&s[c],p=r[n],h=c&&d&&p&&p.major;return this._adapter.format(t,i||(h?d:u))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n<r;++n)i=t[n],i.label=this._tickFormatFunction(i.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,i=Jr(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(i),a=Math.sin(i),s=this._resolveTickFontOptions(0).size;return{w:r*o+s*a,h:r*a+s*o}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,o=this._tickFormatFunction(t,0,fE(this,[t],this._majorUnit),i),a=this._getLabelSize(o),s=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return s>0?s:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)t=t.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const i=this.getLabels();for(n=0,r=i.length;n<r;++n)t.push(cE(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return wk(t.sort(lE))}}function Hc(e,t,n){let r=0,i=e.length-1,o,a,s,l;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=bo(e,"pos",t)),{pos:o,time:s}=e[r],{pos:a,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=bo(e,"time",t)),{time:o,pos:s}=e[r],{time:a,pos:l}=e[i]);const c=a-o;return c?s+(l-s)*(t-o)/c:s}class dne extends pE{static id="timeseries";static defaults=pE.defaults;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=Hc(n,this.min),this._tableRange=Hc(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],o=[];let a,s,l,c,u;for(a=0,s=t.length;a<s;++a)c=t[a],c>=n&&c<=r&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(a=0,s=i.length;a<s;++a)u=i[a+1],l=i[a-1],c=i[a],Math.round((u+l)/2)!==c&&o.push({time:c,pos:a/(s-1)});return o}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((i,o)=>i-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(Hc(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Hc(this._table,r*this._tableRange+this._minPos,!0)}}const Qk="label";function hE(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function ete(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function eM(e,t){e.labels=t}function tM(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Qk;const r=[];e.datasets=t.map(i=>{const o=e.datasets.find(a=>a[n]===i[n]);return!o||!i.data||r.includes(o)?{...i}:(r.push(o),Object.assign(o,i),o)})}function tte(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Qk;const n={labels:[],datasets:[]};return eM(n,e.labels),tM(n,e.datasets,t),n}function nte(e,t){const{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:o,type:a,data:s,options:l,plugins:c=[],fallbackContent:u,updateMode:d,...p}=e,h=I.useRef(null),g=I.useRef(null),m=()=>{h.current&&(g.current=new Tn(h.current,{type:a,data:tte(s,o),options:l&&{...l},plugins:c}),hE(t,g.current))},v=()=>{hE(t,null),g.current&&(g.current.destroy(),g.current=null)};return I.useEffect(()=>{!i&&g.current&&l&&ete(g.current,l)},[i,l]),I.useEffect(()=>{!i&&g.current&&eM(g.current.config.data,s.labels)},[i,s.labels]),I.useEffect(()=>{!i&&g.current&&s.datasets&&tM(g.current.config.data,s.datasets,o)},[i,s.datasets]),I.useEffect(()=>{g.current&&(i?(v(),setTimeout(m)):g.current.update(d))},[i,l,s.labels,s.datasets,d]),I.useEffect(()=>{g.current&&(v(),setTimeout(m))},[a]),I.useEffect(()=>(m(),()=>v()),[]),I.createElement("canvas",{ref:h,role:"img",height:n,width:r,...p},u)}const rte=I.forwardRef(nte);function nb(e,t){return Tn.register(t),I.forwardRef((n,r)=>I.createElement(rte,{...n,ref:r,type:e}))}const rb=nb("line",iQ),Jl=nb("bar",tQ),ib=nb("doughnut",rQ);Tn.register(Qy,gr,mr);const ite={id:"centerText",afterDraw(e,t,n){const{ctx:r}=e,i=e.getDatasetMeta(0);if(!i?.data?.[0])return;const{x:o,y:a}=i.data[0],{top:s="",bottom:l="",topSize:c=20,bottomSize:u=10,topColor:d="#0F172A",bottomColor:p="#64748B"}=n||{};r.save(),r.textAlign="center",r.textBaseline="middle",r.fillStyle=d,r.font=`600 ${c}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(s,o,a-5),r.fillStyle=p,r.font=`500 ${u}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(l,o,a+12),r.restore()}},ote=({sold:e=847,unsold:t=73,growthPct:n="+9.1%"})=>{const r=e+t,i={labels:["Sold","Unsold"],datasets:[{data:[e,t],backgroundColor:["#12B981","#EF4444"],borderWidth:2,hoverOffset:4}]},o={responsive:!0,maintainAspectRatio:!1,cutout:"68%",plugins:{legend:{display:!1},tooltip:{callbacks:{label:a=>`${a.label}: ${a.parsed}`},displayColors:!1},centerText:{top:`${r}`,bottom:"Total Units",topSize:20,bottomSize:10}}};return w.jsx(st,{title:"Unit Status",period:"This Month",icon:w.jsx(_g,{className:"h-6 w-6 text-green-600"}),className:"h-[238px]",children:w.jsxs("div",{className:"grid grid-cols-12 gap-[16px] items-center",children:[w.jsxs("div",{className:"col-span-5 space-y-3",children:[w.jsxs("div",{children:[w.jsx("div",{className:"!text-[12px] lending-[16px] text-[#64748B]",children:"Sold"}),w.jsx("div",{className:"text-[28px] leading-[32px] text-[#1FA05B]",children:e})]}),w.jsxs("div",{children:[w.jsx("div",{className:"!text-[12px] lending-[16px] text-[#64748B]",children:"Unsold"}),w.jsx("div",{className:"text-[28px] leading-[32px] text-[#EF4444]",children:t})]}),w.jsxs("div",{className:"text-[10px] text-[#1FA05B] flex gap-[8px] items-center ",children:[n," ",w.jsx("div",{className:"text-[#64748B] text-[10px]",children:"Compared to last month"})]})]}),w.jsx("div",{className:"col-span-7",children:w.jsx("div",{className:"h-[158px] w-[158px] ml-auto mr-2",children:w.jsx(ib,{data:i,options:o,plugins:[ite]})})})]})})},mE=({value:e=0,total:t=1,colorClass:n="",label:r=""})=>{const i=Math.max(0,Math.min(100,e/(t||1)*100)),o=n==="bg-[#8B5CF6]"?"text-[#8B5CF6]":n==="bg-[#12B981]"?"text-[#12B981]":"text-slate-600";return w.jsxs("div",{className:"flex flex-col items-start",children:[w.jsx("div",{className:"w-2/3 min-w-[80px] h-3 rounded-full overflow-hidden",children:w.jsx("div",{className:`h-3 rounded-full ${n}`,style:{width:`${i}%`}})}),w.jsx("div",{className:`${o} !text-[12px] font-bold mt-1`,children:e}),w.jsx("div",{className:"!text-[12px] text-[#64748B] mt-1",children:r})]})},gE=({title:e,value:t,suffix:n,valueClass:r=""})=>w.jsxs("div",{className:"bg-white border border-[#EBEBEB] rounded-xl shadow-[0_0_12px_0_#EAF2FF] h-[98px] p-4 flex flex-col justify-center",children:[w.jsx("div",{className:"!text-[12px] leading-[16px] text-[#121212] mb-1",children:e}),w.jsxs("div",{className:`text-[28px] leading-[32px] flex item gap-[4px] font-medium ${r}`,children:[t," ",n&&w.jsx("div",{className:"text-[28px] leading-[32px] font-medium",children:n})]})]}),ate=({totalUnits:e=847,occupiedUnits:t=756,ownerCount:n=700,tenantCount:r=56,avgResidents:i=4.4,avgLeaseMonths:o=18})=>{const a=n+r;return w.jsxs("div",{children:[w.jsxs("div",{className:"bg-white border border-[#EBEBEB] rounded-xl shadow-[0_0_12px_0_#EAF2FF] p-4 h-[128px]",children:[w.jsxs("div",{className:"flex items-center gap-[12px] mb-4",children:[w.jsx(d_,{className:"h-6 w-6 text-[#329DFF]"}),w.jsx("div",{className:"font-medium text-[#121212]",children:"Occupancy Overview"})]}),w.jsxs("div",{className:"flex items-center justify-between gap-",children:[w.jsxs("div",{children:[w.jsx("div",{className:"text-xs leading-[16px] text-[#64748B]",children:"Occupied Units"}),w.jsxs("div",{className:"flex items-center gap-1",children:[w.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),w.jsxs("div",{className:"text-[#64748B] text-[20px] leading-[32px]",children:["/",e]})]})]}),w.jsxs("div",{className:"flex items-end",children:[w.jsx(mE,{value:n,total:a,colorClass:"bg-[#8B5CF6]",label:"Owner"}),w.jsx(mE,{value:r,total:a,colorClass:"bg-[#12B981]",label:"Tenant"})]})]})]}),w.jsxs("div",{className:"mt-2.5 grid grid-cols-2 gap-[12px]",children:[w.jsx(gE,{title:"Avg Residents Per Unit",value:i,valueClass:"text-[#8B5CF6]"}),w.jsx(gE,{title:"Avg Lease Period",value:o,suffix:"months",valueClass:"text-[#E7A015]"})]})]})};Tn.register(Qy,gr,mr);const ste={id:"centerText",afterDraw(e,t,n){const{ctx:r}=e,i=e.getDatasetMeta(0);if(!i?.data?.[0])return;const{x:o,y:a}=i.data[0],{top:s="",bottom:l="",topSize:c=20,bottomSize:u=10,topColor:d="#0F172A",bottomColor:p="#64748B"}=n||{};r.save(),r.textAlign="center",r.textBaseline="middle",r.fillStyle=d,r.font=`600 ${c}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(s,o,a-5),r.fillStyle=p,r.font=`500 ${u}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(l,o,a+12),r.restore()}},lte=({ownerCount:e=1e3,tenantCount:t=200,nonResidingOwners:n=26,growthPct:r="+9.1%"})=>{const i=Math.max(e-n,0),o=e+t,a={labels:["Owners","Tenants","Non-residing Owner"],datasets:[{data:[i,t,n],backgroundColor:["#3C81F6","#08B6D4","#8B5CF6"],borderWidth:2,hoverOffset:4}]},s={responsive:!0,maintainAspectRatio:!1,cutout:"68%",plugins:{legend:{display:!1},tooltip:{callbacks:{label:l=>`${l.label}: ${l.parsed}`},displayColors:!1},centerText:{top:`${o}`,bottom:"Total Members",topSize:20,bottomSize:10}}};return w.jsx(st,{title:"Resident Overview",icon:w.jsx(u_,{className:"h-6 w-6 text-[#8B5CF6]"}),className:"h-[238px]",children:w.jsxs("div",{className:" flex-1 min-h-0 grid grid-cols-12 gap-[16px] items-center",children:[w.jsxs("div",{className:"col-span-5",children:[w.jsxs("div",{children:[w.jsx("div",{className:"!text-[12px] text-[#64748B] leading-[16px]",children:"Total Owners"}),w.jsx("div",{className:"text-[28px] leading-[32px ] text-[#3C81F6]",children:e})]}),w.jsxs("div",{children:[w.jsx("div",{className:"!text-[12px] text-[#64748B] leading-[16px]",children:"Total Tenants"}),w.jsx("div",{className:"text-[28px] leading-[32px ] text-[#08B6D4]",children:t})]}),w.jsxs("div",{className:"text-[10px] text-[#1FA05B] flex gap-2 items-center",children:[r," ",w.jsx("div",{className:"text-[#64748B] ",children:"Compared to last month"})]})]}),w.jsx("div",{className:"col-span-7",children:w.jsx("div",{className:"h-[162px] w-[162px] ml-auto mr-2",children:w.jsx(ib,{data:a,options:s,plugins:[ste]})})})]})})};Tn.register(Ki,Yi,Zl,gr,mr);const cte=({blocks:e=[{name:"Block A",owner:110,rented:24,vacant:8},{name:"Block B",owner:95,rented:18,vacant:6},{name:"Block C",owner:65,rented:12,vacant:18},{name:"Block D",owner:78,rented:16,vacant:30}]})=>{const t=e.map(s=>s.name),n=e.map(s=>s.owner),r=e.map(s=>s.rented),i=e.map(s=>s.vacant),o={labels:t,datasets:[{label:"Owner",data:n,backgroundColor:"#3C81F6",barThickness:40},{label:"",data:n.map(()=>2),backgroundColor:"transparent",barThickness:40},{label:"Rented",data:r,backgroundColor:"#8B5CF6",barThickness:40},{label:"",data:r.map(()=>2),backgroundColor:"transparent",barThickness:40},{label:"Vacant",data:i,backgroundColor:"#08B6D4",barThickness:40}]},a={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,boxWidth:10,boxHeight:10,pointStyle:"rectRot",padding:20}},tooltip:{callbacks:{label:s=>`${s.dataset.label}: ${s.parsed.y}`}}},scales:{x:{stacked:!0,grid:{display:!1},ticks:{color:"#64748B"}},y:{stacked:!0,beginAtZero:!0,suggestedMax:180,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:20}}}};return w.jsx(st,{title:"Block-wise Occupancy",period:w.jsx(qt,{className:"text-xl text-[#884EA7]"}),className:"w-full h-[360px]",titleWeight:"semi-bold",children:w.jsx(Jl,{data:o,options:a})})};Tn.register(Ki,Yi,tb,eb,gr,mr);const ute=e=>{const[t,n]=String(e).split(" ");return`${{Jan:"January",Feb:"February",Mar:"March",Apr:"April",May:"May",Jun:"June",Jul:"July",Aug:"August",Sep:"September",Oct:"October",Nov:"November",Dec:"December"}[t]||t} 20${n}`},dte=({labels:e=["Jan 25","Feb 25","Mar 25","Apr 25","May 25"],moveIn:t=[24,27,20,26,23],moveOut:n=[12,17,8,5,16]})=>{const r={labels:e,datasets:[{label:"Move-in",data:t,borderColor:"#12B981",backgroundColor:"rgba(16,185,129,0.15)",pointBackgroundColor:"#12B981",pointStyle:"rectRot",fill:!1},{label:"Move-out",data:n,borderColor:"#8B5CF6",backgroundColor:"rgba(124,58,237,0.15)",pointBackgroundColor:"#8B5CF6",pointStyle:"rectRot",fill:!1}]},i={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,boxWidth:10,boxHeight:10,padding:20}},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:0,callbacks:{title:o=>ute(o[0].label),label:o=>`${o.dataset.label}: ${o.parsed.y}`}}},scales:{x:{grid:{color:"#F1F5F9"},ticks:{color:"#64748B"}},y:{beginAtZero:!0,suggestedMax:28,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:4,precision:0}}},elements:{line:{borderWidth:2,tension:0},point:{radius:0,hoverRadius:3,hitRadius:10}}};return w.jsx(st,{title:"Move-in/Out Trends",className:"w-full h-[360px]",period:w.jsx(qt,{className:"text-[20px] text-[#884EA7]"}),titleWeight:"semi-bold",children:w.jsx(rb,{data:r,options:i})})};Tn.register(Ki,Yi,tb,eb,gr,mr);const fte=e=>{const[t,n]=String(e).split(" ");return`${{Jan:"January",Feb:"February",Mar:"March",Apr:"April",May:"May",Jun:"June",Jul:"July",Aug:"August",Sep:"September",Oct:"October",Nov:"November",Dec:"December"}[t]||t} 20${n}`},nM=({labels:e=["Jan 25","Feb 25","Mar 25","Apr 25","May 25"],moveIn:t=[24,27,20,26,23],moveOut:n=[4,17,8,5,16,4,7]})=>{const r={labels:e,datasets:[{label:"Income",data:t,borderColor:"#10B981",backgroundColor:"rgba(16,185,129,0.15)",pointBackgroundColor:"#10B981",pointStyle:"rectRot",fill:!1},{label:"Expenditure",data:n,borderColor:"#AB0000",backgroundColor:"rgba(124,58,237,0.15)",pointBackgroundColor:"#AB0000",pointStyle:"rectRot",fill:!1}]},i={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,boxWidth:10,boxHeight:10,padding:20}},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:0,callbacks:{title:o=>fte(o[0].label),label:o=>`${o.dataset.label}: ${o.parsed.y}`}}},scales:{x:{grid:{color:"#F1F5F9"},ticks:{color:"#64748B"}},y:{beginAtZero:!0,suggestedMax:28,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:4,precision:0}}},elements:{line:{borderWidth:2,tension:0},point:{radius:0,hoverRadius:3,hitRadius:10}}};return w.jsx(rb,{data:r,options:i})};function vE({label:e,value:t,positive:n,bgColor:r,delta:i,deltaLabel:o,textColor:a}){return w.jsxs("div",{className:`rounded-lg p-4 ${r} border border-[#EBEBEB] h-[126px]`,children:[w.jsx("div",{className:`text-[16px] leading-[20px] ${a}`,children:e}),w.jsx("div",{className:"mt-[16px] leading-[28px] !text-[24px] font-medium text-[#121212]",children:t}),w.jsxs("div",{className:"mt-[8px] flex items-center gap-[8px] leading-[14px] text-[10px]",children:[w.jsx("div",{className:n?"text-[#1FA05B] font-medium":"text-[#EF4444] font-medium",children:i}),w.jsx("div",{className:"text-[#64748B] ",children:o})]})]})}function pte(){return w.jsxs(st,{title:"Accounting",className:"w-full h-[523px]",period:w.jsx(qt,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:[w.jsxs("div",{className:"grid grid-cols-2 gap-[16px]",children:[w.jsx(vE,{label:"Total Income",value:"AED 5.68M",delta:"+4.4%",positive:!0,bgColor:"bg-slate-50",deltaLabel:"Compared to last month",textColor:"text-[#1FA05B]"}),w.jsx(vE,{label:"Total Expenditure",value:"AED 1.83M",delta:"-1.1%",positive:!1,bgColor:"bg-slate-50",deltaLabel:"Compared to last month",textColor:"text-[#AB0000]"})]}),w.jsx("div",{className:"h-[254px] mt-[35.5px]",children:w.jsx(nM,{})})]})}Tn.register(Ki,Yi,Zl,gr,mr);const hte=()=>{const e=["Maintenance","Security","Utilities","Housekeeping","Administration","Others"],r={labels:e,datasets:[{label:"Budget",data:[55e3,56e3,64e3,38e3,54e3,65e3],backgroundColor:"#93C5FD",barThickness:60},{label:"Actual",data:[63e3,48e3,51300,28e3,42e3,35e3],backgroundColor:"#3B82F6",barThickness:60}]},i={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,pointStyle:"rectRot",padding:20}},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:6,callbacks:{title:o=>e[o[0].dataIndex],label:o=>{const a=o.parsed.y;return`${o.dataset.label}: AED ${(a/1e3).toFixed(1)}K`}}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B"}},y:{beginAtZero:!0,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",callback:o=>`${o/1e3}K`}}}};return w.jsx(st,{title:"Budget vs Actuals",className:"w-full h-[362px]",period:w.jsx(qt,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:w.jsx(Jl,{data:r,options:i})})},mte=()=>{const e=[{title:"Primary Account",amount:285e4,subtitle:"Savings"},{title:"Emergency Fund",amount:12e5,subtitle:"Fixed deposit"},{title:"Maintenance Fund",amount:68e4,subtitle:"Current"}],t=e.reduce((r,i)=>r+i.amount,0),n=r=>r>=1e6?`AED ${(r/1e6).toFixed(2)}M`:r>=1e3?`AED ${(r/1e3).toFixed(1)}K`:`AED ${r}`;return w.jsxs(st,{title:"Cash & Bank Balance",className:"w-full h-[362px]",period:w.jsx(qt,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),children:[w.jsx("div",{className:"flex flex-col gap-[12px]",children:e.map((r,i)=>w.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-lg p-3",children:[w.jsxs("div",{className:"flex flex-col",children:[w.jsx("div",{className:"text-[14px] font-medium text-[#121212]",children:r.title}),w.jsx("div",{className:"!text-[12px] text-[#64748B]",children:r?.subtitle})]}),w.jsx("div",{className:"flex flex-col items-end",children:w.jsx("div",{className:"text-[14px] text-[#1FA05B] font-semibold",children:n(r.amount)})})]},i))}),w.jsxs("div",{className:"flex items-center justify-between border-t border-[#EBEBEB] h-[68px] px-3",children:[w.jsx("div",{className:"text-[14px] font-medium text-[#121212]",children:"Total"}),w.jsx("div",{className:"text-[16px] text-[#1FA05B] font-bold",children:n(t)})]})]})};Tn.register(Ki,Yi,Zl,gr,mr);const gte=()=>{const e=["Current Month","1-3 Months","3-6 Months","6+ Months"],t=[13e3,9400,8800,7200],n=[18,12,18,6],r={labels:e,datasets:[{label:"Due",data:t,backgroundColor:"#EF4444",barThickness:60}]},i={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:6,callbacks:{title:o=>e[o[0].dataIndex],label:o=>`Due: AED ${(o.parsed.y/1e3).toFixed(1)}K`,afterLabel:o=>`Units Count: ${n[o.dataIndex]}`}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B"}},y:{beginAtZero:!0,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",callback:o=>`${o/1e3}K`}}}};return w.jsxs(st,{title:"Dues Ageing",className:"w-full h-[362px]",period:w.jsx(qt,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:[w.jsx("div",{className:"grid grid-cols-4 md:grid-cols-4 gap-[12px] h-[48px]",children:e.map((o,a)=>w.jsx("div",{className:"p-2 rounded-lg bg-slate-50",children:w.jsxs("div",{className:"flex justify-between items-start",children:[w.jsx("div",{className:"font-medium leading-[16px] !text-[12px] rounded",children:o}),w.jsxs("div",{className:"text-right",children:[w.jsxs("div",{className:"text-red-600 font-medium leading-[16px] !text-[12px]",children:["AED ",(t[a]/1e3).toFixed(1),"K"]}),w.jsxs("div",{className:" text-gray-500 leading-[14px] text-[10px]",children:[n[a]," Units"]})]})]})},o))}),w.jsx("div",{className:"h-[192px]",children:w.jsx(Jl,{data:r,options:i})})]})};Tn.register(Qy,gr,mr);const vte=()=>{const e=["Maintenance","Utilities","Security","Administration","Others"],t=[45e4,32e4,28e4,18e4,12e4],n={labels:e,datasets:[{label:"Expenses",data:t,backgroundColor:["#08B6D4","#8B5CF6","#EF4444","#F69E0A","#12B981"],borderColor:"#FFFFFF",borderWidth:2,cutout:"70%"}]},r=t.reduce((o,a)=>o+a,0),i={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:10,callbacks:{label:o=>`${o.label}: AED ${o.formattedValue}`}}}};return w.jsxs(st,{title:"Expense Categories",className:"w-full h-[523px]",period:w.jsx(qt,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:[w.jsxs("div",{className:"relative h-[259px] flex justify-center items-center",children:[w.jsx(ib,{data:n,options:i}),w.jsxs("div",{className:"absolute text-center",children:[w.jsxs("div",{className:"!text-[24px] font-medium leading-[28px] text-[#121212]",children:["AED ",(r/1e6).toFixed(2),"M"]}),w.jsx("div",{className:"text-[#121212] leading-[18px] text-[14px]",children:"Total Expenses"})]})]}),w.jsx("div",{className:"space-y-2",children:e.map((o,a)=>w.jsxs("div",{className:"flex justify-between items-center text-[14px] pb-2",children:[w.jsxs("div",{className:"flex items-center gap-[8px] !text-[12px] leading-[16px] text-[#64748B]",children:[w.jsx("div",{className:"w-[7px] h-[7px] rotate-45",style:{backgroundColor:n.datasets[0].backgroundColor[a]}}),o]}),w.jsxs("div",{className:"leading-[16px] !text-[12px] text-[#64748B]",children:["AED ",(t[a]/1e3).toFixed(0),"K"]})]},o))})]})},bs=[{name:"Gym Equipment",value:1e6,color:"#08B6D4"},{name:"Security",value:8e5,color:"#EF4444"},{name:"Others",value:6e5,color:"#F59E0B"},{name:"Pool Maintenance",value:7e5,color:"#8B5CF6"},{name:"Administration",value:52e4,color:"#10B981"}];function yte(){const e=bs.reduce((t,n)=>t+n.value,0);return w.jsx(st,{title:"Asset Value Breakdown",period:w.jsx(qt,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"h-[362px]",titleWeight:"semi-bold",children:w.jsxs("div",{className:"flex flex-col items-center justify-center",children:[w.jsxs("div",{className:"w-[214px] h-[181px] relative",children:[w.jsx(Vo,{width:"100%",height:"100%",children:w.jsxs(ff,{children:[w.jsx(Hl,{data:bs,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:bs.map((t,n)=>w.jsx(Ir,{fill:t.color},`cell-${n}`))}),w.jsx(zo,{formatter:t=>`AED ${t.toLocaleString()}`})]})}),w.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[w.jsxs("div",{className:"font-medium text-lg leading-[12px] ",children:["AED ",(e/1e6).toFixed(2),"M"]}),w.jsx("div",{className:"text-[10px] leading-[12.59px] text-[#121212] mt-[6px]",children:"Total Assets"})]})]}),w.jsxs("div",{className:"flex justify-between w-full px-4 sm:px-8 mt-4 text-[14px]",children:[w.jsx("div",{className:"flex flex-col gap-[8px]",children:bs.slice(0,3).map(t=>w.jsxs("div",{className:"flex items-center gap-[8px]",children:[w.jsx("div",{className:"inline-block h-[7px] w-[7px] rotate-45",style:{backgroundColor:t.color}}),w.jsx("div",{className:"text-[#64748B] leading-[16px] !text-[12px]",children:t.name})]},t.name))}),w.jsx("div",{className:"flex flex-col gap-[8px] items-start",children:bs.slice(3).map(t=>w.jsxs("div",{className:"flex items-center gap-[8px]",children:[w.jsx("div",{className:"inline-block h-[7px] w-[7px] rotate-45",style:{backgroundColor:t.color}}),w.jsx("div",{className:"text-[#64748B] leading-[16px] !text-[12px]",children:t.name})]},t.name))})]})]})})}Tn.register(Ki,Yi,Zl,gr,mr);const bte=()=>{const e=["Gym","Parking","Swimming Pool","Community Hall","Tennis Court"],t=[13e3,9400,8800,7200,6e3],n=[18,12,18,6],r={labels:e,datasets:[{label:"Due",data:t,backgroundColor:"#8B5CF6",barThickness:60}]},i={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:6,callbacks:{title:o=>e[o[0].dataIndex],label:o=>`Due: AED ${(o.parsed.y/1e3).toFixed(1)}K`,afterLabel:o=>`Units Count: ${n[o.dataIndex]}`}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B"}},y:{beginAtZero:!0,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",callback:o=>`${o/1e3}K`}}}};return w.jsx(st,{title:"Revenue by Category",className:"w-full h-[362px]",period:w.jsx(qt,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:w.jsx(Jl,{data:r,options:i})})};function xte(e){return Xe({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15 5l0 2"},child:[]},{tag:"path",attr:{d:"M15 11l0 2"},child:[]},{tag:"path",attr:{d:"M15 17l0 2"},child:[]},{tag:"path",attr:{d:"M5 5h14a2 2 0 0 1 2 2v3a2 2 0 0 0 0 4v3a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-3a2 2 0 0 0 0 -4v-3a2 2 0 0 1 2 -2"},child:[]}]})(e)}function wte(e){return Xe({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M855.7 210.8l-42.4-42.4a8.03 8.03 0 0 0-11.3 0L168.3 801.9a8.03 8.03 0 0 0 0 11.3l42.4 42.4c3.1 3.1 8.2 3.1 11.3 0L855.6 222c3.2-3 3.2-8.1.1-11.2zM304 448c79.4 0 144-64.6 144-144s-64.6-144-144-144-144 64.6-144 144 64.6 144 144 144zm0-216c39.7 0 72 32.3 72 72s-32.3 72-72 72-72-32.3-72-72 32.3-72 72-72zm416 344c-79.4 0-144 64.6-144 144s64.6 144 144 144 144-64.6 144-144-64.6-144-144-144zm0 216c-39.7 0-72-32.3-72-72s32.3-72 72-72 72 32.3 72 72-32.3 72-72 72z"},child:[]}]})(e)}function Ote({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=El,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return w.jsxs(st,{title:e,icon:w.jsx("div",{className:"h-6 w-6 grid place-items-center",children:w.jsx(o,{className:`h-6 w-6 ${a}`})}),children:[w.jsx("div",{className:"text-4xl font-semibold tracking-tight text-[#121212]",children:t}),w.jsxs("div",{className:"flex items-center gap-[8px] text-[14px]",children:[w.jsx("div",{className:i?"text-emerald-600 font-medium":"text-rose-600 font-medium",children:n}),w.jsx("div",{className:"text-slate-500",children:r})]})]})}function Ste(){const e=[{title:"Total Bookings",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:c_,iconColor:"text-emerald-600"},{title:"Utilisation Rate",value:73,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:wte,iconColor:"text-[#329DFF]"},{title:"Revenue",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:xte,iconColor:"text-[#FA7E28]"},{title:"Pending Dues",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:f_,iconColor:"text-[#DBB467]"}];return w.jsx("div",{className:"px-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:e.map((t,n)=>w.jsx(Ote,{...t},n))})}const qc=[{name:"Completed",value:46,color:"#12B981"},{name:"Delayed",value:2,color:"#EF4444"},{name:"Missed",value:2,color:"#F69E0A"}];function Ete(){const t=qc.find(n=>n.name==="Completed")?.value||0;return w.jsx(st,{title:"Guard Patrols",period:w.jsx(qt,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"h-[362px]",children:w.jsxs("div",{className:"flex flex-col items-center justify-center",children:[w.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[w.jsx(Vo,{width:"100%",height:"100%",children:w.jsxs(ff,{children:[w.jsx(Hl,{data:qc,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:qc.map((n,r)=>w.jsx(Ir,{fill:n.color},`cell-${r}`))}),w.jsx(zo,{formatter:n=>n.toLocaleString()})]})}),w.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[w.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px] ",children:[t,"/",50]}),w.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),w.jsx("div",{className:"flex flex-col gap-[8px] mt-3 w-full px-6 text-[14px]",children:qc.map(n=>w.jsxs("div",{className:"flex items-center justify-between",children:[w.jsxs("div",{className:"flex items-center gap-[8px]",children:[w.jsx("div",{className:"inline-block w-[7px] h-[7px] rotate-45",style:{backgroundColor:n.color}}),w.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:n.name})]}),w.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:n.value})]},n.name))})]})})}Tn.register(Ki,Yi,tb,eb,gr,mr);const _te=()=>{const t={labels:["10 AM","12 PM","2 PM","4 PM","6 PM","8 PM","10 PM"],datasets:[{label:"Guest",data:[9,5,12,7,3,6,4],borderColor:"#EF4444",backgroundColor:"rgba(239,68,68,0.15)",pointBackgroundColor:"#EF4444",pointStyle:"rectRot",fill:!1},{label:"Cab",data:[15,12,10,14,7,12,8],borderColor:"#7C3AED",backgroundColor:"rgba(124,58,237,0.15)",pointBackgroundColor:"#7C3AED",pointStyle:"rectRot",fill:!1},{label:"Delivery",data:[22,18,16,20,22,14,17],borderColor:"#10B981",backgroundColor:"rgba(16,185,129,0.15)",pointBackgroundColor:"#10B981",pointStyle:"rectRot",fill:!1},{label:"Service",data:[13,12,8,9,5,10,7],borderColor:"#F59E0B",backgroundColor:"rgba(245,158,11,0.15)",pointBackgroundColor:"#F59E0B",pointStyle:"rectRot",fill:!1}]},n={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,boxWidth:10,boxHeight:10,padding:20}},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:0,callbacks:{title:r=>r[0].label,label:r=>`${r.dataset.label} ${r.parsed.y}`}}},scales:{x:{grid:{color:"#F1F5F9"},ticks:{color:"#64748B"}},y:{beginAtZero:!0,suggestedMax:28,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:4,precision:0}}},elements:{line:{borderWidth:2,tension:0},point:{radius:0,hoverRadius:3,hitRadius:10}}};return w.jsx(st,{title:"Hourly Traffic Flow",className:"w-full h-[362px]",period:w.jsx(qt,{className:"text-[20px] text-[#884EA7]"}),children:w.jsx(rb,{data:t,options:n})})};function Pte(){return w.jsx(st,{title:"Incident Reports",period:w.jsx(qt,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"h-[362px]",children:w.jsxs("div",{children:[w.jsxs("div",{className:"flex w-full text-center gap-[24px]",children:[w.jsxs("div",{className:"flex-1 py-3 bg-[#FBF4F4] h-[76px] rounded",children:[w.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#AB0000]",children:"3"}),w.jsx("div",{className:"!text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),w.jsxs("div",{className:"flex-1 py-3 bg-[#FFFBF2] h-[76px] rounded",children:[w.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#E7A015]",children:"5"}),w.jsx("div",{className:"!text-[12px] leading-[16px] text-[#E7A015]",children:"In-progress"})]}),w.jsxs("div",{className:"flex-1 py-3 bg-[#F7FEFA] h-[76px] rounded",children:[w.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:"12"}),w.jsx("div",{className:"!text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),w.jsxs("div",{className:"mt-4 ",children:[w.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#FAFBFD] rounded-md border border-[#FAFBFD]",children:[w.jsxs("div",{className:"flex items-center gap-[8px]",children:[w.jsx("div",{className:"w-4 h-4 rounded-full flex items-center justify-center bg-[#AB0000]",children:w.jsx("div",{className:"text-white !text-[12px] font-bold",children:"!"})}),w.jsx("div",{className:"text-gray-700 font-medium",children:"INC 001"})]}),w.jsxs("div",{className:"px-3 py-1 rounded-full !text-[12px] font-semibold flex items-center gap-[4px] text-[#AB0000] bg-red-50",children:[w.jsx("div",{children:"4 - Danger"}),w.jsx("div",{className:"w-2 h-2 rounded-full bg-[#AB0000]"})]})]}),w.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#FAFBFD] rounded-md border border-[#FAFBFD]",children:[w.jsxs("div",{className:"flex items-center gap-[8px]",children:[w.jsx("div",{className:"w-4 h-4 rounded-full flex items-center justify-center bg-[#E7A015]",children:w.jsx(a0,{className:"text-white text-[10px]"})}),w.jsx("div",{className:"text-gray-700 font-medium",children:"INC 002"})]}),w.jsxs("div",{className:"px-3 py-1 rounded-full !text-[12px] font-semibold flex items-center gap-[4px] text-[#E7A015] bg-yellow-50",children:[w.jsx("div",{children:"3 - High"}),w.jsx("div",{className:"w-2 h-2 rounded-full bg-[#E7A015]"})]})]}),w.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#FAFBFD] rounded-md border border-[#FAFBFD]",children:[w.jsxs("div",{className:"flex items-center gap-[8px]",children:[w.jsx("div",{className:"w-4 h-4 rounded-full flex items-center justify-center bg-[#1FA05B]",children:w.jsx(a0,{className:"text-white text-[10px]"})}),w.jsx("div",{className:"text-gray-700 font-medium",children:"INC 003"})]}),w.jsxs("div",{className:"px-3 py-1 rounded-full !text-[12px] font-semibold flex items-center gap-[4px] text-[#1FA05B] bg-green-50",children:[w.jsx("div",{children:"1 - Low"}),w.jsx("div",{className:"w-2 h-2 rounded-full bg-[#1FA05B]"})]})]})]})]})})}function Cte(){return w.jsx(st,{title:"Staff Attendance",period:w.jsx(qt,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"h-[362px]",children:w.jsxs("div",{children:[w.jsxs("div",{className:"flex w-full text-center h-[76px] gap-[16px] mb-2",children:[w.jsxs("div",{className:"flex-1 py-4 bg-green-50 rounded-md",children:[w.jsx("div",{className:"!text-[24px] leading-[18px] font-medium text-[#1FA05B] pb-[8px]",children:"25"}),w.jsx("div",{className:"!text-[12px] leading-[16px] text-[#1FA05B]",children:"Present"})]}),w.jsxs("div",{className:"flex-1 py-4 bg-red-50 rounded-md",children:[w.jsx("div",{className:"!text-[24px] leading-[18px] font-medium text-[#AB0000] pb-[8px]",children:"1"}),w.jsx("div",{className:"!text-[12px] leading-[16px] text-[#AB0000]",children:"Absent"})]})]}),w.jsxs("div",{className:"mt-[24px] ",children:[w.jsxs("div",{className:"flex justify-between items-center p-3 bg-[#FAFBFD] rounded-md",children:[w.jsx("div",{className:" font-medium !text-[12px] leading-[18px]",children:"Security guards"}),w.jsx("div",{className:"text-[#64748B] leading[20px] text-[14px]",children:"12/12 Present"})]}),w.jsxs("div",{className:"flex justify-between items-center p-3 bg-[#FAFBFD] rounded-md",children:[w.jsx("div",{className:" font-medium !text-[12px] leading-[18px]",children:"Housekeeping"}),w.jsx("div",{className:"text-[#64748B] leading[20px] text-[14px]",children:"7/8 Present"})]}),w.jsxs("div",{className:"flex justify-between items-center p-3 bg-[#FAFBFD] rounded-md",children:[w.jsx("div",{className:" font-medium !text-[12px] leading-[18px]",children:"Maintenance"}),w.jsx("div",{className:"text-[#64748B] leading[20px] text-[14px]",children:"4/4 Present"})]}),w.jsxs("div",{className:"flex justify-between items-center p-3 bg-[#FAFBFD] rounded-md",children:[w.jsx("div",{className:" font-medium !text-[12px] leading-[18px]",children:"Gardening"}),w.jsx("div",{className:"text-[#64748B] leading[20px] text-[14px]",children:"2/2 Present"})]})]})]})})}function Tte(e){return Xe({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M116,132V96a12,12,0,0,1,24,0v36a12,12,0,0,1-24,0Zm12,56a16,16,0,1,0-16-16A16,16,0,0,0,128,188ZM228,56v56c0,54.29-26.32,87.22-48.4,105.29-23.71,19.39-47.44,26-48.44,26.29a12.1,12.1,0,0,1-6.32,0c-1-.28-24.73-6.9-48.44-26.29C54.32,199.22,28,166.29,28,112V56A20,20,0,0,1,48,36H208A20,20,0,0,1,228,56Zm-24,4H52v52c0,35.71,13.09,64.69,38.91,86.15A126.14,126.14,0,0,0,128,219.38a126.28,126.28,0,0,0,37.09-21.23C190.91,176.69,204,147.71,204,112Z"},child:[]}]})(e)}function Ate({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=El,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return w.jsxs(st,{title:e,icon:w.jsx("div",{className:"h-6 w-6 grid place-items-center",children:w.jsx(o,{className:`h-6 w-6 ${a}`})}),children:[w.jsx("div",{className:"text-4xl font-semibold tracking-tight text-[#121212]",children:t}),w.jsxs("div",{className:"flex items-center gap-[8px] text-[14px]",children:[w.jsx("div",{className:i?"text-emerald-600 font-medium":"text-rose-600 font-medium",children:n}),w.jsx("div",{className:"text-slate-500",children:r})]})]})}function kte(){const e=[{title:"Total Visitors",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:d_,iconColor:"text-[#329DFF]"},{title:"Active Incidents",value:73,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:UG,iconColor:"text-[#F69E0A]"},{title:"Missed Patrols",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Tte,iconColor:"text-[#AB0000]"},{title:"Parking Usage",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:oD,iconColor:"text-[#36AB6C]"}];return w.jsx("div",{className:"px-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:e.map((t,n)=>w.jsx(Ate,{...t},n))})}function Mte({data:e=[]}){console.log(e,"complaints data");const t=Array.isArray(e)?e.map(n=>({title:n.category_name||"—",total:n.total||0,pending:n.pending||0})):[];return w.jsx(st,{title:"Complaints",period:w.jsx(qt,{className:"text-[20px] text-[#884EA7]"}),className:"h-[362px]",children:w.jsx("div",{className:"flex flex-col gap-[12px]",children:t.length>0?t.map((n,r)=>w.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-lg p-3 h-[62px]",children:[w.jsxs("div",{className:"flex flex-col",children:[w.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212]",children:n.title}),w.jsxs("div",{className:"!text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),w.jsxs("div",{className:"flex flex-col items-end",children:[w.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),w.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},r)):w.jsx("div",{className:"text-center text-gray-500 py-8",children:"No data available"})})})}Tn.register(Ki,Yi,Zl,gr,mr);const yE=[{key:"closed_count",label:"Closed",color:"#12B981"},{key:"in_progress_count",label:"In Progress",color:"#F59D0D"},{key:"open_count",label:"Open",color:"#EF4444"}],jte=({data:e=[]})=>{console.log(e,"data for complaint");const t=I.useMemo(()=>{if(!Array.isArray(e)||e.length===0)return{labels:[],datasets:[]};const r=e.map(s=>s.level??"—"),i=Math.max(...e.map(s=>Number(s.total||0)),0),o=e.map(()=>1),a=yE.flatMap((s,l)=>[{label:s.label,data:e.map(c=>Number(c[s.key]||0)),backgroundColor:s.color,barThickness:44},...l<yE.length-1?[{label:"",data:o,backgroundColor:"transparent",barThickness:44}]:[]]);return{labels:r,datasets:a,maxTotal:i}},[e]),n={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,boxWidth:10,boxHeight:10,pointStyle:"rectRot"}},tooltip:{callbacks:{label:r=>r.dataset.label?`${r.dataset.label}: ${r.parsed.y}`:null}}},scales:{x:{stacked:!0,grid:{display:!1}},y:{stacked:!0,beginAtZero:!0,suggestedMax:Math.ceil(t.maxTotal*1.2)||5,ticks:{stepSize:Math.max(Math.ceil(t.maxTotal/6),1)}}}};return w.jsx(st,{title:"Complaints by Level",className:"w-full h-[362px]",period:w.jsx(qt,{className:"text-[20px] text-[#884EA7]"}),children:w.jsx(Jl,{data:t,options:n})})};function Nte({data:e={}}){console.log(e,"request box data");const t=Array.isArray(e?.request_box_by_type)?e.request_box_by_type.map(n=>({title:n.category_name||"—",total:Number(n.total)||0,pending:Number(n.pending)||0})):[];return w.jsx(st,{title:"Request Box",period:w.jsx(qt,{className:"text-[20px] text-[#884EA7]"}),className:"h-[362px]",children:w.jsx("div",{className:"flex flex-col gap-[12px]",children:t.length>0?t.map((n,r)=>w.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-lg p-3 h-[62px]",children:[w.jsxs("div",{className:"flex flex-col",children:[w.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212]",children:n.title}),w.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),w.jsxs("div",{className:"flex flex-col items-end",children:[w.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),w.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},`${n.title}-${r}`)):w.jsx("div",{className:"text-center text-gray-500 py-8",children:"No data available"})})})}function Rte(e){return Xe({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinejoin:"round",strokeWidth:"32",d:"M416 221.25V416a48 48 0 0 1-48 48H144a48 48 0 0 1-48-48V96a48 48 0 0 1 48-48h98.75a32 32 0 0 1 22.62 9.37l141.26 141.26a32 32 0 0 1 9.37 22.62z"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M256 56v120a32 32 0 0 0 32 32h120m-232 80h160m-160 80h160"},child:[]}]})(e)}function Dte({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=El,iconColor:a="text-emerald-600"}){return w.jsxs(st,{title:e,icon:w.jsx("div",{className:"h-6 w-6 grid place-items-center",children:w.jsx(o,{className:`h-6 w-6 ${a}`})}),children:[w.jsx("div",{className:"text-4xl font-semibold tracking-tight text-[#121212]",children:t??"—"}),w.jsxs("div",{className:"flex items-center gap-[8px] text-[14px]",children:[w.jsx("div",{className:i?"text-emerald-600 font-medium":"text-rose-600 font-medium",children:n??"—"}),w.jsx("div",{className:"text-slate-500",children:r})]})]})}function Ite({data:e}){console.log(e,"stats grid data");const n=[{key:"open_complaints",title:"Open Complaints",Icon:c_,iconColor:"text-[#AB0000]",deltaLabel:"Compared to last month"},{key:"pending_requests",title:"Pending Requests",Icon:Rte,iconColor:"text-[#E7A015]",deltaLabel:"Compared to last month"},{key:"avg_response_time",title:"Avg Response Time",Icon:nD,iconColor:"text-[#1FA05B]",deltaLabel:"Compared to last month"},{key:"resolution_rate",title:"Resolution Rate",Icon:JR,iconColor:"text-[#329DFF]",deltaLabel:"Compared to last month"}].map(r=>{const i=e?.[r.key]||{};return{title:r.title,value:i.current??"—",delta:i.trend_percent??"—",positive:i.direction==="good"||i.direction==="neutral",Icon:r.Icon,iconColor:r.iconColor,deltaLabel:r.deltaLabel}});return w.jsx("div",{className:"px-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:n.map((r,i)=>w.jsx(Dte,{...r},i))})}function bE({title:e,date:t,rsvp:n,utilisation:r,status:i}){return w.jsxs("div",{className:" bg-[#F8FAFC] h-[106px] px-3 mt-3",children:[w.jsxs("div",{className:"flex items-center justify-between",children:[w.jsx("div",{className:"text-[16px] leading-[20px] font-semibold text-[#121212]",children:e}),w.jsx("div",{className:`!text-[12px] font-medium leading-[16px] px-2 py-1 ${i==="Completed"?"text-[#36AB6C] bg-[#E6F7EE]":i==="Upcoming"?"text-[#329DFF] bg-[#E6F2FF]":"text-slate-500 bg-slate-100"}`,children:i})]}),w.jsx("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:t}),w.jsxs("div",{className:"flex justify-between items-center mt-2",children:[w.jsxs("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:[n," RSVP"]}),w.jsxs("div",{className:"text-[#3C82F6] text-[14px] leading-[18px] font-medium",children:[r,"% utilisation"]})]}),w.jsx("div",{className:"w-full bg-[#F8FAFC] h-[6px] rounded mt-2 mb-3",children:w.jsx("div",{className:"h-[6px] rounded bg-[#3C82F6]",style:{width:`${r}%`}})})]})}function $te(){return w.jsx(st,{title:"Events Utilisation",period:w.jsx(qt,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"w-full h-[360px]",children:w.jsxs("div",{children:[w.jsx(bE,{title:"Holi Celebration",date:"25 Jun 2025",rsvp:"78/100",utilisation:71,status:"Upcoming"}),w.jsx(bE,{title:"Maintenance Meeting",date:"25 Jun 2025",rsvp:"45/60",utilisation:75,status:"Completed"})]})})}function Kc({label:e,value:t,subLabel:n,bgColor:r,textColor:i}){return w.jsxs("div",{className:`rounded-lg p-4 ${r} h-[124px]`,children:[w.jsx("div",{className:`text-[16px] font-medium ${i} leading-[20px]`,children:e}),w.jsx("div",{className:"mt-4 text-[28px] leading-[32px] font-semibold text-[#121212]",children:t}),w.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-2",children:n})]})}function Lte(){return w.jsx(st,{title:"Notice Board Status",period:w.jsx(qt,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"w-full h-[360px]",children:w.jsxs("div",{className:"grid grid-cols-2 gap-[16px]",children:[w.jsx(Kc,{label:"Active",value:138,subLabel:"3 expiring soon",bgColor:"bg-[#F0FFF7]",textColor:"text-[#1FA05B]"}),w.jsx(Kc,{label:"Scheduled",value:13,subLabel:"4 this week",bgColor:"bg-[#FFFBF2]",textColor:"text-[#E7A015]"}),w.jsx(Kc,{label:"Recurring",value:3,subLabel:"All active",bgColor:"bg-[#EDF6FF]",textColor:"text-[#329DFF]"}),w.jsx(Kc,{label:"Expired",value:7,subLabel:"4 recent",bgColor:"bg-[#F6F6F6]",textColor:"text-[#64748B]"})]})})}function rM(e){return Xe({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M20 22H4C3.44772 22 3 21.5523 3 21V3C3 2.44772 3.44772 2 4 2H20C20.5523 2 21 2.44772 21 3V21C21 21.5523 20.5523 22 20 22ZM19 20V4H5V20H19ZM8 9H16V11H8V9ZM8 13H16V15H8V13Z"},child:[]}]})(e)}function Fte({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=El,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return w.jsx(st,{title:e,icon:w.jsx("div",{className:`h-6 w-6 grid place-items-center rounded-md ${s}`,children:w.jsx(o,{className:`h-4 w-4 ${a}`})}),className:"h-[132px]",children:w.jsxs("div",{children:[w.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),w.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[w.jsx("div",{className:i?"text-[#1FA05B] font-medium":"text-rose-600 font-medium",children:n}),w.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}function Bte({data:e}){const t=[{title:e?.title||"Total Bookings",value:145,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:rM,iconColor:"text-emerald-600",iconBg:"bg-emerald-50"}];return w.jsx("div",{className:"h-full",children:t.map((n,r)=>w.jsx(Fte,{...n},r))})}function zte(e){return Xe({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"},child:[]}]})(e)}function Vte({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=El,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return w.jsx(st,{title:e,icon:w.jsx("div",{className:`h-6 w-6 grid place-items-center rounded-md ${s}`,children:w.jsx(o,{className:`h-4 w-4 ${a}`})}),className:"h-[132px]",children:w.jsxs("div",{children:[w.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),w.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[w.jsx("div",{className:i?"text-[#1FA05B] font-medium":"text-rose-600 font-medium",children:n}),w.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}function Wte(){const e=[{title:"Notice",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:rM,iconColor:"text-emerald-600",iconBg:"bg-emerald-50"},{title:"Post",value:83,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:aD,iconColor:"text-[#329DFF]",iconBg:"bg-emerald-50"},{title:"Poll",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:VG,iconColor:"text-[#FA7E28]",iconBg:"bg-orange-100"},{title:"Poll",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:zte,iconColor:"text-[#DBB467]",iconBg:"bg-yellow-100"}];return w.jsx("div",{className:"px-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:e.map((t,n)=>w.jsx(Vte,{...t},n))})}exports.Accounting=pte;exports.AssetValueBreakdown=yte;exports.BlockWiseOccupancy=cte;exports.Budgets=hte;exports.Card=st;exports.CashBankBalance=mte;exports.Community=qG;exports.Complaints=Mte;exports.ComplaintsByLevel=jte;exports.DuesAgeing=gte;exports.Engagement=KG;exports.EngagementStatsGrid=Wte;exports.EventsUtilisation=$te;exports.ExpenseCategories=vte;exports.Facilities=YG;exports.FinanceSummary=GG;exports.GateAndSecurityStatsGrid=kte;exports.GateUpdates=DX;exports.GuardPatrols=Ete;exports.Header=rD;exports.Helpdesk=IX;exports.HelpdeskStatsGrid=Ite;exports.HourlyTrafficFlow=_te;exports.IncidentReports=Pte;exports.IncomeExpenditure=nM;exports.MainHeader=cD;exports.MoveInOutTrends=dte;exports.NoticeBoardStatus=Lte;exports.OccupancyOverview=ate;exports.RequestBox=Nte;exports.ResidentOverview=lte;exports.RevenuebyCategory=bte;exports.SingleStats=Bte;exports.StaffAttendance=Cte;exports.StatsGrid=Ste;exports.UnitStatus=ote;
346
+ `):e}function Fee(e,t){const{element:n,datasetIndex:r,index:i}=t,o=e.getDatasetMeta(r).controller,{label:a,value:s}=o.getLabelAndValue(i);return{chart:e,label:a,parsed:o.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:s,dataset:o.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function eE(e,t){const n=e.chart.ctx,{body:r,footer:i,title:o}=e,{boxWidth:a,boxHeight:s}=t,l=Sn(t.bodyFont),c=Sn(t.titleFont),u=Sn(t.footerFont),d=o.length,p=i.length,h=r.length,g=pr(t.padding);let m=g.height,v=0,y=r.reduce((b,O)=>b+O.before.length+O.lines.length+O.after.length,0);if(y+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),y){const b=t.displayColors?Math.max(s,l.lineHeight):l.lineHeight;m+=h*b+(y-h)*l.lineHeight+(y-1)*t.bodySpacing}p&&(m+=t.footerMarginTop+p*u.lineHeight+(p-1)*t.footerSpacing);let S=0;const x=function(b){v=Math.max(v,n.measureText(b).width+S)};return n.save(),n.font=c.string,Ue(e.title,x),n.font=l.string,Ue(e.beforeBody.concat(e.afterBody),x),S=t.displayColors?a+2+t.boxPadding:0,Ue(r,b=>{Ue(b.before,x),Ue(b.lines,x),Ue(b.after,x)}),S=0,n.font=u.string,Ue(e.footer,x),n.restore(),v+=g.width,{width:v,height:m}}function Bee(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function zee(e,t,n,r){const{x:i,width:o}=r,a=n.caretSize+n.caretPadding;if(e==="left"&&i+o+a>t.width||e==="right"&&i-o-a<0)return!0}function Vee(e,t,n,r){const{x:i,width:o}=n,{width:a,chartArea:{left:s,right:l}}=e;let c="center";return r==="center"?c=i<=(s+l)/2?"left":"right":i<=o/2?c="left":i>=a-o/2&&(c="right"),zee(c,e,t,n)&&(c="center"),c}function tE(e,t,n){const r=n.yAlign||t.yAlign||Bee(e,n);return{xAlign:n.xAlign||t.xAlign||Vee(e,t,n,r),yAlign:r}}function Wee(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function Uee(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function nE(e,t,n,r){const{caretSize:i,caretPadding:o,cornerRadius:a}=e,{xAlign:s,yAlign:l}=n,c=i+o,{topLeft:u,topRight:d,bottomLeft:p,bottomRight:h}=ha(a);let g=Wee(t,s);const m=Uee(t,l,c);return l==="center"?s==="left"?g+=c:s==="right"&&(g-=c):s==="left"?g-=Math.max(u,p)+i:s==="right"&&(g+=Math.max(d,h)+i),{x:ln(g,0,r.width-t.width),y:ln(m,0,r.height-t.height)}}function Uc(e,t,n){const r=pr(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function rE(e){return wr([],Hr(e))}function Hee(e,t,n){return Uo(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function iE(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const Jk={beforeTitle:Wr,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:Wr,beforeBody:Wr,beforeLabel:Wr,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return ze(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Wr,afterBody:Wr,beforeFooter:Wr,footer:Wr,afterFooter:Wr};function yn(e,t,n,r){const i=e[t].call(n,r);return typeof i>"u"?Jk[t].call(n,r):i}class oE extends qi{static positioners=ks;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,o=new Ik(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Hee(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=yn(r,"beforeTitle",this,t),o=yn(r,"title",this,t),a=yn(r,"afterTitle",this,t);let s=[];return s=wr(s,Hr(i)),s=wr(s,Hr(o)),s=wr(s,Hr(a)),s}getBeforeBody(t,n){return rE(yn(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return Ue(t,o=>{const a={before:[],lines:[],after:[]},s=iE(r,o);wr(a.before,Hr(yn(s,"beforeLabel",this,o))),wr(a.lines,yn(s,"label",this,o)),wr(a.after,Hr(yn(s,"afterLabel",this,o))),i.push(a)}),i}getAfterBody(t,n){return rE(yn(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=yn(r,"beforeFooter",this,t),o=yn(r,"footer",this,t),a=yn(r,"afterFooter",this,t);let s=[];return s=wr(s,Hr(i)),s=wr(s,Hr(o)),s=wr(s,Hr(a)),s}_createItems(t){const n=this._active,r=this.chart.data,i=[],o=[],a=[];let s=[],l,c;for(l=0,c=n.length;l<c;++l)s.push(Fee(this.chart,n[l]));return t.filter&&(s=s.filter((u,d,p)=>t.filter(u,d,p,r))),t.itemSort&&(s=s.sort((u,d)=>t.itemSort(u,d,r))),Ue(s,u=>{const d=iE(t.callbacks,u);i.push(yn(d,"labelColor",this,u)),o.push(yn(d,"labelPointStyle",this,u)),a.push(yn(d,"labelTextColor",this,u))}),this.labelColors=i,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=s,s}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let o,a=[];if(!i.length)this.opacity!==0&&(o={opacity:0});else{const s=ks[r.position].call(this,i,this._eventPosition);a=this._createItems(r),this.title=this.getTitle(a,r),this.beforeBody=this.getBeforeBody(a,r),this.body=this.getBody(a,r),this.afterBody=this.getAfterBody(a,r),this.footer=this.getFooter(a,r);const l=this._size=eE(this,r),c=Object.assign({},s,l),u=tE(this.chart,r,c),d=nE(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:s.x,caretY:s.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const o=this.getCaretPosition(t,r,i);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:o}=this,{caretSize:a,cornerRadius:s}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=ha(s),{x:p,y:h}=t,{width:g,height:m}=n;let v,y,S,x,b,O;return o==="center"?(b=h+m/2,i==="left"?(v=p,y=v-a,x=b+a,O=b-a):(v=p+g,y=v+a,x=b-a,O=b+a),S=v):(i==="left"?y=p+Math.max(l,u)+a:i==="right"?y=p+g-Math.max(c,d)-a:y=this.caretX,o==="top"?(x=h,b=x-a,v=y-a,S=y+a):(x=h+m,b=x+a,v=y+a,S=y-a),O=x),{x1:v,x2:y,x3:S,y1:x,y2:b,y3:O}}drawTitle(t,n,r){const i=this.title,o=i.length;let a,s,l;if(o){const c=ma(r.rtl,this.x,this.width);for(t.x=Uc(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",a=Sn(r.titleFont),s=r.titleSpacing,n.fillStyle=r.titleColor,n.font=a.string,l=0;l<o;++l)n.fillText(i[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+s,l+1===o&&(t.y+=r.titleMarginBottom-s)}}_drawColorBox(t,n,r,i,o){const a=this.labelColors[r],s=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=o,u=Sn(o.bodyFont),d=Uc(this,"left",o),p=i.x(d),h=l<u.lineHeight?(u.lineHeight-l)/2:0,g=n.y+h;if(o.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},v=i.leftForLtr(p,c)+c/2,y=g+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,rg(t,m,v,y),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,rg(t,m,v,y)}else{t.lineWidth=Ae(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const m=i.leftForLtr(p,c),v=i.leftForLtr(i.xPlus(p,1),c-2),y=ha(a.borderRadius);Object.values(y).some(S=>S!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ud(t,{x:m,y:g,w:c,h:l,radius:y}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),ud(t,{x:v,y:g+1,w:c-2,h:l-2,radius:y}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,g,c,l),t.strokeRect(m,g,c,l),t.fillStyle=a.backgroundColor,t.fillRect(v,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:o,bodyAlign:a,displayColors:s,boxHeight:l,boxWidth:c,boxPadding:u}=r,d=Sn(r.bodyFont);let p=d.lineHeight,h=0;const g=ma(r.rtl,this.x,this.width),m=function(T){n.fillText(T,g.x(t.x+h),t.y+p/2),t.y+=p+o},v=g.textAlign(a);let y,S,x,b,O,E,C;for(n.textAlign=a,n.textBaseline="middle",n.font=d.string,t.x=Uc(this,v,r),n.fillStyle=r.bodyColor,Ue(this.beforeBody,m),h=s&&v!=="right"?a==="center"?c/2+u:c+2+u:0,b=0,E=i.length;b<E;++b){for(y=i[b],S=this.labelTextColors[b],n.fillStyle=S,Ue(y.before,m),x=y.lines,s&&x.length&&(this._drawColorBox(n,t,b,g,r),p=Math.max(d.lineHeight,l)),O=0,C=x.length;O<C;++O)m(x[O]),p=d.lineHeight;Ue(y.after,m)}h=0,p=d.lineHeight,Ue(this.afterBody,m),t.y-=o}drawFooter(t,n,r){const i=this.footer,o=i.length;let a,s;if(o){const l=ma(r.rtl,this.x,this.width);for(t.x=Uc(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",a=Sn(r.footerFont),n.fillStyle=r.footerColor,n.font=a.string,s=0;s<o;++s)n.fillText(i[s],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r.footerSpacing}}drawBackground(t,n,r,i){const{xAlign:o,yAlign:a}=this,{x:s,y:l}=t,{width:c,height:u}=r,{topLeft:d,topRight:p,bottomLeft:h,bottomRight:g}=ha(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(s+d,l),a==="top"&&this.drawCaret(t,n,r,i),n.lineTo(s+c-p,l),n.quadraticCurveTo(s+c,l,s+c,l+p),a==="center"&&o==="right"&&this.drawCaret(t,n,r,i),n.lineTo(s+c,l+u-g),n.quadraticCurveTo(s+c,l+u,s+c-g,l+u),a==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(s+h,l+u),n.quadraticCurveTo(s,l+u,s,l+u-h),a==="center"&&o==="left"&&this.drawCaret(t,n,r,i),n.lineTo(s,l+d),n.quadraticCurveTo(s,l,s+d,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,o=r&&r.y;if(i||o){const a=ks[t.position].call(this,this._active,this._eventPosition);if(!a)return;const s=this._size=eE(this,t),l=Object.assign({},a,this._size),c=tE(n,t,l),u=nE(t,l,c,n);(i._to!==u.x||o._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=s.width,this.height=s.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},o={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const a=pr(n.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&s&&(t.save(),t.globalAlpha=r,this.drawBackground(o,t,i,n),Nk(t,n.textDirection),o.y+=a.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),Rk(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=t.map(({datasetIndex:s,index:l})=>{const c=this.chart.getDatasetMeta(s);if(!c)throw new Error("Cannot find a dataset at index "+s);return{datasetIndex:s,element:c.data[l],index:l}}),o=!ad(r,i),a=this._positionChanged(i,n);(o||a)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,o=this._active||[],a=this._getActiveElements(t,o,n,r),s=this._positionChanged(a,t),l=n||!ad(a,o)||s;return l&&(this._active=a,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,i){const o=this.options;if(t.type==="mouseout")return[];if(!i)return n.filter(s=>this.chart.data.datasets[s.datasetIndex]&&this.chart.getDatasetMeta(s.datasetIndex).controller.getParsed(s.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,o.mode,o,r);return o.reverse&&a.reverse(),a}_positionChanged(t,n){const{caretX:r,caretY:i,options:o}=this,a=ks[o.position].call(this,t,n);return a!==!1&&(r!==a.x||i!==a.y)}}var gr={id:"tooltip",_element:oE,positioners:ks,afterInit(e,t,n){n&&(e.tooltip=new oE({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:Jk},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const qee=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function Kee(e,t,n,r){const i=e.indexOf(t);if(i===-1)return qee(e,t,n,r);const o=e.lastIndexOf(t);return i!==o?n:i}const Yee=(e,t)=>e===null?null:ln(Math.round(e),0,t);function aE(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Ki extends Ga{static id="category";static defaults={ticks:{callback:aE}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:i,label:o}of n)r[i]===o&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(ze(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:Kee(r,t,Oe(n,t),this._addedLabels),Yee(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,i=[];let o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let a=t;a<=n;a++)i.push({value:a});return i}getLabelForValue(t){return aE.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function Gee(e,t){const n=[],{bounds:i,step:o,min:a,max:s,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:p}=e,h=o||1,g=u-1,{min:m,max:v}=t,y=!ze(a),S=!ze(s),x=!ze(c),b=(v-m)/(d+1);let O=sS((v-m)/g/h)*h,E,C,T,k;if(O<1e-14&&!y&&!S)return[{value:m},{value:v}];k=Math.ceil(v/O)-Math.floor(m/O),k>g&&(O=sS(k*O/g/h)*h),ze(l)||(E=Math.pow(10,l),O=Math.ceil(O*E)/E),i==="ticks"?(C=Math.floor(m/O)*O,T=Math.ceil(v/O)*O):(C=m,T=v),y&&S&&o&&gZ((s-a)/o,O/1e3)?(k=Math.round(Math.min((s-a)/O,u)),O=(s-a)/k,C=a,T=s):x?(C=y?a:C,T=S?s:T,k=c-1,O=(T-C)/k):(k=(T-C)/O,Bs(k,Math.round(k),O/1e3)?k=Math.round(k):k=Math.ceil(k));const R=Math.max(lS(O),lS(C));E=Math.pow(10,ze(l)?R:l),C=Math.round(C*E)/E,T=Math.round(T*E)/E;let M=0;for(y&&(p&&C!==a?(n.push({value:a}),C<a&&M++,Bs(Math.round((C+M*O)*E)/E,a,sE(a,b,e))&&M++):C<a&&M++);M<k;++M){const P=Math.round((C+M*O)*E)/E;if(S&&P>s)break;n.push({value:P})}return S&&p&&T!==s?n.length&&Bs(n[n.length-1].value,s,sE(s,b,e))?n[n.length-1].value=s:n.push({value:s}):(!S||T===s)&&n.push({value:T}),n}function sE(e,t,{horizontal:n,minRotation:r}){const i=Jr(r),o=(n?Math.sin(i):Math.cos(i))||.001,a=.75*t*(""+e).length;return Math.min(t/o,a)}class Xee extends Ga{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 ze(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:o}=this;const a=l=>i=n?i:l,s=l=>o=r?o:l;if(t){const l=Mr(i),c=Mr(o);l<0&&c<0?s(0):l>0&&c>0&&a(0)}if(i===o){let l=o===0?1:Math.abs(o*.05);s(o+l),t||a(i-l)}this.min=i,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,a=Gee(i,o);return t.bounds==="ticks"&&vZ(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return Wy(t,this.chart.options.locale,this.options.ticks.format)}}class Yi extends Xee{static id="linear";static defaults={ticks:{callback:_k.formatters.numeric}};determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=sr(t)?t:0,this.max=sr(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Jr(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const Af={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}},wn=Object.keys(Af);function lE(e,t){return e-t}function cE(e,t){if(ze(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:o}=e._parseOpts;let a=t;return typeof r=="function"&&(a=r(a)),sr(a)||(a=typeof r=="string"?n.parse(a,r):n.parse(a)),a===null?null:(i&&(a=i==="week"&&(ml(o)||o===!0)?n.startOf(a,"isoWeek",o):n.startOf(a,i)),+a)}function uE(e,t,n,r){const i=wn.length;for(let o=wn.indexOf(e);o<i-1;++o){const a=Af[wn[o]],s=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-t)/(s*a.size))<=r)return wn[o]}return wn[i-1]}function Zee(e,t,n,r,i){for(let o=wn.length-1;o>=wn.indexOf(n);o--){const a=wn[o];if(Af[a].common&&e._adapter.diff(i,r,a)>=t-1)return a}return wn[n?wn.indexOf(n):0]}function Jee(e){for(let t=wn.indexOf(e)+1,n=wn.length;t<n;++t)if(Af[wn[t]].common)return wn[t]}function dE(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=zy(n,t),o=n[r]>=t?n[r]:n[i];e[o]=!0}}function Qee(e,t,n,r){const i=e._adapter,o=+i.startOf(t[0].value,r),a=t[t.length-1].value;let s,l;for(s=o;s<=a;s=+i.add(s,1,r))l=n[s],l>=0&&(t[l].major=!0);return t}function fE(e,t,n){const r=[],i={},o=t.length;let a,s;for(a=0;a<o;++a)s=t[a],i[s]=a,r.push({value:s,major:!1});return o===0||!n?r:Qee(e,r,i,n)}class pE extends Ga{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),i=this._adapter=new oQ._date(t.adapters.date);i.init(n),Fs(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:cE(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:i,max:o,minDefined:a,maxDefined:s}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!s&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!a||!s)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=sr(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),o=sr(o)&&!isNaN(o)?o:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,o-1),this.max=Math.max(i+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const o=this.min,a=this.max,s=OZ(i,o,a);return this._unit=n.unit||(r.autoSkip?uE(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):Zee(this,s.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:Jee(this._unit),this.initOffsets(i),t.reverse&&s.reverse(),fE(this,s,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,i,o;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?r=o:r=(o-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;n=ln(n,0,a),r=ln(r,0,a),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,o=i.time,a=o.unit||uE(o.minUnit,n,r,this._getLabelCapacity(n)),s=Oe(i.ticks.stepSize,1),l=a==="week"?o.isoWeekday:!1,c=ml(l)||l===!0,u={};let d=n,p,h;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":a),t.diff(r,n,a)>1e5*s)throw new Error(n+" and "+r+" are too far apart with stepSize of "+s+" "+a);const g=i.ticks.source==="data"&&this.getDataTimestamps();for(p=d,h=0;p<r;p=+t.add(p,s,a),h++)dE(u,p,g);return(p===r||i.bounds==="ticks"||h===1)&&dE(u,p,g),Object.keys(u).sort(lE).map(m=>+m)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const i=this.options.time.displayFormats,o=this._unit,a=n||i[o];return this._adapter.format(t,a)}_tickFormatFunction(t,n,r,i){const o=this.options,a=o.ticks.callback;if(a)return lt(a,[t,n,r],this);const s=o.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&s[l],d=c&&s[c],p=r[n],h=c&&d&&p&&p.major;return this._adapter.format(t,i||(h?d:u))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n<r;++n)i=t[n],i.label=this._tickFormatFunction(i.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,i=Jr(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(i),a=Math.sin(i),s=this._resolveTickFontOptions(0).size;return{w:r*o+s*a,h:r*a+s*o}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,o=this._tickFormatFunction(t,0,fE(this,[t],this._majorUnit),i),a=this._getLabelSize(o),s=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return s>0?s:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)t=t.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const i=this.getLabels();for(n=0,r=i.length;n<r;++n)t.push(cE(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return wk(t.sort(lE))}}function Hc(e,t,n){let r=0,i=e.length-1,o,a,s,l;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=bo(e,"pos",t)),{pos:o,time:s}=e[r],{pos:a,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=bo(e,"time",t)),{time:o,pos:s}=e[r],{time:a,pos:l}=e[i]);const c=a-o;return c?s+(l-s)*(t-o)/c:s}class dne extends pE{static id="timeseries";static defaults=pE.defaults;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=Hc(n,this.min),this._tableRange=Hc(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],o=[];let a,s,l,c,u;for(a=0,s=t.length;a<s;++a)c=t[a],c>=n&&c<=r&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(a=0,s=i.length;a<s;++a)u=i[a+1],l=i[a-1],c=i[a],Math.round((u+l)/2)!==c&&o.push({time:c,pos:a/(s-1)});return o}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((i,o)=>i-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(Hc(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Hc(this._table,r*this._tableRange+this._minPos,!0)}}const Qk="label";function hE(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function ete(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function eM(e,t){e.labels=t}function tM(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Qk;const r=[];e.datasets=t.map(i=>{const o=e.datasets.find(a=>a[n]===i[n]);return!o||!i.data||r.includes(o)?{...i}:(r.push(o),Object.assign(o,i),o)})}function tte(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Qk;const n={labels:[],datasets:[]};return eM(n,e.labels),tM(n,e.datasets,t),n}function nte(e,t){const{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:o,type:a,data:s,options:l,plugins:c=[],fallbackContent:u,updateMode:d,...p}=e,h=I.useRef(null),g=I.useRef(null),m=()=>{h.current&&(g.current=new Tn(h.current,{type:a,data:tte(s,o),options:l&&{...l},plugins:c}),hE(t,g.current))},v=()=>{hE(t,null),g.current&&(g.current.destroy(),g.current=null)};return I.useEffect(()=>{!i&&g.current&&l&&ete(g.current,l)},[i,l]),I.useEffect(()=>{!i&&g.current&&eM(g.current.config.data,s.labels)},[i,s.labels]),I.useEffect(()=>{!i&&g.current&&s.datasets&&tM(g.current.config.data,s.datasets,o)},[i,s.datasets]),I.useEffect(()=>{g.current&&(i?(v(),setTimeout(m)):g.current.update(d))},[i,l,s.labels,s.datasets,d]),I.useEffect(()=>{g.current&&(v(),setTimeout(m))},[a]),I.useEffect(()=>(m(),()=>v()),[]),I.createElement("canvas",{ref:h,role:"img",height:n,width:r,...p},u)}const rte=I.forwardRef(nte);function nb(e,t){return Tn.register(t),I.forwardRef((n,r)=>I.createElement(rte,{...n,ref:r,type:e}))}const rb=nb("line",iQ),Jl=nb("bar",tQ),ib=nb("doughnut",rQ);Tn.register(Qy,gr,mr);const ite={id:"centerText",afterDraw(e,t,n){const{ctx:r}=e,i=e.getDatasetMeta(0);if(!i?.data?.[0])return;const{x:o,y:a}=i.data[0],{top:s="",bottom:l="",topSize:c=20,bottomSize:u=10,topColor:d="#0F172A",bottomColor:p="#64748B"}=n||{};r.save(),r.textAlign="center",r.textBaseline="middle",r.fillStyle=d,r.font=`600 ${c}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(s,o,a-5),r.fillStyle=p,r.font=`500 ${u}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(l,o,a+12),r.restore()}},ote=({sold:e=847,unsold:t=73,growthPct:n="+9.1%"})=>{const r=e+t,i={labels:["Sold","Unsold"],datasets:[{data:[e,t],backgroundColor:["#12B981","#EF4444"],borderWidth:2,hoverOffset:4}]},o={responsive:!0,maintainAspectRatio:!1,cutout:"68%",plugins:{legend:{display:!1},tooltip:{callbacks:{label:a=>`${a.label}: ${a.parsed}`},displayColors:!1},centerText:{top:`${r}`,bottom:"Total Units",topSize:20,bottomSize:10}}};return w.jsx(st,{title:"Unit Status",period:"This Month",icon:w.jsx(_g,{className:"h-6 w-6 text-green-600"}),className:"h-[238px]",children:w.jsxs("div",{className:"grid grid-cols-12 gap-[16px] items-center",children:[w.jsxs("div",{className:"col-span-5 space-y-3",children:[w.jsxs("div",{children:[w.jsx("div",{className:"!text-[12px] lending-[16px] text-[#64748B]",children:"Sold"}),w.jsx("div",{className:"text-[28px] leading-[32px] text-[#1FA05B]",children:e})]}),w.jsxs("div",{children:[w.jsx("div",{className:"!text-[12px] lending-[16px] text-[#64748B]",children:"Unsold"}),w.jsx("div",{className:"text-[28px] leading-[32px] text-[#EF4444]",children:t})]}),w.jsxs("div",{className:"text-[10px] text-[#1FA05B] flex gap-[8px] items-center ",children:[n," ",w.jsx("div",{className:"text-[#64748B] text-[10px]",children:"Compared to last month"})]})]}),w.jsx("div",{className:"col-span-7",children:w.jsx("div",{className:"h-[158px] w-[158px] ml-auto mr-2",children:w.jsx(ib,{data:i,options:o,plugins:[ite]})})})]})})},mE=({value:e=0,total:t=1,colorClass:n="",label:r=""})=>{const i=Math.max(0,Math.min(100,e/(t||1)*100)),o=n==="bg-[#8B5CF6]"?"text-[#8B5CF6]":n==="bg-[#12B981]"?"text-[#12B981]":"text-slate-600";return w.jsxs("div",{className:"flex flex-col items-start",children:[w.jsx("div",{className:"w-2/3 min-w-[80px] h-3 rounded-full overflow-hidden",children:w.jsx("div",{className:`h-3 rounded-full ${n}`,style:{width:`${i}%`}})}),w.jsx("div",{className:`${o} !text-[12px] font-bold mt-1`,children:e}),w.jsx("div",{className:"!text-[12px] text-[#64748B] mt-1",children:r})]})},gE=({title:e,value:t,suffix:n,valueClass:r=""})=>w.jsxs("div",{className:"bg-white border border-[#EBEBEB] rounded-xl shadow-[0_0_12px_0_#EAF2FF] h-[98px] p-4 flex flex-col justify-center",children:[w.jsx("div",{className:"!text-[12px] leading-[16px] text-[#121212] mb-1",children:e}),w.jsxs("div",{className:`text-[28px] leading-[32px] flex item gap-[4px] font-medium ${r}`,children:[t," ",n&&w.jsx("div",{className:"text-[28px] leading-[32px] font-medium",children:n})]})]}),ate=({totalUnits:e=847,occupiedUnits:t=756,ownerCount:n=700,tenantCount:r=56,avgResidents:i=4.4,avgLeaseMonths:o=18})=>{const a=n+r;return w.jsxs("div",{children:[w.jsxs("div",{className:"bg-white border border-[#EBEBEB] rounded-xl shadow-[0_0_12px_0_#EAF2FF] p-4 h-[128px]",children:[w.jsxs("div",{className:"flex items-center gap-[12px] mb-4",children:[w.jsx(d_,{className:"h-6 w-6 text-[#329DFF]"}),w.jsx("div",{className:"font-medium text-[#121212]",children:"Occupancy Overview"})]}),w.jsxs("div",{className:"flex items-center justify-between gap-",children:[w.jsxs("div",{children:[w.jsx("div",{className:"text-xs leading-[16px] text-[#64748B]",children:"Occupied Units"}),w.jsxs("div",{className:"flex items-center gap-1",children:[w.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),w.jsxs("div",{className:"text-[#64748B] text-[20px] leading-[32px]",children:["/",e]})]})]}),w.jsxs("div",{className:"flex items-end",children:[w.jsx(mE,{value:n,total:a,colorClass:"bg-[#8B5CF6]",label:"Owner"}),w.jsx(mE,{value:r,total:a,colorClass:"bg-[#12B981]",label:"Tenant"})]})]})]}),w.jsxs("div",{className:"mt-2.5 grid grid-cols-2 gap-[12px]",children:[w.jsx(gE,{title:"Avg Residents Per Unit",value:i,valueClass:"text-[#8B5CF6]"}),w.jsx(gE,{title:"Avg Lease Period",value:o,suffix:"months",valueClass:"text-[#E7A015]"})]})]})};Tn.register(Qy,gr,mr);const ste={id:"centerText",afterDraw(e,t,n){const{ctx:r}=e,i=e.getDatasetMeta(0);if(!i?.data?.[0])return;const{x:o,y:a}=i.data[0],{top:s="",bottom:l="",topSize:c=20,bottomSize:u=10,topColor:d="#0F172A",bottomColor:p="#64748B"}=n||{};r.save(),r.textAlign="center",r.textBaseline="middle",r.fillStyle=d,r.font=`600 ${c}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(s,o,a-5),r.fillStyle=p,r.font=`500 ${u}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(l,o,a+12),r.restore()}},lte=({ownerCount:e=1e3,tenantCount:t=200,nonResidingOwners:n=26,growthPct:r="+9.1%"})=>{const i=Math.max(e-n,0),o=e+t,a={labels:["Owners","Tenants","Non-residing Owner"],datasets:[{data:[i,t,n],backgroundColor:["#3C81F6","#08B6D4","#8B5CF6"],borderWidth:2,hoverOffset:4}]},s={responsive:!0,maintainAspectRatio:!1,cutout:"68%",plugins:{legend:{display:!1},tooltip:{callbacks:{label:l=>`${l.label}: ${l.parsed}`},displayColors:!1},centerText:{top:`${o}`,bottom:"Total Members",topSize:20,bottomSize:10}}};return w.jsx(st,{title:"Resident Overview",icon:w.jsx(u_,{className:"h-6 w-6 text-[#8B5CF6]"}),className:"h-[238px]",children:w.jsxs("div",{className:" flex-1 min-h-0 grid grid-cols-12 gap-[16px] items-center",children:[w.jsxs("div",{className:"col-span-5",children:[w.jsxs("div",{children:[w.jsx("div",{className:"!text-[12px] text-[#64748B] leading-[16px]",children:"Total Owners"}),w.jsx("div",{className:"text-[28px] leading-[32px ] text-[#3C81F6]",children:e})]}),w.jsxs("div",{children:[w.jsx("div",{className:"!text-[12px] text-[#64748B] leading-[16px]",children:"Total Tenants"}),w.jsx("div",{className:"text-[28px] leading-[32px ] text-[#08B6D4]",children:t})]}),w.jsxs("div",{className:"text-[10px] text-[#1FA05B] flex gap-2 items-center",children:[r," ",w.jsx("div",{className:"text-[#64748B] ",children:"Compared to last month"})]})]}),w.jsx("div",{className:"col-span-7",children:w.jsx("div",{className:"h-[162px] w-[162px] ml-auto mr-2",children:w.jsx(ib,{data:a,options:s,plugins:[ste]})})})]})})};Tn.register(Ki,Yi,Zl,gr,mr);const cte=({blocks:e=[{name:"Block A",owner:110,rented:24,vacant:8},{name:"Block B",owner:95,rented:18,vacant:6},{name:"Block C",owner:65,rented:12,vacant:18},{name:"Block D",owner:78,rented:16,vacant:30}]})=>{const t=e.map(s=>s.name),n=e.map(s=>s.owner),r=e.map(s=>s.rented),i=e.map(s=>s.vacant),o={labels:t,datasets:[{label:"Owner",data:n,backgroundColor:"#3C81F6",barThickness:40},{label:"",data:n.map(()=>2),backgroundColor:"transparent",barThickness:40},{label:"Rented",data:r,backgroundColor:"#8B5CF6",barThickness:40},{label:"",data:r.map(()=>2),backgroundColor:"transparent",barThickness:40},{label:"Vacant",data:i,backgroundColor:"#08B6D4",barThickness:40}]},a={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,boxWidth:10,boxHeight:10,pointStyle:"rectRot",padding:20}},tooltip:{callbacks:{label:s=>`${s.dataset.label}: ${s.parsed.y}`}}},scales:{x:{stacked:!0,grid:{display:!1},ticks:{color:"#64748B"}},y:{stacked:!0,beginAtZero:!0,suggestedMax:180,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:20}}}};return w.jsx(st,{title:"Block-wise Occupancy",period:w.jsx(qt,{className:"text-xl text-[#884EA7]"}),className:"w-full h-[360px]",titleWeight:"semi-bold",children:w.jsx(Jl,{data:o,options:a})})};Tn.register(Ki,Yi,tb,eb,gr,mr);const ute=e=>{const[t,n]=String(e).split(" ");return`${{Jan:"January",Feb:"February",Mar:"March",Apr:"April",May:"May",Jun:"June",Jul:"July",Aug:"August",Sep:"September",Oct:"October",Nov:"November",Dec:"December"}[t]||t} 20${n}`},dte=({labels:e=["Jan 25","Feb 25","Mar 25","Apr 25","May 25"],moveIn:t=[24,27,20,26,23],moveOut:n=[12,17,8,5,16]})=>{const r={labels:e,datasets:[{label:"Move-in",data:t,borderColor:"#12B981",backgroundColor:"rgba(16,185,129,0.15)",pointBackgroundColor:"#12B981",pointStyle:"rectRot",fill:!1},{label:"Move-out",data:n,borderColor:"#8B5CF6",backgroundColor:"rgba(124,58,237,0.15)",pointBackgroundColor:"#8B5CF6",pointStyle:"rectRot",fill:!1}]},i={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,boxWidth:10,boxHeight:10,padding:20}},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:0,callbacks:{title:o=>ute(o[0].label),label:o=>`${o.dataset.label}: ${o.parsed.y}`}}},scales:{x:{grid:{color:"#F1F5F9"},ticks:{color:"#64748B"}},y:{beginAtZero:!0,suggestedMax:28,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:4,precision:0}}},elements:{line:{borderWidth:2,tension:0},point:{radius:0,hoverRadius:3,hitRadius:10}}};return w.jsx(st,{title:"Move-in/Out Trends",className:"w-full h-[360px]",period:w.jsx(qt,{className:"text-[20px] text-[#884EA7]"}),titleWeight:"semi-bold",children:w.jsx(rb,{data:r,options:i})})};Tn.register(Ki,Yi,tb,eb,gr,mr);const fte=e=>{const[t,n]=String(e).split(" ");return`${{Jan:"January",Feb:"February",Mar:"March",Apr:"April",May:"May",Jun:"June",Jul:"July",Aug:"August",Sep:"September",Oct:"October",Nov:"November",Dec:"December"}[t]||t} 20${n}`},nM=({labels:e=["Jan 25","Feb 25","Mar 25","Apr 25","May 25"],moveIn:t=[24,27,20,26,23],moveOut:n=[4,17,8,5,16,4,7]})=>{const r={labels:e,datasets:[{label:"Income",data:t,borderColor:"#10B981",backgroundColor:"rgba(16,185,129,0.15)",pointBackgroundColor:"#10B981",pointStyle:"rectRot",fill:!1},{label:"Expenditure",data:n,borderColor:"#AB0000",backgroundColor:"rgba(124,58,237,0.15)",pointBackgroundColor:"#AB0000",pointStyle:"rectRot",fill:!1}]},i={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,boxWidth:10,boxHeight:10,padding:20}},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:0,callbacks:{title:o=>fte(o[0].label),label:o=>`${o.dataset.label}: ${o.parsed.y}`}}},scales:{x:{grid:{color:"#F1F5F9"},ticks:{color:"#64748B"}},y:{beginAtZero:!0,suggestedMax:28,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:4,precision:0}}},elements:{line:{borderWidth:2,tension:0},point:{radius:0,hoverRadius:3,hitRadius:10}}};return w.jsx(rb,{data:r,options:i})};function vE({label:e,value:t,positive:n,bgColor:r,delta:i,deltaLabel:o,textColor:a}){return w.jsxs("div",{className:`rounded-lg p-4 ${r} border border-[#EBEBEB] h-[126px]`,children:[w.jsx("div",{className:`text-[16px] leading-[20px] ${a}`,children:e}),w.jsx("div",{className:"mt-[16px] leading-[28px] !text-[24px] font-medium text-[#121212]",children:t}),w.jsxs("div",{className:"mt-[8px] flex items-center gap-[8px] leading-[14px] text-[10px]",children:[w.jsx("div",{className:n?"text-[#1FA05B] font-medium":"text-[#EF4444] font-medium",children:i}),w.jsx("div",{className:"text-[#64748B] ",children:o})]})]})}function pte(){return w.jsxs(st,{title:"Accounting",className:"w-full h-[523px]",period:w.jsx(qt,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:[w.jsxs("div",{className:"grid grid-cols-2 gap-[16px]",children:[w.jsx(vE,{label:"Total Income",value:"AED 5.68M",delta:"+4.4%",positive:!0,bgColor:"bg-slate-50",deltaLabel:"Compared to last month",textColor:"text-[#1FA05B]"}),w.jsx(vE,{label:"Total Expenditure",value:"AED 1.83M",delta:"-1.1%",positive:!1,bgColor:"bg-slate-50",deltaLabel:"Compared to last month",textColor:"text-[#AB0000]"})]}),w.jsx("div",{className:"h-[254px] mt-[35.5px]",children:w.jsx(nM,{})})]})}Tn.register(Ki,Yi,Zl,gr,mr);const hte=()=>{const e=["Maintenance","Security","Utilities","Housekeeping","Administration","Others"],r={labels:e,datasets:[{label:"Budget",data:[55e3,56e3,64e3,38e3,54e3,65e3],backgroundColor:"#93C5FD",barThickness:60},{label:"Actual",data:[63e3,48e3,51300,28e3,42e3,35e3],backgroundColor:"#3B82F6",barThickness:60}]},i={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,pointStyle:"rectRot",padding:20}},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:6,callbacks:{title:o=>e[o[0].dataIndex],label:o=>{const a=o.parsed.y;return`${o.dataset.label}: AED ${(a/1e3).toFixed(1)}K`}}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B"}},y:{beginAtZero:!0,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",callback:o=>`${o/1e3}K`}}}};return w.jsx(st,{title:"Budget vs Actuals",className:"w-full h-[362px]",period:w.jsx(qt,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:w.jsx(Jl,{data:r,options:i})})},mte=()=>{const e=[{title:"Primary Account",amount:285e4,subtitle:"Savings"},{title:"Emergency Fund",amount:12e5,subtitle:"Fixed deposit"},{title:"Maintenance Fund",amount:68e4,subtitle:"Current"}],t=e.reduce((r,i)=>r+i.amount,0),n=r=>r>=1e6?`AED ${(r/1e6).toFixed(2)}M`:r>=1e3?`AED ${(r/1e3).toFixed(1)}K`:`AED ${r}`;return w.jsxs(st,{title:"Cash & Bank Balance",className:"w-full h-[362px]",period:w.jsx(qt,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),children:[w.jsx("div",{className:"flex flex-col gap-[12px]",children:e.map((r,i)=>w.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-lg p-3",children:[w.jsxs("div",{className:"flex flex-col",children:[w.jsx("div",{className:"text-[14px] font-medium text-[#121212]",children:r.title}),w.jsx("div",{className:"!text-[12px] text-[#64748B]",children:r?.subtitle})]}),w.jsx("div",{className:"flex flex-col items-end",children:w.jsx("div",{className:"text-[14px] text-[#1FA05B] font-semibold",children:n(r.amount)})})]},i))}),w.jsxs("div",{className:"flex items-center justify-between border-t border-[#EBEBEB] h-[68px] px-3",children:[w.jsx("div",{className:"text-[14px] font-medium text-[#121212]",children:"Total"}),w.jsx("div",{className:"text-[16px] text-[#1FA05B] font-bold",children:n(t)})]})]})};Tn.register(Ki,Yi,Zl,gr,mr);const gte=()=>{const e=["Current Month","1-3 Months","3-6 Months","6+ Months"],t=[13e3,9400,8800,7200],n=[18,12,18,6],r={labels:e,datasets:[{label:"Due",data:t,backgroundColor:"#EF4444",barThickness:60}]},i={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:6,callbacks:{title:o=>e[o[0].dataIndex],label:o=>`Due: AED ${(o.parsed.y/1e3).toFixed(1)}K`,afterLabel:o=>`Units Count: ${n[o.dataIndex]}`}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B"}},y:{beginAtZero:!0,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",callback:o=>`${o/1e3}K`}}}};return w.jsxs(st,{title:"Dues Ageing",className:"w-full h-[362px]",period:w.jsx(qt,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:[w.jsx("div",{className:"grid grid-cols-4 md:grid-cols-4 gap-[12px] h-[48px]",children:e.map((o,a)=>w.jsx("div",{className:"p-2 rounded-lg bg-slate-50",children:w.jsxs("div",{className:"flex justify-between items-start",children:[w.jsx("div",{className:"font-medium leading-[16px] !text-[12px] rounded",children:o}),w.jsxs("div",{className:"text-right",children:[w.jsxs("div",{className:"text-red-600 font-medium leading-[16px] !text-[12px]",children:["AED ",(t[a]/1e3).toFixed(1),"K"]}),w.jsxs("div",{className:" text-gray-500 leading-[14px] text-[10px]",children:[n[a]," Units"]})]})]})},o))}),w.jsx("div",{className:"h-[192px]",children:w.jsx(Jl,{data:r,options:i})})]})};Tn.register(Qy,gr,mr);const vte=()=>{const e=["Maintenance","Utilities","Security","Administration","Others"],t=[45e4,32e4,28e4,18e4,12e4],n={labels:e,datasets:[{label:"Expenses",data:t,backgroundColor:["#08B6D4","#8B5CF6","#EF4444","#F69E0A","#12B981"],borderColor:"#FFFFFF",borderWidth:2,cutout:"70%"}]},r=t.reduce((o,a)=>o+a,0),i={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:10,callbacks:{label:o=>`${o.label}: AED ${o.formattedValue}`}}}};return w.jsxs(st,{title:"Expense Categories",className:"w-full h-[523px]",period:w.jsx(qt,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:[w.jsxs("div",{className:"relative h-[259px] flex justify-center items-center",children:[w.jsx(ib,{data:n,options:i}),w.jsxs("div",{className:"absolute text-center",children:[w.jsxs("div",{className:"!text-[24px] font-medium leading-[28px] text-[#121212]",children:["AED ",(r/1e6).toFixed(2),"M"]}),w.jsx("div",{className:"text-[#121212] leading-[18px] text-[14px]",children:"Total Expenses"})]})]}),w.jsx("div",{className:"space-y-2",children:e.map((o,a)=>w.jsxs("div",{className:"flex justify-between items-center text-[14px] pb-2",children:[w.jsxs("div",{className:"flex items-center gap-[8px] !text-[12px] leading-[16px] text-[#64748B]",children:[w.jsx("div",{className:"w-[7px] h-[7px] rotate-45",style:{backgroundColor:n.datasets[0].backgroundColor[a]}}),o]}),w.jsxs("div",{className:"leading-[16px] !text-[12px] text-[#64748B]",children:["AED ",(t[a]/1e3).toFixed(0),"K"]})]},o))})]})},bs=[{name:"Gym Equipment",value:1e6,color:"#08B6D4"},{name:"Security",value:8e5,color:"#EF4444"},{name:"Others",value:6e5,color:"#F59E0B"},{name:"Pool Maintenance",value:7e5,color:"#8B5CF6"},{name:"Administration",value:52e4,color:"#10B981"}];function yte(){const e=bs.reduce((t,n)=>t+n.value,0);return w.jsx(st,{title:"Asset Value Breakdown",period:w.jsx(qt,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"h-[362px]",titleWeight:"semi-bold",children:w.jsxs("div",{className:"flex flex-col items-center justify-center",children:[w.jsxs("div",{className:"w-[214px] h-[181px] relative",children:[w.jsx(Vo,{width:"100%",height:"100%",children:w.jsxs(ff,{children:[w.jsx(Hl,{data:bs,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:bs.map((t,n)=>w.jsx(Ir,{fill:t.color},`cell-${n}`))}),w.jsx(zo,{formatter:t=>`AED ${t.toLocaleString()}`})]})}),w.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[w.jsxs("div",{className:"font-medium text-lg leading-[12px] ",children:["AED ",(e/1e6).toFixed(2),"M"]}),w.jsx("div",{className:"text-[10px] leading-[12.59px] text-[#121212] mt-[6px]",children:"Total Assets"})]})]}),w.jsxs("div",{className:"flex justify-between w-full px-4 sm:px-8 mt-4 text-[14px]",children:[w.jsx("div",{className:"flex flex-col gap-[8px]",children:bs.slice(0,3).map(t=>w.jsxs("div",{className:"flex items-center gap-[8px]",children:[w.jsx("div",{className:"inline-block h-[7px] w-[7px] rotate-45",style:{backgroundColor:t.color}}),w.jsx("div",{className:"text-[#64748B] leading-[16px] !text-[12px]",children:t.name})]},t.name))}),w.jsx("div",{className:"flex flex-col gap-[8px] items-start",children:bs.slice(3).map(t=>w.jsxs("div",{className:"flex items-center gap-[8px]",children:[w.jsx("div",{className:"inline-block h-[7px] w-[7px] rotate-45",style:{backgroundColor:t.color}}),w.jsx("div",{className:"text-[#64748B] leading-[16px] !text-[12px]",children:t.name})]},t.name))})]})]})})}Tn.register(Ki,Yi,Zl,gr,mr);const bte=()=>{const e=["Gym","Parking","Swimming Pool","Community Hall","Tennis Court"],t=[13e3,9400,8800,7200,6e3],n=[18,12,18,6],r={labels:e,datasets:[{label:"Due",data:t,backgroundColor:"#8B5CF6",barThickness:60}]},i={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:6,callbacks:{title:o=>e[o[0].dataIndex],label:o=>`Due: AED ${(o.parsed.y/1e3).toFixed(1)}K`,afterLabel:o=>`Units Count: ${n[o.dataIndex]}`}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B"}},y:{beginAtZero:!0,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",callback:o=>`${o/1e3}K`}}}};return w.jsx(st,{title:"Revenue by Category",className:"w-full h-[362px]",period:w.jsx(qt,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:w.jsx(Jl,{data:r,options:i})})};function xte(e){return Xe({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15 5l0 2"},child:[]},{tag:"path",attr:{d:"M15 11l0 2"},child:[]},{tag:"path",attr:{d:"M15 17l0 2"},child:[]},{tag:"path",attr:{d:"M5 5h14a2 2 0 0 1 2 2v3a2 2 0 0 0 0 4v3a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-3a2 2 0 0 0 0 -4v-3a2 2 0 0 1 2 -2"},child:[]}]})(e)}function wte(e){return Xe({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M855.7 210.8l-42.4-42.4a8.03 8.03 0 0 0-11.3 0L168.3 801.9a8.03 8.03 0 0 0 0 11.3l42.4 42.4c3.1 3.1 8.2 3.1 11.3 0L855.6 222c3.2-3 3.2-8.1.1-11.2zM304 448c79.4 0 144-64.6 144-144s-64.6-144-144-144-144 64.6-144 144 64.6 144 144 144zm0-216c39.7 0 72 32.3 72 72s-32.3 72-72 72-72-32.3-72-72 32.3-72 72-72zm416 344c-79.4 0-144 64.6-144 144s64.6 144 144 144 144-64.6 144-144-64.6-144-144-144zm0 216c-39.7 0-72-32.3-72-72s32.3-72 72-72 72 32.3 72 72-32.3 72-72 72z"},child:[]}]})(e)}function Ote({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=El,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return w.jsxs(st,{title:e,icon:w.jsx("div",{className:"h-6 w-6 grid place-items-center",children:w.jsx(o,{className:`h-6 w-6 ${a}`})}),children:[w.jsx("div",{className:"text-4xl font-semibold tracking-tight text-[#121212]",children:t}),w.jsxs("div",{className:"flex items-center gap-[8px] text-[14px]",children:[w.jsx("div",{className:i?"text-emerald-600 font-medium":"text-rose-600 font-medium",children:n}),w.jsx("div",{className:"text-slate-500",children:r})]})]})}function Ste(){const e=[{title:"Total Bookings",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:c_,iconColor:"text-emerald-600"},{title:"Utilisation Rate",value:73,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:wte,iconColor:"text-[#329DFF]"},{title:"Revenue",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:xte,iconColor:"text-[#FA7E28]"},{title:"Pending Dues",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:f_,iconColor:"text-[#DBB467]"}];return w.jsx("div",{className:"px-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:e.map((t,n)=>w.jsx(Ote,{...t},n))})}const qc=[{name:"Completed",value:46,color:"#12B981"},{name:"Delayed",value:2,color:"#EF4444"},{name:"Missed",value:2,color:"#F69E0A"}];function Ete(){const t=qc.find(n=>n.name==="Completed")?.value||0;return w.jsx(st,{title:"Guard Patrols",period:w.jsx(qt,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"h-[362px]",children:w.jsxs("div",{className:"flex flex-col items-center justify-center",children:[w.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[w.jsx(Vo,{width:"100%",height:"100%",children:w.jsxs(ff,{children:[w.jsx(Hl,{data:qc,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:qc.map((n,r)=>w.jsx(Ir,{fill:n.color},`cell-${r}`))}),w.jsx(zo,{formatter:n=>n.toLocaleString()})]})}),w.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[w.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px] ",children:[t,"/",50]}),w.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),w.jsx("div",{className:"flex flex-col gap-[8px] mt-3 w-full px-6 text-[14px]",children:qc.map(n=>w.jsxs("div",{className:"flex items-center justify-between",children:[w.jsxs("div",{className:"flex items-center gap-[8px]",children:[w.jsx("div",{className:"inline-block w-[7px] h-[7px] rotate-45",style:{backgroundColor:n.color}}),w.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:n.name})]}),w.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:n.value})]},n.name))})]})})}Tn.register(Ki,Yi,tb,eb,gr,mr);const _te=()=>{const t={labels:["10 AM","12 PM","2 PM","4 PM","6 PM","8 PM","10 PM"],datasets:[{label:"Guest",data:[9,5,12,7,3,6,4],borderColor:"#EF4444",backgroundColor:"rgba(239,68,68,0.15)",pointBackgroundColor:"#EF4444",pointStyle:"rectRot",fill:!1},{label:"Cab",data:[15,12,10,14,7,12,8],borderColor:"#7C3AED",backgroundColor:"rgba(124,58,237,0.15)",pointBackgroundColor:"#7C3AED",pointStyle:"rectRot",fill:!1},{label:"Delivery",data:[22,18,16,20,22,14,17],borderColor:"#10B981",backgroundColor:"rgba(16,185,129,0.15)",pointBackgroundColor:"#10B981",pointStyle:"rectRot",fill:!1},{label:"Service",data:[13,12,8,9,5,10,7],borderColor:"#F59E0B",backgroundColor:"rgba(245,158,11,0.15)",pointBackgroundColor:"#F59E0B",pointStyle:"rectRot",fill:!1}]},n={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,boxWidth:10,boxHeight:10,padding:20}},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:0,callbacks:{title:r=>r[0].label,label:r=>`${r.dataset.label} ${r.parsed.y}`}}},scales:{x:{grid:{color:"#F1F5F9"},ticks:{color:"#64748B"}},y:{beginAtZero:!0,suggestedMax:28,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:4,precision:0}}},elements:{line:{borderWidth:2,tension:0},point:{radius:0,hoverRadius:3,hitRadius:10}}};return w.jsx(st,{title:"Hourly Traffic Flow",className:"w-full h-[362px]",period:w.jsx(qt,{className:"text-[20px] text-[#884EA7]"}),children:w.jsx(rb,{data:t,options:n})})};function Pte(){return w.jsx(st,{title:"Incident Reports",period:w.jsx(qt,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"h-[362px]",children:w.jsxs("div",{children:[w.jsxs("div",{className:"flex w-full text-center gap-[24px]",children:[w.jsxs("div",{className:"flex-1 py-3 bg-[#FBF4F4] h-[76px] rounded",children:[w.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#AB0000]",children:"3"}),w.jsx("div",{className:"!text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),w.jsxs("div",{className:"flex-1 py-3 bg-[#FFFBF2] h-[76px] rounded",children:[w.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#E7A015]",children:"5"}),w.jsx("div",{className:"!text-[12px] leading-[16px] text-[#E7A015]",children:"In-progress"})]}),w.jsxs("div",{className:"flex-1 py-3 bg-[#F7FEFA] h-[76px] rounded",children:[w.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:"12"}),w.jsx("div",{className:"!text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),w.jsxs("div",{className:"mt-4 ",children:[w.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#FAFBFD] rounded-md border border-[#FAFBFD]",children:[w.jsxs("div",{className:"flex items-center gap-[8px]",children:[w.jsx("div",{className:"w-4 h-4 rounded-full flex items-center justify-center bg-[#AB0000]",children:w.jsx("div",{className:"text-white !text-[12px] font-bold",children:"!"})}),w.jsx("div",{className:"text-gray-700 font-medium",children:"INC 001"})]}),w.jsxs("div",{className:"px-3 py-1 rounded-full !text-[12px] font-semibold flex items-center gap-[4px] text-[#AB0000] bg-red-50",children:[w.jsx("div",{children:"4 - Danger"}),w.jsx("div",{className:"w-2 h-2 rounded-full bg-[#AB0000]"})]})]}),w.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#FAFBFD] rounded-md border border-[#FAFBFD]",children:[w.jsxs("div",{className:"flex items-center gap-[8px]",children:[w.jsx("div",{className:"w-4 h-4 rounded-full flex items-center justify-center bg-[#E7A015]",children:w.jsx(a0,{className:"text-white text-[10px]"})}),w.jsx("div",{className:"text-gray-700 font-medium",children:"INC 002"})]}),w.jsxs("div",{className:"px-3 py-1 rounded-full !text-[12px] font-semibold flex items-center gap-[4px] text-[#E7A015] bg-yellow-50",children:[w.jsx("div",{children:"3 - High"}),w.jsx("div",{className:"w-2 h-2 rounded-full bg-[#E7A015]"})]})]}),w.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#FAFBFD] rounded-md border border-[#FAFBFD]",children:[w.jsxs("div",{className:"flex items-center gap-[8px]",children:[w.jsx("div",{className:"w-4 h-4 rounded-full flex items-center justify-center bg-[#1FA05B]",children:w.jsx(a0,{className:"text-white text-[10px]"})}),w.jsx("div",{className:"text-gray-700 font-medium",children:"INC 003"})]}),w.jsxs("div",{className:"px-3 py-1 rounded-full !text-[12px] font-semibold flex items-center gap-[4px] text-[#1FA05B] bg-green-50",children:[w.jsx("div",{children:"1 - Low"}),w.jsx("div",{className:"w-2 h-2 rounded-full bg-[#1FA05B]"})]})]})]})]})})}function Cte(){return w.jsx(st,{title:"Staff Attendance",period:w.jsx(qt,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"h-[362px]",children:w.jsxs("div",{children:[w.jsxs("div",{className:"flex w-full text-center h-[76px] gap-[16px] mb-2",children:[w.jsxs("div",{className:"flex-1 py-4 bg-green-50 rounded-md",children:[w.jsx("div",{className:"!text-[24px] leading-[18px] font-medium text-[#1FA05B] pb-[8px]",children:"25"}),w.jsx("div",{className:"!text-[12px] leading-[16px] text-[#1FA05B]",children:"Present"})]}),w.jsxs("div",{className:"flex-1 py-4 bg-red-50 rounded-md",children:[w.jsx("div",{className:"!text-[24px] leading-[18px] font-medium text-[#AB0000] pb-[8px]",children:"1"}),w.jsx("div",{className:"!text-[12px] leading-[16px] text-[#AB0000]",children:"Absent"})]})]}),w.jsxs("div",{className:"mt-[24px] ",children:[w.jsxs("div",{className:"flex justify-between items-center p-3 bg-[#FAFBFD] rounded-md",children:[w.jsx("div",{className:" font-medium !text-[12px] leading-[18px]",children:"Security guards"}),w.jsx("div",{className:"text-[#64748B] leading[20px] text-[14px]",children:"12/12 Present"})]}),w.jsxs("div",{className:"flex justify-between items-center p-3 bg-[#FAFBFD] rounded-md",children:[w.jsx("div",{className:" font-medium !text-[12px] leading-[18px]",children:"Housekeeping"}),w.jsx("div",{className:"text-[#64748B] leading[20px] text-[14px]",children:"7/8 Present"})]}),w.jsxs("div",{className:"flex justify-between items-center p-3 bg-[#FAFBFD] rounded-md",children:[w.jsx("div",{className:" font-medium !text-[12px] leading-[18px]",children:"Maintenance"}),w.jsx("div",{className:"text-[#64748B] leading[20px] text-[14px]",children:"4/4 Present"})]}),w.jsxs("div",{className:"flex justify-between items-center p-3 bg-[#FAFBFD] rounded-md",children:[w.jsx("div",{className:" font-medium !text-[12px] leading-[18px]",children:"Gardening"}),w.jsx("div",{className:"text-[#64748B] leading[20px] text-[14px]",children:"2/2 Present"})]})]})]})})}function Tte(e){return Xe({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M116,132V96a12,12,0,0,1,24,0v36a12,12,0,0,1-24,0Zm12,56a16,16,0,1,0-16-16A16,16,0,0,0,128,188ZM228,56v56c0,54.29-26.32,87.22-48.4,105.29-23.71,19.39-47.44,26-48.44,26.29a12.1,12.1,0,0,1-6.32,0c-1-.28-24.73-6.9-48.44-26.29C54.32,199.22,28,166.29,28,112V56A20,20,0,0,1,48,36H208A20,20,0,0,1,228,56Zm-24,4H52v52c0,35.71,13.09,64.69,38.91,86.15A126.14,126.14,0,0,0,128,219.38a126.28,126.28,0,0,0,37.09-21.23C190.91,176.69,204,147.71,204,112Z"},child:[]}]})(e)}function Ate({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=El,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return w.jsxs(st,{title:e,icon:w.jsx("div",{className:"h-6 w-6 grid place-items-center",children:w.jsx(o,{className:`h-6 w-6 ${a}`})}),children:[w.jsx("div",{className:"text-4xl font-semibold tracking-tight text-[#121212]",children:t}),w.jsxs("div",{className:"flex items-center gap-[8px] text-[14px]",children:[w.jsx("div",{className:i?"text-emerald-600 font-medium":"text-rose-600 font-medium",children:n}),w.jsx("div",{className:"text-slate-500",children:r})]})]})}function kte(){const e=[{title:"Total Visitors",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:d_,iconColor:"text-[#329DFF]"},{title:"Active Incidents",value:73,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:UG,iconColor:"text-[#F69E0A]"},{title:"Missed Patrols",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Tte,iconColor:"text-[#AB0000]"},{title:"Parking Usage",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:oD,iconColor:"text-[#36AB6C]"}];return w.jsx("div",{className:"px-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:e.map((t,n)=>w.jsx(Ate,{...t},n))})}function Mte({data:e=[]}){console.log(e,"complaints data");const t=Array.isArray(e)?e.map(n=>({title:n.category_name||"—",total:n.total||0,pending:n.pending||0})):[];return w.jsx(st,{title:"Complaints",period:w.jsx(qt,{className:"text-[20px] text-[#884EA7]"}),className:"h-[362px]",children:w.jsx("div",{className:"flex flex-col gap-[12px]",children:t.length>0?t.map((n,r)=>w.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-lg p-3 h-[62px]",children:[w.jsxs("div",{className:"flex flex-col",children:[w.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212]",children:n.title}),w.jsxs("div",{className:"!text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),w.jsxs("div",{className:"flex flex-col items-end",children:[w.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),w.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},r)):w.jsx("div",{className:"text-center text-gray-500 py-8",children:"No data available"})})})}Tn.register(Ki,Yi,Zl,gr,mr);const yE=[{key:"closed_count",label:"Closed",color:"#12B981"},{key:"in_progress_count",label:"In Progress",color:"#F59D0D"},{key:"open_count",label:"Open",color:"#EF4444"}],jte=({data:e=[]})=>{console.log(e,"data for complaint");const t=I.useMemo(()=>{if(!Array.isArray(e)||e.length===0)return{labels:[],datasets:[]};const r=e.map(s=>s.level??"—"),i=Math.max(...e.map(s=>Number(s.total||0)),0),o=e.map(()=>1),a=yE.flatMap((s,l)=>[{label:s.label,data:e.map(c=>Number(c[s.key]||0)),backgroundColor:s.color,barThickness:44},...l<yE.length-1?[{label:"",data:o,backgroundColor:"transparent",barThickness:44}]:[]]);return{labels:r,datasets:a,maxTotal:i}},[e]),n={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,boxWidth:10,boxHeight:10,pointStyle:"rectRot"}},tooltip:{callbacks:{label:r=>r.dataset.label?`${r.dataset.label}: ${r.parsed.y}`:null}}},scales:{x:{stacked:!0,grid:{display:!1}},y:{stacked:!0,beginAtZero:!0,suggestedMax:Math.ceil(t.maxTotal*1.2)||5,ticks:{stepSize:Math.max(Math.ceil(t.maxTotal/6),1)}}}};return w.jsx(st,{title:"Complaints by Level",className:"w-full h-[362px]",period:w.jsx(qt,{className:"text-[20px] text-[#884EA7]"}),children:w.jsx(Jl,{data:t,options:n})})};function Nte({data:e={}}){console.log(e,"request box data");const t=Array.isArray(e?.request_box_by_type)?e.request_box_by_type.map(n=>({title:n.category_name||"—",total:Number(n.total)||0,pending:Number(n.pending)||0})):[];return console.log(t,"requests"),w.jsx(st,{title:"Request Box",period:w.jsx(qt,{className:"text-[20px] text-[#884EA7]"}),className:"h-[362px]",children:w.jsx("div",{className:"flex flex-col gap-[12px]",children:t.length>0?t.map((n,r)=>w.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-lg p-3 h-[62px]",children:[w.jsxs("div",{className:"flex flex-col",children:[w.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212]",children:n.title}),w.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),w.jsxs("div",{className:"flex flex-col items-end",children:[w.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),w.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},`${n.title}-${r}`)):w.jsx("div",{className:"text-center text-gray-500 py-8",children:"No data available"})})})}function Rte(e){return Xe({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinejoin:"round",strokeWidth:"32",d:"M416 221.25V416a48 48 0 0 1-48 48H144a48 48 0 0 1-48-48V96a48 48 0 0 1 48-48h98.75a32 32 0 0 1 22.62 9.37l141.26 141.26a32 32 0 0 1 9.37 22.62z"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M256 56v120a32 32 0 0 0 32 32h120m-232 80h160m-160 80h160"},child:[]}]})(e)}function Dte({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=El,iconColor:a="text-emerald-600"}){return w.jsxs(st,{title:e,icon:w.jsx("div",{className:"h-6 w-6 grid place-items-center",children:w.jsx(o,{className:`h-6 w-6 ${a}`})}),children:[w.jsx("div",{className:"text-4xl font-semibold tracking-tight text-[#121212]",children:t??"—"}),w.jsxs("div",{className:"flex items-center gap-[8px] text-[14px]",children:[w.jsx("div",{className:i?"text-emerald-600 font-medium":"text-rose-600 font-medium",children:n??"—"}),w.jsx("div",{className:"text-slate-500",children:r})]})]})}function Ite({data:e}){console.log(e,"stats grid data");const n=[{key:"open_complaints",title:"Open Complaints",Icon:c_,iconColor:"text-[#AB0000]",deltaLabel:"Compared to last month"},{key:"pending_requests",title:"Pending Requests",Icon:Rte,iconColor:"text-[#E7A015]",deltaLabel:"Compared to last month"},{key:"avg_response_time",title:"Avg Response Time",Icon:nD,iconColor:"text-[#1FA05B]",deltaLabel:"Compared to last month"},{key:"resolution_rate",title:"Resolution Rate",Icon:JR,iconColor:"text-[#329DFF]",deltaLabel:"Compared to last month"}].map(r=>{const i=e?.[r.key]||{};return{title:r.title,value:i.current??"—",delta:i.trend_percent??"—",positive:i.direction==="good"||i.direction==="neutral",Icon:r.Icon,iconColor:r.iconColor,deltaLabel:r.deltaLabel}});return w.jsx("div",{className:"px-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:n.map((r,i)=>w.jsx(Dte,{...r},i))})}function bE({title:e,date:t,rsvp:n,utilisation:r,status:i}){return w.jsxs("div",{className:" bg-[#F8FAFC] h-[106px] px-3 mt-3",children:[w.jsxs("div",{className:"flex items-center justify-between",children:[w.jsx("div",{className:"text-[16px] leading-[20px] font-semibold text-[#121212]",children:e}),w.jsx("div",{className:`!text-[12px] font-medium leading-[16px] px-2 py-1 ${i==="Completed"?"text-[#36AB6C] bg-[#E6F7EE]":i==="Upcoming"?"text-[#329DFF] bg-[#E6F2FF]":"text-slate-500 bg-slate-100"}`,children:i})]}),w.jsx("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:t}),w.jsxs("div",{className:"flex justify-between items-center mt-2",children:[w.jsxs("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:[n," RSVP"]}),w.jsxs("div",{className:"text-[#3C82F6] text-[14px] leading-[18px] font-medium",children:[r,"% utilisation"]})]}),w.jsx("div",{className:"w-full bg-[#F8FAFC] h-[6px] rounded mt-2 mb-3",children:w.jsx("div",{className:"h-[6px] rounded bg-[#3C82F6]",style:{width:`${r}%`}})})]})}function $te(){return w.jsx(st,{title:"Events Utilisation",period:w.jsx(qt,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"w-full h-[360px]",children:w.jsxs("div",{children:[w.jsx(bE,{title:"Holi Celebration",date:"25 Jun 2025",rsvp:"78/100",utilisation:71,status:"Upcoming"}),w.jsx(bE,{title:"Maintenance Meeting",date:"25 Jun 2025",rsvp:"45/60",utilisation:75,status:"Completed"})]})})}function Kc({label:e,value:t,subLabel:n,bgColor:r,textColor:i}){return w.jsxs("div",{className:`rounded-lg p-4 ${r} h-[124px]`,children:[w.jsx("div",{className:`text-[16px] font-medium ${i} leading-[20px]`,children:e}),w.jsx("div",{className:"mt-4 text-[28px] leading-[32px] font-semibold text-[#121212]",children:t}),w.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-2",children:n})]})}function Lte(){return w.jsx(st,{title:"Notice Board Status",period:w.jsx(qt,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"w-full h-[360px]",children:w.jsxs("div",{className:"grid grid-cols-2 gap-[16px]",children:[w.jsx(Kc,{label:"Active",value:138,subLabel:"3 expiring soon",bgColor:"bg-[#F0FFF7]",textColor:"text-[#1FA05B]"}),w.jsx(Kc,{label:"Scheduled",value:13,subLabel:"4 this week",bgColor:"bg-[#FFFBF2]",textColor:"text-[#E7A015]"}),w.jsx(Kc,{label:"Recurring",value:3,subLabel:"All active",bgColor:"bg-[#EDF6FF]",textColor:"text-[#329DFF]"}),w.jsx(Kc,{label:"Expired",value:7,subLabel:"4 recent",bgColor:"bg-[#F6F6F6]",textColor:"text-[#64748B]"})]})})}function rM(e){return Xe({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M20 22H4C3.44772 22 3 21.5523 3 21V3C3 2.44772 3.44772 2 4 2H20C20.5523 2 21 2.44772 21 3V21C21 21.5523 20.5523 22 20 22ZM19 20V4H5V20H19ZM8 9H16V11H8V9ZM8 13H16V15H8V13Z"},child:[]}]})(e)}function Fte({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=El,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return w.jsx(st,{title:e,icon:w.jsx("div",{className:`h-6 w-6 grid place-items-center rounded-md ${s}`,children:w.jsx(o,{className:`h-4 w-4 ${a}`})}),className:"h-[132px]",children:w.jsxs("div",{children:[w.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),w.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[w.jsx("div",{className:i?"text-[#1FA05B] font-medium":"text-rose-600 font-medium",children:n}),w.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}function Bte({data:e}){const t=[{title:e?.title||"Total Bookings",value:145,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:rM,iconColor:"text-emerald-600",iconBg:"bg-emerald-50"}];return w.jsx("div",{className:"h-full",children:t.map((n,r)=>w.jsx(Fte,{...n},r))})}function zte(e){return Xe({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"},child:[]}]})(e)}function Vte({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=El,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return w.jsx(st,{title:e,icon:w.jsx("div",{className:`h-6 w-6 grid place-items-center rounded-md ${s}`,children:w.jsx(o,{className:`h-4 w-4 ${a}`})}),className:"h-[132px]",children:w.jsxs("div",{children:[w.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),w.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[w.jsx("div",{className:i?"text-[#1FA05B] font-medium":"text-rose-600 font-medium",children:n}),w.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}function Wte(){const e=[{title:"Notice",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:rM,iconColor:"text-emerald-600",iconBg:"bg-emerald-50"},{title:"Post",value:83,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:aD,iconColor:"text-[#329DFF]",iconBg:"bg-emerald-50"},{title:"Poll",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:VG,iconColor:"text-[#FA7E28]",iconBg:"bg-orange-100"},{title:"Poll",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:zte,iconColor:"text-[#DBB467]",iconBg:"bg-yellow-100"}];return w.jsx("div",{className:"px-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:e.map((t,n)=>w.jsx(Vte,{...t},n))})}exports.Accounting=pte;exports.AssetValueBreakdown=yte;exports.BlockWiseOccupancy=cte;exports.Budgets=hte;exports.Card=st;exports.CashBankBalance=mte;exports.Community=qG;exports.Complaints=Mte;exports.ComplaintsByLevel=jte;exports.DuesAgeing=gte;exports.Engagement=KG;exports.EngagementStatsGrid=Wte;exports.EventsUtilisation=$te;exports.ExpenseCategories=vte;exports.Facilities=YG;exports.FinanceSummary=GG;exports.GateAndSecurityStatsGrid=kte;exports.GateUpdates=DX;exports.GuardPatrols=Ete;exports.Header=rD;exports.Helpdesk=IX;exports.HelpdeskStatsGrid=Ite;exports.HourlyTrafficFlow=_te;exports.IncidentReports=Pte;exports.IncomeExpenditure=nM;exports.MainHeader=cD;exports.MoveInOutTrends=dte;exports.NoticeBoardStatus=Lte;exports.OccupancyOverview=ate;exports.RequestBox=Nte;exports.ResidentOverview=lte;exports.RevenuebyCategory=bte;exports.SingleStats=Bte;exports.StaffAttendance=Cte;exports.StatsGrid=Ste;exports.UnitStatus=ote;