Files
Express_console_build/build/static/js/6165.266ba693.chunk.js

1 line
20 KiB
JavaScript

"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[6165],{23787:(e,o,r)=>{r.d(o,{FG:()=>u,nV:()=>x,pY:()=>f,pg:()=>h});var n=r(89379),i=r(80045),t=r(93230),s=r(2235),l=r(16491),c=r(82053),a=r(44414);const d=["children","scroll","onScroll","sx"],x=e=>{let{children:o,scroll:r=!1,onScroll:s,sx:l}=e,c=(0,i.A)(e,d);return(0,a.jsx)(t.A,(0,n.A)((0,n.A)({spacing:1.25,onScroll:s,sx:(0,n.A)((0,n.A)({p:1.5},r&&{maxHeight:"calc(100vh - 220px)",overflowY:"auto",overflowX:"hidden"}),l)},c),{},{children:o}))},h=e=>{let{accent:o="#662582",header:r,footer:i,selected:t=!1,onClick:c,children:d,sx:x}=e;return(0,a.jsxs)(s.A,{elevation:0,onClick:c,sx:(0,n.A)({position:"relative",overflow:"hidden",flexShrink:0,borderRadius:2.5,border:"1px solid",borderColor:t?o:"#e2e8f0",background:t?"".concat(o,"0a"):"#fff",boxShadow:"0 4px 14px rgba(15,23,42,0.05)",transition:"border-color 0.15s, box-shadow 0.15s"},x),children:[(0,a.jsx)(l.A,{sx:{position:"absolute",left:0,top:0,bottom:0,width:3,bgcolor:o}}),(0,a.jsxs)(l.A,{sx:{p:1.5,pl:2},children:[r,d,i]})]})},u=e=>{let{children:o,columns:r=2,sx:i}=e;return(0,a.jsx)(l.A,{sx:(0,n.A)({display:"grid",gridTemplateColumns:"repeat(".concat(r,", minmax(0, 1fr))"),gap:1,mt:1.25},i),children:o})},f=e=>{let{label:o,value:r,children:n,full:i=!1,align:t="left"}=e;return(0,a.jsxs)(l.A,{sx:{gridColumn:i?"1 / -1":"auto",minWidth:0,textAlign:t},children:[(0,a.jsx)(c.A,{sx:{fontSize:9.5,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:"#94a3b8",lineHeight:1.4},children:o}),(0,a.jsx)(l.A,{sx:{mt:.25,minWidth:0},children:void 0!==n?n:(0,a.jsx)(c.A,{sx:{fontSize:13,fontWeight:600,color:"#0f172a"},noWrap:!0,children:null!==r&&void 0!==r?r:"\u2014"})})]})}},26165:(e,o,r)=>{r.r(o),r.d(o,{default:()=>$});var n=r(9950),i=r(28429),t=r(36150),s=r(4159),l=r.n(s),c=r(41413),a=r(47223),d=r(16491),x=r(82053),h=r(60899),u=r(2235),f=r(93230),p=r(83274),g=r(25333),m=r(1320),j=r(15769),b=r(69780),A=r(9213),v=r(21671),w=r(34075),y=r(74745),k=r(6258),C=r(14857),S=r(31222),W=r(81425),I=r(52351),z=r(56311),R=r(27001),Y=r(36803),M=r(96646),T=r(23787),D=r(44414),P=r(36220);l().extend(P);const L=14,F="#0f172a",B="#64748b",H="#94a3b8",N="#e2e8f0",E="#f1f5f9",K="#ffffff",O="#f8fafc",G=(e,o)=>"".concat(e).concat(o),U=e=>G(e,"08"),q=e=>G(e,"18"),X=e=>G(e,"55"),_="#662582",V=e=>{let{color:o,selected:r,size:n=24,children:i}=e;return(0,D.jsx)(c.A,{sx:{width:n,height:n,bgcolor:r?o:q(o),color:r?"#fff":o,transition:"background-color 0.15s, color 0.15s"},children:i})},J={0:{key:"all",label:"All",color:_,icon:S.Uhn,countKey:"totalcount"},1:{key:"open",label:"Open",color:"#ef4444",icon:S.tX0,countKey:"pendingcount"},2:{key:"overdue",label:"Overdue",color:"#f59e0b",icon:S.tMO,countKey:"overduecount"},3:{key:"paid",label:"Paid",color:"#10b981",icon:S.mU9,countKey:"paidcount"}},Z=[0,1,2,3];function Q(e){return new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",minimumFractionDigits:2}).format(Number(e)||0)}const $=()=>{var e,o,r,s;const P=(0,i.Zp)(),$=(0,C.A)(),ee=(0,a.A)($.breakpoints.down("md")),[oe,re]=(0,n.useState)(0),[ne,ie]=(0,n.useState)(10),[te,se]=(0,n.useState)(0),[le,ce]=(0,n.useState)(!1),[ae,de]=(0,n.useState)(""),[xe,he]=(0,n.useState)(""),ue=n.useCallback((e=>{he(e),re(0)}),[]),{data:fe,isLoading:pe,isError:ge,error:me}=(0,t.I)({queryKey:["invoiceInsight"],queryFn:W.Y8,refetchInterval:3e5}),{data:je,isLoading:be,isError:Ae,error:ve}=(0,t.I)({queryKey:[te],queryFn:W.XC,refetchInterval:3e5}),we=pe||be,ye=ge||Ae,ke=(null===me||void 0===me?void 0:me.message)||(null===ve||void 0===ve?void 0:ve.message),Ce=(0,n.useMemo)((()=>{if(!je)return[];if(!xe)return je;const e=xe.toLowerCase().trim();return je.filter((o=>[o.tenantname,o.contactperson,String(o.invoiceno)].filter(Boolean).some((o=>String(o).toLowerCase().includes(e)))))}),[je,xe]),Se=(0,n.useMemo)((()=>{const e=Math.max(0,Math.ceil(Ce.length/ne)-1);return Math.min(oe,e)}),[Ce.length,oe,ne]);n.useEffect((()=>{oe!==Se&&re(Se)}),[oe,Se]);const We=(0,n.useMemo)((()=>Ce.slice(Se*ne,Se*ne+ne)),[Ce,Se,ne]),Ie=(0,n.useMemo)((()=>Ce.reduce(((e,o)=>e+(Number(o.totalamount)||0)),0)),[Ce]),ze=(0,n.useMemo)((()=>We.reduce(((e,o)=>e+(Number(o.totalamount)||0)),0)),[We]);if(ye)return ke;const Re=[{idx:0,label:"All Invoices",color:_,icon:S.Uhn,value:null!==(e=null===fe||void 0===fe?void 0:fe.totalcount)&&void 0!==e?e:0},{idx:1,label:"Open",color:"#ef4444",icon:S.G6c,value:null!==(o=null===fe||void 0===fe?void 0:fe.pendingcount)&&void 0!==o?o:0},{idx:2,label:"Overdue",color:"#f59e0b",icon:S.tMO,value:null!==(r=null===fe||void 0===fe?void 0:fe.overduecount)&&void 0!==r?r:0},{idx:3,label:"Paid",color:"#10b981",icon:S.cAP,value:null!==(s=null===fe||void 0===fe?void 0:fe.paidcount)&&void 0!==s?s:0}],Ye=J[te];return(0,D.jsxs)(D.Fragment,{children:[(le||we)&&(0,D.jsx)(I.A,{}),(0,D.jsx)(R.A,{title:"Invoices",subtitle:"Live \xb7 Viewing ".concat(Ye.label.toLowerCase()," invoices"),live:!0,action:(0,D.jsxs)(d.A,{sx:{display:"inline-flex",alignItems:"center",gap:1,px:1.5,py:.875,borderRadius:999,bgcolor:"#ffffff",border:"1.5px solid ".concat(X(_)),color:_,fontWeight:800,fontSize:12},children:[(0,D.jsx)(S.YHz,{size:14}),(0,D.jsx)(x.A,{variant:"caption",sx:{fontWeight:800,color:B,letterSpacing:.4,textTransform:"uppercase"},children:"Grand Total"}),(0,D.jsx)(x.A,{sx:{fontWeight:800,color:_,fontSize:13},children:Q(Ie)})]})}),(0,D.jsx)(h.Ay,{container:!0,spacing:{xs:2,md:2.5},sx:{mb:{xs:1.5,md:2}},children:Re.map((e=>{const o=e.icon;return(0,D.jsx)(h.Ay,{item:!0,xs:6,sm:6,md:3,children:(0,D.jsx)(d.A,{onClick:()=>{se(e.idx),re(0)},sx:{cursor:"pointer",height:"100%"},children:(0,D.jsx)(Y.A,{title:e.label,value:e.value,icon:(0,D.jsx)(o,{size:20}),color:e.color,loading:pe})})},e.idx)}))}),(0,D.jsx)(u.A,{elevation:0,sx:{mt:{xs:1.5,md:2},p:{xs:1,md:1.5},borderTopLeftRadius:L/8,borderTopRightRadius:L/8,borderBottomLeftRadius:0,borderBottomRightRadius:0,border:"1px solid",borderColor:N,borderBottom:0,background:"#fff"},children:(0,D.jsxs)(f.A,{direction:"row",alignItems:"center",justifyContent:"space-between",gap:1.5,sx:{flexWrap:"wrap-reverse"},children:[(0,D.jsx)(f.A,{direction:"row",spacing:.75,sx:{flex:1,overflowX:"auto",py:.5,px:.25,"&::-webkit-scrollbar":{height:6},"&::-webkit-scrollbar-thumb":{backgroundColor:N,borderRadius:4}},children:Z.map((e=>{var o;const r=J[e],n=r.icon,i=te===e,t=null!==(o=null===fe||void 0===fe?void 0:fe[r.countKey])&&void 0!==o?o:0;return(0,D.jsxs)(d.A,{onClick:()=>{se(e),re(0)},sx:{display:"inline-flex",alignItems:"center",gap:{xs:.625,md:.875},pl:.5,pr:{xs:1,md:1.25},py:.5,flexShrink:0,cursor:"pointer",borderRadius:999,border:"1px solid ".concat(i?r.color:N),bgcolor:i?r.color:K,color:i?"#fff":B,fontWeight:600,boxShadow:"none",transition:"background-color 0.15s, border-color 0.15s, color 0.15s","&:hover":{borderColor:i?r.color:"#cbd5e1",bgcolor:i?r.color:O}},children:[(0,D.jsx)(c.A,{sx:{width:{xs:20,md:22},height:{xs:20,md:22},bgcolor:i?"rgba(255,255,255,0.22)":q(r.color),color:i?"#fff":r.color},children:(0,D.jsx)(n,{size:12})}),(0,D.jsx)(x.A,{variant:"caption",sx:{fontWeight:600,fontSize:{xs:11.5,md:13},lineHeight:1},children:r.label}),(0,D.jsx)(d.A,{sx:{minWidth:{xs:20,md:24},height:{xs:18,md:20},px:.625,display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:999,fontSize:{xs:10,md:11},fontWeight:700,bgcolor:i?"rgba(255,255,255,0.22)":O,color:i?"#fff":B,border:"none"},children:t})]},e)}))}),(0,D.jsx)(d.A,{sx:{width:{xs:"100%",sm:240,lg:280},flex:{xs:"1 1 100%",sm:"0 0 auto"}},children:(0,D.jsx)(z.A,{value:ae,onChange:de,onDebouncedChange:ue,placeholder:"Search invoices (ctrl+k)",sx:{m:0,width:"100%",borderRadius:999,bgcolor:"#ffffff","& fieldset":{borderColor:"#e2e8f0",borderWidth:1},"&:hover fieldset":{borderColor:"#cbd5e1"},"&.Mui-focused fieldset":{borderColor:"#662582",borderWidth:1.5},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat((Me=_,G(Me,"26")))}}})})]})}),(0,D.jsxs)(u.A,{elevation:0,sx:{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:L/8,borderBottomRightRadius:L/8,border:"1px solid",borderColor:N,overflow:"hidden",background:"#fff"},children:[ee?(0,D.jsx)(D.Fragment,{children:be?(0,D.jsx)(d.A,{sx:{p:1.5},children:(0,D.jsx)(M.r,{col:4})}):0===We.length?(0,D.jsxs)(f.A,{alignItems:"center",spacing:1.5,sx:{py:6,px:2},children:[(0,D.jsx)(c.A,{sx:{width:64,height:64,bgcolor:q("#94a3b8"),color:H},children:(0,D.jsx)(S.GdF,{size:28})}),(0,D.jsx)(x.A,{variant:"subtitle1",sx:{fontWeight:700,color:F},children:"No invoices to show"}),(0,D.jsx)(x.A,{variant:"caption",sx:{color:B,textAlign:"center"},children:ae?"Try a different keyword.":"No ".concat(Ye.label.toLowerCase()," invoices for this filter.")})]}):(0,D.jsx)(T.nV,{children:We.map(((e,o)=>{var r;const n=2===te||e.duedate&&l()(e.duedate).isBefore(l()(),"day")&&3!==te;return(0,D.jsx)(T.pg,{accent:_,header:(0,D.jsxs)(f.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,D.jsxs)(f.A,{direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0},children:[(0,D.jsx)(V,{color:_,size:36,children:(0,D.jsx)(S.Itr,{size:18})}),(0,D.jsxs)(f.A,{spacing:.25,sx:{minWidth:0},children:[(0,D.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:F},noWrap:!0,children:e.tenantname||"\u2014"}),e.contactperson&&(0,D.jsx)(x.A,{variant:"caption",sx:{color:B},noWrap:!0,children:e.contactperson})]})]}),(0,D.jsx)(p.A,{title:"Preview invoice",placement:"left",children:(0,D.jsx)(g.A,{size:"small",onClick:()=>{ce(!0),setTimeout((()=>{ce(!1),P("/nearle/invoice/preview",{state:e})}),500)},sx:{flexShrink:0,bgcolor:q(_),color:_,border:"1px solid ".concat(X(_)),"&:hover":{bgcolor:_,color:"#fff"}},children:(0,D.jsx)(S.U3x,{size:16})})})]}),children:(0,D.jsxs)(T.FG,{children:[(0,D.jsx)(T.pY,{label:"Invoice ID",children:(0,D.jsxs)(d.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:U("#0ea5e9"),border:"1px solid ".concat(X("#0ea5e9")),color:"#0ea5e9",fontSize:11,fontWeight:800},children:[(0,D.jsx)(S.GdF,{size:12})," ",e.invoiceno||"\u2014"]})}),(0,D.jsx)(T.pY,{label:"Amount",align:"right",children:(0,D.jsxs)(d.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:"#ffffff",border:"1px solid ".concat(X(_)),color:_,fontSize:11,fontWeight:800,justifyContent:"center"},children:[(0,D.jsx)(S.YHz,{size:11}),Q(e.totalamount).replace("\u20b9","").trim()]})}),(0,D.jsx)(T.pY,{label:"Invoice Date",children:(0,D.jsxs)(f.A,{direction:"row",alignItems:"center",spacing:.5,children:[(0,D.jsx)(S.auT,{size:12,color:H}),(0,D.jsx)(x.A,{variant:"caption",sx:{fontWeight:700,color:F},noWrap:!0,children:e.transactiondate?l()(e.transactiondate).format("DD/MM/YYYY"):"\u2014"})]})}),(0,D.jsx)(T.pY,{label:"Due Date",children:(0,D.jsxs)(f.A,{direction:"row",alignItems:"center",spacing:.5,children:[(0,D.jsx)(S.auT,{size:12,color:n&&3!==te?"#ef4444":H}),(0,D.jsx)(x.A,{variant:"caption",sx:{fontWeight:700,color:n&&3!==te?"#ef4444":F},noWrap:!0,children:e.duedate?l()(e.duedate).format("DD/MM/YYYY"):"\u2014"})]})}),(0,D.jsx)(T.pY,{label:"Items",children:(0,D.jsxs)(d.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:.875,py:.25,borderRadius:999,bgcolor:U("#14b8a6"),border:"1px solid ".concat(X("#14b8a6")),color:"#14b8a6",fontSize:11,fontWeight:800,minWidth:44,justifyContent:"center"},children:[(0,D.jsx)(S.gsJ,{size:11})," ",null!==(r=e.itemcount)&&void 0!==r?r:0]})})]})},e.invoiceno||o)}))})}):(0,D.jsx)(m.A,{sx:{maxHeight:{xs:"calc(100vh - 220px)",md:"calc(100vh - 190px)"},"&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-thumb":{backgroundColor:X(_),borderRadius:8,"&:hover":{backgroundColor:_}},"&::-webkit-scrollbar-track":{backgroundColor:O}},children:(0,D.jsxs)(j.A,{stickyHeader:!0,sx:{minWidth:{xs:880,md:1060}},children:[(0,D.jsx)(b.A,{children:(0,D.jsxs)(A.A,{sx:{"& th":{backgroundColor:O,color:B,fontSize:{xs:10,md:11},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(N),py:{xs:1,md:1.25},px:{xs:1,md:2}}},children:[(0,D.jsx)(v.A,{children:"#"}),(0,D.jsx)(v.A,{children:"Client"}),(0,D.jsx)(v.A,{children:"Invoice ID"}),(0,D.jsx)(v.A,{children:"Invoice Date"}),(0,D.jsx)(v.A,{children:"Due Date"}),(0,D.jsx)(v.A,{align:"center",children:"Items"}),(0,D.jsx)(v.A,{align:"right",children:"Amount"}),(0,D.jsx)(v.A,{align:"center",children:"Action"})]})}),(0,D.jsxs)(w.A,{children:[be&&(0,D.jsx)(M.r,{col:4}),be||0!==We.length?We.map(((e,o)=>{var r;const n=2===te||e.duedate&&l()(e.duedate).isBefore(l()(),"day")&&3!==te;return(0,D.jsxs)(A.A,{sx:{transition:"background-color 0.15s","& td":{borderBottom:"1px solid ".concat(E),py:{xs:1,md:1.5},px:{xs:1,md:2},verticalAlign:"top"},"&:hover":{backgroundColor:O}},children:[(0,D.jsx)(v.A,{children:(0,D.jsx)(x.A,{variant:"caption",sx:{fontWeight:700,color:H},children:String(Se*ne+o+1).padStart(2,"0")})}),(0,D.jsx)(v.A,{children:(0,D.jsxs)(f.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,D.jsx)(V,{color:_,size:36,children:(0,D.jsx)(S.Itr,{size:18})}),(0,D.jsxs)(f.A,{spacing:.25,sx:{minWidth:0},children:[(0,D.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:F,whiteSpace:"nowrap"},children:e.tenantname||"\u2014"}),e.contactperson&&(0,D.jsx)(x.A,{variant:"caption",sx:{color:B},children:e.contactperson})]})]})}),(0,D.jsx)(v.A,{children:(0,D.jsxs)(d.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:U("#0ea5e9"),border:"1px solid ".concat(X("#0ea5e9")),color:"#0ea5e9",fontSize:11,fontWeight:800},children:[(0,D.jsx)(S.GdF,{size:12})," ",e.invoiceno||"\u2014"]})}),(0,D.jsx)(v.A,{children:(0,D.jsxs)(f.A,{spacing:.25,children:[(0,D.jsxs)(f.A,{direction:"row",alignItems:"center",spacing:.5,children:[(0,D.jsx)(S.auT,{size:12,color:H}),(0,D.jsx)(x.A,{variant:"caption",sx:{fontWeight:700,color:F,whiteSpace:"nowrap"},children:e.transactiondate?l()(e.transactiondate).format("DD/MM/YYYY"):"\u2014"})]}),(0,D.jsx)(x.A,{variant:"caption",sx:{color:B,pl:2},children:e.transactiondate?l()(e.transactiondate).utc().format("hh:mm A"):""})]})}),(0,D.jsx)(v.A,{children:(0,D.jsxs)(f.A,{spacing:.25,children:[(0,D.jsxs)(f.A,{direction:"row",alignItems:"center",spacing:.5,children:[(0,D.jsx)(S.auT,{size:12,color:n&&3!==te?"#ef4444":H}),(0,D.jsx)(x.A,{variant:"caption",sx:{fontWeight:700,color:n&&3!==te?"#ef4444":F,whiteSpace:"nowrap"},children:e.duedate?l()(e.duedate).format("DD/MM/YYYY"):"\u2014"})]}),(0,D.jsx)(x.A,{variant:"caption",sx:{color:B,pl:2},children:e.duedate?l()(e.duedate).utc().format("hh:mm A"):""})]})}),(0,D.jsx)(v.A,{align:"center",children:(0,D.jsxs)(d.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:.875,py:.25,borderRadius:999,bgcolor:U("#14b8a6"),border:"1px solid ".concat(X("#14b8a6")),color:"#14b8a6",fontSize:11,fontWeight:800,minWidth:44,justifyContent:"center"},children:[(0,D.jsx)(S.gsJ,{size:11})," ",null!==(r=e.itemcount)&&void 0!==r?r:0]})}),(0,D.jsx)(v.A,{align:"right",children:(0,D.jsxs)(d.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:"#ffffff",border:"1px solid ".concat(X(_)),color:_,fontSize:11,fontWeight:800,minWidth:110,justifyContent:"center"},children:[(0,D.jsx)(S.YHz,{size:11}),Q(e.totalamount).replace("\u20b9","").trim()]})}),(0,D.jsx)(v.A,{align:"center",children:(0,D.jsx)(p.A,{title:"Preview invoice",placement:"left",children:(0,D.jsx)(g.A,{size:"small",onClick:()=>{ce(!0),setTimeout((()=>{ce(!1),P("/nearle/invoice/preview",{state:e})}),500)},sx:{bgcolor:q(_),color:_,border:"1px solid ".concat(X(_)),"&:hover":{bgcolor:_,color:"#fff"}},children:(0,D.jsx)(S.U3x,{size:16})})})})]},e.invoiceno||o)})):(0,D.jsx)(A.A,{children:(0,D.jsx)(v.A,{colSpan:8,sx:{py:6},children:(0,D.jsxs)(f.A,{alignItems:"center",spacing:1.5,children:[(0,D.jsx)(c.A,{sx:{width:64,height:64,bgcolor:q("#94a3b8"),color:H},children:(0,D.jsx)(S.GdF,{size:28})}),(0,D.jsx)(x.A,{variant:"subtitle1",sx:{fontWeight:700,color:F},children:"No invoices to show"}),(0,D.jsx)(x.A,{variant:"caption",sx:{color:B},children:ae?"Try a different keyword.":"No ".concat(Ye.label.toLowerCase()," invoices for this filter.")})]})})})]})]})}),(0,D.jsx)(y.A,{}),(0,D.jsxs)(f.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",sx:{px:2,py:1,background:"#ffffff"},children:[(0,D.jsxs)(x.A,{variant:"caption",sx:{fontWeight:800,color:B,letterSpacing:.6,textTransform:"uppercase"},children:["Page total \xb7 ",Q(ze)]}),(0,D.jsx)(k.A,{rowsPerPageOptions:[5,10,25,100],component:"div",count:Ce.length,rowsPerPage:ne,page:Se,onPageChange:(e,o)=>re(o),onRowsPerPageChange:e=>{var o;ie(+(null===e||void 0===e||null===(o=e.target)||void 0===o?void 0:o.value)),re(0)},sx:{"& .MuiTablePagination-toolbar":{minHeight:40,px:0},"& .MuiTablePagination-selectLabel, & .MuiTablePagination-displayedRows":{fontWeight:700,color:B}}})]})]}),(0,D.jsx)(i.sv,{})]});var Me}},27001:(e,o,r)=>{r.d(o,{A:()=>l});var n=r(93230),i=r(16491),t=r(82053),s=r(44414);function l(e){let{title:o,subtitle:r,live:l=!1,action:c}=e;return(0,s.jsxs)(n.A,{direction:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",sm:"center"},spacing:1.5,sx:{mb:{xs:2,md:2.5}},children:[(0,s.jsxs)(i.A,{sx:{minWidth:0},children:[(0,s.jsx)(t.A,{variant:"h3",sx:{fontWeight:700,letterSpacing:"-0.02em",color:"grey.800"},children:o}),r&&(0,s.jsxs)(n.A,{direction:"row",alignItems:"center",spacing:.75,sx:{mt:.5},children:[l&&(0,s.jsx)(i.A,{sx:{width:7,height:7,borderRadius:"50%",bgcolor:"success.main",boxShadow:"0 0 0 3px rgba(16,185,129,0.18)"}}),(0,s.jsx)(t.A,{variant:"caption",sx:{color:"text.secondary",fontWeight:500},children:r})]})]}),c&&(0,s.jsx)(i.A,{sx:{flexShrink:0,width:{xs:"100%",sm:"auto"}},children:c})]})}},36803:(e,o,r)=>{r.d(o,{A:()=>x});var n=r(48089),i=r(50704),t=r(93230),s=r(16491),l=r(82053),c=r(82917),a=r(41413),d=r(44414);function x(e){let{title:o,value:r,icon:x,color:h="#662582",caption:u,loading:f=!1}=e;return(0,d.jsx)(n.A,{sx:{height:"100%"},children:(0,d.jsx)(i.A,{sx:{p:{xs:1.75,md:2},"&:last-child":{pb:{xs:1.75,md:2}}},children:(0,d.jsxs)(t.A,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:1,children:[(0,d.jsxs)(s.A,{sx:{minWidth:0,flex:1},children:[(0,d.jsx)(l.A,{variant:"body2",sx:{fontWeight:500,color:"text.secondary",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o}),f?(0,d.jsx)(c.A,{variant:"rounded",sx:{width:72,height:30,mt:.5},animation:"wave"}):(0,d.jsx)(l.A,{sx:{mt:.25,fontWeight:700,letterSpacing:"-0.015em",color:"grey.800",lineHeight:1.15,fontSize:{xs:"1.375rem",md:"1.5rem"},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r}),u&&(0,d.jsx)(l.A,{variant:"caption",sx:{display:"block",mt:.5,color:"text.secondary"},children:u})]}),x&&(0,d.jsx)(a.A,{variant:"rounded",sx:{width:42,height:42,borderRadius:2,bgcolor:"".concat(h,"14"),color:h,flexShrink:0},children:x})]})})})}},56311:(e,o,r)=>{r.d(o,{A:()=>u});var n=r(89379),i=r(9950),t=r(2660),s=r(2046),l=r(83274),c=r(25333),a=r(97125),d=r(7762),x=r(52097),h=r(44414);const u=e=>{let{value:o,onChange:r,onDebouncedChange:u,debounceTime:f=500,placeholder:p="Search (ctrl+k)",sx:g}=e;const m=(0,i.useRef)(null),[j]=(0,x.d7)(o,f);return(0,i.useEffect)((()=>{u&&u(j)}),[j,u]),(0,i.useEffect)((()=>{const e=e=>{var o;"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),null===(o=m.current)||void 0===o||o.focus());"Escape"===e.key&&document.activeElement===m.current&&m.current.blur()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,h.jsx)(t.A,{sx:(0,n.A)({},g),inputRef:m,placeholder:p,autoComplete:"off",value:o,fullWidth:!0,onChange:e=>r(e.target.value),startAdornment:(0,h.jsx)(s.A,{position:"start",sx:{mr:-.5},children:(0,h.jsx)(a.A,{})}),endAdornment:(0,h.jsx)(l.A,{title:"Clear",children:(0,h.jsx)(c.A,{sx:{visibility:o?"visible":"hidden"},onClick:()=>r(""),children:(0,h.jsx)(d.A,{})})})})}},96646:(e,o,r)=>{r.d(o,{r:()=>c});var n=r(9213),i=r(21671),t=r(82917),s=r(93230),l=r(44414);const c=e=>{let{rowsPerPage:o=5,col:r=1}=e;return(0,l.jsx)(l.Fragment,{children:Array.from(new Array(o)).map(((e,o)=>(0,l.jsxs)(n.A,{children:[(0,l.jsx)(i.A,{children:(0,l.jsx)(t.A,{variant:"circular",width:24,height:24})}),(0,l.jsx)(i.A,{children:(0,l.jsx)(t.A,{variant:"text",width:30})}),Array.from({length:r}).map(((e,o)=>(0,l.jsx)(i.A,{children:(0,l.jsxs)(s.A,{spacing:.5,children:[(0,l.jsx)(t.A,{variant:"text",width:100}),(0,l.jsx)(t.A,{variant:"text",width:80})]})},o))),(0,l.jsx)(i.A,{children:(0,l.jsx)(t.A,{variant:"text",width:150})}),(0,l.jsx)(i.A,{children:(0,l.jsx)(t.A,{variant:"rounded",width:60,height:24})}),(0,l.jsx)(i.A,{align:"center",children:(0,l.jsxs)(s.A,{direction:"row",spacing:1,justifyContent:"flex-end",children:[(0,l.jsx)(t.A,{variant:"circular",width:28,height:28}),(0,l.jsx)(t.A,{variant:"circular",width:28,height:28})]})})]},o)))})}}}]);