anarock-widgets 1.0.205 → 1.0.206
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 +2 -2
- package/dist/index.es.js +11 -11
- package/dist/index.umd.js +2 -2
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -242,7 +242,7 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
|
|
|
242
242
|
`))}},[on,we,S,w,W]),mn&&(S?mt.length===0?At=null:At=mt.reduce((G,de,he)=>(G.push(de),he<mt.length-1&&G.push(", "),G),[]):At=Ht);let Bn=ue;!a&&ae&&ee&&(Bn=R.clientWidth);let Qt;typeof M<"u"?Qt=M:Qt=d?null:0;const Wn=N.id||(w?`mui-component-select-${w}`:void 0),ye={...t,variant:$,value:W,open:ut,error:p},vn=Wie(ye),Zt={...b.PaperProps,...typeof b.slotProps?.paper=="function"?b.slotProps.paper(ye):b.slotProps?.paper},H={...b.MenuListProps,...typeof b.slotProps?.list=="function"?b.slotProps.list(ye):b.slotProps?.list},le=VP();return v.jsxs(E.Fragment,{children:[v.jsx(Lie,{as:"div",ref:Z,tabIndex:Qt,role:"combobox","aria-controls":ut?le:void 0,"aria-disabled":d?"true":void 0,"aria-expanded":ut?"true":"false","aria-haspopup":"listbox","aria-label":i,"aria-labelledby":[g,Wn].filter(Boolean).join(" ")||void 0,"aria-describedby":r,"aria-required":C?"true":void 0,"aria-invalid":p?"true":void 0,onKeyDown:_t,onMouseDown:d||j?null:te,onBlur:Ye,onFocus:k,...N,ownerState:ye,className:oe(N.className,vn.select,l),id:Wn,children:Bie(At)?D2||(D2=v.jsx("span",{className:"notranslate","aria-hidden":!0,children:""})):At}),v.jsx($ie,{"aria-invalid":p,value:Array.isArray(W)?W.join(","):W,name:w,ref:re,"aria-hidden":!0,onChange:Fe,tabIndex:-1,disabled:d,className:vn.nativeInput,autoFocus:o,required:C,...V,ownerState:ye}),v.jsx(Fie,{as:h,className:vn.icon,ownerState:ye}),v.jsx(_j,{id:`menu-${w||""}`,anchorEl:R,open:ut,onClose:ve,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...b,slotProps:{...b.slotProps,list:{"aria-labelledby":g,role:"listbox","aria-multiselectable":S?"true":void 0,disableListWrap:!0,id:le,...H},paper:{...Zt,style:{minWidth:Bn,...Zt!=null?Zt.style:null}}},children:gn})]})});process.env.NODE_ENV!=="production"&&(kj.propTypes={"aria-describedby":y.string,"aria-label":y.string,autoFocus:y.bool,autoWidth:y.bool,children:y.node,classes:y.object,className:y.string,defaultOpen:y.bool,defaultValue:y.any,disabled:y.bool,displayEmpty:y.bool,error:y.bool,IconComponent:y.elementType.isRequired,inputRef:So,labelId:y.string,MenuProps:y.object,multiple:y.bool,name:y.string,onBlur:y.func,onChange:y.func,onClose:y.func,onFocus:y.func,onOpen:y.func,open:y.bool,readOnly:y.bool,renderValue:y.func,required:y.bool,SelectDisplayProps:y.object,tabIndex:y.oneOfType([y.number,y.string]),type:y.any,value:y.any,variant:y.oneOf(["standard","outlined","filled"])});const zie=e=>{const{classes:t}=e,r=Dn({root:["root"]},Pj,t);return{...t,...r}},Ix={name:"MuiSelect",slot:"Root",shouldForwardProp:e=>mo(e)&&e!=="variant"},Vie=ke(Nx,Ix)(""),Hie=ke(Rx,Ix)(""),Yie=ke(Mx,Ix)(""),Lx=E.forwardRef(function(t,n){const r=rr({name:"MuiSelect",props:t}),{autoWidth:i=!1,children:o,classes:a={},className:s,defaultOpen:l=!1,displayEmpty:c=!1,IconComponent:u=Lre,id:d,input:f,inputProps:p,label:h,labelId:m,MenuProps:g,multiple:b=!1,native:S=!1,onClose:w,onOpen:x,open:_,renderValue:O,SelectDisplayProps:k,variant:D="outlined",...T}=r,j=S?Oj:kj,A=Tx(),C=Dx({props:r,muiFormControl:A,states:["variant","error"]}),N=C.variant||D,M={...r,variant:N,classes:a},I=zie(M),{root:L,...$}=I,V=f||{standard:v.jsx(Vie,{ownerState:M}),outlined:v.jsx(Hie,{label:h,ownerState:M}),filled:v.jsx(Yie,{ownerState:M})}[N],W=In(n,Sl(V));return v.jsx(E.Fragment,{children:E.cloneElement(V,{inputComponent:j,inputProps:{children:o,error:C.error,IconComponent:u,variant:N,type:void 0,multiple:b,...S?{id:d}:{autoWidth:i,defaultOpen:l,displayEmpty:c,labelId:m,MenuProps:g,onClose:w,onOpen:x,open:_,renderValue:O,SelectDisplayProps:{id:d,...k}},...p,classes:p?On($,p.classes):$,...f?f.props.inputProps:{}},...(b&&S||c)&&N==="outlined"?{notched:!0}:{},ref:W,className:oe(V.props.className,s,I.root),...!f&&{variant:N},...T})})});process.env.NODE_ENV!=="production"&&(Lx.propTypes={autoWidth:y.bool,children:y.node,classes:y.object,className:y.string,defaultOpen:y.bool,defaultValue:y.any,displayEmpty:y.bool,IconComponent:y.elementType,id:y.string,input:y.element,inputProps:y.object,label:y.node,labelId:y.string,MenuProps:y.object,multiple:y.bool,native:y.bool,onChange:y.func,onClose:y.func,onOpen:y.func,open:y.bool,renderValue:y.func,SelectDisplayProps:y.object,sx:y.oneOfType([y.arrayOf(y.oneOfType([y.func,y.object,y.bool])),y.func,y.object]),value:y.oneOfType([y.oneOf([""]),y.any]),variant:y.oneOf(["filled","outlined","standard"])});Lx.muiName="Select";function Uie(e){return fn("MuiTooltip",e)}const Pt=Ln("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]);function Kie(e){return Math.round(e*1e5)/1e5}const qie=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${cn(o.split("-")[0])}`],arrow:["arrow"]};return Dn(a,Uie,t)},Gie=ke(kx,{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]}})(Fn(({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"] .${Pt.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${Pt.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${Pt.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${Pt.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:({ownerState:t})=>t.arrow&&!t.isRtl,style:{[`&[data-popper-placement*="right"] .${Pt.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!!t.isRtl,style:{[`&[data-popper-placement*="right"] .${Pt.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!t.isRtl,style:{[`&[data-popper-placement*="left"] .${Pt.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!!t.isRtl,style:{[`&[data-popper-placement*="left"] .${Pt.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}))),Xie=ke("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${cn(n.placement.split("-")[0])}`]]}})(Fn(({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,[`.${Pt.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${Pt.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${Pt.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${Pt.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:`${Kie(16/14)}em`,fontWeight:e.typography.fontWeightRegular}},{props:({ownerState:t})=>!t.isRtl,style:{[`.${Pt.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${Pt.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:({ownerState:t})=>!t.isRtl&&t.touch,style:{[`.${Pt.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${Pt.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:({ownerState:t})=>!!t.isRtl,style:{[`.${Pt.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${Pt.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:({ownerState:t})=>!!t.isRtl&&t.touch,style:{[`.${Pt.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${Pt.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:({ownerState:t})=>t.touch,style:{[`.${Pt.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:({ownerState:t})=>t.touch,style:{[`.${Pt.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]}))),Qie=ke("span",{name:"MuiTooltip",slot:"Arrow"})(Fn(({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 Ed=!1;const T2=new Lh;let Gl={x:0,y:0};function Od(e,t){return(n,...r)=>{t&&t(n,...r),e(n,...r)}}const Dj=E.forwardRef(function(t,n){const r=rr({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:h=100,enterNextDelay:m=0,enterTouchDelay:g=700,followCursor:b=!1,id:S,leaveDelay:w=0,leaveTouchDelay:x=1500,onClose:_,onOpen:O,open:k,placement:D="bottom",PopperComponent:T,PopperProps:j={},slotProps:A={},slots:C={},title:N,TransitionComponent:M,TransitionProps:I,...L}=r,$=E.isValidElement(o)?o:v.jsx("span",{children:o}),V=Wp(),W=eb(),[B,X]=E.useState(),[q,re]=E.useState(null),J=E.useRef(!1),ee=f||b,ie=lc(),ae=lc(),ue=lc(),U=lc(),[K,Z]=_v({controlled:k,default:!1,name:"Tooltip",state:"open"});let R=K;if(process.env.NODE_ENV!=="production"){const{current:be}=E.useRef(k!==void 0);E.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(`
|
|
243
243
|
`))},[N,B,be])}const ge=VP(S),te=E.useRef(),ve=kc(()=>{te.current!==void 0&&(document.body.style.WebkitUserSelect=te.current,te.current=void 0),U.clear()});E.useEffect(()=>ve,[ve]);const we=be=>{T2.clear(),Ed=!0,Z(!0),O&&!R&&O(be)},Fe=kc(be=>{T2.start(800+w,()=>{Ed=!1}),Z(!1),_&&R&&_(be),ie.start(V.transitions.duration.shortest,()=>{J.current=!1})}),st=be=>{J.current&&be.type!=="touchstart"||(B&&B.removeAttribute("title"),ae.clear(),ue.clear(),h||Ed&&m?ae.start(Ed?m:h,()=>{we(be)}):we(be))},_t=be=>{ae.clear(),ue.start(w,()=>{Fe(be)})},[,ut]=E.useState(!1),Ye=be=>{s2(be.target)||(ut(!1),_t(be))},At=be=>{B||X(be.currentTarget),s2(be.target)&&(ut(!0),st(be))},Ht=be=>{J.current=!0;const An=$.props;An.onTouchStart&&An.onTouchStart(be)},mt=be=>{Ht(be),ue.clear(),ie.clear(),ve(),te.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",U.start(g,()=>{document.body.style.WebkitUserSelect=te.current,st(be)})},mn=be=>{$.props.onTouchEnd&&$.props.onTouchEnd(be),ve(),ue.start(x,()=>{Fe(be)})};E.useEffect(()=>{if(!R)return;function be(An){An.key==="Escape"&&Fe(An)}return document.addEventListener("keydown",be),()=>{document.removeEventListener("keydown",be)}},[Fe,R]);const on=In(Sl($),X,n);!N&&N!==0&&(R=!1);const gn=E.useRef(),Bn=be=>{const An=$.props;An.onMouseMove&&An.onMouseMove(be),Gl={x:be.clientX,y:be.clientY},gn.current&&gn.current.update()},Qt={},Wn=typeof N=="string";c?(Qt.title=!R&&Wn&&!d?N:null,Qt["aria-describedby"]=R?ge:null):(Qt["aria-label"]=Wn?N:null,Qt["aria-labelledby"]=R&&!Wn?ge:null);const ye={...Qt,...L,...$.props,className:oe(L.className,$.props.className),onTouchStart:Ht,ref:on,...b?{onMouseMove:Bn}:{}};process.env.NODE_ENV!=="production"&&(ye["data-mui-internal-clone-element"]=!0,E.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(`
|
|
244
244
|
`))},[B]));const vn={};p||(ye.onTouchStart=mt,ye.onTouchEnd=mn),d||(ye.onMouseOver=Od(st,ye.onMouseOver),ye.onMouseLeave=Od(_t,ye.onMouseLeave),ee||(vn.onMouseOver=st,vn.onMouseLeave=_t)),u||(ye.onFocus=Od(At,ye.onFocus),ye.onBlur=Od(Ye,ye.onBlur),ee||(vn.onFocus=At,vn.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(`
|
|
245
|
-
`));const Zt={...r,isRtl:W,arrow:i,disableInteractive:ee,placement:D,PopperComponentProp:T,touch:J.current},H=typeof A.popper=="function"?A.popper(Zt):A.popper,le=E.useMemo(()=>{let be=[{name:"arrow",enabled:!!q,options:{element:q,padding:4}}];return j.popperOptions?.modifiers&&(be=be.concat(j.popperOptions.modifiers)),H?.popperOptions?.modifiers&&(be=be.concat(H.popperOptions.modifiers)),{...j.popperOptions,...H?.popperOptions,modifiers:be}},[q,j.popperOptions,H?.popperOptions]),G=qie(Zt),de=typeof A.transition=="function"?A.transition(Zt):A.transition,he={slots:{popper:s.Popper,transition:s.Transition??M,tooltip:s.Tooltip,arrow:s.Arrow,...C},slotProps:{arrow:A.arrow??l.arrow,popper:{...j,...H??l.popper},tooltip:A.tooltip??l.tooltip,transition:{...I,...de??l.transition}}},[rt,gt]=Qn("popper",{elementType:Gie,externalForwardedProps:he,ownerState:Zt,className:oe(G.popper,j?.className)}),[xr,ko]=Qn("transition",{elementType:qc,externalForwardedProps:he,ownerState:Zt}),[wr,la]=Qn("tooltip",{elementType:Xie,className:G.tooltip,externalForwardedProps:he,ownerState:Zt}),[ji,ei]=Qn("arrow",{elementType:Qie,className:G.arrow,externalForwardedProps:he,ownerState:Zt,ref:re});return v.jsxs(E.Fragment,{children:[E.cloneElement($,ye),v.jsx(rt,{as:T??kx,placement:D,anchorEl:b?{getBoundingClientRect:()=>({top:Gl.y,left:Gl.x,right:Gl.x,bottom:Gl.y,width:0,height:0})}:B,popperRef:gn,open:B?R:!1,id:ge,transition:!0,...vn,...gt,popperOptions:le,children:({TransitionProps:be})=>v.jsx(xr,{timeout:V.transitions.duration.shorter,...be,...ko,children:v.jsxs(wr,{...la,children:[N,i?v.jsx(ji,{...ei}):null]})})})]})});process.env.NODE_ENV!=="production"&&(Dj.propTypes={arrow:y.bool,children:El.isRequired,classes:y.object,className:y.string,components:y.shape({Arrow:y.elementType,Popper:y.elementType,Tooltip:y.elementType,Transition:y.elementType}),componentsProps:y.shape({arrow:y.object,popper:y.object,tooltip:y.object,transition:y.object}),describeChild:y.bool,disableFocusListener:y.bool,disableHoverListener:y.bool,disableInteractive:y.bool,disableTouchListener:y.bool,enterDelay:y.number,enterNextDelay:y.number,enterTouchDelay:y.number,followCursor:y.bool,id:y.string,leaveDelay:y.number,leaveTouchDelay:y.number,onClose:y.func,onOpen:y.func,open:y.bool,placement:y.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:y.elementType,PopperProps:y.object,slotProps:y.shape({arrow:y.oneOfType([y.func,y.object]),popper:y.oneOfType([y.func,y.object]),tooltip:y.oneOfType([y.func,y.object]),transition:y.oneOfType([y.func,y.object])}),slots:y.shape({arrow:y.elementType,popper:y.elementType,tooltip:y.elementType,transition:y.elementType}),sx:y.oneOfType([y.arrayOf(y.oneOfType([y.func,y.object,y.bool])),y.func,y.object]),title:y.node,TransitionComponent:y.elementType,TransitionProps:y.object});function Zie(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 Jie(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 eoe(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)}sf(Lx)(()=>({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 Ol({widgetId:e,options:t=[],defaultValue:n=["all"],onFilterChange:r=()=>{},onExport:i=()=>{}}){const o=JSON.parse(sessionStorage.getItem("community_id"))||[],[a,s]=P.useState(o),[l,c]=P.useState("");t.filter(d=>d.community_name.toLowerCase().includes(l.toLowerCase()));const u=()=>{Xw("widget_id",e),Xw("export",!0),i()};return v.jsx("div",{className:"flex items-center gap-2",children:v.jsx(Dj,{title:"Export CSV for this widget",children:v.jsx("button",{onClick:u,className:"px-3 py-2 bg-[#FBF5FF] rounded cursor-pointer",children:v.jsx(Jie,{className:"stroke-[#884EA7] stroke-[1.4]"})})})})}function toe({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 v.jsx(is,{title:"Community",period:"This Month",icon:v.jsx(Wk,{className:"!text-[24px] text-[#329DFF]"}),className:`${e&&"max-h-[184px]"} h-[184px] mb-4 break-inside-avoid gap-[20px]`,actionButtons:v.jsx(Ol,{widgetId:t?.widget_id,options:t?.communities}),children:v.jsxs("div",{className:"flex",children:[v.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[v.jsxs("div",{className:"flex flex-col gap-[8px]",children:[v.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Move-in/Out Count"}),v.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium !text-[#8B5CF6]",children:n+r})]}),v.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] flex items-center gap-[4px]",children:[v.jsx(bb,{value:l(i,o)}),v.jsx("div",{className:"whitespace-nowrap",children:"Compared to last month"})]})]}),v.jsx("div",{className:"w-[50%] h-[111px] flex justify-end",children:v.jsx(Ft,{width:"75%",height:"100%",children:v.jsxs(_o,{children:[v.jsxs(Mi,{data:s,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:[v.jsx(kn,{fill:a[0]}),v.jsx(kn,{fill:a[1]})]}),v.jsx(Vt,{content:v.jsx(fu,{})})]})})})]})})}function noe({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||t?.total_forum_topics||0),color:r[1]},{name:"Poll",value:Number(t?.total_polls||t?.total_poll_detail||0),color:r[2]},{name:"Survey",value:Number(t?.total_surveys||t?.total_survey_detail||0),color:r[3]}],o=t?.widget==="commercial";return v.jsx(is,{title:"Engagement",period:"This Month",icon:v.jsx(zk,{className:"!text-[24px] text-[#DBB467]"}),className:`${e&&"max-h-[303px]"} ${o?"h-[324px]":"h-[303px]"} gap-[20px]`,actionButtons:!o&&v.jsx(Ol,{widgetId:t?.widget_id,options:t?.communities}),children:v.jsx("div",{className:"w-full h-[235px]",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(oa,{data:i,layout:"vertical",margin:{top:4,right:8,left:0,bottom:0},children:[v.jsx(Hr,{stroke:"#e5e7eb",strokeDasharray:"3 3",horizontal:!1}),v.jsx(nr,{type:"category",dataKey:"name",width:40,axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#121212",fontWeight:400}}),v.jsx(br,{type:"number",allowDecimals:!1,axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#64748B",fontWeight:400}}),v.jsx(Vt,{content:v.jsx(fu,{}),cursor:{fill:"transparent"},wrapperStyle:{outline:"none"},position:{x:160,y:0}}),v.jsx(jn,{dataKey:"value",barSize:40,isAnimationActive:!1,children:i.map((a,s)=>v.jsx(kn,{fill:r[s]},a.name))})]})})})})}function roe({isStatic:e,data:t}){const n=Number(t?.totalBookings||0),r=Number(t?.averageUtilizationPercentage||0),i=P.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 v.jsxs(is,{title:"Facilities",period:"Today",icon:v.jsx(Qp,{className:"!text-[24px] text-[#8B5CF6]"}),className:`${e&&"max-h-[305px]"} h-[305px] mb-4 break-inside-avoid`,actionButtons:v.jsx(Ol,{widgetId:t?.widget_id,options:t?.communities}),children:[v.jsxs("div",{className:"grid grid-cols-2 gap-[24px] mt-[16px] mb-[16px]",children:[v.jsxs("div",{children:[v.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Bookings"}),v.jsx("div",{className:"!text-[24px] font-medium text-[#8B5CF6]",children:n})]}),v.jsxs("div",{children:[v.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Utilisation Rate"}),v.jsxs("div",{className:"!text-[24px] font-medium text-[#329DFF]",children:[r.toFixed(2),"%"]})]})]}),v.jsx("div",{className:"w-full h-[170px]",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(bx,{data:a,margin:{top:5,right:-30,left:-35,bottom:0},children:[v.jsx(Hr,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),v.jsx(br,{dataKey:"time",interval:0,tickFormatter:o,tick:{fontSize:10,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1,minTickGap:0}),v.jsx(nr,{yAxisId:"left",tick:{fontSize:10,fill:"#64748B"},axisLine:!1,tickLine:!1}),v.jsx(nr,{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}),v.jsx(Vt,{content:v.jsx(fu,{})}),v.jsx(Vo,{yAxisId:"left",type:"monotone",dataKey:"bookings",name:"Bookings",stroke:"#8B5CF6",strokeWidth:2,dot:!1,isAnimationActive:!1}),v.jsx(Vo,{yAxisId:"right",type:"monotone",dataKey:"utilization",name:"Utilization Rate",stroke:"#329DFF",strokeWidth:2,dot:!1,strokeDasharray:"2 4",isAnimationActive:!1})]})})})]})}function ioe({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 v.jsx(is,{title:"Income",period:"This Month",icon:v.jsx(Dv,{className:"!text-[24px] text-green-600"}),className:"!gap-[16px] break-inside-avoid h-[232px] overflow-hidden",actionButtons:v.jsx(Ol,{widgetId:e?.widget_id,options:e?.communities}),children:v.jsxs("div",{children:[v.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mb-2",children:[v.jsx("div",{children:"Opening"}),v.jsx("div",{children:"Income"}),v.jsx("div",{children:"Collection"}),v.jsx("div",{children:"Closing"})]}),v.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212] mb-2",children:[v.jsx("div",{children:a(t.opening_balance,t?.currency_type)}),v.jsx("div",{children:a(t.income,t?.currency_type)}),v.jsx("div",{children:a(t.collection,t?.currency_type)}),v.jsx("div",{children:a(t.closing_balance,t?.currency_type)})]}),v.jsx("hr",{className:"my-4 border-t border-dashed border-gray-300"}),v.jsx("div",{className:"flex items-center justify-between",children:v.jsxs("div",{className:"flex items-center gap-[12px]",children:[v.jsx(Dv,{className:"!text-[24px] text-red-600"}),v.jsx("div",{className:"!my-0 !font-medium !text-[16px] !leading-[20px] !text-[#121212]",children:"Expenditure"})]})}),v.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mt-4 mb-2",children:[v.jsx("div",{children:"Opening"}),v.jsx("div",{children:"Expenditure"}),v.jsx("div",{children:"Payment"}),v.jsx("div",{children:"Outstanding"})]}),v.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212]",children:[v.jsx("div",{children:a(n.opening_balance,n?.currency_type)}),v.jsx("div",{children:a(n.expenditure,n?.currency_type)}),v.jsx("div",{children:a(n.payment,n?.currency_type)}),v.jsx("div",{children:a(n.outstanding,n?.currency_type)})]})]})})}var ooe="tippy-box",Aj="tippy-content",aoe="tippy-backdrop",Tj="tippy-arrow",Mj="tippy-svg-arrow",Ea={passive:!0,capture:!0},Nj=function(){return document.body};function soe(e,t){return{}.hasOwnProperty.call(e,t)}function Xg(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function Fx(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function jj(e,t){return typeof e=="function"?e.apply(void 0,t):e}function M2(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function loe(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function coe(e){return e.split(/\s+/).filter(Boolean)}function Cs(e){return[].concat(e)}function N2(e,t){e.indexOf(t)===-1&&e.push(t)}function uoe(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function doe(e){return e.split("-")[0]}function hp(e){return[].slice.call(e)}function j2(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function bc(){return document.createElement("div")}function Gc(e){return["Element","Fragment"].some(function(t){return Fx(e,t)})}function foe(e){return Fx(e,"NodeList")}function poe(e){return Fx(e,"MouseEvent")}function hoe(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function moe(e){return Gc(e)?[e]:foe(e)?hp(e):Array.isArray(e)?e:hp(document.querySelectorAll(e))}function Qg(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function R2(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function goe(e){var t,n=Cs(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function voe(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=doe(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,h=c==="left"?u.right.x:0,m=o.top-r+d>l,g=r-o.bottom-f>l,b=o.left-n+p>l,S=n-o.right-h>l;return m||g||b||S})}function Zg(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function I2(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 ui={isTouch:!1},L2=0;function yoe(){ui.isTouch||(ui.isTouch=!0,window.performance&&document.addEventListener("mousemove",Rj))}function Rj(){var e=performance.now();e-L2<20&&(ui.isTouch=!1,document.removeEventListener("mousemove",Rj)),L2=e}function boe(){var e=document.activeElement;if(hoe(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function xoe(){document.addEventListener("touchstart",yoe,Ea),window.addEventListener("blur",boe)}var woe=typeof window<"u"&&typeof document<"u",_oe=woe?!!window.msCrypto:!1;function xs(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 F2(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function Soe(e){return F2(`
|
|
245
|
+
`));const Zt={...r,isRtl:W,arrow:i,disableInteractive:ee,placement:D,PopperComponentProp:T,touch:J.current},H=typeof A.popper=="function"?A.popper(Zt):A.popper,le=E.useMemo(()=>{let be=[{name:"arrow",enabled:!!q,options:{element:q,padding:4}}];return j.popperOptions?.modifiers&&(be=be.concat(j.popperOptions.modifiers)),H?.popperOptions?.modifiers&&(be=be.concat(H.popperOptions.modifiers)),{...j.popperOptions,...H?.popperOptions,modifiers:be}},[q,j.popperOptions,H?.popperOptions]),G=qie(Zt),de=typeof A.transition=="function"?A.transition(Zt):A.transition,he={slots:{popper:s.Popper,transition:s.Transition??M,tooltip:s.Tooltip,arrow:s.Arrow,...C},slotProps:{arrow:A.arrow??l.arrow,popper:{...j,...H??l.popper},tooltip:A.tooltip??l.tooltip,transition:{...I,...de??l.transition}}},[rt,gt]=Qn("popper",{elementType:Gie,externalForwardedProps:he,ownerState:Zt,className:oe(G.popper,j?.className)}),[xr,ko]=Qn("transition",{elementType:qc,externalForwardedProps:he,ownerState:Zt}),[wr,la]=Qn("tooltip",{elementType:Xie,className:G.tooltip,externalForwardedProps:he,ownerState:Zt}),[ji,ei]=Qn("arrow",{elementType:Qie,className:G.arrow,externalForwardedProps:he,ownerState:Zt,ref:re});return v.jsxs(E.Fragment,{children:[E.cloneElement($,ye),v.jsx(rt,{as:T??kx,placement:D,anchorEl:b?{getBoundingClientRect:()=>({top:Gl.y,left:Gl.x,right:Gl.x,bottom:Gl.y,width:0,height:0})}:B,popperRef:gn,open:B?R:!1,id:ge,transition:!0,...vn,...gt,popperOptions:le,children:({TransitionProps:be})=>v.jsx(xr,{timeout:V.transitions.duration.shorter,...be,...ko,children:v.jsxs(wr,{...la,children:[N,i?v.jsx(ji,{...ei}):null]})})})]})});process.env.NODE_ENV!=="production"&&(Dj.propTypes={arrow:y.bool,children:El.isRequired,classes:y.object,className:y.string,components:y.shape({Arrow:y.elementType,Popper:y.elementType,Tooltip:y.elementType,Transition:y.elementType}),componentsProps:y.shape({arrow:y.object,popper:y.object,tooltip:y.object,transition:y.object}),describeChild:y.bool,disableFocusListener:y.bool,disableHoverListener:y.bool,disableInteractive:y.bool,disableTouchListener:y.bool,enterDelay:y.number,enterNextDelay:y.number,enterTouchDelay:y.number,followCursor:y.bool,id:y.string,leaveDelay:y.number,leaveTouchDelay:y.number,onClose:y.func,onOpen:y.func,open:y.bool,placement:y.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:y.elementType,PopperProps:y.object,slotProps:y.shape({arrow:y.oneOfType([y.func,y.object]),popper:y.oneOfType([y.func,y.object]),tooltip:y.oneOfType([y.func,y.object]),transition:y.oneOfType([y.func,y.object])}),slots:y.shape({arrow:y.elementType,popper:y.elementType,tooltip:y.elementType,transition:y.elementType}),sx:y.oneOfType([y.arrayOf(y.oneOfType([y.func,y.object,y.bool])),y.func,y.object]),title:y.node,TransitionComponent:y.elementType,TransitionProps:y.object});function Zie(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 Jie(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 eoe(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)}sf(Lx)(()=>({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 Ol({widgetId:e,options:t=[],defaultValue:n=["all"],onFilterChange:r=()=>{},onExport:i=()=>{}}){const o=JSON.parse(sessionStorage.getItem("community_id"))||[],[a,s]=P.useState(o),[l,c]=P.useState("");t.filter(d=>d.community_name.toLowerCase().includes(l.toLowerCase()));const u=()=>{Xw("widget_id",e),Xw("export",!0),i()};return v.jsx("div",{className:"flex items-center gap-2",children:v.jsx(Dj,{title:"Export CSV for this widget",children:v.jsx("button",{onClick:u,className:"px-3 py-2 bg-[#FBF5FF] rounded cursor-pointer",children:v.jsx(Jie,{className:"stroke-[#884EA7] stroke-[1.4]"})})})})}function toe({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 v.jsx(is,{title:"Community",period:"This Month",icon:v.jsx(Wk,{className:"!text-[24px] text-[#329DFF]"}),className:`${e&&"max-h-[184px]"} h-[184px] mb-4 break-inside-avoid gap-[20px]`,actionButtons:v.jsx(Ol,{widgetId:t?.widget_id,options:t?.communities}),children:v.jsxs("div",{className:"flex",children:[v.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[v.jsxs("div",{className:"flex flex-col gap-[8px]",children:[v.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Move-in/Out Count"}),v.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium !text-[#8B5CF6]",children:n+r})]}),v.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] flex items-center gap-[4px]",children:[v.jsx(bb,{value:l(i,o)}),v.jsx("div",{className:"whitespace-nowrap",children:"Compared to last month"})]})]}),v.jsx("div",{className:"w-[50%] h-[111px] flex justify-end",children:v.jsx(Ft,{width:"75%",height:"100%",children:v.jsxs(_o,{children:[v.jsxs(Mi,{data:s,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:[v.jsx(kn,{fill:a[0]}),v.jsx(kn,{fill:a[1]})]}),v.jsx(Vt,{content:v.jsx(fu,{})})]})})})]})})}function noe({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||t?.total_forum_topics||0),color:r[1]},{name:"Poll",value:Number(t?.total_polls||t?.total_poll_detail||0),color:r[2]},{name:"Survey",value:Number(t?.total_surveys||t?.total_survey_detail||0),color:r[3]}],o=t?.widget==="commercial";return v.jsx(is,{title:"Engagement",period:"This Month",icon:v.jsx(zk,{className:"!text-[24px] text-[#DBB467]"}),className:`${e&&"max-h-[303px]"} ${o?"h-[324px]":"h-[303px]"} gap-[20px]`,actionButtons:!o&&v.jsx(Ol,{widgetId:t?.widget_id,options:t?.communities}),children:v.jsx("div",{className:"w-full h-[260px]",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(oa,{data:i,layout:"vertical",margin:{top:4,right:8,left:0,bottom:0},children:[v.jsx(Hr,{stroke:"#e5e7eb",strokeDasharray:"3 3",horizontal:!1}),v.jsx(nr,{type:"category",dataKey:"name",width:40,axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#121212",fontWeight:400}}),v.jsx(br,{type:"number",allowDecimals:!1,axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#64748B",fontWeight:400}}),v.jsx(Vt,{content:v.jsx(fu,{}),cursor:{fill:"transparent"},wrapperStyle:{outline:"none"},position:{x:160,y:0}}),v.jsx(jn,{dataKey:"value",barSize:40,isAnimationActive:!1,children:i.map((a,s)=>v.jsx(kn,{fill:r[s]},a.name))})]})})})})}function roe({isStatic:e,data:t}){const n=Number(t?.totalBookings||0),r=Number(t?.averageUtilizationPercentage||0),i=P.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 v.jsxs(is,{title:"Facilities",period:"Today",icon:v.jsx(Qp,{className:"!text-[24px] text-[#8B5CF6]"}),className:`${e&&"max-h-[305px]"} h-[305px] mb-4 break-inside-avoid`,actionButtons:v.jsx(Ol,{widgetId:t?.widget_id,options:t?.communities}),children:[v.jsxs("div",{className:"grid grid-cols-2 gap-[24px] mt-[16px] mb-[16px]",children:[v.jsxs("div",{children:[v.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Bookings"}),v.jsx("div",{className:"!text-[24px] font-medium text-[#8B5CF6]",children:n})]}),v.jsxs("div",{children:[v.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Utilisation Rate"}),v.jsxs("div",{className:"!text-[24px] font-medium text-[#329DFF]",children:[r.toFixed(2),"%"]})]})]}),v.jsx("div",{className:"w-full h-[170px]",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(bx,{data:a,margin:{top:5,right:-30,left:-35,bottom:0},children:[v.jsx(Hr,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),v.jsx(br,{dataKey:"time",interval:0,tickFormatter:o,tick:{fontSize:10,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1,minTickGap:0}),v.jsx(nr,{yAxisId:"left",tick:{fontSize:10,fill:"#64748B"},axisLine:!1,tickLine:!1}),v.jsx(nr,{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}),v.jsx(Vt,{content:v.jsx(fu,{})}),v.jsx(Vo,{yAxisId:"left",type:"monotone",dataKey:"bookings",name:"Bookings",stroke:"#8B5CF6",strokeWidth:2,dot:!1,isAnimationActive:!1}),v.jsx(Vo,{yAxisId:"right",type:"monotone",dataKey:"utilization",name:"Utilization Rate",stroke:"#329DFF",strokeWidth:2,dot:!1,strokeDasharray:"2 4",isAnimationActive:!1})]})})})]})}function ioe({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 v.jsx(is,{title:"Income",period:"This Month",icon:v.jsx(Dv,{className:"!text-[24px] text-green-600"}),className:"!gap-[16px] break-inside-avoid h-[232px] overflow-hidden",actionButtons:v.jsx(Ol,{widgetId:e?.widget_id,options:e?.communities}),children:v.jsxs("div",{children:[v.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mb-2",children:[v.jsx("div",{children:"Opening"}),v.jsx("div",{children:"Income"}),v.jsx("div",{children:"Collection"}),v.jsx("div",{children:"Closing"})]}),v.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212] mb-2",children:[v.jsx("div",{children:a(t.opening_balance,t?.currency_type)}),v.jsx("div",{children:a(t.income,t?.currency_type)}),v.jsx("div",{children:a(t.collection,t?.currency_type)}),v.jsx("div",{children:a(t.closing_balance,t?.currency_type)})]}),v.jsx("hr",{className:"my-4 border-t border-dashed border-gray-300"}),v.jsx("div",{className:"flex items-center justify-between",children:v.jsxs("div",{className:"flex items-center gap-[12px]",children:[v.jsx(Dv,{className:"!text-[24px] text-red-600"}),v.jsx("div",{className:"!my-0 !font-medium !text-[16px] !leading-[20px] !text-[#121212]",children:"Expenditure"})]})}),v.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mt-4 mb-2",children:[v.jsx("div",{children:"Opening"}),v.jsx("div",{children:"Expenditure"}),v.jsx("div",{children:"Payment"}),v.jsx("div",{children:"Outstanding"})]}),v.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212]",children:[v.jsx("div",{children:a(n.opening_balance,n?.currency_type)}),v.jsx("div",{children:a(n.expenditure,n?.currency_type)}),v.jsx("div",{children:a(n.payment,n?.currency_type)}),v.jsx("div",{children:a(n.outstanding,n?.currency_type)})]})]})})}var ooe="tippy-box",Aj="tippy-content",aoe="tippy-backdrop",Tj="tippy-arrow",Mj="tippy-svg-arrow",Ea={passive:!0,capture:!0},Nj=function(){return document.body};function soe(e,t){return{}.hasOwnProperty.call(e,t)}function Xg(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function Fx(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function jj(e,t){return typeof e=="function"?e.apply(void 0,t):e}function M2(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function loe(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function coe(e){return e.split(/\s+/).filter(Boolean)}function Cs(e){return[].concat(e)}function N2(e,t){e.indexOf(t)===-1&&e.push(t)}function uoe(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function doe(e){return e.split("-")[0]}function hp(e){return[].slice.call(e)}function j2(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function bc(){return document.createElement("div")}function Gc(e){return["Element","Fragment"].some(function(t){return Fx(e,t)})}function foe(e){return Fx(e,"NodeList")}function poe(e){return Fx(e,"MouseEvent")}function hoe(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function moe(e){return Gc(e)?[e]:foe(e)?hp(e):Array.isArray(e)?e:hp(document.querySelectorAll(e))}function Qg(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function R2(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function goe(e){var t,n=Cs(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function voe(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=doe(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,h=c==="left"?u.right.x:0,m=o.top-r+d>l,g=r-o.bottom-f>l,b=o.left-n+p>l,S=n-o.right-h>l;return m||g||b||S})}function Zg(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function I2(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 ui={isTouch:!1},L2=0;function yoe(){ui.isTouch||(ui.isTouch=!0,window.performance&&document.addEventListener("mousemove",Rj))}function Rj(){var e=performance.now();e-L2<20&&(ui.isTouch=!1,document.removeEventListener("mousemove",Rj)),L2=e}function boe(){var e=document.activeElement;if(hoe(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function xoe(){document.addEventListener("touchstart",yoe,Ea),window.addEventListener("blur",boe)}var woe=typeof window<"u"&&typeof document<"u",_oe=woe?!!window.msCrypto:!1;function xs(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 F2(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function Soe(e){return F2(`
|
|
246
246
|
%ctippy.js
|
|
247
247
|
|
|
248
248
|
%c`+F2(e)+`
|
|
@@ -364,4 +364,4 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
|
|
|
364
364
|
*
|
|
365
365
|
* This source code is licensed under the ISC license.
|
|
366
366
|
* See the LICENSE file in the root directory of this source tree.
|
|
367
|
-
*/const lde=[["path",{d:"M19 5a2 2 0 0 0-2 2v11",key:"s41o68"}],["path",{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"rd2r6e"}],["path",{d:"M7 13h10",key:"1rwob1"}],["path",{d:"M7 9h10",key:"12czzb"}],["path",{d:"M9 5a2 2 0 0 0-2 2v11",key:"x0q4gh"}]],cde=Co("waves-ladder",lde),dn=({title:e,icon:t,period:n,isDateSelector:r=!1,children:i,footer:o,className:a="",titleWeight:s,titleColor:l,iconClassName:c,titleClassName:u,childrenClassName:d,onCalendarClick:f,onPrevClick:p,onNextClick:h})=>{const m=s==="semi-bold"?600:500;return v.jsxs("div",{className:`relative bg-white rounded-[12px] p-[24px] shadow-[0_0_12px_0_#EAF2FF] ${a}`,children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[t&&v.jsx("div",{className:c,children:t}),v.jsx("div",{style:{fontWeight:m,color:l||"#121212"},className:u||"text-[20px] leading-[24px]",children:e})]}),n&&!r&&v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:n}),r&&v.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 rounded-lg bg-white text-sm text-[#64748B]",children:[v.jsx(Que,{size:16,className:"text-[#64748B] cursor-pointer",onClick:f}),v.jsx(LR,{size:16,className:"cursor-pointer",onClick:p}),v.jsx("span",{className:"text-[12px] leading-[16px] text-[#64748B]",children:n}),v.jsx(FR,{size:16,className:"cursor-pointer",onClick:h})]})]}),v.jsx("div",{className:`flex-1 min-h-0 mt-4 ${d}`,children:i}),o&&v.jsx("div",{className:"mt-4 pt-4 border-t border-gray-100 text-[12px] text-[#64748B]",children:o})]})},ude={completed:18,not_completed:6,missed:4};function dde({data:e={}}){const t=e&&Object.keys(e).length>0?e:ude,n=[{name:"Completed",value:Number(t?.completed??0),color:"#12B981"},{name:"Delayed",value:Number(t?.not_completed??0),color:"#EF4444"},{name:"Missed",value:Number(t?.missed??0),color:"#F69E0A"}],r=Number(t?.completed??0)+Number(t?.not_completed??0)+Number(t?.missed??0),i=Number(t?.completed??0);return v.jsx(dn,{title:"Guard Patrols",className:"h-[362px]",titleWeight:"semi-bold",children:v.jsxs("div",{className:"flex flex-col items-center justify-center",children:[v.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(_o,{children:[v.jsx(Mi,{data:n??[],innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:n?.map?.((o,a)=>v.jsx(kn,{fill:o?.color??"#ccc"},`cell-${a}`))}),v.jsx(Vt,{formatter:o=>Number(o??0).toLocaleString()})]})}),v.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[v.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px]",children:[i??0,"/",r??0]}),v.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),v.jsx("div",{className:"flex flex-col w-full text-[14px]",children:n?.length?n?.map?.((o,a)=>v.jsxs("div",{className:`flex items-center justify-between py-[10px] ${a!==(n?.length??0)-1?"border-b border-[#F1F5F9]":""}`,children:[v.jsxs("div",{className:"flex items-center gap-[10px]",children:[v.jsx("div",{className:"inline-block w-[16px] h-[7px]",style:{backgroundColor:o?.color??"#ccc"}}),v.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:o?.name??"-"})]}),v.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:o?.value??0})]},o?.name??a)):v.jsx("div",{className:"text-center text-gray-400 text-sm py-6",children:"No patrol data"})})]})})}$n.register(Eo,Oo,r1,n1,Yr,Jr);const fde=["10 AM","12 PM","2 PM","4 PM","6 PM","8 PM","10 PM"],Wd={guest:[9,5,12,7,3,6,4],cab:[15,12,10,14,7,12,8],delivery:[22,18,16,20,22,14,17],service:[13,12,8,9,5,10,7]},pde=({data:e})=>{const n={labels:Array.isArray(e?.labels)&&e.labels.length>0?e.labels:fde,datasets:[{label:"Guest",data:Array.isArray(e?.guest)&&e.guest.length>0?e.guest:Wd.guest,borderColor:"#EF4444",backgroundColor:"rgba(239,68,68,0.15)",pointBackgroundColor:"#EF4444",pointStyle:"rectRot",fill:!1},{label:"Cab",data:Array.isArray(e?.cab)&&e.cab.length>0?e.cab:Wd.cab,borderColor:"#7C3AED",backgroundColor:"rgba(124,58,237,0.15)",pointBackgroundColor:"#7C3AED",pointStyle:"rectRot",fill:!1},{label:"Delivery",data:Array.isArray(e?.delivery)&&e.delivery.length>0?e.delivery:Wd.delivery,borderColor:"#10B981",backgroundColor:"rgba(16,185,129,0.15)",pointBackgroundColor:"#10B981",pointStyle:"rectRot",fill:!1},{label:"Service",data:Array.isArray(e?.service)&&e.service.length>0?e.service:Wd.service,borderColor:"#F59E0B",backgroundColor:"rgba(245,158,11,0.15)",pointBackgroundColor:"#F59E0B",pointStyle:"rectRot",fill:!1}]},r={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:i=>i[0].label,label:i=>`${i.dataset.label} ${i.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 v.jsx(Ie,{title:"Hourly Traffic Flow",className:"w-full h-[362px]",period:v.jsx(Wr,{className:"text-[20px] text-[#884EA7]"}),children:v.jsx(o1,{data:n,options:r})})},hde={open:4,in_progress:7,closed:12},mde=[{incident_code:"INC-401",severity_level:"L1",severity:"Danger"},{incident_code:"INC-402",severity_level:"L2",severity:"High"},{incident_code:"INC-403",severity_level:"L3",severity:"Low"}];function gde({incidentReports:e={},incidentReportsDetails:t=[]}){const n=e&&Object.keys(e).length>0?e:hde,r=Array.isArray(t)&&t.length>0?t:mde,i=Number(n?.open??0),o=Number(n?.in_progress??0),a=Number(n?.closed??0);return v.jsx(dn,{title:"Incident Reports",className:"h-[362px]",titleWeight:"semi-bold",children:v.jsxs("div",{children:[v.jsxs("div",{className:"flex w-full text-center gap-[24px]",children:[v.jsxs("div",{className:"flex-1 py-3 bg-[#FBF4F4] h-[76px] rounded",children:[v.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#AB0000]",children:i??0}),v.jsx("div",{className:"!text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),v.jsxs("div",{className:"flex-1 py-3 bg-[#FFFBF2] h-[76px] rounded",children:[v.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#E7A015]",children:o??0}),v.jsx("div",{className:"!text-[12px] leading-[16px] text-[#E7A015]",children:"In-progress"})]}),v.jsxs("div",{className:"flex-1 py-3 bg-[#F7FEFA] h-[76px] rounded",children:[v.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:a??0}),v.jsx("div",{className:"!text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),v.jsx("div",{className:"mt-4 space-y-2",children:r?.length?r?.map?.((s,l)=>{const c=s?.severity==="Danger"?"text-[#AB0000]":s?.severity==="High"?"text-[#E7A015]":"text-[#1FA05B]";return v.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#FAFBFD] rounded-md",children:[v.jsx("div",{className:"flex items-center gap-[8px]",children:v.jsx("div",{className:"text-gray-700 font-medium",children:s?.incident_code??"-"})}),v.jsx("div",{className:`!text-[12px] font-semibold flex items-center gap-[4px] ${c}`,children:v.jsxs("div",{children:[s?.severity_level??"-"," - ",s?.severity??"-"]})})]},l)}):v.jsx("div",{className:"text-center text-gray-400 text-sm py-6",children:"No incidents found"})})]})})}const vde=[{total_staff:42,absent_staff:6}],yde=[{staff_role_name:"Security Guard",total_staff:18,present_staff:16},{staff_role_name:"Supervisor",total_staff:8,present_staff:7},{staff_role_name:"Technician",total_staff:10,present_staff:9}];function bde({staffPresentAbsent:e,staffPresentByRole:t}){const n=Array.isArray(e)&&e.length>0?e:vde,r=Array.isArray(t)&&t.length>0?t:yde,i=n?.[0]?.total_staff??0,o=n?.[0]?.absent_staff??0,a=(i??0)-(o??0);return v.jsx(dn,{title:"Staff Attendance",className:"h-[362px]",titleWeight:"semi-bold",children:v.jsxs("div",{children:[v.jsxs("div",{className:"flex gap-[24px] text-center",children:[v.jsxs("div",{className:"flex-1 py-3 bg-[#F7FEFA] rounded h-[76px]",children:[v.jsx("div",{className:"text-[24px] font-medium text-[#1FA05B]",children:a??0}),v.jsx("div",{className:"text-[12px] text-[#1FA05B]",children:"Present"})]}),v.jsxs("div",{className:"flex-1 py-3 bg-[#FBF4F4] rounded h-[76px]",children:[v.jsx("div",{className:"text-[24px] font-medium text-[#AB0000]",children:o??0}),v.jsx("div",{className:"text-[12px] text-[#AB0000]",children:"Absent"})]})]}),v.jsx("div",{className:"mt-4 space-y-2 overflow-y-auto max-h-[200px]",children:r?.length?r?.map?.((s,l)=>{const c=Number(s?.total_staff??0),u=Number(s?.present_staff??0);return v.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#FAFBFD] rounded-md",children:[v.jsx("div",{className:"text-[#121212] text-[14px] leading-[18px] font-medium",children:s?.staff_role_name??"-"}),v.jsxs("div",{className:"text-[14px] leading-[20px] text-[#64748B]",children:[u??0,"/",c??0]})]},l)}):v.jsx("div",{className:"text-center text-[16px] text-gray-400 text-sm py-6",children:"No staff data"})})]})})}function xde(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 wde({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=su,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return v.jsxs(Ie,{title:e,icon:v.jsx("div",{className:"h-6 w-6 grid place-items-center",children:v.jsx(o,{className:`h-6 w-6 ${a}`})}),children:[v.jsx("div",{className:"text-4xl font-semibold tracking-tight text-[#121212]",children:t}),v.jsxs("div",{className:"flex items-center gap-[8px] text-[14px]",children:[v.jsx("div",{className:i?"text-emerald-600 font-medium":"text-rose-600 font-medium",children:n}),v.jsx("div",{className:"text-slate-500",children:r})]})]})}const _de=[{title:"Total Visitors",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:yb,iconColor:"text-[#329DFF]"},{title:"Active Incidents",value:73,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:eoe,iconColor:"text-[#F69E0A]"},{title:"Missed Patrols",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:xde,iconColor:"text-[#AB0000]"},{title:"Parking Usage",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:y3,iconColor:"text-[#36AB6C]"}];function Sde({data:e}){const t=Array.isArray(e)&&e.length>0?e:_de;return v.jsx("div",{className:"px-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:t.map((n,r)=>v.jsx(wde,{...n},r))})}const Ede=[{title:"Maintenance",total:12,pending:3},{title:"Security",total:8,pending:1},{title:"Housekeeping",total:6,pending:2},{title:"Utilities",total:10,pending:4}],Ode=(e="")=>e.replace(/</g,"<").replace(/>/g,">").replace(/<[^>]*>/g,"").trim();function Cde({data:e}){const t=Array.isArray(e?.complaints_by_category)&&e.complaints_by_category.length>0?e.complaints_by_category.map(n=>({title:Ode(n.category_name)||"—",total:n.total||0,pending:n.pending||0})):Ede;return v.jsx(Ie,{title:"Complaints",className:"h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:v.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((n,r)=>v.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-lg p-3 h-[62px]",children:[v.jsxs("div",{className:"flex flex-col",children:[v.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),v.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),v.jsxs("div",{className:"flex flex-col items-end",children:[v.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},r))})})}const Pde=e=>{const t={0:"𝟎",1:"𝟏",2:"𝟐",3:"𝟑",4:"𝟒",5:"𝟓",6:"𝟔",7:"𝟕",8:"𝟖",9:"𝟗"};return String(e).split("").map(n=>t[n]||n).join("")},kde=[{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}],Dde=({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 v.jsxs("div",{style:{backgroundColor:"#0B0B0B",padding:"14px 40px 14px 18px",borderRadius:"10px",color:"#ffffff"},children:[v.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=Pde(a);return v.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:o<r.length-1?"8px":"0",fontSize:"12px"},children:[v.jsx("div",{style:{width:"8px",height:"8px",backgroundColor:i.color,transform:"rotate(45deg)",marginRight:"8px"}}),v.jsx("span",{style:{color:"D1D3D4",minWidth:"100px"},children:i.label}),v.jsx("span",{style:{marginLeft:"auto",fontWeight:"700"},children:s})]},i.key)})]})},Ade=()=>{const e=[{label:"Open",color:"#EF4444"},{label:"In Progress",color:"#F59D0D"},{label:"Closed",color:"#12B981"}];return v.jsx("div",{style:{display:"flex",justifyContent:"space-between",gap:"15px"},children:e.map(t=>v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[v.jsx("div",{style:{width:"6px",height:"6px",backgroundColor:t.color,transform:"rotate(45deg)"}}),v.jsx("span",{style:{fontSize:"14px"},children:t.label})]},t.label))})},Tde=({data:e})=>{const t=P.useMemo(()=>(Array.isArray(e?.complaints_by_level)&&e.complaints_by_level.some(l=>Number(l.total)>0)?e.complaints_by_level:kde).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=P.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 v.jsxs(Ie,{title:"Complaints by Level",className:"w-full h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:[v.jsx(Ft,{width:"100%",height:"85%",children:v.jsxs(oa,{data:t,margin:{top:5,right:-25,left:-30,bottom:5},children:[v.jsx(Hr,{strokeDasharray:"0",vertical:!1}),v.jsx(br,{dataKey:"level"}),v.jsx(nr,{domain:[0,r],ticks:Array.from({length:i+1},(a,s)=>s*o)}),v.jsx(Vt,{content:v.jsx(Dde,{}),cursor:!1}),v.jsx(jn,{dataKey:"open_count",stackId:"a",fill:"#EF4444",barSize:44,radius:[0,0,0,0]}),v.jsx(jn,{dataKey:"in_progress_count",stackId:"a",fill:"#F59D0D",barSize:44,radius:[0,0,0,0]}),v.jsx(jn,{dataKey:"closed_count",stackId:"a",fill:"#12B981",barSize:44,radius:[0,0,0,0]})]})}),v.jsx(Ade,{})]})},Mde=[{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 Nde({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})):Mde;return v.jsx(Ie,{title:"Request Box",className:"h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:v.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((n,r)=>v.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-lg p-3 h-[62px]",children:[v.jsxs("div",{className:"flex flex-col",children:[v.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),v.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),v.jsxs("div",{className:"flex flex-col items-end",children:[v.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},`${n.title}-${r}`))})})}function jde(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 Rde=["open_complaints","pending_requests","avg_response_time","resolution_rate"],Ide={open_complaints:{title:"Open Complaints",Icon:Vk,iconColor:"#AB0000",deltaLabel:"Compared to last month"},pending_requests:{title:"Pending Requests",Icon:jde,iconColor:"#E7A015",deltaLabel:"Compared to last month"},avg_response_time:{title:"Avg Response Time",Icon:P3,iconColor:"#1FA05B",deltaLabel:"Compared to last month"},resolution_rate:{title:"Resolution Rate",Icon:S3,iconColor:"#329DFF",deltaLabel:"Compared to last month"}},Lde=({children:e,size:t=28,lineHeight:n=32,weight:r=500,color:i="#121212"})=>v.jsx("div",{style:{fontWeight:r,fontSize:`${t}px`,lineHeight:`${n}px`,color:i},children:e}),Fde={primary:{size:28,lineHeight:32,weight:500}},$de={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 Bde({id:e,data:t}){return e&&t&&!t[e]&&t.current!==void 0?v.jsx(cP,{id:e,data:t}):v.jsx("div",{className:"px-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:Rde.map(n=>v.jsx(cP,{id:n},n))})}function cP({id:e,data:t}){const n=Ide[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=su,iconColor:a,deltaLabel:s}=n,l=t&&Object.keys(t).length>0?t:$de[e],c=r(e,l?.current),u=l?.trend_percent??"—";return l?.direction==="good"||l?.direction,v.jsx("div",{className:"h-[132px]",children:v.jsxs(Ie,{title:i,titleColor:a,icon:v.jsx("div",{className:"h-[20px] w-[20px] flex items-center justify-center",children:v.jsx(o,{className:"h-[20px] w-[20px]",style:{color:a}})}),childrenClassName:"!space-y-[12px]",iconClassName:"!gap-[12px]",children:[v.jsx(Lde,{...Fde.primary,children:c}),v.jsxs("div",{className:"flex items-center gap-[8px] text-[12px] leading-[16px]",children:[v.jsx(bb,{value:u}),v.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:s})]})]})})}const Wde=[{title:"Holi Celebration",date:"25 Jun 2025",rsvp:"78/100",utilisation:71,status:"Upcoming"},{title:"Maintenance Meeting",date:"25 Jun 2025",rsvp:"45/60",utilisation:75,status:"Completed"}];function zde({title:e,date:t,rsvp:n,utilisation:r,status:i}){return v.jsxs("div",{className:" bg-[#F8FAFC] h-[106px] px-3 mt-3",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("div",{className:"text-[16px] leading-[20px] font-semibold text-[#121212]",children:e}),v.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})]}),v.jsx("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:t}),v.jsxs("div",{className:"flex justify-between items-center mt-2",children:[v.jsxs("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:[n," RSVP"]}),v.jsxs("div",{className:"text-[#3C82F6] text-[14px] leading-[18px] font-medium",children:[r,"% utilisation"]})]}),v.jsx("div",{className:"w-full bg-[#F8FAFC] h-[6px] rounded mt-2 mb-3",children:v.jsx("div",{className:"h-[6px] rounded bg-[#3C82F6]",style:{width:`${r}%`}})})]})}function Vde({data:e}){const t=Array.isArray(e)&&e.length>0?e:Wde;return v.jsx(Ie,{title:"Events Utilisation",period:v.jsx(Wr,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"w-full h-[360px]",children:v.jsx("div",{children:t.map((n,r)=>v.jsx(zde,{...n},`${n.title}-${r}`))})})}const Hde=[{label:"Active",value:138,subLabel:"3 expiring soon",bgColor:"bg-[#F0FFF7]",textColor:"text-[#1FA05B]"},{label:"Scheduled",value:13,subLabel:"4 this week",bgColor:"bg-[#FFFBF2]",textColor:"text-[#E7A015]"},{label:"Recurring",value:3,subLabel:"All active",bgColor:"bg-[#EDF6FF]",textColor:"text-[#329DFF]"},{label:"Expired",value:7,subLabel:"4 recent",bgColor:"bg-[#F6F6F6]",textColor:"text-[#64748B]"}];function Yde({label:e,value:t,subLabel:n,bgColor:r,textColor:i}){return v.jsxs("div",{className:`rounded-lg p-4 ${r} h-[124px]`,children:[v.jsx("div",{className:`text-[16px] font-medium ${i} leading-[20px]`,children:e}),v.jsx("div",{className:"mt-4 text-[28px] leading-[32px] font-semibold text-[#121212]",children:t}),v.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-2",children:n})]})}function Ude({data:e}){const t=Array.isArray(e)&&e.length>0?e:Hde;return v.jsx(Ie,{title:"Notice Board Status",period:v.jsx(Wr,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"w-full h-[360px]",children:v.jsx("div",{className:"grid grid-cols-2 gap-[16px]",children:t.map((n,r)=>v.jsx(Yde,{...n},`${n.label}-${r}`))})})}function $R(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 Kde({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=su,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return v.jsx(Ie,{title:e,icon:v.jsx("div",{className:`h-6 w-6 grid place-items-center rounded-md ${s}`,children:v.jsx(o,{className:`h-4 w-4 ${a}`})}),className:"h-[132px]",children:v.jsxs("div",{children:[v.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),v.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[v.jsx("div",{className:i?"text-[#1FA05B] font-medium":"text-rose-600 font-medium",children:n}),v.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}function qde({data:e}){const t=[{title:e?.title||"Total Bookings",value:145,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:$R,iconColor:"text-emerald-600",iconBg:"bg-emerald-50"}];return v.jsx("div",{className:"h-full",children:t.map((n,r)=>v.jsx(Kde,{...n},r))})}function Gde(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 Xde({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=su,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return v.jsx(Ie,{title:e,icon:v.jsx("div",{className:`h-6 w-6 grid place-items-center rounded-md ${s}`,children:v.jsx(o,{className:`h-4 w-4 ${a}`})}),className:"h-[132px]",children:v.jsxs("div",{children:[v.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),v.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[v.jsx("div",{className:i?"text-[#1FA05B] font-medium":"text-rose-600 font-medium",children:n}),v.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}const Qde=[{title:"Notice",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:$R,iconColor:"text-emerald-600",iconBg:"bg-emerald-50"},{title:"Post",value:83,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:b3,iconColor:"text-[#329DFF]",iconBg:"bg-emerald-50"},{title:"Poll",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Zie,iconColor:"text-[#FA7E28]",iconBg:"bg-orange-100"},{title:"Poll",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:Gde,iconColor:"text-[#DBB467]",iconBg:"bg-yellow-100"}];function Zde({data:e}){const t=Array.isArray(e)&&e.length>0?e:Qde;return v.jsx("div",{className:"px-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:t.map((n,r)=>v.jsx(Xde,{...n},r))})}const uP=({value:e=0,total:t=1,colorClass:n="",label:r=""})=>{const i=Number(e)||0,o=Number(t)||1,a=Math.max(0,Math.min(100,i/o*100)),s=n==="bg-[#3C81F6]"?"text-[#8B5CF6]":n==="bg-[#8B5CF6]"?"text-[#12B981]":"text-slate-600";return v.jsxs("div",{className:"flex flex-col items-start",children:[v.jsx("div",{className:"w-2/3 min-w-[80px] h-5 rounded-full overflow-hidden",children:v.jsx("div",{className:`h-[11px] rounded-full ${n||""}`,style:{width:n==="bg-[#12B981]"?`${a+45}%`:`${a}%`}})}),v.jsx("div",{className:`${s} !text-[12px] font-bold mt-1`,children:i??0}),v.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-1",children:r??""})]})},Jde=({data:e,occupiedUnits:t=1,EmployeesCount:n=8910,AdminsCount:r=910})=>{const i=e?.total_occupants!==void 0&&e?.total_occupants!==null?Number(e?.total_occupants)||0:Number(t)||0,o=e?.total_members!==void 0&&e?.total_members!==null?Number(e?.total_members)||0:Number(n)||0,a=e?.total_admins!==void 0&&e?.total_admins!==null?Number(e?.total_admins)||0:Number(r)||0,s=(o||0)+(a||0);return v.jsx("div",{children:v.jsxs("div",{className:"bg-white !border-[0.5px] !border-[#EBEBEB] rounded-xl shadow-[0_0_12px_0_#EAF2FF] p-4 h-[128px]",children:[v.jsxs("div",{className:"flex items-center gap-[12px] h-[20px]",style:{marginBottom:"24px"},children:[v.jsx(yb,{className:"!text-[20px] text-[#329DFF]"}),v.jsx("div",{className:"font-medium text-[#121212] text-[16px] leading-[20px]",children:"Occupancy Overview"})]}),v.jsxs("div",{className:"flex items-start justify-between",children:[v.jsxs("div",{className:"flex flex-col gap-[4px]",children:[v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B] font-normal",children:"Total Occupants"}),v.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:i??0})]}),v.jsxs("div",{className:"flex items-end gap-1",children:[v.jsx(uP,{value:o??0,total:s||1,colorClass:"bg-[#3C81F6]",label:(o??0)<=1?"Employee":"Employees"}),v.jsx(uP,{value:a??0,total:s||1,colorClass:"bg-[#8B5CF6]",label:(a??0)<=1?"Admin":"Admins"})]})]})]})})};$n.register(Eo,Oo,Pl,Yr);const efe=()=>{const t={labels:["HP","Adobe","Anarock","Swiggy","Infosys","Zepto"],datasets:[{data:[2e3,1700,1500,1200,900,800],backgroundColor:["#3C81F6","#3C81F6","#3C81F6","#3C81F6","#3C81F6","#3C81F6"],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,min:0,max:2e3,ticks:{stepSize:500,color:"#64748B",callback:r=>r},grid:{display:!1,color:"#E5E7EB",borderDash:[4,4],drawBorder:!1}}}};return v.jsxs(Ie,{className:"w-full h-[238px]",title:"Employee Footfall (Static Data)",period:"Today",icon:v.jsx(Gue,{className:"!text-[24px] text-[#8B5CF6]"}),children:[v.jsxs("div",{className:"mb-[16px] mt-[8px] flex flex-col gap-[4px]!",children:[v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Employees Inside"}),v.jsx("div",{className:"text-[20px] leading-[24px] font-medium text-[#3C81F6]",children:"7,500"})]}),v.jsx("div",{className:"h-[110px]",children:v.jsx(kl,{data:t,options:n})})]})};function tfe(){return v.jsx(Ie,{className:"h-[324px]",title:"Food & Beverages (Static Data)",period:"Today",icon:v.jsx(sde,{className:"!text-[24px] text-[#FA7E28]"}),children:v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsxs("div",{className:"grid grid-cols-2 gap-6 mb-6",children:[v.jsxs("div",{children:[v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Orders"}),v.jsx("div",{className:"mt-[4px] text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:247})]}),v.jsxs("div",{children:[v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Revenue Generated"}),v.jsxs("div",{className:"mt-[4px] text-[28px] leading-[32px] font-medium text-[#329DFF]",children:["₹ ","82K"]}),v.jsxs("div",{className:"inline-flex items-center gap-1 mt-2 text-[10px] leading-[14px] px-2 py-1 rounded-full text-[#1FA05B] bg-green-50",children:[v.jsx(Us,{}),8,"%",v.jsx("span",{children:"from last month"})]})]})]}),v.jsxs("div",{className:"mt-[16px]",children:[v.jsxs("div",{className:"mb-[16px]",children:[v.jsxs("div",{className:"flex justify-between text-sm mb-2",children:[v.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:"HP"}),v.jsxs("div",{className:"font-medium text-[12px] leading-[16px] flex items-center",children:[v.jsx("div",{className:"text-[#64748B] inline-block",children:"120 orders"}),v.jsx("div",{className:"mx-2 text-[#121212] inline-block",children:"₹ 45K"})]})]}),v.jsx("div",{className:"h-[11px] bg-gray-100 rounded-full",children:v.jsx("div",{className:"h-[11px] bg-blue-500 rounded-full",style:{width:"70%"}})})]}),v.jsxs("div",{className:"mb-[16px]",children:[v.jsxs("div",{className:"flex justify-between text-sm mb-2",children:[v.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:"Adobe"}),v.jsxs("div",{className:"font-medium text-[12px] leading-[16px] flex items-center",children:[v.jsx("div",{className:"text-[#64748B] inline-block",children:"85 orders"}),v.jsx("div",{className:"mx-2 text-[#121212] inline-block",children:"₹ 23K"})]})]}),v.jsx("div",{className:"h-[11px] bg-gray-100 rounded-full",children:v.jsx("div",{className:"h-[11px] bg-red-500 rounded-full",style:{width:"50%"}})})]}),v.jsxs("div",{className:"mb-[16px]",children:[v.jsxs("div",{className:"flex justify-between text-sm mb-2",children:[v.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:"Anarock"}),v.jsxs("div",{className:"font-medium text-[12px] leading-[16px] flex items-center",children:[v.jsx("div",{className:"text-[#64748B] inline-block",children:"42 orders"}),v.jsx("div",{className:"mx-2 text-[#121212] inline-block",children:"₹ 14K"})]})]}),v.jsx("div",{className:"h-[11px] bg-gray-100 rounded-full",children:v.jsx("div",{className:"h-[11px] bg-purple-700 rounded-full",style:{width:"25%"}})})]})]})]})})}function nfe({data:e}){const t=e?.amenity_summary?{amenitySummary:{totalBookings:e?.amenity_summary?.total_bookings??0,todayPaidRevenue:e?.amenity_summary?.today_paid_revenue??"0.00",growthPercentage:e?.amenity_summary?.growth_percentage??null,bookingGrowth:e?.amenity_summary?.booking_growth??null,currencyType:e?.amenity_summary?.currency_type??"₹"},chartData:Array.isArray(e?.chart_data)?e.chart_data.map(h=>({facility_name:h?.facility_name,total_bookings:h?.total_bookings??0,paid_revenue:h?.paid_revenue??"0",isPaid:h?.is_paid===!0})):[]}:e||{},n=t?.amenitySummary||{},i=(Array.isArray(t?.chartData)?t.chartData:[]).map(h=>({...h,isPaid:h?.isPaid===!0})),o=i.length>0&&i.every(h=>h?.isPaid===!1),a=n?.totalBookings||0,s=n?.bookingGrowth;let l=0;if(typeof s=="number")l=s;else if(typeof s=="string"){const h=s.replace("%","").trim(),m=Number(h);l=isNaN(m)?0:m}const c=i.reduce((h,m)=>{const g=m?.total_bookings||0;return h+g},0),u=i.map(h=>{const m=h?.total_bookings||0,g=h?.isPaid?`${n?.currencyType||"₹"} ${h?.paid_revenue||"0.00"}`:"",b=c>0?Math.round(m/c*100):0;return{name:h?.facility_name||"Unknown",bookings:m,revenue:g,percentage:b,color:h?.isPaid?"bg-violet-500":"bg-slate-400",isPaid:h?.isPaid}}),d=n?.growthPercentage;let f=null;if(typeof d=="number")f=d;else if(typeof d=="string"){const h=d.replace("%","").trim(),m=Number(h);f=isNaN(m)?null:m}const p=f!==null?f>=0:!0;return v.jsx(Ie,{className:"h-[324px]",title:"Amenities",period:"Today",icon:v.jsx(cde,{className:"!text-[24px] text-[#8B5CF6]"}),children:v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsxs("div",{className:"grid grid-cols-2 gap-6 mb-6",children:[v.jsxs("div",{children:[v.jsxs("div",{className:"flex flex-col gap-[4px]!",children:[v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Bookings"}),v.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:a})]}),v.jsxs("div",{className:`inline-flex items-center gap-1 mt-2 text-[10px] leading-[14px] px-2 py-1 rounded-full ${l>=0?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[l>=0?v.jsx(Us,{}):v.jsx(Nc,{}),l,"%",v.jsx("span",{children:"from last month"})]})]}),!o&&v.jsxs("div",{className:"flex flex-col gap-[4px]!",children:[v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Revenue Generated"}),v.jsxs("div",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF]",children:[n?.currencyType||"₹"," ",n?.todayPaidRevenue??"0.00"]}),f!==null&&v.jsxs("div",{className:`inline-flex items-center gap-1 mt-2 text-[10px] leading-[14px] px-2 py-1 rounded-full ${p?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[p?v.jsx(Us,{}):v.jsx(Nc,{}),f,"%",v.jsx("span",{children:"from last month"})]})]})]}),v.jsx("div",{className:"mt-[16px]",children:u.length>0?u.map((h,m)=>v.jsxs("div",{className:"mb-[16px]",children:[v.jsxs("div",{className:"flex justify-between text-sm mb-2",children:[v.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:h?.name}),v.jsxs("div",{className:"font-medium text-[12px] leading-[16px]",children:[v.jsxs("div",{className:"text-[#64748B] inline",children:[h?.bookings," ",h?.bookings<=1?"booking":"bookings"]}),h?.isPaid&&v.jsx("div",{className:"mx-2 text-[#121212] inline",children:h?.revenue})]})]}),v.jsx("div",{className:"h-[11px] bg-gray-100 rounded-full",children:v.jsx("div",{className:`h-[11px] rounded-full ${h?.color}`,style:{width:`${h?.percentage}%`}})})]},m)):v.jsx("div",{className:"flex items-center justify-center h-[120px]",children:v.jsx("div",{className:"text-[12px] text-[#94A3B8]",children:"No amenity usage data available"})})})]})})}$n.register(Eo,Oo,Pl,Yr,Jr);function rfe({data:e=[]}){const t=[{level:"L1",open:55,in_progress:22,on_hold:15,closed:6},{level:"L2",open:45,in_progress:25,on_hold:18,closed:5},{level:"L3",open:58,in_progress:23,on_hold:14,closed: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)),o.push(Number(n[u].in_progress)),a.push(Number(n[u].on_hold)),s.push(Number(n[u].cancelled));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:"#FB2C36",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 v.jsx(Ie,{className:"h-[267px]",title:"Ticket Escalation Levels",period:"Today",icon:v.jsx(E3,{className:"!text-[24px] text-[#3C81F6]"}),children:v.jsx("div",{className:"h-full",children:v.jsx(kl,{data:l,options:c})})})}const ife=({active:e,payload:t})=>{if(!e||!t||!t.length)return null;const n=t[0],r=n.payload.color;return v.jsx("div",{style:{backgroundColor:"#000000",color:"#ffffff",padding:"8px 10px",borderRadius:"8px",fontSize:"12px"},children:v.jsxs("div",{className:"flex items-center gap-2 font-medium",children:[v.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:r}}),v.jsx("div",{children:n.name}),v.jsx("div",{className:"ml-2",children:n.value})]})})};function ofe({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 v.jsx(Ie,{className:"h-[267px]",title:"Ticket Status",period:"Today",icon:v.jsx(Dv,{className:"!text-[24px] text-[#EF4444]"}),children:v.jsxs("div",{className:"flex h-full items-center gap-4",children:[v.jsxs("div",{className:"w-[202px] h-[170px] relative",children:[v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(_o,{children:[v.jsx(Mi,{data:i,innerRadius:55,outerRadius:85,dataKey:"value",stroke:"#FFFFFF",strokeWidth:2,children:i.map((a,s)=>v.jsx(kn,{fill:a.color},s))}),v.jsx(Vt,{content:v.jsx(ife,{}),wrapperStyle:{zIndex:1e3}})]})}),v.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[v.jsxs("div",{className:"flex items-baseline text-[18px] leading-[22px] font-medium text-[#121212]",children:[v.jsx("div",{children:r(n.completed)}),v.jsxs("div",{className:"text-[18.18px] leading-[22.22px] text-[#121212]",children:["/",o]})]}),v.jsx("div",{className:"text-[10.1px] leading-[14.14px] text-[#64748B]",children:"Completed"})]})]}),v.jsx("div",{className:"flex-1 space-y-2",children:i.map(a=>v.jsxs("div",{className:"flex items-center justify-between text-[12px] leading-[17px] mt-[12px]",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"h-[7px] w-[16px]",style:{backgroundColor:a.color}}),v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:a.name})]}),v.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px] font-medium",children:a.value})]},a.name))})]})})}const dP={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}},chart_data:[{hour:10,walkins:22,preApproved:30},{hour:12,walkins:15,preApproved:28},{hour:14,walkins:30,preApproved:38},{hour:16,walkins:45,preApproved:50},{hour:18,walkins:25,preApproved:40}]};function afe(e){const t=e>=12?"PM":"AM";let n=e%12;return n===0&&(n=12),`${n} ${t}`}function sfe(e){if(typeof e=="number"&&e>=0&&e<=23)return e;if(typeof e=="string"){const t=e.trim().toUpperCase(),n=t.match(/^(\d{1,2})(?::\d{2})?\s*(AM|PM)$/);if(n){let i=Number(n[1])%12;return n[2]==="PM"&&(i+=12),i}const r=Number(t);if(!Number.isNaN(r)&&r>=0&&r<=23)return r}return null}function lfe(e=[]){return Array.from({length:24},(t,n)=>{const r=e.find(i=>sfe(i?.hour)===n)||{};return{hour:n,time:afe(n),walkins:Number(r?.walkins??0),approved:Number(r?.pre_approved??r?.preApproved??r?.approved??0)}})}function fP({title:e,color:t,rows:n=[],children:r}){const i=v.jsxs("div",{className:"bg-white rounded-xl min-w-[260px] p-4",children:[v.jsxs("div",{className:"flex items-center gap-2 font-medium text-[#121212]",children:[v.jsx(Qp,{className:`text-[20px] ${t}`}),v.jsx("div",{children:e??""})]}),v.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})=>v.jsxs("div",{className:"flex justify-between text-[14px]",children:[v.jsx("div",{children:o??""}),v.jsx("div",{className:"font-semibold",style:{color:s||"#121212"},children:a??0})]},o))})]});return v.jsx(Hj,{content:i,placement:"right-start",interactive:!0,delay:[100,0],offset:[6,0],appendTo:()=>document.body,theme:"light-border",maxWidth:"none",children:r})}function cfe({active:e,payload:t}){return!e||!t?.length?null:v.jsx("div",{className:"rounded-lg bg-[#121212] px-3 py-2 text-[12px] text-white shadow-lg",children:t.map(n=>v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"h-2 w-2 rounded-full",style:{backgroundColor:n.stroke}}),v.jsx("span",{className:"min-w-[82px] text-[#D1D3D4]",children:n.name}),v.jsx("span",{className:"font-semibold",children:n.value})]},n.dataKey))})}function ufe({data:e}){const t=e&&Object.keys(e).length?e:dP,n=t?.visitor_summary?{totalVisitorsToday:t?.visitor_summary?.total_visitors_today??0,peakTime:t?.visitor_summary?.peak_time??"-"}:t?.visitorSummary??{},r=t?.walkins_popup_data?{walkins:{currently_inside:Number(t?.walkins_popup_data?.walkins_inside??0),total_visited_today:Number(t?.walkins_popup_data?.total_walkins??0)},preApproved:{completed_visits:Number(t?.pre_approved_popup_data?.pre_approved_check_ins??0),total_expected_today:Number(t?.pre_approved_popup_data?.total_pre_approved_check_ins??0)}}:t?.popupData??{},i=P.useMemo(()=>{const l=t?.chart_data??[];return lfe(l.length?l:dP.chart_data)},[t]),{yAxisTicks:o,yAxisMax:a}=P.useMemo(()=>{const l=Math.max(...i.map(u=>Math.max(u.walkins,u.approved))),c=l>0?l:5;return{yAxisTicks:[0,Math.ceil(c/2),c],yAxisMax:c}},[i]),s=new Date().toLocaleTimeString("en-IN",{hour:"2-digit",minute:"2-digit",hour12:!0});return v.jsx(Ie,{className:"h-[377px]",title:"Visitor Updates",period:`Today at ${s}`,icon:v.jsx(Qp,{className:"!text-[24px] text-[#8B5CF6]"}),children:v.jsxs("div",{className:"flex flex-col mt-2",children:[v.jsxs("div",{className:"grid grid-cols-2 gap-y-4 gap-x-6 mb-6",children:[v.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[v.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Total Visitors"}),v.jsx("div",{className:"text-[20px] font-medium text-[#08B6D4]",children:n?.totalVisitorsToday??0})]}),v.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[v.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Peak Time"}),v.jsx("div",{className:"text-[20px] font-medium text-[#8B5CF6]",children:n?.peakTime??"-"})]}),v.jsxs("div",{className:"mt-2 flex flex-col gap-[8px]!",children:[v.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Active Walk-ins"}),v.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[v.jsx("div",{className:"text-[28px] text-[#1FA05B] leading-[32px]",children:r?.walkins?.currently_inside??0}),v.jsx(fP,{title:"Active Walk-ins",color:"text-[#1FA05B]",rows:[{label:"Currently Inside",value:r?.walkins?.currently_inside??0,valueColor:"#1FA05B"},{label:"Total Visited Today",value:r?.walkins?.total_visited_today??0}],children:v.jsxs("div",{className:"text-[#64748B] cursor-pointer text-[20px] leading-[32px]",children:["/",r?.walkins?.total_visited_today??0]})})]})]}),v.jsxs("div",{className:"mt-2 flex flex-col gap-[8px]!",children:[v.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Pre-approved Check-ins"}),v.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[v.jsx("div",{className:"text-[28px] text-[#E7A015] leading-[32px]",children:r?.preApproved?.completed_visits??0}),v.jsx(fP,{title:"Pre-approved Check-ins",color:"text-[#E7A015]",rows:[{label:"Completed Visits",value:r?.preApproved?.completed_visits??0,valueColor:"#E7A015"},{label:"Total Expected Check-ins Today",value:r?.preApproved?.total_expected_today??0}],children:v.jsxs("div",{className:"text-[#64748B] cursor-pointer text-[20px] leading-[32px]",children:["/",r?.preApproved?.total_expected_today??0]})})]})]})]}),v.jsx("div",{className:"w-full h-[179px]",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(bx,{data:i??[],margin:{top:5,right:0,left:-18,bottom:0},children:[v.jsx(Hr,{stroke:"#E5E7EB",strokeDasharray:"4 4",vertical:!1}),v.jsx(br,{dataKey:"time",tickFormatter:(l,c)=>c%4===0?l:"",axisLine:!1,tickLine:!1,tick:{fill:"#121212",fontSize:10,fontWeight:400}}),v.jsx(nr,{width:24,axisLine:!1,tickLine:!1,allowDecimals:!1,ticks:o,domain:[0,a],tick:{fill:"#64748B",fontSize:10,fontWeight:400}}),v.jsx(Vt,{content:v.jsx(cfe,{})}),v.jsx(Vo,{type:"monotone",dataKey:"walkins",stroke:"#22C55E",strokeWidth:2,dot:!1,name:"Walk-ins",isAnimationActive:!1}),v.jsx(Vo,{type:"monotone",dataKey:"approved",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"5 5",dot:!1,name:"Pre-approved",isAnimationActive:!1})]})})})]})})}const dfe=({color:e})=>v.jsx("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",backgroundColor:e,marginRight:"6px"}}),ffe=({active:e,payload:t})=>!e||!t||!t.length?null:v.jsx("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:t.map((n,r)=>v.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[v.jsx(dfe,{color:n.color}),n.name,": ",v.jsx("div",{className:"font-semibold",children:n.value})]},r))});function pfe({data:e=null}){const n=e||{card_entry:60,mobile_entry:35,card_exit:15,mobile_exit:10,total:20.3},r=a=>{const s=Number(a);return isNaN(s)?0:s},i=[{name:"Card Entry",value:r(n.card_entry),color:"#329DFF"},{name:"Mobile Entry",value:r(n.mobile_entry),color:"#8B5CF6"},{name:"Card Exit",value:r(n.card_exit),color:"#B1D2F0"},{name:"Mobile Exit",value:r(n.mobile_exit),color:"#DACBFB"}],o=r(n.total);return v.jsx(dn,{className:"h-[362px]",title:"Access Overview",titleWeight:"semi-bold",children:v.jsxs("div",{className:"flex flex-col items-center mt-[16px]",children:[v.jsxs("div",{className:"relative w-[200px] h-[200px]",children:[v.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:v.jsx("div",{className:"w-[130px] h-[130px] rounded-full shadow-[0px_12px_35px_rgba(0,0,0,0.12)]"})}),v.jsx("div",{className:"h-[184px]",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(_o,{children:[v.jsx(Mi,{data:i,dataKey:"value",innerRadius:65,outerRadius:90,startAngle:110,endAngle:-250,paddingAngle:2,stroke:"transparent",children:i.map((a,s)=>v.jsx(kn,{fill:a.color},s))}),v.jsx(Vt,{content:v.jsx(ffe,{}),wrapperStyle:{zIndex:9999}})]})})}),v.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[v.jsxs("div",{className:"text-[20px] leading-[24px] font-semibold text-[#121212]",children:[o,"L"]}),v.jsx("div",{className:"text-[10px] leading-[15px] text-[#64748B]",children:"Total Access"})]})]}),v.jsx("div",{className:"mt-[32px] grid grid-cols-2 gap-x-[20px] gap-y-[12px] text-[12px] text-[#94A3B8]",children:i.map(a=>v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"w-[16px] h-[7px] ",style:{backgroundColor:a.color}}),v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:a.name})]},a.name))})]})})}function BR({title:e="Access",data:t=[],height:n="h-[362px]"}){const r=i=>i==null?"0":Number(i).toLocaleString();return v.jsx(dn,{className:n,title:e,titleWeight:"semi-bold",children:v.jsxs("div",{className:"rounded-xl overflow-hidden mt-[16px]",children:[v.jsxs("div",{className:"grid grid-cols-2 bg-[#F8FAFC] py-[8px] px-[12px] text-[12px] leading-[16px] font-medium text-[#64748B]",children:[v.jsx("div",{children:"Point"}),v.jsx("div",{className:"text-right",children:"Access"})]}),t.map((i,o)=>v.jsxs("div",{className:"grid grid-cols-2 p-[12px] text-[14px] border-t border-[#E2E8F0]",children:[v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:i.label}),v.jsx("div",{className:"text-[12px] leading-[16px] text-right font-medium",style:{color:i.color||"#000"},children:r(i.value)})]},o))]})})}function hfe({data:e=[]}){const t=[{name:"Google",value:82e3},{name:"Uber",value:67e3},{name:"ANAROCK",value:6e4},{name:"Flipkart",value:48e3},{name:"HP",value:41e3},{name:"Myntra",value:3e4},{name:"Cloudscape",value:2e4},{name:"Infosys",value:9e3}],n=e.length?e:t,r=o=>o>=1e3?`${o/1e3}K`:o,i=Math.max(...n.map(o=>o.value));return v.jsx(dn,{title:"Access Points Usage",titleWeight:"semi-bold",className:"h-[362px]",children:v.jsx("div",{className:"mt-[24px] h-[270px] w-full",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(oa,{data:n,barSize:60,margin:{top:0,right:0,left:-20,bottom:0},children:[v.jsx(Hr,{strokeDasharray:"8 8",vertical:!1}),v.jsx(ux,{y:0,stroke:"#EBEBEB",strokeDasharray:"0"}),v.jsx(br,{dataKey:"name",tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1}),v.jsx(nr,{tickFormatter:r,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1}),v.jsx(Vt,{cursor:!1}),v.jsx(jn,{dataKey:"value",barSize:60,children:n.map((o,a)=>v.jsx(kn,{fill:o.value===i?"#3C81F6":"#79ABFF"},`cell-${a}`))})]})})})})}function Po({image:e="https://cdni.iconscout.com/illustration/premium/thumb/businessman-sad-for-no-data-in-folder-illustration-svg-download-png-10155562.png",title:t="No Data Available",description:n="Catch up all the data. Change the date range to see the data."}){return v.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center px-4",children:[v.jsx("img",{src:e,alt:"no data",className:"w-32 h-32 mb-4 opacity-80"}),v.jsx("h3",{className:"text-[16px] font-semibold text-gray-900 mb-1",children:t}),v.jsx("p",{className:"text-sm text-gray-500 max-w-[260px]",children:n})]})}const mfe=({active:e,payload:t})=>e&&t&&t.length?v.jsx("div",{className:"bg-black text-white px-4 py-2 rounded-lg text-sm shadow-lg",children:v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{children:t[0].payload.name}),v.jsx("div",{className:"font-semibold",children:t[0].value})]})}):null,gfe=({x:e,y:t,payload:n})=>{const r=n.value.split(" ");return v.jsx("g",{transform:`translate(${e},${t})`,children:v.jsx("text",{x:-85,y:0,textAnchor:"start",fill:"#121212",fontSize:14,children:r.map((i,o)=>v.jsx("tspan",{x:-85,dy:o===0?0:16,children:i},o))})})};function vfe({data:e=[]}){const t=e&&e.length>0,n=e.map(r=>({name:r.category_name,value:r.total_complaints}));return v.jsx(dn,{title:"Tickets per Category",className:"h-[362px]",titleWeight:"semi-bold",childrenClassName:"h-full",children:t?v.jsx("div",{className:"w-full h-[280px] mt-[28px]",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(oa,{data:n,layout:"vertical",children:[v.jsx(Hr,{strokeDasharray:"3 3",horizontal:!1}),v.jsx(br,{type:"number",tick:{fill:"#94A3B8",fontSize:12},axisLine:!0,tickLine:!1,allowDecimals:!1}),v.jsx(nr,{type:"category",dataKey:"name",axisLine:!1,tickLine:!1,width:120,tick:v.jsx(gfe,{})}),v.jsx(Vt,{content:v.jsx(mfe,{}),cursor:{fill:"transparent"}}),v.jsx(jn,{dataKey:"value",barSize:36,fill:"#08B6D4"})]})})}):v.jsx(Po,{title:"No Tickets Found",description:"Catch up all the data. Change the date range to see the data."})})}function yfe({icon:e,iconColor:t="#329DFF",title:n,value:r,percentage:i,percentageText:o}){const a=parseFloat(i),s=a>=0,l=s?"#16A34A":"#DC2626";return v.jsxs("div",{className:"relative bg-white rounded-[12px] shadow-[0_0_12px_0_#EAF2FF] p-[16px]",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[e&&v.jsx("div",{className:"h-[20px] w-[20px]",style:{color:t,display:"flex",alignItems:"center",justifyContent:"center"},children:v.jsx(e,{className:"h-[20px] w-[20px]"})}),v.jsx("div",{className:"text-[16px] leading-[20px] font-medium text-[#64748B]",children:n})]}),v.jsx("div",{className:"mt-[16px] text-[28px] leading-[32px] font-medium text-[#121212]",children:r}),(i||o)&&v.jsxs("div",{className:"mt-[12px] flex items-center gap-2",children:[i&&v.jsxs("div",{className:"flex items-center gap-[4px] text-[12px] leading-[16px] font-medium",style:{color:l},children:[s?v.jsx(Us,{}):v.jsx(Nc,{}),Math.abs(a),"%"]}),o&&v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:o})]})]})}const bfe=({data:e=[],onDateChange:t})=>{const[n,r]=P.useState(new Date),[i,o]=P.useState(!1),s=(g=>{const b=new Date(g);return b.setDate(b.getDate()-6),b})(n),l=g=>{try{return g.toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}catch{return""}},c=g=>{const b=new Date(g),S=new Date(b);S.setDate(S.getDate()-6),t&&t(S.toISOString(),b.toISOString())},u=()=>{const g=new Date(n);g.setDate(g.getDate()-7),r(g),c(g)},d=()=>{const g=new Date(n);g.setDate(g.getDate()+7),r(g),c(g)},f=()=>{o(g=>!g)},p=g=>{const b=g||new Date;r(b),c(b),o(!1)},h=Array.isArray(e)?e:[],m=!h.length||h.every(g=>g.no_of_visitors===0);return v.jsxs(dn,{title:"Weekly Visitor Pattern",period:`${l(s)} - ${l(n)}`,isDateSelector:!0,titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-6",onPrevClick:u,onNextClick:d,onCalendarClick:f,children:[i&&v.jsx("div",{className:"absolute top-[70px] right-[24px] z-50 bg-white shadow-lg rounded-lg",children:v.jsx(Fk,{selected:n,onChange:p,inline:!0})}),m?v.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:v.jsx(Po,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."})}):v.jsx("div",{className:"w-full h-[260px]",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(nne,{data:h,margin:{top:10,right:10,left:0,bottom:0},children:[v.jsx("defs",{children:v.jsxs("linearGradient",{id:"colorVisitors",x1:"0",y1:"0",x2:"0",y2:"1",children:[v.jsx("stop",{offset:"0%",stopColor:"#6366F1",stopOpacity:.25}),v.jsx("stop",{offset:"100%",stopColor:"#6366F1",stopOpacity:0})]})}),v.jsx(Hr,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),v.jsx(br,{dataKey:"day",type:"category",scale:"point",padding:{left:20,right:20},tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1,tickFormatter:g=>new Date(g).toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}),v.jsx(nr,{width:35,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1,domain:[0,"dataMax + 2"]}),v.jsx(Vt,{labelFormatter:g=>new Date(g).toLocaleDateString("en-GB",{day:"2-digit",month:"short"}),formatter:g=>[g,"Visitors"]}),v.jsx(EN,{type:"monotone",dataKey:"no_of_visitors",stroke:"#6366F1",strokeWidth:2,fill:"url(#colorVisitors)",dot:{r:5,stroke:"#6366F1",strokeWidth:2,fill:"#fff"},activeDot:{r:6}})]})})})]})},xfe=[{building_name:"Google",no_of_visitors:1e3},{building_name:"Uber",no_of_visitors:3500},{building_name:"ANAROCK",no_of_visitors:2e3},{building_name:"Flipkart",no_of_visitors:8e3},{building_name:"HP",no_of_visitors:1650}],wfe=({data:e})=>{const t=Array.isArray(e)&&e?.length===0,n=e==null?xfe:Array.isArray(e)?e:[];return v.jsx(dn,{title:"Organisation Wise Visitors",titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-6",children:v.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:t?v.jsx(Po,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."}):v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(oa,{data:n||[],margin:{top:10,right:10,left:0,bottom:0},barCategoryGap:35,children:[v.jsx(Hr,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),v.jsx(br,{dataKey:"building_name",tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1}),v.jsx(nr,{width:40,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1}),v.jsx(Vt,{cursor:!1}),v.jsx(jn,{dataKey:"no_of_visitors",name:"Visitors",maxBarSize:55,fill:"#3C81F6"})]})})})})};function _fe({data:e}){return v.jsx("div",{className:"h-full",children:e.map((t,n)=>{const r=parseFloat(t.delta),i=r>=0;return v.jsx(Ie,{iconClassName:"!gap-[8px]",title:v.jsx("div",{className:"text-[#64748B]",children:t.title}),icon:v.jsx(t.Icon,{className:"h-[20px] w-[20px]",style:{color:t.iconColor||"#000000"}}),className:"h-[132px]",children:v.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[v.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t.value}),v.jsxs("div",{className:`flex items-center pt-[8px] text-[12px] leading-[16px] ${t.delta?"gap-[8px]":""}`,children:[t.delta&&v.jsxs("div",{className:"flex items-center gap-[4px]",style:{color:i?"#1FA05B":"#E11D48",fontWeight:500},children:[i?v.jsx(Us,{}):v.jsx(Nc,{}),Math.abs(r),"%"]}),v.jsx("div",{style:{color:"#64748B"},children:t.deltaLabel})]})]})},n)})})}const Sfe=[{facility_name:"Table Tennis",total_booking:5},{facility_name:"Gym",total_booking:12},{facility_name:"Meeting Room A",total_booking:3},{facility_name:"Conference Hall",total_booking:8}],Efe=({x:e,y:t,payload:n})=>v.jsx("foreignObject",{x:(e||0)-80,y:(t||0)-18,width:80,height:40,children:v.jsx("div",{className:"text-[12px] leading-[16px] text-[#121212]",style:{width:"80px",whiteSpace:"normal",wordBreak:"break-word",textAlign:"left"},children:n?.value||""})});function Ofe({data:e}){const t=Array?.isArray(e)&&e?.length===0,n=e==null?Sfe:Array?.isArray(e)?e:[];return v.jsx(Ie,{title:"Bookings",icon:v.jsx(ode,{size:18,className:"text-[#DBB467]"}),className:"h-[288px]",children:v.jsx("div",{className:"w-full h-full flex items-center justify-center",children:t?v.jsx(Po,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(oa,{data:n||[],layout:"vertical",margin:{top:0,right:10,left:10,bottom:0},children:[v.jsx(br,{type:"number",allowDecimals:!1,tick:{fill:"#64748B",fontSize:12},axisLine:!0,tickLine:!1}),v.jsx(nr,{type:"category",dataKey:"facility_name",axisLine:!1,tickLine:!1,width:100,tick:v.jsx(Efe,{})}),v.jsx(Vt,{formatter:r=>[r,"Bookings"],cursor:{fill:"rgba(0,0,0,0.05)"}}),v.jsx(jn,{dataKey:"total_booking",barSize:40,fill:"#8B5CF6"})]})})})})}const Cfe=[{building_name:"Google",no_of_booking:1},{building_name:"Uber",no_of_booking:2},{building_name:"ANAROCK",no_of_booking:4},{building_name:"Flipkart",no_of_booking:2},{building_name:"HP",no_of_booking:1}];function Pfe({data:e}){const t=Array.isArray(e)&&e?.length===0,n=e==null?Cfe:Array.isArray(e)?e:[];return v.jsx(dn,{title:"Booking Trend by Organisation",titleWeight:"semi-bold",className:"h-[362px]",children:v.jsx("div",{className:"w-full h-[280px] flex items-center justify-center",children:t?v.jsx(Po,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(oa,{data:n||[],margin:{top:0,right:0,left:-15,bottom:0},children:[v.jsx(Hr,{strokeDasharray:"3 3",vertical:!1,stroke:"#E5E7EB"}),v.jsx(br,{dataKey:"building_name",axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12}}),v.jsx(nr,{allowDecimals:!1,axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12},tickFormatter:r=>`${r??0}`}),v.jsx(Vt,{formatter:r=>[r,"Bookings"],labelFormatter:r=>`Organisation: ${r}`,cursor:{fill:"rgba(0,0,0,0.05)"}}),v.jsx(jn,{dataKey:"no_of_booking",barSize:54,fill:"#12B981"})]})})})})}const kfe=[{facility_name:"Table Tennis",paid_revenue:"24000.00"},{facility_name:"Games Room",paid_revenue:"14000.00"},{facility_name:"Badminton",paid_revenue:"10000.00"},{facility_name:"GYM",paid_revenue:"4000.00"}],zd=["#3C81F6","#60A5FA","#95BFFA","#BEDAFE","#DAE6FC"];function Dfe({data:e}){const t=Array?.isArray(e)&&e?.length===0,n=e??kfe,r=Array?.isArray(n)&&n?.length>0?n?.map(s=>({name:s?.facility_name||"Unknown",value:Number(s?.paid_revenue)||0})):[],o=(r?.length>0?r?.every(s=>s?.value===0):!1)?r?.map((s,l)=>({...s,value:l===0?1:0})):r,a=s=>`Rs ${s?.toLocaleString?.("en-IN")||0}`;return v.jsx(dn,{title:"Amenity Wise Revenue",titleWeight:"semi-bold",className:"h-[362px]",children:v.jsx("div",{className:"grid grid-cols-12 gap-6 items-center h-full",children:t?v.jsx("div",{className:"col-span-12 flex items-center justify-center h-[240px]",children:v.jsx(Po,{title:"No Amenity Found",description:"Catch up all the data. Change the date range to see the data."})}):v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"col-span-5 h-[240px]",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(_o,{children:[v.jsx(Mi,{data:o||[],dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:95,stroke:"#fff",strokeWidth:1,children:o?.map?.((s,l)=>v.jsx(kn,{fill:zd?.[l%zd?.length]},`cell-${l}`))}),v.jsx(Vt,{formatter:s=>a(s),labelFormatter:s=>`Amenity: ${s||""}`,contentStyle:{borderRadius:"10px",border:"1px solid #EBEBEB",fontSize:"12px"}})]})})}),v.jsx("div",{className:"col-span-7",children:v.jsxs("div",{className:"rounded-[12px] overflow-hidden",children:[v.jsxs("div",{className:"grid grid-cols-2 px-[12px] py-[8px] bg-[#EBEBEB] text-[12px] leading-[16px] font-semibold text-[#64748B]",children:[v.jsx("div",{children:"Amenity"}),v.jsx("div",{className:"text-right",children:"Revenue"})]}),v.jsx("div",{className:"divide-y divide-[#F1F5F9]",children:r?.map?.((s,l)=>v.jsxs("div",{className:"grid grid-cols-2 px-4 py-4 text-[14px] text-[#121212]",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("span",{className:"w-[16px] h-[7px]",style:{backgroundColor:zd?.[l%zd?.length]}}),v.jsx("span",{className:"text-[#64748B] text-[12px] leading-[16px]",children:s?.name||"Unknown"})]}),v.jsx("div",{className:"text-right text-[12px] leading-[16px] text-[#64748B]",children:a(s?.value||0)})]},s?.name||l))})]})})]})})})}const Vd=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],Afe=[{asset_group_name:"Lifts",asset_count:3},{asset_group_name:"Fire Systems",asset_count:16},{asset_group_name:"Generators",asset_count:16},{asset_group_name:"HVAC",asset_count:24},{asset_group_name:"Others",asset_count:97}],Tfe=({rows:e,totalAssets:t})=>{const n=P.useMemo(()=>e?e.length===0?[]:e.map((i,o)=>({name:i.asset_group_name,value:i.asset_count||0,color:Vd[o%Vd.length]})):Afe.map((i,o)=>({name:i.asset_group_name,value:i.asset_count||0,color:Vd[o%Vd.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?v.jsx(dn,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:v.jsx("div",{className:"flex items-center justify-center h-full",children:v.jsx(Po,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):v.jsx(dn,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:v.jsxs("div",{className:"flex items-center justify-between gap-8",children:[v.jsxs("div",{className:"relative w-[240px] h-[240px]",children:[v.jsx(Ft,{width:"100%",height:"100%",children:v.jsx(_o,{children:v.jsx(Mi,{data:n,dataKey:"value",cx:"50%",cy:"50%",innerRadius:60,outerRadius:90,paddingAngle:2,stroke:"#FFFFFF",strokeWidth:2,startAngle:90,endAngle:-270,children:n.map((i,o)=>v.jsx(kn,{fill:i.color},o))})})}),v.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[v.jsx("div",{className:"text-[24px] text-[#121212]",children:r}),v.jsx("div",{className:"text-[12px] text-[#94A3B8] mt-1",children:"Total Assets"})]})]}),v.jsx("div",{className:"flex-1 max-w-[280px]",children:v.jsxs("div",{className:"rounded-[12px] overflow-hidden bg-white",children:[v.jsxs("div",{className:"flex items-center justify-between px-4 py-3 bg-[#F8FAFC]",children:[v.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Asset"}),v.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Count"})]}),n.map((i,o)=>v.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t border-[#F1F5F9]",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"w-[16px] h-[7px]",style:{backgroundColor:i.color}}),v.jsx("div",{className:"text-[13px] text-[#475569]",children:i.name})]}),v.jsx("div",{className:"text-[13px] text-[#64748B]",children:i.value})]},o))]})})]})})},Mfe=({data:e})=>{const[t,n]=P.useState({}),r=[{name:"Lifts",Cancelled:55,Closed:45,Open:50,OnHold:20,InProgress:10},{name:"Fire Systems",Cancelled:15,Closed:45,Open:15,OnHold:8,InProgress:5},{name:"Generators",Cancelled:12,Closed:45,Open:75,OnHold:18,InProgress:7},{name:"HVAC",Cancelled:45,Closed:80,Open:30,OnHold:22,InProgress:12},{name:"Others",Cancelled:18,Closed:18,Open:45,OnHold:9,InProgress:4}],i=P.useMemo(()=>e?Array.isArray(e)&&e.length===0?[]:e:r,[e]),o=a=>{const{dataKey:s}=a;n(l=>({...l,[s]:!l[s]}))};return Array.isArray(e)&&e.length===0?v.jsx(dn,{title:"Maintenance Status",titleWeight:"semi-bold",className:"h-full",children:v.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:v.jsx(Po,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):v.jsx(dn,{title:"Maintenance Status",titleWeight:"semi-bold",className:"h-full",children:v.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:Array.isArray(e)&&e.length===0?v.jsx("div",{className:"text-[#94A3B8] text-sm",children:"No Data Found"}):v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(oa,{data:i,barSize:50,margin:{top:0,right:0,left:-30,bottom:0},children:[v.jsx(Hr,{strokeDasharray:"3 3",vertical:!1}),v.jsx(br,{dataKey:"name",tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1}),v.jsx(nr,{tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1,allowDecimals:!1}),v.jsx(Vt,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},contentStyle:{borderRadius:"10px",border:"1px solid #E2E8F0",fontSize:"12px"}}),v.jsx(fh,{verticalAlign:"bottom",align:"center",iconType:"square",onClick:o,formatter:a=>v.jsx("div",{style:{color:t[a]?"#CBD5E1":"#64748B",cursor:"pointer",fontSize:"12px",display:"inline-flex",alignItems:"center"},children:a}),wrapperStyle:{paddingTop:"18px"}}),v.jsx(jn,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:t.Open}),v.jsx(jn,{dataKey:"Closed",stackId:"a",fill:"#10B981",hide:t.Closed}),v.jsx(jn,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:t.Cancelled}),v.jsx(jn,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:t.OnHold}),v.jsx(jn,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:t.InProgress})]})})})})};function Nfe({data:e}){const t=[{name:"Completed",value:Number(e?.completed||0),color:"#12B981"},{name:"Not - Completed",value:Number(e?.not_completed||0),color:"#F69E0A"},{name:"Missed",value:Number(e?.missed||0),color:"#EF4444"}],n=Number(e?.completed||0)+Number(e?.not_completed||0)+Number(e?.missed||0),r=Number(e?.completed||0);return v.jsx(dn,{title:"Patrol Status",className:"h-[362px]",titleWeight:"semi-bold",children:v.jsxs("div",{className:"flex flex-col items-center justify-center",children:[v.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(_o,{children:[v.jsx(Mi,{data:t,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:t.map((i,o)=>v.jsx(kn,{fill:i.color},`cell-${o}`))}),v.jsx(Vt,{formatter:i=>i.toLocaleString()})]})}),v.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[v.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px]",children:[r,"/",n]}),v.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),v.jsx("div",{className:"flex flex-col w-full text-[14px]",children:t.map((i,o)=>v.jsxs("div",{className:`flex items-center justify-between py-[10px] ${o!==t.length-1?"border-b border-[#F1F5F9]":""}`,children:[v.jsxs("div",{className:"flex items-center gap-[10px]",children:[v.jsx("div",{className:"inline-block w-[16px] h-[7px]",style:{backgroundColor:i.color}}),v.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.name})]}),v.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.value})]},i.name))})]})})}function jfe({incidentReports:e,incidentReportsDetails:t}){const n=Number(e?.open||0),r=Number(e?.in_progress||0),i=Number(e?.closed||0);return v.jsx(dn,{title:"Incident Reports",className:"h-[362px]",titleWeight:"semi-bold",children:v.jsxs("div",{children:[v.jsxs("div",{className:"flex w-full text-center gap-[24px]",children:[v.jsxs("div",{className:"flex-1 py-3 bg-[#FBF4F4] h-[76px] rounded",children:[v.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#AB0000]",children:n}),v.jsx("div",{className:"!text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),v.jsxs("div",{className:"flex-1 py-3 bg-[#FFFBF2] h-[76px] rounded",children:[v.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#E7A015]",children:r}),v.jsx("div",{className:"!text-[12px] leading-[16px] text-[#E7A015]",children:"In-progress"})]}),v.jsxs("div",{className:"flex-1 py-3 bg-[#F7FEFA] h-[76px] rounded",children:[v.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:i}),v.jsx("div",{className:"!text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),v.jsx("div",{className:"mt-4 space-y-2",children:t?.length>0?t.map((o,a)=>{const s=o?.severity==="Danger"?"text-[#AB0000]":o?.severity==="High"?"text-[#E7A015]":"text-[#1FA05B]";return v.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#FAFBFD] rounded-md",children:[v.jsx("div",{className:"flex items-center gap-[8px]",children:v.jsx("div",{className:"text-gray-700 font-medium",children:o?.incident_code})}),v.jsx("div",{className:`!text-[12px] font-semibold flex items-center gap-[4px] ${s}`,children:v.jsxs("div",{children:[o?.severity_level," - ",o?.severity]})})]},a)}):v.jsx("div",{className:"text-[16px] text-center text-gray-400 text-sm py-6",children:"No incidents found"})})]})})}function Rfe({columns:e=[{key:"a",label:"Organisation"},{key:"b",label:"Item"},{key:"c",label:"Orders"},{key:"d",label:"Revenue"},{key:"e",label:"AOV"},{key:"f",label:"% Revenue"}],data:t=[{a:"Google",b:"Coffee",c:"34,908",d:"₹ 57,21,288",e:"₹ 450",f:"43.6%"},{a:"Uber",b:"Paneer Combo",c:"12,000",d:"₹ 12,00,000",e:"₹ 500",f:"100%"}],rowsPerPage:n=10,setRowsPerPage:r=()=>{},currentPage:i=1,setCurrentPage:o=()=>{},totalRows:a=0,totalPages:s=1,pageOptions:l=[10,20,30,40,50]}){const c=Array.isArray(t)?t:[],u=Array.isArray(e)?e:[],d=n>0?Math.ceil(c.length/n):1,f=s||d,p=c;return console.log("safeData:",c),console.log("currentData:",p),v.jsxs("div",{className:"w-full bg-white rounded-xl h-[390px] shadow-md overflow-hidden flex flex-col",children:[v.jsx("div",{className:"grid bg-slate-600 text-white text-sm font-medium",style:{gridTemplateColumns:`repeat(${u.length}, 1fr)`},children:u.map((h,m)=>v.jsx("div",{className:"px-6 py-4 text-[16px] leading-[20px]",children:h.label},m))}),v.jsx("div",{className:"flex-1 overflow-y-auto",children:p.length>0?p.map((h,m)=>v.jsx("div",{className:"grid text-[14px] leading-[18px] text-gray-700 hover:bg-gray-50 transition",style:{gridTemplateColumns:`repeat(${u.length}, 1fr)`},children:u.map((g,b)=>{const S=h[g.key],w=typeof S=="string"&&S.includes("%"),x=S==="100%"?"bg-green-100 text-green-600":"bg-red-100 text-red-600";return v.jsx("div",{className:"px-6 py-4 bg-gray-50",children:w?v.jsx("div",{className:`inline-block px-3 py-1 rounded-full text-[14px] font-semibold ${x}`,children:S}):v.jsx("div",{children:S??"-"})},b)})},m)):v.jsx(Po,{title:"No Data Found",description:"Catch up all the data. Change the date range to see the data."})}),v.jsxs("div",{className:"flex justify-end items-center px-6 py-4 text-sm bg-white gap-8",children:[v.jsxs("div",{className:"flex items-center gap-2 text-gray-600 text-[14px]",children:[v.jsx("div",{children:"Rows per page:"}),v.jsx("select",{value:n,onChange:h=>{r(Number(h.target.value)),o(1)},className:"border rounded px-2 py-1",children:l.map((h,m)=>v.jsx("option",{value:h,children:h},m))}),v.jsxs("div",{className:"ml-4 text-[14px]",children:[c?.length===0?"0–0":`1–${c?.length}`," ","of ",a||c?.length]})]}),v.jsxs("div",{className:"flex items-center space-x-2 text-gray-600 text-[14px]",children:[v.jsx("button",{onClick:()=>o(1),disabled:i===1,className:"p-2 rounded hover:bg-gray-100 disabled:opacity-40",children:v.jsx(tde,{size:18})}),v.jsx("button",{onClick:()=>o(h=>h-1),disabled:i===1,className:"p-2 rounded hover:bg-gray-100 disabled:opacity-40",children:v.jsx(LR,{size:18})}),v.jsx("button",{onClick:()=>o(h=>h+1),disabled:i===f,className:"p-2 rounded hover:bg-gray-100 disabled:opacity-40",children:v.jsx(FR,{size:18})}),v.jsx("button",{onClick:()=>o(f),disabled:i===f,className:"p-2 rounded hover:bg-gray-100 disabled:opacity-40",children:v.jsx(rde,{size:18})})]})]})]})}exports.AccessPointsUsage=hfe;exports.Accounting=Sue;exports.Amenities=nfe;exports.AmenitiesStatsCard=_fe;exports.AmenityWiseRevenue=Dfe;exports.AssetValueBreakdown=Rue;exports.AssetsByType=Tfe;exports.BlockWiseOccupancy=gue;exports.BookingTrendChart=Pfe;exports.Bookings=Ofe;exports.Budgets=Pue;exports.Card=Ie;exports.CardAccess=BR;exports.CashBankBalance=Due;exports.CommercialAccessOverview=pfe;exports.CommercialGuardPatrols=Nfe;exports.CommercialIncidentReports=jfe;exports.CommercialOccupancy=Jde;exports.CommercialReportTable=Rfe;exports.Community=toe;exports.Complaints=Cde;exports.ComplaintsByLevel=Tde;exports.DuesAgeing=Tue;exports.EmployeeFootfall=efe;exports.Engagement=noe;exports.EngagementStatsGrid=Zde;exports.EventsUtilisation=Vde;exports.ExpenseCategories=Nue;exports.Facilities=roe;exports.FinanceSummary=ioe;exports.FoodBeverages=tfe;exports.GateAndSecurityStatsGrid=Sde;exports.GateUpdates=Voe;exports.GuardPatrols=dde;exports.Header=c3;exports.Helpdesk=Hoe;exports.HelpdeskStatsGrid=Bde;exports.HourlyTrafficFlow=pde;exports.IncidentReports=gde;exports.IncomeExpenditure=RR;exports.MainHeader=_3;exports.MaintenanceStatus=Mfe;exports.MetricCard=yfe;exports.MobileAccess=BR;exports.MoveInOutTrends=yue;exports.NoticeBoardStatus=Ude;exports.OccupancyOverview=pue;exports.OrganisationWiseVisitors=wfe;exports.RequestBox=Nde;exports.ResidentOverview=mue;exports.RevenuebyCategory=Lue;exports.SingleStats=qde;exports.StaffAttendance=bde;exports.StatsGrid=zue;exports.TicketEscalation=rfe;exports.TicketStatus=ofe;exports.Tickets=jR;exports.TicketsperCategory=vfe;exports.UnitStatus=jR;exports.VisitorUpdates=ufe;exports.WeeklyVisitorPattern=bfe;
|
|
367
|
+
*/const lde=[["path",{d:"M19 5a2 2 0 0 0-2 2v11",key:"s41o68"}],["path",{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"rd2r6e"}],["path",{d:"M7 13h10",key:"1rwob1"}],["path",{d:"M7 9h10",key:"12czzb"}],["path",{d:"M9 5a2 2 0 0 0-2 2v11",key:"x0q4gh"}]],cde=Co("waves-ladder",lde),dn=({title:e,icon:t,period:n,isDateSelector:r=!1,children:i,footer:o,className:a="",titleWeight:s,titleColor:l,iconClassName:c,titleClassName:u,childrenClassName:d,onCalendarClick:f,onPrevClick:p,onNextClick:h})=>{const m=s==="semi-bold"?600:500;return v.jsxs("div",{className:`relative bg-white rounded-[12px] p-[24px] shadow-[0_0_12px_0_#EAF2FF] ${a}`,children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[t&&v.jsx("div",{className:c,children:t}),v.jsx("div",{style:{fontWeight:m,color:l||"#121212"},className:u||"text-[20px] leading-[24px]",children:e})]}),n&&!r&&v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:n}),r&&v.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 rounded-lg bg-white text-sm text-[#64748B]",children:[v.jsx(Que,{size:16,className:"text-[#64748B] cursor-pointer",onClick:f}),v.jsx(LR,{size:16,className:"cursor-pointer",onClick:p}),v.jsx("span",{className:"text-[12px] leading-[16px] text-[#64748B]",children:n}),v.jsx(FR,{size:16,className:"cursor-pointer",onClick:h})]})]}),v.jsx("div",{className:`flex-1 min-h-0 mt-4 ${d}`,children:i}),o&&v.jsx("div",{className:"mt-4 pt-4 border-t border-gray-100 text-[12px] text-[#64748B]",children:o})]})},ude={completed:18,not_completed:6,missed:4};function dde({data:e={}}){const t=e&&Object.keys(e).length>0?e:ude,n=[{name:"Completed",value:Number(t?.completed??0),color:"#12B981"},{name:"Delayed",value:Number(t?.not_completed??0),color:"#EF4444"},{name:"Missed",value:Number(t?.missed??0),color:"#F69E0A"}],r=Number(t?.completed??0)+Number(t?.not_completed??0)+Number(t?.missed??0),i=Number(t?.completed??0);return v.jsx(dn,{title:"Guard Patrols",className:"h-[362px]",titleWeight:"semi-bold",children:v.jsxs("div",{className:"flex flex-col items-center justify-center",children:[v.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(_o,{children:[v.jsx(Mi,{data:n??[],innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:n?.map?.((o,a)=>v.jsx(kn,{fill:o?.color??"#ccc"},`cell-${a}`))}),v.jsx(Vt,{formatter:o=>Number(o??0).toLocaleString()})]})}),v.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[v.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px]",children:[i??0,"/",r??0]}),v.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),v.jsx("div",{className:"flex flex-col w-full text-[14px]",children:n?.length?n?.map?.((o,a)=>v.jsxs("div",{className:`flex items-center justify-between py-[10px] ${a!==(n?.length??0)-1?"border-b border-[#F1F5F9]":""}`,children:[v.jsxs("div",{className:"flex items-center gap-[10px]",children:[v.jsx("div",{className:"inline-block w-[16px] h-[7px]",style:{backgroundColor:o?.color??"#ccc"}}),v.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:o?.name??"-"})]}),v.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:o?.value??0})]},o?.name??a)):v.jsx("div",{className:"text-center text-gray-400 text-sm py-6",children:"No patrol data"})})]})})}$n.register(Eo,Oo,r1,n1,Yr,Jr);const fde=["10 AM","12 PM","2 PM","4 PM","6 PM","8 PM","10 PM"],Wd={guest:[9,5,12,7,3,6,4],cab:[15,12,10,14,7,12,8],delivery:[22,18,16,20,22,14,17],service:[13,12,8,9,5,10,7]},pde=({data:e})=>{const n={labels:Array.isArray(e?.labels)&&e.labels.length>0?e.labels:fde,datasets:[{label:"Guest",data:Array.isArray(e?.guest)&&e.guest.length>0?e.guest:Wd.guest,borderColor:"#EF4444",backgroundColor:"rgba(239,68,68,0.15)",pointBackgroundColor:"#EF4444",pointStyle:"rectRot",fill:!1},{label:"Cab",data:Array.isArray(e?.cab)&&e.cab.length>0?e.cab:Wd.cab,borderColor:"#7C3AED",backgroundColor:"rgba(124,58,237,0.15)",pointBackgroundColor:"#7C3AED",pointStyle:"rectRot",fill:!1},{label:"Delivery",data:Array.isArray(e?.delivery)&&e.delivery.length>0?e.delivery:Wd.delivery,borderColor:"#10B981",backgroundColor:"rgba(16,185,129,0.15)",pointBackgroundColor:"#10B981",pointStyle:"rectRot",fill:!1},{label:"Service",data:Array.isArray(e?.service)&&e.service.length>0?e.service:Wd.service,borderColor:"#F59E0B",backgroundColor:"rgba(245,158,11,0.15)",pointBackgroundColor:"#F59E0B",pointStyle:"rectRot",fill:!1}]},r={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:i=>i[0].label,label:i=>`${i.dataset.label} ${i.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 v.jsx(Ie,{title:"Hourly Traffic Flow",className:"w-full h-[362px]",period:v.jsx(Wr,{className:"text-[20px] text-[#884EA7]"}),children:v.jsx(o1,{data:n,options:r})})},hde={open:4,in_progress:7,closed:12},mde=[{incident_code:"INC-401",severity_level:"L1",severity:"Danger"},{incident_code:"INC-402",severity_level:"L2",severity:"High"},{incident_code:"INC-403",severity_level:"L3",severity:"Low"}];function gde({incidentReports:e={},incidentReportsDetails:t=[]}){const n=e&&Object.keys(e).length>0?e:hde,r=Array.isArray(t)&&t.length>0?t:mde,i=Number(n?.open??0),o=Number(n?.in_progress??0),a=Number(n?.closed??0);return v.jsx(dn,{title:"Incident Reports",className:"h-[362px]",titleWeight:"semi-bold",children:v.jsxs("div",{children:[v.jsxs("div",{className:"flex w-full text-center gap-[24px]",children:[v.jsxs("div",{className:"flex-1 py-3 bg-[#FBF4F4] h-[76px] rounded",children:[v.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#AB0000]",children:i??0}),v.jsx("div",{className:"!text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),v.jsxs("div",{className:"flex-1 py-3 bg-[#FFFBF2] h-[76px] rounded",children:[v.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#E7A015]",children:o??0}),v.jsx("div",{className:"!text-[12px] leading-[16px] text-[#E7A015]",children:"In-progress"})]}),v.jsxs("div",{className:"flex-1 py-3 bg-[#F7FEFA] h-[76px] rounded",children:[v.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:a??0}),v.jsx("div",{className:"!text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),v.jsx("div",{className:"mt-4 space-y-2",children:r?.length?r?.map?.((s,l)=>{const c=s?.severity==="Danger"?"text-[#AB0000]":s?.severity==="High"?"text-[#E7A015]":"text-[#1FA05B]";return v.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#FAFBFD] rounded-md",children:[v.jsx("div",{className:"flex items-center gap-[8px]",children:v.jsx("div",{className:"text-gray-700 font-medium",children:s?.incident_code??"-"})}),v.jsx("div",{className:`!text-[12px] font-semibold flex items-center gap-[4px] ${c}`,children:v.jsxs("div",{children:[s?.severity_level??"-"," - ",s?.severity??"-"]})})]},l)}):v.jsx("div",{className:"text-center text-gray-400 text-sm py-6",children:"No incidents found"})})]})})}const vde=[{total_staff:42,absent_staff:6}],yde=[{staff_role_name:"Security Guard",total_staff:18,present_staff:16},{staff_role_name:"Supervisor",total_staff:8,present_staff:7},{staff_role_name:"Technician",total_staff:10,present_staff:9}];function bde({staffPresentAbsent:e,staffPresentByRole:t}){const n=Array.isArray(e)&&e.length>0?e:vde,r=Array.isArray(t)&&t.length>0?t:yde,i=n?.[0]?.total_staff??0,o=n?.[0]?.absent_staff??0,a=(i??0)-(o??0);return v.jsx(dn,{title:"Staff Attendance",className:"h-[362px]",titleWeight:"semi-bold",children:v.jsxs("div",{children:[v.jsxs("div",{className:"flex gap-[24px] text-center",children:[v.jsxs("div",{className:"flex-1 py-3 bg-[#F7FEFA] rounded h-[76px]",children:[v.jsx("div",{className:"text-[24px] font-medium text-[#1FA05B]",children:a??0}),v.jsx("div",{className:"text-[12px] text-[#1FA05B]",children:"Present"})]}),v.jsxs("div",{className:"flex-1 py-3 bg-[#FBF4F4] rounded h-[76px]",children:[v.jsx("div",{className:"text-[24px] font-medium text-[#AB0000]",children:o??0}),v.jsx("div",{className:"text-[12px] text-[#AB0000]",children:"Absent"})]})]}),v.jsx("div",{className:"mt-4 space-y-2 overflow-y-auto max-h-[200px]",children:r?.length?r?.map?.((s,l)=>{const c=Number(s?.total_staff??0),u=Number(s?.present_staff??0);return v.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#FAFBFD] rounded-md",children:[v.jsx("div",{className:"text-[#121212] text-[14px] leading-[18px] font-medium",children:s?.staff_role_name??"-"}),v.jsxs("div",{className:"text-[14px] leading-[20px] text-[#64748B]",children:[u??0,"/",c??0]})]},l)}):v.jsx("div",{className:"text-center text-[16px] text-gray-400 text-sm py-6",children:"No staff data"})})]})})}function xde(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 wde({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=su,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return v.jsxs(Ie,{title:e,icon:v.jsx("div",{className:"h-6 w-6 grid place-items-center",children:v.jsx(o,{className:`h-6 w-6 ${a}`})}),children:[v.jsx("div",{className:"text-4xl font-semibold tracking-tight text-[#121212]",children:t}),v.jsxs("div",{className:"flex items-center gap-[8px] text-[14px]",children:[v.jsx("div",{className:i?"text-emerald-600 font-medium":"text-rose-600 font-medium",children:n}),v.jsx("div",{className:"text-slate-500",children:r})]})]})}const _de=[{title:"Total Visitors",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:yb,iconColor:"text-[#329DFF]"},{title:"Active Incidents",value:73,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:eoe,iconColor:"text-[#F69E0A]"},{title:"Missed Patrols",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:xde,iconColor:"text-[#AB0000]"},{title:"Parking Usage",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:y3,iconColor:"text-[#36AB6C]"}];function Sde({data:e}){const t=Array.isArray(e)&&e.length>0?e:_de;return v.jsx("div",{className:"px-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:t.map((n,r)=>v.jsx(wde,{...n},r))})}const Ede=[{title:"Maintenance",total:12,pending:3},{title:"Security",total:8,pending:1},{title:"Housekeeping",total:6,pending:2},{title:"Utilities",total:10,pending:4}],Ode=(e="")=>e.replace(/</g,"<").replace(/>/g,">").replace(/<[^>]*>/g,"").trim();function Cde({data:e}){const t=Array.isArray(e?.complaints_by_category)&&e.complaints_by_category.length>0?e.complaints_by_category.map(n=>({title:Ode(n.category_name)||"—",total:n.total||0,pending:n.pending||0})):Ede;return v.jsx(Ie,{title:"Complaints",className:"h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:v.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((n,r)=>v.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-lg p-3 h-[62px]",children:[v.jsxs("div",{className:"flex flex-col",children:[v.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),v.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),v.jsxs("div",{className:"flex flex-col items-end",children:[v.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},r))})})}const Pde=e=>{const t={0:"𝟎",1:"𝟏",2:"𝟐",3:"𝟑",4:"𝟒",5:"𝟓",6:"𝟔",7:"𝟕",8:"𝟖",9:"𝟗"};return String(e).split("").map(n=>t[n]||n).join("")},kde=[{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}],Dde=({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 v.jsxs("div",{style:{backgroundColor:"#0B0B0B",padding:"14px 40px 14px 18px",borderRadius:"10px",color:"#ffffff"},children:[v.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=Pde(a);return v.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:o<r.length-1?"8px":"0",fontSize:"12px"},children:[v.jsx("div",{style:{width:"8px",height:"8px",backgroundColor:i.color,transform:"rotate(45deg)",marginRight:"8px"}}),v.jsx("span",{style:{color:"D1D3D4",minWidth:"100px"},children:i.label}),v.jsx("span",{style:{marginLeft:"auto",fontWeight:"700"},children:s})]},i.key)})]})},Ade=()=>{const e=[{label:"Open",color:"#EF4444"},{label:"In Progress",color:"#F59D0D"},{label:"Closed",color:"#12B981"}];return v.jsx("div",{style:{display:"flex",justifyContent:"space-between",gap:"15px"},children:e.map(t=>v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[v.jsx("div",{style:{width:"6px",height:"6px",backgroundColor:t.color,transform:"rotate(45deg)"}}),v.jsx("span",{style:{fontSize:"14px"},children:t.label})]},t.label))})},Tde=({data:e})=>{const t=P.useMemo(()=>(Array.isArray(e?.complaints_by_level)&&e.complaints_by_level.some(l=>Number(l.total)>0)?e.complaints_by_level:kde).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=P.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 v.jsxs(Ie,{title:"Complaints by Level",className:"w-full h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:[v.jsx(Ft,{width:"100%",height:"85%",children:v.jsxs(oa,{data:t,margin:{top:5,right:-25,left:-30,bottom:5},children:[v.jsx(Hr,{strokeDasharray:"0",vertical:!1}),v.jsx(br,{dataKey:"level"}),v.jsx(nr,{domain:[0,r],ticks:Array.from({length:i+1},(a,s)=>s*o)}),v.jsx(Vt,{content:v.jsx(Dde,{}),cursor:!1}),v.jsx(jn,{dataKey:"open_count",stackId:"a",fill:"#EF4444",barSize:44,radius:[0,0,0,0]}),v.jsx(jn,{dataKey:"in_progress_count",stackId:"a",fill:"#F59D0D",barSize:44,radius:[0,0,0,0]}),v.jsx(jn,{dataKey:"closed_count",stackId:"a",fill:"#12B981",barSize:44,radius:[0,0,0,0]})]})}),v.jsx(Ade,{})]})},Mde=[{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 Nde({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})):Mde;return v.jsx(Ie,{title:"Request Box",className:"h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:v.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((n,r)=>v.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-lg p-3 h-[62px]",children:[v.jsxs("div",{className:"flex flex-col",children:[v.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),v.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),v.jsxs("div",{className:"flex flex-col items-end",children:[v.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},`${n.title}-${r}`))})})}function jde(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 Rde=["open_complaints","pending_requests","avg_response_time","resolution_rate"],Ide={open_complaints:{title:"Open Complaints",Icon:Vk,iconColor:"#AB0000",deltaLabel:"Compared to last month"},pending_requests:{title:"Pending Requests",Icon:jde,iconColor:"#E7A015",deltaLabel:"Compared to last month"},avg_response_time:{title:"Avg Response Time",Icon:P3,iconColor:"#1FA05B",deltaLabel:"Compared to last month"},resolution_rate:{title:"Resolution Rate",Icon:S3,iconColor:"#329DFF",deltaLabel:"Compared to last month"}},Lde=({children:e,size:t=28,lineHeight:n=32,weight:r=500,color:i="#121212"})=>v.jsx("div",{style:{fontWeight:r,fontSize:`${t}px`,lineHeight:`${n}px`,color:i},children:e}),Fde={primary:{size:28,lineHeight:32,weight:500}},$de={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 Bde({id:e,data:t}){return e&&t&&!t[e]&&t.current!==void 0?v.jsx(cP,{id:e,data:t}):v.jsx("div",{className:"px-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:Rde.map(n=>v.jsx(cP,{id:n},n))})}function cP({id:e,data:t}){const n=Ide[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=su,iconColor:a,deltaLabel:s}=n,l=t&&Object.keys(t).length>0?t:$de[e],c=r(e,l?.current),u=l?.trend_percent??"—";return l?.direction==="good"||l?.direction,v.jsx("div",{className:"h-[132px]",children:v.jsxs(Ie,{title:i,titleColor:a,icon:v.jsx("div",{className:"h-[20px] w-[20px] flex items-center justify-center",children:v.jsx(o,{className:"h-[20px] w-[20px]",style:{color:a}})}),childrenClassName:"!space-y-[12px]",iconClassName:"!gap-[12px]",children:[v.jsx(Lde,{...Fde.primary,children:c}),v.jsxs("div",{className:"flex items-center gap-[8px] text-[12px] leading-[16px]",children:[v.jsx(bb,{value:u}),v.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:s})]})]})})}const Wde=[{title:"Holi Celebration",date:"25 Jun 2025",rsvp:"78/100",utilisation:71,status:"Upcoming"},{title:"Maintenance Meeting",date:"25 Jun 2025",rsvp:"45/60",utilisation:75,status:"Completed"}];function zde({title:e,date:t,rsvp:n,utilisation:r,status:i}){return v.jsxs("div",{className:" bg-[#F8FAFC] h-[106px] px-3 mt-3",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("div",{className:"text-[16px] leading-[20px] font-semibold text-[#121212]",children:e}),v.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})]}),v.jsx("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:t}),v.jsxs("div",{className:"flex justify-between items-center mt-2",children:[v.jsxs("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:[n," RSVP"]}),v.jsxs("div",{className:"text-[#3C82F6] text-[14px] leading-[18px] font-medium",children:[r,"% utilisation"]})]}),v.jsx("div",{className:"w-full bg-[#F8FAFC] h-[6px] rounded mt-2 mb-3",children:v.jsx("div",{className:"h-[6px] rounded bg-[#3C82F6]",style:{width:`${r}%`}})})]})}function Vde({data:e}){const t=Array.isArray(e)&&e.length>0?e:Wde;return v.jsx(Ie,{title:"Events Utilisation",period:v.jsx(Wr,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"w-full h-[360px]",children:v.jsx("div",{children:t.map((n,r)=>v.jsx(zde,{...n},`${n.title}-${r}`))})})}const Hde=[{label:"Active",value:138,subLabel:"3 expiring soon",bgColor:"bg-[#F0FFF7]",textColor:"text-[#1FA05B]"},{label:"Scheduled",value:13,subLabel:"4 this week",bgColor:"bg-[#FFFBF2]",textColor:"text-[#E7A015]"},{label:"Recurring",value:3,subLabel:"All active",bgColor:"bg-[#EDF6FF]",textColor:"text-[#329DFF]"},{label:"Expired",value:7,subLabel:"4 recent",bgColor:"bg-[#F6F6F6]",textColor:"text-[#64748B]"}];function Yde({label:e,value:t,subLabel:n,bgColor:r,textColor:i}){return v.jsxs("div",{className:`rounded-lg p-4 ${r} h-[124px]`,children:[v.jsx("div",{className:`text-[16px] font-medium ${i} leading-[20px]`,children:e}),v.jsx("div",{className:"mt-4 text-[28px] leading-[32px] font-semibold text-[#121212]",children:t}),v.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-2",children:n})]})}function Ude({data:e}){const t=Array.isArray(e)&&e.length>0?e:Hde;return v.jsx(Ie,{title:"Notice Board Status",period:v.jsx(Wr,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"w-full h-[360px]",children:v.jsx("div",{className:"grid grid-cols-2 gap-[16px]",children:t.map((n,r)=>v.jsx(Yde,{...n},`${n.label}-${r}`))})})}function $R(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 Kde({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=su,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return v.jsx(Ie,{title:e,icon:v.jsx("div",{className:`h-6 w-6 grid place-items-center rounded-md ${s}`,children:v.jsx(o,{className:`h-4 w-4 ${a}`})}),className:"h-[132px]",children:v.jsxs("div",{children:[v.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),v.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[v.jsx("div",{className:i?"text-[#1FA05B] font-medium":"text-rose-600 font-medium",children:n}),v.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}function qde({data:e}){const t=[{title:e?.title||"Total Bookings",value:145,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:$R,iconColor:"text-emerald-600",iconBg:"bg-emerald-50"}];return v.jsx("div",{className:"h-full",children:t.map((n,r)=>v.jsx(Kde,{...n},r))})}function Gde(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 Xde({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=su,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return v.jsx(Ie,{title:e,icon:v.jsx("div",{className:`h-6 w-6 grid place-items-center rounded-md ${s}`,children:v.jsx(o,{className:`h-4 w-4 ${a}`})}),className:"h-[132px]",children:v.jsxs("div",{children:[v.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),v.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[v.jsx("div",{className:i?"text-[#1FA05B] font-medium":"text-rose-600 font-medium",children:n}),v.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}const Qde=[{title:"Notice",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:$R,iconColor:"text-emerald-600",iconBg:"bg-emerald-50"},{title:"Post",value:83,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:b3,iconColor:"text-[#329DFF]",iconBg:"bg-emerald-50"},{title:"Poll",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Zie,iconColor:"text-[#FA7E28]",iconBg:"bg-orange-100"},{title:"Poll",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:Gde,iconColor:"text-[#DBB467]",iconBg:"bg-yellow-100"}];function Zde({data:e}){const t=Array.isArray(e)&&e.length>0?e:Qde;return v.jsx("div",{className:"px-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:t.map((n,r)=>v.jsx(Xde,{...n},r))})}const uP=({value:e=0,total:t=1,colorClass:n="",label:r=""})=>{const i=Number(e)||0,o=Number(t)||1,a=Math.max(0,Math.min(100,i/o*100)),s=n==="bg-[#3C81F6]"?"text-[#8B5CF6]":n==="bg-[#8B5CF6]"?"text-[#12B981]":"text-slate-600";return v.jsxs("div",{className:"flex flex-col items-start",children:[v.jsx("div",{className:"w-2/3 min-w-[80px] h-5 rounded-full overflow-hidden",children:v.jsx("div",{className:`h-[11px] rounded-full ${n||""}`,style:{width:n==="bg-[#12B981]"?`${a+45}%`:`${a}%`}})}),v.jsx("div",{className:`${s} !text-[12px] font-bold mt-1`,children:i??0}),v.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-1",children:r??""})]})},Jde=({data:e,occupiedUnits:t=1,EmployeesCount:n=8910,AdminsCount:r=910})=>{const i=e?.total_occupants!==void 0&&e?.total_occupants!==null?Number(e?.total_occupants)||0:Number(t)||0,o=e?.total_members!==void 0&&e?.total_members!==null?Number(e?.total_members)||0:Number(n)||0,a=e?.total_admins!==void 0&&e?.total_admins!==null?Number(e?.total_admins)||0:Number(r)||0,s=(o||0)+(a||0);return v.jsx("div",{children:v.jsxs("div",{className:"bg-white !border-[0.5px] !border-[#EBEBEB] rounded-xl shadow-[0_0_12px_0_#EAF2FF] p-[16px] h-[128px]",children:[v.jsxs("div",{className:"flex items-center gap-[12px] h-[20px]",style:{marginBottom:"24px"},children:[v.jsx(yb,{className:"!text-[20px] text-[#329DFF]"}),v.jsx("div",{className:"font-medium text-[#121212] text-[16px] leading-[20px]",children:"Occupancy Overview"})]}),v.jsxs("div",{className:"flex items-start justify-between",children:[v.jsxs("div",{className:"flex flex-col gap-[4px]",children:[v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B] font-normal",children:"Total Occupants"}),v.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:i??0})]}),v.jsxs("div",{className:"flex items-end gap-1",children:[v.jsx(uP,{value:o??0,total:s||1,colorClass:"bg-[#3C81F6]",label:(o??0)<=1?"Employee":"Employees"}),v.jsx(uP,{value:a??0,total:s||1,colorClass:"bg-[#8B5CF6]",label:(a??0)<=1?"Admin":"Admins"})]})]})]})})};$n.register(Eo,Oo,Pl,Yr);const efe=()=>{const t={labels:["HP","Adobe","Anarock","Swiggy","Infosys","Zepto"],datasets:[{data:[2e3,1700,1500,1200,900,800],backgroundColor:["#3C81F6","#3C81F6","#3C81F6","#3C81F6","#3C81F6","#3C81F6"],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,min:0,max:2e3,ticks:{stepSize:500,color:"#64748B",callback:r=>r},grid:{display:!1,color:"#E5E7EB",borderDash:[4,4],drawBorder:!1}}}};return v.jsxs(Ie,{className:"w-full h-[238px]",title:"Employee Footfall (Static Data)",period:"Today",icon:v.jsx(Gue,{className:"!text-[24px] text-[#8B5CF6]"}),children:[v.jsxs("div",{className:"mb-[16px] mt-[8px] flex flex-col gap-[4px]!",children:[v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Employees Inside"}),v.jsx("div",{className:"text-[20px] leading-[24px] font-medium text-[#3C81F6]",children:"7,500"})]}),v.jsx("div",{className:"h-[110px]",children:v.jsx(kl,{data:t,options:n})})]})};function tfe(){return v.jsx(Ie,{className:"h-[324px]",title:"Food & Beverages (Static Data)",period:"Today",icon:v.jsx(sde,{className:"!text-[24px] text-[#FA7E28]"}),children:v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsxs("div",{className:"grid grid-cols-2 gap-6 mb-6",children:[v.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Orders"}),v.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:247})]}),v.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Revenue Generated"}),v.jsxs("div",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF]",children:["₹ ","82K"]}),v.jsxs("div",{className:"inline-flex items-center gap-1 text-[10px] leading-[14px] px-2 py-1 rounded-full text-[#1FA05B] bg-green-50",children:[v.jsx(Us,{}),8,"%",v.jsx("span",{children:"from last month"})]})]})]}),v.jsxs("div",{className:"mt-[16px]",children:[v.jsxs("div",{className:"mb-[16px]",children:[v.jsxs("div",{className:"flex justify-between text-sm mb-2",children:[v.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:"HP"}),v.jsxs("div",{className:"font-medium text-[12px] leading-[16px] flex items-center",children:[v.jsx("div",{className:"text-[#64748B] inline-block",children:"120 orders"}),v.jsx("div",{className:"mx-2 text-[#121212] inline-block",children:"₹ 45K"})]})]}),v.jsx("div",{className:"h-[11px] bg-gray-100 rounded-full",children:v.jsx("div",{className:"h-[11px] bg-blue-500 rounded-full",style:{width:"70%"}})})]}),v.jsxs("div",{className:"mb-[16px]",children:[v.jsxs("div",{className:"flex justify-between text-sm mb-2",children:[v.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:"Adobe"}),v.jsxs("div",{className:"font-medium text-[12px] leading-[16px] flex items-center",children:[v.jsx("div",{className:"text-[#64748B] inline-block",children:"85 orders"}),v.jsx("div",{className:"mx-2 text-[#121212] inline-block",children:"₹ 23K"})]})]}),v.jsx("div",{className:"h-[11px] bg-gray-100 rounded-full",children:v.jsx("div",{className:"h-[11px] bg-red-500 rounded-full",style:{width:"50%"}})})]}),v.jsxs("div",{className:"mb-[16px]",children:[v.jsxs("div",{className:"flex justify-between text-sm mb-2",children:[v.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:"Anarock"}),v.jsxs("div",{className:"font-medium text-[12px] leading-[16px] flex items-center",children:[v.jsx("div",{className:"text-[#64748B] inline-block",children:"42 orders"}),v.jsx("div",{className:"mx-2 text-[#121212] inline-block",children:"₹ 14K"})]})]}),v.jsx("div",{className:"h-[11px] bg-gray-100 rounded-full",children:v.jsx("div",{className:"h-[11px] bg-purple-700 rounded-full",style:{width:"25%"}})})]})]})]})})}function nfe({data:e}){const t=e?.amenity_summary?{amenitySummary:{totalBookings:e?.amenity_summary?.total_bookings??0,todayPaidRevenue:e?.amenity_summary?.today_paid_revenue??"0.00",growthPercentage:e?.amenity_summary?.growth_percentage??null,bookingGrowth:e?.amenity_summary?.booking_growth??null,currencyType:e?.amenity_summary?.currency_type??"₹"},chartData:Array.isArray(e?.chart_data)?e.chart_data.map(h=>({facility_name:h?.facility_name,total_bookings:h?.total_bookings??0,paid_revenue:h?.paid_revenue??"0",isPaid:h?.is_paid===!0})):[]}:e||{},n=t?.amenitySummary||{},i=(Array.isArray(t?.chartData)?t.chartData:[]).map(h=>({...h,isPaid:h?.isPaid===!0})),o=i.length>0&&i.every(h=>h?.isPaid===!1),a=n?.totalBookings||0,s=n?.bookingGrowth;let l=0;if(typeof s=="number")l=s;else if(typeof s=="string"){const h=s.replace("%","").trim(),m=Number(h);l=isNaN(m)?0:m}const c=i.reduce((h,m)=>{const g=m?.total_bookings||0;return h+g},0),u=i.map(h=>{const m=h?.total_bookings||0,g=h?.isPaid?`${n?.currencyType||"₹"} ${h?.paid_revenue||"0.00"}`:"",b=c>0?Math.round(m/c*100):0;return{name:h?.facility_name||"Unknown",bookings:m,revenue:g,percentage:b,color:h?.isPaid?"bg-violet-500":"bg-slate-400",isPaid:h?.isPaid}}),d=n?.growthPercentage;let f=null;if(typeof d=="number")f=d;else if(typeof d=="string"){const h=d.replace("%","").trim(),m=Number(h);f=isNaN(m)?null:m}const p=f!==null?f>=0:!0;return v.jsx(Ie,{className:"h-[324px]",title:"Amenities",period:"Today",icon:v.jsx(cde,{className:"!text-[24px] text-[#8B5CF6]"}),children:v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsxs("div",{className:"grid grid-cols-2 gap-6 mb-6",children:[v.jsxs("div",{children:[v.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Bookings"}),v.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:a})]}),v.jsxs("div",{className:`inline-flex items-center gap-1 text-[10px] leading-[14px] px-2 py-1 rounded-full ${l>=0?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[l>=0?v.jsx(Us,{}):v.jsx(Nc,{}),l,"%",v.jsx("span",{children:"from last month"})]})]}),!o&&v.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Revenue Generated"}),v.jsxs("div",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF]",children:[n?.currencyType||"₹"," ",n?.todayPaidRevenue??"0.00"]}),f!==null&&v.jsxs("div",{className:`inline-flex items-center gap-1 text-[10px] leading-[14px] px-2 py-1 rounded-full ${p?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[p?v.jsx(Us,{}):v.jsx(Nc,{}),f,"%",v.jsx("span",{children:"from last month"})]})]})]}),v.jsx("div",{className:"mt-[16px]",children:u.length>0?u.map((h,m)=>v.jsxs("div",{className:"mb-[16px]",children:[v.jsxs("div",{className:"flex justify-between text-sm mb-2",children:[v.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:h?.name}),v.jsxs("div",{className:"font-medium text-[12px] leading-[16px]",children:[v.jsxs("div",{className:"text-[#64748B] inline",children:[h?.bookings," ",h?.bookings<=1?"booking":"bookings"]}),h?.isPaid&&v.jsx("div",{className:"mx-2 text-[#121212] inline",children:h?.revenue})]})]}),v.jsx("div",{className:"h-[11px] bg-gray-100 rounded-full",children:v.jsx("div",{className:`h-[11px] rounded-full ${h?.color}`,style:{width:`${h?.percentage}%`}})})]},m)):v.jsx("div",{className:"flex items-center justify-center h-[120px]",children:v.jsx("div",{className:"text-[12px] text-[#94A3B8]",children:"No amenity usage data available"})})})]})})}$n.register(Eo,Oo,Pl,Yr,Jr);function rfe({data:e=[]}){const t=[{level:"L1",open:55,in_progress:22,on_hold:15,closed:6},{level:"L2",open:45,in_progress:25,on_hold:18,closed:5},{level:"L3",open:58,in_progress:23,on_hold:14,closed: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)),o.push(Number(n[u].in_progress)),a.push(Number(n[u].on_hold)),s.push(Number(n[u].cancelled));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:"#FB2C36",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 v.jsx(Ie,{className:"h-[267px]",title:"Ticket Escalation Levels",period:"Today",icon:v.jsx(E3,{className:"!text-[24px] text-[#3C81F6]"}),children:v.jsx("div",{className:"h-full",children:v.jsx(kl,{data:l,options:c})})})}const ife=({active:e,payload:t})=>{if(!e||!t||!t.length)return null;const n=t[0],r=n.payload.color;return v.jsx("div",{style:{backgroundColor:"#000000",color:"#ffffff",padding:"8px 10px",borderRadius:"8px",fontSize:"12px"},children:v.jsxs("div",{className:"flex items-center gap-2 font-medium",children:[v.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:r}}),v.jsx("div",{children:n.name}),v.jsx("div",{className:"ml-2",children:n.value})]})})};function ofe({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 v.jsx(Ie,{className:"h-[267px]",title:"Ticket Status",period:"Today",icon:v.jsx(Dv,{className:"!text-[24px] text-[#EF4444]"}),children:v.jsxs("div",{className:"flex h-full items-center gap-4",children:[v.jsxs("div",{className:"w-[202px] h-[170px] relative",children:[v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(_o,{children:[v.jsx(Mi,{data:i,innerRadius:55,outerRadius:85,dataKey:"value",stroke:"#FFFFFF",strokeWidth:2,children:i.map((a,s)=>v.jsx(kn,{fill:a.color},s))}),v.jsx(Vt,{content:v.jsx(ife,{}),wrapperStyle:{zIndex:1e3}})]})}),v.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[v.jsxs("div",{className:"flex items-baseline text-[18px] leading-[22px] font-medium text-[#121212]",children:[v.jsx("div",{children:r(n.completed)}),v.jsxs("div",{className:"text-[18.18px] leading-[22.22px] text-[#121212]",children:["/",o]})]}),v.jsx("div",{className:"text-[10.1px] leading-[14.14px] text-[#64748B]",children:"Completed"})]})]}),v.jsx("div",{className:"flex-1 space-y-2",children:i.map(a=>v.jsxs("div",{className:"flex items-center justify-between text-[12px] leading-[17px] mt-[12px]",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"h-[7px] w-[16px]",style:{backgroundColor:a.color}}),v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:a.name})]}),v.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px] font-medium",children:a.value})]},a.name))})]})})}const dP={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}},chart_data:[{hour:10,walkins:22,preApproved:30},{hour:12,walkins:15,preApproved:28},{hour:14,walkins:30,preApproved:38},{hour:16,walkins:45,preApproved:50},{hour:18,walkins:25,preApproved:40}]};function afe(e){const t=e>=12?"PM":"AM";let n=e%12;return n===0&&(n=12),`${n} ${t}`}function sfe(e){if(typeof e=="number"&&e>=0&&e<=23)return e;if(typeof e=="string"){const t=e.trim().toUpperCase(),n=t.match(/^(\d{1,2})(?::\d{2})?\s*(AM|PM)$/);if(n){let i=Number(n[1])%12;return n[2]==="PM"&&(i+=12),i}const r=Number(t);if(!Number.isNaN(r)&&r>=0&&r<=23)return r}return null}function lfe(e=[]){return Array.from({length:24},(t,n)=>{const r=e.find(i=>sfe(i?.hour)===n)||{};return{hour:n,time:afe(n),walkins:Number(r?.walkins??0),approved:Number(r?.pre_approved??r?.preApproved??r?.approved??0)}})}function fP({title:e,color:t,rows:n=[],children:r}){const i=v.jsxs("div",{className:"bg-white rounded-xl min-w-[260px] p-4",children:[v.jsxs("div",{className:"flex items-center gap-2 font-medium text-[#121212]",children:[v.jsx(Qp,{className:`text-[20px] ${t}`}),v.jsx("div",{children:e??""})]}),v.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})=>v.jsxs("div",{className:"flex justify-between text-[14px]",children:[v.jsx("div",{children:o??""}),v.jsx("div",{className:"font-semibold",style:{color:s||"#121212"},children:a??0})]},o))})]});return v.jsx(Hj,{content:i,placement:"right-start",interactive:!0,delay:[100,0],offset:[6,0],appendTo:()=>document.body,theme:"light-border",maxWidth:"none",children:r})}function cfe({active:e,payload:t}){return!e||!t?.length?null:v.jsx("div",{className:"rounded-lg bg-[#121212] px-3 py-2 text-[12px] text-white shadow-lg",children:t.map(n=>v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"h-2 w-2 rounded-full",style:{backgroundColor:n.stroke}}),v.jsx("span",{className:"min-w-[82px] text-[#D1D3D4]",children:n.name}),v.jsx("span",{className:"font-semibold",children:n.value})]},n.dataKey))})}function ufe({data:e}){const t=e&&Object.keys(e).length?e:dP,n=t?.visitor_summary?{totalVisitorsToday:t?.visitor_summary?.total_visitors_today??0,peakTime:t?.visitor_summary?.peak_time??"-"}:t?.visitorSummary??{},r=t?.walkins_popup_data?{walkins:{currently_inside:Number(t?.walkins_popup_data?.walkins_inside??0),total_visited_today:Number(t?.walkins_popup_data?.total_walkins??0)},preApproved:{completed_visits:Number(t?.pre_approved_popup_data?.pre_approved_check_ins??0),total_expected_today:Number(t?.pre_approved_popup_data?.total_pre_approved_check_ins??0)}}:t?.popupData??{},i=P.useMemo(()=>{const l=t?.chart_data??[];return lfe(l.length?l:dP.chart_data)},[t]),{yAxisTicks:o,yAxisMax:a}=P.useMemo(()=>{const l=Math.max(...i.map(u=>Math.max(u.walkins,u.approved))),c=l>0?l:5;return{yAxisTicks:[0,Math.ceil(c/2),c],yAxisMax:c}},[i]),s=new Date().toLocaleTimeString("en-IN",{hour:"2-digit",minute:"2-digit",hour12:!0});return v.jsx(Ie,{className:"h-[377px]",title:"Visitor Updates",period:`Today at ${s}`,icon:v.jsx(Qp,{className:"!text-[24px] text-[#8B5CF6]"}),children:v.jsxs("div",{className:"flex flex-col mt-2",children:[v.jsxs("div",{className:"grid grid-cols-2 gap-y-4 gap-x-6 mb-6",children:[v.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[v.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Total Visitors"}),v.jsx("div",{className:"text-[20px] font-medium text-[#08B6D4]",children:n?.totalVisitorsToday??0})]}),v.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[v.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Peak Time"}),v.jsx("div",{className:"text-[20px] font-medium text-[#8B5CF6]",children:n?.peakTime??"-"})]}),v.jsxs("div",{className:"mt-2 flex flex-col gap-[8px]!",children:[v.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Active Walk-ins"}),v.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[v.jsx("div",{className:"text-[28px] text-[#1FA05B] leading-[32px]",children:r?.walkins?.currently_inside??0}),v.jsx(fP,{title:"Active Walk-ins",color:"text-[#1FA05B]",rows:[{label:"Currently Inside",value:r?.walkins?.currently_inside??0,valueColor:"#1FA05B"},{label:"Total Visited Today",value:r?.walkins?.total_visited_today??0}],children:v.jsxs("div",{className:"text-[#64748B] cursor-pointer text-[20px] leading-[32px]",children:["/",r?.walkins?.total_visited_today??0]})})]})]}),v.jsxs("div",{className:"mt-2 flex flex-col gap-[8px]!",children:[v.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Pre-approved Check-ins"}),v.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[v.jsx("div",{className:"text-[28px] text-[#E7A015] leading-[32px]",children:r?.preApproved?.completed_visits??0}),v.jsx(fP,{title:"Pre-approved Check-ins",color:"text-[#E7A015]",rows:[{label:"Completed Visits",value:r?.preApproved?.completed_visits??0,valueColor:"#E7A015"},{label:"Total Expected Check-ins Today",value:r?.preApproved?.total_expected_today??0}],children:v.jsxs("div",{className:"text-[#64748B] cursor-pointer text-[20px] leading-[32px]",children:["/",r?.preApproved?.total_expected_today??0]})})]})]})]}),v.jsx("div",{className:"w-full h-[179px]",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(bx,{data:i??[],margin:{top:5,right:0,left:-18,bottom:0},children:[v.jsx(Hr,{stroke:"#E5E7EB",strokeDasharray:"4 4",vertical:!1}),v.jsx(br,{dataKey:"time",tickFormatter:(l,c)=>c%4===0?l:"",axisLine:!1,tickLine:!1,tick:{fill:"#121212",fontSize:10,fontWeight:400}}),v.jsx(nr,{width:24,axisLine:!1,tickLine:!1,allowDecimals:!1,ticks:o,domain:[0,a],tick:{fill:"#64748B",fontSize:10,fontWeight:400}}),v.jsx(Vt,{content:v.jsx(cfe,{})}),v.jsx(Vo,{type:"monotone",dataKey:"walkins",stroke:"#22C55E",strokeWidth:2,dot:!1,name:"Walk-ins",isAnimationActive:!1}),v.jsx(Vo,{type:"monotone",dataKey:"approved",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"5 5",dot:!1,name:"Pre-approved",isAnimationActive:!1})]})})})]})})}const dfe=({color:e})=>v.jsx("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",backgroundColor:e,marginRight:"6px"}}),ffe=({active:e,payload:t})=>!e||!t||!t.length?null:v.jsx("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:t.map((n,r)=>v.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[v.jsx(dfe,{color:n.color}),n.name,": ",v.jsx("div",{className:"font-semibold",children:n.value})]},r))});function pfe({data:e=null}){const n=e||{card_entry:60,mobile_entry:35,card_exit:15,mobile_exit:10,total:20.3},r=a=>{const s=Number(a);return isNaN(s)?0:s},i=[{name:"Card Entry",value:r(n.card_entry),color:"#329DFF"},{name:"Mobile Entry",value:r(n.mobile_entry),color:"#8B5CF6"},{name:"Card Exit",value:r(n.card_exit),color:"#B1D2F0"},{name:"Mobile Exit",value:r(n.mobile_exit),color:"#DACBFB"}],o=r(n.total);return v.jsx(dn,{className:"h-[362px]",title:"Access Overview",titleWeight:"semi-bold",children:v.jsxs("div",{className:"flex flex-col items-center mt-[16px]",children:[v.jsxs("div",{className:"relative w-[200px] h-[200px]",children:[v.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:v.jsx("div",{className:"w-[130px] h-[130px] rounded-full shadow-[0px_12px_35px_rgba(0,0,0,0.12)]"})}),v.jsx("div",{className:"h-[184px]",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(_o,{children:[v.jsx(Mi,{data:i,dataKey:"value",innerRadius:65,outerRadius:90,startAngle:110,endAngle:-250,paddingAngle:2,stroke:"transparent",children:i.map((a,s)=>v.jsx(kn,{fill:a.color},s))}),v.jsx(Vt,{content:v.jsx(ffe,{}),wrapperStyle:{zIndex:9999}})]})})}),v.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[v.jsxs("div",{className:"text-[20px] leading-[24px] font-semibold text-[#121212]",children:[o,"L"]}),v.jsx("div",{className:"text-[10px] leading-[15px] text-[#64748B]",children:"Total Access"})]})]}),v.jsx("div",{className:"mt-[32px] grid grid-cols-2 gap-x-[20px] gap-y-[12px] text-[12px] text-[#94A3B8]",children:i.map(a=>v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"w-[16px] h-[7px] ",style:{backgroundColor:a.color}}),v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:a.name})]},a.name))})]})})}function BR({title:e="Access",data:t=[],height:n="h-[362px]"}){const r=i=>i==null?"0":Number(i).toLocaleString();return v.jsx(dn,{className:n,title:e,titleWeight:"semi-bold",children:v.jsxs("div",{className:"rounded-xl overflow-hidden mt-[16px]",children:[v.jsxs("div",{className:"grid grid-cols-2 bg-[#F8FAFC] py-[8px] px-[12px] text-[12px] leading-[16px] font-medium text-[#64748B]",children:[v.jsx("div",{children:"Point"}),v.jsx("div",{className:"text-right",children:"Access"})]}),t.map((i,o)=>v.jsxs("div",{className:"grid grid-cols-2 p-[12px] text-[14px] border-t border-[#E2E8F0]",children:[v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:i.label}),v.jsx("div",{className:"text-[12px] leading-[16px] text-right font-medium",style:{color:i.color||"#000"},children:r(i.value)})]},o))]})})}function hfe({data:e=[]}){const t=[{name:"Google",value:82e3},{name:"Uber",value:67e3},{name:"ANAROCK",value:6e4},{name:"Flipkart",value:48e3},{name:"HP",value:41e3},{name:"Myntra",value:3e4},{name:"Cloudscape",value:2e4},{name:"Infosys",value:9e3}],n=e.length?e:t,r=o=>o>=1e3?`${o/1e3}K`:o,i=Math.max(...n.map(o=>o.value));return v.jsx(dn,{title:"Access Points Usage",titleWeight:"semi-bold",className:"h-[362px]",children:v.jsx("div",{className:"mt-[24px] h-[270px] w-full",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(oa,{data:n,barSize:60,margin:{top:0,right:0,left:-20,bottom:0},children:[v.jsx(Hr,{strokeDasharray:"8 8",vertical:!1}),v.jsx(ux,{y:0,stroke:"#EBEBEB",strokeDasharray:"0"}),v.jsx(br,{dataKey:"name",tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1}),v.jsx(nr,{tickFormatter:r,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1}),v.jsx(Vt,{cursor:!1}),v.jsx(jn,{dataKey:"value",barSize:60,children:n.map((o,a)=>v.jsx(kn,{fill:o.value===i?"#3C81F6":"#79ABFF"},`cell-${a}`))})]})})})})}function Po({image:e="https://cdni.iconscout.com/illustration/premium/thumb/businessman-sad-for-no-data-in-folder-illustration-svg-download-png-10155562.png",title:t="No Data Available",description:n="Catch up all the data. Change the date range to see the data."}){return v.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center px-4",children:[v.jsx("img",{src:e,alt:"no data",className:"w-32 h-32 mb-4 opacity-80"}),v.jsx("h3",{className:"text-[16px] font-semibold text-gray-900 mb-1",children:t}),v.jsx("p",{className:"text-sm text-gray-500 max-w-[260px]",children:n})]})}const mfe=({active:e,payload:t})=>e&&t&&t.length?v.jsx("div",{className:"bg-black text-white px-4 py-2 rounded-lg text-sm shadow-lg",children:v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{children:t[0].payload.name}),v.jsx("div",{className:"font-semibold",children:t[0].value})]})}):null,gfe=({x:e,y:t,payload:n})=>{const r=n.value.split(" ");return v.jsx("g",{transform:`translate(${e},${t})`,children:v.jsx("text",{x:-85,y:0,textAnchor:"start",fill:"#121212",fontSize:14,children:r.map((i,o)=>v.jsx("tspan",{x:-85,dy:o===0?0:16,children:i},o))})})};function vfe({data:e=[]}){const t=e&&e.length>0,n=e.map(r=>({name:r.category_name,value:r.total_complaints}));return v.jsx(dn,{title:"Tickets per Category",className:"h-[362px]",titleWeight:"semi-bold",childrenClassName:"h-full",children:t?v.jsx("div",{className:"w-full h-[280px] mt-[28px]",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(oa,{data:n,layout:"vertical",children:[v.jsx(Hr,{strokeDasharray:"3 3",horizontal:!1}),v.jsx(br,{type:"number",tick:{fill:"#94A3B8",fontSize:12},axisLine:!0,tickLine:!1,allowDecimals:!1}),v.jsx(nr,{type:"category",dataKey:"name",axisLine:!1,tickLine:!1,width:120,tick:v.jsx(gfe,{})}),v.jsx(Vt,{content:v.jsx(mfe,{}),cursor:{fill:"transparent"}}),v.jsx(jn,{dataKey:"value",barSize:36,fill:"#08B6D4"})]})})}):v.jsx(Po,{title:"No Tickets Found",description:"Catch up all the data. Change the date range to see the data."})})}function yfe({icon:e,iconColor:t="#329DFF",title:n,value:r,percentage:i,percentageText:o}){const a=parseFloat(i),s=a>=0,l=s?"#16A34A":"#DC2626";return v.jsxs("div",{className:"relative bg-white rounded-[12px] shadow-[0_0_12px_0_#EAF2FF] p-[16px]",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[e&&v.jsx("div",{className:"h-[20px] w-[20px]",style:{color:t,display:"flex",alignItems:"center",justifyContent:"center"},children:v.jsx(e,{className:"h-[20px] w-[20px]"})}),v.jsx("div",{className:"text-[16px] leading-[20px] font-medium text-[#64748B]",children:n})]}),v.jsx("div",{className:"mt-[16px] text-[28px] leading-[32px] font-medium text-[#121212]",children:r}),(i||o)&&v.jsxs("div",{className:"mt-[12px] flex items-center gap-2",children:[i&&v.jsxs("div",{className:"flex items-center gap-[4px] text-[12px] leading-[16px] font-medium",style:{color:l},children:[s?v.jsx(Us,{}):v.jsx(Nc,{}),Math.abs(a),"%"]}),o&&v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:o})]})]})}const bfe=({data:e=[],onDateChange:t})=>{const[n,r]=P.useState(new Date),[i,o]=P.useState(!1),s=(g=>{const b=new Date(g);return b.setDate(b.getDate()-6),b})(n),l=g=>{try{return g.toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}catch{return""}},c=g=>{const b=new Date(g),S=new Date(b);S.setDate(S.getDate()-6),t&&t(S.toISOString(),b.toISOString())},u=()=>{const g=new Date(n);g.setDate(g.getDate()-7),r(g),c(g)},d=()=>{const g=new Date(n);g.setDate(g.getDate()+7),r(g),c(g)},f=()=>{o(g=>!g)},p=g=>{const b=g||new Date;r(b),c(b),o(!1)},h=Array.isArray(e)?e:[],m=!h.length||h.every(g=>g.no_of_visitors===0);return v.jsxs(dn,{title:"Weekly Visitor Pattern",period:`${l(s)} - ${l(n)}`,isDateSelector:!0,titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-6",onPrevClick:u,onNextClick:d,onCalendarClick:f,children:[i&&v.jsx("div",{className:"absolute top-[70px] right-[24px] z-50 bg-white shadow-lg rounded-lg",children:v.jsx(Fk,{selected:n,onChange:p,inline:!0})}),m?v.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:v.jsx(Po,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."})}):v.jsx("div",{className:"w-full h-[260px]",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(nne,{data:h,margin:{top:10,right:10,left:0,bottom:0},children:[v.jsx("defs",{children:v.jsxs("linearGradient",{id:"colorVisitors",x1:"0",y1:"0",x2:"0",y2:"1",children:[v.jsx("stop",{offset:"0%",stopColor:"#6366F1",stopOpacity:.25}),v.jsx("stop",{offset:"100%",stopColor:"#6366F1",stopOpacity:0})]})}),v.jsx(Hr,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),v.jsx(br,{dataKey:"day",type:"category",scale:"point",padding:{left:20,right:20},tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1,tickFormatter:g=>new Date(g).toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}),v.jsx(nr,{width:35,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1,domain:[0,"dataMax + 2"]}),v.jsx(Vt,{labelFormatter:g=>new Date(g).toLocaleDateString("en-GB",{day:"2-digit",month:"short"}),formatter:g=>[g,"Visitors"]}),v.jsx(EN,{type:"monotone",dataKey:"no_of_visitors",stroke:"#6366F1",strokeWidth:2,fill:"url(#colorVisitors)",dot:{r:5,stroke:"#6366F1",strokeWidth:2,fill:"#fff"},activeDot:{r:6}})]})})})]})},xfe=[{building_name:"Google",no_of_visitors:1e3},{building_name:"Uber",no_of_visitors:3500},{building_name:"ANAROCK",no_of_visitors:2e3},{building_name:"Flipkart",no_of_visitors:8e3},{building_name:"HP",no_of_visitors:1650}],wfe=({data:e})=>{const t=Array.isArray(e)&&e?.length===0,n=e==null?xfe:Array.isArray(e)?e:[];return v.jsx(dn,{title:"Organisation Wise Visitors",titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-6",children:v.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:t?v.jsx(Po,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."}):v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(oa,{data:n||[],margin:{top:10,right:10,left:0,bottom:0},barCategoryGap:35,children:[v.jsx(Hr,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),v.jsx(br,{dataKey:"building_name",tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1}),v.jsx(nr,{width:40,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1}),v.jsx(Vt,{cursor:!1}),v.jsx(jn,{dataKey:"no_of_visitors",name:"Visitors",maxBarSize:55,fill:"#3C81F6"})]})})})})};function _fe({data:e}){return v.jsx("div",{className:"h-full",children:e.map((t,n)=>{const r=parseFloat(t.delta),i=r>=0;return v.jsx(Ie,{iconClassName:"!gap-[8px]",title:v.jsx("div",{className:"text-[#64748B]",children:t.title}),icon:v.jsx(t.Icon,{className:"h-[20px] w-[20px]",style:{color:t.iconColor||"#000000"}}),className:"h-[132px]",children:v.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[v.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t.value}),v.jsxs("div",{className:`flex items-center pt-[8px] text-[12px] leading-[16px] ${t.delta?"gap-[8px]":""}`,children:[t.delta&&v.jsxs("div",{className:"flex items-center gap-[4px]",style:{color:i?"#1FA05B":"#E11D48",fontWeight:500},children:[i?v.jsx(Us,{}):v.jsx(Nc,{}),Math.abs(r),"%"]}),v.jsx("div",{style:{color:"#64748B"},children:t.deltaLabel})]})]})},n)})})}const Sfe=[{facility_name:"Table Tennis",total_booking:5},{facility_name:"Gym",total_booking:12},{facility_name:"Meeting Room A",total_booking:3},{facility_name:"Conference Hall",total_booking:8}],Efe=({x:e,y:t,payload:n})=>v.jsx("foreignObject",{x:(e||0)-80,y:(t||0)-18,width:80,height:40,children:v.jsx("div",{className:"text-[12px] leading-[16px] text-[#121212]",style:{width:"80px",whiteSpace:"normal",wordBreak:"break-word",textAlign:"left"},children:n?.value||""})});function Ofe({data:e}){const t=Array?.isArray(e)&&e?.length===0,n=e==null?Sfe:Array?.isArray(e)?e:[];return v.jsx(Ie,{title:"Bookings",icon:v.jsx(ode,{size:18,className:"text-[#DBB467]"}),className:"h-[288px]",children:v.jsx("div",{className:"w-full h-full flex items-center justify-center",children:t?v.jsx(Po,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(oa,{data:n||[],layout:"vertical",margin:{top:0,right:10,left:10,bottom:0},children:[v.jsx(br,{type:"number",allowDecimals:!1,tick:{fill:"#64748B",fontSize:12},axisLine:!0,tickLine:!1}),v.jsx(nr,{type:"category",dataKey:"facility_name",axisLine:!1,tickLine:!1,width:100,tick:v.jsx(Efe,{})}),v.jsx(Vt,{formatter:r=>[r,"Bookings"],cursor:{fill:"rgba(0,0,0,0.05)"}}),v.jsx(jn,{dataKey:"total_booking",barSize:40,fill:"#8B5CF6"})]})})})})}const Cfe=[{building_name:"Google",no_of_booking:1},{building_name:"Uber",no_of_booking:2},{building_name:"ANAROCK",no_of_booking:4},{building_name:"Flipkart",no_of_booking:2},{building_name:"HP",no_of_booking:1}];function Pfe({data:e}){const t=Array.isArray(e)&&e?.length===0,n=e==null?Cfe:Array.isArray(e)?e:[];return v.jsx(dn,{title:"Booking Trend by Organisation",titleWeight:"semi-bold",className:"h-[362px]",children:v.jsx("div",{className:"w-full h-[280px] flex items-center justify-center",children:t?v.jsx(Po,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(oa,{data:n||[],margin:{top:0,right:0,left:-15,bottom:0},children:[v.jsx(Hr,{strokeDasharray:"3 3",vertical:!1,stroke:"#E5E7EB"}),v.jsx(br,{dataKey:"building_name",axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12}}),v.jsx(nr,{allowDecimals:!1,axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12},tickFormatter:r=>`${r??0}`}),v.jsx(Vt,{formatter:r=>[r,"Bookings"],labelFormatter:r=>`Organisation: ${r}`,cursor:{fill:"rgba(0,0,0,0.05)"}}),v.jsx(jn,{dataKey:"no_of_booking",barSize:54,fill:"#12B981"})]})})})})}const kfe=[{facility_name:"Table Tennis",paid_revenue:"24000.00"},{facility_name:"Games Room",paid_revenue:"14000.00"},{facility_name:"Badminton",paid_revenue:"10000.00"},{facility_name:"GYM",paid_revenue:"4000.00"}],zd=["#3C81F6","#60A5FA","#95BFFA","#BEDAFE","#DAE6FC"];function Dfe({data:e}){const t=Array?.isArray(e)&&e?.length===0,n=e??kfe,r=Array?.isArray(n)&&n?.length>0?n?.map(s=>({name:s?.facility_name||"Unknown",value:Number(s?.paid_revenue)||0})):[],o=(r?.length>0?r?.every(s=>s?.value===0):!1)?r?.map((s,l)=>({...s,value:l===0?1:0})):r,a=s=>`Rs ${s?.toLocaleString?.("en-IN")||0}`;return v.jsx(dn,{title:"Amenity Wise Revenue",titleWeight:"semi-bold",className:"h-[362px]",children:v.jsx("div",{className:"grid grid-cols-12 gap-6 items-center h-full",children:t?v.jsx("div",{className:"col-span-12 flex items-center justify-center h-[240px]",children:v.jsx(Po,{title:"No Amenity Found",description:"Catch up all the data. Change the date range to see the data."})}):v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"col-span-5 h-[240px]",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(_o,{children:[v.jsx(Mi,{data:o||[],dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:95,stroke:"#fff",strokeWidth:1,children:o?.map?.((s,l)=>v.jsx(kn,{fill:zd?.[l%zd?.length]},`cell-${l}`))}),v.jsx(Vt,{formatter:s=>a(s),labelFormatter:s=>`Amenity: ${s||""}`,contentStyle:{borderRadius:"10px",border:"1px solid #EBEBEB",fontSize:"12px"}})]})})}),v.jsx("div",{className:"col-span-7",children:v.jsxs("div",{className:"rounded-[12px] overflow-hidden",children:[v.jsxs("div",{className:"grid grid-cols-2 px-[12px] py-[8px] bg-[#EBEBEB] text-[12px] leading-[16px] font-semibold text-[#64748B]",children:[v.jsx("div",{children:"Amenity"}),v.jsx("div",{className:"text-right",children:"Revenue"})]}),v.jsx("div",{className:"divide-y divide-[#F1F5F9]",children:r?.map?.((s,l)=>v.jsxs("div",{className:"grid grid-cols-2 px-4 py-4 text-[14px] text-[#121212]",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("span",{className:"w-[16px] h-[7px]",style:{backgroundColor:zd?.[l%zd?.length]}}),v.jsx("span",{className:"text-[#64748B] text-[12px] leading-[16px]",children:s?.name||"Unknown"})]}),v.jsx("div",{className:"text-right text-[12px] leading-[16px] text-[#64748B]",children:a(s?.value||0)})]},s?.name||l))})]})})]})})})}const Vd=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],Afe=[{asset_group_name:"Lifts",asset_count:3},{asset_group_name:"Fire Systems",asset_count:16},{asset_group_name:"Generators",asset_count:16},{asset_group_name:"HVAC",asset_count:24},{asset_group_name:"Others",asset_count:97}],Tfe=({rows:e,totalAssets:t})=>{const n=P.useMemo(()=>e?e.length===0?[]:e.map((i,o)=>({name:i.asset_group_name,value:i.asset_count||0,color:Vd[o%Vd.length]})):Afe.map((i,o)=>({name:i.asset_group_name,value:i.asset_count||0,color:Vd[o%Vd.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?v.jsx(dn,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:v.jsx("div",{className:"flex items-center justify-center h-full",children:v.jsx(Po,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):v.jsx(dn,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:v.jsxs("div",{className:"flex items-center justify-between gap-8",children:[v.jsxs("div",{className:"relative w-[240px] h-[240px]",children:[v.jsx(Ft,{width:"100%",height:"100%",children:v.jsx(_o,{children:v.jsx(Mi,{data:n,dataKey:"value",cx:"50%",cy:"50%",innerRadius:60,outerRadius:90,paddingAngle:2,stroke:"#FFFFFF",strokeWidth:2,startAngle:90,endAngle:-270,children:n.map((i,o)=>v.jsx(kn,{fill:i.color},o))})})}),v.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[v.jsx("div",{className:"text-[24px] text-[#121212]",children:r}),v.jsx("div",{className:"text-[12px] text-[#94A3B8] mt-1",children:"Total Assets"})]})]}),v.jsx("div",{className:"flex-1 max-w-[280px]",children:v.jsxs("div",{className:"rounded-[12px] overflow-hidden bg-white",children:[v.jsxs("div",{className:"flex items-center justify-between px-4 py-3 bg-[#F8FAFC]",children:[v.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Asset"}),v.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Count"})]}),n.map((i,o)=>v.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t border-[#F1F5F9]",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"w-[16px] h-[7px]",style:{backgroundColor:i.color}}),v.jsx("div",{className:"text-[13px] text-[#475569]",children:i.name})]}),v.jsx("div",{className:"text-[13px] text-[#64748B]",children:i.value})]},o))]})})]})})},Mfe=({data:e})=>{const[t,n]=P.useState({}),r=[{name:"Lifts",Cancelled:55,Closed:45,Open:50,OnHold:20,InProgress:10},{name:"Fire Systems",Cancelled:15,Closed:45,Open:15,OnHold:8,InProgress:5},{name:"Generators",Cancelled:12,Closed:45,Open:75,OnHold:18,InProgress:7},{name:"HVAC",Cancelled:45,Closed:80,Open:30,OnHold:22,InProgress:12},{name:"Others",Cancelled:18,Closed:18,Open:45,OnHold:9,InProgress:4}],i=P.useMemo(()=>e?Array.isArray(e)&&e.length===0?[]:e:r,[e]),o=a=>{const{dataKey:s}=a;n(l=>({...l,[s]:!l[s]}))};return Array.isArray(e)&&e.length===0?v.jsx(dn,{title:"Maintenance Status",titleWeight:"semi-bold",className:"h-full",children:v.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:v.jsx(Po,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):v.jsx(dn,{title:"Maintenance Status",titleWeight:"semi-bold",className:"h-full",children:v.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:Array.isArray(e)&&e.length===0?v.jsx("div",{className:"text-[#94A3B8] text-sm",children:"No Data Found"}):v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(oa,{data:i,barSize:50,margin:{top:0,right:0,left:-30,bottom:0},children:[v.jsx(Hr,{strokeDasharray:"3 3",vertical:!1}),v.jsx(br,{dataKey:"name",tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1}),v.jsx(nr,{tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1,allowDecimals:!1}),v.jsx(Vt,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},contentStyle:{borderRadius:"10px",border:"1px solid #E2E8F0",fontSize:"12px"}}),v.jsx(fh,{verticalAlign:"bottom",align:"center",iconType:"square",onClick:o,formatter:a=>v.jsx("div",{style:{color:t[a]?"#CBD5E1":"#64748B",cursor:"pointer",fontSize:"12px",display:"inline-flex",alignItems:"center"},children:a}),wrapperStyle:{paddingTop:"18px"}}),v.jsx(jn,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:t.Open}),v.jsx(jn,{dataKey:"Closed",stackId:"a",fill:"#10B981",hide:t.Closed}),v.jsx(jn,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:t.Cancelled}),v.jsx(jn,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:t.OnHold}),v.jsx(jn,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:t.InProgress})]})})})})};function Nfe({data:e}){const t=[{name:"Completed",value:Number(e?.completed||0),color:"#12B981"},{name:"Not - Completed",value:Number(e?.not_completed||0),color:"#F69E0A"},{name:"Missed",value:Number(e?.missed||0),color:"#EF4444"}],n=Number(e?.completed||0)+Number(e?.not_completed||0)+Number(e?.missed||0),r=Number(e?.completed||0);return v.jsx(dn,{title:"Patrol Status",className:"h-[362px]",titleWeight:"semi-bold",children:v.jsxs("div",{className:"flex flex-col items-center justify-center",children:[v.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(_o,{children:[v.jsx(Mi,{data:t,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:t.map((i,o)=>v.jsx(kn,{fill:i.color},`cell-${o}`))}),v.jsx(Vt,{formatter:i=>i.toLocaleString()})]})}),v.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[v.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px]",children:[r,"/",n]}),v.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),v.jsx("div",{className:"flex flex-col w-full text-[14px]",children:t.map((i,o)=>v.jsxs("div",{className:`flex items-center justify-between py-[10px] ${o!==t.length-1?"border-b border-[#F1F5F9]":""}`,children:[v.jsxs("div",{className:"flex items-center gap-[10px]",children:[v.jsx("div",{className:"inline-block w-[16px] h-[7px]",style:{backgroundColor:i.color}}),v.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.name})]}),v.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.value})]},i.name))})]})})}function jfe({incidentReports:e,incidentReportsDetails:t}){const n=Number(e?.open||0),r=Number(e?.in_progress||0),i=Number(e?.closed||0);return v.jsx(dn,{title:"Incident Reports",className:"h-[362px]",titleWeight:"semi-bold",children:v.jsxs("div",{children:[v.jsxs("div",{className:"flex w-full text-center gap-[24px]",children:[v.jsxs("div",{className:"flex-1 py-3 bg-[#FBF4F4] h-[76px] rounded",children:[v.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#AB0000]",children:n}),v.jsx("div",{className:"!text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),v.jsxs("div",{className:"flex-1 py-3 bg-[#FFFBF2] h-[76px] rounded",children:[v.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#E7A015]",children:r}),v.jsx("div",{className:"!text-[12px] leading-[16px] text-[#E7A015]",children:"In-progress"})]}),v.jsxs("div",{className:"flex-1 py-3 bg-[#F7FEFA] h-[76px] rounded",children:[v.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:i}),v.jsx("div",{className:"!text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),v.jsx("div",{className:"mt-4 space-y-2",children:t?.length>0?t.map((o,a)=>{const s=o?.severity==="Danger"?"text-[#AB0000]":o?.severity==="High"?"text-[#E7A015]":"text-[#1FA05B]";return v.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#FAFBFD] rounded-md",children:[v.jsx("div",{className:"flex items-center gap-[8px]",children:v.jsx("div",{className:"text-gray-700 font-medium",children:o?.incident_code})}),v.jsx("div",{className:`!text-[12px] font-semibold flex items-center gap-[4px] ${s}`,children:v.jsxs("div",{children:[o?.severity_level," - ",o?.severity]})})]},a)}):v.jsx("div",{className:"text-[16px] text-center text-gray-400 text-sm py-6",children:"No incidents found"})})]})})}function Rfe({columns:e=[{key:"a",label:"Organisation"},{key:"b",label:"Item"},{key:"c",label:"Orders"},{key:"d",label:"Revenue"},{key:"e",label:"AOV"},{key:"f",label:"% Revenue"}],data:t=[{a:"Google",b:"Coffee",c:"34,908",d:"₹ 57,21,288",e:"₹ 450",f:"43.6%"},{a:"Uber",b:"Paneer Combo",c:"12,000",d:"₹ 12,00,000",e:"₹ 500",f:"100%"}],rowsPerPage:n=10,setRowsPerPage:r=()=>{},currentPage:i=1,setCurrentPage:o=()=>{},totalRows:a=0,totalPages:s=1,pageOptions:l=[10,20,30,40,50]}){const c=Array.isArray(t)?t:[],u=Array.isArray(e)?e:[],d=n>0?Math.ceil(c.length/n):1,f=s||d,p=c;return console.log("safeData:",c),console.log("currentData:",p),v.jsxs("div",{className:"w-full bg-white rounded-xl h-[390px] shadow-md overflow-hidden flex flex-col",children:[v.jsx("div",{className:"grid bg-slate-600 text-white text-sm font-medium",style:{gridTemplateColumns:`repeat(${u.length}, 1fr)`},children:u.map((h,m)=>v.jsx("div",{className:"px-6 py-4 text-[16px] leading-[20px]",children:h.label},m))}),v.jsx("div",{className:"flex-1 overflow-y-auto",children:p.length>0?p.map((h,m)=>v.jsx("div",{className:"grid text-[14px] leading-[18px] text-gray-700 hover:bg-gray-50 transition",style:{gridTemplateColumns:`repeat(${u.length}, 1fr)`},children:u.map((g,b)=>{const S=h[g.key],w=typeof S=="string"&&S.includes("%"),x=S==="100%"?"bg-green-100 text-green-600":"bg-red-100 text-red-600";return v.jsx("div",{className:"px-6 py-4 bg-gray-50",children:w?v.jsx("div",{className:`inline-block px-3 py-1 rounded-full text-[14px] font-semibold ${x}`,children:S}):v.jsx("div",{children:S??"-"})},b)})},m)):v.jsx(Po,{title:"No Data Found",description:"Catch up all the data. Change the date range to see the data."})}),v.jsxs("div",{className:"flex justify-end items-center px-6 py-4 text-sm bg-white gap-8",children:[v.jsxs("div",{className:"flex items-center gap-2 text-gray-600 text-[14px]",children:[v.jsx("div",{children:"Rows per page:"}),v.jsx("select",{value:n,onChange:h=>{r(Number(h.target.value)),o(1)},className:"border rounded px-2 py-1",children:l.map((h,m)=>v.jsx("option",{value:h,children:h},m))}),v.jsxs("div",{className:"ml-4 text-[14px]",children:[c?.length===0?"0–0":`1–${c?.length}`," ","of ",a||c?.length]})]}),v.jsxs("div",{className:"flex items-center space-x-2 text-gray-600 text-[14px]",children:[v.jsx("button",{onClick:()=>o(1),disabled:i===1,className:"p-2 rounded hover:bg-gray-100 disabled:opacity-40",children:v.jsx(tde,{size:18})}),v.jsx("button",{onClick:()=>o(h=>h-1),disabled:i===1,className:"p-2 rounded hover:bg-gray-100 disabled:opacity-40",children:v.jsx(LR,{size:18})}),v.jsx("button",{onClick:()=>o(h=>h+1),disabled:i===f,className:"p-2 rounded hover:bg-gray-100 disabled:opacity-40",children:v.jsx(FR,{size:18})}),v.jsx("button",{onClick:()=>o(f),disabled:i===f,className:"p-2 rounded hover:bg-gray-100 disabled:opacity-40",children:v.jsx(rde,{size:18})})]})]})]})}exports.AccessPointsUsage=hfe;exports.Accounting=Sue;exports.Amenities=nfe;exports.AmenitiesStatsCard=_fe;exports.AmenityWiseRevenue=Dfe;exports.AssetValueBreakdown=Rue;exports.AssetsByType=Tfe;exports.BlockWiseOccupancy=gue;exports.BookingTrendChart=Pfe;exports.Bookings=Ofe;exports.Budgets=Pue;exports.Card=Ie;exports.CardAccess=BR;exports.CashBankBalance=Due;exports.CommercialAccessOverview=pfe;exports.CommercialGuardPatrols=Nfe;exports.CommercialIncidentReports=jfe;exports.CommercialOccupancy=Jde;exports.CommercialReportTable=Rfe;exports.Community=toe;exports.Complaints=Cde;exports.ComplaintsByLevel=Tde;exports.DuesAgeing=Tue;exports.EmployeeFootfall=efe;exports.Engagement=noe;exports.EngagementStatsGrid=Zde;exports.EventsUtilisation=Vde;exports.ExpenseCategories=Nue;exports.Facilities=roe;exports.FinanceSummary=ioe;exports.FoodBeverages=tfe;exports.GateAndSecurityStatsGrid=Sde;exports.GateUpdates=Voe;exports.GuardPatrols=dde;exports.Header=c3;exports.Helpdesk=Hoe;exports.HelpdeskStatsGrid=Bde;exports.HourlyTrafficFlow=pde;exports.IncidentReports=gde;exports.IncomeExpenditure=RR;exports.MainHeader=_3;exports.MaintenanceStatus=Mfe;exports.MetricCard=yfe;exports.MobileAccess=BR;exports.MoveInOutTrends=yue;exports.NoticeBoardStatus=Ude;exports.OccupancyOverview=pue;exports.OrganisationWiseVisitors=wfe;exports.RequestBox=Nde;exports.ResidentOverview=mue;exports.RevenuebyCategory=Lue;exports.SingleStats=qde;exports.StaffAttendance=bde;exports.StatsGrid=zue;exports.TicketEscalation=rfe;exports.TicketStatus=ofe;exports.Tickets=jR;exports.TicketsperCategory=vfe;exports.UnitStatus=jR;exports.VisitorUpdates=ufe;exports.WeeklyVisitorPattern=bfe;
|