anarock-widgets 1.0.146 → 1.0.147

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
@@ -236,7 +236,7 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
236
236
  `))}},[en,we,S,w,W]),un&&(S?ft.length===0?kt=null:kt=ft.reduce((G,ue,fe)=>(G.push(ue),fe<ft.length-1&&G.push(", "),G),[]):kt=Wt);let Nn=ce;!a&&ae&&ee&&(Nn=j.clientWidth);let Kt;typeof M<"u"?Kt=M:Kt=d?null:0;const jn=N.id||(w?`mui-component-select-${w}`:void 0),ye={...t,variant:$,value:W,open:lt,error:p},fn=Zne(ye),qt={...y.PaperProps,...typeof y.slotProps?.paper=="function"?y.slotProps.paper(ye):y.slotProps?.paper},H={...y.MenuListProps,...typeof y.slotProps?.list=="function"?y.slotProps.list(ye):y.slotProps?.list},le=oC();return b.jsxs(P.Fragment,{children:[b.jsx(qne,{as:"div",ref:Z,tabIndex:Kt,role:"combobox","aria-controls":lt?le:void 0,"aria-disabled":d?"true":void 0,"aria-expanded":lt?"true":"false","aria-haspopup":"listbox","aria-label":i,"aria-labelledby":[g,jn].filter(Boolean).join(" ")||void 0,"aria-describedby":r,"aria-required":O?"true":void 0,"aria-invalid":p?"true":void 0,onKeyDown:bt,onMouseDown:d||R?null:te,onBlur:Ye,onFocus:C,...N,ownerState:ye,className:oe(N.className,fn.select,l),id:jn,children:Qne(kt)?YO||(YO=b.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):kt}),b.jsx(Xne,{"aria-invalid":p,value:Array.isArray(W)?W.join(","):W,name:w,ref:re,"aria-hidden":!0,onChange:Fe,tabIndex:-1,disabled:d,className:fn.nativeInput,autoFocus:o,required:O,...V,ownerState:ye}),b.jsx(Gne,{as:m,className:fn.icon,ownerState:ye}),b.jsx(AN,{id:`menu-${w||""}`,anchorEl:j,open:lt,onClose:ge,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...y,slotProps:{...y.slotProps,list:{"aria-labelledby":g,role:"listbox","aria-multiselectable":S?"true":void 0,disableListWrap:!0,id:le,...H},paper:{...qt,style:{minWidth:Nn,...qt!=null?qt.style:null}}},children:dn})]})});process.env.NODE_ENV!=="production"&&(LN.propTypes={"aria-describedby":v.string,"aria-label":v.string,autoFocus:v.bool,autoWidth:v.bool,children:v.node,classes:v.object,className:v.string,defaultOpen:v.bool,defaultValue:v.any,disabled:v.bool,displayEmpty:v.bool,error:v.bool,IconComponent:v.elementType.isRequired,inputRef:so,labelId:v.string,MenuProps:v.object,multiple:v.bool,name:v.string,onBlur:v.func,onChange:v.func,onClose:v.func,onFocus:v.func,onOpen:v.func,open:v.bool,readOnly:v.bool,renderValue:v.func,required:v.bool,SelectDisplayProps:v.object,tabIndex:v.oneOfType([v.number,v.string]),type:v.any,value:v.any,variant:v.oneOf(["standard","outlined","filled"])});const Jne=e=>{const{classes:t}=e,r=_n({root:["root"]},IN,t);return{...t,...r}},rx={name:"MuiSelect",slot:"Root",shouldForwardProp:e=>Ji(e)&&e!=="variant"},ere=Ce(ex,rx)(""),tre=Ce(nx,rx)(""),nre=Ce(J0,rx)(""),ix=P.forwardRef(function(t,n){const r=Gn({name:"MuiSelect",props:t}),{autoWidth:i=!1,children:o,classes:a={},className:s,defaultOpen:l=!1,displayEmpty:c=!1,IconComponent:u=qte,id:d,input:f,inputProps:p,label:m,labelId:h,MenuProps:g,multiple:y=!1,native:S=!1,onClose:w,onOpen:x,open:_,renderValue:E,SelectDisplayProps:C,variant:D="outlined",...A}=r,R=S?jN:LN,T=Z0(),O=X0({props:r,muiFormControl:T,states:["variant","error"]}),N=O.variant||D,M={...r,variant:N,classes:a},I=Jne(M),{root:L,...$}=I,V=f||{standard:b.jsx(ere,{ownerState:M}),outlined:b.jsx(tre,{label:m,ownerState:M}),filled:b.jsx(nre,{ownerState:M})}[N],W=kn(n,ll(V));return b.jsx(P.Fragment,{children:P.cloneElement(V,{inputComponent:R,inputProps:{children:o,error:O.error,IconComponent:u,variant:N,type:void 0,multiple:y,...S?{id:d}:{autoWidth:i,defaultOpen:l,displayEmpty:c,labelId:h,MenuProps:g,onClose:w,onOpen:x,open:_,renderValue:E,SelectDisplayProps:{id:d,...C}},...p,classes:p?xn($,p.classes):$,...f?f.props.inputProps:{}},...(y&&S||c)&&N==="outlined"?{notched:!0}:{},ref:W,className:oe(V.props.className,s,I.root),...!f&&{variant:N},...A})})});process.env.NODE_ENV!=="production"&&(ix.propTypes={autoWidth:v.bool,children:v.node,classes:v.object,className:v.string,defaultOpen:v.bool,defaultValue:v.any,displayEmpty:v.bool,IconComponent:v.elementType,id:v.string,input:v.element,inputProps:v.object,label:v.node,labelId:v.string,MenuProps:v.object,multiple:v.bool,native:v.bool,onChange:v.func,onClose:v.func,onOpen:v.func,open:v.bool,renderValue:v.func,SelectDisplayProps:v.object,sx:v.oneOfType([v.arrayOf(v.oneOfType([v.func,v.object,v.bool])),v.func,v.object]),value:v.oneOfType([v.oneOf([""]),v.any]),variant:v.oneOf(["filled","outlined","standard"])});ix.muiName="Select";function rre(e){return sn("MuiTooltip",e)}const Et=Dn("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]);function ire(e){return Math.round(e*1e5)/1e5}const ore=e=>{const{classes:t,disableInteractive:n,arrow:r,touch:i,placement:o}=e,a={popper:["popper",!n&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",i&&"touch",`tooltipPlacement${on(o.split("-")[0])}`],arrow:["arrow"]};return _n(a,rre,t)},are=Ce(G0,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.popper,!n.disableInteractive&&t.popperInteractive,n.arrow&&t.popperArrow,!n.open&&t.popperClose]}})(Tn(({theme:e})=>({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none",variants:[{props:({ownerState:t})=>!t.disableInteractive,style:{pointerEvents:"auto"}},{props:({open:t})=>!t,style:{pointerEvents:"none"}},{props:({ownerState:t})=>t.arrow,style:{[`&[data-popper-placement*="bottom"] .${Et.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${Et.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${Et.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${Et.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:({ownerState:t})=>t.arrow&&!t.isRtl,style:{[`&[data-popper-placement*="right"] .${Et.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!!t.isRtl,style:{[`&[data-popper-placement*="right"] .${Et.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!t.isRtl,style:{[`&[data-popper-placement*="left"] .${Et.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!!t.isRtl,style:{[`&[data-popper-placement*="left"] .${Et.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}))),sre=Ce("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.tooltip,n.touch&&t.touch,n.arrow&&t.tooltipArrow,t[`tooltipPlacement${on(n.placement.split("-")[0])}`]]}})(Tn(({theme:e})=>({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:e.alpha(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium,[`.${Et.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${Et.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${Et.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${Et.popper}[data-popper-placement*="bottom"] &`]:{transformOrigin:"center top",marginTop:"14px"},variants:[{props:({ownerState:t})=>t.arrow,style:{position:"relative",margin:0}},{props:({ownerState:t})=>t.touch,style:{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:`${ire(16/14)}em`,fontWeight:e.typography.fontWeightRegular}},{props:({ownerState:t})=>!t.isRtl,style:{[`.${Et.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${Et.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:({ownerState:t})=>!t.isRtl&&t.touch,style:{[`.${Et.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${Et.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:({ownerState:t})=>!!t.isRtl,style:{[`.${Et.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${Et.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:({ownerState:t})=>!!t.isRtl&&t.touch,style:{[`.${Et.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${Et.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:({ownerState:t})=>t.touch,style:{[`.${Et.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:({ownerState:t})=>t.touch,style:{[`.${Et.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]}))),lre=Ce("span",{name:"MuiTooltip",slot:"Arrow"})(Tn(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:e.alpha(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}})));let ld=!1;const KO=new dh;let jl={x:0,y:0};function cd(e,t){return(n,...r)=>{t&&t(n,...r),e(n,...r)}}const FN=P.forwardRef(function(t,n){const r=Gn({props:t,name:"MuiTooltip"}),{arrow:i=!1,children:o,classes:a,components:s={},componentsProps:l={},describeChild:c=!1,disableFocusListener:u=!1,disableHoverListener:d=!1,disableInteractive:f=!1,disableTouchListener:p=!1,enterDelay:m=100,enterNextDelay:h=0,enterTouchDelay:g=700,followCursor:y=!1,id:S,leaveDelay:w=0,leaveTouchDelay:x=1500,onClose:_,onOpen:E,open:C,placement:D="bottom",PopperComponent:A,PopperProps:R={},slotProps:T={},slots:O={},title:N,TransitionComponent:M,TransitionProps:I,...L}=r,$=P.isValidElement(o)?o:b.jsx("span",{children:o}),V=_p(),W=Oy(),[B,X]=P.useState(),[q,re]=P.useState(null),J=P.useRef(!1),ee=f||y,ie=ql(),ae=ql(),ce=ql(),U=ql(),[K,Z]=Xg({controlled:C,default:!1,name:"Tooltip",state:"open"});let j=K;if(process.env.NODE_ENV!=="production"){const{current:be}=P.useRef(C!==void 0);P.useEffect(()=>{B&&B.disabled&&!be&&N!==""&&B.tagName.toLowerCase()==="button"&&console.warn(["MUI: You are providing a disabled `button` child to the Tooltip component.","A disabled element does not fire events.","Tooltip needs to listen to the child element's events to display the title.","","Add a simple wrapper element, such as a `span`."].join(`
237
237
  `))},[N,B,be])}const me=oC(S),te=P.useRef(),ge=mc(()=>{te.current!==void 0&&(document.body.style.WebkitUserSelect=te.current,te.current=void 0),U.clear()});P.useEffect(()=>ge,[ge]);const we=be=>{KO.clear(),ld=!0,Z(!0),E&&!j&&E(be)},Fe=mc(be=>{KO.start(800+w,()=>{ld=!1}),Z(!1),_&&j&&_(be),ie.start(V.transitions.duration.shortest,()=>{J.current=!1})}),ot=be=>{J.current&&be.type!=="touchstart"||(B&&B.removeAttribute("title"),ae.clear(),ce.clear(),m||ld&&h?ae.start(ld?h:m,()=>{we(be)}):we(be))},bt=be=>{ae.clear(),ce.start(w,()=>{Fe(be)})},[,lt]=P.useState(!1),Ye=be=>{SO(be.target)||(lt(!1),bt(be))},kt=be=>{B||X(be.currentTarget),SO(be.target)&&(lt(!0),ot(be))},Wt=be=>{J.current=!0;const Sn=$.props;Sn.onTouchStart&&Sn.onTouchStart(be)},ft=be=>{Wt(be),ce.clear(),ie.clear(),ge(),te.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",U.start(g,()=>{document.body.style.WebkitUserSelect=te.current,ot(be)})},un=be=>{$.props.onTouchEnd&&$.props.onTouchEnd(be),ge(),ce.start(x,()=>{Fe(be)})};P.useEffect(()=>{if(!j)return;function be(Sn){Sn.key==="Escape"&&Fe(Sn)}return document.addEventListener("keydown",be),()=>{document.removeEventListener("keydown",be)}},[Fe,j]);const en=kn(ll($),X,n);!N&&N!==0&&(j=!1);const dn=P.useRef(),Nn=be=>{const Sn=$.props;Sn.onMouseMove&&Sn.onMouseMove(be),jl={x:be.clientX,y:be.clientY},dn.current&&dn.current.update()},Kt={},jn=typeof N=="string";c?(Kt.title=!j&&jn&&!d?N:null,Kt["aria-describedby"]=j?me:null):(Kt["aria-label"]=jn?N:null,Kt["aria-labelledby"]=j&&!jn?me:null);const ye={...Kt,...L,...$.props,className:oe(L.className,$.props.className),onTouchStart:Wt,ref:en,...y?{onMouseMove:Nn}:{}};process.env.NODE_ENV!=="production"&&(ye["data-mui-internal-clone-element"]=!0,P.useEffect(()=>{B&&!B.getAttribute("data-mui-internal-clone-element")&&console.error(["MUI: The `children` component of the Tooltip is not forwarding its props correctly.","Please make sure that props are spread on the same element that the ref is applied to."].join(`
238
238
  `))},[B]));const fn={};p||(ye.onTouchStart=ft,ye.onTouchEnd=un),d||(ye.onMouseOver=cd(ot,ye.onMouseOver),ye.onMouseLeave=cd(bt,ye.onMouseLeave),ee||(fn.onMouseOver=ot,fn.onMouseLeave=bt)),u||(ye.onFocus=cd(kt,ye.onFocus),ye.onBlur=cd(Ye,ye.onBlur),ee||(fn.onFocus=kt,fn.onBlur=Ye)),process.env.NODE_ENV!=="production"&&$.props.title&&console.error(["MUI: You have provided a `title` prop to the child of <Tooltip />.",`Remove this title prop \`${$.props.title}\` or the Tooltip component.`].join(`
239
- `));const qt={...r,isRtl:W,arrow:i,disableInteractive:ee,placement:D,PopperComponentProp:A,touch:J.current},H=typeof T.popper=="function"?T.popper(qt):T.popper,le=P.useMemo(()=>{let be=[{name:"arrow",enabled:!!q,options:{element:q,padding:4}}];return R.popperOptions?.modifiers&&(be=be.concat(R.popperOptions.modifiers)),H?.popperOptions?.modifiers&&(be=be.concat(H.popperOptions.modifiers)),{...R.popperOptions,...H?.popperOptions,modifiers:be}},[q,R.popperOptions,H?.popperOptions]),G=ore(qt),ue=typeof T.transition=="function"?T.transition(qt):T.transition,fe={slots:{popper:s.Popper,transition:s.Transition??M,tooltip:s.Tooltip,arrow:s.Arrow,...O},slotProps:{arrow:T.arrow??l.arrow,popper:{...R,...H??l.popper},tooltip:T.tooltip??l.tooltip,transition:{...I,...ue??l.transition}}},[tt,pt]=Hn("popper",{elementType:are,externalForwardedProps:fe,ownerState:qt,className:oe(G.popper,R?.className)}),[hr,uo]=Hn("transition",{elementType:jc,externalForwardedProps:fe,ownerState:qt}),[mr,qo]=Hn("tooltip",{elementType:sre,className:G.tooltip,externalForwardedProps:fe,ownerState:qt}),[_i,Hr]=Hn("arrow",{elementType:lre,className:G.arrow,externalForwardedProps:fe,ownerState:qt,ref:re});return b.jsxs(P.Fragment,{children:[P.cloneElement($,ye),b.jsx(tt,{as:A??G0,placement:D,anchorEl:y?{getBoundingClientRect:()=>({top:jl.y,left:jl.x,right:jl.x,bottom:jl.y,width:0,height:0})}:B,popperRef:dn,open:B?j:!1,id:me,transition:!0,...fn,...pt,popperOptions:le,children:({TransitionProps:be})=>b.jsx(hr,{timeout:V.transitions.duration.shorter,...be,...uo,children:b.jsxs(mr,{...qo,children:[N,i?b.jsx(_i,{...Hr}):null]})})})]})});process.env.NODE_ENV!=="production"&&(FN.propTypes={arrow:v.bool,children:cl.isRequired,classes:v.object,className:v.string,components:v.shape({Arrow:v.elementType,Popper:v.elementType,Tooltip:v.elementType,Transition:v.elementType}),componentsProps:v.shape({arrow:v.object,popper:v.object,tooltip:v.object,transition:v.object}),describeChild:v.bool,disableFocusListener:v.bool,disableHoverListener:v.bool,disableInteractive:v.bool,disableTouchListener:v.bool,enterDelay:v.number,enterNextDelay:v.number,enterTouchDelay:v.number,followCursor:v.bool,id:v.string,leaveDelay:v.number,leaveTouchDelay:v.number,onClose:v.func,onOpen:v.func,open:v.bool,placement:v.oneOf(["auto-end","auto-start","auto","bottom-end","bottom-start","bottom","left-end","left-start","left","right-end","right-start","right","top-end","top-start","top"]),PopperComponent:v.elementType,PopperProps:v.object,slotProps:v.shape({arrow:v.oneOfType([v.func,v.object]),popper:v.oneOfType([v.func,v.object]),tooltip:v.oneOfType([v.func,v.object]),transition:v.oneOfType([v.func,v.object])}),slots:v.shape({arrow:v.elementType,popper:v.elementType,tooltip:v.elementType,transition:v.elementType}),sx:v.oneOfType([v.arrayOf(v.oneOfType([v.func,v.object,v.bool])),v.func,v.object]),title:v.node,TransitionComponent:v.elementType,TransitionProps:v.object});function cre(e){return Ze({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Box_List"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M6.562,8.062h-2a1.5,1.5,0,0,1-1.5-1.5v-2a1.5,1.5,0,0,1,1.5-1.5h2a1.5,1.5,0,0,1,1.5,1.5v2A1.5,1.5,0,0,1,6.562,8.062Zm-2-4a.5.5,0,0,0-.5.5v2a.5.5,0,0,0,.5.5h2a.5.5,0,0,0,.5-.5v-2a.5.5,0,0,0-.5-.5Z"},child:[]},{tag:"path",attr:{d:"M6.562,20.938h-2a1.5,1.5,0,0,1-1.5-1.5v-2a1.5,1.5,0,0,1,1.5-1.5h2a1.5,1.5,0,0,1,1.5,1.5v2A1.5,1.5,0,0,1,6.562,20.938Zm-2-4a.5.5,0,0,0-.5.5v2a.5.5,0,0,0,.5.5h2a.5.5,0,0,0,.5-.5v-2a.5.5,0,0,0-.5-.5Z"},child:[]},{tag:"path",attr:{d:"M6.562,14.5h-2a1.5,1.5,0,0,1-1.5-1.5V11a1.5,1.5,0,0,1,1.5-1.5h2a1.5,1.5,0,0,1,1.5,1.5v2A1.5,1.5,0,0,1,6.562,14.5Zm-2-4a.5.5,0,0,0-.5.5v2a.5.5,0,0,0,.5.5h2a.5.5,0,0,0,.5-.5V11a.5.5,0,0,0-.5-.5Z"},child:[]},{tag:"path",attr:{d:"M20.438,6.062h-9a.5.5,0,0,1,0-1h9a.5.5,0,0,1,0,1Z"},child:[]},{tag:"path",attr:{d:"M20.438,12.5h-9a.5.5,0,0,1,0-1h9a.5.5,0,0,1,0,1Z"},child:[]},{tag:"path",attr:{d:"M20.438,18.935h-9a.5.5,0,1,1,0-1h9a.5.5,0,0,1,0,1Z"},child:[]}]}]}]})(e)}function ure(e){return Ze({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Export"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M5.552,20.968a2.577,2.577,0,0,1-2.5-2.73c-.012-2.153,0-4.306,0-6.459a.5.5,0,0,1,1,0c0,2.2-.032,4.4,0,6.6.016,1.107.848,1.589,1.838,1.589H18.353A1.546,1.546,0,0,0,19.825,19a3.023,3.023,0,0,0,.1-1.061V11.779h0a.5.5,0,0,1,1,0c0,2.224.085,4.465,0,6.687a2.567,2.567,0,0,1-2.67,2.5Z"},child:[]},{tag:"path",attr:{d:"M12.337,3.176a.455.455,0,0,0-.311-.138c-.015,0-.028,0-.043-.006s-.027,0-.041.006a.457.457,0,0,0-.312.138L7.961,6.845a.5.5,0,0,0,.707.707l2.816-2.815V15.479a.5.5,0,0,0,1,0V4.737L15.3,7.552a.5.5,0,0,0,.707-.707Z"},child:[]}]}]}]})(e)}function dre(e){return Ze({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Warning"},child:[{tag:"g",attr:{},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M12.5,8.752a.5.5,0,0,0-1,0h0v6a.5.5,0,0,0,1,0Z"},child:[]},{tag:"circle",attr:{cx:"11.999",cy:"16.736",r:"0.5"},child:[]}]},{tag:"path",attr:{d:"M18.642,20.934H5.385A2.5,2.5,0,0,1,3.163,17.29L9.792,4.421a2.5,2.5,0,0,1,4.444,0L20.865,17.29a2.5,2.5,0,0,1-2.223,3.644ZM12.014,4.065a1.478,1.478,0,0,0-1.334.814L4.052,17.748a1.5,1.5,0,0,0,1.333,2.186H18.642a1.5,1.5,0,0,0,1.334-2.186L13.348,4.879A1.478,1.478,0,0,0,12.014,4.065Z"},child:[]}]}]}]})(e)}Vd(ix)(()=>({width:"fit-content",maxWidth:"100px",height:"28px",padding:"0 6px",display:"flex",fontSize:"12px",alignItems:"center","& .MuiSelect-select":{padding:0},"& .MuiOutlinedInput-notchedOutline":{borderColor:"#C6C6C6",transition:"all 0.2s ease"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#B084CC"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"#884EA7 !important",boxShadow:"0 0 0 3px rgba(136, 78, 167, 0.2)"}}));function ul({widgetId:e,options:t=[],defaultValue:n=["all"],onFilterChange:r=()=>{},onExport:i=()=>{}}){const o=JSON.parse(sessionStorage.getItem("community_id"))||[],[a,s]=k.useState(o),[l,c]=k.useState("");t.filter(d=>d.community_name.toLowerCase().includes(l.toLowerCase()));const u=()=>{bw("widget_id",e),bw("export",!0),i()};return b.jsx("div",{className:"flex items-center gap-2",children:b.jsx(FN,{title:"Export CSV for this widget",children:b.jsx("button",{onClick:u,className:"px-3 py-2 bg-[#FBF5FF] rounded cursor-pointer",children:b.jsx(ure,{className:"stroke-[#884EA7] stroke-[1.4]"})})})})}function fre({isStatic:e,data:t}){const n=Number(t?.thisMonthMoveIns??t?.lastMonthMoveIns??0),r=Number(t?.thisMonthMoveOuts??t?.lastMonthMoveOuts??0),i=Number(t?.moveInPercentChange??t?.moveInChange??0),o=Number(t?.moveOutPercentChange??t?.moveOutChange??0),a=["#8B5CF6","#EBE4F9"],s=[{name:"Move-ins",value:n,color:a[0]},{name:"Move-outs",value:r,color:a[1]}];function l(c,u){return((Number(c)+Number(u))/2).toFixed(2)+"%"}return b.jsx(Ha,{title:"Community",period:"This Month",icon:b.jsx(zy,{className:"!text-[24px] text-[#329DFF]"}),className:`${e&&"max-h-[184px]"} h-[184px] mb-4 break-inside-avoid gap-[20px]`,actionButtons:b.jsx(ul,{widgetId:t?.widget_id,options:t?.communities}),children:b.jsxs("div",{className:"flex",children:[b.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[b.jsxs("div",{className:"flex flex-col gap-[8px]",children:[b.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Move-in/Out Count"}),b.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium !text-[#8B5CF6]",children:n+r})]}),b.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] flex items-center gap-[4px]",children:[b.jsx(Yy,{value:l(i,o)}),b.jsx("div",{className:"whitespace-nowrap",children:"Compared to last month"})]})]}),b.jsx("div",{className:"w-[50%] h-[111px] flex justify-end",children:b.jsx(xi,{width:"75%",height:"100%",children:b.jsxs(bu,{children:[b.jsxs(il,{data:s,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:[b.jsx(Br,{fill:a[0]}),b.jsx(Br,{fill:a[1]})]}),b.jsx(bi,{content:b.jsx(Zc,{})})]})})})]})})}function pre({isStatic:e,data:t,communities:n}){const r=["#8B5CF6","#22C55E","#3B82F6","#F59E0B"],i=[{name:"Notice",value:Number(t?.total_notices||0),color:r[0]},{name:"Post",value:Number(t?.total_topics||0),color:r[1]},{name:"Poll",value:Number(t?.total_polls||0),color:r[2]},{name:"Survey",value:Number(t?.total_surveys||0),color:r[3]}],o=t?.widget==="commercial";return b.jsx(Ha,{title:"Engagement",period:"This Month",icon:b.jsx(nk,{className:"!text-[24px] text-[#DBB467]"}),className:`${e&&"max-h-[303px]"} ${o?"h-[324px]":"h-[303px]"} gap-[20px]`,actionButtons:b.jsx(ul,{widgetId:t?.widget_id,options:t?.communities}),children:b.jsx("div",{className:"w-full h-[235px]",children:b.jsx(xi,{width:"100%",height:"100%",children:b.jsxs(KM,{data:i,layout:"vertical",margin:{top:4,right:8,left:0,bottom:0},children:[b.jsx(ol,{stroke:"#e5e7eb",strokeDasharray:"3 3",horizontal:!1}),b.jsx($a,{type:"category",dataKey:"name",width:40,axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#121212",fontWeight:400}}),b.jsx(al,{type:"number",allowDecimals:!1,axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#64748B",fontWeight:400}}),b.jsx(bi,{content:b.jsx(Zc,{}),cursor:{fill:"transparent"}}),b.jsx(nc,{dataKey:"value",barSize:40,isAnimationActive:!1,children:i.map((a,s)=>b.jsx(Br,{fill:r[s]},a.name))})]})})})})}function hre({isStatic:e,data:t}){const n=Number(t?.totalBookings||0),r=Number(t?.averageUtilizationPercentage||0),i=k.useMemo(()=>{if(!t?.graph)return[];const{labels:s=[],bookings:l=[],utilization:c=[]}=t.graph;return s.map((u,d)=>({time:u,bookings:l[d]||0,utilization:c[d]||0}))},[t]),o=s=>["12 AM","6 AM","12 PM","6 PM","11 PM"].includes(s)?s:"",a=i.length?i:Array.from({length:24},(s,l)=>({time:`${l%12||12} ${l>=12?"PM":"AM"}`,bookings:0,utilization:0}));return b.jsxs(Ha,{title:"Facilities",period:"Today",icon:b.jsx(Mp,{className:"!text-[24px] text-[#8B5CF6]"}),className:`${e&&"max-h-[305px]"} h-[305px] mb-4 break-inside-avoid`,actionButtons:b.jsx(ul,{widgetId:t?.widget_id,options:t?.communities}),children:[b.jsxs("div",{className:"grid grid-cols-2 gap-[24px] mt-[16px] mb-[16px]",children:[b.jsxs("div",{children:[b.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Bookings"}),b.jsx("div",{className:"!text-[24px] font-medium text-[#8B5CF6]",children:n})]}),b.jsxs("div",{children:[b.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Utilisation Rate"}),b.jsxs("div",{className:"!text-[24px] font-medium text-[#329DFF]",children:[r.toFixed(2),"%"]})]})]}),b.jsx("div",{className:"w-full h-[170px]",children:b.jsx(xi,{width:"100%",height:"100%",children:b.jsxs(B0,{data:a,margin:{top:5,right:-30,left:-35,bottom:0},children:[b.jsx(ol,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),b.jsx(al,{dataKey:"time",interval:0,tickFormatter:o,tick:{fontSize:10,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1,minTickGap:0}),b.jsx($a,{yAxisId:"left",tick:{fontSize:10,fill:"#64748B"},axisLine:!1,tickLine:!1}),b.jsx($a,{yAxisId:"right",orientation:"right",domain:[0,100],ticks:[0,20,40,60,80,100],tickFormatter:s=>`${s}%`,tick:{fontSize:10,fill:"#64748B"},axisLine:!1,tickLine:!1}),b.jsx(bi,{content:b.jsx(Zc,{})}),b.jsx(Co,{yAxisId:"left",type:"monotone",dataKey:"bookings",name:"Bookings",stroke:"#8B5CF6",strokeWidth:2,dot:!1,isAnimationActive:!1}),b.jsx(Co,{yAxisId:"right",type:"monotone",dataKey:"utilization",name:"Utilization Rate",stroke:"#329DFF",strokeWidth:2,dot:!1,strokeDasharray:"2 4",isAnimationActive:!1})]})})})]})}function mre({data:e}){const t=e?.incomeSummary||{},n=e?.expenditureSummary||{},r=["AED","USD","EUR"],i=["Rs","INR","₹"];function o(s){if(s==null||isNaN(s))return"0";const l=Number(s),c=Math.abs(l),u=l<0?"-":"";return c>=1e9?u+(c/1e9).toFixed(c%1e9===0?0:2)+"B":c>=1e6?u+(c/1e6).toFixed(c%1e6===0?0:2)+"M":c>=1e3?u+(c/1e3).toFixed(c%1e3===0?0:2)+"K":u+c.toFixed(c%1===0?0:2)}function a(s,l){return l?i.includes(l)?`${l} ${o(s)}`:r.includes(l)?`${o(s)} ${l}`:`${o(s)} ${l}`:o(s)}return b.jsx(Ha,{title:"Income",period:"This Month",icon:b.jsx(rv,{className:"!text-[24px] text-green-600"}),className:"!gap-[16px] break-inside-avoid h-[232px] overflow-hidden",actionButtons:b.jsx(ul,{widgetId:e?.widget_id,options:e?.communities}),children:b.jsxs("div",{children:[b.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mb-2",children:[b.jsx("div",{children:"Opening"}),b.jsx("div",{children:"Income"}),b.jsx("div",{children:"Collection"}),b.jsx("div",{children:"Closing"})]}),b.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212] mb-2",children:[b.jsx("div",{children:a(t.opening_balance,t?.currency_type)}),b.jsx("div",{children:a(t.income,t?.currency_type)}),b.jsx("div",{children:a(t.collection,t?.currency_type)}),b.jsx("div",{children:a(t.closing_balance,t?.currency_type)})]}),b.jsx("hr",{className:"my-4 border-t border-dashed border-gray-300"}),b.jsx("div",{className:"flex items-center justify-between",children:b.jsxs("div",{className:"flex items-center gap-[12px]",children:[b.jsx(rv,{className:"!text-[24px] text-red-600"}),b.jsx("div",{className:"!my-0 !font-medium !text-[16px] !leading-[20px] !text-[#121212]",children:"Expenditure"})]})}),b.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mt-4 mb-2",children:[b.jsx("div",{children:"Opening"}),b.jsx("div",{children:"Expenditure"}),b.jsx("div",{children:"Payment"}),b.jsx("div",{children:"Outstanding"})]}),b.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212]",children:[b.jsx("div",{children:a(n.opening_balance,n?.currency_type)}),b.jsx("div",{children:a(n.expenditure,n?.currency_type)}),b.jsx("div",{children:a(n.payment,n?.currency_type)}),b.jsx("div",{children:a(n.outstanding,n?.currency_type)})]})]})})}var gre="tippy-box",$N="tippy-content",vre="tippy-backdrop",BN="tippy-arrow",WN="tippy-svg-arrow",ua={passive:!0,capture:!0},zN=function(){return document.body};function yre(e,t){return{}.hasOwnProperty.call(e,t)}function Eg(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function ox(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function VN(e,t){return typeof e=="function"?e.apply(void 0,t):e}function qO(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function bre(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function xre(e){return e.split(/\s+/).filter(Boolean)}function fs(e){return[].concat(e)}function GO(e,t){e.indexOf(t)===-1&&e.push(t)}function wre(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function _re(e){return e.split("-")[0]}function Gf(e){return[].slice.call(e)}function XO(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function ac(){return document.createElement("div")}function Rc(e){return["Element","Fragment"].some(function(t){return ox(e,t)})}function Sre(e){return ox(e,"NodeList")}function Ere(e){return ox(e,"MouseEvent")}function Ore(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function Pre(e){return Rc(e)?[e]:Sre(e)?Gf(e):Array.isArray(e)?e:Gf(document.querySelectorAll(e))}function Og(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function QO(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function Cre(e){var t,n=fs(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function kre(e,t){var n=t.clientX,r=t.clientY;return e.every(function(i){var o=i.popperRect,a=i.popperState,s=i.props,l=s.interactiveBorder,c=_re(a.placement),u=a.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,f=c==="top"?u.bottom.y:0,p=c==="right"?u.left.x:0,m=c==="left"?u.right.x:0,h=o.top-r+d>l,g=r-o.bottom-f>l,y=o.left-n+p>l,S=n-o.right-m>l;return h||g||y||S})}function Pg(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function ZO(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var ei={isTouch:!1},JO=0;function Dre(){ei.isTouch||(ei.isTouch=!0,window.performance&&document.addEventListener("mousemove",HN))}function HN(){var e=performance.now();e-JO<20&&(ei.isTouch=!1,document.removeEventListener("mousemove",HN)),JO=e}function Tre(){var e=document.activeElement;if(Ore(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function Are(){document.addEventListener("touchstart",Dre,ua),window.addEventListener("blur",Tre)}var Mre=typeof window<"u"&&typeof document<"u",Nre=Mre?!!window.msCrypto:!1;function as(e){var t=e==="destroy"?"n already-":" ";return[e+"() was called on a"+t+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function eP(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function jre(e){return eP(`
239
+ `));const qt={...r,isRtl:W,arrow:i,disableInteractive:ee,placement:D,PopperComponentProp:A,touch:J.current},H=typeof T.popper=="function"?T.popper(qt):T.popper,le=P.useMemo(()=>{let be=[{name:"arrow",enabled:!!q,options:{element:q,padding:4}}];return R.popperOptions?.modifiers&&(be=be.concat(R.popperOptions.modifiers)),H?.popperOptions?.modifiers&&(be=be.concat(H.popperOptions.modifiers)),{...R.popperOptions,...H?.popperOptions,modifiers:be}},[q,R.popperOptions,H?.popperOptions]),G=ore(qt),ue=typeof T.transition=="function"?T.transition(qt):T.transition,fe={slots:{popper:s.Popper,transition:s.Transition??M,tooltip:s.Tooltip,arrow:s.Arrow,...O},slotProps:{arrow:T.arrow??l.arrow,popper:{...R,...H??l.popper},tooltip:T.tooltip??l.tooltip,transition:{...I,...ue??l.transition}}},[tt,pt]=Hn("popper",{elementType:are,externalForwardedProps:fe,ownerState:qt,className:oe(G.popper,R?.className)}),[hr,uo]=Hn("transition",{elementType:jc,externalForwardedProps:fe,ownerState:qt}),[mr,qo]=Hn("tooltip",{elementType:sre,className:G.tooltip,externalForwardedProps:fe,ownerState:qt}),[_i,Hr]=Hn("arrow",{elementType:lre,className:G.arrow,externalForwardedProps:fe,ownerState:qt,ref:re});return b.jsxs(P.Fragment,{children:[P.cloneElement($,ye),b.jsx(tt,{as:A??G0,placement:D,anchorEl:y?{getBoundingClientRect:()=>({top:jl.y,left:jl.x,right:jl.x,bottom:jl.y,width:0,height:0})}:B,popperRef:dn,open:B?j:!1,id:me,transition:!0,...fn,...pt,popperOptions:le,children:({TransitionProps:be})=>b.jsx(hr,{timeout:V.transitions.duration.shorter,...be,...uo,children:b.jsxs(mr,{...qo,children:[N,i?b.jsx(_i,{...Hr}):null]})})})]})});process.env.NODE_ENV!=="production"&&(FN.propTypes={arrow:v.bool,children:cl.isRequired,classes:v.object,className:v.string,components:v.shape({Arrow:v.elementType,Popper:v.elementType,Tooltip:v.elementType,Transition:v.elementType}),componentsProps:v.shape({arrow:v.object,popper:v.object,tooltip:v.object,transition:v.object}),describeChild:v.bool,disableFocusListener:v.bool,disableHoverListener:v.bool,disableInteractive:v.bool,disableTouchListener:v.bool,enterDelay:v.number,enterNextDelay:v.number,enterTouchDelay:v.number,followCursor:v.bool,id:v.string,leaveDelay:v.number,leaveTouchDelay:v.number,onClose:v.func,onOpen:v.func,open:v.bool,placement:v.oneOf(["auto-end","auto-start","auto","bottom-end","bottom-start","bottom","left-end","left-start","left","right-end","right-start","right","top-end","top-start","top"]),PopperComponent:v.elementType,PopperProps:v.object,slotProps:v.shape({arrow:v.oneOfType([v.func,v.object]),popper:v.oneOfType([v.func,v.object]),tooltip:v.oneOfType([v.func,v.object]),transition:v.oneOfType([v.func,v.object])}),slots:v.shape({arrow:v.elementType,popper:v.elementType,tooltip:v.elementType,transition:v.elementType}),sx:v.oneOfType([v.arrayOf(v.oneOfType([v.func,v.object,v.bool])),v.func,v.object]),title:v.node,TransitionComponent:v.elementType,TransitionProps:v.object});function cre(e){return Ze({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Box_List"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M6.562,8.062h-2a1.5,1.5,0,0,1-1.5-1.5v-2a1.5,1.5,0,0,1,1.5-1.5h2a1.5,1.5,0,0,1,1.5,1.5v2A1.5,1.5,0,0,1,6.562,8.062Zm-2-4a.5.5,0,0,0-.5.5v2a.5.5,0,0,0,.5.5h2a.5.5,0,0,0,.5-.5v-2a.5.5,0,0,0-.5-.5Z"},child:[]},{tag:"path",attr:{d:"M6.562,20.938h-2a1.5,1.5,0,0,1-1.5-1.5v-2a1.5,1.5,0,0,1,1.5-1.5h2a1.5,1.5,0,0,1,1.5,1.5v2A1.5,1.5,0,0,1,6.562,20.938Zm-2-4a.5.5,0,0,0-.5.5v2a.5.5,0,0,0,.5.5h2a.5.5,0,0,0,.5-.5v-2a.5.5,0,0,0-.5-.5Z"},child:[]},{tag:"path",attr:{d:"M6.562,14.5h-2a1.5,1.5,0,0,1-1.5-1.5V11a1.5,1.5,0,0,1,1.5-1.5h2a1.5,1.5,0,0,1,1.5,1.5v2A1.5,1.5,0,0,1,6.562,14.5Zm-2-4a.5.5,0,0,0-.5.5v2a.5.5,0,0,0,.5.5h2a.5.5,0,0,0,.5-.5V11a.5.5,0,0,0-.5-.5Z"},child:[]},{tag:"path",attr:{d:"M20.438,6.062h-9a.5.5,0,0,1,0-1h9a.5.5,0,0,1,0,1Z"},child:[]},{tag:"path",attr:{d:"M20.438,12.5h-9a.5.5,0,0,1,0-1h9a.5.5,0,0,1,0,1Z"},child:[]},{tag:"path",attr:{d:"M20.438,18.935h-9a.5.5,0,1,1,0-1h9a.5.5,0,0,1,0,1Z"},child:[]}]}]}]})(e)}function ure(e){return Ze({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Export"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M5.552,20.968a2.577,2.577,0,0,1-2.5-2.73c-.012-2.153,0-4.306,0-6.459a.5.5,0,0,1,1,0c0,2.2-.032,4.4,0,6.6.016,1.107.848,1.589,1.838,1.589H18.353A1.546,1.546,0,0,0,19.825,19a3.023,3.023,0,0,0,.1-1.061V11.779h0a.5.5,0,0,1,1,0c0,2.224.085,4.465,0,6.687a2.567,2.567,0,0,1-2.67,2.5Z"},child:[]},{tag:"path",attr:{d:"M12.337,3.176a.455.455,0,0,0-.311-.138c-.015,0-.028,0-.043-.006s-.027,0-.041.006a.457.457,0,0,0-.312.138L7.961,6.845a.5.5,0,0,0,.707.707l2.816-2.815V15.479a.5.5,0,0,0,1,0V4.737L15.3,7.552a.5.5,0,0,0,.707-.707Z"},child:[]}]}]}]})(e)}function dre(e){return Ze({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Warning"},child:[{tag:"g",attr:{},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M12.5,8.752a.5.5,0,0,0-1,0h0v6a.5.5,0,0,0,1,0Z"},child:[]},{tag:"circle",attr:{cx:"11.999",cy:"16.736",r:"0.5"},child:[]}]},{tag:"path",attr:{d:"M18.642,20.934H5.385A2.5,2.5,0,0,1,3.163,17.29L9.792,4.421a2.5,2.5,0,0,1,4.444,0L20.865,17.29a2.5,2.5,0,0,1-2.223,3.644ZM12.014,4.065a1.478,1.478,0,0,0-1.334.814L4.052,17.748a1.5,1.5,0,0,0,1.333,2.186H18.642a1.5,1.5,0,0,0,1.334-2.186L13.348,4.879A1.478,1.478,0,0,0,12.014,4.065Z"},child:[]}]}]}]})(e)}Vd(ix)(()=>({width:"fit-content",maxWidth:"100px",height:"28px",padding:"0 6px",display:"flex",fontSize:"12px",alignItems:"center","& .MuiSelect-select":{padding:0},"& .MuiOutlinedInput-notchedOutline":{borderColor:"#C6C6C6",transition:"all 0.2s ease"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#B084CC"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"#884EA7 !important",boxShadow:"0 0 0 3px rgba(136, 78, 167, 0.2)"}}));function ul({widgetId:e,options:t=[],defaultValue:n=["all"],onFilterChange:r=()=>{},onExport:i=()=>{}}){const o=JSON.parse(sessionStorage.getItem("community_id"))||[],[a,s]=k.useState(o),[l,c]=k.useState("");t.filter(d=>d.community_name.toLowerCase().includes(l.toLowerCase()));const u=()=>{bw("widget_id",e),bw("export",!0),i()};return b.jsx("div",{className:"flex items-center gap-2",children:b.jsx(FN,{title:"Export CSV for this widget",children:b.jsx("button",{onClick:u,className:"px-3 py-2 bg-[#FBF5FF] rounded cursor-pointer",children:b.jsx(ure,{className:"stroke-[#884EA7] stroke-[1.4]"})})})})}function fre({isStatic:e,data:t}){const n=Number(t?.thisMonthMoveIns??t?.lastMonthMoveIns??0),r=Number(t?.thisMonthMoveOuts??t?.lastMonthMoveOuts??0),i=Number(t?.moveInPercentChange??t?.moveInChange??0),o=Number(t?.moveOutPercentChange??t?.moveOutChange??0),a=["#8B5CF6","#EBE4F9"],s=[{name:"Move-ins",value:n,color:a[0]},{name:"Move-outs",value:r,color:a[1]}];function l(c,u){return((Number(c)+Number(u))/2).toFixed(2)+"%"}return b.jsx(Ha,{title:"Community",period:"This Month",icon:b.jsx(zy,{className:"!text-[24px] text-[#329DFF]"}),className:`${e&&"max-h-[184px]"} h-[184px] mb-4 break-inside-avoid gap-[20px]`,actionButtons:b.jsx(ul,{widgetId:t?.widget_id,options:t?.communities}),children:b.jsxs("div",{className:"flex",children:[b.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[b.jsxs("div",{className:"flex flex-col gap-[8px]",children:[b.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Move-in/Out Count"}),b.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium !text-[#8B5CF6]",children:n+r})]}),b.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] flex items-center gap-[4px]",children:[b.jsx(Yy,{value:l(i,o)}),b.jsx("div",{className:"whitespace-nowrap",children:"Compared to last month"})]})]}),b.jsx("div",{className:"w-[50%] h-[111px] flex justify-end",children:b.jsx(xi,{width:"75%",height:"100%",children:b.jsxs(bu,{children:[b.jsxs(il,{data:s,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:[b.jsx(Br,{fill:a[0]}),b.jsx(Br,{fill:a[1]})]}),b.jsx(bi,{content:b.jsx(Zc,{})})]})})})]})})}function pre({isStatic:e,data:t,communities:n}){const r=["#8B5CF6","#22C55E","#3B82F6","#F59E0B"],i=[{name:"Notice",value:Number(t?.total_notices||0),color:r[0]},{name:"Post",value:Number(t?.total_topics||0),color:r[1]},{name:"Poll",value:Number(t?.total_polls||0),color:r[2]},{name:"Survey",value:Number(t?.total_surveys||0),color:r[3]}],o=t?.widget==="commercial";return b.jsx(Ha,{title:"Engagement",period:"This Month",icon:b.jsx(nk,{className:"!text-[24px] text-[#DBB467]"}),className:`${e&&"max-h-[303px]"} ${o?"h-[324px]":"h-[303px]"} gap-[20px]`,actionButtons:!o&&b.jsx(ul,{widgetId:t?.widget_id,options:t?.communities}),children:b.jsx("div",{className:"w-full h-[235px]",children:b.jsx(xi,{width:"100%",height:"100%",children:b.jsxs(KM,{data:i,layout:"vertical",margin:{top:4,right:8,left:0,bottom:0},children:[b.jsx(ol,{stroke:"#e5e7eb",strokeDasharray:"3 3",horizontal:!1}),b.jsx($a,{type:"category",dataKey:"name",width:40,axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#121212",fontWeight:400}}),b.jsx(al,{type:"number",allowDecimals:!1,axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#64748B",fontWeight:400}}),b.jsx(bi,{content:b.jsx(Zc,{}),cursor:{fill:"transparent"}}),b.jsx(nc,{dataKey:"value",barSize:40,isAnimationActive:!1,children:i.map((a,s)=>b.jsx(Br,{fill:r[s]},a.name))})]})})})})}function hre({isStatic:e,data:t}){const n=Number(t?.totalBookings||0),r=Number(t?.averageUtilizationPercentage||0),i=k.useMemo(()=>{if(!t?.graph)return[];const{labels:s=[],bookings:l=[],utilization:c=[]}=t.graph;return s.map((u,d)=>({time:u,bookings:l[d]||0,utilization:c[d]||0}))},[t]),o=s=>["12 AM","6 AM","12 PM","6 PM","11 PM"].includes(s)?s:"",a=i.length?i:Array.from({length:24},(s,l)=>({time:`${l%12||12} ${l>=12?"PM":"AM"}`,bookings:0,utilization:0}));return b.jsxs(Ha,{title:"Facilities",period:"Today",icon:b.jsx(Mp,{className:"!text-[24px] text-[#8B5CF6]"}),className:`${e&&"max-h-[305px]"} h-[305px] mb-4 break-inside-avoid`,actionButtons:b.jsx(ul,{widgetId:t?.widget_id,options:t?.communities}),children:[b.jsxs("div",{className:"grid grid-cols-2 gap-[24px] mt-[16px] mb-[16px]",children:[b.jsxs("div",{children:[b.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Bookings"}),b.jsx("div",{className:"!text-[24px] font-medium text-[#8B5CF6]",children:n})]}),b.jsxs("div",{children:[b.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Utilisation Rate"}),b.jsxs("div",{className:"!text-[24px] font-medium text-[#329DFF]",children:[r.toFixed(2),"%"]})]})]}),b.jsx("div",{className:"w-full h-[170px]",children:b.jsx(xi,{width:"100%",height:"100%",children:b.jsxs(B0,{data:a,margin:{top:5,right:-30,left:-35,bottom:0},children:[b.jsx(ol,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),b.jsx(al,{dataKey:"time",interval:0,tickFormatter:o,tick:{fontSize:10,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1,minTickGap:0}),b.jsx($a,{yAxisId:"left",tick:{fontSize:10,fill:"#64748B"},axisLine:!1,tickLine:!1}),b.jsx($a,{yAxisId:"right",orientation:"right",domain:[0,100],ticks:[0,20,40,60,80,100],tickFormatter:s=>`${s}%`,tick:{fontSize:10,fill:"#64748B"},axisLine:!1,tickLine:!1}),b.jsx(bi,{content:b.jsx(Zc,{})}),b.jsx(Co,{yAxisId:"left",type:"monotone",dataKey:"bookings",name:"Bookings",stroke:"#8B5CF6",strokeWidth:2,dot:!1,isAnimationActive:!1}),b.jsx(Co,{yAxisId:"right",type:"monotone",dataKey:"utilization",name:"Utilization Rate",stroke:"#329DFF",strokeWidth:2,dot:!1,strokeDasharray:"2 4",isAnimationActive:!1})]})})})]})}function mre({data:e}){const t=e?.incomeSummary||{},n=e?.expenditureSummary||{},r=["AED","USD","EUR"],i=["Rs","INR","₹"];function o(s){if(s==null||isNaN(s))return"0";const l=Number(s),c=Math.abs(l),u=l<0?"-":"";return c>=1e9?u+(c/1e9).toFixed(c%1e9===0?0:2)+"B":c>=1e6?u+(c/1e6).toFixed(c%1e6===0?0:2)+"M":c>=1e3?u+(c/1e3).toFixed(c%1e3===0?0:2)+"K":u+c.toFixed(c%1===0?0:2)}function a(s,l){return l?i.includes(l)?`${l} ${o(s)}`:r.includes(l)?`${o(s)} ${l}`:`${o(s)} ${l}`:o(s)}return b.jsx(Ha,{title:"Income",period:"This Month",icon:b.jsx(rv,{className:"!text-[24px] text-green-600"}),className:"!gap-[16px] break-inside-avoid h-[232px] overflow-hidden",actionButtons:b.jsx(ul,{widgetId:e?.widget_id,options:e?.communities}),children:b.jsxs("div",{children:[b.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mb-2",children:[b.jsx("div",{children:"Opening"}),b.jsx("div",{children:"Income"}),b.jsx("div",{children:"Collection"}),b.jsx("div",{children:"Closing"})]}),b.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212] mb-2",children:[b.jsx("div",{children:a(t.opening_balance,t?.currency_type)}),b.jsx("div",{children:a(t.income,t?.currency_type)}),b.jsx("div",{children:a(t.collection,t?.currency_type)}),b.jsx("div",{children:a(t.closing_balance,t?.currency_type)})]}),b.jsx("hr",{className:"my-4 border-t border-dashed border-gray-300"}),b.jsx("div",{className:"flex items-center justify-between",children:b.jsxs("div",{className:"flex items-center gap-[12px]",children:[b.jsx(rv,{className:"!text-[24px] text-red-600"}),b.jsx("div",{className:"!my-0 !font-medium !text-[16px] !leading-[20px] !text-[#121212]",children:"Expenditure"})]})}),b.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mt-4 mb-2",children:[b.jsx("div",{children:"Opening"}),b.jsx("div",{children:"Expenditure"}),b.jsx("div",{children:"Payment"}),b.jsx("div",{children:"Outstanding"})]}),b.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212]",children:[b.jsx("div",{children:a(n.opening_balance,n?.currency_type)}),b.jsx("div",{children:a(n.expenditure,n?.currency_type)}),b.jsx("div",{children:a(n.payment,n?.currency_type)}),b.jsx("div",{children:a(n.outstanding,n?.currency_type)})]})]})})}var gre="tippy-box",$N="tippy-content",vre="tippy-backdrop",BN="tippy-arrow",WN="tippy-svg-arrow",ua={passive:!0,capture:!0},zN=function(){return document.body};function yre(e,t){return{}.hasOwnProperty.call(e,t)}function Eg(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function ox(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function VN(e,t){return typeof e=="function"?e.apply(void 0,t):e}function qO(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function bre(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function xre(e){return e.split(/\s+/).filter(Boolean)}function fs(e){return[].concat(e)}function GO(e,t){e.indexOf(t)===-1&&e.push(t)}function wre(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function _re(e){return e.split("-")[0]}function Gf(e){return[].slice.call(e)}function XO(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function ac(){return document.createElement("div")}function Rc(e){return["Element","Fragment"].some(function(t){return ox(e,t)})}function Sre(e){return ox(e,"NodeList")}function Ere(e){return ox(e,"MouseEvent")}function Ore(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function Pre(e){return Rc(e)?[e]:Sre(e)?Gf(e):Array.isArray(e)?e:Gf(document.querySelectorAll(e))}function Og(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function QO(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function Cre(e){var t,n=fs(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function kre(e,t){var n=t.clientX,r=t.clientY;return e.every(function(i){var o=i.popperRect,a=i.popperState,s=i.props,l=s.interactiveBorder,c=_re(a.placement),u=a.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,f=c==="top"?u.bottom.y:0,p=c==="right"?u.left.x:0,m=c==="left"?u.right.x:0,h=o.top-r+d>l,g=r-o.bottom-f>l,y=o.left-n+p>l,S=n-o.right-m>l;return h||g||y||S})}function Pg(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function ZO(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var ei={isTouch:!1},JO=0;function Dre(){ei.isTouch||(ei.isTouch=!0,window.performance&&document.addEventListener("mousemove",HN))}function HN(){var e=performance.now();e-JO<20&&(ei.isTouch=!1,document.removeEventListener("mousemove",HN)),JO=e}function Tre(){var e=document.activeElement;if(Ore(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function Are(){document.addEventListener("touchstart",Dre,ua),window.addEventListener("blur",Tre)}var Mre=typeof window<"u"&&typeof document<"u",Nre=Mre?!!window.msCrypto:!1;function as(e){var t=e==="destroy"?"n already-":" ";return[e+"() was called on a"+t+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function eP(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function jre(e){return eP(`
240
240
  %ctippy.js
241
241
 
242
242
  %c`+eP(e)+`
@@ -273,5 +273,5 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
273
273
  * Released under the MIT License
274
274
  */class Xoe{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=cj.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 Ci=new Xoe;const DP="transparent",Qoe={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=yP(e||DP),i=r.valid&&yP(t||DP);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class Zoe{constructor(t,n,r,i){const o=n[r];i=md([t.to,i,o,t.from]);const a=md([t.from,o,i]);this._active=!0,this._fn=t.fn||Qoe[t.type||typeof a],this._easing=cc[t.easing]||cc.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=md([t.to,n,i,t.from]),this._from=md([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 Sj{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Ae(t))return;const n=Object.keys(Nt.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];(Xt(o.properties)&&o.properties||[i]).forEach(s=>{(s===i||!r.has(s))&&r.set(s,a)})})}_animateOptions(t,n){const r=n.options,i=eae(t,r);if(!i)return[];const o=this._createAnimations(i,r);return r.$shared&&Joe(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 f=r.get(c);if(d)if(f&&d.active()){d.update(f,u,s);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}o[c]=d=new Zoe(f,t,c,u),i.push(d)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return Ci.add(this._chart,r),!0}}function Joe(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 eae(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 TP(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 tae(e,t,n){if(n===!1)return!1;const r=TP(e,n),i=TP(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function nae(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 Ej(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 AP(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],Ar(c)&&(o||t===0||di(t)===di(c))&&(t+=c)}return!u&&!r.all?0:t}function rae(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 Mg(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function iae(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function oae(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 aae(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function MP(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 NP(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=iae(o,a,r),d=t.length;let f;for(let p=0;p<d;++p){const m=t[p],{[l]:h,[c]:g}=m,y=m._stacks||(m._stacks={});f=y[c]=aae(i,u,h),f[s]=g,f._top=MP(f,a,!0,r.type),f._bottom=MP(f,a,!1,r.type);const S=f._visualValues||(f._visualValues={});S[s]=g}}function Ng(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function sae(e,t){return qa(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function lae(e,t,n){return qa(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Rl(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 jg=e=>e==="reset"||e==="none",jP=(e,t)=>t?e:Object.assign({},e),cae=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Ej(n,!0),values:null};class xh{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=Mg(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&&Rl(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(d,f,p,m)=>d==="x"?f:d==="r"?m:p,o=n.xAxisID=Se(r.xAxisID,Ng(t,"x")),a=n.yAxisID=Se(r.yAxisID,Ng(t,"y")),s=n.rAxisID=Se(r.rAxisID,Ng(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&&mP(this._data,this),t._stacked&&Rl(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Ae(n)){const i=this._cachedMeta;this._data=rae(n,i)}else if(r!==n){if(r){mP(r,this);const i=this._cachedMeta;Rl(i),i._parsed=[]}n&&Object.isExtensible(n)&&zie(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=Mg(n.vScale,n),n.stack!==r.stack&&(i=!0,Rl(n),n.stack=r.stack),this._resyncElements(t),(i||o!==n._stacked)&&(NP(this,n._parsed),n._stacked=Mg(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,f;if(this._parsing===!1)r._parsed=i,r._sorted=!0,f=i;else{Xt(i[t])?f=this.parseArrayData(r,i,t,n):Ae(i[t])?f=this.parseObjectData(r,i,t,n):f=this.parsePrimitiveData(r,i,t,n);const p=()=>d[s]===null||c&&d[s]<c[s];for(u=0;u<n;++u)r._parsed[u+t]=d=f[u],l&&(p()&&(l=!1),c=d);r._sorted=l}a&&NP(this,f)}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 f,p,m;for(f=0,p=i;f<p;++f)m=f+r,d[f]={[s]:u||o.parse(c[m],m),[l]:a.parse(n[m],m)};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,f,p;for(u=0,d=i;u<d;++u)f=u+r,p=n[f],c[u]={x:o.parse(Wa(p,s),f),y:a.parse(Wa(p,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const i=this.chart,o=this._cachedMeta,a=n[t.axis],s={keys:Ej(i,!0),values:n._stacks[t.axis]._visualValues};return AP(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=AP(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=cae(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=oae(s);let f,p;function m(){p=i[f];const h=p[s.axis];return!Ar(p[t.axis])||u>h||d<h}for(f=0;f<a&&!(!m()&&(this.updateRangeFromParsed(c,t,p,l),o));++f);if(o){for(f=a-1;f>=0;--f)if(!m()){this.updateRangeFromParsed(c,t,p,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],Ar(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=nae(Se(this.options.clip,tae(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=lae(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=sae(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&&$c(r);if(s)return jP(s,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=i?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),p=Object.keys(Nt.elements[t]),m=()=>this.getContext(r,i,n),h=c.resolveNamedOptions(f,p,m,d);return h.$shared&&(h.$shared=l,o[a]=Object.freeze(jP(h,l))),h}_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),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(t,r,n))}const c=new Sj(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||jg(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){jg(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!jg(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&&Rl(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 uae(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=lj(r.sort((i,o)=>i-o))}return e._cache.$bar}function dae(e){const t=e.iScale,n=uae(t,e.type);let r=t._length,i,o,a,s;const l=()=>{a===32767||a===-32768||($c(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 fae(e,t,n,r){const i=n.barThickness;let o,a;return He(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 pae(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 hae(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 Oj(e,t,n,r){return Xt(e)?hae(e,t,n,r):t[n.axis]=n.parse(e,r),t}function RP(e,t,n,r){const i=e.iScale,o=e.vScale,a=i.getLabels(),s=i===o,l=[];let c,u,d,f;for(c=n,u=n+r;c<u;++c)f=t[c],d={},d[i.axis]=s||i.parse(a[c],c),l.push(Oj(f,d,o,c));return l}function Rg(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function mae(e,t,n){return e!==0?di(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function gae(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 vae(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}=gae(e);i==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?i=c:(n._bottom||0)===r?i=u:(o[IP(u,a,s,l)]=!0,i=c)),o[IP(i,a,s,l)]=!0,e.borderSkipped=o}function IP(e,t,n,r){return r?(e=yae(e,t,n),e=LP(e,n,t)):e=LP(e,t,n),e}function yae(e,t,n){return e===t?n:e===n?t:e}function LP(e,t,n){return e==="start"?t:e==="end"?n:e}function bae(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class xae extends xh{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 RP(t,n,r,i)}parseArrayData(t,n,r,i){return RP(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 f,p,m,h;for(f=r,p=r+i;f<p;++f)h=n[f],m={},m[o.axis]=o.parse(Wa(h,c),f),d.push(Oj(Wa(h,u),m,a,f));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=Rg(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:f}=this._getSharedOptions(n,i);for(let p=n;p<n+r;p++){const m=this.getParsed(p),h=o||He(m[s.axis])?{base:l,head:l}:this._calculateBarValuePixels(p),g=this._calculateBarIndexPixels(p,u),y=(m._stacks||{})[s.axis],S={horizontal:c,base:h.base,enableBorderRadius:!y||Rg(m._custom)||a===y._top||a===y._bottom,x:c?h.head:g.center,y:c?g.center:h.head,height:c?g.size:Math.abs(h.size),width:c?Math.abs(h.size):g.size};f&&(S.options=d||this.resolveDataElementOptions(p,t[p].active?"active":i));const w=S.options||t[p].options;vae(S,w,y,a),bae(S,w,u.ratio),this.updateElement(t[p],p,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(p=>p[r.axis]===l),f=d&&d[u.vScale.axis];if(He(f)||isNaN(f))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[Se(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||dae(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=Rg(c);let d=l[n.axis],f=0,p=r?this.applyStack(n,l,r):d,m,h;p!==d&&(f=p-d,p=d),u&&(d=c.barStart,p=c.barEnd-c.barStart,d!==0&&di(d)!==di(c.barEnd)&&(f=0),f+=d);const g=!He(o)&&!u?o:f;let y=n.getPixelForValue(g);if(this.chart.getDataVisibility(t)?m=n.getPixelForValue(f+p):m=y,h=m-y,Math.abs(h)<a){h=mae(h,n,s)*a,d===s&&(y-=h/2);const S=n.getPixelForDecimal(0),w=n.getPixelForDecimal(1),x=Math.min(S,w),_=Math.max(S,w);y=Math.max(Math.min(y,_),x),m=y+h,r&&!u&&(l._stacks[n.axis]._visualValues[i]=n.getValueForPixel(m)-n.getValueForPixel(y))}if(y===n.getPixelForValue(s)){const S=di(h)*n.getLineWidthForValue(s)/2;y+=S,h-=S}return{size:h,base:y,head:m,center:m+h/2}}_calculateBarIndexPixels(t,n){const r=n.scale,i=this.options,o=i.skipNull,a=Se(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"?pae(t,n,i,u*c):fae(t,n,i,u*c),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,p=this._getAxis().indexOf(Se(f,this.getFirstScaleIdForIndexAxis())),m=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+p;s=d.start+d.chunk*m+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 wae(e,t,n){let r=1,i=1,o=0,a=0;if(t<Pt){const s=e,l=s+t,c=Math.cos(s),u=Math.sin(s),d=Math.cos(l),f=Math.sin(l),p=(w,x,_)=>Wc(w,s,l,!0)?1:Math.max(x,x*n,_,_*n),m=(w,x,_)=>Wc(w,s,l,!0)?-1:Math.min(x,x*n,_,_*n),h=p(0,c,d),g=p(Vt,u,f),y=m(rt,c,d),S=m(rt+Vt,u,f);r=(h-y)/2,i=(g-S)/2,o=-(h+y)/2,a=-(g+S)/2}return{ratioX:r,ratioY:i,offsetX:o,offsetY:a}}class _ae extends xh{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=>+Wa(r[c],l)}let a,s;for(a=t,s=t+n;a<s;++a)i._parsed[a]=o(a)}}_getRotation(){return Li(this.options.rotation-90)}_getCircumference(){return Li(this.options.circumference)}_getRotationExtents(){let t=Pt,n=-Pt;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(Oie(this.options.cutout,s),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:p,offsetX:m,offsetY:h}=wae(d,u,l),g=(r.width-a)/f,y=(r.height-a)/p,S=Math.max(Math.min(g,y)/2,0),w=rj(this.options.radius,S),x=Math.max(w*l,0),_=(w-x)/this._getVisibleDatasetWeightTotal();this.offsetX=m*w,this.offsetY=h*w,i.total=this.calculateTotal(),this.outerRadius=w-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*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/Pt)}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,f=o&&c.animateScale,p=f?0:this.innerRadius,m=f?0:this.outerRadius,{sharedOptions:h,includeOptions:g}=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 w=this._circumference(S,o),x=t[S],_={x:u+this.offsetX,y:d+this.offsetY,startAngle:y,endAngle:y+w,circumference:w,outerRadius:m,innerRadius:p};g&&(_.options=h||this.resolveDataElementOptions(S,x.active?"active":i)),y+=w,this.updateElement(x,S,_,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)?Pt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],o=fx(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(Se(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class Sae extends xh{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}=Yie(n,i,a);this._drawStart=s,this._drawCount=l,Uie(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),f=a.axis,p=s.axis,{spanGaps:m,segment:h}=this.options,g=Bc(m)?m:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||o||i==="none",S=n+r,w=t.length;let x=n>0&&this.getParsed(n-1);for(let _=0;_<w;++_){const E=t[_],C=y?E:{};if(_<n||_>=S){C.skip=!0;continue}const D=this.getParsed(_),A=He(D[p]),R=C[f]=a.getPixelForValue(D[f],_),T=C[p]=o||A?s.getBasePixel():s.getPixelForValue(l?this.applyStack(s,D,l):D[p],_);C.skip=isNaN(R)||isNaN(T)||A,C.stop=_>0&&Math.abs(D[f]-x[f])>g,h&&(C.parsed=D,C.raw=c.data[_]),d&&(C.options=u||this.resolveDataElementOptions(_,E.active?"active":i)),y||this.updateElement(E,_,C,i),x=D}}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 na(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class wx{static override(t){Object.assign(wx.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return na()}parse(){return na()}format(){return na()}add(){return na()}diff(){return na()}startOf(){return na()}endOf(){return na()}}var Eae={_date:wx};function Oae(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?Bie:wa;if(r){if(i._sharedOptions){const u=o[0],d=typeof u.getRange=="function"&&u.getRange(t);if(d){const f=c(o,t,n-d),p=c(o,t,n+d);return{lo:f.lo,hi:p.hi}}}}else{const u=c(o,t,n);if(l){const{vScale:d}=i._cachedMeta,{_parsed:f}=e,p=f.slice(0,u.lo+1).reverse().findIndex(h=>!He(h[d.axis]));u.lo-=Math.max(0,p);const m=f.slice(u.hi).findIndex(h=>!He(h[d.axis]));u.hi+=Math.max(0,m)}return u}}return{lo:0,hi:o.length-1}}function wh(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:f}=Oae(o[s],t,a,i);for(let p=d;p<=f;++p){const m=u[p];m.skip||r(m,c,p)}}}function Pae(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 Ig(e,t,n,r,i){const o=[];return!i&&!e.isPointInArea(t)||wh(e,n,t,function(s,l,c){!i&&!zc(s,e.chartArea,0)||s.inRange(t.x,t.y,r)&&o.push({element:s,datasetIndex:l,index:c})},!0),o}function Cae(e,t,n,r){let i=[];function o(a,s,l){const{startAngle:c,endAngle:u}=a.getProps(["startAngle","endAngle"],r),{angle:d}=aj(a,{x:t.x,y:t.y});Wc(d,c,u)&&i.push({element:a,datasetIndex:s,index:l})}return wh(e,n,t,o),i}function kae(e,t,n,r,i,o){let a=[];const s=Pae(n);let l=Number.POSITIVE_INFINITY;function c(u,d,f){const p=u.inRange(t.x,t.y,i);if(r&&!p)return;const m=u.getCenterPoint(i);if(!(!!o||e.isPointInArea(m))&&!p)return;const g=s(t,m);g<l?(a=[{element:u,datasetIndex:d,index:f}],l=g):g===l&&a.push({element:u,datasetIndex:d,index:f})}return wh(e,n,t,c),a}function Lg(e,t,n,r,i,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!r?Cae(e,t,n,i):kae(e,t,n,r,i,o)}function FP(e,t,n,r,i){const o=[],a=n==="x"?"inXRange":"inYRange";let s=!1;return wh(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 Dae={modes:{index(e,t,n,r){const i=da(t,e),o=n.axis||"x",a=n.includeInvisible||!1,s=n.intersect?Ig(e,i,o,r,a):Lg(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=da(t,e),o=n.axis||"xy",a=n.includeInvisible||!1;let s=n.intersect?Ig(e,i,o,r,a):Lg(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=da(t,e),o=n.axis||"xy",a=n.includeInvisible||!1;return Ig(e,i,o,r,a)},nearest(e,t,n,r){const i=da(t,e),o=n.axis||"xy",a=n.includeInvisible||!1;return Lg(e,i,o,n.intersect,r,a)},x(e,t,n,r){const i=da(t,e);return FP(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=da(t,e);return FP(e,i,"y",n.intersect,r)}}};const Pj=["left","top","right","bottom"];function Il(e,t){return e.filter(n=>n.pos===t)}function $P(e,t){return e.filter(n=>Pj.indexOf(n.pos)===-1&&n.box.axis===t)}function Ll(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 Tae(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 Aae(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:o}=n;if(!r||!Pj.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 Mae(e,t){const n=Aae(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 Nae(e){const t=Tae(e),n=Ll(t.filter(c=>c.box.fullSize),!0),r=Ll(Il(t,"left"),!0),i=Ll(Il(t,"right")),o=Ll(Il(t,"top"),!0),a=Ll(Il(t,"bottom")),s=$P(t,"x"),l=$P(t,"y");return{fullSize:n,leftAndTop:r.concat(o),rightAndBottom:i.concat(l).concat(a).concat(s),chartArea:Il(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:o.concat(a).concat(s)}}function BP(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function Cj(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 jae(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&&Cj(a,o.getPadding());const s=Math.max(0,t.outerWidth-BP(a,e,"left","right")),l=Math.max(0,t.outerHeight-BP(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 Rae(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 Iae(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 Ql(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,Iae(s.horizontal,t));const{same:d,other:f}=jae(t,n,s,r);c|=d&&i.length,u=u||f,l.fullSize||i.push(s)}return c&&Ql(i,t,n,r)||u}function bd(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 WP(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,f=c.size||l.height;$c(c.start)&&(a=c.start),l.fullSize?bd(l,i.left,a,n.outerWidth-i.right-i.left,f):bd(l,t.left+c.placed,a,d,f),c.start=a,c.placed+=d,a=l.bottom}else{const d=t.h*u,f=c.size||l.width;$c(c.start)&&(o=c.start),l.fullSize?bd(l,o,i.top,f,n.outerHeight-i.bottom-i.top):bd(l,o,t.top+c.placed,f,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=a}var wo={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=Wr(e.options.layout.padding),o=Math.max(t-i.width,0),a=Math.max(n-i.height,0),s=Nae(e.boxes),l=s.vertical,c=s.horizontal;Ge(e.boxes,h=>{typeof h.beforeLayout=="function"&&h.beforeLayout()});const u=l.reduce((h,g)=>g.box.options&&g.box.options.display===!1?h:h+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/u,hBoxMaxHeight:a/2}),f=Object.assign({},i);Cj(f,Wr(r));const p=Object.assign({maxPadding:f,w:o,h:a,x:i.left,y:i.top},i),m=Mae(l.concat(c),d);Ql(s.fullSize,p,d,m),Ql(l,p,d,m),Ql(c,p,d,m)&&Ql(l,p,d,m),Rae(p),WP(s.leftAndTop,p,d,m),p.x+=p.w,p.y+=p.h,WP(s.rightAndBottom,p,d,m),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},Ge(s.chartArea,h=>{const g=h.box;Object.assign(g,e.chartArea),g.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class kj{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 Lae extends kj{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const $d="$chartjs",Fae={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},zP=e=>e===null||e==="";function $ae(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[$d]={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",zP(i)){const o=OP(e,"width");o!==void 0&&(e.width=o)}if(zP(r))if(e.style.height==="")e.height=e.width/(t||2);else{const o=OP(e,"height");o!==void 0&&(e.height=o)}return e}const Dj=Roe?{passive:!0}:!1;function Bae(e,t,n){e&&e.addEventListener(t,n,Dj)}function Wae(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,Dj)}function zae(e,t){const n=Fae[e.type]||e.type,{x:r,y:i}=da(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function np(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function Vae(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let a=!1;for(const s of o)a=a||np(s.addedNodes,r),a=a&&!np(s.removedNodes,r);a&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function Hae(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let a=!1;for(const s of o)a=a||np(s.removedNodes,r),a=a&&!np(s.addedNodes,r);a&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const Vc=new Map;let VP=0;function Tj(){const e=window.devicePixelRatio;e!==VP&&(VP=e,Vc.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function Yae(e,t){Vc.size||window.addEventListener("resize",Tj),Vc.set(e,t)}function Uae(e){Vc.delete(e),Vc.size||window.removeEventListener("resize",Tj)}function Kae(e,t,n){const r=e.canvas,i=r&&xx(r);if(!i)return;const o=uj((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),Yae(e,o),a}function Fg(e,t,n){n&&n.disconnect(),t==="resize"&&Uae(e)}function qae(e,t,n){const r=e.canvas,i=uj(o=>{e.ctx!==null&&n(zae(o,e))},e);return Bae(r,t,i),i}class Gae extends kj{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?($ae(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[$d])return!1;const r=n[$d].initial;["height","width"].forEach(o=>{const a=r[o];He(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[$d],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),a={attach:Vae,detach:Hae,resize:Kae}[n]||qae;i[n]=a(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:Fg,detach:Fg,resize:Fg}[n]||Wae)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return joe(t,n,r,i)}isAttached(t){const n=t&&xx(t);return!!(n&&n.isConnected)}}function Xae(e){return!bx()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Lae:Gae}let Ko=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 Bc(this.x)&&Bc(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 Qae(e,t){const n=e.options.ticks,r=Zae(e),i=Math.min(n.maxTicksLimit||r,r),o=n.major.enabled?ese(t):[],a=o.length,s=o[0],l=o[a-1],c=[];if(a>i)return tse(t,c,o,a/i),c;const u=Jae(o,t,i);if(a>0){let d,f;const p=a>1?Math.round((l-s)/(a-1)):null;for(xd(t,c,u,He(p)?0:s-p,s),d=0,f=a-1;d<f;d++)xd(t,c,u,o[d],o[d+1]);return xd(t,c,u,l,He(p)?t.length:l+p),c}return xd(t,c,u),c}function Zae(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 Jae(e,t,n){const r=nse(e),i=t.length/n;if(!r)return Math.max(i,1);const o=Nie(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 ese(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function tse(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 xd(e,t,n,r,i){const o=Se(r,0),a=Math.min(Se(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 nse(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 rse=e=>e==="left"?"right":e==="right"?"left":e,HP=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,YP=(e,t)=>Math.min(t||e,e);function UP(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 ise(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 ose(e,t){Ge(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 Fl(e){return e.drawTicks?e.tickLength:0}function KP(e,t){if(!e.display)return 0;const n=Yn(e.font,t),r=Wr(e.padding);return(Xt(e.text)?e.text.length:1)*n.lineHeight+r.height}function ase(e,t){return qa(e,{scale:t,type:"scale"})}function sse(e,t,n){return qa(e,{tick:n,index:t,type:"tick"})}function lse(e,t,n){let r=dj(e);return(n&&t!=="right"||!n&&t==="right")&&(r=rse(r)),r}function cse(e,t,n,r){const{top:i,left:o,bottom:a,right:s,chart:l}=e,{chartArea:c,scales:u}=l;let d=0,f,p,m;const h=a-i,g=s-o;if(e.isHorizontal()){if(p=Jn(r,o,s),Ae(n)){const y=Object.keys(n)[0],S=n[y];m=u[y].getPixelForValue(S)+h-t}else n==="center"?m=(c.bottom+c.top)/2+h-t:m=HP(e,n,t);f=s-o}else{if(Ae(n)){const y=Object.keys(n)[0],S=n[y];p=u[y].getPixelForValue(S)-g+t}else n==="center"?p=(c.left+c.right)/2-g+t:p=HP(e,n,t);m=Jn(r,a,i),d=n==="left"?-Vt:Vt}return{titleX:p,titleY:m,maxWidth:f,rotation:d}}class dl extends Ko{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=Kr(t,Number.POSITIVE_INFINITY),n=Kr(n,Number.NEGATIVE_INFINITY),r=Kr(r,Number.POSITIVE_INFINITY),i=Kr(i,Number.NEGATIVE_INFINITY),{min:Kr(t,r),max:Kr(n,i),minDefined:Ar(t),maxDefined:Ar(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:Kr(n,Kr(r,n)),max:Kr(r,Kr(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(){ct(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=foe(this,o,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=s<this.ticks.length;this._convertTicksToLabels(l?UP(this.ticks,s):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=Qae(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(){ct(this.options.afterUpdate,[this])}beforeSetDimensions(){ct(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(){ct(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),ct(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){ct(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=ct(n.callback,[o.value,r,t],this)}afterTickToLabelConversion(){ct(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){ct(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=YP(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,f=u.highest.height,p=bn(this.chart.width-d,0,this.maxWidth);s=t.offset?this.maxWidth/r:p/(r-1),d+6>s&&(s=p/(r-(t.offset?.5:1)),l=this.maxHeight-Fl(t.grid)-n.padding-KP(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),a=Lie(Math.min(Math.asin(bn((u.highest.height+6)/s,-1,1)),Math.asin(bn(l/c,-1,1))-Math.asin(bn(f/c,-1,1)))),a=Math.max(i,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){ct(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ct(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=KP(i,n.options.font);if(s?(t.width=this.maxWidth,t.height=Fl(o)+l):(t.height=this.maxHeight,t.width=Fl(o)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),p=r.padding*2,m=Li(this.labelRotation),h=Math.cos(m),g=Math.sin(m);if(s){const y=r.mirror?0:g*d.width+h*f.height;t.height=Math.min(this.maxHeight,t.height+y+p)}else{const y=r.mirror?0:h*d.width+g*f.height;t.width=Math.min(this.maxWidth,t.width+y+p)}this._calculatePadding(c,u,g,h)}}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 f=0,p=0;l?c?(f=i*t.width,p=r*n.height):(f=r*t.height,p=i*n.width):o==="start"?p=n.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,p=n.width/2),this.paddingLeft=Math.max((f-u+a)*this.width/(this.width-u),0),this.paddingRight=Math.max((p-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(){ct(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++)He(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=UP(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/YP(n,r));let c=0,u=0,d,f,p,m,h,g,y,S,w,x,_;for(d=0;d<n;d+=l){if(m=t[d].label,h=this._resolveTickFontOptions(d),i.font=g=h.string,y=o[g]=o[g]||{data:{},gc:[]},S=h.lineHeight,w=x=0,!He(m)&&!Xt(m))w=xP(i,y.data,y.gc,w,m),x=S;else if(Xt(m))for(f=0,p=m.length;f<p;++f)_=m[f],!He(_)&&!Xt(_)&&(w=xP(i,y.data,y.gc,w,_),x+=S);a.push(w),s.push(x),c=Math.max(w,c),u=Math.max(x,u)}ose(o,n);const E=a.indexOf(c),C=s.indexOf(u),D=A=>({width:a[A]||0,height:s[A]||0});return{first:D(0),last:D(n-1),widest:D(E),highest:D(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 $ie(this._alignToPixels?ta(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=sse(this.getContext(),t,r))}return this.$context||(this.$context=ase(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Li(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),f=Fl(o),p=[],m=s.setContext(this.getContext()),h=m.display?m.width:0,g=h/2,y=function(L){return ta(r,L,h)};let S,w,x,_,E,C,D,A,R,T,O,N;if(a==="top")S=y(this.bottom),C=this.bottom-f,A=S-g,T=y(t.top)+g,N=t.bottom;else if(a==="bottom")S=y(this.top),T=t.top,N=y(t.bottom)-g,C=S+g,A=this.top+f;else if(a==="left")S=y(this.right),E=this.right-f,D=S-g,R=y(t.left)+g,O=t.right;else if(a==="right")S=y(this.left),R=t.left,O=y(t.right)-g,E=S+g,D=this.left+f;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],$=a[L];S=y(this.chart.scales[L].getPixelForValue($))}T=t.top,N=t.bottom,C=S+g,A=C+f}else if(n==="y"){if(a==="center")S=y((t.left+t.right)/2);else if(Ae(a)){const L=Object.keys(a)[0],$=a[L];S=y(this.chart.scales[L].getPixelForValue($))}E=S-g,D=E-f,R=t.left,O=t.right}const M=Se(i.ticks.maxTicksLimit,d),I=Math.max(1,Math.ceil(d/M));for(w=0;w<d;w+=I){const L=this.getContext(w),$=o.setContext(L),V=s.setContext(L),W=$.lineWidth,B=$.color,X=V.dash||[],q=V.dashOffset,re=$.tickWidth,J=$.tickColor,ee=$.tickBorderDash||[],ie=$.tickBorderDashOffset;x=ise(this,w,l),x!==void 0&&(_=ta(r,x,W),c?E=D=R=O=_:C=A=T=N=_,p.push({tx1:E,ty1:C,tx2:D,ty2:A,x1:R,y1:T,x2:O,y2:N,width:W,color:B,borderDash:X,borderDashOffset:q,tickWidth:re,tickColor:J,tickBorderDash:ee,tickBorderDashOffset:ie}))}return this._ticksLength=d,this._borderValue=S,p}_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,f=Fl(r.grid),p=f+u,m=d?-u:p,h=-Li(this.labelRotation),g=[];let y,S,w,x,_,E,C,D,A,R,T,O,N="middle";if(i==="top")E=this.bottom-m,C=this._getXAxisLabelAlignment();else if(i==="bottom")E=this.top+m,C=this._getXAxisLabelAlignment();else if(i==="left"){const I=this._getYAxisLabelAlignment(f);C=I.textAlign,_=I.x}else if(i==="right"){const I=this._getYAxisLabelAlignment(f);C=I.textAlign,_=I.x}else if(n==="x"){if(i==="center")E=(t.top+t.bottom)/2+p;else if(Ae(i)){const I=Object.keys(i)[0],L=i[I];E=this.chart.scales[I].getPixelForValue(L)+p}C=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")_=(t.left+t.right)/2-p;else if(Ae(i)){const I=Object.keys(i)[0],L=i[I];_=this.chart.scales[I].getPixelForValue(L)}C=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?N="top":l==="end"&&(N="bottom"));const M=this._getLabelSizes();for(y=0,S=s.length;y<S;++y){w=s[y],x=w.label;const I=o.setContext(this.getContext(y));D=this.getPixelForTick(y)+o.labelOffset,A=this._resolveTickFontOptions(y),R=A.lineHeight,T=Xt(x)?x.length:1;const L=T/2,$=I.color,V=I.textStrokeColor,W=I.textStrokeWidth;let B=C;a?(_=D,C==="inner"&&(y===S-1?B=this.options.reverse?"left":"right":y===0?B=this.options.reverse?"right":"left":B="center"),i==="top"?c==="near"||h!==0?O=-T*R+R/2:c==="center"?O=-M.highest.height/2-L*R+R:O=-M.highest.height+R/2:c==="near"||h!==0?O=R/2:c==="center"?O=M.highest.height/2-L*R:O=M.highest.height-T*R,d&&(O*=-1),h!==0&&!I.showLabelBackdrop&&(_+=R/2*Math.sin(h))):(E=D,O=(1-T)*R/2);let X;if(I.showLabelBackdrop){const q=Wr(I.backdropPadding),re=M.heights[y],J=M.widths[y];let ee=O-q.top,ie=0-q.left;switch(N){case"middle":ee-=re/2;break;case"bottom":ee-=re;break}switch(C){case"center":ie-=J/2;break;case"right":ie-=J;break;case"inner":y===S-1?ie-=J:y>0&&(ie-=J/2);break}X={left:ie,top:ee,width:J+q.width,height:re+q.height,color:I.backdropColor}}g.push({label:x,font:A,textOffset:O,options:{rotation:h,color:$,strokeColor:V,strokeWidth:W,textAlign:B,textBaseline:N,translation:[_,E],backdrop:X}})}return g}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Li(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,f;this.isHorizontal()?(c=ta(t,this.left,a)-a/2,u=ta(t,this.right,s)+s/2,d=f=l):(d=ta(t,this.top,a)-a/2,f=ta(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,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&px(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;Jf(r,c,0,u,l,s)}i&&hx(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const o=Yn(r.font),a=Wr(r.padding),s=r.align;let l=o.lineHeight/2;n==="bottom"||n==="center"||Ae(n)?(l+=a.bottom,Xt(r.text)&&(l+=o.lineHeight*(r.text.length-1))):l+=a.top;const{titleX:c,titleY:u,maxWidth:d,rotation:f}=cse(this,l,n,s);Jf(t,r.text,0,0,o,{color:r.color,maxWidth:d,rotation:f,textAlign:lse(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=Se(t.grid&&t.grid.z,-1),i=Se(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==dl.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 Yn(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class wd{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;fse(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,use(t,a,r),this.override&&Nt.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 Nt[i]&&(delete Nt[i][r],this.override&&delete za[r])}}function use(e,t,n){const r=Fc(Object.create(null),[n?Nt.get(n):{},Nt.get(t),e.defaults]);Nt.set(t,r),e.defaultRoutes&&dse(t,e.defaultRoutes),e.descriptors&&Nt.describe(t,e.descriptors)}function dse(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(".");Nt.route(o,i,l,s)})}function fse(e){return"id"in e&&"defaults"in e}class pse{constructor(){this.controllers=new wd(xh,"datasets",!0),this.elements=new wd(Ko,"elements"),this.plugins=new wd(Object,"plugins"),this.scales=new wd(dl,"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):Ge(i,a=>{const s=r||this._getRegistryForType(a);this._exec(t,s,a)})})}_exec(t,n,r){const i=cx(t);ct(r["before"+i],[],r),n[t](r),ct(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 Gr=new pse;class hse{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(ct(s,l,a)===!1&&i.cancelable)return!1}return!0}invalidate(){He(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=Se(r.options&&r.options.plugins,{}),o=mse(r);return i===!1&&!n?[]:vse(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 mse(e){const t={},n=[],r=Object.keys(Gr.plugins.items);for(let o=0;o<r.length;o++)n.push(Gr.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 gse(e,t){return!t&&e===!1?null:e===!0?{}:e}function vse(e,{plugins:t,localIds:n},r,i){const o=[],a=e.getContext();for(const s of t){const l=s.id,c=gse(r[l],i);c!==null&&o.push({plugin:s,options:yse(e.config,{plugin:s,local:n[l]},c,a)})}return o}function yse(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 uy(e,t){const n=Nt.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function bse(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function xse(e,t){return e===t?"_index_":"_value_"}function qP(e){if(e==="x"||e==="y"||e==="r")return e}function wse(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function dy(e,...t){if(qP(e))return e;for(const n of t){const r=n.axis||wse(n.position)||e.length>1&&qP(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function GP(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function _se(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 GP(e,"x",n[0])||GP(e,"y",n[0])}return{}}function Sse(e,t){const n=za[e.type]||{scales:{}},r=t.scales||{},i=uy(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=dy(a,s,_se(a,e),Nt.scales[s.type]),c=xse(l,i),u=n.scales||{};o[a]=sc(Object.create(null),[{axis:l},s,u[l],u[c]])}),e.data.datasets.forEach(a=>{const s=a.type||e.type,l=a.indexAxis||uy(s,t),u=(za[s]||{}).scales||{};Object.keys(u).forEach(d=>{const f=bse(d,l),p=a[f+"AxisID"]||f;o[p]=o[p]||Object.create(null),sc(o[p],[{axis:f},r[p],u[d]])})}),Object.keys(o).forEach(a=>{const s=o[a];sc(s,[Nt.scales[s.type],Nt.scale])}),o}function Aj(e){const t=e.options||(e.options={});t.plugins=Se(t.plugins,{}),t.scales=Sse(e,t)}function Mj(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Ese(e){return e=e||{},e.data=Mj(e.data),Aj(e),e}const XP=new Map,Nj=new Set;function _d(e,t){let n=XP.get(e);return n||(n=t(),XP.set(e,n),Nj.add(n)),n}const $l=(e,t,n)=>{const r=Wa(t,n);r!==void 0&&e.add(r)};class Ose{constructor(t){this._config=Ese(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=Mj(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(),Aj(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return _d(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return _d(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return _d(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return _d(`${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=>$l(l,t,d))),u.forEach(d=>$l(l,i,d)),u.forEach(d=>$l(l,za[o]||{},d)),u.forEach(d=>$l(l,Nt,d)),u.forEach(d=>$l(l,ly,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Nj.has(n)&&a.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,za[n]||{},Nt.datasets[n]||{},{type:n},Nt,ly]}resolveNamedOptions(t,n,r,i=[""]){const o={$shared:!0},{resolver:a,subPrefixes:s}=QP(this._resolverCache,t,i);let l=a;if(Cse(a,n)){o.$shared=!1,r=Fo(r)?r():r;const c=this.createResolver(t,r,s);l=Hs(a,r,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,r=[""],i){const{resolver:o}=QP(this._resolverCache,t,r);return Ae(n)?Hs(o,n,void 0,i):o}}function QP(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:gx(t,n),subPrefixes:n.filter(s=>!s.toLowerCase().includes("hover"))},r.set(i,o)),o}const Pse=e=>Ae(e)&&Object.getOwnPropertyNames(e).some(t=>Fo(e[t]));function Cse(e,t){const{isScriptable:n,isIndexable:r}=mj(e);for(const i of t){const o=n(i),a=r(i),s=(a||o)&&e[i];if(o&&(Fo(s)||Pse(s))||a&&Xt(s))return!0}return!1}var kse="4.5.0";const Dse=["top","bottom","left","right","chartArea"];function ZP(e,t){return e==="top"||e==="bottom"||Dse.indexOf(e)===-1&&t==="x"}function JP(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function e2(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),ct(n&&n.onComplete,[e],t)}function Tse(e){const t=e.chart,n=t.options.animation;ct(n&&n.onProgress,[e],t)}function jj(e){return bx()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Bd={},t2=e=>{const t=jj(e);return Object.values(Bd).filter(n=>n.canvas===t).pop()};function Ase(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 Mse(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}let Mn=class{static defaults=Nt;static instances=Bd;static overrides=za;static registry=Gr;static version=kse;static getChart=t2;static register(...t){Gr.add(...t),n2()}static unregister(...t){Gr.remove(...t),n2()}constructor(t,n){const r=this.config=new Ose(n),i=jj(t),o=t2(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||Xae(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=Eie(),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 hse,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Vie(d=>this.update(d),a.resizeDelay||0),this._dataChanges=[],Bd[this.id]=this,!s||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Ci.listen(this,"complete",e2),Ci.listen(this,"progress",Tse),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:o}=this;return He(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 Gr}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():EP(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return wP(this.canvas,this.ctx),this}stop(){return Ci.stop(this),this}resize(t,n){Ci.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,EP(this,s,!0)&&(this.notifyPlugins("resize",{size:a}),ct(r.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Ge(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=dy(a,s),c=l==="r",u=l==="x";return{options:s,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Ge(o,a=>{const s=a.options,l=s.id,c=dy(l,s),u=Se(s.type,a.dtype);(s.position===void 0||ZP(s.position,c)!==ZP(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 f=Gr.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(s,t)}),Ge(i,(a,s)=>{a||delete r[s]}),Ge(r,a=>{wo.configure(this,a,a.options),wo.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(JP("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||uy(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=Gr.getController(s),{datasetElementType:c,dataElementType:u}=Nt.datasets[s];Object.assign(l,{dataElementType:Gr.getElement(u),datasetElementType:c&&Gr.getElement(c)}),a.controller=new l(this,r),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){Ge(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),f=!i&&o.indexOf(d)===-1;d.buildOrUpdateElements(f),a=Math.max(+d.getMaxOverflow(),a)}a=this._minPadding=r.layout.autoPadding?a:0,this._updateLayout(a),i||Ge(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(JP("z","_idx"));const{_active:s,_lastEvent:l}=this;l?this._eventHandler(l,!0):s.length&&this._updateHoverStyles(s,s,!0),this.render()}_updateScales(){Ge(this.scales,t=>{wo.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!dP(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;Ase(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(!dP(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;wo.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Ge(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,Fo(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&&(Ci.has(this)?this.attached&&!Ci.running(this)&&Ci.start(this):(this.draw(),e2({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=Goe(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(i&&px(n,i),t.controller.draw(),i&&hx(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return zc(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const o=Dae.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=qa(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);$c(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(),Ci.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(),wP(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Bd[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)};Ge(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(){Ge(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Ge(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}});!Xf(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=Tie(t),c=Mse(t,this._lastEvent,r,l);r&&(this._lastEvent=null,ct(o.onHover,[t,s,this],this),l&&ct(o.onClick,[t,s,this],this));const u=!Xf(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 n2(){return Ge(Mn.instances,e=>e._plugins.invalidate())}function Nse(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,Rr(r-n));if(e.beginPath(),e.arc(i,o,a-c/2,r+d/2,n-d/2),s>0){const f=Math.min(c/s,Rr(r-n));e.arc(i,o,s+c/2,n-f/2,r+f/2,!0)}else{const f=Math.min(c/2,a*Rr(r-n));if(u==="round")e.arc(i,o,f,n-rt/2,r+rt/2,!0);else if(u==="bevel"){const p=2*f*f,m=-p*Math.cos(n+rt/2)+i,h=-p*Math.sin(n+rt/2)+o,g=p*Math.cos(r+rt/2)+i,y=p*Math.sin(r+rt/2)+o;e.lineTo(m,h),e.lineTo(g,y)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function jse(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+Vt,r-Vt),e.closePath(),e.clip()}function Rse(e){return mx(e,["outerStart","outerEnd","innerStart","innerEnd"])}function Ise(e,t,n,r){const i=Rse(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 bn(l,0,Math.min(o,c))};return{outerStart:s(i.outerStart),outerEnd:s(i.outerEnd),innerStart:bn(i.innerStart,0,a),innerEnd:bn(i.innerEnd,0,a)}}function cs(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function rp(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),f=u>0?u+r+n+c:0;let p=0;const m=i-l;if(r){const I=u>0?u-r:0,L=d>0?d-r:0,$=(I+L)/2,V=$!==0?m*$/($+r):m;p=(m-V)/2}const h=Math.max(.001,m*d-n/rt)/d,g=(m-h)/2,y=l+g+p,S=i-g-p,{outerStart:w,outerEnd:x,innerStart:_,innerEnd:E}=Ise(t,f,d,S-y),C=d-w,D=d-x,A=y+w/C,R=S-x/D,T=f+_,O=f+E,N=y+_/T,M=S-E/O;if(e.beginPath(),o){const I=(A+R)/2;if(e.arc(a,s,d,A,I),e.arc(a,s,d,I,R),x>0){const W=cs(D,R,a,s);e.arc(W.x,W.y,x,R,S+Vt)}const L=cs(O,S,a,s);if(e.lineTo(L.x,L.y),E>0){const W=cs(O,M,a,s);e.arc(W.x,W.y,E,S+Vt,M+Math.PI)}const $=(S-E/f+(y+_/f))/2;if(e.arc(a,s,f,S-E/f,$,!0),e.arc(a,s,f,$,y+_/f,!0),_>0){const W=cs(T,N,a,s);e.arc(W.x,W.y,_,N+Math.PI,y-Vt)}const V=cs(C,y,a,s);if(e.lineTo(V.x,V.y),w>0){const W=cs(C,A,a,s);e.arc(W.x,W.y,w,y-Vt,A)}}else{e.moveTo(a,s);const I=Math.cos(A)*d+a,L=Math.sin(A)*d+s;e.lineTo(I,L);const $=Math.cos(R)*d+a,V=Math.sin(R)*d+s;e.lineTo($,V)}e.closePath()}function Lse(e,t,n,r,i){const{fullCircles:o,startAngle:a,circumference:s}=t;let l=t.endAngle;if(o){rp(e,t,n,r,l,i);for(let c=0;c<o;++c)e.fill();isNaN(s)||(l=a+(s%Pt||Pt))}return rp(e,t,n,r,l,i),e.fill(),l}function Fse(e,t,n,r,i){const{fullCircles:o,startAngle:a,circumference:s,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:f,borderRadius:p}=l,m=l.borderAlign==="inner";if(!c)return;e.setLineDash(d||[]),e.lineDashOffset=f,m?(e.lineWidth=c*2,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let h=t.endAngle;if(o){rp(e,t,n,r,h,i);for(let g=0;g<o;++g)e.stroke();isNaN(s)||(h=a+(s%Pt||Pt))}m&&jse(e,t,h),l.selfJoin&&h-a>=rt&&p===0&&u!=="miter"&&Nse(e,t,h),o||(rp(e,t,n,r,h,i),e.stroke())}class _x extends Ko{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}=aj(i,{x:t,y:n}),{startAngle:s,endAngle:l,innerRadius:c,outerRadius:u,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],r),f=(this.options.spacing+this.options.borderWidth)/2,p=Se(d,l-s),m=Wc(o,s,l)&&s!==l,h=p>=Pt||m,g=xo(a,c+f,u+f);return h&&g}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>Pt?Math.floor(r/Pt):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(rt,r||0)),c=i*l;t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,Lse(t,this,c,o,a),Fse(t,this,c,o,a),t.restore()}}function Rj(e,t,n=t){e.lineCap=Se(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Se(n.borderDash,t.borderDash)),e.lineDashOffset=Se(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Se(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Se(n.borderWidth,t.borderWidth),e.strokeStyle=Se(n.borderColor,t.borderColor)}function $se(e,t,n){e.lineTo(n.x,n.y)}function Bse(e){return e.stepped?roe:e.tension||e.cubicInterpolationMode==="monotone"?ioe:$se}function Ij(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 Wse(e,t,n,r){const{points:i,options:o}=t,{count:a,start:s,loop:l,ilen:c}=Ij(i,n,r),u=Bse(o);let{move:d=!0,reverse:f}=r||{},p,m,h;for(p=0;p<=c;++p)m=i[(s+(f?c-p:p))%a],!m.skip&&(d?(e.moveTo(m.x,m.y),d=!1):u(e,h,m,f,o.stepped),h=m);return l&&(m=i[(s+(f?c:0))%a],u(e,h,m,f,o.stepped)),!!l}function zse(e,t,n,r){const i=t.points,{count:o,start:a,ilen:s}=Ij(i,n,r),{move:l=!0,reverse:c}=r||{};let u=0,d=0,f,p,m,h,g,y;const S=x=>(a+(c?s-x:x))%o,w=()=>{h!==g&&(e.lineTo(u,g),e.lineTo(u,h),e.lineTo(u,y))};for(l&&(p=i[S(0)],e.moveTo(p.x,p.y)),f=0;f<=s;++f){if(p=i[S(f)],p.skip)continue;const x=p.x,_=p.y,E=x|0;E===m?(_<h?h=_:_>g&&(g=_),u=(d*u+x)/++d):(w(),e.lineTo(x,_),m=E,d=0,h=g=_),y=_}w()}function fy(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?zse:Wse}function Vse(e){return e.stepped?Ioe:e.tension||e.cubicInterpolationMode==="monotone"?Loe:fa}function Hse(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),Rj(e,t.options),e.stroke(i)}function Yse(e,t,n,r){const{segments:i,options:o}=t,a=fy(t);for(const s of i)Rj(e,o,s.style),e.beginPath(),a(e,t,s,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const Use=typeof Path2D=="function";function Kse(e,t,n,r){Use&&!t.options.segment?Hse(e,t,n,r):Yse(e,t,n,r)}class Sx extends Ko{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;koe(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=Yoe(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=zoe(this,{property:n,start:i,end:i});if(!a.length)return;const s=[],l=Vse(r);let c,u;for(c=0,u=a.length;c<u;++c){const{start:d,end:f}=a[c],p=o[d],m=o[f];if(p===m){s.push(p);continue}const h=Math.abs((i-p[n])/(m[n]-p[n])),g=l(p,m,h,r.stepped);g[n]=t[n],s.push(g)}return s.length===1?s[0]:s}pathSegment(t,n,r){return fy(this)(t,this,n,r)}path(t,n,r){const i=this.segments,o=fy(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(),Kse(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function r2(e,t,n,r){const i=e.options,{[n]:o}=e.getProps([n],r);return Math.abs(t-o)<i.radius+i.hitRadius}class Ex extends Ko{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 r2(this,t,"x",n)}inYRange(t,n){return r2(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||!zc(this,n,this.size(r)/2)||(t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.fillStyle=r.backgroundColor,cy(t,r,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function Lj(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 _o(e,t,n,r){return e?0:bn(t,n,r)}function qse(e,t,n){const r=e.options.borderWidth,i=e.borderSkipped,o=hj(r);return{t:_o(i.top,o.top,0,n),r:_o(i.right,o.right,0,t),b:_o(i.bottom,o.bottom,0,n),l:_o(i.left,o.left,0,t)}}function Gse(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),i=e.options.borderRadius,o=xs(i),a=Math.min(t,n),s=e.borderSkipped,l=r||Ae(i);return{topLeft:_o(!l||s.top||s.left,o.topLeft,0,a),topRight:_o(!l||s.top||s.right,o.topRight,0,a),bottomLeft:_o(!l||s.bottom||s.left,o.bottomLeft,0,a),bottomRight:_o(!l||s.bottom||s.right,o.bottomRight,0,a)}}function Xse(e){const t=Lj(e),n=t.right-t.left,r=t.bottom-t.top,i=qse(e,n/2,r/2),o=Gse(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 $g(e,t,n,r){const i=t===null,o=n===null,s=e&&!(i&&o)&&Lj(e,r);return s&&(i||xo(t,s.left,s.right))&&(o||xo(n,s.top,s.bottom))}function Qse(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function Zse(e,t){e.rect(t.x,t.y,t.w,t.h)}function Bg(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 fl extends Ko{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}=Xse(this),s=Qse(a.radius)?ep:Zse;t.save(),(a.w!==o.w||a.h!==o.h)&&(t.beginPath(),s(t,Bg(a,n,o)),t.clip(),s(t,Bg(o,-n,a)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),s(t,Bg(o,n)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,n,r){return $g(this,t,n,r)}inXRange(t,n){return $g(this,t,null,n)}inYRange(t,n){return $g(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 i2=(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)}},Jse=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class o2 extends Ko{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=ct(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=Yn(r.font),o=i.size,a=this._computeTitleHeight(),{boxWidth:s,itemHeight:l}=i2(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 f=-1,p=-u;return this.legendItems.forEach((m,h)=>{const g=r+n/2+o.measureText(m.text).width;(h===0||c[c.length-1]+g+2*s>a)&&(d+=u,c[c.length-(h>0?0:1)]=0,p+=u,f++),l[h]={left:0,top:p,row:f,width:g,height:i},c[c.length-1]+=g+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,f=0,p=0,m=0,h=0;return this.legendItems.forEach((g,y)=>{const{itemWidth:S,itemHeight:w}=ele(r,n,o,g,i);y>0&&p+w+2*s>u&&(d+=f+s,c.push({width:f,height:p}),m+=f+s,h++,f=p=0),l[y]={left:m,top:p,col:h,width:S,height:w},f=Math.max(f,S),p+=w+s}),d+=f,c.push({width:f,height:p}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:o}}=this,a=ws(o,this.left,this.width);if(this.isHorizontal()){let s=0,l=Jn(r,this.left+i,this.right-this.lineWidths[s]);for(const c of n)s!==c.row&&(s=c.row,l=Jn(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=Jn(r,this.top+t+i,this.bottom-this.columnSizes[s].height);for(const c of n)c.col!==s&&(s=c.col,l=Jn(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;px(t,this),this._draw(),hx(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:o,labels:a}=t,s=Nt.color,l=ws(t.rtl,this.left,this.width),c=Yn(a.font),{padding:u}=a,d=c.size,f=d/2;let p;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;const{boxWidth:m,boxHeight:h,itemHeight:g}=i2(a,d),y=function(E,C,D){if(isNaN(m)||m<=0||isNaN(h)||h<0)return;i.save();const A=Se(D.lineWidth,1);if(i.fillStyle=Se(D.fillStyle,s),i.lineCap=Se(D.lineCap,"butt"),i.lineDashOffset=Se(D.lineDashOffset,0),i.lineJoin=Se(D.lineJoin,"miter"),i.lineWidth=A,i.strokeStyle=Se(D.strokeStyle,s),i.setLineDash(Se(D.lineDash,[])),a.usePointStyle){const R={radius:h*Math.SQRT2/2,pointStyle:D.pointStyle,rotation:D.rotation,borderWidth:A},T=l.xPlus(E,m/2),O=C+f;pj(i,R,T,O,a.pointStyleWidth&&m)}else{const R=C+Math.max((d-h)/2,0),T=l.leftForLtr(E,m),O=xs(D.borderRadius);i.beginPath(),Object.values(O).some(N=>N!==0)?ep(i,{x:T,y:R,w:m,h,radius:O}):i.rect(T,R,m,h),i.fill(),A!==0&&i.stroke()}i.restore()},S=function(E,C,D){Jf(i,D.text,E,C+g/2,c,{strikethrough:D.hidden,textAlign:l.textAlign(D.textAlign)})},w=this.isHorizontal(),x=this._computeTitleHeight();w?p={x:Jn(o,this.left+u,this.right-r[0]),y:this.top+u+x,line:0}:p={x:this.left+u,y:Jn(o,this.top+x+u,this.bottom-n[0].height),line:0},xj(this.ctx,t.textDirection);const _=g+u;this.legendItems.forEach((E,C)=>{i.strokeStyle=E.fontColor,i.fillStyle=E.fontColor;const D=i.measureText(E.text).width,A=l.textAlign(E.textAlign||(E.textAlign=a.textAlign)),R=m+f+D;let T=p.x,O=p.y;l.setWidth(this.width),w?C>0&&T+R+u>this.right&&(O=p.y+=_,p.line++,T=p.x=Jn(o,this.left+u,this.right-r[p.line])):C>0&&O+_>this.bottom&&(T=p.x=T+n[p.line].width+u,p.line++,O=p.y=Jn(o,this.top+x+u,this.bottom-n[p.line].height));const N=l.x(T);if(y(N,O,E),T=Hie(A,T+m+f,w?T+R:this.right,t.rtl),S(l.x(T),O,E),w)p.x+=R+u;else if(typeof E.text!="string"){const M=c.lineHeight;p.y+=Fj(E,M)+u}else p.y+=_}),wj(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=Yn(n.font),i=Wr(n.padding);if(!n.display)return;const o=ws(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,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=Jn(t.align,d,this.right-f);else{const m=this.columnSizes.reduce((h,g)=>Math.max(h,g.height),0);u=c+Jn(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}const p=Jn(s,d,d+f);a.textAlign=o.textAlign(dj(s)),a.textBaseline="middle",a.strokeStyle=n.color,a.fillStyle=n.color,a.font=r.string,Jf(a,n.text,p,u,r)}_computeTitleHeight(){const t=this.options.title,n=Yn(t.font),r=Wr(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,o;if(xo(t,this.left,this.right)&&xo(n,this.top,this.bottom)){for(o=this.legendHitBoxes,r=0;r<o.length;++r)if(i=o[r],xo(t,i.left,i.left+i.width)&&xo(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!rle(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,o=Jse(i,r);i&&!o&&ct(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!o&&ct(n.onHover,[t,r,this],this)}else r&&ct(n.onClick,[t,r,this],this)}}function ele(e,t,n,r,i){const o=tle(r,e,t,n),a=nle(i,r,t.lineHeight);return{itemWidth:o,itemHeight:a}}function tle(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 nle(e,t,n){let r=e;return typeof t.text!="string"&&(r=Fj(t,n)),r}function Fj(e,t){const n=e.text?e.text.length:0;return t*n}function rle(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var Vr={id:"legend",_element:o2,start(e,t,n){const r=e.legend=new o2({ctx:e.ctx,options:n,chart:e});wo.configure(e,r,n),wo.addBox(e,r)},stop(e){wo.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;wo.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=Wr(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 Zl={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=sy(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 qr(e,t){return t&&(Xt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function ki(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
275
275
  `)>-1?e.split(`
276
- `):e}function ile(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 a2(e,t){const n=e.chart.ctx,{body:r,footer:i,title:o}=e,{boxWidth:a,boxHeight:s}=t,l=Yn(t.bodyFont),c=Yn(t.titleFont),u=Yn(t.footerFont),d=o.length,f=i.length,p=r.length,m=Wr(t.padding);let h=m.height,g=0,y=r.reduce((x,_)=>x+_.before.length+_.lines.length+_.after.length,0);if(y+=e.beforeBody.length+e.afterBody.length,d&&(h+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),y){const x=t.displayColors?Math.max(s,l.lineHeight):l.lineHeight;h+=p*x+(y-p)*l.lineHeight+(y-1)*t.bodySpacing}f&&(h+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let S=0;const w=function(x){g=Math.max(g,n.measureText(x).width+S)};return n.save(),n.font=c.string,Ge(e.title,w),n.font=l.string,Ge(e.beforeBody.concat(e.afterBody),w),S=t.displayColors?a+2+t.boxPadding:0,Ge(r,x=>{Ge(x.before,w),Ge(x.lines,w),Ge(x.after,w)}),S=0,n.font=u.string,Ge(e.footer,w),n.restore(),g+=m.width,{width:g,height:h}}function ole(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function ale(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 sle(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"),ale(c,e,t,n)&&(c="center"),c}function s2(e,t,n){const r=n.yAlign||t.yAlign||ole(e,n);return{xAlign:n.xAlign||t.xAlign||sle(e,t,n,r),yAlign:r}}function lle(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function cle(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function l2(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:f,bottomRight:p}=xs(a);let m=lle(t,s);const h=cle(t,l,c);return l==="center"?s==="left"?m+=c:s==="right"&&(m-=c):s==="left"?m-=Math.max(u,f)+i:s==="right"&&(m+=Math.max(d,p)+i),{x:bn(m,0,r.width-t.width),y:bn(h,0,r.height-t.height)}}function Sd(e,t,n){const r=Wr(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function c2(e){return qr([],ki(e))}function ule(e,t,n){return qa(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function u2(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const $j={beforeTitle:Pi,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:Pi,beforeBody:Pi,beforeLabel:Pi,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 He(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:Pi,afterBody:Pi,beforeFooter:Pi,footer:Pi,afterFooter:Pi};function In(e,t,n,r){const i=e[t].call(n,r);return typeof i>"u"?$j[t].call(n,r):i}class d2 extends Ko{static positioners=Zl;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 Sj(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=ule(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=In(r,"beforeTitle",this,t),o=In(r,"title",this,t),a=In(r,"afterTitle",this,t);let s=[];return s=qr(s,ki(i)),s=qr(s,ki(o)),s=qr(s,ki(a)),s}getBeforeBody(t,n){return c2(In(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return Ge(t,o=>{const a={before:[],lines:[],after:[]},s=u2(r,o);qr(a.before,ki(In(s,"beforeLabel",this,o))),qr(a.lines,In(s,"label",this,o)),qr(a.after,ki(In(s,"afterLabel",this,o))),i.push(a)}),i}getAfterBody(t,n){return c2(In(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=In(r,"beforeFooter",this,t),o=In(r,"footer",this,t),a=In(r,"afterFooter",this,t);let s=[];return s=qr(s,ki(i)),s=qr(s,ki(o)),s=qr(s,ki(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(ile(this.chart,n[l]));return t.filter&&(s=s.filter((u,d,f)=>t.filter(u,d,f,r))),t.itemSort&&(s=s.sort((u,d)=>t.itemSort(u,d,r))),Ge(s,u=>{const d=u2(t.callbacks,u);i.push(In(d,"labelColor",this,u)),o.push(In(d,"labelPointStyle",this,u)),a.push(In(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=Zl[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=a2(this,r),c=Object.assign({},s,l),u=s2(this.chart,r,c),d=l2(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}=xs(s),{x:f,y:p}=t,{width:m,height:h}=n;let g,y,S,w,x,_;return o==="center"?(x=p+h/2,i==="left"?(g=f,y=g-a,w=x+a,_=x-a):(g=f+m,y=g+a,w=x-a,_=x+a),S=g):(i==="left"?y=f+Math.max(l,u)+a:i==="right"?y=f+m-Math.max(c,d)-a:y=this.caretX,o==="top"?(w=p,x=w-a,g=y-a,S=y+a):(w=p+h,x=w+a,g=y+a,S=y-a),_=w),{x1:g,x2:y,x3:S,y1:w,y2:x,y3:_}}drawTitle(t,n,r){const i=this.title,o=i.length;let a,s,l;if(o){const c=ws(r.rtl,this.x,this.width);for(t.x=Sd(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",a=Yn(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=Yn(o.bodyFont),d=Sd(this,"left",o),f=i.x(d),p=l<u.lineHeight?(u.lineHeight-l)/2:0,m=n.y+p;if(o.usePointStyle){const h={radius:Math.min(c,l)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},g=i.leftForLtr(f,c)+c/2,y=m+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,cy(t,h,g,y),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,cy(t,h,g,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 h=i.leftForLtr(f,c),g=i.leftForLtr(i.xPlus(f,1),c-2),y=xs(a.borderRadius);Object.values(y).some(S=>S!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ep(t,{x:h,y:m,w:c,h:l,radius:y}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),ep(t,{x:g,y:m+1,w:c-2,h:l-2,radius:y}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(h,m,c,l),t.strokeRect(h,m,c,l),t.fillStyle=a.backgroundColor,t.fillRect(g,m+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=Yn(r.bodyFont);let f=d.lineHeight,p=0;const m=ws(r.rtl,this.x,this.width),h=function(D){n.fillText(D,m.x(t.x+p),t.y+f/2),t.y+=f+o},g=m.textAlign(a);let y,S,w,x,_,E,C;for(n.textAlign=a,n.textBaseline="middle",n.font=d.string,t.x=Sd(this,g,r),n.fillStyle=r.bodyColor,Ge(this.beforeBody,h),p=s&&g!=="right"?a==="center"?c/2+u:c+2+u:0,x=0,E=i.length;x<E;++x){for(y=i[x],S=this.labelTextColors[x],n.fillStyle=S,Ge(y.before,h),w=y.lines,s&&w.length&&(this._drawColorBox(n,t,x,m,r),f=Math.max(d.lineHeight,l)),_=0,C=w.length;_<C;++_)h(w[_]),f=d.lineHeight;Ge(y.after,h)}p=0,f=d.lineHeight,Ge(this.afterBody,h),t.y-=o}drawFooter(t,n,r){const i=this.footer,o=i.length;let a,s;if(o){const l=ws(r.rtl,this.x,this.width);for(t.x=Sd(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",a=Yn(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:f,bottomLeft:p,bottomRight:m}=xs(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-f,l),n.quadraticCurveTo(s+c,l,s+c,l+f),a==="center"&&o==="right"&&this.drawCaret(t,n,r,i),n.lineTo(s+c,l+u-m),n.quadraticCurveTo(s+c,l+u,s+c-m,l+u),a==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(s+p,l+u),n.quadraticCurveTo(s,l+u,s,l+u-p),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=Zl[t.position].call(this,this._active,this._eventPosition);if(!a)return;const s=this._size=a2(this,t),l=Object.assign({},a,this._size),c=s2(n,t,l),u=l2(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=Wr(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),xj(t,n.textDirection),o.y+=a.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),wj(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=!Xf(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||!Xf(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=Zl[o.position].call(this,t,n);return a!==!1&&(r!==a.x||i!==a.y)}}var jr={id:"tooltip",_element:d2,positioners:Zl,afterInit(e,t,n){n&&(e.tooltip=new d2({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:$j},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 dle=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function fle(e,t,n,r){const i=e.indexOf(t);if(i===-1)return dle(e,t,n,r);const o=e.lastIndexOf(t);return i!==o?n:i}const ple=(e,t)=>e===null?null:bn(Math.round(e),0,t);function f2(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class lo extends dl{static id="category";static defaults={ticks:{callback:f2}};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(He(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:fle(r,t,Se(n,t),this._addedLabels),ple(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 f2.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 hle(e,t){const n=[],{bounds:i,step:o,min:a,max:s,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=e,p=o||1,m=u-1,{min:h,max:g}=t,y=!He(a),S=!He(s),w=!He(c),x=(g-h)/(d+1);let _=pP((g-h)/m/p)*p,E,C,D,A;if(_<1e-14&&!y&&!S)return[{value:h},{value:g}];A=Math.ceil(g/_)-Math.floor(h/_),A>m&&(_=pP(A*_/m/p)*p),He(l)||(E=Math.pow(10,l),_=Math.ceil(_*E)/E),i==="ticks"?(C=Math.floor(h/_)*_,D=Math.ceil(g/_)*_):(C=h,D=g),y&&S&&o&&Rie((s-a)/o,_/1e3)?(A=Math.round(Math.min((s-a)/_,u)),_=(s-a)/A,C=a,D=s):w?(C=y?a:C,D=S?s:D,A=c-1,_=(D-C)/A):(A=(D-C)/_,lc(A,Math.round(A),_/1e3)?A=Math.round(A):A=Math.ceil(A));const R=Math.max(hP(_),hP(C));E=Math.pow(10,He(l)?R:l),C=Math.round(C*E)/E,D=Math.round(D*E)/E;let T=0;for(y&&(f&&C!==a?(n.push({value:a}),C<a&&T++,lc(Math.round((C+T*_)*E)/E,a,p2(a,x,e))&&T++):C<a&&T++);T<A;++T){const O=Math.round((C+T*_)*E)/E;if(S&&O>s)break;n.push({value:O})}return S&&f&&D!==s?n.length&&lc(n[n.length-1].value,s,p2(s,x,e))?n[n.length-1].value=s:n.push({value:s}):(!S||D===s)&&n.push({value:D}),n}function p2(e,t,{horizontal:n,minRotation:r}){const i=Li(r),o=(n?Math.sin(i):Math.cos(i))||.001,a=.75*t*(""+e).length;return Math.min(t/o,a)}class mle extends dl{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 He(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=di(i),c=di(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=hle(i,o);return t.bounds==="ticks"&&Iie(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 fx(t,this.chart.options.locale,this.options.ticks.format)}}class co extends mle{static id="linear";static defaults={ticks:{callback:fj.formatters.numeric}};determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Ar(t)?t:0,this.max=Ar(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Li(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 _h={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}},zn=Object.keys(_h);function h2(e,t){return e-t}function m2(e,t){if(He(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)),Ar(a)||(a=typeof r=="string"?n.parse(a,r):n.parse(a)),a===null?null:(i&&(a=i==="week"&&(Bc(o)||o===!0)?n.startOf(a,"isoWeek",o):n.startOf(a,i)),+a)}function g2(e,t,n,r){const i=zn.length;for(let o=zn.indexOf(e);o<i-1;++o){const a=_h[zn[o]],s=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-t)/(s*a.size))<=r)return zn[o]}return zn[i-1]}function gle(e,t,n,r,i){for(let o=zn.length-1;o>=zn.indexOf(n);o--){const a=zn[o];if(_h[a].common&&e._adapter.diff(i,r,a)>=t-1)return a}return zn[n?zn.indexOf(n):0]}function vle(e){for(let t=zn.indexOf(e)+1,n=zn.length;t<n;++t)if(_h[zn[t]].common)return zn[t]}function v2(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=ux(n,t),o=n[r]>=t?n[r]:n[i];e[o]=!0}}function yle(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 y2(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:yle(e,r,i,n)}class b2 extends dl{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 Eae._date(t.adapters.date);i.init(n),sc(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:m2(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=Ar(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),o=Ar(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=Wie(i,o,a);return this._unit=n.unit||(r.autoSkip?g2(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):gle(this,s.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:vle(this._unit),this.initOffsets(i),t.reverse&&s.reverse(),y2(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=bn(n,0,a),r=bn(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||g2(o.minUnit,n,r,this._getLabelCapacity(n)),s=Se(i.ticks.stepSize,1),l=a==="week"?o.isoWeekday:!1,c=Bc(l)||l===!0,u={};let d=n,f,p;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 m=i.ticks.source==="data"&&this.getDataTimestamps();for(f=d,p=0;f<r;f=+t.add(f,s,a),p++)v2(u,f,m);return(f===r||i.bounds==="ticks"||p===1)&&v2(u,f,m),Object.keys(u).sort(h2).map(h=>+h)}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 ct(a,[t,n,r],this);const s=o.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&s[l],d=c&&s[c],f=r[n],p=c&&d&&f&&f.major;return this._adapter.format(t,i||(p?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=Li(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,y2(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(m2(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return lj(t.sort(h2))}}function Ed(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}=wa(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}=wa(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 Gce extends b2{static id="timeseries";static defaults=b2.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=Ed(n,this.min),this._tableRange=Ed(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(Ed(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Ed(this._table,r*this._tableRange+this._minPos,!0)}}const Bj="label";function x2(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function ble(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function Wj(e,t){e.labels=t}function zj(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Bj;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 xle(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Bj;const n={labels:[],datasets:[]};return Wj(n,e.labels),zj(n,e.datasets,t),n}function wle(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,...f}=e,p=k.useRef(null),m=k.useRef(null),h=()=>{p.current&&(m.current=new Mn(p.current,{type:a,data:xle(s,o),options:l&&{...l},plugins:c}),x2(t,m.current))},g=()=>{x2(t,null),m.current&&(m.current.destroy(),m.current=null)};return k.useEffect(()=>{!i&&m.current&&l&&ble(m.current,l)},[i,l]),k.useEffect(()=>{!i&&m.current&&Wj(m.current.config.data,s.labels)},[i,s.labels]),k.useEffect(()=>{!i&&m.current&&s.datasets&&zj(m.current.config.data,s.datasets,o)},[i,s.datasets]),k.useEffect(()=>{m.current&&(i?(g(),setTimeout(h)):m.current.update(d))},[i,l,s.labels,s.datasets,d]),k.useEffect(()=>{m.current&&(g(),setTimeout(h))},[a]),k.useEffect(()=>(h(),()=>g()),[]),k.createElement("canvas",{ref:p,role:"img",height:n,width:r,...f},u)}const _le=k.forwardRef(wle);function Ox(e,t){return Mn.register(t),k.forwardRef((n,r)=>k.createElement(_le,{...n,ref:r,type:e}))}const Px=Ox("line",Sae),pl=Ox("bar",xae),Cx=Ox("doughnut",_ae);Mn.register(_x,jr,Vr);const Sle={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:f="#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=f,r.font=`500 ${u}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(l,o,a+12),r.restore()}},Ele=({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 b.jsx(Ne,{title:"Unit Status",period:"This Month",icon:b.jsx(zy,{className:"h-6 w-6 text-green-600"}),className:"h-[238px]",children:b.jsxs("div",{className:"grid grid-cols-12 gap-[16px] items-center",children:[b.jsxs("div",{className:"col-span-5 space-y-3",children:[b.jsxs("div",{children:[b.jsx("div",{className:"!text-[12px] lending-[16px] text-[#64748B]",children:"Sold"}),b.jsx("div",{className:"text-[28px] leading-[32px] text-[#1FA05B]",children:e})]}),b.jsxs("div",{children:[b.jsx("div",{className:"!text-[12px] lending-[16px] text-[#64748B]",children:"Unsold"}),b.jsx("div",{className:"text-[28px] leading-[32px] text-[#EF4444]",children:t})]}),b.jsxs("div",{className:"text-[10px] text-[#1FA05B] flex gap-[8px] items-center ",children:[n," ",b.jsx("div",{className:"text-[#64748B] text-[10px]",children:"Compared to last month"})]})]}),b.jsx("div",{className:"col-span-7",children:b.jsx("div",{className:"h-[158px] w-[158px] ml-auto mr-2",children:b.jsx(Cx,{data:i,options:o,plugins:[Sle]})})})]})})},w2=({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 b.jsxs("div",{className:"flex flex-col items-start",children:[b.jsx("div",{className:"w-2/3 min-w-[80px] h-3 rounded-full overflow-hidden",children:b.jsx("div",{className:`h-3 rounded-full ${n}`,style:{width:`${i}%`}})}),b.jsx("div",{className:`${o} !text-[12px] font-bold mt-1`,children:e}),b.jsx("div",{className:"!text-[12px] text-[#64748B] mt-1",children:r})]})},_2=({title:e,value:t,suffix:n,valueClass:r=""})=>b.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:[b.jsx("div",{className:"!text-[12px] leading-[16px] text-[#121212] mb-1",children:e}),b.jsxs("div",{className:`text-[28px] leading-[32px] flex item gap-[4px] font-medium ${r}`,children:[t," ",n&&b.jsx("div",{className:"text-[28px] leading-[32px] font-medium",children:n})]})]}),Ole=({totalUnits:e=847,occupiedUnits:t=756,ownerCount:n=700,tenantCount:r=56,avgResidents:i=4.4,avgLeaseMonths:o=18})=>{const a=n+r;return b.jsxs("div",{children:[b.jsxs("div",{className:"bg-white border border-[#EBEBEB] rounded-xl shadow-[0_0_12px_0_#EAF2FF] p-4 h-[128px]",children:[b.jsxs("div",{className:"flex items-center gap-[12px] mb-4",children:[b.jsx(Hy,{className:"h-6 w-6 text-[#329DFF]"}),b.jsx("div",{className:"font-medium text-[#121212]",children:"Occupancy Overview"})]}),b.jsxs("div",{className:"flex items-center justify-between gap-",children:[b.jsxs("div",{children:[b.jsx("div",{className:"text-xs leading-[16px] text-[#64748B]",children:"Occupied Units"}),b.jsxs("div",{className:"flex items-center gap-1",children:[b.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),b.jsxs("div",{className:"text-[#64748B] text-[20px] leading-[32px]",children:["/",e]})]})]}),b.jsxs("div",{className:"flex items-end",children:[b.jsx(w2,{value:n,total:a,colorClass:"bg-[#8B5CF6]",label:"Owner"}),b.jsx(w2,{value:r,total:a,colorClass:"bg-[#12B981]",label:"Tenant"})]})]})]}),b.jsxs("div",{className:"mt-2.5 grid grid-cols-2 gap-[12px]",children:[b.jsx(_2,{title:"Avg Residents Per Unit",value:i,valueClass:"text-[#8B5CF6]"}),b.jsx(_2,{title:"Avg Lease Period",value:o,suffix:"months",valueClass:"text-[#E7A015]"})]})]})};Mn.register(_x,jr,Vr);const Ple={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:f="#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=f,r.font=`500 ${u}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(l,o,a+12),r.restore()}},Cle=({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 b.jsx(Ne,{title:"Resident Overview",icon:b.jsx(ik,{className:"h-6 w-6 text-[#8B5CF6]"}),className:"h-[238px]",children:b.jsxs("div",{className:" flex-1 min-h-0 grid grid-cols-12 gap-[16px] items-center",children:[b.jsxs("div",{className:"col-span-5",children:[b.jsxs("div",{children:[b.jsx("div",{className:"!text-[12px] text-[#64748B] leading-[16px]",children:"Total Owners"}),b.jsx("div",{className:"text-[28px] leading-[32px ] text-[#3C81F6]",children:e})]}),b.jsxs("div",{children:[b.jsx("div",{className:"!text-[12px] text-[#64748B] leading-[16px]",children:"Total Tenants"}),b.jsx("div",{className:"text-[28px] leading-[32px ] text-[#08B6D4]",children:t})]}),b.jsxs("div",{className:"text-[10px] text-[#1FA05B] flex gap-2 items-center",children:[r," ",b.jsx("div",{className:"text-[#64748B] ",children:"Compared to last month"})]})]}),b.jsx("div",{className:"col-span-7",children:b.jsx("div",{className:"h-[162px] w-[162px] ml-auto mr-2",children:b.jsx(Cx,{data:a,options:s,plugins:[Ple]})})})]})})};Mn.register(lo,co,fl,jr,Vr);const kle=({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 b.jsx(Ne,{title:"Block-wise Occupancy",period:b.jsx(An,{className:"text-xl text-[#884EA7]"}),className:"w-full h-[360px]",titleWeight:"semi-bold",children:b.jsx(pl,{data:o,options:a})})};Mn.register(lo,co,Ex,Sx,jr,Vr);const Dle=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}`},Tle=({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=>Dle(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 b.jsx(Ne,{title:"Move-in/Out Trends",className:"w-full h-[360px]",period:b.jsx(An,{className:"text-[20px] text-[#884EA7]"}),titleWeight:"semi-bold",children:b.jsx(Px,{data:r,options:i})})};Mn.register(lo,co,Ex,Sx,jr,Vr);const Ale=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}`},Vj=({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=>Ale(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 b.jsx(Px,{data:r,options:i})};function S2({label:e,value:t,positive:n,bgColor:r,delta:i,deltaLabel:o,textColor:a}){return b.jsxs("div",{className:`rounded-lg p-4 ${r} border border-[#EBEBEB] h-[126px]`,children:[b.jsx("div",{className:`text-[16px] leading-[20px] ${a}`,children:e}),b.jsx("div",{className:"mt-[16px] leading-[28px] !text-[24px] font-medium text-[#121212]",children:t}),b.jsxs("div",{className:"mt-[8px] flex items-center gap-[8px] leading-[14px] text-[10px]",children:[b.jsx("div",{className:n?"text-[#1FA05B] font-medium":"text-[#EF4444] font-medium",children:i}),b.jsx("div",{className:"text-[#64748B] ",children:o})]})]})}function Mle(){return b.jsxs(Ne,{title:"Accounting",className:"w-full h-[523px]",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:[b.jsxs("div",{className:"grid grid-cols-2 gap-[16px]",children:[b.jsx(S2,{label:"Total Income",value:"AED 5.68M",delta:"+4.4%",positive:!0,bgColor:"bg-slate-50",deltaLabel:"Compared to last month",textColor:"text-[#1FA05B]"}),b.jsx(S2,{label:"Total Expenditure",value:"AED 1.83M",delta:"-1.1%",positive:!1,bgColor:"bg-slate-50",deltaLabel:"Compared to last month",textColor:"text-[#AB0000]"})]}),b.jsx("div",{className:"h-[254px] mt-[35.5px]",children:b.jsx(Vj,{})})]})}Mn.register(lo,co,fl,jr,Vr);const Nle=()=>{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 b.jsx(Ne,{title:"Budget vs Actuals",className:"w-full h-[362px]",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:b.jsx(pl,{data:r,options:i})})},jle=()=>{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 b.jsxs(Ne,{title:"Cash & Bank Balance",className:"w-full h-[362px]",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),children:[b.jsx("div",{className:"flex flex-col gap-[12px]",children:e.map((r,i)=>b.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-lg p-3",children:[b.jsxs("div",{className:"flex flex-col",children:[b.jsx("div",{className:"text-[14px] font-medium text-[#121212]",children:r.title}),b.jsx("div",{className:"!text-[12px] text-[#64748B]",children:r?.subtitle})]}),b.jsx("div",{className:"flex flex-col items-end",children:b.jsx("div",{className:"text-[14px] text-[#1FA05B] font-semibold",children:n(r.amount)})})]},i))}),b.jsxs("div",{className:"flex items-center justify-between border-t border-[#EBEBEB] h-[68px] px-3",children:[b.jsx("div",{className:"text-[14px] font-medium text-[#121212]",children:"Total"}),b.jsx("div",{className:"text-[16px] text-[#1FA05B] font-bold",children:n(t)})]})]})};Mn.register(lo,co,fl,jr,Vr);const Rle=()=>{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 b.jsxs(Ne,{title:"Dues Ageing",className:"w-full h-[362px]",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:[b.jsx("div",{className:"grid grid-cols-4 md:grid-cols-4 gap-[12px] h-[48px]",children:e.map((o,a)=>b.jsx("div",{className:"p-2 rounded-lg bg-slate-50",children:b.jsxs("div",{className:"flex justify-between items-start",children:[b.jsx("div",{className:"font-medium leading-[16px] !text-[12px] rounded",children:o}),b.jsxs("div",{className:"text-right",children:[b.jsxs("div",{className:"text-red-600 font-medium leading-[16px] !text-[12px]",children:["AED ",(t[a]/1e3).toFixed(1),"K"]}),b.jsxs("div",{className:" text-gray-500 leading-[14px] text-[10px]",children:[n[a]," Units"]})]})]})},o))}),b.jsx("div",{className:"h-[192px]",children:b.jsx(pl,{data:r,options:i})})]})};Mn.register(_x,jr,Vr);const Ile=()=>{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 b.jsxs(Ne,{title:"Expense Categories",className:"w-full h-[523px]",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:[b.jsxs("div",{className:"relative h-[259px] flex justify-center items-center",children:[b.jsx(Cx,{data:n,options:i}),b.jsxs("div",{className:"absolute text-center",children:[b.jsxs("div",{className:"!text-[24px] font-medium leading-[28px] text-[#121212]",children:["AED ",(r/1e6).toFixed(2),"M"]}),b.jsx("div",{className:"text-[#121212] leading-[18px] text-[14px]",children:"Total Expenses"})]})]}),b.jsx("div",{className:"space-y-2",children:e.map((o,a)=>b.jsxs("div",{className:"flex justify-between items-center text-[14px] pb-2",children:[b.jsxs("div",{className:"flex items-center gap-[8px] !text-[12px] leading-[16px] text-[#64748B]",children:[b.jsx("div",{className:"w-[7px] h-[7px] rotate-45",style:{backgroundColor:n.datasets[0].backgroundColor[a]}}),o]}),b.jsxs("div",{className:"leading-[16px] !text-[12px] text-[#64748B]",children:["AED ",(t[a]/1e3).toFixed(0),"K"]})]},o))})]})},Bl=[{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 Lle(){const e=Bl.reduce((t,n)=>t+n.value,0);return b.jsx(Ne,{title:"Asset Value Breakdown",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"h-[362px]",titleWeight:"semi-bold",children:b.jsxs("div",{className:"flex flex-col items-center justify-center",children:[b.jsxs("div",{className:"w-[214px] h-[181px] relative",children:[b.jsx(xi,{width:"100%",height:"100%",children:b.jsxs(bu,{children:[b.jsx(il,{data:Bl,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:Bl.map((t,n)=>b.jsx(Br,{fill:t.color},`cell-${n}`))}),b.jsx(bi,{formatter:t=>`AED ${t.toLocaleString()}`})]})}),b.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[b.jsxs("div",{className:"font-medium text-lg leading-[12px] ",children:["AED ",(e/1e6).toFixed(2),"M"]}),b.jsx("div",{className:"text-[10px] leading-[12.59px] text-[#121212] mt-[6px]",children:"Total Assets"})]})]}),b.jsxs("div",{className:"flex justify-between w-full px-4 sm:px-8 mt-4 text-[14px]",children:[b.jsx("div",{className:"flex flex-col gap-[8px]",children:Bl.slice(0,3).map(t=>b.jsxs("div",{className:"flex items-center gap-[8px]",children:[b.jsx("div",{className:"inline-block h-[7px] w-[7px] rotate-45",style:{backgroundColor:t.color}}),b.jsx("div",{className:"text-[#64748B] leading-[16px] !text-[12px]",children:t.name})]},t.name))}),b.jsx("div",{className:"flex flex-col gap-[8px] items-start",children:Bl.slice(3).map(t=>b.jsxs("div",{className:"flex items-center gap-[8px]",children:[b.jsx("div",{className:"inline-block h-[7px] w-[7px] rotate-45",style:{backgroundColor:t.color}}),b.jsx("div",{className:"text-[#64748B] leading-[16px] !text-[12px]",children:t.name})]},t.name))})]})]})})}Mn.register(lo,co,fl,jr,Vr);const Fle=()=>{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 b.jsx(Ne,{title:"Revenue by Category",className:"w-full h-[362px]",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:b.jsx(pl,{data:r,options:i})})};function $le(e){return Ze({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 Ble(e){return Ze({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 Wle({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=Kc,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return b.jsxs(Ne,{title:e,icon:b.jsx("div",{className:"h-6 w-6 grid place-items-center",children:b.jsx(o,{className:`h-6 w-6 ${a}`})}),children:[b.jsx("div",{className:"text-4xl font-semibold tracking-tight text-[#121212]",children:t}),b.jsxs("div",{className:"flex items-center gap-[8px] text-[14px]",children:[b.jsx("div",{className:i?"text-emerald-600 font-medium":"text-rose-600 font-medium",children:n}),b.jsx("div",{className:"text-slate-500",children:r})]})]})}function zle(){const e=[{title:"Total Bookings",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:rk,iconColor:"text-emerald-600"},{title:"Utilisation Rate",value:73,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Ble,iconColor:"text-[#329DFF]"},{title:"Revenue",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:$le,iconColor:"text-[#FA7E28]"},{title:"Pending Dues",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:ok,iconColor:"text-[#DBB467]"}];return b.jsx("div",{className:"px-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:e.map((t,n)=>b.jsx(Wle,{...t},n))})}const Od=[{name:"Completed",value:46,color:"#12B981"},{name:"Delayed",value:2,color:"#EF4444"},{name:"Missed",value:2,color:"#F69E0A"}];function Vle(){const t=Od.find(n=>n.name==="Completed")?.value||0;return b.jsx(Ne,{title:"Guard Patrols",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"h-[362px]",children:b.jsxs("div",{className:"flex flex-col items-center justify-center",children:[b.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[b.jsx(xi,{width:"100%",height:"100%",children:b.jsxs(bu,{children:[b.jsx(il,{data:Od,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:Od.map((n,r)=>b.jsx(Br,{fill:n.color},`cell-${r}`))}),b.jsx(bi,{formatter:n=>n.toLocaleString()})]})}),b.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[b.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px] ",children:[t,"/",50]}),b.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),b.jsx("div",{className:"flex flex-col gap-[8px] mt-3 w-full px-6 text-[14px]",children:Od.map(n=>b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsxs("div",{className:"flex items-center gap-[8px]",children:[b.jsx("div",{className:"inline-block w-[7px] h-[7px] rotate-45",style:{backgroundColor:n.color}}),b.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:n.name})]}),b.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:n.value})]},n.name))})]})})}Mn.register(lo,co,Ex,Sx,jr,Vr);const Hle=()=>{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 b.jsx(Ne,{title:"Hourly Traffic Flow",className:"w-full h-[362px]",period:b.jsx(An,{className:"text-[20px] text-[#884EA7]"}),children:b.jsx(Px,{data:t,options:n})})};function Yle(){return b.jsx(Ne,{title:"Incident Reports",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"h-[362px]",children:b.jsxs("div",{children:[b.jsxs("div",{className:"flex w-full text-center gap-[24px]",children:[b.jsxs("div",{className:"flex-1 py-3 bg-[#FBF4F4] h-[76px] rounded",children:[b.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#AB0000]",children:"3"}),b.jsx("div",{className:"!text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),b.jsxs("div",{className:"flex-1 py-3 bg-[#FFFBF2] h-[76px] rounded",children:[b.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#E7A015]",children:"5"}),b.jsx("div",{className:"!text-[12px] leading-[16px] text-[#E7A015]",children:"In-progress"})]}),b.jsxs("div",{className:"flex-1 py-3 bg-[#F7FEFA] h-[76px] rounded",children:[b.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:"12"}),b.jsx("div",{className:"!text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),b.jsxs("div",{className:"mt-4 ",children:[b.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#FAFBFD] rounded-md border border-[#FAFBFD]",children:[b.jsxs("div",{className:"flex items-center gap-[8px]",children:[b.jsx("div",{className:"w-4 h-4 rounded-full flex items-center justify-center bg-[#AB0000]",children:b.jsx("div",{className:"text-white !text-[12px] font-bold",children:"!"})}),b.jsx("div",{className:"text-gray-700 font-medium",children:"INC 001"})]}),b.jsxs("div",{className:"px-3 py-1 rounded-full !text-[12px] font-semibold flex items-center gap-[4px] text-[#AB0000] bg-red-50",children:[b.jsx("div",{children:"4 - Danger"}),b.jsx("div",{className:"w-2 h-2 rounded-full bg-[#AB0000]"})]})]}),b.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#FAFBFD] rounded-md border border-[#FAFBFD]",children:[b.jsxs("div",{className:"flex items-center gap-[8px]",children:[b.jsx("div",{className:"w-4 h-4 rounded-full flex items-center justify-center bg-[#E7A015]",children:b.jsx(vw,{className:"text-white text-[10px]"})}),b.jsx("div",{className:"text-gray-700 font-medium",children:"INC 002"})]}),b.jsxs("div",{className:"px-3 py-1 rounded-full !text-[12px] font-semibold flex items-center gap-[4px] text-[#E7A015] bg-yellow-50",children:[b.jsx("div",{children:"3 - High"}),b.jsx("div",{className:"w-2 h-2 rounded-full bg-[#E7A015]"})]})]}),b.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#FAFBFD] rounded-md border border-[#FAFBFD]",children:[b.jsxs("div",{className:"flex items-center gap-[8px]",children:[b.jsx("div",{className:"w-4 h-4 rounded-full flex items-center justify-center bg-[#1FA05B]",children:b.jsx(vw,{className:"text-white text-[10px]"})}),b.jsx("div",{className:"text-gray-700 font-medium",children:"INC 003"})]}),b.jsxs("div",{className:"px-3 py-1 rounded-full !text-[12px] font-semibold flex items-center gap-[4px] text-[#1FA05B] bg-green-50",children:[b.jsx("div",{children:"1 - Low"}),b.jsx("div",{className:"w-2 h-2 rounded-full bg-[#1FA05B]"})]})]})]})]})})}function Ule(){return b.jsx(Ne,{title:"Staff Attendance",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"h-[362px]",children:b.jsxs("div",{children:[b.jsxs("div",{className:"flex w-full text-center h-[76px] gap-[16px] mb-2",children:[b.jsxs("div",{className:"flex-1 py-4 bg-green-50 rounded-md",children:[b.jsx("div",{className:"!text-[24px] leading-[18px] font-medium text-[#1FA05B] pb-[8px]",children:"25"}),b.jsx("div",{className:"!text-[12px] leading-[16px] text-[#1FA05B]",children:"Present"})]}),b.jsxs("div",{className:"flex-1 py-4 bg-red-50 rounded-md",children:[b.jsx("div",{className:"!text-[24px] leading-[18px] font-medium text-[#AB0000] pb-[8px]",children:"1"}),b.jsx("div",{className:"!text-[12px] leading-[16px] text-[#AB0000]",children:"Absent"})]})]}),b.jsxs("div",{className:"mt-[24px] ",children:[b.jsxs("div",{className:"flex justify-between items-center p-3 bg-[#FAFBFD] rounded-md",children:[b.jsx("div",{className:" font-medium !text-[12px] leading-[18px]",children:"Security guards"}),b.jsx("div",{className:"text-[#64748B] leading[20px] text-[14px]",children:"12/12 Present"})]}),b.jsxs("div",{className:"flex justify-between items-center p-3 bg-[#FAFBFD] rounded-md",children:[b.jsx("div",{className:" font-medium !text-[12px] leading-[18px]",children:"Housekeeping"}),b.jsx("div",{className:"text-[#64748B] leading[20px] text-[14px]",children:"7/8 Present"})]}),b.jsxs("div",{className:"flex justify-between items-center p-3 bg-[#FAFBFD] rounded-md",children:[b.jsx("div",{className:" font-medium !text-[12px] leading-[18px]",children:"Maintenance"}),b.jsx("div",{className:"text-[#64748B] leading[20px] text-[14px]",children:"4/4 Present"})]}),b.jsxs("div",{className:"flex justify-between items-center p-3 bg-[#FAFBFD] rounded-md",children:[b.jsx("div",{className:" font-medium !text-[12px] leading-[18px]",children:"Gardening"}),b.jsx("div",{className:"text-[#64748B] leading[20px] text-[14px]",children:"2/2 Present"})]})]})]})})}function Kle(e){return Ze({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 qle({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=Kc,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return b.jsxs(Ne,{title:e,icon:b.jsx("div",{className:"h-6 w-6 grid place-items-center",children:b.jsx(o,{className:`h-6 w-6 ${a}`})}),children:[b.jsx("div",{className:"text-4xl font-semibold tracking-tight text-[#121212]",children:t}),b.jsxs("div",{className:"flex items-center gap-[8px] text-[14px]",children:[b.jsx("div",{className:i?"text-emerald-600 font-medium":"text-rose-600 font-medium",children:n}),b.jsx("div",{className:"text-slate-500",children:r})]})]})}function Gle(){const e=[{title:"Total Visitors",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Hy,iconColor:"text-[#329DFF]"},{title:"Active Incidents",value:73,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:dre,iconColor:"text-[#F69E0A]"},{title:"Missed Patrols",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Kle,iconColor:"text-[#AB0000]"},{title:"Parking Usage",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:P3,iconColor:"text-[#36AB6C]"}];return b.jsx("div",{className:"px-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:e.map((t,n)=>b.jsx(qle,{...t},n))})}const Xle=[{title:"Maintenance",total:12,pending:3},{title:"Security",total:8,pending:1},{title:"Housekeeping",total:6,pending:2},{title:"Utilities",total:10,pending:4}],Qle=(e="")=>e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/<[^>]*>/g,"").trim();function Zle({data:e}){const t=Array.isArray(e?.complaints_by_category)&&e.complaints_by_category.length>0?e.complaints_by_category.map(n=>({title:Qle(n.category_name)||"—",total:n.total||0,pending:n.pending||0})):Xle;return b.jsx(Ne,{title:"Complaints",className:"h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:b.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((n,r)=>b.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-lg p-3 h-[62px]",children:[b.jsxs("div",{className:"flex flex-col",children:[b.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),b.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),b.jsxs("div",{className:"flex flex-col items-end",children:[b.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},r))})})}const Jle=e=>{const t={0:"𝟎",1:"𝟏",2:"𝟐",3:"𝟑",4:"𝟒",5:"𝟓",6:"𝟔",7:"𝟕",8:"𝟖",9:"𝟗"};return String(e).split("").map(n=>t[n]||n).join("")},ece=[{level:"Level 1",open_count:3,in_progress_count:4,closed_count:5,total:12},{level:"Level 2",open_count:1,in_progress_count:1,closed_count:1,total:3},{level:"Level 3",open_count:5,in_progress_count:2,closed_count:3,total:10}],tce=({active:e,payload:t,label:n})=>{if(!e||!t)return null;const r=[{key:"open_count",label:"Open",color:"#EF4444"},{key:"in_progress_count",label:"In Progress",color:"#F59D0D"},{key:"closed_count",label:"Closed",color:"#12B981"}];return b.jsxs("div",{style:{backgroundColor:"#0B0B0B",padding:"14px 40px 14px 18px",borderRadius:"10px",color:"#ffffff"},children:[b.jsx("div",{style:{color:"#ffffff",fontSize:"12px",fontWeight:"900",marginBottom:"10px"},children:n}),r.map((i,o)=>{const a=t[0]?.payload[i.key]||0,s=Jle(a);return b.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:o<r.length-1?"8px":"0",fontSize:"12px"},children:[b.jsx("div",{style:{width:"8px",height:"8px",backgroundColor:i.color,transform:"rotate(45deg)",marginRight:"8px"}}),b.jsx("span",{style:{color:"D1D3D4",minWidth:"100px"},children:i.label}),b.jsx("span",{style:{marginLeft:"auto",fontWeight:"700"},children:s})]},i.key)})]})},nce=()=>{const e=[{label:"Open",color:"#EF4444"},{label:"In Progress",color:"#F59D0D"},{label:"Closed",color:"#12B981"}];return b.jsx("div",{style:{display:"flex",justifyContent:"space-between",gap:"15px"},children:e.map(t=>b.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[b.jsx("div",{style:{width:"6px",height:"6px",backgroundColor:t.color,transform:"rotate(45deg)"}}),b.jsx("span",{style:{fontSize:"14px"},children:t.label})]},t.label))})},rce=({data:e})=>{const t=k.useMemo(()=>(Array.isArray(e?.complaints_by_level)&&e.complaints_by_level.some(l=>Number(l.total)>0)?e.complaints_by_level:ece).map(l=>({level:l.level||"—",open_count:Number(l.open_count)||0,in_progress_count:Number(l.in_progress_count)||0,closed_count:Number(l.closed_count)||0,total:Number(l.total)||0})),[e]),n=k.useMemo(()=>Math.max(...t.map(a=>a.total),5),[t]),r=Math.ceil(n*1.2),i=6,o=Math.max(Math.ceil(n/i),1);return b.jsxs(Ne,{title:"Complaints by Level",className:"w-full h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:[b.jsx(xi,{width:"100%",height:"85%",children:b.jsxs(KM,{data:t,margin:{top:5,right:-25,left:-30,bottom:5},children:[b.jsx(ol,{strokeDasharray:"0",vertical:!1}),b.jsx(al,{dataKey:"level"}),b.jsx($a,{domain:[0,r],ticks:Array.from({length:i+1},(a,s)=>s*o)}),b.jsx(bi,{content:b.jsx(tce,{}),cursor:!1}),b.jsx(nc,{dataKey:"open_count",stackId:"a",fill:"#EF4444",barSize:44,radius:[0,0,0,0]}),b.jsx(nc,{dataKey:"in_progress_count",stackId:"a",fill:"#F59D0D",barSize:44,radius:[0,0,0,0]}),b.jsx(nc,{dataKey:"closed_count",stackId:"a",fill:"#12B981",barSize:44,radius:[0,0,0,0]})]})}),b.jsx(nce,{})]})},ice=[{title:"Maintenance",total:18,pending:4},{title:"Security",total:11,pending:2},{title:"Housekeeping",total:9,pending:3},{title:"Utilities",total:14,pending:5}];function oce({data:e}){const t=Array.isArray(e?.request_box_by_type)&&e.request_box_by_type.length>0?e.request_box_by_type.map(n=>({title:n.category_name||"—",total:Number(n.total)||0,pending:Number(n.pending)||0})):ice;return b.jsx(Ne,{title:"Request Box",className:"h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:b.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((n,r)=>b.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-lg p-3 h-[62px]",children:[b.jsxs("div",{className:"flex flex-col",children:[b.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),b.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),b.jsxs("div",{className:"flex flex-col items-end",children:[b.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},`${n.title}-${r}`))})})}function ace(e){return Ze({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)}const sce=["open_complaints","pending_requests","avg_response_time","resolution_rate"],lce={open_complaints:{title:"Open Complaints",Icon:rk,iconColor:"#AB0000",deltaLabel:"Compared to last month"},pending_requests:{title:"Pending Requests",Icon:ace,iconColor:"#E7A015",deltaLabel:"Compared to last month"},avg_response_time:{title:"Avg Response Time",Icon:R3,iconColor:"#1FA05B",deltaLabel:"Compared to last month"},resolution_rate:{title:"Resolution Rate",Icon:A3,iconColor:"#329DFF",deltaLabel:"Compared to last month"}},cce=({children:e,size:t=28,lineHeight:n=32,weight:r=500,color:i="#121212"})=>b.jsx("div",{style:{fontWeight:r,fontSize:`${t}px`,lineHeight:`${n}px`,color:i},children:e}),uce={primary:{size:28,lineHeight:32,weight:500}},dce={open_complaints:{current:24,trend_percent:"-8%",direction:"bad"},pending_requests:{current:17,trend_percent:"-5%",direction:"bad"},avg_response_time:{current:"2.4 h",trend_percent:"+6%",direction:"good"},resolution_rate:{current:"89%",trend_percent:"+4%",direction:"good"}};function fce({id:e,data:t}){return e&&t&&!t[e]&&t.current!==void 0?b.jsx(E2,{id:e,data:t}):b.jsx("div",{className:"px-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:sce.map(n=>b.jsx(E2,{id:n},n))})}function E2({id:e,data:t}){const n=lce[e];if(!n)return null;const r=(d,f)=>f==null?"—":d==="avg_response_time"?typeof f=="number"?`${f} h`:f:d==="resolution_rate"&&typeof f=="number"?`${f}%`:f,{title:i,Icon:o=Kc,iconColor:a,deltaLabel:s}=n,l=t&&Object.keys(t).length>0?t:dce[e],c=r(e,l?.current),u=l?.trend_percent??"—";return l?.direction==="good"||l?.direction,b.jsx("div",{className:"h-[132px]",children:b.jsxs(Ne,{title:i,titleColor:a,icon:b.jsx("div",{className:"h-[20px] w-[20px] flex items-center justify-center",children:b.jsx(o,{className:"h-[20px] w-[20px]",style:{color:a}})}),childrenClassName:"!space-y-[12px]",iconClassName:"!gap-[12px]",children:[b.jsx(cce,{...uce.primary,children:c}),b.jsxs("div",{className:"flex items-center gap-[8px] text-[12px] leading-[16px]",children:[b.jsx(Yy,{value:u}),b.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:s})]})]})})}function O2({title:e,date:t,rsvp:n,utilisation:r,status:i}){return b.jsxs("div",{className:" bg-[#F8FAFC] h-[106px] px-3 mt-3",children:[b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsx("div",{className:"text-[16px] leading-[20px] font-semibold text-[#121212]",children:e}),b.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})]}),b.jsx("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:t}),b.jsxs("div",{className:"flex justify-between items-center mt-2",children:[b.jsxs("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:[n," RSVP"]}),b.jsxs("div",{className:"text-[#3C82F6] text-[14px] leading-[18px] font-medium",children:[r,"% utilisation"]})]}),b.jsx("div",{className:"w-full bg-[#F8FAFC] h-[6px] rounded mt-2 mb-3",children:b.jsx("div",{className:"h-[6px] rounded bg-[#3C82F6]",style:{width:`${r}%`}})})]})}function pce(){return b.jsx(Ne,{title:"Events Utilisation",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"w-full h-[360px]",children:b.jsxs("div",{children:[b.jsx(O2,{title:"Holi Celebration",date:"25 Jun 2025",rsvp:"78/100",utilisation:71,status:"Upcoming"}),b.jsx(O2,{title:"Maintenance Meeting",date:"25 Jun 2025",rsvp:"45/60",utilisation:75,status:"Completed"})]})})}function Pd({label:e,value:t,subLabel:n,bgColor:r,textColor:i}){return b.jsxs("div",{className:`rounded-lg p-4 ${r} h-[124px]`,children:[b.jsx("div",{className:`text-[16px] font-medium ${i} leading-[20px]`,children:e}),b.jsx("div",{className:"mt-4 text-[28px] leading-[32px] font-semibold text-[#121212]",children:t}),b.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-2",children:n})]})}function hce(){return b.jsx(Ne,{title:"Notice Board Status",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"w-full h-[360px]",children:b.jsxs("div",{className:"grid grid-cols-2 gap-[16px]",children:[b.jsx(Pd,{label:"Active",value:138,subLabel:"3 expiring soon",bgColor:"bg-[#F0FFF7]",textColor:"text-[#1FA05B]"}),b.jsx(Pd,{label:"Scheduled",value:13,subLabel:"4 this week",bgColor:"bg-[#FFFBF2]",textColor:"text-[#E7A015]"}),b.jsx(Pd,{label:"Recurring",value:3,subLabel:"All active",bgColor:"bg-[#EDF6FF]",textColor:"text-[#329DFF]"}),b.jsx(Pd,{label:"Expired",value:7,subLabel:"4 recent",bgColor:"bg-[#F6F6F6]",textColor:"text-[#64748B]"})]})})}function Hj(e){return Ze({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 mce({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=Kc,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return b.jsx(Ne,{title:e,icon:b.jsx("div",{className:`h-6 w-6 grid place-items-center rounded-md ${s}`,children:b.jsx(o,{className:`h-4 w-4 ${a}`})}),className:"h-[132px]",children:b.jsxs("div",{children:[b.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),b.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[b.jsx("div",{className:i?"text-[#1FA05B] font-medium":"text-rose-600 font-medium",children:n}),b.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}function gce({data:e}){const t=[{title:e?.title||"Total Bookings",value:145,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Hj,iconColor:"text-emerald-600",iconBg:"bg-emerald-50"}];return b.jsx("div",{className:"h-full",children:t.map((n,r)=>b.jsx(mce,{...n},r))})}function vce(e){return Ze({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 yce({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=Kc,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return b.jsx(Ne,{title:e,icon:b.jsx("div",{className:`h-6 w-6 grid place-items-center rounded-md ${s}`,children:b.jsx(o,{className:`h-4 w-4 ${a}`})}),className:"h-[132px]",children:b.jsxs("div",{children:[b.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),b.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[b.jsx("div",{className:i?"text-[#1FA05B] font-medium":"text-rose-600 font-medium",children:n}),b.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}function bce(){const e=[{title:"Notice",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Hj,iconColor:"text-emerald-600",iconBg:"bg-emerald-50"},{title:"Post",value:83,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:C3,iconColor:"text-[#329DFF]",iconBg:"bg-emerald-50"},{title:"Poll",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:cre,iconColor:"text-[#FA7E28]",iconBg:"bg-orange-100"},{title:"Poll",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:vce,iconColor:"text-[#DBB467]",iconBg:"bg-yellow-100"}];return b.jsx("div",{className:"px-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:e.map((t,n)=>b.jsx(yce,{...t},n))})}const P2=({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 b.jsxs("div",{className:"flex flex-col items-start",children:[b.jsx("div",{className:"w-2/3 min-w-[80px] h-3 rounded-full overflow-hidden",children:b.jsx("div",{className:`h-[11px] rounded-full ${n}`,style:{width:`${i}%`}})}),b.jsx("div",{className:`${o} !text-[12px] font-bold mt-1`,children:e}),b.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-1",children:r})]})},xce=({occupiedUnits:e=9e3,EmployeesCount:t=8910,AdminsCount:n=90})=>{const r=t+n;return b.jsx("div",{children:b.jsxs("div",{className:"bg-white !border-[0.5px] !border-[#EBEBEB] rounded-xl shadow-[0_0_12px_0_#EAF2FF] p-4 h-[128px]",children:[b.jsxs("div",{className:"flex items-center gap-[12px] h-[20px]",style:{marginBottom:"24px"},children:[b.jsx(Hy,{className:"!text-[20px] text-[#329DFF]"}),b.jsx("div",{className:"font-medium text-[#121212]",children:"Occupancy Overview"})]}),b.jsxs("div",{className:"flex items-start justify-between",children:[b.jsxs("div",{children:[b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B] font-normal",children:"Total Occupants"}),b.jsx("div",{className:"flex items-center gap-1",children:b.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:e})})]}),b.jsxs("div",{className:"flex items-end",children:[b.jsx(P2,{value:t,total:r,colorClass:"bg-[#8B5CF6]",label:"Employees"}),b.jsx(P2,{value:n,total:r,colorClass:"bg-[#12B981]",label:"Admins"})]})]})]})})};Mn.register(lo,co,fl,jr);const wce=()=>{const t={labels:["HP","Adobe","Anarock","Swiggy","Infosys","Zepto"],datasets:[{data:[2e3,1700,1500,1200,900,800],backgroundColor:["#329DFF","#EF4645","#8A2E64","#F69E0A","#A2BB40","#8B5CF6"],barThickness:34}]},n={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#fff",bodyColor:"#fff",displayColors:!1,callbacks:{label:r=>`Employees: ${r.parsed.y}`}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B",font:{size:12}}},y:{beginAtZero:!0,max:2e3,ticks:{stepSize:500,color:"#64748B"},grid:{display:!1,color:"#E5E7EB",borderDash:[4,4],drawBorder:!1}}}};return b.jsxs(Ne,{className:"w-full h-[238px]",title:b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(T5,{className:"!text-[20px] text-[#8B5CF6]"}),b.jsx("div",{className:"font-medium text-[#121212]",children:"Employee Footfall"})]}),period:b.jsx("span",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Today"}),children:[b.jsxs("div",{style:{marginBottom:"16px",marginTop:"8px"},children:[b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Employees Inside"}),b.jsx("div",{className:"text-[20px] leading-[24px] font-medium text-[#1FA05B]",children:"7,500"})]}),b.jsx("div",{className:"h-[97px]",children:b.jsx(pl,{data:t,options:n})})]})};function _ce(){return b.jsx(Ne,{className:"h-[324px]",title:b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(D5,{className:"!text-[20px] text-[#FA7E28]"}),b.jsx("div",{className:"font-semibold",children:"Food & Beverages"})]}),period:b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Today"}),children:b.jsxs("div",{className:"flex flex-col h-full",children:[b.jsxs("div",{className:"grid grid-cols-2 gap-6 mb-6",children:[b.jsxs("div",{children:[b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Orders"}),b.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:"247"})]}),b.jsxs("div",{children:[b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Revenue Generated"}),b.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF]",children:"₹ 82K"}),b.jsx("div",{className:"inline-block mt-2 text-[10px] leading-[14px] text-[#1FA05B] bg-green-50 px-2 py-1 rounded-full",children:"+8% from last month"})]})]}),b.jsxs("div",{className:"space-y-5",children:[b.jsxs("div",{children:[b.jsxs("div",{className:"flex justify-between text-sm mb-2",children:[b.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:"HP"}),b.jsxs("div",{className:"font-medium text-[12px] leading-[16px] flex items-center",children:[b.jsx("div",{className:"text-[#64748B] inline-block",children:"120 orders"}),b.jsx("div",{className:"mx-2 text-[#121212] inline-block",children:"₹ 45K"})]})]}),b.jsx("div",{className:"h-3 bg-gray-100 rounded-full",children:b.jsx("div",{className:"h-3 bg-blue-500 rounded-full",style:{width:"70%"}})})]}),b.jsxs("div",{children:[b.jsxs("div",{className:"flex justify-between text-sm mb-2",children:[b.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:"Adobe"}),b.jsxs("div",{className:"font-medium text-[12px] leading-[16px] flex items-center",children:[b.jsx("div",{className:"text-[#64748B] inline-block",children:"85 orders"}),b.jsx("div",{className:"mx-2 text-[#121212] inline-block",children:"₹ 23K"})]})]}),b.jsx("div",{className:"h-3 bg-gray-100 rounded-full",children:b.jsx("div",{className:"h-3 bg-red-500 rounded-full",style:{width:"50%"}})})]}),b.jsxs("div",{children:[b.jsxs("div",{className:"flex justify-between text-sm mb-2",children:[b.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:"Anarock"}),b.jsxs("div",{className:"font-medium text-[12px] leading-[16px] flex items-center",children:[b.jsx("div",{className:"text-[#64748B] inline-block",children:"42 orders"}),b.jsx("div",{className:"mx-2 text-[#121212] inline-block",children:"₹ 14K"})]})]}),b.jsx("div",{className:"h-3 bg-gray-100 rounded-full",children:b.jsx("div",{className:"h-3 bg-purple-700 rounded-full",style:{width:"25%"}})})]})]})]})})}function Sce({data:e}){const{amenitySummary:t,chartData:n}=e||{},r=Array.isArray(n)?n:[];return b.jsx(Ne,{className:"h-[324px]",title:b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(O3,{className:"!text-[20px] text-[#884EA7]"}),b.jsx("span",{className:"font-semibold",children:"Amenities"})]}),period:b.jsx("span",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Today"}),children:b.jsxs("div",{className:"flex flex-col h-full",children:[b.jsxs("div",{className:"grid grid-cols-2 gap-6 mb-6",children:[b.jsxs("div",{children:[b.jsx("p",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Bookings"}),b.jsx("p",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:t?.totalBookings??0})]}),b.jsxs("div",{children:[b.jsx("p",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Revenue Generated"}),b.jsx("p",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF]",children:t?.revenueGenerated??"₹0.0"}),t?.growth&&b.jsxs("span",{className:`inline-block mt-2 text-[10px] leading-[14px] px-2 py-1 rounded-full
277
- ${t.growth.isPositive?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[t.growth.percentage," ",t.growth.label]})]})]}),b.jsx("div",{className:"space-y-5",children:r.length>0?r.map((i,o)=>b.jsxs("div",{children:[b.jsxs("div",{className:"flex justify-between text-sm mb-2",children:[b.jsx("span",{className:"text-[#64748B] text-[12px] leading-[16px]",children:i.name}),b.jsxs("span",{className:"font-medium text-[12px] leading-[16px]",children:[b.jsxs("span",{className:"text-[#64748B]",children:[i.bookings," bookings"]}),b.jsx("span",{className:"mx-2 text-[#121212]",children:i.revenue})]})]}),b.jsx("div",{className:"h-3 bg-gray-100 rounded-full",children:b.jsx("div",{className:`h-3 rounded-full ${i.color||"bg-slate-400"}`,style:{width:`${i.percentage||0}%`}})})]},o)):b.jsx("div",{className:"flex items-center justify-center h-[120px]",children:b.jsx("p",{className:"text-[12px] text-[#94A3B8]",children:"No amenity usage data available"})})})]})})}Mn.register(lo,co,fl,jr,Vr);function Ece({data:e=[]}){const t=[{level:"L1",open_count:55,in_progress_count:22,on_hold:15,closed_count:6},{level:"L2",open_count:45,in_progress_count:25,on_hold:18,closed_count:5},{level:"L3",open_count:58,in_progress_count:23,on_hold:14,closed_count:6}],n=e.length>0?e:t,r=[],i=[],o=[],a=[],s=[];for(let u=0;u<n.length;u++)r.push(n[u].level),i.push(Number(n[u].open_count)),o.push(Number(n[u].in_progress_count)),a.push(Number(n[u].on_hold)),s.push(Number(n[u].closed_count));const l={labels:r,datasets:[{label:"Open",data:i,backgroundColor:"#3B82F6",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"In Progress",data:o,backgroundColor:"#F59E0B",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"On-Hold",data:a,backgroundColor:"#64748B",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"Closed",data:s,backgroundColor:"#EF4444",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"}]},c={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,pointStyle:"rectRot",padding:20,color:"#64748B"}},tooltip:{backgroundColor:"#0F172A",titleColor:"#fff",bodyColor:"#fff"}},scales:{x:{stacked:!0,grid:{display:!1},ticks:{color:"#64748B"}},y:{stacked:!0,beginAtZero:!0,grid:{display:!1,color:"#E5E7EB",borderDash:[4,4],drawBorder:!1},ticks:{color:"#64748B"}}}};return b.jsx(Ne,{className:"h-[267px]",title:b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(M3,{className:"!text-[20px] text-[#3C81F6]"}),b.jsx("span",{className:"font-semibold",children:"Ticket Escalation Levels"})]}),period:b.jsx("span",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Today"}),children:b.jsx("div",{className:"h-full",children:b.jsx(pl,{data:l,options:c})})})}const Oce=({active:e,payload:t})=>!e||!t||!t.length?null:b.jsxs("div",{style:{backgroundColor:"#000000",color:"#ffffff",padding:"8px 10px",borderRadius:"8px",fontSize:"12px"},children:[b.jsx("div",{className:"font-medium",children:t[0].name}),b.jsx("div",{children:t[0].value})]});function Pce({data:e=null}){const n=e||{open:12,on_hold:5,cancelled:3,completed:156,in_progress:8,total_complaints:184},r=a=>{const s=Number(a);return isNaN(s)?0:s},i=[{name:"Completed",value:r(n.completed),color:"#10B981"},{name:"Open",value:r(n.open),color:"#3B82F6"},{name:"In Progress",value:r(n.in_progress),color:"#F59E0B"},{name:"On Hold",value:r(n.on_hold),color:"#6B7280"},{name:"Cancelled",value:r(n.cancelled),color:"#EF4444"}],o=r(n.total_complaints);return b.jsx(Ne,{className:"h-[267px]",title:b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(rv,{className:"!text-[20px] text-[#EF4444]"}),b.jsx("div",{className:"font-medium text-[#121212]",children:"Ticket Status"})]}),period:b.jsx("span",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Today"}),children:b.jsxs("div",{className:"flex h-full items-center gap-4",children:[b.jsxs("div",{className:"w-[202px] h-[170px] relative",children:[b.jsx(xi,{width:"100%",height:"100%",children:b.jsxs(bu,{children:[b.jsx(il,{data:i,innerRadius:55,outerRadius:85,dataKey:"value",stroke:"#FFFFFF",strokeWidth:2,children:i.map((a,s)=>b.jsx(Br,{fill:a.color},s))}),b.jsx(bi,{content:b.jsx(Oce,{}),wrapperStyle:{zIndex:1e3}})]})}),b.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[b.jsxs("div",{className:"flex items-baseline text-[18px] leading-[22px] font-medium text-[#121212]",children:[b.jsx("div",{children:r(n.completed)}),b.jsxs("div",{className:"text-[18.18px] leading-[22.22px] text-[#121212]",children:["/",o]})]}),b.jsx("div",{className:"text-[10.1px] leading-[14.14px] text-[#64748B]",children:"Completed"})]})]}),b.jsx("div",{className:"flex-1 space-y-2",children:i.map(a=>b.jsxs("div",{className:"flex items-center justify-between text-sm",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx("div",{className:"h-[7px] w-[16px]",style:{backgroundColor:a.color}}),b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:a.name})]}),b.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px] font-medium",children:a.value})]},a.name))})]})})}const C2={visitorSummary:{totalVisitorsToday:150,peakTime:"2:00 - 4:00PM",peakCount:50,activeWalkins:18,preApprovedCheckins:3},popupData:{walkins:{currently_inside:18,total_visited_today:58},preApproved:{completed_visits:3,total_expected_today:5}},chartData:[{hour:"10 AM",walkins:22,preApproved:30},{hour:"12 PM",walkins:15,preApproved:28},{hour:"2 PM",walkins:30,preApproved:38},{hour:"4 PM",walkins:45,preApproved:50},{hour:"6 PM",walkins:25,preApproved:40}]};function k2({title:e,color:t,rows:n,children:r}){const i=b.jsxs("div",{className:"bg-white rounded-xl min-w-[260px] p-4 ",children:[b.jsxs("div",{className:"flex items-center gap-2 font-medium text-[#121212]",children:[b.jsx(Mp,{className:`text-[20px] ${t}`}),b.jsx("div",{children:e})]}),b.jsx("div",{className:"mt-3 pt-3 border-t border-dashed border-gray-200 space-y-2",children:n.map(({label:o,value:a,valueColor:s})=>b.jsxs("div",{className:"flex justify-between text-[14px]",children:[b.jsx("div",{children:o}),b.jsx("div",{className:"font-semibold",style:{color:s||"#121212"},children:a})]},o))})]});return b.jsx(JN,{content:i,placement:"right-start",interactive:!0,delay:[100,0],offset:[6,0],appendTo:()=>document.body,theme:"light-border",maxWidth:"none",children:r})}function Cce({data:e}){const t=e&&Object.keys(e).length?e:C2,n=t.visitorSummary,r=t.popupData,i=k.useMemo(()=>{const a=t.chartData||[];if(!a.length)return C2.chartData;const s=[];for(let l=0;l<a.length;l++)s.push({time:a[l].hour,walkins:a[l].walkins,approved:a[l].preApproved});return s},[t]),o=new Date().toLocaleTimeString("en-IN",{hour:"2-digit",minute:"2-digit",hour12:!0});return b.jsx(Ne,{className:"h-[377px]",title:b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(Mp,{className:"!text-[20px] text-[#8B5CF6]"}),b.jsx("div",{className:"font-medium text-[#121212]",children:"Visitor Updates"})]}),period:b.jsxs("div",{className:"flex items-center gap-1 text-[12px] text-[#64748B]",children:[b.jsx("div",{className:"h-[5px] w-[5px] rounded-full bg-[#12B981]"}),b.jsxs("div",{children:["Today at ",o]})]}),children:b.jsxs("div",{className:"flex flex-col mt-2",children:[b.jsxs("div",{className:"grid grid-cols-2 gap-y-4 gap-x-6 mb-6",children:[b.jsxs("div",{children:[b.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Total Visitors"}),b.jsx("div",{className:"text-[20px] font-medium text-[#08B6D4]",children:n.totalVisitorsToday})]}),b.jsxs("div",{children:[b.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Peak Time"}),b.jsx("div",{className:"text-[20px] font-medium text-[#8B5CF6]",children:n.peakTime})]}),b.jsxs("div",{className:"mt-2",children:[b.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Active Walk-ins"}),b.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[b.jsx("div",{className:"text-[28px] text-[#1FA05B] leading-[32px]",children:r.walkins.currently_inside}),b.jsx(k2,{title:"Active Walk-ins",color:"text-[#1FA05B]",rows:[{label:"Currently Inside",value:r.walkins.currently_inside,valueColor:"#1FA05B"},{label:"Total Visited Today",value:r.walkins.total_visited_today}],children:b.jsxs("div",{className:"text-gray-400 cursor-pointer ml-1 leading-[32px]",children:["/",r.walkins.total_visited_today]})})]})]}),b.jsxs("div",{className:"mt-2",children:[b.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Pre-approved Check-ins"}),b.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[b.jsx("div",{className:"text-[28px] text-[#E7A015] leading-[32px]",children:r.preApproved.completed_visits}),b.jsx(k2,{title:"Pre-approved Check-ins",color:"text-[#E7A015]",rows:[{label:"Completed Visits",value:r.preApproved.completed_visits,valueColor:"#E7A015"},{label:"Total Expected Check-ins Today",value:r.preApproved.total_expected_today}],children:b.jsxs("div",{className:"text-gray-400 cursor-pointer ml-1 leading-[32px]",children:["/",r.preApproved.total_expected_today]})})]})]})]}),b.jsx("div",{className:"w-full h-[179px]",children:b.jsx(xi,{width:"100%",height:"100%",children:b.jsxs(B0,{data:i,children:[b.jsx(ol,{stroke:"#E5E7EB",strokeDasharray:"4 4",vertical:!1}),b.jsx(al,{dataKey:"time",axisLine:!1,tickLine:!1,tick:{fill:"#121212",fontSize:12}}),b.jsx($a,{width:30,axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12}}),b.jsx(bi,{}),b.jsx(Co,{type:"monotone",dataKey:"walkins",stroke:"#22C55E",strokeWidth:2,dot:!1}),b.jsx(Co,{type:"monotone",dataKey:"approved",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"5 5",dot:!1})]})})})]})})}exports.Accounting=Mle;exports.Amenities=Sce;exports.AssetValueBreakdown=Lle;exports.BlockWiseOccupancy=kle;exports.Budgets=Nle;exports.Card=Ne;exports.CashBankBalance=jle;exports.CommercialOccupancy=xce;exports.Community=fre;exports.Complaints=Zle;exports.ComplaintsByLevel=rce;exports.DuesAgeing=Rle;exports.EmployeeFootfall=wce;exports.Engagement=pre;exports.EngagementStatsGrid=bce;exports.EventsUtilisation=pce;exports.ExpenseCategories=Ile;exports.Facilities=hre;exports.FinanceSummary=mre;exports.FoodBeverages=_ce;exports.GateAndSecurityStatsGrid=Gle;exports.GateUpdates=eie;exports.GuardPatrols=Vle;exports.Header=g3;exports.Helpdesk=tie;exports.HelpdeskStatsGrid=fce;exports.HourlyTrafficFlow=Hle;exports.IncidentReports=Yle;exports.IncomeExpenditure=Vj;exports.MainHeader=T3;exports.MoveInOutTrends=Tle;exports.NoticeBoardStatus=hce;exports.OccupancyOverview=Ole;exports.RequestBox=oce;exports.ResidentOverview=Cle;exports.RevenuebyCategory=Fle;exports.SingleStats=gce;exports.StaffAttendance=Ule;exports.StatsGrid=zle;exports.TicketEscalation=Ece;exports.TicketStatus=Pce;exports.UnitStatus=Ele;exports.VisitorUpdates=Cce;
276
+ `):e}function ile(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 a2(e,t){const n=e.chart.ctx,{body:r,footer:i,title:o}=e,{boxWidth:a,boxHeight:s}=t,l=Yn(t.bodyFont),c=Yn(t.titleFont),u=Yn(t.footerFont),d=o.length,f=i.length,p=r.length,m=Wr(t.padding);let h=m.height,g=0,y=r.reduce((x,_)=>x+_.before.length+_.lines.length+_.after.length,0);if(y+=e.beforeBody.length+e.afterBody.length,d&&(h+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),y){const x=t.displayColors?Math.max(s,l.lineHeight):l.lineHeight;h+=p*x+(y-p)*l.lineHeight+(y-1)*t.bodySpacing}f&&(h+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let S=0;const w=function(x){g=Math.max(g,n.measureText(x).width+S)};return n.save(),n.font=c.string,Ge(e.title,w),n.font=l.string,Ge(e.beforeBody.concat(e.afterBody),w),S=t.displayColors?a+2+t.boxPadding:0,Ge(r,x=>{Ge(x.before,w),Ge(x.lines,w),Ge(x.after,w)}),S=0,n.font=u.string,Ge(e.footer,w),n.restore(),g+=m.width,{width:g,height:h}}function ole(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function ale(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 sle(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"),ale(c,e,t,n)&&(c="center"),c}function s2(e,t,n){const r=n.yAlign||t.yAlign||ole(e,n);return{xAlign:n.xAlign||t.xAlign||sle(e,t,n,r),yAlign:r}}function lle(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function cle(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function l2(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:f,bottomRight:p}=xs(a);let m=lle(t,s);const h=cle(t,l,c);return l==="center"?s==="left"?m+=c:s==="right"&&(m-=c):s==="left"?m-=Math.max(u,f)+i:s==="right"&&(m+=Math.max(d,p)+i),{x:bn(m,0,r.width-t.width),y:bn(h,0,r.height-t.height)}}function Sd(e,t,n){const r=Wr(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function c2(e){return qr([],ki(e))}function ule(e,t,n){return qa(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function u2(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const $j={beforeTitle:Pi,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:Pi,beforeBody:Pi,beforeLabel:Pi,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 He(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:Pi,afterBody:Pi,beforeFooter:Pi,footer:Pi,afterFooter:Pi};function In(e,t,n,r){const i=e[t].call(n,r);return typeof i>"u"?$j[t].call(n,r):i}class d2 extends Ko{static positioners=Zl;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 Sj(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=ule(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=In(r,"beforeTitle",this,t),o=In(r,"title",this,t),a=In(r,"afterTitle",this,t);let s=[];return s=qr(s,ki(i)),s=qr(s,ki(o)),s=qr(s,ki(a)),s}getBeforeBody(t,n){return c2(In(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return Ge(t,o=>{const a={before:[],lines:[],after:[]},s=u2(r,o);qr(a.before,ki(In(s,"beforeLabel",this,o))),qr(a.lines,In(s,"label",this,o)),qr(a.after,ki(In(s,"afterLabel",this,o))),i.push(a)}),i}getAfterBody(t,n){return c2(In(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=In(r,"beforeFooter",this,t),o=In(r,"footer",this,t),a=In(r,"afterFooter",this,t);let s=[];return s=qr(s,ki(i)),s=qr(s,ki(o)),s=qr(s,ki(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(ile(this.chart,n[l]));return t.filter&&(s=s.filter((u,d,f)=>t.filter(u,d,f,r))),t.itemSort&&(s=s.sort((u,d)=>t.itemSort(u,d,r))),Ge(s,u=>{const d=u2(t.callbacks,u);i.push(In(d,"labelColor",this,u)),o.push(In(d,"labelPointStyle",this,u)),a.push(In(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=Zl[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=a2(this,r),c=Object.assign({},s,l),u=s2(this.chart,r,c),d=l2(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}=xs(s),{x:f,y:p}=t,{width:m,height:h}=n;let g,y,S,w,x,_;return o==="center"?(x=p+h/2,i==="left"?(g=f,y=g-a,w=x+a,_=x-a):(g=f+m,y=g+a,w=x-a,_=x+a),S=g):(i==="left"?y=f+Math.max(l,u)+a:i==="right"?y=f+m-Math.max(c,d)-a:y=this.caretX,o==="top"?(w=p,x=w-a,g=y-a,S=y+a):(w=p+h,x=w+a,g=y+a,S=y-a),_=w),{x1:g,x2:y,x3:S,y1:w,y2:x,y3:_}}drawTitle(t,n,r){const i=this.title,o=i.length;let a,s,l;if(o){const c=ws(r.rtl,this.x,this.width);for(t.x=Sd(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",a=Yn(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=Yn(o.bodyFont),d=Sd(this,"left",o),f=i.x(d),p=l<u.lineHeight?(u.lineHeight-l)/2:0,m=n.y+p;if(o.usePointStyle){const h={radius:Math.min(c,l)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},g=i.leftForLtr(f,c)+c/2,y=m+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,cy(t,h,g,y),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,cy(t,h,g,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 h=i.leftForLtr(f,c),g=i.leftForLtr(i.xPlus(f,1),c-2),y=xs(a.borderRadius);Object.values(y).some(S=>S!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ep(t,{x:h,y:m,w:c,h:l,radius:y}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),ep(t,{x:g,y:m+1,w:c-2,h:l-2,radius:y}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(h,m,c,l),t.strokeRect(h,m,c,l),t.fillStyle=a.backgroundColor,t.fillRect(g,m+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=Yn(r.bodyFont);let f=d.lineHeight,p=0;const m=ws(r.rtl,this.x,this.width),h=function(D){n.fillText(D,m.x(t.x+p),t.y+f/2),t.y+=f+o},g=m.textAlign(a);let y,S,w,x,_,E,C;for(n.textAlign=a,n.textBaseline="middle",n.font=d.string,t.x=Sd(this,g,r),n.fillStyle=r.bodyColor,Ge(this.beforeBody,h),p=s&&g!=="right"?a==="center"?c/2+u:c+2+u:0,x=0,E=i.length;x<E;++x){for(y=i[x],S=this.labelTextColors[x],n.fillStyle=S,Ge(y.before,h),w=y.lines,s&&w.length&&(this._drawColorBox(n,t,x,m,r),f=Math.max(d.lineHeight,l)),_=0,C=w.length;_<C;++_)h(w[_]),f=d.lineHeight;Ge(y.after,h)}p=0,f=d.lineHeight,Ge(this.afterBody,h),t.y-=o}drawFooter(t,n,r){const i=this.footer,o=i.length;let a,s;if(o){const l=ws(r.rtl,this.x,this.width);for(t.x=Sd(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",a=Yn(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:f,bottomLeft:p,bottomRight:m}=xs(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-f,l),n.quadraticCurveTo(s+c,l,s+c,l+f),a==="center"&&o==="right"&&this.drawCaret(t,n,r,i),n.lineTo(s+c,l+u-m),n.quadraticCurveTo(s+c,l+u,s+c-m,l+u),a==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(s+p,l+u),n.quadraticCurveTo(s,l+u,s,l+u-p),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=Zl[t.position].call(this,this._active,this._eventPosition);if(!a)return;const s=this._size=a2(this,t),l=Object.assign({},a,this._size),c=s2(n,t,l),u=l2(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=Wr(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),xj(t,n.textDirection),o.y+=a.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),wj(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=!Xf(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||!Xf(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=Zl[o.position].call(this,t,n);return a!==!1&&(r!==a.x||i!==a.y)}}var jr={id:"tooltip",_element:d2,positioners:Zl,afterInit(e,t,n){n&&(e.tooltip=new d2({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:$j},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 dle=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function fle(e,t,n,r){const i=e.indexOf(t);if(i===-1)return dle(e,t,n,r);const o=e.lastIndexOf(t);return i!==o?n:i}const ple=(e,t)=>e===null?null:bn(Math.round(e),0,t);function f2(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class lo extends dl{static id="category";static defaults={ticks:{callback:f2}};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(He(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:fle(r,t,Se(n,t),this._addedLabels),ple(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 f2.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 hle(e,t){const n=[],{bounds:i,step:o,min:a,max:s,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=e,p=o||1,m=u-1,{min:h,max:g}=t,y=!He(a),S=!He(s),w=!He(c),x=(g-h)/(d+1);let _=pP((g-h)/m/p)*p,E,C,D,A;if(_<1e-14&&!y&&!S)return[{value:h},{value:g}];A=Math.ceil(g/_)-Math.floor(h/_),A>m&&(_=pP(A*_/m/p)*p),He(l)||(E=Math.pow(10,l),_=Math.ceil(_*E)/E),i==="ticks"?(C=Math.floor(h/_)*_,D=Math.ceil(g/_)*_):(C=h,D=g),y&&S&&o&&Rie((s-a)/o,_/1e3)?(A=Math.round(Math.min((s-a)/_,u)),_=(s-a)/A,C=a,D=s):w?(C=y?a:C,D=S?s:D,A=c-1,_=(D-C)/A):(A=(D-C)/_,lc(A,Math.round(A),_/1e3)?A=Math.round(A):A=Math.ceil(A));const R=Math.max(hP(_),hP(C));E=Math.pow(10,He(l)?R:l),C=Math.round(C*E)/E,D=Math.round(D*E)/E;let T=0;for(y&&(f&&C!==a?(n.push({value:a}),C<a&&T++,lc(Math.round((C+T*_)*E)/E,a,p2(a,x,e))&&T++):C<a&&T++);T<A;++T){const O=Math.round((C+T*_)*E)/E;if(S&&O>s)break;n.push({value:O})}return S&&f&&D!==s?n.length&&lc(n[n.length-1].value,s,p2(s,x,e))?n[n.length-1].value=s:n.push({value:s}):(!S||D===s)&&n.push({value:D}),n}function p2(e,t,{horizontal:n,minRotation:r}){const i=Li(r),o=(n?Math.sin(i):Math.cos(i))||.001,a=.75*t*(""+e).length;return Math.min(t/o,a)}class mle extends dl{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 He(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=di(i),c=di(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=hle(i,o);return t.bounds==="ticks"&&Iie(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 fx(t,this.chart.options.locale,this.options.ticks.format)}}class co extends mle{static id="linear";static defaults={ticks:{callback:fj.formatters.numeric}};determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Ar(t)?t:0,this.max=Ar(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Li(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 _h={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}},zn=Object.keys(_h);function h2(e,t){return e-t}function m2(e,t){if(He(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)),Ar(a)||(a=typeof r=="string"?n.parse(a,r):n.parse(a)),a===null?null:(i&&(a=i==="week"&&(Bc(o)||o===!0)?n.startOf(a,"isoWeek",o):n.startOf(a,i)),+a)}function g2(e,t,n,r){const i=zn.length;for(let o=zn.indexOf(e);o<i-1;++o){const a=_h[zn[o]],s=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-t)/(s*a.size))<=r)return zn[o]}return zn[i-1]}function gle(e,t,n,r,i){for(let o=zn.length-1;o>=zn.indexOf(n);o--){const a=zn[o];if(_h[a].common&&e._adapter.diff(i,r,a)>=t-1)return a}return zn[n?zn.indexOf(n):0]}function vle(e){for(let t=zn.indexOf(e)+1,n=zn.length;t<n;++t)if(_h[zn[t]].common)return zn[t]}function v2(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=ux(n,t),o=n[r]>=t?n[r]:n[i];e[o]=!0}}function yle(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 y2(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:yle(e,r,i,n)}class b2 extends dl{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 Eae._date(t.adapters.date);i.init(n),sc(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:m2(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=Ar(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),o=Ar(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=Wie(i,o,a);return this._unit=n.unit||(r.autoSkip?g2(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):gle(this,s.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:vle(this._unit),this.initOffsets(i),t.reverse&&s.reverse(),y2(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=bn(n,0,a),r=bn(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||g2(o.minUnit,n,r,this._getLabelCapacity(n)),s=Se(i.ticks.stepSize,1),l=a==="week"?o.isoWeekday:!1,c=Bc(l)||l===!0,u={};let d=n,f,p;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 m=i.ticks.source==="data"&&this.getDataTimestamps();for(f=d,p=0;f<r;f=+t.add(f,s,a),p++)v2(u,f,m);return(f===r||i.bounds==="ticks"||p===1)&&v2(u,f,m),Object.keys(u).sort(h2).map(h=>+h)}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 ct(a,[t,n,r],this);const s=o.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&s[l],d=c&&s[c],f=r[n],p=c&&d&&f&&f.major;return this._adapter.format(t,i||(p?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=Li(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,y2(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(m2(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return lj(t.sort(h2))}}function Ed(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}=wa(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}=wa(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 Gce extends b2{static id="timeseries";static defaults=b2.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=Ed(n,this.min),this._tableRange=Ed(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(Ed(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Ed(this._table,r*this._tableRange+this._minPos,!0)}}const Bj="label";function x2(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function ble(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function Wj(e,t){e.labels=t}function zj(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Bj;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 xle(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Bj;const n={labels:[],datasets:[]};return Wj(n,e.labels),zj(n,e.datasets,t),n}function wle(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,...f}=e,p=k.useRef(null),m=k.useRef(null),h=()=>{p.current&&(m.current=new Mn(p.current,{type:a,data:xle(s,o),options:l&&{...l},plugins:c}),x2(t,m.current))},g=()=>{x2(t,null),m.current&&(m.current.destroy(),m.current=null)};return k.useEffect(()=>{!i&&m.current&&l&&ble(m.current,l)},[i,l]),k.useEffect(()=>{!i&&m.current&&Wj(m.current.config.data,s.labels)},[i,s.labels]),k.useEffect(()=>{!i&&m.current&&s.datasets&&zj(m.current.config.data,s.datasets,o)},[i,s.datasets]),k.useEffect(()=>{m.current&&(i?(g(),setTimeout(h)):m.current.update(d))},[i,l,s.labels,s.datasets,d]),k.useEffect(()=>{m.current&&(g(),setTimeout(h))},[a]),k.useEffect(()=>(h(),()=>g()),[]),k.createElement("canvas",{ref:p,role:"img",height:n,width:r,...f},u)}const _le=k.forwardRef(wle);function Ox(e,t){return Mn.register(t),k.forwardRef((n,r)=>k.createElement(_le,{...n,ref:r,type:e}))}const Px=Ox("line",Sae),pl=Ox("bar",xae),Cx=Ox("doughnut",_ae);Mn.register(_x,jr,Vr);const Sle={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:f="#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=f,r.font=`500 ${u}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(l,o,a+12),r.restore()}},Ele=({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 b.jsx(Ne,{title:"Unit Status",period:"This Month",icon:b.jsx(zy,{className:"h-6 w-6 text-green-600"}),className:"h-[238px]",children:b.jsxs("div",{className:"grid grid-cols-12 gap-[16px] items-center",children:[b.jsxs("div",{className:"col-span-5 space-y-3",children:[b.jsxs("div",{children:[b.jsx("div",{className:"!text-[12px] lending-[16px] text-[#64748B]",children:"Sold"}),b.jsx("div",{className:"text-[28px] leading-[32px] text-[#1FA05B]",children:e})]}),b.jsxs("div",{children:[b.jsx("div",{className:"!text-[12px] lending-[16px] text-[#64748B]",children:"Unsold"}),b.jsx("div",{className:"text-[28px] leading-[32px] text-[#EF4444]",children:t})]}),b.jsxs("div",{className:"text-[10px] text-[#1FA05B] flex gap-[8px] items-center ",children:[n," ",b.jsx("div",{className:"text-[#64748B] text-[10px]",children:"Compared to last month"})]})]}),b.jsx("div",{className:"col-span-7",children:b.jsx("div",{className:"h-[158px] w-[158px] ml-auto mr-2",children:b.jsx(Cx,{data:i,options:o,plugins:[Sle]})})})]})})},w2=({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 b.jsxs("div",{className:"flex flex-col items-start",children:[b.jsx("div",{className:"w-2/3 min-w-[80px] h-3 rounded-full overflow-hidden",children:b.jsx("div",{className:`h-3 rounded-full ${n}`,style:{width:`${i}%`}})}),b.jsx("div",{className:`${o} !text-[12px] font-bold mt-1`,children:e}),b.jsx("div",{className:"!text-[12px] text-[#64748B] mt-1",children:r})]})},_2=({title:e,value:t,suffix:n,valueClass:r=""})=>b.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:[b.jsx("div",{className:"!text-[12px] leading-[16px] text-[#121212] mb-1",children:e}),b.jsxs("div",{className:`text-[28px] leading-[32px] flex item gap-[4px] font-medium ${r}`,children:[t," ",n&&b.jsx("div",{className:"text-[28px] leading-[32px] font-medium",children:n})]})]}),Ole=({totalUnits:e=847,occupiedUnits:t=756,ownerCount:n=700,tenantCount:r=56,avgResidents:i=4.4,avgLeaseMonths:o=18})=>{const a=n+r;return b.jsxs("div",{children:[b.jsxs("div",{className:"bg-white border border-[#EBEBEB] rounded-xl shadow-[0_0_12px_0_#EAF2FF] p-4 h-[128px]",children:[b.jsxs("div",{className:"flex items-center gap-[12px] mb-4",children:[b.jsx(Hy,{className:"h-6 w-6 text-[#329DFF]"}),b.jsx("div",{className:"font-medium text-[#121212]",children:"Occupancy Overview"})]}),b.jsxs("div",{className:"flex items-center justify-between gap-",children:[b.jsxs("div",{children:[b.jsx("div",{className:"text-xs leading-[16px] text-[#64748B]",children:"Occupied Units"}),b.jsxs("div",{className:"flex items-center gap-1",children:[b.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),b.jsxs("div",{className:"text-[#64748B] text-[20px] leading-[32px]",children:["/",e]})]})]}),b.jsxs("div",{className:"flex items-end",children:[b.jsx(w2,{value:n,total:a,colorClass:"bg-[#8B5CF6]",label:"Owner"}),b.jsx(w2,{value:r,total:a,colorClass:"bg-[#12B981]",label:"Tenant"})]})]})]}),b.jsxs("div",{className:"mt-2.5 grid grid-cols-2 gap-[12px]",children:[b.jsx(_2,{title:"Avg Residents Per Unit",value:i,valueClass:"text-[#8B5CF6]"}),b.jsx(_2,{title:"Avg Lease Period",value:o,suffix:"months",valueClass:"text-[#E7A015]"})]})]})};Mn.register(_x,jr,Vr);const Ple={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:f="#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=f,r.font=`500 ${u}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(l,o,a+12),r.restore()}},Cle=({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 b.jsx(Ne,{title:"Resident Overview",icon:b.jsx(ik,{className:"h-6 w-6 text-[#8B5CF6]"}),className:"h-[238px]",children:b.jsxs("div",{className:" flex-1 min-h-0 grid grid-cols-12 gap-[16px] items-center",children:[b.jsxs("div",{className:"col-span-5",children:[b.jsxs("div",{children:[b.jsx("div",{className:"!text-[12px] text-[#64748B] leading-[16px]",children:"Total Owners"}),b.jsx("div",{className:"text-[28px] leading-[32px ] text-[#3C81F6]",children:e})]}),b.jsxs("div",{children:[b.jsx("div",{className:"!text-[12px] text-[#64748B] leading-[16px]",children:"Total Tenants"}),b.jsx("div",{className:"text-[28px] leading-[32px ] text-[#08B6D4]",children:t})]}),b.jsxs("div",{className:"text-[10px] text-[#1FA05B] flex gap-2 items-center",children:[r," ",b.jsx("div",{className:"text-[#64748B] ",children:"Compared to last month"})]})]}),b.jsx("div",{className:"col-span-7",children:b.jsx("div",{className:"h-[162px] w-[162px] ml-auto mr-2",children:b.jsx(Cx,{data:a,options:s,plugins:[Ple]})})})]})})};Mn.register(lo,co,fl,jr,Vr);const kle=({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 b.jsx(Ne,{title:"Block-wise Occupancy",period:b.jsx(An,{className:"text-xl text-[#884EA7]"}),className:"w-full h-[360px]",titleWeight:"semi-bold",children:b.jsx(pl,{data:o,options:a})})};Mn.register(lo,co,Ex,Sx,jr,Vr);const Dle=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}`},Tle=({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=>Dle(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 b.jsx(Ne,{title:"Move-in/Out Trends",className:"w-full h-[360px]",period:b.jsx(An,{className:"text-[20px] text-[#884EA7]"}),titleWeight:"semi-bold",children:b.jsx(Px,{data:r,options:i})})};Mn.register(lo,co,Ex,Sx,jr,Vr);const Ale=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}`},Vj=({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=>Ale(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 b.jsx(Px,{data:r,options:i})};function S2({label:e,value:t,positive:n,bgColor:r,delta:i,deltaLabel:o,textColor:a}){return b.jsxs("div",{className:`rounded-lg p-4 ${r} border border-[#EBEBEB] h-[126px]`,children:[b.jsx("div",{className:`text-[16px] leading-[20px] ${a}`,children:e}),b.jsx("div",{className:"mt-[16px] leading-[28px] !text-[24px] font-medium text-[#121212]",children:t}),b.jsxs("div",{className:"mt-[8px] flex items-center gap-[8px] leading-[14px] text-[10px]",children:[b.jsx("div",{className:n?"text-[#1FA05B] font-medium":"text-[#EF4444] font-medium",children:i}),b.jsx("div",{className:"text-[#64748B] ",children:o})]})]})}function Mle(){return b.jsxs(Ne,{title:"Accounting",className:"w-full h-[523px]",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:[b.jsxs("div",{className:"grid grid-cols-2 gap-[16px]",children:[b.jsx(S2,{label:"Total Income",value:"AED 5.68M",delta:"+4.4%",positive:!0,bgColor:"bg-slate-50",deltaLabel:"Compared to last month",textColor:"text-[#1FA05B]"}),b.jsx(S2,{label:"Total Expenditure",value:"AED 1.83M",delta:"-1.1%",positive:!1,bgColor:"bg-slate-50",deltaLabel:"Compared to last month",textColor:"text-[#AB0000]"})]}),b.jsx("div",{className:"h-[254px] mt-[35.5px]",children:b.jsx(Vj,{})})]})}Mn.register(lo,co,fl,jr,Vr);const Nle=()=>{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 b.jsx(Ne,{title:"Budget vs Actuals",className:"w-full h-[362px]",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:b.jsx(pl,{data:r,options:i})})},jle=()=>{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 b.jsxs(Ne,{title:"Cash & Bank Balance",className:"w-full h-[362px]",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),children:[b.jsx("div",{className:"flex flex-col gap-[12px]",children:e.map((r,i)=>b.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-lg p-3",children:[b.jsxs("div",{className:"flex flex-col",children:[b.jsx("div",{className:"text-[14px] font-medium text-[#121212]",children:r.title}),b.jsx("div",{className:"!text-[12px] text-[#64748B]",children:r?.subtitle})]}),b.jsx("div",{className:"flex flex-col items-end",children:b.jsx("div",{className:"text-[14px] text-[#1FA05B] font-semibold",children:n(r.amount)})})]},i))}),b.jsxs("div",{className:"flex items-center justify-between border-t border-[#EBEBEB] h-[68px] px-3",children:[b.jsx("div",{className:"text-[14px] font-medium text-[#121212]",children:"Total"}),b.jsx("div",{className:"text-[16px] text-[#1FA05B] font-bold",children:n(t)})]})]})};Mn.register(lo,co,fl,jr,Vr);const Rle=()=>{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 b.jsxs(Ne,{title:"Dues Ageing",className:"w-full h-[362px]",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:[b.jsx("div",{className:"grid grid-cols-4 md:grid-cols-4 gap-[12px] h-[48px]",children:e.map((o,a)=>b.jsx("div",{className:"p-2 rounded-lg bg-slate-50",children:b.jsxs("div",{className:"flex justify-between items-start",children:[b.jsx("div",{className:"font-medium leading-[16px] !text-[12px] rounded",children:o}),b.jsxs("div",{className:"text-right",children:[b.jsxs("div",{className:"text-red-600 font-medium leading-[16px] !text-[12px]",children:["AED ",(t[a]/1e3).toFixed(1),"K"]}),b.jsxs("div",{className:" text-gray-500 leading-[14px] text-[10px]",children:[n[a]," Units"]})]})]})},o))}),b.jsx("div",{className:"h-[192px]",children:b.jsx(pl,{data:r,options:i})})]})};Mn.register(_x,jr,Vr);const Ile=()=>{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 b.jsxs(Ne,{title:"Expense Categories",className:"w-full h-[523px]",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:[b.jsxs("div",{className:"relative h-[259px] flex justify-center items-center",children:[b.jsx(Cx,{data:n,options:i}),b.jsxs("div",{className:"absolute text-center",children:[b.jsxs("div",{className:"!text-[24px] font-medium leading-[28px] text-[#121212]",children:["AED ",(r/1e6).toFixed(2),"M"]}),b.jsx("div",{className:"text-[#121212] leading-[18px] text-[14px]",children:"Total Expenses"})]})]}),b.jsx("div",{className:"space-y-2",children:e.map((o,a)=>b.jsxs("div",{className:"flex justify-between items-center text-[14px] pb-2",children:[b.jsxs("div",{className:"flex items-center gap-[8px] !text-[12px] leading-[16px] text-[#64748B]",children:[b.jsx("div",{className:"w-[7px] h-[7px] rotate-45",style:{backgroundColor:n.datasets[0].backgroundColor[a]}}),o]}),b.jsxs("div",{className:"leading-[16px] !text-[12px] text-[#64748B]",children:["AED ",(t[a]/1e3).toFixed(0),"K"]})]},o))})]})},Bl=[{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 Lle(){const e=Bl.reduce((t,n)=>t+n.value,0);return b.jsx(Ne,{title:"Asset Value Breakdown",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"h-[362px]",titleWeight:"semi-bold",children:b.jsxs("div",{className:"flex flex-col items-center justify-center",children:[b.jsxs("div",{className:"w-[214px] h-[181px] relative",children:[b.jsx(xi,{width:"100%",height:"100%",children:b.jsxs(bu,{children:[b.jsx(il,{data:Bl,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:Bl.map((t,n)=>b.jsx(Br,{fill:t.color},`cell-${n}`))}),b.jsx(bi,{formatter:t=>`AED ${t.toLocaleString()}`})]})}),b.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[b.jsxs("div",{className:"font-medium text-lg leading-[12px] ",children:["AED ",(e/1e6).toFixed(2),"M"]}),b.jsx("div",{className:"text-[10px] leading-[12.59px] text-[#121212] mt-[6px]",children:"Total Assets"})]})]}),b.jsxs("div",{className:"flex justify-between w-full px-4 sm:px-8 mt-4 text-[14px]",children:[b.jsx("div",{className:"flex flex-col gap-[8px]",children:Bl.slice(0,3).map(t=>b.jsxs("div",{className:"flex items-center gap-[8px]",children:[b.jsx("div",{className:"inline-block h-[7px] w-[7px] rotate-45",style:{backgroundColor:t.color}}),b.jsx("div",{className:"text-[#64748B] leading-[16px] !text-[12px]",children:t.name})]},t.name))}),b.jsx("div",{className:"flex flex-col gap-[8px] items-start",children:Bl.slice(3).map(t=>b.jsxs("div",{className:"flex items-center gap-[8px]",children:[b.jsx("div",{className:"inline-block h-[7px] w-[7px] rotate-45",style:{backgroundColor:t.color}}),b.jsx("div",{className:"text-[#64748B] leading-[16px] !text-[12px]",children:t.name})]},t.name))})]})]})})}Mn.register(lo,co,fl,jr,Vr);const Fle=()=>{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 b.jsx(Ne,{title:"Revenue by Category",className:"w-full h-[362px]",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:b.jsx(pl,{data:r,options:i})})};function $le(e){return Ze({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 Ble(e){return Ze({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 Wle({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=Kc,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return b.jsxs(Ne,{title:e,icon:b.jsx("div",{className:"h-6 w-6 grid place-items-center",children:b.jsx(o,{className:`h-6 w-6 ${a}`})}),children:[b.jsx("div",{className:"text-4xl font-semibold tracking-tight text-[#121212]",children:t}),b.jsxs("div",{className:"flex items-center gap-[8px] text-[14px]",children:[b.jsx("div",{className:i?"text-emerald-600 font-medium":"text-rose-600 font-medium",children:n}),b.jsx("div",{className:"text-slate-500",children:r})]})]})}function zle(){const e=[{title:"Total Bookings",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:rk,iconColor:"text-emerald-600"},{title:"Utilisation Rate",value:73,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Ble,iconColor:"text-[#329DFF]"},{title:"Revenue",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:$le,iconColor:"text-[#FA7E28]"},{title:"Pending Dues",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:ok,iconColor:"text-[#DBB467]"}];return b.jsx("div",{className:"px-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:e.map((t,n)=>b.jsx(Wle,{...t},n))})}const Od=[{name:"Completed",value:46,color:"#12B981"},{name:"Delayed",value:2,color:"#EF4444"},{name:"Missed",value:2,color:"#F69E0A"}];function Vle(){const t=Od.find(n=>n.name==="Completed")?.value||0;return b.jsx(Ne,{title:"Guard Patrols",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"h-[362px]",children:b.jsxs("div",{className:"flex flex-col items-center justify-center",children:[b.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[b.jsx(xi,{width:"100%",height:"100%",children:b.jsxs(bu,{children:[b.jsx(il,{data:Od,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:Od.map((n,r)=>b.jsx(Br,{fill:n.color},`cell-${r}`))}),b.jsx(bi,{formatter:n=>n.toLocaleString()})]})}),b.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[b.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px] ",children:[t,"/",50]}),b.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),b.jsx("div",{className:"flex flex-col gap-[8px] mt-3 w-full px-6 text-[14px]",children:Od.map(n=>b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsxs("div",{className:"flex items-center gap-[8px]",children:[b.jsx("div",{className:"inline-block w-[7px] h-[7px] rotate-45",style:{backgroundColor:n.color}}),b.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:n.name})]}),b.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:n.value})]},n.name))})]})})}Mn.register(lo,co,Ex,Sx,jr,Vr);const Hle=()=>{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 b.jsx(Ne,{title:"Hourly Traffic Flow",className:"w-full h-[362px]",period:b.jsx(An,{className:"text-[20px] text-[#884EA7]"}),children:b.jsx(Px,{data:t,options:n})})};function Yle(){return b.jsx(Ne,{title:"Incident Reports",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"h-[362px]",children:b.jsxs("div",{children:[b.jsxs("div",{className:"flex w-full text-center gap-[24px]",children:[b.jsxs("div",{className:"flex-1 py-3 bg-[#FBF4F4] h-[76px] rounded",children:[b.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#AB0000]",children:"3"}),b.jsx("div",{className:"!text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),b.jsxs("div",{className:"flex-1 py-3 bg-[#FFFBF2] h-[76px] rounded",children:[b.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#E7A015]",children:"5"}),b.jsx("div",{className:"!text-[12px] leading-[16px] text-[#E7A015]",children:"In-progress"})]}),b.jsxs("div",{className:"flex-1 py-3 bg-[#F7FEFA] h-[76px] rounded",children:[b.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:"12"}),b.jsx("div",{className:"!text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),b.jsxs("div",{className:"mt-4 ",children:[b.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#FAFBFD] rounded-md border border-[#FAFBFD]",children:[b.jsxs("div",{className:"flex items-center gap-[8px]",children:[b.jsx("div",{className:"w-4 h-4 rounded-full flex items-center justify-center bg-[#AB0000]",children:b.jsx("div",{className:"text-white !text-[12px] font-bold",children:"!"})}),b.jsx("div",{className:"text-gray-700 font-medium",children:"INC 001"})]}),b.jsxs("div",{className:"px-3 py-1 rounded-full !text-[12px] font-semibold flex items-center gap-[4px] text-[#AB0000] bg-red-50",children:[b.jsx("div",{children:"4 - Danger"}),b.jsx("div",{className:"w-2 h-2 rounded-full bg-[#AB0000]"})]})]}),b.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#FAFBFD] rounded-md border border-[#FAFBFD]",children:[b.jsxs("div",{className:"flex items-center gap-[8px]",children:[b.jsx("div",{className:"w-4 h-4 rounded-full flex items-center justify-center bg-[#E7A015]",children:b.jsx(vw,{className:"text-white text-[10px]"})}),b.jsx("div",{className:"text-gray-700 font-medium",children:"INC 002"})]}),b.jsxs("div",{className:"px-3 py-1 rounded-full !text-[12px] font-semibold flex items-center gap-[4px] text-[#E7A015] bg-yellow-50",children:[b.jsx("div",{children:"3 - High"}),b.jsx("div",{className:"w-2 h-2 rounded-full bg-[#E7A015]"})]})]}),b.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#FAFBFD] rounded-md border border-[#FAFBFD]",children:[b.jsxs("div",{className:"flex items-center gap-[8px]",children:[b.jsx("div",{className:"w-4 h-4 rounded-full flex items-center justify-center bg-[#1FA05B]",children:b.jsx(vw,{className:"text-white text-[10px]"})}),b.jsx("div",{className:"text-gray-700 font-medium",children:"INC 003"})]}),b.jsxs("div",{className:"px-3 py-1 rounded-full !text-[12px] font-semibold flex items-center gap-[4px] text-[#1FA05B] bg-green-50",children:[b.jsx("div",{children:"1 - Low"}),b.jsx("div",{className:"w-2 h-2 rounded-full bg-[#1FA05B]"})]})]})]})]})})}function Ule(){return b.jsx(Ne,{title:"Staff Attendance",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"h-[362px]",children:b.jsxs("div",{children:[b.jsxs("div",{className:"flex w-full text-center h-[76px] gap-[16px] mb-2",children:[b.jsxs("div",{className:"flex-1 py-4 bg-green-50 rounded-md",children:[b.jsx("div",{className:"!text-[24px] leading-[18px] font-medium text-[#1FA05B] pb-[8px]",children:"25"}),b.jsx("div",{className:"!text-[12px] leading-[16px] text-[#1FA05B]",children:"Present"})]}),b.jsxs("div",{className:"flex-1 py-4 bg-red-50 rounded-md",children:[b.jsx("div",{className:"!text-[24px] leading-[18px] font-medium text-[#AB0000] pb-[8px]",children:"1"}),b.jsx("div",{className:"!text-[12px] leading-[16px] text-[#AB0000]",children:"Absent"})]})]}),b.jsxs("div",{className:"mt-[24px] ",children:[b.jsxs("div",{className:"flex justify-between items-center p-3 bg-[#FAFBFD] rounded-md",children:[b.jsx("div",{className:" font-medium !text-[12px] leading-[18px]",children:"Security guards"}),b.jsx("div",{className:"text-[#64748B] leading[20px] text-[14px]",children:"12/12 Present"})]}),b.jsxs("div",{className:"flex justify-between items-center p-3 bg-[#FAFBFD] rounded-md",children:[b.jsx("div",{className:" font-medium !text-[12px] leading-[18px]",children:"Housekeeping"}),b.jsx("div",{className:"text-[#64748B] leading[20px] text-[14px]",children:"7/8 Present"})]}),b.jsxs("div",{className:"flex justify-between items-center p-3 bg-[#FAFBFD] rounded-md",children:[b.jsx("div",{className:" font-medium !text-[12px] leading-[18px]",children:"Maintenance"}),b.jsx("div",{className:"text-[#64748B] leading[20px] text-[14px]",children:"4/4 Present"})]}),b.jsxs("div",{className:"flex justify-between items-center p-3 bg-[#FAFBFD] rounded-md",children:[b.jsx("div",{className:" font-medium !text-[12px] leading-[18px]",children:"Gardening"}),b.jsx("div",{className:"text-[#64748B] leading[20px] text-[14px]",children:"2/2 Present"})]})]})]})})}function Kle(e){return Ze({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 qle({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=Kc,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return b.jsxs(Ne,{title:e,icon:b.jsx("div",{className:"h-6 w-6 grid place-items-center",children:b.jsx(o,{className:`h-6 w-6 ${a}`})}),children:[b.jsx("div",{className:"text-4xl font-semibold tracking-tight text-[#121212]",children:t}),b.jsxs("div",{className:"flex items-center gap-[8px] text-[14px]",children:[b.jsx("div",{className:i?"text-emerald-600 font-medium":"text-rose-600 font-medium",children:n}),b.jsx("div",{className:"text-slate-500",children:r})]})]})}function Gle(){const e=[{title:"Total Visitors",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Hy,iconColor:"text-[#329DFF]"},{title:"Active Incidents",value:73,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:dre,iconColor:"text-[#F69E0A]"},{title:"Missed Patrols",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Kle,iconColor:"text-[#AB0000]"},{title:"Parking Usage",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:P3,iconColor:"text-[#36AB6C]"}];return b.jsx("div",{className:"px-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:e.map((t,n)=>b.jsx(qle,{...t},n))})}const Xle=[{title:"Maintenance",total:12,pending:3},{title:"Security",total:8,pending:1},{title:"Housekeeping",total:6,pending:2},{title:"Utilities",total:10,pending:4}],Qle=(e="")=>e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/<[^>]*>/g,"").trim();function Zle({data:e}){const t=Array.isArray(e?.complaints_by_category)&&e.complaints_by_category.length>0?e.complaints_by_category.map(n=>({title:Qle(n.category_name)||"—",total:n.total||0,pending:n.pending||0})):Xle;return b.jsx(Ne,{title:"Complaints",className:"h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:b.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((n,r)=>b.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-lg p-3 h-[62px]",children:[b.jsxs("div",{className:"flex flex-col",children:[b.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),b.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),b.jsxs("div",{className:"flex flex-col items-end",children:[b.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},r))})})}const Jle=e=>{const t={0:"𝟎",1:"𝟏",2:"𝟐",3:"𝟑",4:"𝟒",5:"𝟓",6:"𝟔",7:"𝟕",8:"𝟖",9:"𝟗"};return String(e).split("").map(n=>t[n]||n).join("")},ece=[{level:"Level 1",open_count:3,in_progress_count:4,closed_count:5,total:12},{level:"Level 2",open_count:1,in_progress_count:1,closed_count:1,total:3},{level:"Level 3",open_count:5,in_progress_count:2,closed_count:3,total:10}],tce=({active:e,payload:t,label:n})=>{if(!e||!t)return null;const r=[{key:"open_count",label:"Open",color:"#EF4444"},{key:"in_progress_count",label:"In Progress",color:"#F59D0D"},{key:"closed_count",label:"Closed",color:"#12B981"}];return b.jsxs("div",{style:{backgroundColor:"#0B0B0B",padding:"14px 40px 14px 18px",borderRadius:"10px",color:"#ffffff"},children:[b.jsx("div",{style:{color:"#ffffff",fontSize:"12px",fontWeight:"900",marginBottom:"10px"},children:n}),r.map((i,o)=>{const a=t[0]?.payload[i.key]||0,s=Jle(a);return b.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:o<r.length-1?"8px":"0",fontSize:"12px"},children:[b.jsx("div",{style:{width:"8px",height:"8px",backgroundColor:i.color,transform:"rotate(45deg)",marginRight:"8px"}}),b.jsx("span",{style:{color:"D1D3D4",minWidth:"100px"},children:i.label}),b.jsx("span",{style:{marginLeft:"auto",fontWeight:"700"},children:s})]},i.key)})]})},nce=()=>{const e=[{label:"Open",color:"#EF4444"},{label:"In Progress",color:"#F59D0D"},{label:"Closed",color:"#12B981"}];return b.jsx("div",{style:{display:"flex",justifyContent:"space-between",gap:"15px"},children:e.map(t=>b.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[b.jsx("div",{style:{width:"6px",height:"6px",backgroundColor:t.color,transform:"rotate(45deg)"}}),b.jsx("span",{style:{fontSize:"14px"},children:t.label})]},t.label))})},rce=({data:e})=>{const t=k.useMemo(()=>(Array.isArray(e?.complaints_by_level)&&e.complaints_by_level.some(l=>Number(l.total)>0)?e.complaints_by_level:ece).map(l=>({level:l.level||"—",open_count:Number(l.open_count)||0,in_progress_count:Number(l.in_progress_count)||0,closed_count:Number(l.closed_count)||0,total:Number(l.total)||0})),[e]),n=k.useMemo(()=>Math.max(...t.map(a=>a.total),5),[t]),r=Math.ceil(n*1.2),i=6,o=Math.max(Math.ceil(n/i),1);return b.jsxs(Ne,{title:"Complaints by Level",className:"w-full h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:[b.jsx(xi,{width:"100%",height:"85%",children:b.jsxs(KM,{data:t,margin:{top:5,right:-25,left:-30,bottom:5},children:[b.jsx(ol,{strokeDasharray:"0",vertical:!1}),b.jsx(al,{dataKey:"level"}),b.jsx($a,{domain:[0,r],ticks:Array.from({length:i+1},(a,s)=>s*o)}),b.jsx(bi,{content:b.jsx(tce,{}),cursor:!1}),b.jsx(nc,{dataKey:"open_count",stackId:"a",fill:"#EF4444",barSize:44,radius:[0,0,0,0]}),b.jsx(nc,{dataKey:"in_progress_count",stackId:"a",fill:"#F59D0D",barSize:44,radius:[0,0,0,0]}),b.jsx(nc,{dataKey:"closed_count",stackId:"a",fill:"#12B981",barSize:44,radius:[0,0,0,0]})]})}),b.jsx(nce,{})]})},ice=[{title:"Maintenance",total:18,pending:4},{title:"Security",total:11,pending:2},{title:"Housekeeping",total:9,pending:3},{title:"Utilities",total:14,pending:5}];function oce({data:e}){const t=Array.isArray(e?.request_box_by_type)&&e.request_box_by_type.length>0?e.request_box_by_type.map(n=>({title:n.category_name||"—",total:Number(n.total)||0,pending:Number(n.pending)||0})):ice;return b.jsx(Ne,{title:"Request Box",className:"h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:b.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((n,r)=>b.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-lg p-3 h-[62px]",children:[b.jsxs("div",{className:"flex flex-col",children:[b.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),b.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),b.jsxs("div",{className:"flex flex-col items-end",children:[b.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},`${n.title}-${r}`))})})}function ace(e){return Ze({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)}const sce=["open_complaints","pending_requests","avg_response_time","resolution_rate"],lce={open_complaints:{title:"Open Complaints",Icon:rk,iconColor:"#AB0000",deltaLabel:"Compared to last month"},pending_requests:{title:"Pending Requests",Icon:ace,iconColor:"#E7A015",deltaLabel:"Compared to last month"},avg_response_time:{title:"Avg Response Time",Icon:R3,iconColor:"#1FA05B",deltaLabel:"Compared to last month"},resolution_rate:{title:"Resolution Rate",Icon:A3,iconColor:"#329DFF",deltaLabel:"Compared to last month"}},cce=({children:e,size:t=28,lineHeight:n=32,weight:r=500,color:i="#121212"})=>b.jsx("div",{style:{fontWeight:r,fontSize:`${t}px`,lineHeight:`${n}px`,color:i},children:e}),uce={primary:{size:28,lineHeight:32,weight:500}},dce={open_complaints:{current:24,trend_percent:"-8%",direction:"bad"},pending_requests:{current:17,trend_percent:"-5%",direction:"bad"},avg_response_time:{current:"2.4 h",trend_percent:"+6%",direction:"good"},resolution_rate:{current:"89%",trend_percent:"+4%",direction:"good"}};function fce({id:e,data:t}){return e&&t&&!t[e]&&t.current!==void 0?b.jsx(E2,{id:e,data:t}):b.jsx("div",{className:"px-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:sce.map(n=>b.jsx(E2,{id:n},n))})}function E2({id:e,data:t}){const n=lce[e];if(!n)return null;const r=(d,f)=>f==null?"—":d==="avg_response_time"?typeof f=="number"?`${f} h`:f:d==="resolution_rate"&&typeof f=="number"?`${f}%`:f,{title:i,Icon:o=Kc,iconColor:a,deltaLabel:s}=n,l=t&&Object.keys(t).length>0?t:dce[e],c=r(e,l?.current),u=l?.trend_percent??"—";return l?.direction==="good"||l?.direction,b.jsx("div",{className:"h-[132px]",children:b.jsxs(Ne,{title:i,titleColor:a,icon:b.jsx("div",{className:"h-[20px] w-[20px] flex items-center justify-center",children:b.jsx(o,{className:"h-[20px] w-[20px]",style:{color:a}})}),childrenClassName:"!space-y-[12px]",iconClassName:"!gap-[12px]",children:[b.jsx(cce,{...uce.primary,children:c}),b.jsxs("div",{className:"flex items-center gap-[8px] text-[12px] leading-[16px]",children:[b.jsx(Yy,{value:u}),b.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:s})]})]})})}function O2({title:e,date:t,rsvp:n,utilisation:r,status:i}){return b.jsxs("div",{className:" bg-[#F8FAFC] h-[106px] px-3 mt-3",children:[b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsx("div",{className:"text-[16px] leading-[20px] font-semibold text-[#121212]",children:e}),b.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})]}),b.jsx("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:t}),b.jsxs("div",{className:"flex justify-between items-center mt-2",children:[b.jsxs("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:[n," RSVP"]}),b.jsxs("div",{className:"text-[#3C82F6] text-[14px] leading-[18px] font-medium",children:[r,"% utilisation"]})]}),b.jsx("div",{className:"w-full bg-[#F8FAFC] h-[6px] rounded mt-2 mb-3",children:b.jsx("div",{className:"h-[6px] rounded bg-[#3C82F6]",style:{width:`${r}%`}})})]})}function pce(){return b.jsx(Ne,{title:"Events Utilisation",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"w-full h-[360px]",children:b.jsxs("div",{children:[b.jsx(O2,{title:"Holi Celebration",date:"25 Jun 2025",rsvp:"78/100",utilisation:71,status:"Upcoming"}),b.jsx(O2,{title:"Maintenance Meeting",date:"25 Jun 2025",rsvp:"45/60",utilisation:75,status:"Completed"})]})})}function Pd({label:e,value:t,subLabel:n,bgColor:r,textColor:i}){return b.jsxs("div",{className:`rounded-lg p-4 ${r} h-[124px]`,children:[b.jsx("div",{className:`text-[16px] font-medium ${i} leading-[20px]`,children:e}),b.jsx("div",{className:"mt-4 text-[28px] leading-[32px] font-semibold text-[#121212]",children:t}),b.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-2",children:n})]})}function hce(){return b.jsx(Ne,{title:"Notice Board Status",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"w-full h-[360px]",children:b.jsxs("div",{className:"grid grid-cols-2 gap-[16px]",children:[b.jsx(Pd,{label:"Active",value:138,subLabel:"3 expiring soon",bgColor:"bg-[#F0FFF7]",textColor:"text-[#1FA05B]"}),b.jsx(Pd,{label:"Scheduled",value:13,subLabel:"4 this week",bgColor:"bg-[#FFFBF2]",textColor:"text-[#E7A015]"}),b.jsx(Pd,{label:"Recurring",value:3,subLabel:"All active",bgColor:"bg-[#EDF6FF]",textColor:"text-[#329DFF]"}),b.jsx(Pd,{label:"Expired",value:7,subLabel:"4 recent",bgColor:"bg-[#F6F6F6]",textColor:"text-[#64748B]"})]})})}function Hj(e){return Ze({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 mce({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=Kc,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return b.jsx(Ne,{title:e,icon:b.jsx("div",{className:`h-6 w-6 grid place-items-center rounded-md ${s}`,children:b.jsx(o,{className:`h-4 w-4 ${a}`})}),className:"h-[132px]",children:b.jsxs("div",{children:[b.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),b.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[b.jsx("div",{className:i?"text-[#1FA05B] font-medium":"text-rose-600 font-medium",children:n}),b.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}function gce({data:e}){const t=[{title:e?.title||"Total Bookings",value:145,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Hj,iconColor:"text-emerald-600",iconBg:"bg-emerald-50"}];return b.jsx("div",{className:"h-full",children:t.map((n,r)=>b.jsx(mce,{...n},r))})}function vce(e){return Ze({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 yce({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=Kc,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return b.jsx(Ne,{title:e,icon:b.jsx("div",{className:`h-6 w-6 grid place-items-center rounded-md ${s}`,children:b.jsx(o,{className:`h-4 w-4 ${a}`})}),className:"h-[132px]",children:b.jsxs("div",{children:[b.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),b.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[b.jsx("div",{className:i?"text-[#1FA05B] font-medium":"text-rose-600 font-medium",children:n}),b.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}function bce(){const e=[{title:"Notice",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Hj,iconColor:"text-emerald-600",iconBg:"bg-emerald-50"},{title:"Post",value:83,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:C3,iconColor:"text-[#329DFF]",iconBg:"bg-emerald-50"},{title:"Poll",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:cre,iconColor:"text-[#FA7E28]",iconBg:"bg-orange-100"},{title:"Poll",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:vce,iconColor:"text-[#DBB467]",iconBg:"bg-yellow-100"}];return b.jsx("div",{className:"px-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:e.map((t,n)=>b.jsx(yce,{...t},n))})}const P2=({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 b.jsxs("div",{className:"flex flex-col items-start",children:[b.jsx("div",{className:"w-2/3 min-w-[80px] h-3 rounded-full overflow-hidden",children:b.jsx("div",{className:`h-[11px] rounded-full ${n}`,style:{width:n==="bg-[#12B981]"?`${i+45}%`:`${i}%`}})}),b.jsx("div",{className:`${o} !text-[12px] font-bold mt-1`,children:e}),b.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-1",children:r})]})},xce=({occupiedUnits:e=9e3,EmployeesCount:t=8910,AdminsCount:n=90})=>{const r=t+n;return b.jsx("div",{children:b.jsxs("div",{className:"bg-white !border-[0.5px] !border-[#EBEBEB] rounded-xl shadow-[0_0_12px_0_#EAF2FF] p-4 h-[128px]",children:[b.jsxs("div",{className:"flex items-center gap-[12px] h-[20px]",style:{marginBottom:"24px"},children:[b.jsx(Hy,{className:"!text-[20px] text-[#329DFF]"}),b.jsx("div",{className:"font-medium text-[#121212]",children:"Occupancy Overview"})]}),b.jsxs("div",{className:"flex items-start justify-between",children:[b.jsxs("div",{children:[b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B] font-normal",children:"Total Occupants"}),b.jsx("div",{className:"flex items-center gap-1",children:b.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:e})})]}),b.jsxs("div",{className:"flex items-end",children:[b.jsx(P2,{value:t,total:r,colorClass:"bg-[#8B5CF6]",label:"Employees"}),b.jsx(P2,{value:n,total:r,colorClass:"bg-[#12B981]",label:"Admins"})]})]})]})})};Mn.register(lo,co,fl,jr);const wce=()=>{const t={labels:["HP","Adobe","Anarock","Swiggy","Infosys","Zepto"],datasets:[{data:[2e3,1700,1500,1200,900,800],backgroundColor:["#329DFF","#EF4645","#8A2E64","#F69E0A","#A2BB40","#8B5CF6"],barThickness:34}]},n={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#fff",bodyColor:"#fff",displayColors:!1,callbacks:{label:r=>`Employees: ${r.parsed.y}`}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B",font:{size:12}}},y:{beginAtZero:!0,max:2e3,ticks:{stepSize:500,color:"#64748B"},grid:{display:!1,color:"#E5E7EB",borderDash:[4,4],drawBorder:!1}}}};return b.jsxs(Ne,{className:"w-full h-[238px]",title:b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(T5,{className:"!text-[20px] text-[#8B5CF6]"}),b.jsx("div",{className:"font-medium text-[#121212]",children:"Employee Footfall"})]}),period:b.jsx("span",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Today"}),children:[b.jsxs("div",{style:{marginBottom:"16px",marginTop:"8px"},children:[b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Employees Inside"}),b.jsx("div",{className:"text-[20px] leading-[24px] font-medium text-[#1FA05B]",children:"7,500"})]}),b.jsx("div",{className:"h-[97px]",children:b.jsx(pl,{data:t,options:n})})]})};function _ce(){return b.jsx(Ne,{className:"h-[324px]",title:b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(D5,{className:"!text-[20px] text-[#FA7E28]"}),b.jsx("div",{className:"font-semibold",children:"Food & Beverages"})]}),period:b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Today"}),children:b.jsxs("div",{className:"flex flex-col h-full",children:[b.jsxs("div",{className:"grid grid-cols-2 gap-6 mb-6",children:[b.jsxs("div",{children:[b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Orders"}),b.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:"247"})]}),b.jsxs("div",{children:[b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Revenue Generated"}),b.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF]",children:"₹ 82K"}),b.jsx("div",{className:"inline-block mt-2 text-[10px] leading-[14px] text-[#1FA05B] bg-green-50 px-2 py-1 rounded-full",children:"+8% from last month"})]})]}),b.jsxs("div",{className:"space-y-5",children:[b.jsxs("div",{children:[b.jsxs("div",{className:"flex justify-between text-sm mb-2",children:[b.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:"HP"}),b.jsxs("div",{className:"font-medium text-[12px] leading-[16px] flex items-center",children:[b.jsx("div",{className:"text-[#64748B] inline-block",children:"120 orders"}),b.jsx("div",{className:"mx-2 text-[#121212] inline-block",children:"₹ 45K"})]})]}),b.jsx("div",{className:"h-3 bg-gray-100 rounded-full",children:b.jsx("div",{className:"h-3 bg-blue-500 rounded-full",style:{width:"70%"}})})]}),b.jsxs("div",{children:[b.jsxs("div",{className:"flex justify-between text-sm mb-2",children:[b.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:"Adobe"}),b.jsxs("div",{className:"font-medium text-[12px] leading-[16px] flex items-center",children:[b.jsx("div",{className:"text-[#64748B] inline-block",children:"85 orders"}),b.jsx("div",{className:"mx-2 text-[#121212] inline-block",children:"₹ 23K"})]})]}),b.jsx("div",{className:"h-3 bg-gray-100 rounded-full",children:b.jsx("div",{className:"h-3 bg-red-500 rounded-full",style:{width:"50%"}})})]}),b.jsxs("div",{children:[b.jsxs("div",{className:"flex justify-between text-sm mb-2",children:[b.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:"Anarock"}),b.jsxs("div",{className:"font-medium text-[12px] leading-[16px] flex items-center",children:[b.jsx("div",{className:"text-[#64748B] inline-block",children:"42 orders"}),b.jsx("div",{className:"mx-2 text-[#121212] inline-block",children:"₹ 14K"})]})]}),b.jsx("div",{className:"h-3 bg-gray-100 rounded-full",children:b.jsx("div",{className:"h-3 bg-purple-700 rounded-full",style:{width:"25%"}})})]})]})]})})}function Sce({data:e}){const{amenitySummary:t,chartData:n}=e||{},r=Array.isArray(n)?n:[];return console.log("Amenities data:",t),console.log("Dattttttaaaa",e),b.jsx(Ne,{className:"h-[324px]",title:b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(O3,{className:"!text-[20px] text-[#884EA7]"}),b.jsx("span",{className:"font-semibold",children:"Amenities"})]}),period:b.jsx("span",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Today"}),children:b.jsxs("div",{className:"flex flex-col h-full",children:[b.jsxs("div",{className:"grid grid-cols-2 gap-6 mb-6",children:[b.jsxs("div",{children:[b.jsx("p",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Bookings"}),b.jsx("p",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:t?.totalBookings??0})]}),b.jsxs("div",{children:[b.jsx("p",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Revenue Generated"}),b.jsx("p",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF]",children:t?.todayPaidRevenue??"₹0.0"}),t?.growth&&b.jsxs("span",{className:`inline-block mt-2 text-[10px] leading-[14px] px-2 py-1 rounded-full
277
+ ${t.growth.isPositive?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[t.growth.percentage," ",t.growth.label]})]})]}),b.jsx("div",{className:"space-y-5",children:r.length>0?r.map((i,o)=>b.jsxs("div",{children:[b.jsxs("div",{className:"flex justify-between text-sm mb-2",children:[b.jsx("span",{className:"text-[#64748B] text-[12px] leading-[16px]",children:i.name}),b.jsxs("span",{className:"font-medium text-[12px] leading-[16px]",children:[b.jsxs("span",{className:"text-[#64748B]",children:[i.bookings," bookings"]}),b.jsx("span",{className:"mx-2 text-[#121212]",children:i.revenue})]})]}),b.jsx("div",{className:"h-3 bg-gray-100 rounded-full",children:b.jsx("div",{className:`h-3 rounded-full ${i.color||"bg-slate-400"}`,style:{width:`${i.percentage||0}%`}})})]},o)):b.jsx("div",{className:"flex items-center justify-center h-[120px]",children:b.jsx("p",{className:"text-[12px] text-[#94A3B8]",children:"No amenity usage data available"})})})]})})}Mn.register(lo,co,fl,jr,Vr);function Ece({data:e=[]}){const t=[{level:"L1",open_count:55,in_progress_count:22,on_hold:15,closed_count:6},{level:"L2",open_count:45,in_progress_count:25,on_hold:18,closed_count:5},{level:"L3",open_count:58,in_progress_count:23,on_hold:14,closed_count:6}],n=e.length>0?e:t,r=[],i=[],o=[],a=[],s=[];for(let u=0;u<n.length;u++)r.push(n[u].level),i.push(Number(n[u].open_count)),o.push(Number(n[u].in_progress_count)),a.push(Number(n[u].on_hold)),s.push(Number(n[u].closed_count));const l={labels:r,datasets:[{label:"Open",data:i,backgroundColor:"#3B82F6",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"In Progress",data:o,backgroundColor:"#F59E0B",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"On-Hold",data:a,backgroundColor:"#64748B",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"Cancelled",data:s,backgroundColor:"#EF4444",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"}]},c={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,pointStyle:"rectRot",padding:20,color:"#64748B"}},tooltip:{backgroundColor:"#0F172A",titleColor:"#fff",bodyColor:"#fff"}},scales:{x:{stacked:!0,grid:{display:!1},ticks:{color:"#64748B"}},y:{stacked:!0,beginAtZero:!0,grid:{display:!1,color:"#E5E7EB",borderDash:[4,4],drawBorder:!1},ticks:{color:"#64748B",stepSize:1,precision:0,callback:u=>Math.round(u)}}}};return b.jsx(Ne,{className:"h-[267px]",title:b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(M3,{className:"!text-[20px] text-[#3C81F6]"}),b.jsx("span",{className:"font-semibold",children:"Ticket Escalation Levels"})]}),period:b.jsx("span",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Today"}),children:b.jsx("div",{className:"h-full",children:b.jsx(pl,{data:l,options:c})})})}const Oce=({active:e,payload:t})=>!e||!t||!t.length?null:b.jsxs("div",{style:{backgroundColor:"#000000",color:"#ffffff",padding:"8px 10px",borderRadius:"8px",fontSize:"12px"},children:[b.jsx("div",{className:"font-medium",children:t[0].name}),b.jsx("div",{children:t[0].value})]});function Pce({data:e=null}){const n=e||{open:12,on_hold:5,cancelled:3,completed:156,in_progress:8,total_complaints:184},r=a=>{const s=Number(a);return isNaN(s)?0:s},i=[{name:"Completed",value:r(n.completed),color:"#10B981"},{name:"Open",value:r(n.open),color:"#3B82F6"},{name:"In Progress",value:r(n.in_progress),color:"#F59E0B"},{name:"On Hold",value:r(n.on_hold),color:"#6B7280"},{name:"Cancelled",value:r(n.cancelled),color:"#EF4444"}],o=r(n.total_complaints);return b.jsx(Ne,{className:"h-[267px]",title:b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(rv,{className:"!text-[20px] text-[#EF4444]"}),b.jsx("div",{className:"font-medium text-[#121212]",children:"Ticket Status"})]}),period:b.jsx("span",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Today"}),children:b.jsxs("div",{className:"flex h-full items-center gap-4",children:[b.jsxs("div",{className:"w-[202px] h-[170px] relative",children:[b.jsx(xi,{width:"100%",height:"100%",children:b.jsxs(bu,{children:[b.jsx(il,{data:i,innerRadius:55,outerRadius:85,dataKey:"value",stroke:"#FFFFFF",strokeWidth:2,children:i.map((a,s)=>b.jsx(Br,{fill:a.color},s))}),b.jsx(bi,{content:b.jsx(Oce,{}),wrapperStyle:{zIndex:1e3}})]})}),b.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[b.jsxs("div",{className:"flex items-baseline text-[18px] leading-[22px] font-medium text-[#121212]",children:[b.jsx("div",{children:r(n.completed)}),b.jsxs("div",{className:"text-[18.18px] leading-[22.22px] text-[#121212]",children:["/",o]})]}),b.jsx("div",{className:"text-[10.1px] leading-[14.14px] text-[#64748B]",children:"Completed"})]})]}),b.jsx("div",{className:"flex-1 space-y-2",children:i.map(a=>b.jsxs("div",{className:"flex items-center justify-between text-sm",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx("div",{className:"h-[7px] w-[16px]",style:{backgroundColor:a.color}}),b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:a.name})]}),b.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px] font-medium",children:a.value})]},a.name))})]})})}const C2={visitorSummary:{totalVisitorsToday:150,peakTime:"2:00 - 4:00PM",peakCount:50,activeWalkins:18,preApprovedCheckins:3},popupData:{walkins:{currently_inside:18,total_visited_today:58},preApproved:{completed_visits:3,total_expected_today:5}},chartData:[{hour:"10 AM",walkins:22,preApproved:30},{hour:"12 PM",walkins:15,preApproved:28},{hour:"2 PM",walkins:30,preApproved:38},{hour:"4 PM",walkins:45,preApproved:50},{hour:"6 PM",walkins:25,preApproved:40}]};function k2({title:e,color:t,rows:n,children:r}){const i=b.jsxs("div",{className:"bg-white rounded-xl min-w-[260px] p-4 ",children:[b.jsxs("div",{className:"flex items-center gap-2 font-medium text-[#121212]",children:[b.jsx(Mp,{className:`text-[20px] ${t}`}),b.jsx("div",{children:e})]}),b.jsx("div",{className:"mt-3 pt-3 border-t border-dashed border-gray-200 space-y-2",children:n.map(({label:o,value:a,valueColor:s})=>b.jsxs("div",{className:"flex justify-between text-[14px]",children:[b.jsx("div",{children:o}),b.jsx("div",{className:"font-semibold",style:{color:s||"#121212"},children:a})]},o))})]});return b.jsx(JN,{content:i,placement:"right-start",interactive:!0,delay:[100,0],offset:[6,0],appendTo:()=>document.body,theme:"light-border",maxWidth:"none",children:r})}function Cce({data:e}){const t=e&&Object.keys(e).length?e:C2,n=t.visitorSummary,r=t.popupData,i=k.useMemo(()=>{const a=t.chartData||[];if(!a.length)return C2.chartData;const s=[];for(let l=0;l<a.length;l++)s.push({time:a[l].hour,walkins:a[l].walkins,approved:a[l].preApproved});return s},[t]),o=new Date().toLocaleTimeString("en-IN",{hour:"2-digit",minute:"2-digit",hour12:!0});return b.jsx(Ne,{className:"h-[377px]",title:b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(Mp,{className:"!text-[20px] text-[#8B5CF6]"}),b.jsx("div",{className:"font-medium text-[#121212]",children:"Visitor Updates"})]}),period:b.jsxs("div",{className:"flex items-center gap-1 text-[12px] text-[#64748B]",children:[b.jsx("div",{className:"h-[5px] w-[5px] rounded-full bg-[#12B981]"}),b.jsxs("div",{children:["Today at ",o]})]}),children:b.jsxs("div",{className:"flex flex-col mt-2",children:[b.jsxs("div",{className:"grid grid-cols-2 gap-y-4 gap-x-6 mb-6",children:[b.jsxs("div",{children:[b.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Total Visitors"}),b.jsx("div",{className:"text-[20px] font-medium text-[#08B6D4]",children:n.totalVisitorsToday})]}),b.jsxs("div",{children:[b.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Peak Time"}),b.jsx("div",{className:"text-[20px] font-medium text-[#8B5CF6]",children:n.peakTime})]}),b.jsxs("div",{className:"mt-2",children:[b.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Active Walk-ins"}),b.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[b.jsx("div",{className:"text-[28px] text-[#1FA05B] leading-[32px]",children:r.walkins.currently_inside}),b.jsx(k2,{title:"Active Walk-ins",color:"text-[#1FA05B]",rows:[{label:"Currently Inside",value:r.walkins.currently_inside,valueColor:"#1FA05B"},{label:"Total Visited Today",value:r.walkins.total_visited_today}],children:b.jsxs("div",{className:"text-gray-400 cursor-pointer ml-1 leading-[32px]",children:["/",r.walkins.total_visited_today]})})]})]}),b.jsxs("div",{className:"mt-2",children:[b.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Pre-approved Check-ins"}),b.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[b.jsx("div",{className:"text-[28px] text-[#E7A015] leading-[32px]",children:r.preApproved.completed_visits}),b.jsx(k2,{title:"Pre-approved Check-ins",color:"text-[#E7A015]",rows:[{label:"Completed Visits",value:r.preApproved.completed_visits,valueColor:"#E7A015"},{label:"Total Expected Check-ins Today",value:r.preApproved.total_expected_today}],children:b.jsxs("div",{className:"text-gray-400 cursor-pointer ml-1 leading-[32px]",children:["/",r.preApproved.total_expected_today]})})]})]})]}),b.jsx("div",{className:"w-full h-[179px]",children:b.jsx(xi,{width:"100%",height:"100%",children:b.jsxs(B0,{data:i,children:[b.jsx(ol,{stroke:"#E5E7EB",strokeDasharray:"4 4",vertical:!1}),b.jsx(al,{dataKey:"time",axisLine:!1,tickLine:!1,tick:{fill:"#121212",fontSize:12}}),b.jsx($a,{width:30,axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12}}),b.jsx(bi,{}),b.jsx(Co,{type:"monotone",dataKey:"walkins",stroke:"#22C55E",strokeWidth:2,dot:!1}),b.jsx(Co,{type:"monotone",dataKey:"approved",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"5 5",dot:!1})]})})})]})})}exports.Accounting=Mle;exports.Amenities=Sce;exports.AssetValueBreakdown=Lle;exports.BlockWiseOccupancy=kle;exports.Budgets=Nle;exports.Card=Ne;exports.CashBankBalance=jle;exports.CommercialOccupancy=xce;exports.Community=fre;exports.Complaints=Zle;exports.ComplaintsByLevel=rce;exports.DuesAgeing=Rle;exports.EmployeeFootfall=wce;exports.Engagement=pre;exports.EngagementStatsGrid=bce;exports.EventsUtilisation=pce;exports.ExpenseCategories=Ile;exports.Facilities=hre;exports.FinanceSummary=mre;exports.FoodBeverages=_ce;exports.GateAndSecurityStatsGrid=Gle;exports.GateUpdates=eie;exports.GuardPatrols=Vle;exports.Header=g3;exports.Helpdesk=tie;exports.HelpdeskStatsGrid=fce;exports.HourlyTrafficFlow=Hle;exports.IncidentReports=Yle;exports.IncomeExpenditure=Vj;exports.MainHeader=T3;exports.MoveInOutTrends=Tle;exports.NoticeBoardStatus=hce;exports.OccupancyOverview=Ole;exports.RequestBox=oce;exports.ResidentOverview=Cle;exports.RevenuebyCategory=Fle;exports.SingleStats=gce;exports.StaffAttendance=Ule;exports.StatsGrid=zle;exports.TicketEscalation=Ece;exports.TicketStatus=Pce;exports.UnitStatus=Ele;exports.VisitorUpdates=Cce;