anarock-widgets 1.0.69 → 1.0.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -306,7 +306,7 @@ Take a look at the reducer(s) handling this action type: ${h.type}.
306
306
  `))}},[Gt,we,S,x,z]),tn&&(S?Je.length===0?de=null:de=Je.reduce((Z,ce,pe)=>(Z.push(ce),pe<Je.length-1&&Z.push(", "),Z),[]):de=Et);let mn=ae;!a&&ie&&X&&(mn=A.clientWidth);let Bt;typeof j<"u"?Bt=j:Bt=d?null:0;const gn=D.id||(x?`mui-component-select-${x}`:void 0),ye={...t,variant:B,value:z,open:De,error:h},rn=PG(ye),zt={...y.PaperProps,...typeof y.slotProps?.paper=="function"?y.slotProps.paper(ye):y.slotProps?.paper},U={...y.MenuListProps,...typeof y.slotProps?.list=="function"?y.slotProps.list(ye):y.slotProps?.list},le=wg();return w.jsxs(_.Fragment,{children:[w.jsx(OG,{as:"div",ref:J,tabIndex:Bt,role:"combobox","aria-controls":De?le:void 0,"aria-disabled":d?"true":void 0,"aria-expanded":De?"true":"false","aria-haspopup":"listbox","aria-label":i,"aria-labelledby":[v,gn].filter(Boolean).join(" ")||void 0,"aria-describedby":r,"aria-required":P?"true":void 0,"aria-invalid":h?"true":void 0,onKeyDown:Ze,onMouseDown:d||R?null:re,onBlur:Te,onFocus:C,...D,ownerState:ye,className:oe(D.className,rn.select,l),id:gn,children:_G(de)?FO||(FO=w.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):de}),w.jsx(EG,{"aria-invalid":h,value:Array.isArray(z)?z.join(","):z,name:x,ref:ne,"aria-hidden":!0,onChange:Se,tabIndex:-1,disabled:d,className:rn.nativeInput,autoFocus:o,required:P,...K,ownerState:ye}),w.jsx(SG,{as:g,className:rn.icon,ownerState:ye}),w.jsx(UA,{id:`menu-${x||""}`,anchorEl:A,open:De,onClose:me,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...y,slotProps:{...y.slotProps,list:{"aria-labelledby":v,role:"listbox","aria-multiselectable":S?"true":void 0,disableListWrap:!0,id:le,...U},paper:{...zt,style:{minWidth:mn,...zt!=null?zt.style:null}}},children:nn})]})});process.env.NODE_ENV!=="production"&&(XA.propTypes={"aria-describedby":f.string,"aria-label":f.string,autoFocus:f.bool,autoWidth:f.bool,children:f.node,classes:f.object,className:f.string,defaultOpen:f.bool,defaultValue:f.any,disabled:f.bool,displayEmpty:f.bool,error:f.bool,IconComponent:f.elementType.isRequired,inputRef:ur,labelId:f.string,MenuProps:f.object,multiple:f.bool,name:f.string,onBlur:f.func,onChange:f.func,onClose:f.func,onFocus:f.func,onOpen:f.func,open:f.bool,readOnly:f.bool,renderValue:f.func,required:f.bool,SelectDisplayProps:f.object,tabIndex:f.oneOfType([f.number,f.string]),type:f.any,value:f.any,variant:f.oneOf(["standard","outlined","filled"])});const CG=e=>{const{classes:t}=e,r=rt({root:["root"]},GA,t);return{...t,...r}},Dy={name:"MuiSelect",slot:"Root",shouldForwardProp:e=>Wn(e)&&e!=="variant"},TG=ve(Sf,Dy)(""),AG=ve(Ef,Dy)(""),kG=ve(Of,Dy)(""),_f=_.forwardRef(function(t,n){const r=ut({name:"MuiSelect",props:t}),{autoWidth:i=!1,children:o,classes:a={},className:s,defaultOpen:l=!1,displayEmpty:c=!1,IconComponent:u=WK,id:d,input:p,inputProps:h,label:g,labelId:m,MenuProps:v,multiple:y=!1,native:S=!1,onClose:x,onOpen:b,open:O,renderValue:E,SelectDisplayProps:C,variant:T="outlined",...k}=r,R=S?KA:XA,M=Wo(),P=qa({props:r,muiFormControl:M,states:["variant","error"]}),D=P.variant||T,j={...r,variant:D,classes:a},N=CG(j),{root:L,...B}=N,K=p||{standard:w.jsx(TG,{ownerState:j}),outlined:w.jsx(AG,{label:g,ownerState:j}),filled:w.jsx(kG,{ownerState:j})}[D],z=Ht(n,Ha(K));return w.jsx(_.Fragment,{children:_.cloneElement(K,{inputComponent:R,inputProps:{children:o,error:P.error,IconComponent:u,variant:D,type:void 0,multiple:y,...S?{id:d}:{autoWidth:i,defaultOpen:l,displayEmpty:c,labelId:m,MenuProps:v,onClose:x,onOpen:b,open:O,renderValue:E,SelectDisplayProps:{id:d,...C}},...h,classes:h?cn(B,h.classes):B,...p?p.props.inputProps:{}},...(y&&S||c)&&D==="outlined"?{notched:!0}:{},ref:z,className:oe(K.props.className,s,N.root),...!p&&{variant:D},...k})})});process.env.NODE_ENV!=="production"&&(_f.propTypes={autoWidth:f.bool,children:f.node,classes:f.object,className:f.string,defaultOpen:f.bool,defaultValue:f.any,displayEmpty:f.bool,IconComponent:f.elementType,id:f.string,input:f.element,inputProps:f.object,label:f.node,labelId:f.string,MenuProps:f.object,multiple:f.bool,native:f.bool,onChange:f.func,onClose:f.func,onOpen:f.func,open:f.bool,renderValue:f.func,SelectDisplayProps:f.object,sx:f.oneOfType([f.arrayOf(f.oneOfType([f.func,f.object,f.bool])),f.func,f.object]),value:f.oneOfType([f.oneOf([""]),f.any]),variant:f.oneOf(["filled","outlined","standard"])});_f.muiName="Select";function MG(e){return Ge("MuiTooltip",e)}const xt=qe("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]);function jG(e){return Math.round(e*1e5)/1e5}const NG=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${Re(o.split("-")[0])}`],arrow:["arrow"]};return rt(a,MG,t)},RG=ve(jy,{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]}})(St(({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"] .${xt.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${xt.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${xt.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${xt.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:({ownerState:t})=>t.arrow&&!t.isRtl,style:{[`&[data-popper-placement*="right"] .${xt.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!!t.isRtl,style:{[`&[data-popper-placement*="right"] .${xt.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!t.isRtl,style:{[`&[data-popper-placement*="left"] .${xt.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!!t.isRtl,style:{[`&[data-popper-placement*="left"] .${xt.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}))),DG=ve("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${Re(n.placement.split("-")[0])}`]]}})(St(({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,[`.${xt.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${xt.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${xt.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${xt.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:`${jG(16/14)}em`,fontWeight:e.typography.fontWeightRegular}},{props:({ownerState:t})=>!t.isRtl,style:{[`.${xt.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${xt.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:({ownerState:t})=>!t.isRtl&&t.touch,style:{[`.${xt.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${xt.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:({ownerState:t})=>!!t.isRtl,style:{[`.${xt.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${xt.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:({ownerState:t})=>!!t.isRtl&&t.touch,style:{[`.${xt.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${xt.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:({ownerState:t})=>t.touch,style:{[`.${xt.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:({ownerState:t})=>t.touch,style:{[`.${xt.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]}))),IG=ve("span",{name:"MuiTooltip",slot:"Arrow"})(St(({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 Ac=!1;const zO=new pf;let fs={x:0,y:0};function kc(e,t){return(n,...r)=>{t&&t(n,...r),e(n,...r)}}const Gm=_.forwardRef(function(t,n){const r=ut({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:p=!1,disableTouchListener:h=!1,enterDelay:g=100,enterNextDelay:m=0,enterTouchDelay:v=700,followCursor:y=!1,id:S,leaveDelay:x=0,leaveTouchDelay:b=1500,onClose:O,onOpen:E,open:C,placement:T="bottom",PopperComponent:k,PopperProps:R={},slotProps:M={},slots:P={},title:D,TransitionComponent:j,TransitionProps:N,...L}=r,B=_.isValidElement(o)?o:w.jsx("span",{children:o}),K=kd(),z=xg(),[F,G]=_.useState(),[Y,ne]=_.useState(null),Q=_.useRef(!1),X=p||y,te=sa(),ie=sa(),ae=sa(),W=sa(),[H,J]=uu({controlled:C,default:!1,name:"Tooltip",state:"open"});let A=H;if(process.env.NODE_ENV!=="production"){const{current:be}=_.useRef(C!==void 0);_.useEffect(()=>{F&&F.disabled&&!be&&D!==""&&F.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(`
307
307
  `))},[D,F,be])}const fe=wg(S),re=_.useRef(),me=Qr(()=>{re.current!==void 0&&(document.body.style.WebkitUserSelect=re.current,re.current=void 0),W.clear()});_.useEffect(()=>me,[me]);const we=be=>{zO.clear(),Ac=!0,J(!0),E&&!A&&E(be)},Se=Qr(be=>{zO.start(800+x,()=>{Ac=!1}),J(!1),O&&A&&O(be),te.start(K.transitions.duration.shortest,()=>{Q.current=!1})}),_e=be=>{Q.current&&be.type!=="touchstart"||(F&&F.removeAttribute("title"),ie.clear(),ae.clear(),g||Ac&&m?ie.start(Ac?m:g,()=>{we(be)}):we(be))},Ze=be=>{ie.clear(),ae.start(x,()=>{Se(be)})},[,De]=_.useState(!1),Te=be=>{Qu(be.target)||(De(!1),Ze(be))},de=be=>{F||G(be.currentTarget),Qu(be.target)&&(De(!0),_e(be))},Et=be=>{Q.current=!0;const dn=B.props;dn.onTouchStart&&dn.onTouchStart(be)},Je=be=>{Et(be),ae.clear(),te.clear(),me(),re.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",W.start(v,()=>{document.body.style.WebkitUserSelect=re.current,_e(be)})},tn=be=>{B.props.onTouchEnd&&B.props.onTouchEnd(be),me(),ae.start(b,()=>{Se(be)})};_.useEffect(()=>{if(!A)return;function be(dn){dn.key==="Escape"&&Se(dn)}return document.addEventListener("keydown",be),()=>{document.removeEventListener("keydown",be)}},[Se,A]);const Gt=Ht(Ha(B),G,n);!D&&D!==0&&(A=!1);const nn=_.useRef(),mn=be=>{const dn=B.props;dn.onMouseMove&&dn.onMouseMove(be),fs={x:be.clientX,y:be.clientY},nn.current&&nn.current.update()},Bt={},gn=typeof D=="string";c?(Bt.title=!A&&gn&&!d?D:null,Bt["aria-describedby"]=A?fe:null):(Bt["aria-label"]=gn?D:null,Bt["aria-labelledby"]=A&&!gn?fe:null);const ye={...Bt,...L,...B.props,className:oe(L.className,B.props.className),onTouchStart:Et,ref:Gt,...y?{onMouseMove:mn}:{}};process.env.NODE_ENV!=="production"&&(ye["data-mui-internal-clone-element"]=!0,_.useEffect(()=>{F&&!F.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(`
308
308
  `))},[F]));const rn={};h||(ye.onTouchStart=Je,ye.onTouchEnd=tn),d||(ye.onMouseOver=kc(_e,ye.onMouseOver),ye.onMouseLeave=kc(Ze,ye.onMouseLeave),X||(rn.onMouseOver=_e,rn.onMouseLeave=Ze)),u||(ye.onFocus=kc(de,ye.onFocus),ye.onBlur=kc(Te,ye.onBlur),X||(rn.onFocus=de,rn.onBlur=Te)),process.env.NODE_ENV!=="production"&&B.props.title&&console.error(["MUI: You have provided a `title` prop to the child of <Tooltip />.",`Remove this title prop \`${B.props.title}\` or the Tooltip component.`].join(`
309
- `));const zt={...r,isRtl:z,arrow:i,disableInteractive:X,placement:T,PopperComponentProp:k,touch:Q.current},U=typeof M.popper=="function"?M.popper(zt):M.popper,le=_.useMemo(()=>{let be=[{name:"arrow",enabled:!!Y,options:{element:Y,padding:4}}];return R.popperOptions?.modifiers&&(be=be.concat(R.popperOptions.modifiers)),U?.popperOptions?.modifiers&&(be=be.concat(U.popperOptions.modifiers)),{...R.popperOptions,...U?.popperOptions,modifiers:be}},[Y,R.popperOptions,U?.popperOptions]),Z=NG(zt),ce=typeof M.transition=="function"?M.transition(zt):M.transition,pe={slots:{popper:s.Popper,transition:s.Transition??j,tooltip:s.Tooltip,arrow:s.Arrow,...P},slotProps:{arrow:M.arrow??l.arrow,popper:{...R,...U??l.popper},tooltip:M.tooltip??l.tooltip,transition:{...N,...ce??l.transition}}},[Qe,dt]=ot("popper",{elementType:RG,externalForwardedProps:pe,ownerState:zt,className:oe(Z.popper,R?.className)}),[Hn,vi]=ot("transition",{elementType:sl,externalForwardedProps:pe,ownerState:zt}),[qn,Gi]=ot("tooltip",{elementType:DG,className:Z.tooltip,externalForwardedProps:pe,ownerState:zt}),[Br,vr]=ot("arrow",{elementType:IG,className:Z.arrow,externalForwardedProps:pe,ownerState:zt,ref:ne});return w.jsxs(_.Fragment,{children:[_.cloneElement(B,ye),w.jsx(Qe,{as:k??jy,placement:T,anchorEl:y?{getBoundingClientRect:()=>({top:fs.y,left:fs.x,right:fs.x,bottom:fs.y,width:0,height:0})}:F,popperRef:nn,open:F?A:!1,id:fe,transition:!0,...rn,...dt,popperOptions:le,children:({TransitionProps:be})=>w.jsx(Hn,{timeout:K.transitions.duration.shorter,...be,...vi,children:w.jsxs(qn,{...Gi,children:[D,i?w.jsx(Br,{...vr}):null]})})})]})});process.env.NODE_ENV!=="production"&&(Gm.propTypes={arrow:f.bool,children:Ka.isRequired,classes:f.object,className:f.string,components:f.shape({Arrow:f.elementType,Popper:f.elementType,Tooltip:f.elementType,Transition:f.elementType}),componentsProps:f.shape({arrow:f.object,popper:f.object,tooltip:f.object,transition:f.object}),describeChild:f.bool,disableFocusListener:f.bool,disableHoverListener:f.bool,disableInteractive:f.bool,disableTouchListener:f.bool,enterDelay:f.number,enterNextDelay:f.number,enterTouchDelay:f.number,followCursor:f.bool,id:f.string,leaveDelay:f.number,leaveTouchDelay:f.number,onClose:f.func,onOpen:f.func,open:f.bool,placement:f.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:f.elementType,PopperProps:f.object,slotProps:f.shape({arrow:f.oneOfType([f.func,f.object]),popper:f.oneOfType([f.func,f.object]),tooltip:f.oneOfType([f.func,f.object]),transition:f.oneOfType([f.func,f.object])}),slots:f.shape({arrow:f.elementType,popper:f.elementType,tooltip:f.elementType,transition:f.elementType}),sx:f.oneOfType([f.arrayOf(f.oneOfType([f.func,f.object,f.bool])),f.func,f.object]),title:f.node,TransitionComponent:f.elementType,TransitionProps:f.object});function $G(e){return Ge("MuiTextField",e)}qe("MuiTextField",["root"]);const LG={standard:Sf,filled:Of,outlined:Ef},FG=e=>{const{classes:t}=e;return rt({root:["root"]},$G,t)},BG=ve(Ny,{name:"MuiTextField",slot:"Root"})({}),ZA=_.forwardRef(function(t,n){const r=ut({props:t,name:"MuiTextField"}),{autoComplete:i,autoFocus:o=!1,children:a,className:s,color:l="primary",defaultValue:c,disabled:u=!1,error:d=!1,FormHelperTextProps:p,fullWidth:h=!1,helperText:g,id:m,InputLabelProps:v,inputProps:y,InputProps:S,inputRef:x,label:b,maxRows:O,minRows:E,multiline:C=!1,name:T,onBlur:k,onChange:R,onFocus:M,placeholder:P,required:D=!1,rows:j,select:N=!1,SelectProps:L,slots:B={},slotProps:K={},type:z,value:F,variant:G="outlined",...Y}=r,ne={...r,autoFocus:o,color:l,disabled:u,error:d,fullWidth:h,multiline:C,required:D,select:N,variant:G},Q=FG(ne);process.env.NODE_ENV!=="production"&&N&&!a&&console.error("MUI: `children` must be passed when using the `TextField` component with `select`.");const X=wg(m),te=g&&X?`${X}-helper-text`:void 0,ie=b&&X?`${X}-label`:void 0,ae=LG[G],W={slots:B,slotProps:{input:S,inputLabel:v,htmlInput:y,formHelperText:p,select:L,...K}},H={},J=W.slotProps.inputLabel;G==="outlined"&&(J&&typeof J.shrink<"u"&&(H.notched=J.shrink),H.label=b),N&&((!L||!L.native)&&(H.id=void 0),H["aria-describedby"]=void 0);const[A,fe]=ot("root",{elementType:BG,shouldForwardComponentProp:!0,externalForwardedProps:{...W,...Y},ownerState:ne,className:oe(Q.root,s),ref:n,additionalProps:{disabled:u,error:d,fullWidth:h,required:D,color:l,variant:G}}),[re,me]=ot("input",{elementType:ae,externalForwardedProps:W,additionalProps:H,ownerState:ne}),[we,Se]=ot("inputLabel",{elementType:LA,externalForwardedProps:W,ownerState:ne}),[_e,Ze]=ot("htmlInput",{elementType:"input",externalForwardedProps:W,ownerState:ne}),[De,Te]=ot("formHelperText",{elementType:IA,externalForwardedProps:W,ownerState:ne}),[de,Et]=ot("select",{elementType:_f,externalForwardedProps:W,ownerState:ne}),Je=w.jsx(re,{"aria-describedby":te,autoComplete:i,autoFocus:o,defaultValue:c,fullWidth:h,multiline:C,name:T,rows:j,maxRows:O,minRows:E,type:z,value:F,id:X,inputRef:x,onBlur:k,onChange:R,onFocus:M,placeholder:P,inputProps:Ze,slots:{input:B.htmlInput?_e:void 0},...me});return w.jsxs(A,{...fe,children:[b!=null&&b!==""&&w.jsx(we,{htmlFor:X,id:ie,...Se,children:b}),N?w.jsx(de,{"aria-describedby":te,id:X,labelId:ie,value:F,input:Je,...Et,children:a}):Je,g&&w.jsx(De,{id:te,...Te,children:g})]})});process.env.NODE_ENV!=="production"&&(ZA.propTypes={autoComplete:f.string,autoFocus:f.bool,children:f.node,classes:f.object,className:f.string,color:f.oneOfType([f.oneOf(["primary","secondary","error","info","success","warning"]),f.string]),defaultValue:f.any,disabled:f.bool,error:f.bool,FormHelperTextProps:f.object,fullWidth:f.bool,helperText:f.node,id:f.string,InputLabelProps:f.object,inputProps:f.object,InputProps:f.object,inputRef:ur,label:f.node,margin:f.oneOf(["dense","none","normal"]),maxRows:f.oneOfType([f.number,f.string]),minRows:f.oneOfType([f.number,f.string]),multiline:f.bool,name:f.string,onBlur:f.func,onChange:f.func,onFocus:f.func,placeholder:f.string,required:f.bool,rows:f.oneOfType([f.number,f.string]),select:f.bool,SelectProps:f.object,size:f.oneOfType([f.oneOf(["medium","small"]),f.string]),slotProps:f.shape({formHelperText:f.oneOfType([f.func,f.object]),htmlInput:f.oneOfType([f.func,f.object]),input:f.oneOfType([f.func,f.object]),inputLabel:f.oneOfType([f.func,f.object]),select:f.oneOfType([f.func,f.object])}),slots:f.shape({formHelperText:f.elementType,htmlInput:f.elementType,input:f.elementType,inputLabel:f.elementType,root:f.elementType,select:f.elementType}),sx:f.oneOfType([f.arrayOf(f.oneOfType([f.func,f.object,f.bool])),f.func,f.object]),type:f.string,value:f.any,variant:f.oneOf(["filled","outlined","standard"])});function zG(e){return Xe({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 VG(e){return Xe({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 WG(e){return Xe({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)}const UG=su(_f)(()=>({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 Yl({widgetId:e,options:t=[],defaultValue:n=["all"],onFilterChange:r=()=>{},onExport:i=()=>{}}){const o=JSON.parse(sessionStorage.getItem("community_id"))||[],[a,s]=I.useState(o),[l,c]=I.useState(""),u=t.filter(h=>h.community_name.toLowerCase().includes(l.toLowerCase())),d=h=>{let g=h.target.value;const m=t.map(v=>v.community_id);if(g.includes("all")&&!a.includes("all"))s(["all",...m]),yi("community_id",JSON.stringify(m)),yi("widget_id",e),r(m);else if(!g.includes("all")&&a.includes("all"))s([]),yi("community_id",JSON.stringify([])),yi("widget_id",e),r([]);else{const v=g.filter(x=>x!=="all"),y=v.length>0&&m.every(x=>v.includes(x));s(y?["all",...m]:v);const S=v.length===1?v[0]:v;yi("community_id",JSON.stringify(S)),yi("widget_id",e),r(S)}},p=()=>{yi("widget_id",e),yi("export",!0),i()};return w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx(Gm,{slotProps:{tooltip:{sx:{fontSize:"12px"}}},children:w.jsx(Ny,{size:"small",children:w.jsxs(UG,{multiple:!0,value:a,onChange:d,displayEmpty:!0,renderValue:h=>h.length===0?w.jsx("span",{style:{color:"#9e9e9e"},children:"Select Community"}):h.includes("all")?"All":t.filter(g=>h.includes(g.community_id)).map(g=>g.community_name).join(", "),MenuProps:{PaperProps:{style:{maxHeight:300}},autoFocus:!1},children:[w.jsx(Ps,{onKeyDown:h=>h.stopPropagation(),onClick:h=>h.stopPropagation(),disableRipple:!0,sx:{"&:hover":{backgroundColor:"transparent"},cursor:"default"},children:w.jsx(ZA,{placeholder:"Search...",size:"small",variant:"outlined",value:l,onChange:h=>c(h.target.value),onClick:h=>h.stopPropagation(),onKeyDown:h=>h.stopPropagation(),sx:{width:"100%"},autoFocus:!0})}),w.jsxs(Ps,{value:"all",children:[w.jsx(Km,{checked:a.includes("all")}),w.jsx(tu,{primary:"All",sx:{fontWeight:600}})]}),u.length>0?u.map(h=>w.jsxs(Ps,{value:h.community_id,children:[w.jsx(Km,{checked:a.includes(h.community_id)}),w.jsx(tu,{primary:h.community_name})]},h.community_id)):w.jsx(Ps,{disabled:!0,children:w.jsx(tu,{primary:"No results found"})})]})})}),w.jsx(Gm,{title:"Export CSV for this widget",children:w.jsx("button",{onClick:p,className:"px-3 py-2 bg-[#FBF5FF] rounded cursor-pointer",children:w.jsx(VG,{className:"stroke-[#884EA7] stroke-[1.4]"})})})]})}function HG({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 w.jsx($o,{title:"Community",period:"This Month",icon:w.jsx(_g,{className:"!text-[24px] text-[#329DFF]"}),className:`${e&&"max-h-[184px]"} h-[184px] mb-4 break-inside-avoid`,actionButtons:w.jsx(Yl,{widgetId:t?.widget_id,options:t?.communities,onFilterChange:(c,u)=>console.log(c,u),onExport:c=>console.log("Export triggered for",c)}),children:w.jsxs("div",{className:"flex",children:[w.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[w.jsxs("div",{className:"flex flex-col gap-[8px]",children:[w.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Move-in/Out Count"}),w.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium !text-[#8B5CF6]",children:n+r})]}),w.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] flex items-center gap-[4px]",children:[w.jsx(f_,{value:l(i,o)}),w.jsx("div",{className:"whitespace-nowrap",children:"Compared to last month"})]})]}),w.jsx("div",{className:"w-[50%] h-[111px] flex justify-end",children:w.jsx(Vo,{width:"75%",height:"100%",children:w.jsxs(ff,{children:[w.jsxs(Ul,{data:s,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:[w.jsx(Ir,{fill:a[0]}),w.jsx(Ir,{fill:a[1]})]}),w.jsx(zo,{content:w.jsx(El,{})})]})})})]})})}function qG({isStatic:e,data:t,communities:n}){const r=["#8B5CF6","#22C55E","#3B82F6","#F59E0B"],i=[{name:"Notice",value:Number(t?.total_notices||0),color:r[0]},{name:"Post",value:Number(t?.total_topics||0),color:r[1]},{name:"Poll",value:Number(t?.total_polls||0),color:r[2]},{name:"Survey",value:Number(t?.total_surveys||0),color:r[3]}];return w.jsx($o,{title:"Engagement",period:"This Month",icon:w.jsx(s_,{className:"!text-[24px] text-[#DBB467]"}),className:`${e&&"max-h-[303px]"} h-[303px]`,actionButtons:w.jsx(Yl,{widgetId:t?.widget_id,options:t?.communities,onFilterChange:(o,a)=>console.log(o,a),onExport:o=>console.log("Export triggered for",o)}),children:w.jsx("div",{className:"w-full h-[235px]",children:w.jsx(Vo,{width:"100%",height:"100%",children:w.jsxs(jH,{data:i,layout:"vertical",margin:{top:4,right:8,left:0,bottom:0},children:[w.jsx(uf,{stroke:"#e5e7eb",strokeDasharray:"3 3",horizontal:!1}),w.jsx(rl,{type:"category",dataKey:"name",width:40,axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#121212",fontWeight:400}}),w.jsx(df,{type:"number",axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#64748B",fontWeight:400}}),w.jsx(zo,{content:w.jsx(El,{}),cursor:{fill:"transparent"}}),w.jsx(CT,{dataKey:"value",barSize:40,isAnimationActive:!1,children:i.map((o,a)=>w.jsx(Ir,{fill:r[a]},o.name))})]})})})})}function KG({isStatic:e,data:t}){const n=Number(t?.totalBookings||0),r=Number(t?.averageUtilizationPercentage||0),i=I.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 w.jsxs($o,{title:"Facilities",period:"Today",icon:w.jsx(a_,{className:"!text-[24px] text-[#8B5CF6]"}),className:`${e&&"max-h-[305px]"} h-[305px] mb-4 break-inside-avoid`,children:[w.jsxs("div",{className:"grid grid-cols-2 gap-[24px] mb-[16px]",children:[w.jsxs("div",{children:[w.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Bookings"}),w.jsx("div",{className:"!text-[24px] font-medium text-[#8B5CF6]",children:n})]}),w.jsxs("div",{children:[w.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Utilisation Rate"}),w.jsxs("div",{className:"!text-[24px] font-medium text-[#329DFF]",children:[r.toFixed(2),"%"]})]})]}),w.jsx("div",{className:"w-full h-[170px]",children:w.jsx(Vo,{width:"100%",height:"100%",children:w.jsxs(tA,{data:a,margin:{top:5,right:-30,left:-35,bottom:0},children:[w.jsx(uf,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),w.jsx(df,{dataKey:"time",interval:0,tickFormatter:o,tick:{fontSize:10,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1,minTickGap:0}),w.jsx(rl,{yAxisId:"left",tick:{fontSize:10,fill:"#64748B"},axisLine:!1,tickLine:!1}),w.jsx(rl,{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}),w.jsx(zo,{content:w.jsx(El,{})}),w.jsx(pa,{yAxisId:"left",type:"monotone",dataKey:"bookings",name:"Bookings",stroke:"#8B5CF6",strokeWidth:2,dot:!1}),w.jsx(pa,{yAxisId:"right",type:"monotone",dataKey:"utilization",name:"Utilization Rate",stroke:"#329DFF",strokeWidth:2,dot:!1,strokeDasharray:"2 4"})]})})})]})}function YG({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 console.log("Finance Summary Data:",e),w.jsx($o,{title:"Income",period:"This Month",icon:w.jsx(s0,{className:"!text-[24px] text-green-600"}),className:"!gap-[16px] break-inside-avoid h-[232px] overflow-hidden",actionButtons:w.jsx(Yl,{widgetId:e?.widget_id,options:e?.communities,onFilterChange:(s,l)=>console.log(s,l),onExport:s=>console.log("Export triggered for",s)}),children:w.jsxs("div",{children:[w.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mb-2",children:[w.jsx("div",{children:"Opening"}),w.jsx("div",{children:"Income"}),w.jsx("div",{children:"Collection"}),w.jsx("div",{children:"Closing"})]}),w.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212] mb-2",children:[w.jsx("div",{children:a(t.opening_balance,t?.currency_type)}),w.jsx("div",{children:a(t.income,t?.currency_type)}),w.jsx("div",{children:a(t.collection,t?.currency_type)}),w.jsx("div",{children:a(t.closing_balance,t?.currency_type)})]}),w.jsx("hr",{className:"my-4 border-t border-dashed border-gray-300"}),w.jsx("div",{className:"flex items-center justify-between",children:w.jsxs("div",{className:"flex items-center gap-[12px]",children:[w.jsx(s0,{className:"!text-[24px] text-red-600"}),w.jsx("div",{className:"!my-0 !font-medium !text-[16px] !leading-[20px] !text-[#121212]",children:"Expenditure"})]})}),w.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mt-4 mb-2",children:[w.jsx("div",{children:"Opening"}),w.jsx("div",{children:"Expenditure"}),w.jsx("div",{children:"Payment"}),w.jsx("div",{children:"Outstanding"})]}),w.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212]",children:[w.jsx("div",{children:a(n.opening_balance,n?.currency_type)}),w.jsx("div",{children:a(n.expenditure,n?.currency_type)}),w.jsx("div",{children:a(n.payment,n?.currency_type)}),w.jsx("div",{children:a(n.outstanding,n?.currency_type)})]})]})})}var GG="tippy-box",JA="tippy-content",XG="tippy-backdrop",QA="tippy-arrow",ek="tippy-svg-arrow",lo={passive:!0,capture:!0},tk=function(){return document.body};function ZG(e,t){return{}.hasOwnProperty.call(e,t)}function Eh(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function Iy(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function nk(e,t){return typeof e=="function"?e.apply(void 0,t):e}function VO(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function JG(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function QG(e){return e.split(/\s+/).filter(Boolean)}function oa(e){return[].concat(e)}function WO(e,t){e.indexOf(t)===-1&&e.push(t)}function eX(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function tX(e){return e.split("-")[0]}function od(e){return[].slice.call(e)}function UO(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function $s(){return document.createElement("div")}function cl(e){return["Element","Fragment"].some(function(t){return Iy(e,t)})}function nX(e){return Iy(e,"NodeList")}function rX(e){return Iy(e,"MouseEvent")}function iX(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function oX(e){return cl(e)?[e]:nX(e)?od(e):Array.isArray(e)?e:od(document.querySelectorAll(e))}function _h(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function HO(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function aX(e){var t,n=oa(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function sX(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=tX(a.placement),u=a.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,p=c==="top"?u.bottom.y:0,h=c==="right"?u.left.x:0,g=c==="left"?u.right.x:0,m=o.top-r+d>l,v=r-o.bottom-p>l,y=o.left-n+h>l,S=n-o.right-g>l;return m||v||y||S})}function Ph(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function qO(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 _r={isTouch:!1},KO=0;function lX(){_r.isTouch||(_r.isTouch=!0,window.performance&&document.addEventListener("mousemove",rk))}function rk(){var e=performance.now();e-KO<20&&(_r.isTouch=!1,document.removeEventListener("mousemove",rk)),KO=e}function cX(){var e=document.activeElement;if(iX(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function uX(){document.addEventListener("touchstart",lX,lo),window.addEventListener("blur",cX)}var dX=typeof window<"u"&&typeof document<"u",fX=dX?!!window.msCrypto:!1;function ea(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 YO(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function pX(e){return YO(`
309
+ `));const zt={...r,isRtl:z,arrow:i,disableInteractive:X,placement:T,PopperComponentProp:k,touch:Q.current},U=typeof M.popper=="function"?M.popper(zt):M.popper,le=_.useMemo(()=>{let be=[{name:"arrow",enabled:!!Y,options:{element:Y,padding:4}}];return R.popperOptions?.modifiers&&(be=be.concat(R.popperOptions.modifiers)),U?.popperOptions?.modifiers&&(be=be.concat(U.popperOptions.modifiers)),{...R.popperOptions,...U?.popperOptions,modifiers:be}},[Y,R.popperOptions,U?.popperOptions]),Z=NG(zt),ce=typeof M.transition=="function"?M.transition(zt):M.transition,pe={slots:{popper:s.Popper,transition:s.Transition??j,tooltip:s.Tooltip,arrow:s.Arrow,...P},slotProps:{arrow:M.arrow??l.arrow,popper:{...R,...U??l.popper},tooltip:M.tooltip??l.tooltip,transition:{...N,...ce??l.transition}}},[Qe,dt]=ot("popper",{elementType:RG,externalForwardedProps:pe,ownerState:zt,className:oe(Z.popper,R?.className)}),[Hn,vi]=ot("transition",{elementType:sl,externalForwardedProps:pe,ownerState:zt}),[qn,Gi]=ot("tooltip",{elementType:DG,className:Z.tooltip,externalForwardedProps:pe,ownerState:zt}),[Br,vr]=ot("arrow",{elementType:IG,className:Z.arrow,externalForwardedProps:pe,ownerState:zt,ref:ne});return w.jsxs(_.Fragment,{children:[_.cloneElement(B,ye),w.jsx(Qe,{as:k??jy,placement:T,anchorEl:y?{getBoundingClientRect:()=>({top:fs.y,left:fs.x,right:fs.x,bottom:fs.y,width:0,height:0})}:F,popperRef:nn,open:F?A:!1,id:fe,transition:!0,...rn,...dt,popperOptions:le,children:({TransitionProps:be})=>w.jsx(Hn,{timeout:K.transitions.duration.shorter,...be,...vi,children:w.jsxs(qn,{...Gi,children:[D,i?w.jsx(Br,{...vr}):null]})})})]})});process.env.NODE_ENV!=="production"&&(Gm.propTypes={arrow:f.bool,children:Ka.isRequired,classes:f.object,className:f.string,components:f.shape({Arrow:f.elementType,Popper:f.elementType,Tooltip:f.elementType,Transition:f.elementType}),componentsProps:f.shape({arrow:f.object,popper:f.object,tooltip:f.object,transition:f.object}),describeChild:f.bool,disableFocusListener:f.bool,disableHoverListener:f.bool,disableInteractive:f.bool,disableTouchListener:f.bool,enterDelay:f.number,enterNextDelay:f.number,enterTouchDelay:f.number,followCursor:f.bool,id:f.string,leaveDelay:f.number,leaveTouchDelay:f.number,onClose:f.func,onOpen:f.func,open:f.bool,placement:f.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:f.elementType,PopperProps:f.object,slotProps:f.shape({arrow:f.oneOfType([f.func,f.object]),popper:f.oneOfType([f.func,f.object]),tooltip:f.oneOfType([f.func,f.object]),transition:f.oneOfType([f.func,f.object])}),slots:f.shape({arrow:f.elementType,popper:f.elementType,tooltip:f.elementType,transition:f.elementType}),sx:f.oneOfType([f.arrayOf(f.oneOfType([f.func,f.object,f.bool])),f.func,f.object]),title:f.node,TransitionComponent:f.elementType,TransitionProps:f.object});function $G(e){return Ge("MuiTextField",e)}qe("MuiTextField",["root"]);const LG={standard:Sf,filled:Of,outlined:Ef},FG=e=>{const{classes:t}=e;return rt({root:["root"]},$G,t)},BG=ve(Ny,{name:"MuiTextField",slot:"Root"})({}),ZA=_.forwardRef(function(t,n){const r=ut({props:t,name:"MuiTextField"}),{autoComplete:i,autoFocus:o=!1,children:a,className:s,color:l="primary",defaultValue:c,disabled:u=!1,error:d=!1,FormHelperTextProps:p,fullWidth:h=!1,helperText:g,id:m,InputLabelProps:v,inputProps:y,InputProps:S,inputRef:x,label:b,maxRows:O,minRows:E,multiline:C=!1,name:T,onBlur:k,onChange:R,onFocus:M,placeholder:P,required:D=!1,rows:j,select:N=!1,SelectProps:L,slots:B={},slotProps:K={},type:z,value:F,variant:G="outlined",...Y}=r,ne={...r,autoFocus:o,color:l,disabled:u,error:d,fullWidth:h,multiline:C,required:D,select:N,variant:G},Q=FG(ne);process.env.NODE_ENV!=="production"&&N&&!a&&console.error("MUI: `children` must be passed when using the `TextField` component with `select`.");const X=wg(m),te=g&&X?`${X}-helper-text`:void 0,ie=b&&X?`${X}-label`:void 0,ae=LG[G],W={slots:B,slotProps:{input:S,inputLabel:v,htmlInput:y,formHelperText:p,select:L,...K}},H={},J=W.slotProps.inputLabel;G==="outlined"&&(J&&typeof J.shrink<"u"&&(H.notched=J.shrink),H.label=b),N&&((!L||!L.native)&&(H.id=void 0),H["aria-describedby"]=void 0);const[A,fe]=ot("root",{elementType:BG,shouldForwardComponentProp:!0,externalForwardedProps:{...W,...Y},ownerState:ne,className:oe(Q.root,s),ref:n,additionalProps:{disabled:u,error:d,fullWidth:h,required:D,color:l,variant:G}}),[re,me]=ot("input",{elementType:ae,externalForwardedProps:W,additionalProps:H,ownerState:ne}),[we,Se]=ot("inputLabel",{elementType:LA,externalForwardedProps:W,ownerState:ne}),[_e,Ze]=ot("htmlInput",{elementType:"input",externalForwardedProps:W,ownerState:ne}),[De,Te]=ot("formHelperText",{elementType:IA,externalForwardedProps:W,ownerState:ne}),[de,Et]=ot("select",{elementType:_f,externalForwardedProps:W,ownerState:ne}),Je=w.jsx(re,{"aria-describedby":te,autoComplete:i,autoFocus:o,defaultValue:c,fullWidth:h,multiline:C,name:T,rows:j,maxRows:O,minRows:E,type:z,value:F,id:X,inputRef:x,onBlur:k,onChange:R,onFocus:M,placeholder:P,inputProps:Ze,slots:{input:B.htmlInput?_e:void 0},...me});return w.jsxs(A,{...fe,children:[b!=null&&b!==""&&w.jsx(we,{htmlFor:X,id:ie,...Se,children:b}),N?w.jsx(de,{"aria-describedby":te,id:X,labelId:ie,value:F,input:Je,...Et,children:a}):Je,g&&w.jsx(De,{id:te,...Te,children:g})]})});process.env.NODE_ENV!=="production"&&(ZA.propTypes={autoComplete:f.string,autoFocus:f.bool,children:f.node,classes:f.object,className:f.string,color:f.oneOfType([f.oneOf(["primary","secondary","error","info","success","warning"]),f.string]),defaultValue:f.any,disabled:f.bool,error:f.bool,FormHelperTextProps:f.object,fullWidth:f.bool,helperText:f.node,id:f.string,InputLabelProps:f.object,inputProps:f.object,InputProps:f.object,inputRef:ur,label:f.node,margin:f.oneOf(["dense","none","normal"]),maxRows:f.oneOfType([f.number,f.string]),minRows:f.oneOfType([f.number,f.string]),multiline:f.bool,name:f.string,onBlur:f.func,onChange:f.func,onFocus:f.func,placeholder:f.string,required:f.bool,rows:f.oneOfType([f.number,f.string]),select:f.bool,SelectProps:f.object,size:f.oneOfType([f.oneOf(["medium","small"]),f.string]),slotProps:f.shape({formHelperText:f.oneOfType([f.func,f.object]),htmlInput:f.oneOfType([f.func,f.object]),input:f.oneOfType([f.func,f.object]),inputLabel:f.oneOfType([f.func,f.object]),select:f.oneOfType([f.func,f.object])}),slots:f.shape({formHelperText:f.elementType,htmlInput:f.elementType,input:f.elementType,inputLabel:f.elementType,root:f.elementType,select:f.elementType}),sx:f.oneOfType([f.arrayOf(f.oneOfType([f.func,f.object,f.bool])),f.func,f.object]),type:f.string,value:f.any,variant:f.oneOf(["filled","outlined","standard"])});function zG(e){return Xe({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 VG(e){return Xe({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 WG(e){return Xe({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)}const UG=su(_f)(()=>({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 Yl({widgetId:e,options:t=[],defaultValue:n=["all"],onFilterChange:r=()=>{},onExport:i=()=>{}}){const o=JSON.parse(sessionStorage.getItem("community_id"))||[],[a,s]=I.useState(o),[l,c]=I.useState(""),u=t.filter(h=>h.community_name.toLowerCase().includes(l.toLowerCase())),d=h=>{let g=h.target.value;const m=t.map(v=>v.community_id);if(g.includes("all")&&!a.includes("all"))s(["all",...m]),yi("community_id",JSON.stringify(m)),yi("widget_id",e),r(m);else if(!g.includes("all")&&a.includes("all"))s([]),yi("community_id",JSON.stringify([])),yi("widget_id",e),r([]);else{const v=g.filter(x=>x!=="all"),y=v.length>0&&m.every(x=>v.includes(x));s(y?["all",...m]:v);const S=v.length===1?v[0]:v;yi("community_id",JSON.stringify(S)),yi("widget_id",e),r(S)}},p=()=>{yi("widget_id",e),yi("export",!0),i()};return w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx(Gm,{slotProps:{tooltip:{sx:{fontSize:"12px"}}},children:w.jsx(Ny,{size:"small",children:w.jsxs(UG,{multiple:!0,value:a,onChange:d,displayEmpty:!0,renderValue:h=>h.length===0?w.jsx("span",{style:{color:"#9e9e9e"},children:"Select Community"}):h.includes("all")?"All":t.filter(g=>h.includes(g.community_id)).map(g=>g.community_name).join(", "),MenuProps:{PaperProps:{style:{maxHeight:300}},autoFocus:!1},children:[w.jsx(Ps,{onKeyDown:h=>h.stopPropagation(),onClick:h=>h.stopPropagation(),disableRipple:!0,sx:{"&:hover":{backgroundColor:"transparent"},cursor:"default"},children:w.jsx(ZA,{placeholder:"Search...",size:"small",variant:"outlined",value:l,onChange:h=>c(h.target.value),onClick:h=>h.stopPropagation(),onKeyDown:h=>h.stopPropagation(),sx:{width:"100%"},autoFocus:!0})}),w.jsxs(Ps,{value:"all",children:[w.jsx(Km,{checked:a.includes("all")}),w.jsx(tu,{primary:"All",sx:{fontWeight:600}})]}),u.length>0?u.map(h=>w.jsxs(Ps,{value:h.community_id,children:[w.jsx(Km,{checked:a.includes(h.community_id)}),w.jsx(tu,{primary:h.community_name})]},h.community_id)):w.jsx(Ps,{disabled:!0,children:w.jsx(tu,{primary:"No results found"})})]})})}),w.jsx(Gm,{title:"Export CSV for this widget",children:w.jsx("button",{onClick:p,className:"px-3 py-2 bg-[#FBF5FF] rounded cursor-pointer",children:w.jsx(VG,{className:"stroke-[#884EA7] stroke-[1.4]"})})})]})}function HG({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 w.jsx($o,{title:"Community",period:"This Month",icon:w.jsx(_g,{className:"!text-[24px] text-[#329DFF]"}),className:`${e&&"max-h-[184px]"} h-[184px] mb-4 break-inside-avoid`,actionButtons:w.jsx(Yl,{widgetId:t?.widget_id,options:t?.communities,onFilterChange:(c,u)=>console.log(c,u),onExport:c=>console.log("Export triggered for",c)}),children:w.jsxs("div",{className:"flex",children:[w.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[w.jsxs("div",{className:"flex flex-col gap-[8px]",children:[w.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Move-in/Out Count"}),w.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium !text-[#8B5CF6]",children:n+r})]}),w.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] flex items-center gap-[4px]",children:[w.jsx(f_,{value:l(i,o)}),w.jsx("div",{className:"whitespace-nowrap",children:"Compared to last month"})]})]}),w.jsx("div",{className:"w-[50%] h-[111px] flex justify-end",children:w.jsx(Vo,{width:"75%",height:"100%",children:w.jsxs(ff,{children:[w.jsxs(Ul,{data:s,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:[w.jsx(Ir,{fill:a[0]}),w.jsx(Ir,{fill:a[1]})]}),w.jsx(zo,{content:w.jsx(El,{})})]})})})]})})}function qG({isStatic:e,data:t,communities:n}){const r=["#8B5CF6","#22C55E","#3B82F6","#F59E0B"],i=[{name:"Notice",value:Number(t?.total_notices||0),color:r[0]},{name:"Post",value:Number(t?.total_topics||0),color:r[1]},{name:"Poll",value:Number(t?.total_polls||0),color:r[2]},{name:"Survey",value:Number(t?.total_surveys||0),color:r[3]}];return w.jsx($o,{title:"Engagement",period:"This Month",icon:w.jsx(s_,{className:"!text-[24px] text-[#DBB467]"}),className:`${e&&"max-h-[303px]"} h-[303px]`,actionButtons:w.jsx(Yl,{widgetId:t?.widget_id,options:t?.communities,onFilterChange:(o,a)=>console.log(o,a),onExport:o=>console.log("Export triggered for",o)}),children:w.jsx("div",{className:"w-full h-[235px]",children:w.jsx(Vo,{width:"100%",height:"100%",children:w.jsxs(jH,{data:i,layout:"vertical",margin:{top:4,right:8,left:0,bottom:0},children:[w.jsx(uf,{stroke:"#e5e7eb",strokeDasharray:"3 3",horizontal:!1}),w.jsx(rl,{type:"category",dataKey:"name",width:40,axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#121212",fontWeight:400}}),w.jsx(df,{type:"number",axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#64748B",fontWeight:400}}),w.jsx(zo,{content:w.jsx(El,{}),cursor:{fill:"transparent"}}),w.jsx(CT,{dataKey:"value",barSize:40,isAnimationActive:!1,children:i.map((o,a)=>w.jsx(Ir,{fill:r[a]},o.name))})]})})})})}function KG({isStatic:e,data:t}){const n=Number(t?.totalBookings||0),r=Number(t?.averageUtilizationPercentage||0),i=I.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 w.jsxs($o,{title:"Facilities",period:"Today",icon:w.jsx(a_,{className:"!text-[24px] text-[#8B5CF6]"}),className:`${e&&"max-h-[305px]"} h-[305px] mb-4 break-inside-avoid`,children:[w.jsxs("div",{className:"grid grid-cols-2 gap-[24px] mb-[16px]",children:[w.jsxs("div",{children:[w.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Bookings"}),w.jsx("div",{className:"!text-[24px] font-medium text-[#8B5CF6]",children:n})]}),w.jsxs("div",{children:[w.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Utilisation Rate"}),w.jsxs("div",{className:"!text-[24px] font-medium text-[#329DFF]",children:[r.toFixed(2),"%"]})]})]}),w.jsx("div",{className:"w-full h-[170px]",children:w.jsx(Vo,{width:"100%",height:"100%",children:w.jsxs(tA,{data:a,margin:{top:5,right:-30,left:-35,bottom:0},children:[w.jsx(uf,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),w.jsx(df,{dataKey:"time",interval:0,tickFormatter:o,tick:{fontSize:10,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1,minTickGap:0}),w.jsx(rl,{yAxisId:"left",tick:{fontSize:10,fill:"#64748B"},axisLine:!1,tickLine:!1}),w.jsx(rl,{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}),w.jsx(zo,{content:w.jsx(El,{})}),w.jsx(pa,{yAxisId:"left",type:"monotone",dataKey:"bookings",name:"Bookings",stroke:"#8B5CF6",strokeWidth:2,dot:!1,isAnimationActive:!1}),w.jsx(pa,{yAxisId:"right",type:"monotone",dataKey:"utilization",name:"Utilization Rate",stroke:"#329DFF",strokeWidth:2,dot:!1,strokeDasharray:"2 4",isAnimationActive:!1})]})})})]})}function YG({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 console.log("Finance Summary Data:",e),w.jsx($o,{title:"Income",period:"This Month",icon:w.jsx(s0,{className:"!text-[24px] text-green-600"}),className:"!gap-[16px] break-inside-avoid h-[232px] overflow-hidden",actionButtons:w.jsx(Yl,{widgetId:e?.widget_id,options:e?.communities,onFilterChange:(s,l)=>console.log(s,l),onExport:s=>console.log("Export triggered for",s)}),children:w.jsxs("div",{children:[w.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mb-2",children:[w.jsx("div",{children:"Opening"}),w.jsx("div",{children:"Income"}),w.jsx("div",{children:"Collection"}),w.jsx("div",{children:"Closing"})]}),w.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212] mb-2",children:[w.jsx("div",{children:a(t.opening_balance,t?.currency_type)}),w.jsx("div",{children:a(t.income,t?.currency_type)}),w.jsx("div",{children:a(t.collection,t?.currency_type)}),w.jsx("div",{children:a(t.closing_balance,t?.currency_type)})]}),w.jsx("hr",{className:"my-4 border-t border-dashed border-gray-300"}),w.jsx("div",{className:"flex items-center justify-between",children:w.jsxs("div",{className:"flex items-center gap-[12px]",children:[w.jsx(s0,{className:"!text-[24px] text-red-600"}),w.jsx("div",{className:"!my-0 !font-medium !text-[16px] !leading-[20px] !text-[#121212]",children:"Expenditure"})]})}),w.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mt-4 mb-2",children:[w.jsx("div",{children:"Opening"}),w.jsx("div",{children:"Expenditure"}),w.jsx("div",{children:"Payment"}),w.jsx("div",{children:"Outstanding"})]}),w.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212]",children:[w.jsx("div",{children:a(n.opening_balance,n?.currency_type)}),w.jsx("div",{children:a(n.expenditure,n?.currency_type)}),w.jsx("div",{children:a(n.payment,n?.currency_type)}),w.jsx("div",{children:a(n.outstanding,n?.currency_type)})]})]})})}var GG="tippy-box",JA="tippy-content",XG="tippy-backdrop",QA="tippy-arrow",ek="tippy-svg-arrow",lo={passive:!0,capture:!0},tk=function(){return document.body};function ZG(e,t){return{}.hasOwnProperty.call(e,t)}function Eh(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function Iy(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function nk(e,t){return typeof e=="function"?e.apply(void 0,t):e}function VO(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function JG(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function QG(e){return e.split(/\s+/).filter(Boolean)}function oa(e){return[].concat(e)}function WO(e,t){e.indexOf(t)===-1&&e.push(t)}function eX(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function tX(e){return e.split("-")[0]}function od(e){return[].slice.call(e)}function UO(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function $s(){return document.createElement("div")}function cl(e){return["Element","Fragment"].some(function(t){return Iy(e,t)})}function nX(e){return Iy(e,"NodeList")}function rX(e){return Iy(e,"MouseEvent")}function iX(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function oX(e){return cl(e)?[e]:nX(e)?od(e):Array.isArray(e)?e:od(document.querySelectorAll(e))}function _h(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function HO(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function aX(e){var t,n=oa(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function sX(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=tX(a.placement),u=a.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,p=c==="top"?u.bottom.y:0,h=c==="right"?u.left.x:0,g=c==="left"?u.right.x:0,m=o.top-r+d>l,v=r-o.bottom-p>l,y=o.left-n+h>l,S=n-o.right-g>l;return m||v||y||S})}function Ph(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function qO(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 _r={isTouch:!1},KO=0;function lX(){_r.isTouch||(_r.isTouch=!0,window.performance&&document.addEventListener("mousemove",rk))}function rk(){var e=performance.now();e-KO<20&&(_r.isTouch=!1,document.removeEventListener("mousemove",rk)),KO=e}function cX(){var e=document.activeElement;if(iX(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function uX(){document.addEventListener("touchstart",lX,lo),window.addEventListener("blur",cX)}var dX=typeof window<"u"&&typeof document<"u",fX=dX?!!window.msCrypto:!1;function ea(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 YO(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function pX(e){return YO(`
310
310
  %ctippy.js
311
311
 
312
312
  %c`+YO(e)+`
@@ -326,7 +326,7 @@ Take a look at the reducer(s) handling this action type: ${h.type}.
326
326
  `,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
327
327
 
328
328
  `,`1) content: element.innerHTML
329
- `,"2) content: () => element.cloneNode(true)"].join(" "))}var s=i.reduce(function(l,c){var u=c&&OX(c,r);return u&&l.push(u),l},[]);return cl(e)?s[0]:s}Gl.defaultProps=In;Gl.setDefaultProps=yX;Gl.currentInput=_r;Object.assign({},yA,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});Gl.setDefaultProps({render:lk});function ck(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var uk=typeof window<"u"&&typeof document<"u";function Qm(e,t){e&&(typeof e=="function"&&e(t),{}.hasOwnProperty.call(e,"current")&&(e.current=t))}function JO(){return uk&&document.createElement("div")}function SX(e){var t={"data-placement":e.placement};return e.referenceHidden&&(t["data-reference-hidden"]=""),e.escaped&&(t["data-escaped"]=""),t}function dk(e,t){if(e===t)return!0;if(typeof e=="object"&&e!=null&&typeof t=="object"&&t!=null){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(t.hasOwnProperty(n)){if(!dk(e[n],t[n]))return!1}else return!1;return!0}else return!1}function EX(e){var t=[];return e.forEach(function(n){t.find(function(r){return dk(n,r)})||t.push(n)}),t}function _X(e,t){var n,r;return Object.assign({},t,{popperOptions:Object.assign({},e.popperOptions,t.popperOptions,{modifiers:EX([].concat(((n=e.popperOptions)==null?void 0:n.modifiers)||[],((r=t.popperOptions)==null?void 0:r.modifiers)||[]))})})}var Th=uk?I.useLayoutEffect:I.useEffect;function PX(e){var t=I.useRef();return t.current||(t.current=typeof e=="function"?e():e),t.current}function QO(e,t,n){n.split(/\s+/).forEach(function(r){r&&e.classList[t](r)})}var CX={name:"className",defaultValue:"",fn:function(t){var n=t.popper.firstElementChild,r=function(){var s;return!!((s=t.props.render)!=null&&s.$$tippy)};function i(){if(t.props.className&&!r()){process.env.NODE_ENV!=="production"&&console.warn(["@tippyjs/react: Cannot use `className` prop in conjunction with","`render` prop. Place the className on the element you are","rendering."].join(" "));return}QO(n,"add",t.props.className)}function o(){r()&&QO(n,"remove",t.props.className)}return{onCreate:i,onBeforeUpdate:o,onAfterUpdate:i}}};function TX(e){function t(n){var r=n.children,i=n.content,o=n.visible,a=n.singleton,s=n.render,l=n.reference,c=n.disabled,u=c===void 0?!1:c,d=n.ignoreAttributes,p=d===void 0?!0:d;n.__source,n.__self;var h=ck(n,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]),g=o!==void 0,m=a!==void 0,v=I.useState(!1),y=v[0],S=v[1],x=I.useState({}),b=x[0],O=x[1],E=I.useState(),C=E[0],T=E[1],k=PX(function(){return{container:JO(),renders:1}}),R=Object.assign({ignoreAttributes:p},h,{content:k.container});g&&(process.env.NODE_ENV!=="production"&&["trigger","hideOnClick","showOnCreate"].forEach(function(j){R[j]!==void 0&&console.warn(["@tippyjs/react: Cannot specify `"+j+"` prop in","controlled mode (`visible` prop)"].join(" "))}),R.trigger="manual",R.hideOnClick=!1),m&&(u=!0);var M=R,P=R.plugins||[];s&&(M=Object.assign({},R,{plugins:m&&a.data!=null?[].concat(P,[{fn:function(){return{onTrigger:function(L,B){var K=a.data.children.find(function(z){var F=z.instance;return F.reference===B.currentTarget});L.state.$$activeSingletonInstance=K.instance,T(K.content)}}}}]):P,render:function(){return{popper:k.container}}}));var D=[l].concat(r?[r.type]:[]);return Th(function(){var j=l;l&&l.hasOwnProperty("current")&&(j=l.current);var N=e(j||k.ref||JO(),Object.assign({},M,{plugins:[CX].concat(R.plugins||[])}));return k.instance=N,u&&N.disable(),o&&N.show(),m&&a.hook({instance:N,content:i,props:M,setSingletonContent:T}),S(!0),function(){N.destroy(),a?.cleanup(N)}},D),Th(function(){var j;if(k.renders===1){k.renders++;return}var N=k.instance;N.setProps(_X(N.props,M)),(j=N.popperInstance)==null||j.forceUpdate(),u?N.disable():N.enable(),g&&(o?N.show():N.hide()),m&&a.hook({instance:N,content:i,props:M,setSingletonContent:T})}),Th(function(){var j;if(s){var N=k.instance;N.setProps({popperOptions:Object.assign({},N.props.popperOptions,{modifiers:[].concat((((j=N.props.popperOptions)==null?void 0:j.modifiers)||[]).filter(function(L){var B=L.name;return B!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(B){var K,z=B.state,F=(K=z.modifiersData)==null?void 0:K.hide;(b.placement!==z.placement||b.referenceHidden!==F?.isReferenceHidden||b.escaped!==F?.hasPopperEscaped)&&O({placement:z.placement,referenceHidden:F?.isReferenceHidden,escaped:F?.hasPopperEscaped}),z.attributes.popper={}}}])})})}},[b.placement,b.referenceHidden,b.escaped].concat(D)),I.createElement(I.Fragment,null,r?I.cloneElement(r,{ref:function(N){k.ref=N,Qm(r.ref,N)}}):null,y&&fo.createPortal(s?s(SX(b),C,k.instance):i,k.container))}return t}var AX=(function(e,t){return I.forwardRef(function(r,i){var o=r.children,a=ck(r,["children"]);return I.createElement(e,Object.assign({},t,a),o?I.cloneElement(o,{ref:function(l){Qm(i,l),Qm(o.ref,l)}}):null)})}),kX=AX(TX(Gl));function MX(e){const t=e>=12?"PM":"AM";let n=e%12;return n===0&&(n=12),`${n} ${t}`}function jX(e=[]){return Array.from({length:24},(t,n)=>{const r=e.find(i=>i.hour===n)||{};return{hour:n,time:MX(n),walkins:r.walkins??0,checkins:r.preApproved??0,staffAttendance:r.staffAttendance??0}})}const ta={walkins:"#1FA05B",preApproved:"#E7A015",staffAttendance:"#329DFF"};function NX({type:e,data:t,children:n}){if(!e||!t)return n;const r={activeWalkins:[["Currently Inside",t.visitor_in],["Total Visited Today",t.total_pass]],preApprovedCheckins:[["Currently Inside",t.currently_inside],["Total Visited Today",t.expected_pass_scanned],["No show",t.expected_pass_not_scanned],["Total Scheduled",t.total_expected_pass]],staffAttendance:[["Currently Inside",t.total_in_now],["Absent Today",t.absent_staff],["Total Visited Today",t.total_in_today],["Total Staff",t.total_staff]]},i={activeWalkins:"Active Walk-ins",preApprovedCheckins:"Pre-approved Check-ins",staffAttendance:"Staff Attendance"},o={activeWalkins:"text-[#1FA05B]",preApprovedCheckins:"text-[#E7A015]",staffAttendance:"text-[#329DFF]"},a=w.jsx($o,{title:i[e],period:"Today",icon:w.jsx(Pg,{className:`${o[e]} !text-[24px]`}),className:"!gap-0 min-w-[353px] bg-white shadow-xl rounded-lg border border-gray-200",children:w.jsx("div",{className:"flex flex-col gap-[8px] mt-[12px] pt-[12px] border-t border-dashed border-[#EBEBEB]",children:r[e].map(([s,l])=>w.jsxs("div",{className:"flex justify-between text-[14px] text-[#64748B]",children:[w.jsx("div",{children:s}),w.jsx("div",{className:"font-semibold text-gray-800",children:l??0})]},s))})});return w.jsx(kX,{content:a,placement:"bottom-start",interactive:!0,delay:[100,0],offset:[0,8],appendTo:document.body,theme:"light-border",maxWidth:"none",children:n})}function RX({isStatic:e,data:t}){const n=t?.summary?.activeWalkins||{},r=t?.summary?.preApprovedCheckins||{},i=t?.summary?.staffAttendance||{},o=I.useMemo(()=>jX(t?.chart||[]),[t]),{yAxisTicks:a,yAxisMax:s}=I.useMemo(()=>{const l=Math.max(...o.flatMap(u=>[u.walkins,u.checkins,u.staffAttendance])),c=l>0?l:5;return{yAxisTicks:[0,Math.ceil(c/2),c],yAxisMax:c}},[o]);return w.jsx($o,{title:"Gate Updates",period:"Today",icon:w.jsx(Pg,{className:"!text-[24px] text-[#37CC6D]"}),className:`${e?"max-h-[303px]":""} h-[251px] mb-4 break-inside-avoid`,actionButtons:w.jsx(Yl,{widgetId:t?.widget_id,options:t?.communities,onFilterChange:(l,c)=>console.log(l,c),onExport:l=>console.log("Export triggered for",l)}),children:w.jsxs("div",{children:[w.jsx("div",{className:"grid grid-cols-3 gap-[24px] mb-[16px]",children:[{key:"activeWalkins",data:n,color:ta.walkins,label:"Active Walk-ins"},{key:"staffAttendance",data:i,color:ta.staffAttendance,label:"Staff Checked-in"},{key:"preApprovedCheckins",data:r,color:ta.preApproved,label:"Pre-approved"}].map(l=>w.jsx(NX,{type:l.key,data:l.data,children:w.jsxs("div",{className:"flex flex-col gap-[8px] cursor-pointer",children:[w.jsx("div",{className:"text-[10px] text-[#64748B] whitespace-nowrap",children:l.label}),w.jsxs("div",{className:"text-[28px] font-medium flex items-center",style:{color:l.color},children:[l.key==="activeWalkins"?l.data?.visitor_in??0:l.key==="preApprovedCheckins"?l.data?.currently_inside??0:l.data?.total_in_now??0,w.jsxs("div",{className:"text-[20px] text-[#64748B] ml-1",children:["/",l.key==="activeWalkins"?l.data?.total_pass??0:l.key==="preApprovedCheckins"?l.data?.total_expected_pass??0:l.data?.total_staff??0]})]})]})},l.key))}),w.jsx("div",{className:"w-full h-[105px]",children:w.jsx(Vo,{width:"100%",height:"100%",children:w.jsxs(tA,{data:o,margin:{top:5,right:0,left:-40,bottom:0},children:[w.jsx(uf,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),w.jsx(df,{dataKey:"time",tickFormatter:(l,c)=>c%4===0?l:"",tick:{fontSize:10,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1}),w.jsx(rl,{tick:{fontSize:10,fill:"#64748B",fontWeight:400},ticks:a,domain:[0,s],allowDecimals:!1,axisLine:!1,tickLine:!1}),w.jsx(zo,{content:w.jsx(El,{})}),w.jsx(pa,{type:"monotone",dataKey:"walkins",stroke:ta.walkins,strokeWidth:2,dot:!1,name:"Active Walk-ins"}),w.jsx(pa,{type:"monotone",dataKey:"checkins",stroke:ta.preApproved,strokeWidth:2,strokeDasharray:"5 5",dot:!1,name:"Pre-approved"}),w.jsx(pa,{type:"monotone",dataKey:"staffAttendance",stroke:ta.staffAttendance,strokeWidth:2,dot:!1,name:"Staff Attendance"})]})})})]})})}function DX({isStatic:e,data:t}){const n=["#1FA05B","#E7A015","#FA7E28","#EF4444","#CBD5E1"],r=[{name:"L1 Level",value:Number(t?.total_L1||0),color:n[0]},{name:"L2 Level",value:Number(t?.total_L2||0),color:n[1]},{name:"L3 Level",value:Number(t?.total_L3||0),color:n[2]},{name:"No Level",value:Number(t?.total_NoLevel||0),color:n[3]}];r.reduce((o,a)=>o+a.value,0);const i=r;return console.log("Helpdesk Data:",t),w.jsx($o,{title:"Helpdesk",period:"As of Today",icon:w.jsx(aD,{className:"!text-[24px] text-[#FA7E28]"}),className:`${e&&"max-h-[186px]"} h-[186px] mb-4 break-inside-avoid`,actionButtons:w.jsx(Yl,{widgetId:t?.widget_id,options:t?.communities,onFilterChange:(o,a)=>console.log(o,a),onExport:o=>console.log("Export triggered for",o)}),children:w.jsxs("div",{className:"flex gap-[12px] h-fit",children:[w.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[w.jsxs("div",{className:"flex flex-col gap-[8px]",children:[w.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Un-resolved Complaints"}),w.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium text-[#FA7E28]",children:t?.total_open_complaints??0})]}),w.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] flex items-center gap-[4px]",children:[w.jsx(f_,{value:t?.percent_change}),w.jsx("div",{className:"whitespace-nowrap",children:"Compared to yesterday"})]})]}),w.jsx("div",{className:"w-[50%] h-[110px] flex justify-end",children:w.jsx(Vo,{width:"75%",height:"100%",children:w.jsxs(ff,{children:[w.jsx(Ul,{data:i,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:i.map((o,a)=>w.jsx(Ir,{fill:n[a]||"#CBD5E1"},o.name))}),w.jsx(zo,{content:w.jsx(El,{})})]})})})]})})}/*!
329
+ `,"2) content: () => element.cloneNode(true)"].join(" "))}var s=i.reduce(function(l,c){var u=c&&OX(c,r);return u&&l.push(u),l},[]);return cl(e)?s[0]:s}Gl.defaultProps=In;Gl.setDefaultProps=yX;Gl.currentInput=_r;Object.assign({},yA,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});Gl.setDefaultProps({render:lk});function ck(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var uk=typeof window<"u"&&typeof document<"u";function Qm(e,t){e&&(typeof e=="function"&&e(t),{}.hasOwnProperty.call(e,"current")&&(e.current=t))}function JO(){return uk&&document.createElement("div")}function SX(e){var t={"data-placement":e.placement};return e.referenceHidden&&(t["data-reference-hidden"]=""),e.escaped&&(t["data-escaped"]=""),t}function dk(e,t){if(e===t)return!0;if(typeof e=="object"&&e!=null&&typeof t=="object"&&t!=null){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(t.hasOwnProperty(n)){if(!dk(e[n],t[n]))return!1}else return!1;return!0}else return!1}function EX(e){var t=[];return e.forEach(function(n){t.find(function(r){return dk(n,r)})||t.push(n)}),t}function _X(e,t){var n,r;return Object.assign({},t,{popperOptions:Object.assign({},e.popperOptions,t.popperOptions,{modifiers:EX([].concat(((n=e.popperOptions)==null?void 0:n.modifiers)||[],((r=t.popperOptions)==null?void 0:r.modifiers)||[]))})})}var Th=uk?I.useLayoutEffect:I.useEffect;function PX(e){var t=I.useRef();return t.current||(t.current=typeof e=="function"?e():e),t.current}function QO(e,t,n){n.split(/\s+/).forEach(function(r){r&&e.classList[t](r)})}var CX={name:"className",defaultValue:"",fn:function(t){var n=t.popper.firstElementChild,r=function(){var s;return!!((s=t.props.render)!=null&&s.$$tippy)};function i(){if(t.props.className&&!r()){process.env.NODE_ENV!=="production"&&console.warn(["@tippyjs/react: Cannot use `className` prop in conjunction with","`render` prop. Place the className on the element you are","rendering."].join(" "));return}QO(n,"add",t.props.className)}function o(){r()&&QO(n,"remove",t.props.className)}return{onCreate:i,onBeforeUpdate:o,onAfterUpdate:i}}};function TX(e){function t(n){var r=n.children,i=n.content,o=n.visible,a=n.singleton,s=n.render,l=n.reference,c=n.disabled,u=c===void 0?!1:c,d=n.ignoreAttributes,p=d===void 0?!0:d;n.__source,n.__self;var h=ck(n,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]),g=o!==void 0,m=a!==void 0,v=I.useState(!1),y=v[0],S=v[1],x=I.useState({}),b=x[0],O=x[1],E=I.useState(),C=E[0],T=E[1],k=PX(function(){return{container:JO(),renders:1}}),R=Object.assign({ignoreAttributes:p},h,{content:k.container});g&&(process.env.NODE_ENV!=="production"&&["trigger","hideOnClick","showOnCreate"].forEach(function(j){R[j]!==void 0&&console.warn(["@tippyjs/react: Cannot specify `"+j+"` prop in","controlled mode (`visible` prop)"].join(" "))}),R.trigger="manual",R.hideOnClick=!1),m&&(u=!0);var M=R,P=R.plugins||[];s&&(M=Object.assign({},R,{plugins:m&&a.data!=null?[].concat(P,[{fn:function(){return{onTrigger:function(L,B){var K=a.data.children.find(function(z){var F=z.instance;return F.reference===B.currentTarget});L.state.$$activeSingletonInstance=K.instance,T(K.content)}}}}]):P,render:function(){return{popper:k.container}}}));var D=[l].concat(r?[r.type]:[]);return Th(function(){var j=l;l&&l.hasOwnProperty("current")&&(j=l.current);var N=e(j||k.ref||JO(),Object.assign({},M,{plugins:[CX].concat(R.plugins||[])}));return k.instance=N,u&&N.disable(),o&&N.show(),m&&a.hook({instance:N,content:i,props:M,setSingletonContent:T}),S(!0),function(){N.destroy(),a?.cleanup(N)}},D),Th(function(){var j;if(k.renders===1){k.renders++;return}var N=k.instance;N.setProps(_X(N.props,M)),(j=N.popperInstance)==null||j.forceUpdate(),u?N.disable():N.enable(),g&&(o?N.show():N.hide()),m&&a.hook({instance:N,content:i,props:M,setSingletonContent:T})}),Th(function(){var j;if(s){var N=k.instance;N.setProps({popperOptions:Object.assign({},N.props.popperOptions,{modifiers:[].concat((((j=N.props.popperOptions)==null?void 0:j.modifiers)||[]).filter(function(L){var B=L.name;return B!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(B){var K,z=B.state,F=(K=z.modifiersData)==null?void 0:K.hide;(b.placement!==z.placement||b.referenceHidden!==F?.isReferenceHidden||b.escaped!==F?.hasPopperEscaped)&&O({placement:z.placement,referenceHidden:F?.isReferenceHidden,escaped:F?.hasPopperEscaped}),z.attributes.popper={}}}])})})}},[b.placement,b.referenceHidden,b.escaped].concat(D)),I.createElement(I.Fragment,null,r?I.cloneElement(r,{ref:function(N){k.ref=N,Qm(r.ref,N)}}):null,y&&fo.createPortal(s?s(SX(b),C,k.instance):i,k.container))}return t}var AX=(function(e,t){return I.forwardRef(function(r,i){var o=r.children,a=ck(r,["children"]);return I.createElement(e,Object.assign({},t,a),o?I.cloneElement(o,{ref:function(l){Qm(i,l),Qm(o.ref,l)}}):null)})}),kX=AX(TX(Gl));function MX(e){const t=e>=12?"PM":"AM";let n=e%12;return n===0&&(n=12),`${n} ${t}`}function jX(e=[]){return Array.from({length:24},(t,n)=>{const r=e.find(i=>i.hour===n)||{};return{hour:n,time:MX(n),walkins:r.walkins??0,checkins:r.preApproved??0,staffAttendance:r.staffAttendance??0}})}const ta={walkins:"#1FA05B",preApproved:"#E7A015",staffAttendance:"#329DFF"};function NX({type:e,data:t,children:n}){if(!e||!t)return n;const r={activeWalkins:[["Currently Inside",t.visitor_in],["Total Visited Today",t.total_pass]],preApprovedCheckins:[["Currently Inside",t.currently_inside],["Total Visited Today",t.expected_pass_scanned],["No show",t.expected_pass_not_scanned],["Total Scheduled",t.total_expected_pass]],staffAttendance:[["Currently Inside",t.total_in_now],["Absent Today",t.absent_staff],["Total Visited Today",t.total_in_today],["Total Staff",t.total_staff]]},i={activeWalkins:"Active Walk-ins",preApprovedCheckins:"Pre-approved Check-ins",staffAttendance:"Staff Attendance"},o={activeWalkins:"text-[#1FA05B]",preApprovedCheckins:"text-[#E7A015]",staffAttendance:"text-[#329DFF]"},a=w.jsx($o,{title:i[e],period:"Today",icon:w.jsx(Pg,{className:`${o[e]} !text-[24px]`}),className:"!gap-0 min-w-[353px] bg-white shadow-xl rounded-lg border border-gray-200",children:w.jsx("div",{className:"flex flex-col gap-[8px] mt-[12px] pt-[12px] border-t border-dashed border-[#EBEBEB]",children:r[e].map(([s,l])=>w.jsxs("div",{className:"flex justify-between text-[14px] text-[#64748B]",children:[w.jsx("div",{children:s}),w.jsx("div",{className:"font-semibold text-gray-800",children:l??0})]},s))})});return w.jsx(kX,{content:a,placement:"bottom-start",interactive:!0,delay:[100,0],offset:[0,8],appendTo:document.body,theme:"light-border",maxWidth:"none",children:n})}function RX({isStatic:e,data:t}){const n=t?.summary?.activeWalkins||{},r=t?.summary?.preApprovedCheckins||{},i=t?.summary?.staffAttendance||{},o=I.useMemo(()=>jX(t?.chart||[]),[t]),{yAxisTicks:a,yAxisMax:s}=I.useMemo(()=>{const l=Math.max(...o.flatMap(u=>[u.walkins,u.checkins,u.staffAttendance])),c=l>0?l:5;return{yAxisTicks:[0,Math.ceil(c/2),c],yAxisMax:c}},[o]);return w.jsx($o,{title:"Gate Updates",period:"Today",icon:w.jsx(Pg,{className:"!text-[24px] text-[#37CC6D]"}),className:`${e?"max-h-[303px]":""} h-[251px] mb-4 break-inside-avoid`,actionButtons:w.jsx(Yl,{widgetId:t?.widget_id,options:t?.communities,onFilterChange:(l,c)=>console.log(l,c),onExport:l=>console.log("Export triggered for",l)}),children:w.jsxs("div",{children:[w.jsx("div",{className:"grid grid-cols-3 gap-[24px] mb-[16px]",children:[{key:"activeWalkins",data:n,color:ta.walkins,label:"Active Walk-ins"},{key:"staffAttendance",data:i,color:ta.staffAttendance,label:"Staff Checked-in"},{key:"preApprovedCheckins",data:r,color:ta.preApproved,label:"Pre-approved"}].map(l=>w.jsx(NX,{type:l.key,data:l.data,children:w.jsxs("div",{className:"flex flex-col gap-[8px] cursor-pointer",children:[w.jsx("div",{className:"text-[10px] text-[#64748B] whitespace-nowrap",children:l.label}),w.jsxs("div",{className:"text-[28px] font-medium flex items-center",style:{color:l.color},children:[l.key==="activeWalkins"?l.data?.visitor_in??0:l.key==="preApprovedCheckins"?l.data?.currently_inside??0:l.data?.total_in_now??0,w.jsxs("div",{className:"text-[20px] text-[#64748B] ml-1",children:["/",l.key==="activeWalkins"?l.data?.total_pass??0:l.key==="preApprovedCheckins"?l.data?.total_expected_pass??0:l.data?.total_staff??0]})]})]})},l.key))}),w.jsx("div",{className:"w-full h-[105px]",children:w.jsx(Vo,{width:"100%",height:"100%",children:w.jsxs(tA,{data:o,margin:{top:5,right:0,left:-40,bottom:0},children:[w.jsx(uf,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),w.jsx(df,{dataKey:"time",tickFormatter:(l,c)=>c%4===0?l:"",tick:{fontSize:10,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1}),w.jsx(rl,{tick:{fontSize:10,fill:"#64748B",fontWeight:400},ticks:a,domain:[0,s],allowDecimals:!1,axisLine:!1,tickLine:!1}),w.jsx(zo,{content:w.jsx(El,{})}),w.jsx(pa,{type:"monotone",dataKey:"walkins",stroke:ta.walkins,strokeWidth:2,dot:!1,name:"Active Walk-ins",isAnimationActive:!1}),w.jsx(pa,{type:"monotone",dataKey:"checkins",stroke:ta.preApproved,strokeWidth:2,strokeDasharray:"5 5",dot:!1,name:"Pre-approved",isAnimationActive:!1}),w.jsx(pa,{type:"monotone",dataKey:"staffAttendance",stroke:ta.staffAttendance,strokeWidth:2,dot:!1,name:"Staff Attendance",isAnimationActive:!1})]})})})]})})}function DX({isStatic:e,data:t}){const n=["#1FA05B","#E7A015","#FA7E28","#EF4444","#CBD5E1"],r=[{name:"L1 Level",value:Number(t?.total_L1||0),color:n[0]},{name:"L2 Level",value:Number(t?.total_L2||0),color:n[1]},{name:"L3 Level",value:Number(t?.total_L3||0),color:n[2]},{name:"No Level",value:Number(t?.total_NoLevel||0),color:n[3]}];r.reduce((o,a)=>o+a.value,0);const i=r;return console.log("Helpdesk Data:",t),w.jsx($o,{title:"Helpdesk",period:"As of Today",icon:w.jsx(aD,{className:"!text-[24px] text-[#FA7E28]"}),className:`${e&&"max-h-[186px]"} h-[186px] mb-4 break-inside-avoid`,actionButtons:w.jsx(Yl,{widgetId:t?.widget_id,options:t?.communities,onFilterChange:(o,a)=>console.log(o,a),onExport:o=>console.log("Export triggered for",o)}),children:w.jsxs("div",{className:"flex gap-[12px] h-fit",children:[w.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[w.jsxs("div",{className:"flex flex-col gap-[8px]",children:[w.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Un-resolved Complaints"}),w.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium text-[#FA7E28]",children:t?.total_open_complaints??0})]}),w.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] flex items-center gap-[4px]",children:[w.jsx(f_,{value:t?.percent_change}),w.jsx("div",{className:"whitespace-nowrap",children:"Compared to yesterday"})]})]}),w.jsx("div",{className:"w-[50%] h-[110px] flex justify-end",children:w.jsx(Vo,{width:"75%",height:"100%",children:w.jsxs(ff,{children:[w.jsx(Ul,{data:i,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:i.map((o,a)=>w.jsx(Ir,{fill:n[a]||"#CBD5E1"},o.name))}),w.jsx(zo,{content:w.jsx(El,{})})]})})})]})})}/*!
330
330
  * @kurkle/color v0.3.4
331
331
  * https://github.com/kurkle/color#readme
332
332
  * (c) 2024 Jukka Kurkela
package/dist/index.es.js CHANGED
@@ -35170,7 +35170,8 @@ function Jte({ isStatic: e, data: t }) {
35170
35170
  name: "Bookings",
35171
35171
  stroke: "#8B5CF6",
35172
35172
  strokeWidth: 2,
35173
- dot: !1
35173
+ dot: !1,
35174
+ isAnimationActive: !1
35174
35175
  }
35175
35176
  ),
35176
35177
  /* @__PURE__ */ w.jsx(
@@ -35183,7 +35184,8 @@ function Jte({ isStatic: e, data: t }) {
35183
35184
  stroke: "#329DFF",
35184
35185
  strokeWidth: 2,
35185
35186
  dot: !1,
35186
- strokeDasharray: "2 4"
35187
+ strokeDasharray: "2 4",
35188
+ isAnimationActive: !1
35187
35189
  }
35188
35190
  )
35189
35191
  ]
@@ -36453,7 +36455,8 @@ function ene({ isStatic: e, data: t }) {
36453
36455
  stroke: ua.walkins,
36454
36456
  strokeWidth: 2,
36455
36457
  dot: !1,
36456
- name: "Active Walk-ins"
36458
+ name: "Active Walk-ins",
36459
+ isAnimationActive: !1
36457
36460
  }
36458
36461
  ),
36459
36462
  /* @__PURE__ */ w.jsx(
@@ -36465,7 +36468,8 @@ function ene({ isStatic: e, data: t }) {
36465
36468
  strokeWidth: 2,
36466
36469
  strokeDasharray: "5 5",
36467
36470
  dot: !1,
36468
- name: "Pre-approved"
36471
+ name: "Pre-approved",
36472
+ isAnimationActive: !1
36469
36473
  }
36470
36474
  ),
36471
36475
  /* @__PURE__ */ w.jsx(
@@ -36476,7 +36480,8 @@ function ene({ isStatic: e, data: t }) {
36476
36480
  stroke: ua.staffAttendance,
36477
36481
  strokeWidth: 2,
36478
36482
  dot: !1,
36479
- name: "Staff Attendance"
36483
+ name: "Staff Attendance",
36484
+ isAnimationActive: !1
36480
36485
  }
36481
36486
  )
36482
36487
  ]
package/dist/index.umd.js CHANGED
@@ -306,7 +306,7 @@ Take a look at the reducer(s) handling this action type: ${h.type}.
306
306
  `))}},[tn,we,S,x,z]),cn&&(S?nt.length===0?de=null:de=nt.reduce((Z,ue,he)=>(Z.push(ue),he<nt.length-1&&Z.push(", "),Z),[]):de=kt);let Cn=ae;!a&&ie&&X&&(Cn=A.clientWidth);let Yt;typeof j<"u"?Yt=j:Yt=d?null:0;const Tn=I.id||(x?`mui-component-select-${x}`:void 0),ye={...t,variant:B,value:z,open:ze,error:h},dn=vG(ye),Gt={...y.PaperProps,...typeof y.slotProps?.paper=="function"?y.slotProps.paper(ye):y.slotProps?.paper},U={...y.MenuListProps,...typeof y.slotProps?.list=="function"?y.slotProps.list(ye):y.slotProps?.list},le=ap();return w.jsxs(_.Fragment,{children:[w.jsx(pG,{as:"div",ref:J,tabIndex:Yt,role:"combobox","aria-controls":ze?le:void 0,"aria-disabled":d?"true":void 0,"aria-expanded":ze?"true":"false","aria-haspopup":"listbox","aria-label":i,"aria-labelledby":[v,Tn].filter(Boolean).join(" ")||void 0,"aria-describedby":r,"aria-required":P?"true":void 0,"aria-invalid":h?"true":void 0,onKeyDown:tt,onMouseDown:d||D?null:re,onBlur:ke,onFocus:C,...I,ownerState:ye,className:oe(I.className,dn.select,l),id:Tn,children:gG(de)?mT||(mT=w.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):de}),w.jsx(mG,{"aria-invalid":h,value:Array.isArray(z)?z.join(","):z,name:x,ref:ne,"aria-hidden":!0,onChange:Ee,tabIndex:-1,disabled:d,className:dn.nativeInput,autoFocus:o,required:P,...K,ownerState:ye}),w.jsx(hG,{as:g,className:dn.icon,ownerState:ye}),w.jsx(lT,{id:`menu-${x||""}`,anchorEl:A,open:ze,onClose:me,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...y,slotProps:{...y.slotProps,list:{"aria-labelledby":v,role:"listbox","aria-multiselectable":S?"true":void 0,disableListWrap:!0,id:le,...U},paper:{...Gt,style:{minWidth:Cn,...Gt!=null?Gt.style:null}}},children:un})]})});process.env.NODE_ENV!=="production"&&(vT.propTypes={"aria-describedby":f.string,"aria-label":f.string,autoFocus:f.bool,autoWidth:f.bool,children:f.node,classes:f.object,className:f.string,defaultOpen:f.bool,defaultValue:f.any,disabled:f.bool,displayEmpty:f.bool,error:f.bool,IconComponent:f.elementType.isRequired,inputRef:nr,labelId:f.string,MenuProps:f.object,multiple:f.bool,name:f.string,onBlur:f.func,onChange:f.func,onClose:f.func,onFocus:f.func,onOpen:f.func,open:f.bool,readOnly:f.bool,renderValue:f.func,required:f.bool,SelectDisplayProps:f.object,tabIndex:f.oneOfType([f.number,f.string]),type:f.any,value:f.any,variant:f.oneOf(["standard","outlined","filled"])});const yG=e=>{const{classes:t}=e,r=Je({root:["root"]},hT,t);return{...t,...r}},ay={name:"MuiSelect",slot:"Root",shouldForwardProp:e=>jn(e)&&e!=="variant"},bG=ve(qd,ay)(""),xG=ve(Yd,ay)(""),wG=ve(Hd,ay)(""),Gd=_.forwardRef(function(t,n){const r=ct({name:"MuiSelect",props:t}),{autoWidth:i=!1,children:o,classes:a={},className:s,defaultOpen:l=!1,displayEmpty:c=!1,IconComponent:u=DK,id:d,input:p,inputProps:h,label:g,labelId:m,MenuProps:v,multiple:y=!1,native:S=!1,onClose:x,onOpen:b,open:O,renderValue:E,SelectDisplayProps:C,variant:T="outlined",...k}=r,D=S?dT:vT,M=Mo(),P=Da({props:r,muiFormControl:M,states:["variant","error"]}),I=P.variant||T,j={...r,variant:I,classes:a},N=yG(j),{root:L,...B}=N,K=p||{standard:w.jsx(bG,{ownerState:j}),outlined:w.jsx(xG,{label:g,ownerState:j}),filled:w.jsx(wG,{ownerState:j})}[I],z=zt(n,Na(K));return w.jsx(_.Fragment,{children:_.cloneElement(K,{inputComponent:D,inputProps:{children:o,error:P.error,IconComponent:u,variant:I,type:void 0,multiple:y,...S?{id:d}:{autoWidth:i,defaultOpen:l,displayEmpty:c,labelId:m,MenuProps:v,onClose:x,onOpen:b,open:O,renderValue:E,SelectDisplayProps:{id:d,...C}},...h,classes:h?nn(B,h.classes):B,...p?p.props.inputProps:{}},...(y&&S||c)&&I==="outlined"?{notched:!0}:{},ref:z,className:oe(K.props.className,s,N.root),...!p&&{variant:I},...k})})});process.env.NODE_ENV!=="production"&&(Gd.propTypes={autoWidth:f.bool,children:f.node,classes:f.object,className:f.string,defaultOpen:f.bool,defaultValue:f.any,displayEmpty:f.bool,IconComponent:f.elementType,id:f.string,input:f.element,inputProps:f.object,label:f.node,labelId:f.string,MenuProps:f.object,multiple:f.bool,native:f.bool,onChange:f.func,onClose:f.func,onOpen:f.func,open:f.bool,renderValue:f.func,SelectDisplayProps:f.object,sx:f.oneOfType([f.arrayOf(f.oneOfType([f.func,f.object,f.bool])),f.func,f.object]),value:f.oneOfType([f.oneOf([""]),f.any]),variant:f.oneOf(["filled","outlined","standard"])}),Gd.muiName="Select";function OG(e){return Xe("MuiTooltip",e)}const St=We("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]);function SG(e){return Math.round(e*1e5)/1e5}const EG=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${je(o.split("-")[0])}`],arrow:["arrow"]};return Je(a,OG,t)},_G=ve(Zv,{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]}})(wt(({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"] .${St.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${St.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${St.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${St.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:({ownerState:t})=>t.arrow&&!t.isRtl,style:{[`&[data-popper-placement*="right"] .${St.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!!t.isRtl,style:{[`&[data-popper-placement*="right"] .${St.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!t.isRtl,style:{[`&[data-popper-placement*="left"] .${St.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!!t.isRtl,style:{[`&[data-popper-placement*="left"] .${St.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}))),PG=ve("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${je(n.placement.split("-")[0])}`]]}})(wt(({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,[`.${St.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${St.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${St.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${St.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:`${SG(16/14)}em`,fontWeight:e.typography.fontWeightRegular}},{props:({ownerState:t})=>!t.isRtl,style:{[`.${St.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${St.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:({ownerState:t})=>!t.isRtl&&t.touch,style:{[`.${St.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${St.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:({ownerState:t})=>!!t.isRtl,style:{[`.${St.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${St.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:({ownerState:t})=>!!t.isRtl&&t.touch,style:{[`.${St.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${St.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:({ownerState:t})=>t.touch,style:{[`.${St.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:({ownerState:t})=>t.touch,style:{[`.${St.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]}))),CG=ve("span",{name:"MuiTooltip",slot:"Arrow"})(wt(({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 Xd=!1;const yT=new Ed;let El={x:0,y:0};function Zd(e,t){return(n,...r)=>{t&&t(n,...r),e(n,...r)}}const sy=_.forwardRef(function(t,n){const r=ct({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:p=!1,disableTouchListener:h=!1,enterDelay:g=100,enterNextDelay:m=0,enterTouchDelay:v=700,followCursor:y=!1,id:S,leaveDelay:x=0,leaveTouchDelay:b=1500,onClose:O,onOpen:E,open:C,placement:T="bottom",PopperComponent:k,PopperProps:D={},slotProps:M={},slots:P={},title:I,TransitionComponent:j,TransitionProps:N,...L}=r,B=_.isValidElement(o)?o:w.jsx("span",{children:o}),K=jc(),z=op(),[F,G]=_.useState(),[Y,ne]=_.useState(null),Q=_.useRef(!1),X=p||y,te=Ta(),ie=Ta(),ae=Ta(),W=Ta(),[H,J]=Dc({controlled:C,default:!1,name:"Tooltip",state:"open"});let A=H;if(process.env.NODE_ENV!=="production"){const{current:be}=_.useRef(C!==void 0);_.useEffect(()=>{F&&F.disabled&&!be&&I!==""&&F.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(`
307
307
  `))},[I,F,be])}const fe=ap(S),re=_.useRef(),me=Hr(()=>{re.current!==void 0&&(document.body.style.WebkitUserSelect=re.current,re.current=void 0),W.clear()});_.useEffect(()=>me,[me]);const we=be=>{yT.clear(),Xd=!0,J(!0),E&&!A&&E(be)},Ee=Hr(be=>{yT.start(800+x,()=>{Xd=!1}),J(!1),O&&A&&O(be),te.start(K.transitions.duration.shortest,()=>{Q.current=!1})}),Ce=be=>{Q.current&&be.type!=="touchstart"||(F&&F.removeAttribute("title"),ie.clear(),ae.clear(),g||Xd&&m?ie.start(Xd?m:g,()=>{we(be)}):we(be))},tt=be=>{ie.clear(),ae.start(x,()=>{Ee(be)})},[,ze]=_.useState(!1),ke=be=>{Cd(be.target)||(ze(!1),tt(be))},de=be=>{F||G(be.currentTarget),Cd(be.target)&&(ze(!0),Ce(be))},kt=be=>{Q.current=!0;const hn=B.props;hn.onTouchStart&&hn.onTouchStart(be)},nt=be=>{kt(be),ae.clear(),te.clear(),me(),re.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",W.start(v,()=>{document.body.style.WebkitUserSelect=re.current,Ce(be)})},cn=be=>{B.props.onTouchEnd&&B.props.onTouchEnd(be),me(),ae.start(b,()=>{Ee(be)})};_.useEffect(()=>{if(!A)return;function be(hn){hn.key==="Escape"&&Ee(hn)}return document.addEventListener("keydown",be),()=>{document.removeEventListener("keydown",be)}},[Ee,A]);const tn=zt(Na(B),G,n);!I&&I!==0&&(A=!1);const un=_.useRef(),Cn=be=>{const hn=B.props;hn.onMouseMove&&hn.onMouseMove(be),El={x:be.clientX,y:be.clientY},un.current&&un.current.update()},Yt={},Tn=typeof I=="string";c?(Yt.title=!A&&Tn&&!d?I:null,Yt["aria-describedby"]=A?fe:null):(Yt["aria-label"]=Tn?I:null,Yt["aria-labelledby"]=A&&!Tn?fe:null);const ye={...Yt,...L,...B.props,className:oe(L.className,B.props.className),onTouchStart:kt,ref:tn,...y?{onMouseMove:Cn}:{}};process.env.NODE_ENV!=="production"&&(ye["data-mui-internal-clone-element"]=!0,_.useEffect(()=>{F&&!F.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(`
308
308
  `))},[F]));const dn={};h||(ye.onTouchStart=nt,ye.onTouchEnd=cn),d||(ye.onMouseOver=Zd(Ce,ye.onMouseOver),ye.onMouseLeave=Zd(tt,ye.onMouseLeave),X||(dn.onMouseOver=Ce,dn.onMouseLeave=tt)),u||(ye.onFocus=Zd(de,ye.onFocus),ye.onBlur=Zd(ke,ye.onBlur),X||(dn.onFocus=de,dn.onBlur=ke)),process.env.NODE_ENV!=="production"&&B.props.title&&console.error(["MUI: You have provided a `title` prop to the child of <Tooltip />.",`Remove this title prop \`${B.props.title}\` or the Tooltip component.`].join(`
309
- `));const Gt={...r,isRtl:z,arrow:i,disableInteractive:X,placement:T,PopperComponentProp:k,touch:Q.current},U=typeof M.popper=="function"?M.popper(Gt):M.popper,le=_.useMemo(()=>{let be=[{name:"arrow",enabled:!!Y,options:{element:Y,padding:4}}];return D.popperOptions?.modifiers&&(be=be.concat(D.popperOptions.modifiers)),U?.popperOptions?.modifiers&&(be=be.concat(U.popperOptions.modifiers)),{...D.popperOptions,...U?.popperOptions,modifiers:be}},[Y,D.popperOptions,U?.popperOptions]),Z=EG(Gt),ue=typeof M.transition=="function"?M.transition(Gt):M.transition,he={slots:{popper:s.Popper,transition:s.Transition??j,tooltip:s.Tooltip,arrow:s.Arrow,...P},slotProps:{arrow:M.arrow??l.arrow,popper:{...D,...U??l.popper},tooltip:M.tooltip??l.tooltip,transition:{...N,...ue??l.transition}}},[rt,vt]=lt("popper",{elementType:_G,externalForwardedProps:he,ownerState:Gt,className:oe(Z.popper,D?.className)}),[cr,Gi]=lt("transition",{elementType:vl,externalForwardedProps:he,ownerState:Gt}),[ur,Uo]=lt("tooltip",{elementType:PG,className:Z.tooltip,externalForwardedProps:he,ownerState:Gt}),[vi,Br]=lt("arrow",{elementType:CG,className:Z.arrow,externalForwardedProps:he,ownerState:Gt,ref:ne});return w.jsxs(_.Fragment,{children:[_.cloneElement(B,ye),w.jsx(rt,{as:k??Zv,placement:T,anchorEl:y?{getBoundingClientRect:()=>({top:El.y,left:El.x,right:El.x,bottom:El.y,width:0,height:0})}:F,popperRef:un,open:F?A:!1,id:fe,transition:!0,...dn,...vt,popperOptions:le,children:({TransitionProps:be})=>w.jsx(cr,{timeout:K.transitions.duration.shorter,...be,...Gi,children:w.jsxs(ur,{...Uo,children:[I,i?w.jsx(vi,{...Br}):null]})})})]})});process.env.NODE_ENV!=="production"&&(sy.propTypes={arrow:f.bool,children:Ra.isRequired,classes:f.object,className:f.string,components:f.shape({Arrow:f.elementType,Popper:f.elementType,Tooltip:f.elementType,Transition:f.elementType}),componentsProps:f.shape({arrow:f.object,popper:f.object,tooltip:f.object,transition:f.object}),describeChild:f.bool,disableFocusListener:f.bool,disableHoverListener:f.bool,disableInteractive:f.bool,disableTouchListener:f.bool,enterDelay:f.number,enterNextDelay:f.number,enterTouchDelay:f.number,followCursor:f.bool,id:f.string,leaveDelay:f.number,leaveTouchDelay:f.number,onClose:f.func,onOpen:f.func,open:f.bool,placement:f.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:f.elementType,PopperProps:f.object,slotProps:f.shape({arrow:f.oneOfType([f.func,f.object]),popper:f.oneOfType([f.func,f.object]),tooltip:f.oneOfType([f.func,f.object]),transition:f.oneOfType([f.func,f.object])}),slots:f.shape({arrow:f.elementType,popper:f.elementType,tooltip:f.elementType,transition:f.elementType}),sx:f.oneOfType([f.arrayOf(f.oneOfType([f.func,f.object,f.bool])),f.func,f.object]),title:f.node,TransitionComponent:f.elementType,TransitionProps:f.object});function TG(e){return Xe("MuiTextField",e)}We("MuiTextField",["root"]);const AG={standard:qd,filled:Hd,outlined:Yd},kG=e=>{const{classes:t}=e;return Je({root:["root"]},TG,t)},MG=ve(ty,{name:"MuiTextField",slot:"Root"})({}),bT=_.forwardRef(function(t,n){const r=ct({props:t,name:"MuiTextField"}),{autoComplete:i,autoFocus:o=!1,children:a,className:s,color:l="primary",defaultValue:c,disabled:u=!1,error:d=!1,FormHelperTextProps:p,fullWidth:h=!1,helperText:g,id:m,InputLabelProps:v,inputProps:y,InputProps:S,inputRef:x,label:b,maxRows:O,minRows:E,multiline:C=!1,name:T,onBlur:k,onChange:D,onFocus:M,placeholder:P,required:I=!1,rows:j,select:N=!1,SelectProps:L,slots:B={},slotProps:K={},type:z,value:F,variant:G="outlined",...Y}=r,ne={...r,autoFocus:o,color:l,disabled:u,error:d,fullWidth:h,multiline:C,required:I,select:N,variant:G},Q=kG(ne);process.env.NODE_ENV!=="production"&&N&&!a&&console.error("MUI: `children` must be passed when using the `TextField` component with `select`.");const X=ap(m),te=g&&X?`${X}-helper-text`:void 0,ie=b&&X?`${X}-label`:void 0,ae=AG[G],W={slots:B,slotProps:{input:S,inputLabel:v,htmlInput:y,formHelperText:p,select:L,...K}},H={},J=W.slotProps.inputLabel;G==="outlined"&&(J&&typeof J.shrink<"u"&&(H.notched=J.shrink),H.label=b),N&&((!L||!L.native)&&(H.id=void 0),H["aria-describedby"]=void 0);const[A,fe]=lt("root",{elementType:MG,shouldForwardComponentProp:!0,externalForwardedProps:{...W,...Y},ownerState:ne,className:oe(Q.root,s),ref:n,additionalProps:{disabled:u,error:d,fullWidth:h,required:I,color:l,variant:G}}),[re,me]=lt("input",{elementType:ae,externalForwardedProps:W,additionalProps:H,ownerState:ne}),[we,Ee]=lt("inputLabel",{elementType:ZC,externalForwardedProps:W,ownerState:ne}),[Ce,tt]=lt("htmlInput",{elementType:"input",externalForwardedProps:W,ownerState:ne}),[ze,ke]=lt("formHelperText",{elementType:GC,externalForwardedProps:W,ownerState:ne}),[de,kt]=lt("select",{elementType:Gd,externalForwardedProps:W,ownerState:ne}),nt=w.jsx(re,{"aria-describedby":te,autoComplete:i,autoFocus:o,defaultValue:c,fullWidth:h,multiline:C,name:T,rows:j,maxRows:O,minRows:E,type:z,value:F,id:X,inputRef:x,onBlur:k,onChange:D,onFocus:M,placeholder:P,inputProps:tt,slots:{input:B.htmlInput?Ce:void 0},...me});return w.jsxs(A,{...fe,children:[b!=null&&b!==""&&w.jsx(we,{htmlFor:X,id:ie,...Ee,children:b}),N?w.jsx(de,{"aria-describedby":te,id:X,labelId:ie,value:F,input:nt,...kt,children:a}):nt,g&&w.jsx(ze,{id:te,...ke,children:g})]})});process.env.NODE_ENV!=="production"&&(bT.propTypes={autoComplete:f.string,autoFocus:f.bool,children:f.node,classes:f.object,className:f.string,color:f.oneOfType([f.oneOf(["primary","secondary","error","info","success","warning"]),f.string]),defaultValue:f.any,disabled:f.bool,error:f.bool,FormHelperTextProps:f.object,fullWidth:f.bool,helperText:f.node,id:f.string,InputLabelProps:f.object,inputProps:f.object,InputProps:f.object,inputRef:nr,label:f.node,margin:f.oneOf(["dense","none","normal"]),maxRows:f.oneOfType([f.number,f.string]),minRows:f.oneOfType([f.number,f.string]),multiline:f.bool,name:f.string,onBlur:f.func,onChange:f.func,onFocus:f.func,placeholder:f.string,required:f.bool,rows:f.oneOfType([f.number,f.string]),select:f.bool,SelectProps:f.object,size:f.oneOfType([f.oneOf(["medium","small"]),f.string]),slotProps:f.shape({formHelperText:f.oneOfType([f.func,f.object]),htmlInput:f.oneOfType([f.func,f.object]),input:f.oneOfType([f.func,f.object]),inputLabel:f.oneOfType([f.func,f.object]),select:f.oneOfType([f.func,f.object])}),slots:f.shape({formHelperText:f.elementType,htmlInput:f.elementType,input:f.elementType,inputLabel:f.elementType,root:f.elementType,select:f.elementType}),sx:f.oneOfType([f.arrayOf(f.oneOfType([f.func,f.object,f.bool])),f.func,f.object]),type:f.string,value:f.any,variant:f.oneOf(["filled","outlined","standard"])});function jG(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 NG(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 DG(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)}const IG=_c(Gd)(()=>({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 _l({widgetId:e,options:t=[],defaultValue:n=["all"],onFilterChange:r=()=>{},onExport:i=()=>{}}){const o=JSON.parse(sessionStorage.getItem("community_id"))||[],[a,s]=R.useState(o),[l,c]=R.useState(""),u=t.filter(h=>h.community_name.toLowerCase().includes(l.toLowerCase())),d=h=>{let g=h.target.value;const m=t.map(v=>v.community_id);if(g.includes("all")&&!a.includes("all"))s(["all",...m]),Si("community_id",JSON.stringify(m)),Si("widget_id",e),r(m);else if(!g.includes("all")&&a.includes("all"))s([]),Si("community_id",JSON.stringify([])),Si("widget_id",e),r([]);else{const v=g.filter(x=>x!=="all"),y=v.length>0&&m.every(x=>v.includes(x));s(y?["all",...m]:v);const S=v.length===1?v[0]:v;Si("community_id",JSON.stringify(S)),Si("widget_id",e),r(S)}},p=()=>{Si("widget_id",e),Si("export",!0),i()};return w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx(sy,{slotProps:{tooltip:{sx:{fontSize:"12px"}}},children:w.jsx(ty,{size:"small",children:w.jsxs(IG,{multiple:!0,value:a,onChange:d,displayEmpty:!0,renderValue:h=>h.length===0?w.jsx("span",{style:{color:"#9e9e9e"},children:"Select Community"}):h.includes("all")?"All":t.filter(g=>h.includes(g.community_id)).map(g=>g.community_name).join(", "),MenuProps:{PaperProps:{style:{maxHeight:300}},autoFocus:!1},children:[w.jsx(Ol,{onKeyDown:h=>h.stopPropagation(),onClick:h=>h.stopPropagation(),disableRipple:!0,sx:{"&:hover":{backgroundColor:"transparent"},cursor:"default"},children:w.jsx(bT,{placeholder:"Search...",size:"small",variant:"outlined",value:l,onChange:h=>c(h.target.value),onClick:h=>h.stopPropagation(),onKeyDown:h=>h.stopPropagation(),sx:{width:"100%"},autoFocus:!0})}),w.jsxs(Ol,{value:"all",children:[w.jsx(Qv,{checked:a.includes("all")}),w.jsx(Kd,{primary:"All",sx:{fontWeight:600}})]}),u.length>0?u.map(h=>w.jsxs(Ol,{value:h.community_id,children:[w.jsx(Qv,{checked:a.includes(h.community_id)}),w.jsx(Kd,{primary:h.community_name})]},h.community_id)):w.jsx(Ol,{disabled:!0,children:w.jsx(Kd,{primary:"No results found"})})]})})}),w.jsx(sy,{title:"Export CSV for this widget",children:w.jsx("button",{onClick:p,className:"px-3 py-2 bg-[#FBF5FF] rounded cursor-pointer",children:w.jsx(NG,{className:"stroke-[#884EA7] stroke-[1.4]"})})})]})}function RG({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 w.jsx(Qi,{title:"Community",period:"This Month",icon:w.jsx(gp,{className:"!text-[24px] text-[#329DFF]"}),className:`${e&&"max-h-[184px]"} h-[184px] mb-4 break-inside-avoid`,actionButtons:w.jsx(_l,{widgetId:t?.widget_id,options:t?.communities,onFilterChange:(c,u)=>console.log(c,u),onExport:c=>console.log("Export triggered for",c)}),children:w.jsxs("div",{className:"flex",children:[w.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[w.jsxs("div",{className:"flex flex-col gap-[8px]",children:[w.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Move-in/Out Count"}),w.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium !text-[#8B5CF6]",children:n+r})]}),w.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] flex items-center gap-[4px]",children:[w.jsx(tx,{value:l(i,o)}),w.jsx("div",{className:"whitespace-nowrap",children:"Compared to last month"})]})]}),w.jsx("div",{className:"w-[50%] h-[111px] flex justify-end",children:w.jsx(wo,{width:"75%",height:"100%",children:w.jsxs(Od,{children:[w.jsxs(el,{data:s,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:[w.jsx(kr,{fill:a[0]}),w.jsx(kr,{fill:a[1]})]}),w.jsx(xo,{content:w.jsx(ps,{})})]})})})]})})}function $G({isStatic:e,data:t,communities:n}){const r=["#8B5CF6","#22C55E","#3B82F6","#F59E0B"],i=[{name:"Notice",value:Number(t?.total_notices||0),color:r[0]},{name:"Post",value:Number(t?.total_topics||0),color:r[1]},{name:"Poll",value:Number(t?.total_polls||0),color:r[2]},{name:"Survey",value:Number(t?.total_surveys||0),color:r[3]}];return w.jsx(Qi,{title:"Engagement",period:"This Month",icon:w.jsx(Y0,{className:"!text-[24px] text-[#DBB467]"}),className:`${e&&"max-h-[303px]"} h-[303px]`,actionButtons:w.jsx(_l,{widgetId:t?.widget_id,options:t?.communities,onFilterChange:(o,a)=>console.log(o,a),onExport:o=>console.log("Export triggered for",o)}),children:w.jsx("div",{className:"w-full h-[235px]",children:w.jsx(wo,{width:"100%",height:"100%",children:w.jsxs(SH,{data:i,layout:"vertical",margin:{top:4,right:8,left:0,bottom:0},children:[w.jsx(gd,{stroke:"#e5e7eb",strokeDasharray:"3 3",horizontal:!1}),w.jsx(rl,{type:"category",dataKey:"name",width:40,axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#121212",fontWeight:400}}),w.jsx(yd,{type:"number",axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#64748B",fontWeight:400}}),w.jsx(xo,{content:w.jsx(ps,{}),cursor:{fill:"transparent"}}),w.jsx(t2,{dataKey:"value",barSize:40,isAnimationActive:!1,children:i.map((o,a)=>w.jsx(kr,{fill:r[a]},o.name))})]})})})})}function LG({isStatic:e,data:t}){const n=Number(t?.totalBookings||0),r=Number(t?.averageUtilizationPercentage||0),i=R.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 w.jsxs(Qi,{title:"Facilities",period:"Today",icon:w.jsx(K0,{className:"!text-[24px] text-[#8B5CF6]"}),className:`${e&&"max-h-[305px]"} h-[305px] mb-4 break-inside-avoid`,children:[w.jsxs("div",{className:"grid grid-cols-2 gap-[24px] mb-[16px]",children:[w.jsxs("div",{children:[w.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Bookings"}),w.jsx("div",{className:"!text-[24px] font-medium text-[#8B5CF6]",children:n})]}),w.jsxs("div",{children:[w.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Utilisation Rate"}),w.jsxs("div",{className:"!text-[24px] font-medium text-[#329DFF]",children:[r.toFixed(2),"%"]})]})]}),w.jsx("div",{className:"w-full h-[170px]",children:w.jsx(wo,{width:"100%",height:"100%",children:w.jsxs(U2,{data:a,margin:{top:5,right:-30,left:-35,bottom:0},children:[w.jsx(gd,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),w.jsx(yd,{dataKey:"time",interval:0,tickFormatter:o,tick:{fontSize:10,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1,minTickGap:0}),w.jsx(rl,{yAxisId:"left",tick:{fontSize:10,fill:"#64748B"},axisLine:!1,tickLine:!1}),w.jsx(rl,{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}),w.jsx(xo,{content:w.jsx(ps,{})}),w.jsx(Ea,{yAxisId:"left",type:"monotone",dataKey:"bookings",name:"Bookings",stroke:"#8B5CF6",strokeWidth:2,dot:!1}),w.jsx(Ea,{yAxisId:"right",type:"monotone",dataKey:"utilization",name:"Utilization Rate",stroke:"#329DFF",strokeWidth:2,dot:!1,strokeDasharray:"2 4"})]})})})]})}function FG({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 console.log("Finance Summary Data:",e),w.jsx(Qi,{title:"Income",period:"This Month",icon:w.jsx(G0,{className:"!text-[24px] text-green-600"}),className:"!gap-[16px] break-inside-avoid h-[232px] overflow-hidden",actionButtons:w.jsx(_l,{widgetId:e?.widget_id,options:e?.communities,onFilterChange:(s,l)=>console.log(s,l),onExport:s=>console.log("Export triggered for",s)}),children:w.jsxs("div",{children:[w.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mb-2",children:[w.jsx("div",{children:"Opening"}),w.jsx("div",{children:"Income"}),w.jsx("div",{children:"Collection"}),w.jsx("div",{children:"Closing"})]}),w.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212] mb-2",children:[w.jsx("div",{children:a(t.opening_balance,t?.currency_type)}),w.jsx("div",{children:a(t.income,t?.currency_type)}),w.jsx("div",{children:a(t.collection,t?.currency_type)}),w.jsx("div",{children:a(t.closing_balance,t?.currency_type)})]}),w.jsx("hr",{className:"my-4 border-t border-dashed border-gray-300"}),w.jsx("div",{className:"flex items-center justify-between",children:w.jsxs("div",{className:"flex items-center gap-[12px]",children:[w.jsx(G0,{className:"!text-[24px] text-red-600"}),w.jsx("div",{className:"!my-0 !font-medium !text-[16px] !leading-[20px] !text-[#121212]",children:"Expenditure"})]})}),w.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mt-4 mb-2",children:[w.jsx("div",{children:"Opening"}),w.jsx("div",{children:"Expenditure"}),w.jsx("div",{children:"Payment"}),w.jsx("div",{children:"Outstanding"})]}),w.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212]",children:[w.jsx("div",{children:a(n.opening_balance,n?.currency_type)}),w.jsx("div",{children:a(n.expenditure,n?.currency_type)}),w.jsx("div",{children:a(n.payment,n?.currency_type)}),w.jsx("div",{children:a(n.outstanding,n?.currency_type)})]})]})})}var BG="tippy-box",xT="tippy-content",zG="tippy-backdrop",wT="tippy-arrow",OT="tippy-svg-arrow",No={passive:!0,capture:!0},ST=function(){return document.body};function VG(e,t){return{}.hasOwnProperty.call(e,t)}function ly(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function cy(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function ET(e,t){return typeof e=="function"?e.apply(void 0,t):e}function _T(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function WG(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function UG(e){return e.split(/\s+/).filter(Boolean)}function La(e){return[].concat(e)}function PT(e,t){e.indexOf(t)===-1&&e.push(t)}function HG(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function qG(e){return e.split("-")[0]}function Jd(e){return[].slice.call(e)}function CT(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function Pl(){return document.createElement("div")}function Cl(e){return["Element","Fragment"].some(function(t){return cy(e,t)})}function KG(e){return cy(e,"NodeList")}function YG(e){return cy(e,"MouseEvent")}function GG(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function XG(e){return Cl(e)?[e]:KG(e)?Jd(e):Array.isArray(e)?e:Jd(document.querySelectorAll(e))}function uy(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function TT(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function ZG(e){var t,n=La(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function JG(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=qG(a.placement),u=a.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,p=c==="top"?u.bottom.y:0,h=c==="right"?u.left.x:0,g=c==="left"?u.right.x:0,m=o.top-r+d>l,v=r-o.bottom-p>l,y=o.left-n+h>l,S=n-o.right-g>l;return m||v||y||S})}function dy(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function AT(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 Ir={isTouch:!1},kT=0;function QG(){Ir.isTouch||(Ir.isTouch=!0,window.performance&&document.addEventListener("mousemove",MT))}function MT(){var e=performance.now();e-kT<20&&(Ir.isTouch=!1,document.removeEventListener("mousemove",MT)),kT=e}function eX(){var e=document.activeElement;if(GG(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function tX(){document.addEventListener("touchstart",QG,No),window.addEventListener("blur",eX)}var nX=typeof window<"u"&&typeof document<"u",rX=nX?!!window.msCrypto:!1;function Fa(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 jT(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function iX(e){return jT(`
309
+ `));const Gt={...r,isRtl:z,arrow:i,disableInteractive:X,placement:T,PopperComponentProp:k,touch:Q.current},U=typeof M.popper=="function"?M.popper(Gt):M.popper,le=_.useMemo(()=>{let be=[{name:"arrow",enabled:!!Y,options:{element:Y,padding:4}}];return D.popperOptions?.modifiers&&(be=be.concat(D.popperOptions.modifiers)),U?.popperOptions?.modifiers&&(be=be.concat(U.popperOptions.modifiers)),{...D.popperOptions,...U?.popperOptions,modifiers:be}},[Y,D.popperOptions,U?.popperOptions]),Z=EG(Gt),ue=typeof M.transition=="function"?M.transition(Gt):M.transition,he={slots:{popper:s.Popper,transition:s.Transition??j,tooltip:s.Tooltip,arrow:s.Arrow,...P},slotProps:{arrow:M.arrow??l.arrow,popper:{...D,...U??l.popper},tooltip:M.tooltip??l.tooltip,transition:{...N,...ue??l.transition}}},[rt,vt]=lt("popper",{elementType:_G,externalForwardedProps:he,ownerState:Gt,className:oe(Z.popper,D?.className)}),[cr,Gi]=lt("transition",{elementType:vl,externalForwardedProps:he,ownerState:Gt}),[ur,Uo]=lt("tooltip",{elementType:PG,className:Z.tooltip,externalForwardedProps:he,ownerState:Gt}),[vi,Br]=lt("arrow",{elementType:CG,className:Z.arrow,externalForwardedProps:he,ownerState:Gt,ref:ne});return w.jsxs(_.Fragment,{children:[_.cloneElement(B,ye),w.jsx(rt,{as:k??Zv,placement:T,anchorEl:y?{getBoundingClientRect:()=>({top:El.y,left:El.x,right:El.x,bottom:El.y,width:0,height:0})}:F,popperRef:un,open:F?A:!1,id:fe,transition:!0,...dn,...vt,popperOptions:le,children:({TransitionProps:be})=>w.jsx(cr,{timeout:K.transitions.duration.shorter,...be,...Gi,children:w.jsxs(ur,{...Uo,children:[I,i?w.jsx(vi,{...Br}):null]})})})]})});process.env.NODE_ENV!=="production"&&(sy.propTypes={arrow:f.bool,children:Ra.isRequired,classes:f.object,className:f.string,components:f.shape({Arrow:f.elementType,Popper:f.elementType,Tooltip:f.elementType,Transition:f.elementType}),componentsProps:f.shape({arrow:f.object,popper:f.object,tooltip:f.object,transition:f.object}),describeChild:f.bool,disableFocusListener:f.bool,disableHoverListener:f.bool,disableInteractive:f.bool,disableTouchListener:f.bool,enterDelay:f.number,enterNextDelay:f.number,enterTouchDelay:f.number,followCursor:f.bool,id:f.string,leaveDelay:f.number,leaveTouchDelay:f.number,onClose:f.func,onOpen:f.func,open:f.bool,placement:f.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:f.elementType,PopperProps:f.object,slotProps:f.shape({arrow:f.oneOfType([f.func,f.object]),popper:f.oneOfType([f.func,f.object]),tooltip:f.oneOfType([f.func,f.object]),transition:f.oneOfType([f.func,f.object])}),slots:f.shape({arrow:f.elementType,popper:f.elementType,tooltip:f.elementType,transition:f.elementType}),sx:f.oneOfType([f.arrayOf(f.oneOfType([f.func,f.object,f.bool])),f.func,f.object]),title:f.node,TransitionComponent:f.elementType,TransitionProps:f.object});function TG(e){return Xe("MuiTextField",e)}We("MuiTextField",["root"]);const AG={standard:qd,filled:Hd,outlined:Yd},kG=e=>{const{classes:t}=e;return Je({root:["root"]},TG,t)},MG=ve(ty,{name:"MuiTextField",slot:"Root"})({}),bT=_.forwardRef(function(t,n){const r=ct({props:t,name:"MuiTextField"}),{autoComplete:i,autoFocus:o=!1,children:a,className:s,color:l="primary",defaultValue:c,disabled:u=!1,error:d=!1,FormHelperTextProps:p,fullWidth:h=!1,helperText:g,id:m,InputLabelProps:v,inputProps:y,InputProps:S,inputRef:x,label:b,maxRows:O,minRows:E,multiline:C=!1,name:T,onBlur:k,onChange:D,onFocus:M,placeholder:P,required:I=!1,rows:j,select:N=!1,SelectProps:L,slots:B={},slotProps:K={},type:z,value:F,variant:G="outlined",...Y}=r,ne={...r,autoFocus:o,color:l,disabled:u,error:d,fullWidth:h,multiline:C,required:I,select:N,variant:G},Q=kG(ne);process.env.NODE_ENV!=="production"&&N&&!a&&console.error("MUI: `children` must be passed when using the `TextField` component with `select`.");const X=ap(m),te=g&&X?`${X}-helper-text`:void 0,ie=b&&X?`${X}-label`:void 0,ae=AG[G],W={slots:B,slotProps:{input:S,inputLabel:v,htmlInput:y,formHelperText:p,select:L,...K}},H={},J=W.slotProps.inputLabel;G==="outlined"&&(J&&typeof J.shrink<"u"&&(H.notched=J.shrink),H.label=b),N&&((!L||!L.native)&&(H.id=void 0),H["aria-describedby"]=void 0);const[A,fe]=lt("root",{elementType:MG,shouldForwardComponentProp:!0,externalForwardedProps:{...W,...Y},ownerState:ne,className:oe(Q.root,s),ref:n,additionalProps:{disabled:u,error:d,fullWidth:h,required:I,color:l,variant:G}}),[re,me]=lt("input",{elementType:ae,externalForwardedProps:W,additionalProps:H,ownerState:ne}),[we,Ee]=lt("inputLabel",{elementType:ZC,externalForwardedProps:W,ownerState:ne}),[Ce,tt]=lt("htmlInput",{elementType:"input",externalForwardedProps:W,ownerState:ne}),[ze,ke]=lt("formHelperText",{elementType:GC,externalForwardedProps:W,ownerState:ne}),[de,kt]=lt("select",{elementType:Gd,externalForwardedProps:W,ownerState:ne}),nt=w.jsx(re,{"aria-describedby":te,autoComplete:i,autoFocus:o,defaultValue:c,fullWidth:h,multiline:C,name:T,rows:j,maxRows:O,minRows:E,type:z,value:F,id:X,inputRef:x,onBlur:k,onChange:D,onFocus:M,placeholder:P,inputProps:tt,slots:{input:B.htmlInput?Ce:void 0},...me});return w.jsxs(A,{...fe,children:[b!=null&&b!==""&&w.jsx(we,{htmlFor:X,id:ie,...Ee,children:b}),N?w.jsx(de,{"aria-describedby":te,id:X,labelId:ie,value:F,input:nt,...kt,children:a}):nt,g&&w.jsx(ze,{id:te,...ke,children:g})]})});process.env.NODE_ENV!=="production"&&(bT.propTypes={autoComplete:f.string,autoFocus:f.bool,children:f.node,classes:f.object,className:f.string,color:f.oneOfType([f.oneOf(["primary","secondary","error","info","success","warning"]),f.string]),defaultValue:f.any,disabled:f.bool,error:f.bool,FormHelperTextProps:f.object,fullWidth:f.bool,helperText:f.node,id:f.string,InputLabelProps:f.object,inputProps:f.object,InputProps:f.object,inputRef:nr,label:f.node,margin:f.oneOf(["dense","none","normal"]),maxRows:f.oneOfType([f.number,f.string]),minRows:f.oneOfType([f.number,f.string]),multiline:f.bool,name:f.string,onBlur:f.func,onChange:f.func,onFocus:f.func,placeholder:f.string,required:f.bool,rows:f.oneOfType([f.number,f.string]),select:f.bool,SelectProps:f.object,size:f.oneOfType([f.oneOf(["medium","small"]),f.string]),slotProps:f.shape({formHelperText:f.oneOfType([f.func,f.object]),htmlInput:f.oneOfType([f.func,f.object]),input:f.oneOfType([f.func,f.object]),inputLabel:f.oneOfType([f.func,f.object]),select:f.oneOfType([f.func,f.object])}),slots:f.shape({formHelperText:f.elementType,htmlInput:f.elementType,input:f.elementType,inputLabel:f.elementType,root:f.elementType,select:f.elementType}),sx:f.oneOfType([f.arrayOf(f.oneOfType([f.func,f.object,f.bool])),f.func,f.object]),type:f.string,value:f.any,variant:f.oneOf(["filled","outlined","standard"])});function jG(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 NG(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 DG(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)}const IG=_c(Gd)(()=>({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 _l({widgetId:e,options:t=[],defaultValue:n=["all"],onFilterChange:r=()=>{},onExport:i=()=>{}}){const o=JSON.parse(sessionStorage.getItem("community_id"))||[],[a,s]=R.useState(o),[l,c]=R.useState(""),u=t.filter(h=>h.community_name.toLowerCase().includes(l.toLowerCase())),d=h=>{let g=h.target.value;const m=t.map(v=>v.community_id);if(g.includes("all")&&!a.includes("all"))s(["all",...m]),Si("community_id",JSON.stringify(m)),Si("widget_id",e),r(m);else if(!g.includes("all")&&a.includes("all"))s([]),Si("community_id",JSON.stringify([])),Si("widget_id",e),r([]);else{const v=g.filter(x=>x!=="all"),y=v.length>0&&m.every(x=>v.includes(x));s(y?["all",...m]:v);const S=v.length===1?v[0]:v;Si("community_id",JSON.stringify(S)),Si("widget_id",e),r(S)}},p=()=>{Si("widget_id",e),Si("export",!0),i()};return w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx(sy,{slotProps:{tooltip:{sx:{fontSize:"12px"}}},children:w.jsx(ty,{size:"small",children:w.jsxs(IG,{multiple:!0,value:a,onChange:d,displayEmpty:!0,renderValue:h=>h.length===0?w.jsx("span",{style:{color:"#9e9e9e"},children:"Select Community"}):h.includes("all")?"All":t.filter(g=>h.includes(g.community_id)).map(g=>g.community_name).join(", "),MenuProps:{PaperProps:{style:{maxHeight:300}},autoFocus:!1},children:[w.jsx(Ol,{onKeyDown:h=>h.stopPropagation(),onClick:h=>h.stopPropagation(),disableRipple:!0,sx:{"&:hover":{backgroundColor:"transparent"},cursor:"default"},children:w.jsx(bT,{placeholder:"Search...",size:"small",variant:"outlined",value:l,onChange:h=>c(h.target.value),onClick:h=>h.stopPropagation(),onKeyDown:h=>h.stopPropagation(),sx:{width:"100%"},autoFocus:!0})}),w.jsxs(Ol,{value:"all",children:[w.jsx(Qv,{checked:a.includes("all")}),w.jsx(Kd,{primary:"All",sx:{fontWeight:600}})]}),u.length>0?u.map(h=>w.jsxs(Ol,{value:h.community_id,children:[w.jsx(Qv,{checked:a.includes(h.community_id)}),w.jsx(Kd,{primary:h.community_name})]},h.community_id)):w.jsx(Ol,{disabled:!0,children:w.jsx(Kd,{primary:"No results found"})})]})})}),w.jsx(sy,{title:"Export CSV for this widget",children:w.jsx("button",{onClick:p,className:"px-3 py-2 bg-[#FBF5FF] rounded cursor-pointer",children:w.jsx(NG,{className:"stroke-[#884EA7] stroke-[1.4]"})})})]})}function RG({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 w.jsx(Qi,{title:"Community",period:"This Month",icon:w.jsx(gp,{className:"!text-[24px] text-[#329DFF]"}),className:`${e&&"max-h-[184px]"} h-[184px] mb-4 break-inside-avoid`,actionButtons:w.jsx(_l,{widgetId:t?.widget_id,options:t?.communities,onFilterChange:(c,u)=>console.log(c,u),onExport:c=>console.log("Export triggered for",c)}),children:w.jsxs("div",{className:"flex",children:[w.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[w.jsxs("div",{className:"flex flex-col gap-[8px]",children:[w.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Move-in/Out Count"}),w.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium !text-[#8B5CF6]",children:n+r})]}),w.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] flex items-center gap-[4px]",children:[w.jsx(tx,{value:l(i,o)}),w.jsx("div",{className:"whitespace-nowrap",children:"Compared to last month"})]})]}),w.jsx("div",{className:"w-[50%] h-[111px] flex justify-end",children:w.jsx(wo,{width:"75%",height:"100%",children:w.jsxs(Od,{children:[w.jsxs(el,{data:s,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:[w.jsx(kr,{fill:a[0]}),w.jsx(kr,{fill:a[1]})]}),w.jsx(xo,{content:w.jsx(ps,{})})]})})})]})})}function $G({isStatic:e,data:t,communities:n}){const r=["#8B5CF6","#22C55E","#3B82F6","#F59E0B"],i=[{name:"Notice",value:Number(t?.total_notices||0),color:r[0]},{name:"Post",value:Number(t?.total_topics||0),color:r[1]},{name:"Poll",value:Number(t?.total_polls||0),color:r[2]},{name:"Survey",value:Number(t?.total_surveys||0),color:r[3]}];return w.jsx(Qi,{title:"Engagement",period:"This Month",icon:w.jsx(Y0,{className:"!text-[24px] text-[#DBB467]"}),className:`${e&&"max-h-[303px]"} h-[303px]`,actionButtons:w.jsx(_l,{widgetId:t?.widget_id,options:t?.communities,onFilterChange:(o,a)=>console.log(o,a),onExport:o=>console.log("Export triggered for",o)}),children:w.jsx("div",{className:"w-full h-[235px]",children:w.jsx(wo,{width:"100%",height:"100%",children:w.jsxs(SH,{data:i,layout:"vertical",margin:{top:4,right:8,left:0,bottom:0},children:[w.jsx(gd,{stroke:"#e5e7eb",strokeDasharray:"3 3",horizontal:!1}),w.jsx(rl,{type:"category",dataKey:"name",width:40,axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#121212",fontWeight:400}}),w.jsx(yd,{type:"number",axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#64748B",fontWeight:400}}),w.jsx(xo,{content:w.jsx(ps,{}),cursor:{fill:"transparent"}}),w.jsx(t2,{dataKey:"value",barSize:40,isAnimationActive:!1,children:i.map((o,a)=>w.jsx(kr,{fill:r[a]},o.name))})]})})})})}function LG({isStatic:e,data:t}){const n=Number(t?.totalBookings||0),r=Number(t?.averageUtilizationPercentage||0),i=R.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 w.jsxs(Qi,{title:"Facilities",period:"Today",icon:w.jsx(K0,{className:"!text-[24px] text-[#8B5CF6]"}),className:`${e&&"max-h-[305px]"} h-[305px] mb-4 break-inside-avoid`,children:[w.jsxs("div",{className:"grid grid-cols-2 gap-[24px] mb-[16px]",children:[w.jsxs("div",{children:[w.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Bookings"}),w.jsx("div",{className:"!text-[24px] font-medium text-[#8B5CF6]",children:n})]}),w.jsxs("div",{children:[w.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Utilisation Rate"}),w.jsxs("div",{className:"!text-[24px] font-medium text-[#329DFF]",children:[r.toFixed(2),"%"]})]})]}),w.jsx("div",{className:"w-full h-[170px]",children:w.jsx(wo,{width:"100%",height:"100%",children:w.jsxs(U2,{data:a,margin:{top:5,right:-30,left:-35,bottom:0},children:[w.jsx(gd,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),w.jsx(yd,{dataKey:"time",interval:0,tickFormatter:o,tick:{fontSize:10,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1,minTickGap:0}),w.jsx(rl,{yAxisId:"left",tick:{fontSize:10,fill:"#64748B"},axisLine:!1,tickLine:!1}),w.jsx(rl,{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}),w.jsx(xo,{content:w.jsx(ps,{})}),w.jsx(Ea,{yAxisId:"left",type:"monotone",dataKey:"bookings",name:"Bookings",stroke:"#8B5CF6",strokeWidth:2,dot:!1,isAnimationActive:!1}),w.jsx(Ea,{yAxisId:"right",type:"monotone",dataKey:"utilization",name:"Utilization Rate",stroke:"#329DFF",strokeWidth:2,dot:!1,strokeDasharray:"2 4",isAnimationActive:!1})]})})})]})}function FG({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 console.log("Finance Summary Data:",e),w.jsx(Qi,{title:"Income",period:"This Month",icon:w.jsx(G0,{className:"!text-[24px] text-green-600"}),className:"!gap-[16px] break-inside-avoid h-[232px] overflow-hidden",actionButtons:w.jsx(_l,{widgetId:e?.widget_id,options:e?.communities,onFilterChange:(s,l)=>console.log(s,l),onExport:s=>console.log("Export triggered for",s)}),children:w.jsxs("div",{children:[w.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mb-2",children:[w.jsx("div",{children:"Opening"}),w.jsx("div",{children:"Income"}),w.jsx("div",{children:"Collection"}),w.jsx("div",{children:"Closing"})]}),w.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212] mb-2",children:[w.jsx("div",{children:a(t.opening_balance,t?.currency_type)}),w.jsx("div",{children:a(t.income,t?.currency_type)}),w.jsx("div",{children:a(t.collection,t?.currency_type)}),w.jsx("div",{children:a(t.closing_balance,t?.currency_type)})]}),w.jsx("hr",{className:"my-4 border-t border-dashed border-gray-300"}),w.jsx("div",{className:"flex items-center justify-between",children:w.jsxs("div",{className:"flex items-center gap-[12px]",children:[w.jsx(G0,{className:"!text-[24px] text-red-600"}),w.jsx("div",{className:"!my-0 !font-medium !text-[16px] !leading-[20px] !text-[#121212]",children:"Expenditure"})]})}),w.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mt-4 mb-2",children:[w.jsx("div",{children:"Opening"}),w.jsx("div",{children:"Expenditure"}),w.jsx("div",{children:"Payment"}),w.jsx("div",{children:"Outstanding"})]}),w.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212]",children:[w.jsx("div",{children:a(n.opening_balance,n?.currency_type)}),w.jsx("div",{children:a(n.expenditure,n?.currency_type)}),w.jsx("div",{children:a(n.payment,n?.currency_type)}),w.jsx("div",{children:a(n.outstanding,n?.currency_type)})]})]})})}var BG="tippy-box",xT="tippy-content",zG="tippy-backdrop",wT="tippy-arrow",OT="tippy-svg-arrow",No={passive:!0,capture:!0},ST=function(){return document.body};function VG(e,t){return{}.hasOwnProperty.call(e,t)}function ly(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function cy(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function ET(e,t){return typeof e=="function"?e.apply(void 0,t):e}function _T(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function WG(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function UG(e){return e.split(/\s+/).filter(Boolean)}function La(e){return[].concat(e)}function PT(e,t){e.indexOf(t)===-1&&e.push(t)}function HG(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function qG(e){return e.split("-")[0]}function Jd(e){return[].slice.call(e)}function CT(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function Pl(){return document.createElement("div")}function Cl(e){return["Element","Fragment"].some(function(t){return cy(e,t)})}function KG(e){return cy(e,"NodeList")}function YG(e){return cy(e,"MouseEvent")}function GG(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function XG(e){return Cl(e)?[e]:KG(e)?Jd(e):Array.isArray(e)?e:Jd(document.querySelectorAll(e))}function uy(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function TT(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function ZG(e){var t,n=La(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function JG(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=qG(a.placement),u=a.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,p=c==="top"?u.bottom.y:0,h=c==="right"?u.left.x:0,g=c==="left"?u.right.x:0,m=o.top-r+d>l,v=r-o.bottom-p>l,y=o.left-n+h>l,S=n-o.right-g>l;return m||v||y||S})}function dy(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function AT(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 Ir={isTouch:!1},kT=0;function QG(){Ir.isTouch||(Ir.isTouch=!0,window.performance&&document.addEventListener("mousemove",MT))}function MT(){var e=performance.now();e-kT<20&&(Ir.isTouch=!1,document.removeEventListener("mousemove",MT)),kT=e}function eX(){var e=document.activeElement;if(GG(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function tX(){document.addEventListener("touchstart",QG,No),window.addEventListener("blur",eX)}var nX=typeof window<"u"&&typeof document<"u",rX=nX?!!window.msCrypto:!1;function Fa(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 jT(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function iX(e){return jT(`
310
310
  %ctippy.js
311
311
 
312
312
  %c`+jT(e)+`
@@ -326,7 +326,7 @@ Take a look at the reducer(s) handling this action type: ${h.type}.
326
326
  `,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
327
327
 
328
328
  `,`1) content: element.innerHTML
329
- `,"2) content: () => element.cloneNode(true)"].join(" "))}var s=i.reduce(function(l,c){var u=c&&pX(c,r);return u&&l.push(u),l},[]);return Cl(e)?s[0]:s}Al.defaultProps=Un,Al.setDefaultProps=cX,Al.currentInput=Ir,Object.assign({},pC,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}}),Al.setDefaultProps({render:BT});function zT(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var VT=typeof window<"u"&&typeof document<"u";function gy(e,t){e&&(typeof e=="function"&&e(t),{}.hasOwnProperty.call(e,"current")&&(e.current=t))}function WT(){return VT&&document.createElement("div")}function hX(e){var t={"data-placement":e.placement};return e.referenceHidden&&(t["data-reference-hidden"]=""),e.escaped&&(t["data-escaped"]=""),t}function UT(e,t){if(e===t)return!0;if(typeof e=="object"&&e!=null&&typeof t=="object"&&t!=null){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(t.hasOwnProperty(n)){if(!UT(e[n],t[n]))return!1}else return!1;return!0}else return!1}function mX(e){var t=[];return e.forEach(function(n){t.find(function(r){return UT(n,r)})||t.push(n)}),t}function gX(e,t){var n,r;return Object.assign({},t,{popperOptions:Object.assign({},e.popperOptions,t.popperOptions,{modifiers:mX([].concat(((n=e.popperOptions)==null?void 0:n.modifiers)||[],((r=t.popperOptions)==null?void 0:r.modifiers)||[]))})})}var vy=VT?R.useLayoutEffect:R.useEffect;function vX(e){var t=R.useRef();return t.current||(t.current=typeof e=="function"?e():e),t.current}function HT(e,t,n){n.split(/\s+/).forEach(function(r){r&&e.classList[t](r)})}var yX={name:"className",defaultValue:"",fn:function(t){var n=t.popper.firstElementChild,r=function(){var s;return!!((s=t.props.render)!=null&&s.$$tippy)};function i(){if(t.props.className&&!r()){process.env.NODE_ENV!=="production"&&console.warn(["@tippyjs/react: Cannot use `className` prop in conjunction with","`render` prop. Place the className on the element you are","rendering."].join(" "));return}HT(n,"add",t.props.className)}function o(){r()&&HT(n,"remove",t.props.className)}return{onCreate:i,onBeforeUpdate:o,onAfterUpdate:i}}};function bX(e){function t(n){var r=n.children,i=n.content,o=n.visible,a=n.singleton,s=n.render,l=n.reference,c=n.disabled,u=c===void 0?!1:c,d=n.ignoreAttributes,p=d===void 0?!0:d;n.__source,n.__self;var h=zT(n,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]),g=o!==void 0,m=a!==void 0,v=R.useState(!1),y=v[0],S=v[1],x=R.useState({}),b=x[0],O=x[1],E=R.useState(),C=E[0],T=E[1],k=vX(function(){return{container:WT(),renders:1}}),D=Object.assign({ignoreAttributes:p},h,{content:k.container});g&&(process.env.NODE_ENV!=="production"&&["trigger","hideOnClick","showOnCreate"].forEach(function(j){D[j]!==void 0&&console.warn(["@tippyjs/react: Cannot specify `"+j+"` prop in","controlled mode (`visible` prop)"].join(" "))}),D.trigger="manual",D.hideOnClick=!1),m&&(u=!0);var M=D,P=D.plugins||[];s&&(M=Object.assign({},D,{plugins:m&&a.data!=null?[].concat(P,[{fn:function(){return{onTrigger:function(L,B){var K=a.data.children.find(function(z){var F=z.instance;return F.reference===B.currentTarget});L.state.$$activeSingletonInstance=K.instance,T(K.content)}}}}]):P,render:function(){return{popper:k.container}}}));var I=[l].concat(r?[r.type]:[]);return vy(function(){var j=l;l&&l.hasOwnProperty("current")&&(j=l.current);var N=e(j||k.ref||WT(),Object.assign({},M,{plugins:[yX].concat(D.plugins||[])}));return k.instance=N,u&&N.disable(),o&&N.show(),m&&a.hook({instance:N,content:i,props:M,setSingletonContent:T}),S(!0),function(){N.destroy(),a?.cleanup(N)}},I),vy(function(){var j;if(k.renders===1){k.renders++;return}var N=k.instance;N.setProps(gX(N.props,M)),(j=N.popperInstance)==null||j.forceUpdate(),u?N.disable():N.enable(),g&&(o?N.show():N.hide()),m&&a.hook({instance:N,content:i,props:M,setSingletonContent:T})}),vy(function(){var j;if(s){var N=k.instance;N.setProps({popperOptions:Object.assign({},N.props.popperOptions,{modifiers:[].concat((((j=N.props.popperOptions)==null?void 0:j.modifiers)||[]).filter(function(L){var B=L.name;return B!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(B){var K,z=B.state,F=(K=z.modifiersData)==null?void 0:K.hide;(b.placement!==z.placement||b.referenceHidden!==F?.isReferenceHidden||b.escaped!==F?.hasPopperEscaped)&&O({placement:z.placement,referenceHidden:F?.isReferenceHidden,escaped:F?.hasPopperEscaped}),z.attributes.popper={}}}])})})}},[b.placement,b.referenceHidden,b.escaped].concat(I)),R.createElement(R.Fragment,null,r?R.cloneElement(r,{ref:function(N){k.ref=N,gy(r.ref,N)}}):null,y&&Xi.createPortal(s?s(hX(b),C,k.instance):i,k.container))}return t}var xX=(function(e,t){return R.forwardRef(function(r,i){var o=r.children,a=zT(r,["children"]);return R.createElement(e,Object.assign({},t,a),o?R.cloneElement(o,{ref:function(l){gy(i,l),gy(o.ref,l)}}):null)})}),wX=xX(bX(Al));function OX(e){const t=e>=12?"PM":"AM";let n=e%12;return n===0&&(n=12),`${n} ${t}`}function SX(e=[]){return Array.from({length:24},(t,n)=>{const r=e.find(i=>i.hour===n)||{};return{hour:n,time:OX(n),walkins:r.walkins??0,checkins:r.preApproved??0,staffAttendance:r.staffAttendance??0}})}const Ba={walkins:"#1FA05B",preApproved:"#E7A015",staffAttendance:"#329DFF"};function EX({type:e,data:t,children:n}){if(!e||!t)return n;const r={activeWalkins:[["Currently Inside",t.visitor_in],["Total Visited Today",t.total_pass]],preApprovedCheckins:[["Currently Inside",t.currently_inside],["Total Visited Today",t.expected_pass_scanned],["No show",t.expected_pass_not_scanned],["Total Scheduled",t.total_expected_pass]],staffAttendance:[["Currently Inside",t.total_in_now],["Absent Today",t.absent_staff],["Total Visited Today",t.total_in_today],["Total Staff",t.total_staff]]},i={activeWalkins:"Active Walk-ins",preApprovedCheckins:"Pre-approved Check-ins",staffAttendance:"Staff Attendance"},o={activeWalkins:"text-[#1FA05B]",preApprovedCheckins:"text-[#E7A015]",staffAttendance:"text-[#329DFF]"},a=w.jsx(Qi,{title:i[e],period:"Today",icon:w.jsx(vp,{className:`${o[e]} !text-[24px]`}),className:"!gap-0 min-w-[353px] bg-white shadow-xl rounded-lg border border-gray-200",children:w.jsx("div",{className:"flex flex-col gap-[8px] mt-[12px] pt-[12px] border-t border-dashed border-[#EBEBEB]",children:r[e].map(([s,l])=>w.jsxs("div",{className:"flex justify-between text-[14px] text-[#64748B]",children:[w.jsx("div",{children:s}),w.jsx("div",{className:"font-semibold text-gray-800",children:l??0})]},s))})});return w.jsx(wX,{content:a,placement:"bottom-start",interactive:!0,delay:[100,0],offset:[0,8],appendTo:document.body,theme:"light-border",maxWidth:"none",children:n})}function _X({isStatic:e,data:t}){const n=t?.summary?.activeWalkins||{},r=t?.summary?.preApprovedCheckins||{},i=t?.summary?.staffAttendance||{},o=R.useMemo(()=>SX(t?.chart||[]),[t]),{yAxisTicks:a,yAxisMax:s}=R.useMemo(()=>{const l=Math.max(...o.flatMap(u=>[u.walkins,u.checkins,u.staffAttendance])),c=l>0?l:5;return{yAxisTicks:[0,Math.ceil(c/2),c],yAxisMax:c}},[o]);return w.jsx(Qi,{title:"Gate Updates",period:"Today",icon:w.jsx(vp,{className:"!text-[24px] text-[#37CC6D]"}),className:`${e?"max-h-[303px]":""} h-[251px] mb-4 break-inside-avoid`,actionButtons:w.jsx(_l,{widgetId:t?.widget_id,options:t?.communities,onFilterChange:(l,c)=>console.log(l,c),onExport:l=>console.log("Export triggered for",l)}),children:w.jsxs("div",{children:[w.jsx("div",{className:"grid grid-cols-3 gap-[24px] mb-[16px]",children:[{key:"activeWalkins",data:n,color:Ba.walkins,label:"Active Walk-ins"},{key:"staffAttendance",data:i,color:Ba.staffAttendance,label:"Staff Checked-in"},{key:"preApprovedCheckins",data:r,color:Ba.preApproved,label:"Pre-approved"}].map(l=>w.jsx(EX,{type:l.key,data:l.data,children:w.jsxs("div",{className:"flex flex-col gap-[8px] cursor-pointer",children:[w.jsx("div",{className:"text-[10px] text-[#64748B] whitespace-nowrap",children:l.label}),w.jsxs("div",{className:"text-[28px] font-medium flex items-center",style:{color:l.color},children:[l.key==="activeWalkins"?l.data?.visitor_in??0:l.key==="preApprovedCheckins"?l.data?.currently_inside??0:l.data?.total_in_now??0,w.jsxs("div",{className:"text-[20px] text-[#64748B] ml-1",children:["/",l.key==="activeWalkins"?l.data?.total_pass??0:l.key==="preApprovedCheckins"?l.data?.total_expected_pass??0:l.data?.total_staff??0]})]})]})},l.key))}),w.jsx("div",{className:"w-full h-[105px]",children:w.jsx(wo,{width:"100%",height:"100%",children:w.jsxs(U2,{data:o,margin:{top:5,right:0,left:-40,bottom:0},children:[w.jsx(gd,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),w.jsx(yd,{dataKey:"time",tickFormatter:(l,c)=>c%4===0?l:"",tick:{fontSize:10,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1}),w.jsx(rl,{tick:{fontSize:10,fill:"#64748B",fontWeight:400},ticks:a,domain:[0,s],allowDecimals:!1,axisLine:!1,tickLine:!1}),w.jsx(xo,{content:w.jsx(ps,{})}),w.jsx(Ea,{type:"monotone",dataKey:"walkins",stroke:Ba.walkins,strokeWidth:2,dot:!1,name:"Active Walk-ins"}),w.jsx(Ea,{type:"monotone",dataKey:"checkins",stroke:Ba.preApproved,strokeWidth:2,strokeDasharray:"5 5",dot:!1,name:"Pre-approved"}),w.jsx(Ea,{type:"monotone",dataKey:"staffAttendance",stroke:Ba.staffAttendance,strokeWidth:2,dot:!1,name:"Staff Attendance"})]})})})]})})}function PX({isStatic:e,data:t}){const n=["#1FA05B","#E7A015","#FA7E28","#EF4444","#CBD5E1"],r=[{name:"L1 Level",value:Number(t?.total_L1||0),color:n[0]},{name:"L2 Level",value:Number(t?.total_L2||0),color:n[1]},{name:"L3 Level",value:Number(t?.total_L3||0),color:n[2]},{name:"No Level",value:Number(t?.total_NoLevel||0),color:n[3]}];r.reduce((o,a)=>o+a.value,0);const i=r;return console.log("Helpdesk Data:",t),w.jsx(Qi,{title:"Helpdesk",period:"As of Today",icon:w.jsx(JD,{className:"!text-[24px] text-[#FA7E28]"}),className:`${e&&"max-h-[186px]"} h-[186px] mb-4 break-inside-avoid`,actionButtons:w.jsx(_l,{widgetId:t?.widget_id,options:t?.communities,onFilterChange:(o,a)=>console.log(o,a),onExport:o=>console.log("Export triggered for",o)}),children:w.jsxs("div",{className:"flex gap-[12px] h-fit",children:[w.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[w.jsxs("div",{className:"flex flex-col gap-[8px]",children:[w.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Un-resolved Complaints"}),w.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium text-[#FA7E28]",children:t?.total_open_complaints??0})]}),w.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] flex items-center gap-[4px]",children:[w.jsx(tx,{value:t?.percent_change}),w.jsx("div",{className:"whitespace-nowrap",children:"Compared to yesterday"})]})]}),w.jsx("div",{className:"w-[50%] h-[110px] flex justify-end",children:w.jsx(wo,{width:"75%",height:"100%",children:w.jsxs(Od,{children:[w.jsx(el,{data:i,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:i.map((o,a)=>w.jsx(kr,{fill:n[a]||"#CBD5E1"},o.name))}),w.jsx(xo,{content:w.jsx(ps,{})})]})})})]})})}/*!
329
+ `,"2) content: () => element.cloneNode(true)"].join(" "))}var s=i.reduce(function(l,c){var u=c&&pX(c,r);return u&&l.push(u),l},[]);return Cl(e)?s[0]:s}Al.defaultProps=Un,Al.setDefaultProps=cX,Al.currentInput=Ir,Object.assign({},pC,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}}),Al.setDefaultProps({render:BT});function zT(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var VT=typeof window<"u"&&typeof document<"u";function gy(e,t){e&&(typeof e=="function"&&e(t),{}.hasOwnProperty.call(e,"current")&&(e.current=t))}function WT(){return VT&&document.createElement("div")}function hX(e){var t={"data-placement":e.placement};return e.referenceHidden&&(t["data-reference-hidden"]=""),e.escaped&&(t["data-escaped"]=""),t}function UT(e,t){if(e===t)return!0;if(typeof e=="object"&&e!=null&&typeof t=="object"&&t!=null){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(t.hasOwnProperty(n)){if(!UT(e[n],t[n]))return!1}else return!1;return!0}else return!1}function mX(e){var t=[];return e.forEach(function(n){t.find(function(r){return UT(n,r)})||t.push(n)}),t}function gX(e,t){var n,r;return Object.assign({},t,{popperOptions:Object.assign({},e.popperOptions,t.popperOptions,{modifiers:mX([].concat(((n=e.popperOptions)==null?void 0:n.modifiers)||[],((r=t.popperOptions)==null?void 0:r.modifiers)||[]))})})}var vy=VT?R.useLayoutEffect:R.useEffect;function vX(e){var t=R.useRef();return t.current||(t.current=typeof e=="function"?e():e),t.current}function HT(e,t,n){n.split(/\s+/).forEach(function(r){r&&e.classList[t](r)})}var yX={name:"className",defaultValue:"",fn:function(t){var n=t.popper.firstElementChild,r=function(){var s;return!!((s=t.props.render)!=null&&s.$$tippy)};function i(){if(t.props.className&&!r()){process.env.NODE_ENV!=="production"&&console.warn(["@tippyjs/react: Cannot use `className` prop in conjunction with","`render` prop. Place the className on the element you are","rendering."].join(" "));return}HT(n,"add",t.props.className)}function o(){r()&&HT(n,"remove",t.props.className)}return{onCreate:i,onBeforeUpdate:o,onAfterUpdate:i}}};function bX(e){function t(n){var r=n.children,i=n.content,o=n.visible,a=n.singleton,s=n.render,l=n.reference,c=n.disabled,u=c===void 0?!1:c,d=n.ignoreAttributes,p=d===void 0?!0:d;n.__source,n.__self;var h=zT(n,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]),g=o!==void 0,m=a!==void 0,v=R.useState(!1),y=v[0],S=v[1],x=R.useState({}),b=x[0],O=x[1],E=R.useState(),C=E[0],T=E[1],k=vX(function(){return{container:WT(),renders:1}}),D=Object.assign({ignoreAttributes:p},h,{content:k.container});g&&(process.env.NODE_ENV!=="production"&&["trigger","hideOnClick","showOnCreate"].forEach(function(j){D[j]!==void 0&&console.warn(["@tippyjs/react: Cannot specify `"+j+"` prop in","controlled mode (`visible` prop)"].join(" "))}),D.trigger="manual",D.hideOnClick=!1),m&&(u=!0);var M=D,P=D.plugins||[];s&&(M=Object.assign({},D,{plugins:m&&a.data!=null?[].concat(P,[{fn:function(){return{onTrigger:function(L,B){var K=a.data.children.find(function(z){var F=z.instance;return F.reference===B.currentTarget});L.state.$$activeSingletonInstance=K.instance,T(K.content)}}}}]):P,render:function(){return{popper:k.container}}}));var I=[l].concat(r?[r.type]:[]);return vy(function(){var j=l;l&&l.hasOwnProperty("current")&&(j=l.current);var N=e(j||k.ref||WT(),Object.assign({},M,{plugins:[yX].concat(D.plugins||[])}));return k.instance=N,u&&N.disable(),o&&N.show(),m&&a.hook({instance:N,content:i,props:M,setSingletonContent:T}),S(!0),function(){N.destroy(),a?.cleanup(N)}},I),vy(function(){var j;if(k.renders===1){k.renders++;return}var N=k.instance;N.setProps(gX(N.props,M)),(j=N.popperInstance)==null||j.forceUpdate(),u?N.disable():N.enable(),g&&(o?N.show():N.hide()),m&&a.hook({instance:N,content:i,props:M,setSingletonContent:T})}),vy(function(){var j;if(s){var N=k.instance;N.setProps({popperOptions:Object.assign({},N.props.popperOptions,{modifiers:[].concat((((j=N.props.popperOptions)==null?void 0:j.modifiers)||[]).filter(function(L){var B=L.name;return B!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(B){var K,z=B.state,F=(K=z.modifiersData)==null?void 0:K.hide;(b.placement!==z.placement||b.referenceHidden!==F?.isReferenceHidden||b.escaped!==F?.hasPopperEscaped)&&O({placement:z.placement,referenceHidden:F?.isReferenceHidden,escaped:F?.hasPopperEscaped}),z.attributes.popper={}}}])})})}},[b.placement,b.referenceHidden,b.escaped].concat(I)),R.createElement(R.Fragment,null,r?R.cloneElement(r,{ref:function(N){k.ref=N,gy(r.ref,N)}}):null,y&&Xi.createPortal(s?s(hX(b),C,k.instance):i,k.container))}return t}var xX=(function(e,t){return R.forwardRef(function(r,i){var o=r.children,a=zT(r,["children"]);return R.createElement(e,Object.assign({},t,a),o?R.cloneElement(o,{ref:function(l){gy(i,l),gy(o.ref,l)}}):null)})}),wX=xX(bX(Al));function OX(e){const t=e>=12?"PM":"AM";let n=e%12;return n===0&&(n=12),`${n} ${t}`}function SX(e=[]){return Array.from({length:24},(t,n)=>{const r=e.find(i=>i.hour===n)||{};return{hour:n,time:OX(n),walkins:r.walkins??0,checkins:r.preApproved??0,staffAttendance:r.staffAttendance??0}})}const Ba={walkins:"#1FA05B",preApproved:"#E7A015",staffAttendance:"#329DFF"};function EX({type:e,data:t,children:n}){if(!e||!t)return n;const r={activeWalkins:[["Currently Inside",t.visitor_in],["Total Visited Today",t.total_pass]],preApprovedCheckins:[["Currently Inside",t.currently_inside],["Total Visited Today",t.expected_pass_scanned],["No show",t.expected_pass_not_scanned],["Total Scheduled",t.total_expected_pass]],staffAttendance:[["Currently Inside",t.total_in_now],["Absent Today",t.absent_staff],["Total Visited Today",t.total_in_today],["Total Staff",t.total_staff]]},i={activeWalkins:"Active Walk-ins",preApprovedCheckins:"Pre-approved Check-ins",staffAttendance:"Staff Attendance"},o={activeWalkins:"text-[#1FA05B]",preApprovedCheckins:"text-[#E7A015]",staffAttendance:"text-[#329DFF]"},a=w.jsx(Qi,{title:i[e],period:"Today",icon:w.jsx(vp,{className:`${o[e]} !text-[24px]`}),className:"!gap-0 min-w-[353px] bg-white shadow-xl rounded-lg border border-gray-200",children:w.jsx("div",{className:"flex flex-col gap-[8px] mt-[12px] pt-[12px] border-t border-dashed border-[#EBEBEB]",children:r[e].map(([s,l])=>w.jsxs("div",{className:"flex justify-between text-[14px] text-[#64748B]",children:[w.jsx("div",{children:s}),w.jsx("div",{className:"font-semibold text-gray-800",children:l??0})]},s))})});return w.jsx(wX,{content:a,placement:"bottom-start",interactive:!0,delay:[100,0],offset:[0,8],appendTo:document.body,theme:"light-border",maxWidth:"none",children:n})}function _X({isStatic:e,data:t}){const n=t?.summary?.activeWalkins||{},r=t?.summary?.preApprovedCheckins||{},i=t?.summary?.staffAttendance||{},o=R.useMemo(()=>SX(t?.chart||[]),[t]),{yAxisTicks:a,yAxisMax:s}=R.useMemo(()=>{const l=Math.max(...o.flatMap(u=>[u.walkins,u.checkins,u.staffAttendance])),c=l>0?l:5;return{yAxisTicks:[0,Math.ceil(c/2),c],yAxisMax:c}},[o]);return w.jsx(Qi,{title:"Gate Updates",period:"Today",icon:w.jsx(vp,{className:"!text-[24px] text-[#37CC6D]"}),className:`${e?"max-h-[303px]":""} h-[251px] mb-4 break-inside-avoid`,actionButtons:w.jsx(_l,{widgetId:t?.widget_id,options:t?.communities,onFilterChange:(l,c)=>console.log(l,c),onExport:l=>console.log("Export triggered for",l)}),children:w.jsxs("div",{children:[w.jsx("div",{className:"grid grid-cols-3 gap-[24px] mb-[16px]",children:[{key:"activeWalkins",data:n,color:Ba.walkins,label:"Active Walk-ins"},{key:"staffAttendance",data:i,color:Ba.staffAttendance,label:"Staff Checked-in"},{key:"preApprovedCheckins",data:r,color:Ba.preApproved,label:"Pre-approved"}].map(l=>w.jsx(EX,{type:l.key,data:l.data,children:w.jsxs("div",{className:"flex flex-col gap-[8px] cursor-pointer",children:[w.jsx("div",{className:"text-[10px] text-[#64748B] whitespace-nowrap",children:l.label}),w.jsxs("div",{className:"text-[28px] font-medium flex items-center",style:{color:l.color},children:[l.key==="activeWalkins"?l.data?.visitor_in??0:l.key==="preApprovedCheckins"?l.data?.currently_inside??0:l.data?.total_in_now??0,w.jsxs("div",{className:"text-[20px] text-[#64748B] ml-1",children:["/",l.key==="activeWalkins"?l.data?.total_pass??0:l.key==="preApprovedCheckins"?l.data?.total_expected_pass??0:l.data?.total_staff??0]})]})]})},l.key))}),w.jsx("div",{className:"w-full h-[105px]",children:w.jsx(wo,{width:"100%",height:"100%",children:w.jsxs(U2,{data:o,margin:{top:5,right:0,left:-40,bottom:0},children:[w.jsx(gd,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),w.jsx(yd,{dataKey:"time",tickFormatter:(l,c)=>c%4===0?l:"",tick:{fontSize:10,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1}),w.jsx(rl,{tick:{fontSize:10,fill:"#64748B",fontWeight:400},ticks:a,domain:[0,s],allowDecimals:!1,axisLine:!1,tickLine:!1}),w.jsx(xo,{content:w.jsx(ps,{})}),w.jsx(Ea,{type:"monotone",dataKey:"walkins",stroke:Ba.walkins,strokeWidth:2,dot:!1,name:"Active Walk-ins",isAnimationActive:!1}),w.jsx(Ea,{type:"monotone",dataKey:"checkins",stroke:Ba.preApproved,strokeWidth:2,strokeDasharray:"5 5",dot:!1,name:"Pre-approved",isAnimationActive:!1}),w.jsx(Ea,{type:"monotone",dataKey:"staffAttendance",stroke:Ba.staffAttendance,strokeWidth:2,dot:!1,name:"Staff Attendance",isAnimationActive:!1})]})})})]})})}function PX({isStatic:e,data:t}){const n=["#1FA05B","#E7A015","#FA7E28","#EF4444","#CBD5E1"],r=[{name:"L1 Level",value:Number(t?.total_L1||0),color:n[0]},{name:"L2 Level",value:Number(t?.total_L2||0),color:n[1]},{name:"L3 Level",value:Number(t?.total_L3||0),color:n[2]},{name:"No Level",value:Number(t?.total_NoLevel||0),color:n[3]}];r.reduce((o,a)=>o+a.value,0);const i=r;return console.log("Helpdesk Data:",t),w.jsx(Qi,{title:"Helpdesk",period:"As of Today",icon:w.jsx(JD,{className:"!text-[24px] text-[#FA7E28]"}),className:`${e&&"max-h-[186px]"} h-[186px] mb-4 break-inside-avoid`,actionButtons:w.jsx(_l,{widgetId:t?.widget_id,options:t?.communities,onFilterChange:(o,a)=>console.log(o,a),onExport:o=>console.log("Export triggered for",o)}),children:w.jsxs("div",{className:"flex gap-[12px] h-fit",children:[w.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[w.jsxs("div",{className:"flex flex-col gap-[8px]",children:[w.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Un-resolved Complaints"}),w.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium text-[#FA7E28]",children:t?.total_open_complaints??0})]}),w.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] flex items-center gap-[4px]",children:[w.jsx(tx,{value:t?.percent_change}),w.jsx("div",{className:"whitespace-nowrap",children:"Compared to yesterday"})]})]}),w.jsx("div",{className:"w-[50%] h-[110px] flex justify-end",children:w.jsx(wo,{width:"75%",height:"100%",children:w.jsxs(Od,{children:[w.jsx(el,{data:i,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:i.map((o,a)=>w.jsx(kr,{fill:n[a]||"#CBD5E1"},o.name))}),w.jsx(xo,{content:w.jsx(ps,{})})]})})})]})})}/*!
330
330
  * @kurkle/color v0.3.4
331
331
  * https://github.com/kurkle/color#readme
332
332
  * (c) 2024 Jukka Kurkela
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anarock-widgets",
3
- "version": "1.0.69",
3
+ "version": "1.0.70",
4
4
  "main": "dist/index.cjs.js",
5
5
  "module": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",