/**
 * Skipped minification because the original files appears to be already minified.
 * Original file: /npm/intureact@2.2.1/dist/index.cjs.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
Object.defineProperty(exports,'__esModule',{value:!0});var e=require('react/jsx-runtime'),t=require('react'),r=require('@mui/material'),i=require('@mui/material/styles'),o=require('@mui/material/Pagination'),n=require('react-sortablejs'),a=require('@mui/material/Box'),l=require('@mui/material/IconButton'),s=require('@mui/material/Tooltip'),d=require('@mui/material/Button'),c=require('@mui/material/Dialog'),p=require('@mui/material/DialogActions'),x=require('@mui/material/DialogContent'),h=require('@mui/material/Typography'),u=require('@mui/material/SvgIcon'),m=require('@mui/material/Checkbox'),g=require('lottie-react'),f=require('react-toastify');require('react-toastify/dist/ReactToastify.css');var y=require('@mui/material/Badge'),b=require('@mui/material/Breadcrumbs'),j=require('@mui/material/Link'),C=require('@mui/material/Tab'),k=require('@mui/material/Tabs'),w=require('date-fns'),v=require('react-calendar'),S=require('@mui/material/InputBase'),D=require('react-window'),F=require('@mui/material/utils/useId'),A=require('date-fns/esm'),M=require('@mui/material/Radio'),B=require('@mui/material/Switch'),z=require('@mui/icons-material'),L=require('react-final-form'),T=require('@mui/material/Paper'),I=require('@tanstack/react-table'),E=require('@mui/material/Grid'),R=require('@mui/material/TableRow'),P=require('@mui/material/TableCell'),H=require('@mui/icons-material/MoreVert'),V=require('@mui/material/styles/useTheme'),O=require('@mui/material/Snackbar'),W=require('@mui/material/ButtonGroup'),q=require('@mui/icons-material/ArrowDropDown'),$=require('@mui/material/MenuItem'),N=require('@mui/material/MenuList'),_=require('victory'),G=require('xlsx'),Z=require('@mui/x-data-grid/components'),Y=require('@mui/x-data-grid');function U(e){return e&&'object'==typeof e&&'default'in e?e:{default:e}}function K(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((r=>{if('default'!==r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:()=>e[r]})}})),t.default=e,Object.freeze(t)}var J=K(t),X=U(t),Q=U(o),ee=U(a),te=U(l),re=U(s),ie=U(d),oe=U(c),ne=U(p),ae=U(x),le=U(h),se=U(u),de=U(m),ce=U(g),pe=U(y),xe=U(b),he=U(j),ue=U(C),me=U(k),ge=U(v),fe=U(S),ye=U(F),be=U(M),je=U(B),Ce=U(T),ke=U(E),we=U(R),ve=U(P),Se=U(H),De=U(V),Fe=U(O),Ae=U(W),Me=U(q),Be=U($),ze=U(N),Le=r.styled(r.createSvgIcon(e.jsxs(J.Fragment,{children:[e.jsx('path',{stroke:'currentColor',strokeMiterlimit:'10',strokeWidth:'1.2',d:'M18.37 22H6.296A3.292 3.292 0 0 1 3 18.714V6.686A3.292 3.292 0 0 1 6.297 3.4h12.058a3.292 3.292 0 0 1 3.297 3.286V18.7A3.274 3.274 0 0 1 18.37 22ZM3 7.971h18.667'}),e.jsx('path',{stroke:'currentColor',strokeLinecap:'round',strokeMiterlimit:'10',strokeWidth:'1.2',d:'M7.545 3.4V2m9.577 1.4V2'}),e.jsx('path',{fill:'currentColor',d:'M7.702 12.4a.83.83 0 0 0 .832-.829.83.83 0 0 0-.832-.828.83.83 0 0 0-.831.828.83.83 0 0 0 .831.829Zm4.631 0a.83.83 0 0 0 .832-.829.83.83 0 0 0-.832-.828.83.83 0 0 0-.831.828.83.83 0 0 0 .831.829Zm4.631 0a.83.83 0 0 0 .832-.829.83.83 0 0 0-.832-.828.83.83 0 0 0-.832.828.83.83 0 0 0 .832.829Zm-9.262 3.243a.83.83 0 0 0 .832-.829.83.83 0 0 0-.832-.828.83.83 0 0 0-.831.828.83.83 0 0 0 .831.829Zm4.631 0a.83.83 0 0 0 .832-.829.83.83 0 0 0-.832-.828.83.83 0 0 0-.831.828.83.83 0 0 0 .831.829Zm4.631 0a.83.83 0 0 0 .832-.829.83.83 0 0 0-.832-.828.83.83 0 0 0-.832.828.83.83 0 0 0 .832.829ZM7.702 18.9a.83.83 0 0 0 .832-.829.83.83 0 0 0-.832-.828.83.83 0 0 0-.831.828.83.83 0 0 0 .831.829Zm4.631 0a.83.83 0 0 0 .832-.829.83.83 0 0 0-.832-.828.83.83 0 0 0-.831.828.83.83 0 0 0 .831.829Zm4.631 0a.83.83 0 0 0 .832-.829.83.83 0 0 0-.832-.828.83.83 0 0 0-.832.828.83.83 0 0 0 .832.829Z'})]}),'Calender'))({fill:'transparent'}),Te=r.styled(r.createSvgIcon(e.jsx(J.Fragment,{children:e.jsx('path',{stroke:'currentColor',strokeLinecap:'round',strokeLinejoin:'round',strokeMiterlimit:'10',strokeWidth:'1.4',d:'M12.2929 5.29289C12.6834 4.90237 13.3166 4.90237 13.7071 5.29289C14.0976 5.68342 14.0976 6.31658 13.7071 6.70711L8.70711 11.7071C8.31658 12.0976 7.68342 12.0976 7.29289 11.7071L2.29289 6.70711C1.90237 6.31658 1.90237 5.68342 2.29289 5.29289C2.68342 4.90237 3.31658 4.90237 3.70711 5.29289L8 9.58579L12.2929 5.29289Z'})}),'ChevronDown'))((({strokeWidth:e})=>({strokeWidth:e||1.4,fill:'transparent'}))),Ie=r.styled(r.createSvgIcon(e.jsx(J.Fragment,{children:e.jsx('path',{stroke:'currentColor',strokeLinecap:'round',strokeLinejoin:'round',strokeMiterlimit:'10',strokeWidth:'1.4',d:'M16.835 2 7 11.965 16.835 22'})}),'ChevronLeft'))({fill:'transparent'}),Ee=r.styled(r.createSvgIcon(e.jsx(J.Fragment,{children:e.jsx('path',{stroke:'currentColor',strokeLinecap:'round',strokeLinejoin:'round',strokeMiterlimit:'10',strokeWidth:'1.4',d:'m7 2 10.18 10.314L7 22.701'})}),'ChevronRight'))({fill:'transparent'}),Re=r.styled(r.createSvgIcon(e.jsx(J.Fragment,{children:e.jsx('path',{stroke:'currentColor',strokeLinecap:'round',strokeLinejoin:'round',strokeMiterlimit:'10',strokeWidth:'1.4',d:'M2 17.18 12.314 7 22.7 17.18'})}),'ChevronUp'))({fill:'transparent'}),Pe=r.styled(r.createSvgIcon(e.jsxs(J.Fragment,{children:[e.jsx('mask',{id:'colSelectorOutlinedA',fill:'transparent',children:e.jsx('rect',{width:'4.961',height:'17.778',x:'2',y:'3',rx:'.5'})}),e.jsx('rect',{width:'4.961',height:'17.778',x:'2',y:'3',stroke:'currentColor',strokeWidth:'2',mask:'url(#colSelectorOutlinedA)',rx:'.5'}),e.jsx('mask',{id:'colSelectorOutlinedB',fill:'transparent',children:e.jsx('rect',{width:'4.961',height:'17.778',x:'9.519',y:'3',rx:'.5'})}),e.jsx('rect',{width:'4.961',height:'17.778',x:'9.519',y:'3',stroke:'currentColor',strokeWidth:'2',mask:'url(#colSelectorOutlinedB)',rx:'.5'}),e.jsx('mask',{id:'colSelectorOutlinedC',fill:'transparent',children:e.jsx('rect',{width:'4.961',height:'17.778',x:'17.039',y:'3',rx:'.5'})}),e.jsx('rect',{width:'4.961',height:'17.778',x:'17.039',y:'3',stroke:'currentColor',strokeWidth:'2',mask:'url(#colSelectorOutlinedC)',rx:'.5'})]}),'ColumnSelector'))({fill:'transparent',stroke:'white'}),He=r.styled(r.createSvgIcon(e.jsxs(J.Fragment,{children:[e.jsx('path',{d:'M21.6706 2L11.8353 11.9647L21.6706 22',stroke:'currentColor',strokeWidth:'1.4',strokeMiterlimit:'10',strokeLinecap:'round',strokeLinejoin:'round'}),e.jsx('path',{d:'M11.8353 2L2 11.9647L11.8353 22',stroke:'currentColor',strokeWidth:'1.4',strokeMiterlimit:'10',strokeLinecap:'round',strokeLinejoin:'round'})]}),'DoubleChevronLeft'))({fill:'transparent'}),Ve=r.styled(r.createSvgIcon(e.jsxs(J.Fragment,{children:[e.jsx('path',{d:'M2 2L12.1801 12.314L2 22.7011',stroke:'currentColor',strokeWidth:'1.4',strokeMiterlimit:'10',strokeLinecap:'round',strokeLinejoin:'round'}),e.jsx('path',{d:'M12 2L22.1801 12.314L12 22.7011',stroke:'currentColor',strokeWidth:'1.4',strokeMiterlimit:'10',strokeLinecap:'round',strokeLinejoin:'round'})]}),'DoubleChevronRight'))({fill:'transparent'}),Oe=r.styled(r.createSvgIcon(e.jsxs(J.Fragment,{children:[e.jsx('path',{stroke:'currentColor',strokeLinecap:'round',strokeLinejoin:'round',strokeMiterlimit:'10',strokeWidth:'1.2',d:'M16.157 19.05v2.207a.753.753 0 0 1-.756.756H2.756A.753.753 0 0 1 2 21.257V2.756C2 2.33 2.342 2 2.756 2h7.108c.212 0 .413.094.566.248l5.538 6.104c.13.142.2.319.2.508v6.671'}),e.jsx('path',{stroke:'currentColor',strokeLinecap:'round',strokeLinejoin:'round',strokeMiterlimit:'10',strokeWidth:'1.2',d:'M9.686 2.06v6.446c0 .425.343.755.756.755h5.727m-5.184 8.029H21.47l-2.621-2.68m2.621 2.68-2.61 2.61'})]}),'Export'))({fill:'transparent'}),We=r.styled(r.createSvgIcon(e.jsxs(J.Fragment,{children:[e.jsx('path',{stroke:'currentColor',strokeLinecap:'round',strokeMiterlimit:'10',strokeWidth:'1.2',d:'M22.031 8.64c.352.98.546 2.03.546 3.125 0 5.339-4.6 9.674-10.294 9.674-2.72 0-5.184-.993-7.03-2.601'}),e.jsx('path',{stroke:'currentColor',strokeLinecap:'round',strokeLinejoin:'round',strokeMiterlimit:'10',strokeWidth:'1.2',d:'m5.326 21.53-.315-2.92 3.095-.308'}),e.jsx('path',{stroke:'currentColor',strokeLinecap:'round',strokeMiterlimit:'10',strokeWidth:'1.2',d:'M2.51 14.788A9.218 9.218 0 0 1 2 11.765c0-5.339 4.601-9.674 10.295-9.674 2.719 0 5.183.993 7.029 2.601'}),e.jsx('path',{stroke:'currentColor',strokeLinecap:'round',strokeLinejoin:'round',strokeMiterlimit:'10',strokeWidth:'1.2',d:'m19.251 2 .328 2.92-3.108.308'})]}),'Refresh'))({fill:'transparent'}),qe=r.styled(r.createSvgIcon(e.jsxs(J.Fragment,{children:[e.jsx('line',{x1:'3.65',y1:'8.35',x2:'20.35',y2:'8.35',stroke:'#666666','stroke-width':'1.3','stroke-linecap':'round'}),e.jsx('line',{x1:'3.65',y1:'15.35',x2:'20.35',y2:'15.35',stroke:'#666666','stroke-width':'1.3','stroke-linecap':'round'})]}),'ReorderColumn'))({fill:'transparent'}),$e=r.styled(r.createSvgIcon(e.jsxs(J.Fragment,{children:[e.jsx('path',{stroke:'currentColor',strokeLinecap:'round',strokeLinejoin:'round',strokeMiterlimit:'10',strokeWidth:'1.1',d:'M17.623 20.5V6m3.623 10.877L17.623 20.5 14 16.877'}),e.jsx('path',{fill:'currentColor',d:'M8.473 19.803H5.971L5.557 21H4.234l2.259-6.291H7.96L10.219 21H8.887l-.414-1.197Zm-.342-1.008-.909-2.628-.909 2.628h1.818ZM6.908 9.938h2.826V11H5.45v-.972L8.258 5.78H5.45V4.718h4.284v.972L6.908 9.938Z'})]}),'SortDown'))({fill:'transparent'}),Ne=r.styled(r.createSvgIcon(e.jsxs(J.Fragment,{children:[e.jsx('path',{stroke:'currentColor',strokeLinecap:'round',strokeLinejoin:'round',strokeMiterlimit:'10',strokeWidth:'1.1',d:'M16.623 5v14.5M13 8.623 16.623 5l3.623 3.623'}),e.jsx('path',{fill:'currentColor',d:'M7.473 8.803H4.971L4.557 10H3.234l2.259-6.291H6.96L9.219 10H7.887l-.414-1.197Zm-.342-1.008-.909-2.628-.909 2.628h1.818ZM4.908 18.938h2.826V20H3.45v-.972l2.808-4.248H3.45v-1.062h4.284v.972l-2.826 4.248Z'})]}),'SortUp'))({fill:'transparent'}),_e=r.styled(r.createSvgIcon(e.jsx(J.Fragment,{children:e.jsx('path',{stroke:'currentColor',strokeLinecap:'round',strokeLinejoin:'round',strokeMiterlimit:'10',strokeWidth:'1.2',d:'m2 13.217 4.059 4.036a2.563 2.563 0 0 0 3.618 0L22 5'})}),'Tick'))({fill:'transparent'}),Ge=r.styled(r.createSvgIcon(e.jsxs(J.Fragment,{children:[e.jsx('g',{stroke:'currentColor',strokeLinecap:'round',strokeMiterlimit:'10',clipPath:'url(#a)',children:e.jsx('path',{d:'M2.4 20.064h9.527m4.726-7.032H2.4m0 0L4.653 10.8M2.4 13.032 4.653 15M2.4 6h18.903'})}),e.jsx('defs',{children:e.jsx('clipPath',{id:'a',children:e.jsx('path',{fill:'transparent',d:'M0 0h24v24H0z'})})})]}),'BurgerMenuCollapse'))({fill:'transparent'}),Ze=r.styled(r.createSvgIcon(e.jsxs(J.Fragment,{children:[e.jsx('g',{stroke:'currentColor',strokeLinecap:'round',strokeMiterlimit:'10',clipPath:'url(#a)',children:e.jsx('path',{d:'M2.4 20.064h9.527M2.4 13.032h14.253m0 0L14.4 10.8m2.253 2.232L14.4 15m-12-9h18.903'})}),e.jsx('defs',{children:e.jsx('clipPath',{id:'a',children:e.jsx('path',{fill:'transparent',d:'M0 0h24v24H0z'})})})]}),'BurgerMenuExpand'))({fill:'transparent'});const Ye=({color:t,htmlColor:i,sx:o,...n})=>e.jsx(r.SvgIcon,{viewBox:'0 0 24 24',sx:{...o,fill:'none'},...n,children:e.jsx('path',{d:'M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z',fill:'transparent',stroke:t||'currentColor',strokeMiterlimit:'10',strokeLinecap:'round'})});var Ue=r.styled(r.createSvgIcon(e.jsxs(J.Fragment,{children:[e.jsx('path',{d:'M7.99967 14.6668C11.6816 14.6668 14.6663 11.6821 14.6663 8.00016C14.6663 4.31826 11.6816 1.3335 7.99967 1.3335C4.31778 1.3335 1.33301 4.31826 1.33301 8.00016C1.33301 11.6821 4.31778 14.6668 7.99967 14.6668Z',stroke:'#A1A1A1',strokeWidth:'1.2',strokeLinecap:'round',strokeLinejoin:'round'}),e.jsx('path',{d:'M8 10.6667V8',stroke:'#A1A1A1',strokeWidth:'1.3',strokeLinecap:'round',strokeLinejoin:'round'}),e.jsx('path',{d:'M8 5.3335H8.00667',stroke:'#A1A1A1',strokeWidth:'1.6',strokeLinecap:'round',strokeLinejoin:'round'})]}),'Info'))((({strokeWidth:e,stroke:t})=>({strokeWidth:e||1.4,fill:'transparent',stroke:t||'currentcolor'})));r.styled(r.createSvgIcon(e.jsx(J.Fragment,{children:e.jsx('path',{stroke:'currentColor',strokeLinecap:'round',strokeLinejoin:'round',strokeMiterlimit:'10',strokeWidth:'1.2',d:'M4 5.138h16.585M16 2H8.585l-.893 3.154h9.2L16 2Zm.215 20H8.4c-1.015 0-1.846-.8-1.892-1.815L5.985 7.692H18.6l-.492 12.477A1.888 1.888 0 0 1 16.215 22ZM10.63 11.43v6.97m3.324-6.97v6.97'})}),'Dustbin'))({fill:'transparent'});const Ke=()=>e.jsx(He,{fontSize:'small',sx:{fill:'none !important',color:'primary.main',fontSize:'10px'}}),Je=()=>e.jsx(Ve,{fontSize:'small',sx:{fill:'none !important',color:'primary.main',fontSize:'10px'}}),Xe=()=>e.jsx(Ie,{fontSize:'small',sx:{fill:'none !important',color:'primary.main',fontSize:'10px'}}),Qe=()=>e.jsx(Ee,{fontSize:'small',sx:{fill:'none !important',color:'primary.main',fontSize:'10px'}}),et=({onPageChange:t,count:i=1,page:o=1,...n})=>e.jsx(Q.default,{count:i,page:o,shape:'rounded',color:'primary',size:'small',showLastButton:!0,showFirstButton:!0,renderItem:t=>e.jsx(r.PaginationItem,{slots:{first:Ke,last:Je,next:Qe,previous:Xe},...t}),sx:[{minWidth:'24px',height:'24px'}],onChange:(e,r)=>{t&&t(r)},...n}),tt=({count:t=1,onPageChange:i,total:o=0,page:n=1,pageSize:a=10,onPageSizeChange:l})=>e.jsxs('div',{style:{padding:'8px 20px',display:'flex',justifyContent:'space-between',alignItems:'center',height:'40px',boxSizing:'border-box',borderTop:'1px solid rgba(224, 224, 224, 1)'},children:[e.jsxs('div',{style:{display:'flex',alignItems:'center'},children:[e.jsxs(r.Typography,{variant:'body2',children:[e.jsx('span',{style:{fontFamily:'Source Sans Pro',color:'1A1A1A',fontSize:'12px'},children:'Viewing'}),' ',e.jsxs('span',{style:{fontFamily:'Poppins',color:'1A1A1A',fontSize:'11px',fontWeight:500},children:[0===o?0:a*(n-1)+1,'-',n*a>o?o:n*a]}),e.jsxs('span',{style:{fontFamily:'Source Sans Pro',color:'1A1A1A',fontSize:'12px'},children:[' ','of',' ']}),e.jsx('span',{style:{fontFamily:'Poppins',color:'1A1A1A',fontSize:'11px',fontWeight:500},children:o}),e.jsxs('span',{style:{fontFamily:'Source Sans Pro',color:'1A1A1A'},children:[' ','records']})]}),e.jsx(r.Typography,{variant:'body2',sx:{marginLeft:'16px'},children:'Rows Per Page:'}),e.jsxs(r.Select,{value:a,onChange:l,variant:'outlined',style:{height:24,margin:'0 8px',boxSizing:'border-box'},sx:{'& .MuiSelect-select':{padding:'0 14px'}},children:[e.jsx(r.MenuItem,{value:10,children:'10'}),e.jsx(r.MenuItem,{value:25,children:'25'}),e.jsx(r.MenuItem,{value:50,children:'50'}),e.jsx(r.MenuItem,{value:100,children:'100'})]})]}),e.jsx('div',{style:{},children:e.jsx(et,{page:n,count:t||1,onPageChange:i})})]}),rt=(e=!1)=>{const[r,i]=t.useState(e);return{toggle:r,handleToggle:()=>i(!r),setTrue:()=>i(!0),setFalse:()=>i(!1)}},it=({title:t,color:r='light',placement:o='top',size:n='small',textAlign:a='center',...l})=>{const s=i.useTheme();return e.jsx(re.default,{title:t,placement:o,arrow:!0,...l,componentsProps:{tooltip:{sx:{backgroundColor:'dark'===r?s.palette.primary.dark:s.palette.primary.contrastText,color:'dark'===r?'#ffffff':'#1A1A1A',height:'auto',minHeight:'medium'===n?'18px':'14px',border:`1px solid ${s.palette.primary[200]}`,borderRadius:'4px',minWidth:'small'===n?'35px':'38px',textAlign:a,...'small'===n?{...s.typography.body2}:{...s.typography.body1},padding:'medium'===n?'8px 16px':'4px 8px',...'top'===o&&{marginBottom:'4px !important'},...'bottom'===o&&{marginTop:'4px !important'}}},arrow:{sx:{color:'dark'===r?s.palette.primary.dark:s.palette.primary.contrastText,position:'absolute',top:'auto','&:before':{border:'.1px solid',borderColor:s.palette.primary[200],borderRadius:'2px'}}}},children:l?.children})},ot=({variant:t='contained',color:r='primary',sx:o,size:n='medium',icon:a,loading:l,...s})=>{const d=i.useTheme();return e.jsx(ie.default,{variant:t,color:r,sx:[{minWidth:'32px','& $text':{maxWidth:0,overflow:'hidden',transition:'all .2s ease-out'},'&:hover $text':{maxWidth:'500px',transition:'all .2s ease-in',paddingLeft:'5px'},...'contained'===t&&{background:d.palette[r].main,color:'#ffffff','&:hover':{background:d.palette[r].dark},boxShadow:'none !important'},...'outlined'===t&&{color:d.palette[r].main,background:'#ffffff',border:'1px solid',borderColor:d.palette[r].main,'&:hover':{background:d.palette[r].contrastText}},...'small'===n&&{width:'32px',height:'32px',padding:'8px','& svg':{width:'16px',height:'16px',paddingLeft:'12px'}},...'medium'===n&&{width:'40px',height:'40px',padding:'10px','& svg':{width:'20px',height:'20px',paddingLeft:'12px'}},...'large'===n&&{width:'48px',height:'48px',...d.typography.h4,padding:'12px','& svg':{width:'24px',height:'24px',paddingLeft:'12px'}}},{'.MuiButton-startIcon':{margin:'auto',svg:{padding:0,animation:l?'spin 1s linear infinite':void 0,'@keyframes spin':{'0%':{transform:'rotate(360deg)'},'100%':{transform:'rotate(0deg)'}}}}},...Boolean(o)&&Array.isArray(o)?o:[],Boolean(o)&&!Array.isArray(o)?o:{}],...s,startIcon:a})},nt=({color:t,sx:r,...i})=>e.jsxs(se.default,{viewBox:'0 0 20 20',...i,sx:{fill:'none',...r},children:[e.jsx('path',{d:'M18 2L2 18',stroke:t||'currentColor',strokeWidth:'1.2',strokeMiterlimit:'10',strokeLinecap:'round'}),e.jsx('path',{d:'M18 18L2 2',stroke:t||'currentColor',strokeWidth:'1.2',strokeMiterlimit:'10',strokeLinecap:'round'})]}),at=({children:t})=>e.jsx(ne.default,{sx:{height:80,width:'auto',maxWidth:'auto',borderTop:'1px solid black',borderColor:'grey.200',bgcolor:'#fff',display:'flex',alignItems:'center',padding:'0 40px',boxSizing:'border-box'},children:t}),lt=({open:t=!1,onClose:r,children:i,buttonAction:o,showDialogFooter:n=!0,title:a,height:l,width:s=496,...d})=>e.jsx(e.Fragment,{children:e.jsxs(oe.default,{sx:{overflowY:'visible'},PaperProps:{sx:{maxWidth:s}},open:t,onClose:r,'aria-labelledby':'alert-dialog-title','aria-describedby':'alert-dialog-description',...d,children:[e.jsxs(ee.default,{sx:{display:'flex',justifyContent:'space-between',alignItems:'center',width:s,maxWidth:s,px:4,py:2.5,height:72,boxSizing:'border-box'},id:'alert-dialog-title',children:[e.jsx('div',{children:e.jsx(le.default,{variant:'h3',color:'textPrimary',children:a})}),e.jsx(te.default,{onClick:r,children:e.jsx(nt,{sx:{fontSize:'16px',color:'#000'},style:{cursor:'pointer'}})})]}),e.jsx(ae.default,{sx:{height:l,width:'auto',padding:'0px'},children:i}),n&&o&&e.jsx(at,{children:o})]})}),st=t.forwardRef((({sx:t,variant:r='contained',color:o='primary',children:n,inputSize:a,size:l='small',fromTextbox:s=!1,inputAlert:d,text:c,inputReq:p,inputLabel:x,disabled:h=!1,...u},m)=>{const g=i.useTheme();return e.jsx(ie.default,{variant:r,color:o,disabled:h,size:l,...u,ref:m,sx:[{...'outlined'===r&&{color:`${g.palette['secondary'===o?'grey':o]['secondary'===o?400:'main']}`,backgroundColor:'#ffffff',border:'1px solid',borderColor:`${g.palette['secondary'===o?'grey':o]['secondary'===o?400:'main']}`,'&:hover':{backgroundColor:'secondary'!==o?`${g.palette[o].contrastText}`:'inherit'},...'secondary'===o&&{color:'#000000',background:'#ffffff','&:hover':{borderColor:'#000000'}}},...h&&{color:`${g.palette.grey[100]} !important`,backgroundColor:'contained'===r?`${g.palette.grey[200]} !important`:'#FFFFFF',borderColor:'outlined'===r?`${g.palette.grey[100]}`:'inherit'},...'contained'===r&&{color:'#FFFFFF',...'secondary'===o&&{backgroundColor:g.palette.grey[400]},'&:hover':{background:`${g.palette['secondary'===o?'grey':o]['secondary'===o?700:'dark']}`},boxShadow:'none !important'},...'text'===r&&{fontWeight:500,...'small'===l&&{...g.typography.h6},...'medium'===l&&{...g.typography.h5},...'large'===l&&{...g.typography.h4},height:'small'===l?'16px':'20px',minWidth:'50px !important',padding:0,...'secondary'===o&&{color:g.palette.common.black},'&:hover':{backgroundColor:'inherit',color:g.palette['secondary'===o?'grey':o]['secondary'===o?'700':'dark']},...s&&{minWidth:'50px !important',position:'absolute',right:'12px',height:'small'===a?'16px':'20px',top:p||x?'medium'===a?'39px':'29px':'medium'===a?'11px':'9px',color:h||d?g.palette.grey[100]:'',padding:'8px 8px',alignSelf:'center',fontWeight:500,backgroundColor:'transparent'}},'& .MuiButton-startIcon':{justifyContent:'center',marginLeft:0}},...Boolean(t)&&Array.isArray(t)?t:[],Boolean(t)&&!Array.isArray(t)?t:{}],children:c||n})}));st.displayName='Button';const dt=({label:t,required:i=!1,icon:o,...n})=>{const a=r.useTheme();return e.jsxs(r.Typography,{sx:{display:'flex',alignItems:'center'},...n,children:[o&&e.jsx('span',{style:{marginRight:'8px'},children:o}),t,' ',t&&i&&e.jsx('span',{style:{color:a.palette.error.main},children:'*'})]})},ct=({htmlColor:t})=>e.jsxs(r.SvgIcon,{viewBox:'0 0 16 16',fill:t,stroke:t,children:[e.jsx('rect',{x:'0.5',y:'0.5',width:'15',height:'15',rx:'3.5',stroke:'currentColor',fill:'currentColor'}),e.jsx('path',{d:'M3.5 8H12.5',stroke:'white',strokeWidth:'0.8',strokeMiterlimit:'10',strokeLinecap:'round'})]}),pt=({sx:t,...i})=>e.jsx(r.SvgIcon,{...i,sx:{fill:'none',...t},viewBox:'0 0 20 20',children:e.jsx('path',{fillRule:'evenodd',clipRule:'evenodd',d:'M0 6C0 3.79086 1.79086 2 4 2H12C14.2091 2 16 3.79086 16 6V14C16 16.2091 14.2091 18 12 18H4C1.79086 18 0 16.2091 0 14V6Z',fill:'inherit',stroke:'currentColor',strokeWidth:'1px',transform:'translate(1 0)'})}),xt=({sx:t,htmlColor:i,...o})=>e.jsxs(r.SvgIcon,{...o,sx:{fill:'none',...t},viewBox:'0 0 20 20',children:[e.jsx('path',{fillRule:'evenodd',clipRule:'evenodd',d:'M0 6C0 3.79086 1.79086 2 4 2H12C14.2091 2 16 3.79086 16 6V14C16 16.2091 14.2091 18 12 18H4C1.79086 18 0 16.2091 0 14V6Z',fill:i??'currentColor',stroke:'currentColor',strokeWidth:'1px',transform:'translate(1 0)'}),e.jsx('path',{fillRule:'evenodd',clipRule:'evenodd',d:'M7.00025 14.0006C6.73625 14.0006 6.48125 13.8966 6.29325 13.7076L4.29325 11.7076C3.90225 11.3166 3.90225 10.6846 4.29325 10.2936C4.68425 9.90257 5.31625 9.90257 5.70725 10.2936L6.84525 11.4316L10.1683 6.44557C10.4742 5.98557 11.0943 5.86157 11.5553 6.16857C12.0142 6.47557 12.1383 7.09557 11.8323 7.55557L7.83225 13.5556C7.66625 13.8046 7.39625 13.9666 7.09925 13.9956C7.06525 13.9986 7.03325 14.0006 7.00025 14.0006Z',fill:'inherit',transform:'translate(1 0)'})]}),ht=({size:t='medium',sx:r,label:o,disabled:n=!1,alert:a,reverse:l,...s})=>{const d=i.useTheme();return e.jsxs(ee.default,{sx:[{display:'flex',color:n?d.palette.grey[100]:d.palette.common.black,alignItems:'center',flexDirection:l?'row-reverse':'row',width:'max-content'},{'& svg':{fontSize:'medium'===t?'16px':'12px',color:d.palette.grey[100],stroke:d.palette.grey[100],fill:d.palette.common.white},'& .Mui-checked > svg':{fontSize:'medium'===t?'16px':'12px',color:d.palette.primary.main,fill:d.palette.common.white},'& .MuiCheckbox-indeterminate > svg':{fontSize:'medium'===t?'16px':'12px',color:d.palette.primary.main,fill:d.palette.common.white},'& .Mui-focusVisible':{outline:`2px solid ${d.palette.primary.light}`,borderRadius:'4px'},'&:hover svg':{color:'primary.main',fill:d.palette.primary.light},'&:hover .Mui-checked > svg':{color:'primary.dark',stroke:d.palette.primary.dark,fill:d.palette.primary.light},'&:hover .MuiCheckbox-indeterminate > svg':{color:'primary.dark',stroke:d.palette.primary.dark,fill:d.palette.primary.light}},a&&{'& svg':{color:`${d.palette.error.main} !important`,fill:d.palette.grey[100]},'&:hover svg':{color:'error.main',fill:d.palette.error.light}},n&&{color:'grey.100','& svg':{color:`${d.palette.grey[100]} !important`,fill:d.palette.grey[100]},'&:hover svg':{color:'grey.100',fill:d.palette.grey[100]}},...Boolean(r)&&Array.isArray(r)?r:[],Boolean(r)&&!Array.isArray(r)?r:{}],children:[e.jsx(de.default,{checkedIcon:e.jsx(xt,{htmlColor:n?d.palette.grey[100]:d.palette.primary.main,color:'primary'}),indeterminateIcon:e.jsx(ct,{htmlColor:n?d.palette.grey[100]:d.palette.primary.main}),icon:e.jsx(pt,{}),size:t,disabled:n,disableRipple:!0,color:'primary',...s,sx:{padding:0,'&:hover':{'#unchecked':{'&>path':{stroke:d.palette.primary.main,fill:d.palette.primary.light}}}}}),!!o&&e.jsx(dt,{label:o,variant:'small'===t?'body2':'body1',sx:[{ml:'small'===t?'4px':1,cursor:'default'}]})]})},ut=({columns:t=[],maxVisibleColumns:i=8,onSave:o,state:a,form:l,setState:s,handleToggle:d})=>{const c=rt(!1);return e.jsxs(e.Fragment,{children:[e.jsx(it,{title:'Set Display Items',children:e.jsx('div',{children:e.jsx(ot,{variant:'text',size:'small',icon:e.jsx(Pe,{}),onClick:()=>c.setTrue()})})}),e.jsx(r.Box,{display:'flex',justifyContent:'center',alignItems:'center',height:'100%',children:e.jsx(lt,{open:c.toggle,title:'Set Display Items',onClose:()=>c.setFalse(),height:500,width:650,buttonAction:e.jsxs(r.Grid,{container:!0,sx:{display:'flex',justifyContent:'space-between'},children:[e.jsx(r.Grid,{item:!0}),e.jsxs(r.Grid,{item:!0,children:[e.jsx(st,{text:'Cancel',size:'small',variant:'outlined',color:'secondary',onClick:()=>c.setFalse()}),e.jsx(st,{text:'Save',size:'small',variant:'contained',color:'success',sx:{marginLeft:'24px'},onClick:()=>{o?.(a.map((e=>({...e,selected:l[e.field]??!1})))),c.setFalse()}})]})]}),children:e.jsxs(r.Box,{p:2,children:[e.jsxs(r.Box,{px:2,children:[e.jsx(r.Typography,{variant:'h6',color:'textSecondary',children:'Add/remove column in the table using the checkbox'}),e.jsx(r.Typography,{variant:'h6',color:'textSecondary',sx:{margin:'8px 0px'},children:'Drag to reorder column position in the table'})]}),e.jsx(r.Box,{py:1,sx:{display:'flex',flexDirection:'column'},children:e.jsx(n.ReactSortable,{list:a,setList:s,style:{display:'flex',flexWrap:'wrap',gap:'5px'},filter:'.static',animation:200,children:a?.map((r=>e.jsx('div',{className:r.disableColumnInFilterMenu?'static':'',style:{cursor:'move',userSelect:'none',width:'calc(100%)',backgroundColor:r.disableColumnInFilterMenu?'#E3E3E3':'#FFFFFF'},children:e.jsxs(ee.default,{sx:{height:'40px',width:'calc(100%)',borderRadius:'4px',border:'1px solid #E3E3E3',padding:'0 16px',boxSizing:'border-box',display:'flex',alignItems:'center',justifyContent:'space-between'},children:[e.jsx(ht,{label:r?.headerName??r.field,size:'medium',checked:l[r.field],onClick:d(r.field),disabled:r.disableColumnInFilterMenu||!1===l[r.field]&&Object.values(l).filter((e=>e)).length===i+Object.values(t).filter((e=>' '===e.headerName)).length}),e.jsx(te.default,{sx:{cursor:'move'},children:e.jsx(qe,{})})]},r?.headerName)},`${r.field}-${r.headerName}`)))})})]})})})]})},mt=(e={},r={debugging:!0})=>{const i=t.useRef(null),[o,n]=t.useState({...e}),[a,l]=t.useState({});t.useEffect((()=>{i.current=e}),[]),t.useEffect((()=>{'production'!==process.env.NODE_ENV&&r.debugging}),[o,a]);const s=(e,t,r)=>{let i='',o=!1;t?(o=r?.validate?r.validate(t):r?.regex?.test(t)??!0,i=o?'':r?.errorMessage||'Invalid Value'):r?.required?i=r?.requiredMessage||'This field is required':o=!0;const a=r?.formatter?r.formatter(t):t;n((t=>({...t,[e]:a}))),l((t=>({...t,[e]:o?'':i})))};return{form:o,initForm:e=>{const t={...e??i.current??{}};return n(t),l({}),t},clearForm:()=>{n({}),l({})},handleTextbox:(e,t)=>r=>{const i=r.target.value;s(e,i,t)},handleToggle:e=>()=>{n((t=>({...t,[e]:!t[e]})))},handleValue:(e,t)=>r=>{s(e,r,t)},setFields:e=>{n('function'==typeof e?t=>({...t,...e(t)}):t=>({...t,...e}))},errors:a,setAllErrors:e=>l({...e}),setError:(e,t)=>l((r=>({...r,[e]:t})))}},gt=(e,t)=>e?.filter((e=>!e.hideColumnInFilterMenu))?.map(((e,r)=>({...e,id:r,selected:t[e.field]??!1}))),ft=({columns:r,maxVisibleTableColumn:i,rerenderDisplayItems:o,setOrder:n})=>{const a=r?.map((({field:e,headerName:t,disableColumnInFilterMenu:r,hideColumnInFilterMenu:i})=>({field:e,headerName:t,disableColumnInFilterMenu:r,hideColumnInFilterMenu:i}))),{form:l,handleToggle:s}=mt(((e,t)=>{const r=((e,t=8)=>{const r=[...e];return r?.sort((({disableColumnInFilterMenu:e},{disableColumnInFilterMenu:t})=>t===e?0:e?-1:1)).slice(0,t).map((e=>e.field))})(e,t);return e?.reduce(((e,t,i)=>(' '===t.headerName||r.includes(t.field)?e[t.field]=!0:e[t.field]=!1,e)),{})})(a,i)),[d,c]=t.useState(gt(a,l));return t.useEffect((()=>{c(gt(a,l))}),[r]),e.jsx('span',{children:e.jsx(ut,{columns:a,onSave:e=>{n?.(e.reduce(((e,{field:t,selected:r,id:i})=>(e[t]={order:i,selected:r??!1},e)),{}))},maxVisibleColumns:i,state:d,form:l,setState:c,handleToggle:s},`${i}-${o}`)})},yt=({title:t,disableMainHeader:i=!1,Actions:o=ft,actionsProps:n={},SubHeader:a,subHeaderProps:l,rows:s,columns:d,selectedColumns:c,maxVisibleTableColumn:p,setSelectedColumns:x,showActions:h=!0,rerenderDisplayItems:u,order:m,setOrder:g,onRowSelectionModelChange:f,selectionModel:y})=>e.jsxs('div',{children:[!i&&e.jsxs('div',{style:{display:'flex',justifyContent:'space-between',height:56,padding:'8px 20px',alignItems:'center',border:'none',borderBottom:'1px solid #E3E3E3',boxSizing:'border-box',borderTopLeftRadius:4,borderTopRightRadius:4},children:[t&&e.jsx(r.Typography,{variant:'h4',style:{marginRight:24},children:t}),h&&e.jsx(o,{rows:s,columns:d,setSelectedColumns:x,selectedColumns:c,maxVisibleTableColumn:p,rerenderDisplayItems:u,onRowSelectionModelChange:f,selectionModel:y,...n,order:m,setOrder:g})]}),a&&e.jsx(a,{order:m,setOrder:g,rows:s,columns:d,setSelectedColumns:x,selectedColumns:c,maxVisibleTableColumn:p,rerenderDisplayItems:u,onRowSelectionModelChange:f,selectionModel:y,...l})]}),bt={v:'4.8.0',meta:{g:'LottieFiles AE 3.4.3',a:'',k:'',d:'',tc:''},fr:24,ip:0,op:84,w:400,h:400,nm:'Rotation',ddd:0,assets:[],layers:[{ddd:0,ind:1,ty:4,nm:'Shape Layer 4',sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:1,k:[{i:{x:0,y:1},o:{x:.453,y:0},t:0,s:[478,361,0],to:[-24.833,.333,0],ti:[25,23.333,0]},{i:{x:0,y:1},o:{x:.592,y:0},t:20,s:[329,363,0],to:[-25,-23.333,0],ti:[-24.667,23.833,0]},{i:{x:.189,y:1},o:{x:.759,y:0},t:40,s:[328,221,0],to:[24.667,-23.833,0],ti:[-25.167,-23.333,0]},{i:{x:0,y:1},o:{x:.545,y:0},t:60,s:[477,220,0],to:[25.167,23.333,0],ti:[-.333,-23.5,0]},{t:80,s:[479,361,0]}],ix:2},a:{a:0,k:[0,0,0],ix:1},s:{a:0,k:[59,59,100],ix:6}},ao:0,shapes:[{ty:'gr',it:[{ty:'rc',d:1,s:{a:0,k:[98.938,98.938],ix:2},p:{a:0,k:[0,0],ix:3},r:{a:0,k:64,ix:4},nm:'Rectangle Path 1',mn:'ADBE Vector Shape - Rect',hd:!1},{ty:'fl',c:{a:0,k:[.56862745098,.690196078431,.980392156863,1],ix:4},o:{a:0,k:100,ix:5},r:1,bm:0,nm:'Fill 1',mn:'ADBE Vector Graphic - Fill',hd:!1},{ty:'tr',p:{a:0,k:[-346.531,-154.531],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:'Transform'}],nm:'Rectangle 1',np:3,cix:2,bm:0,ix:1,mn:'ADBE Vector Group',hd:!1}],ip:0,op:95,st:0,bm:0},{ddd:0,ind:2,ty:4,nm:'Shape Layer 3',sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:1,k:[{i:{x:0,y:1},o:{x:.482,y:0},t:0,s:[331,361,0],to:[-.333,-23.333,0],ti:[-24.667,23.333,0]},{i:{x:0,y:1},o:{x:.592,y:.025},t:20,s:[329,221,0],to:[24.667,-23.333,0],ti:[-24.667,-23.5,0]},{i:{x:.189,y:1},o:{x:.76,y:0},t:40,s:[479,221,0],to:[24.667,23.5,0],ti:[25,-23.333,0]},{i:{x:0,y:1},o:{x:.524,y:0},t:60,s:[477,362,0],to:[-25,23.333,0],ti:[24.667,.167,0]},{t:80,s:[329,361,0]}],ix:2},a:{a:0,k:[0,0,0],ix:1},s:{a:0,k:[59,59,100],ix:6}},ao:0,shapes:[{ty:'gr',it:[{ty:'rc',d:1,s:{a:0,k:[98.938,98.938],ix:2},p:{a:0,k:[0,0],ix:3},r:{a:0,k:64,ix:4},nm:'Rectangle Path 1',mn:'ADBE Vector Shape - Rect',hd:!1},{ty:'fl',c:{a:0,k:[.172549019608,.388235294118,.898039215686,1],ix:4},o:{a:0,k:100,ix:5},r:1,bm:0,nm:'Fill 1',mn:'ADBE Vector Graphic - Fill',hd:!1},{ty:'tr',p:{a:0,k:[-346.531,-154.531],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:'Transform'}],nm:'Rectangle 1',np:3,cix:2,bm:0,ix:1,mn:'ADBE Vector Group',hd:!1}],ip:0,op:95,st:0,bm:0},{ddd:0,ind:3,ty:4,nm:'Shape Layer 2',sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:1,k:[{i:{x:0,y:1},o:{x:.477,y:0},t:0,s:[478,220,0],to:[.333,23.833,0],ti:[25,-23.333,0]},{i:{x:0,y:1},o:{x:.579,y:0},t:20,s:[480,363,0],to:[-25,23.333,0],ti:[25,23.833,0]},{i:{x:.136,y:1},o:{x:.785,y:.07},t:40,s:[328,360,0],to:[-25,-23.833,0],ti:[-25.167,23.333,0]},{i:{x:0,y:1},o:{x:.615,y:.086},t:60,s:[330,220,0],to:[25.167,-23.333,0],ti:[-24.833,0,0]},{t:80,s:[479,220,0]}],ix:2},a:{a:0,k:[0,0,0],ix:1},s:{a:0,k:[59,59,100],ix:6}},ao:0,shapes:[{ty:'gr',it:[{ty:'rc',d:1,s:{a:0,k:[98.938,98.938],ix:2},p:{a:0,k:[0,0],ix:3},r:{a:0,k:64,ix:4},nm:'Rectangle Path 1',mn:'ADBE Vector Shape - Rect',hd:!1},{ty:'fl',c:{a:0,k:[.749019607843,.823529411765,.992156862745,1],ix:4},o:{a:0,k:100,ix:5},r:1,bm:0,nm:'Fill 1',mn:'ADBE Vector Graphic - Fill',hd:!1},{ty:'tr',p:{a:0,k:[-346.531,-154.531],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:'Transform'}],nm:'Rectangle 1',np:3,cix:2,bm:0,ix:1,mn:'ADBE Vector Group',hd:!1}],ip:0,op:95,st:0,bm:0},{ddd:0,ind:4,ty:4,nm:'Shape Layer 1',sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:1,k:[{i:{x:0,y:1},o:{x:.469,y:0},t:0,s:[331,220,0],to:[24.833,.167,0],ti:[-24.667,-23.333,0]},{i:{x:0,y:1},o:{x:.606,y:.018},t:20,s:[480,221,0],to:[24.667,23.333,0],ti:[25,-23.5,0]},{i:{x:.163,y:1},o:{x:.772,y:0},t:40,s:[479,360,0],to:[-25,23.5,0],ti:[25,23.333,0]},{i:{x:0,y:1},o:{x:.559,y:0},t:60,s:[330,362,0],to:[-25,-23.333,0],ti:[.167,23.667,0]},{t:80,s:[329,220,0]}],ix:2},a:{a:0,k:[0,0,0],ix:1},s:{a:0,k:[59,59,100],ix:6}},ao:0,shapes:[{ty:'gr',it:[{ty:'rc',d:1,s:{a:0,k:[98.938,98.938],ix:2},p:{a:0,k:[0,0],ix:3},r:{a:0,k:64,ix:4},nm:'Rectangle Path 1',mn:'ADBE Vector Shape - Rect',hd:!1},{ty:'fl',c:{a:0,k:[.843137254902,.890196078431,.996078431373,1],ix:4},o:{a:0,k:100,ix:5},r:1,bm:0,nm:'Fill 1',mn:'ADBE Vector Graphic - Fill',hd:!1},{ty:'tr',p:{a:0,k:[-346.531,-154.531],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:'Transform'}],nm:'Rectangle 1',np:3,cix:2,bm:0,ix:1,mn:'ADBE Vector Group',hd:!1}],ip:0,op:95,st:0,bm:0}],markers:[{tm:0,cm:'1',dr:0}]},jt=()=>e.jsx(r.Box,{display:'flex',height:'100%',justifyContent:'center',alignItems:'center',sx:{color:'primary.light'},children:e.jsx(ce.default,{style:{height:100},animationData:bt})}),Ct=({NoDataIcon:t,src:i})=>e.jsx(r.Box,{display:'flex',justifyContent:'center',alignItems:'center',height:'100%',children:t||(i?.trim()?.length?e.jsx('img',{src:i,alt:'No Data'}):'No Data')});function kt(){const{innerWidth:e,innerHeight:t}=globalThis.window;return{width:e,height:t}}function wt(){const[e,r]=t.useState(kt());return t.useEffect((()=>{function e(){r(kt())}return globalThis.window.addEventListener('resize',e),()=>globalThis.window.removeEventListener('resize',e)}),[]),e}var vt=[],St=[];!function(e,t){if(e&&'undefined'!=typeof document){var r,i=!0===t.prepend?'prepend':'append',o=!0===t.singleTag,n='string'==typeof t.container?document.querySelector(t.container):document.getElementsByTagName('head')[0];if(o){var a=vt.indexOf(n);-1===a&&(a=vt.push(n)-1,St[a]={}),r=St[a]&&St[a][i]?St[a][i]:St[a][i]=l()}else r=l();65279===e.charCodeAt(0)&&(e=e.substring(1)),r.styleSheet?r.styleSheet.cssText+=e:r.appendChild(document.createTextNode(e))}function l(){var e=document.createElement('style');if(e.setAttribute('type','text/css'),t.attributes)for(var r=Object.keys(t.attributes),o=0;o<r.length;o++)e.setAttribute(r[o],t.attributes[r[o]]);var a='prepend'===i?'afterbegin':'beforeend';return n.insertAdjacentElement(a,e),e}}(':root {\r\n  --toastify-color-light: #2c63e5;\r\n  --toastify-color-dark: #121212;\r\n  --toastify-color-info: #91b0fa;\r\n  --toastify-color-success: #008f66;\r\n  --toastify-color-warning: #d97f30;\r\n  --toastify-color-error: #cc3333;\r\n  --toastify-color-transparent: rgba(255, 255, 255, 0.7);\r\n\r\n  --toastify-icon-color-info: var(--toastify-color-info);\r\n  --toastify-icon-color-success: var(--toastify-color-success);\r\n  --toastify-icon-color-warning: var(--toastify-color-warning);\r\n  --toastify-icon-color-error: var(--toastify-color-error);\r\n\r\n  --toastify-toast-width: 360px;\r\n  --toastify-toast-background: #fff;\r\n  --toastify-toast-min-height: 48px;\r\n  --toastify-toast-max-height: 800px;\r\n  --toastify-font-family: \'Source Sans Pro\', sans-serif;\r\n  --toastify-z-index: 9999;\r\n\r\n  --toastify-text-color-light: #fff;\r\n  --toastify-text-color-dark: #fff;\r\n  --toastify-text-color-info: #fff;\r\n  --toastify-text-color-success: #fff;\r\n  --toastify-text-color-warning: #fff;\r\n  --toastify-text-color-error: #fff;\r\n\r\n  --toastify-spinner-color: #616161;\r\n  --toastify-spinner-color-empty-area: #e0e0e0;\r\n  --toastify-color-progress-light: linear-gradient(\r\n    to right,\r\n    #4cd964,\r\n    #5ac8fa,\r\n    #007aff,\r\n    #34aadc,\r\n    #5856d6,\r\n    #ff2d55\r\n  );\r\n  --toastify-color-progress-dark: #bb86fc;\r\n  --toastify-color-progress-info: var(--toastify-color-info);\r\n  --toastify-color-progress-success: var(--toastify-color-success);\r\n  --toastify-color-progress-warning: var(--toastify-color-warning);\r\n  --toastify-color-progress-error: var(--toastify-color-error);\r\n}\r\n.Toastify__toast-body {\r\n  font-size: 12px;\r\n  font-family: \'Source Sans Pro\', sans-serif;\r\n  font-weight: 400;\r\n  line-height: 16px;\r\n}\r\n.Toastify__close-button {\r\n  align-self: center;\r\n}\r\n',{});var Dt=r.createSvgIcon(e.jsxs(J.Fragment,{children:[e.jsx('path',{fill:'currentColor',stroke:'currentColor',strokeLinecap:'round',strokeLinejoin:'round',strokeMiterlimit:'10',strokeWidth:'1.2',d:'M11.735 21.47a9.734 9.734 0 0 0 9.735-9.735C21.47 6.359 17.112 2 11.735 2 6.359 2 2 6.359 2 11.735c0 5.377 4.359 9.735 9.735 9.735Z'}),e.jsx('path',{stroke:'#fff',strokeLinecap:'round',strokeLinejoin:'round',strokeMiterlimit:'10',strokeWidth:'1.2',d:'M11.735 5.816v8.746'}),e.jsx('path',{fill:'#fff',d:'M11.735 18.229c.736 0 .736-1.15 0-1.15s-.736 1.15 0 1.15Z'})]}),'Alert'),Ft=r.createSvgIcon(e.jsx(J.Fragment,{children:e.jsx('path',{fill:'currentColor',fillRule:'evenodd',d:'M12 16c-.506 0-.99-.233-1.326-.642L6.462 10.26a2.086 2.086 0 0 1-.259-2.211C6.508 7.402 7.115 7 7.788 7h8.424c.673 0 1.28.402 1.585 1.049a2.09 2.09 0 0 1-.258 2.21l-4.213 5.099c-.336.409-.82.642-1.326.642Z',clipRule:'evenodd'})}),'ChevronDown'),At=r.createSvgIcon(e.jsx(J.Fragment,{children:e.jsx('path',{fill:'currentColor',fillRule:'evenodd',d:'M12 8c.506 0 .99.233 1.326.642l4.212 5.098a2.09 2.09 0 0 1 .259 2.211c-.305.647-.912 1.049-1.585 1.049H7.788c-.673 0-1.28-.402-1.585-1.049a2.085 2.085 0 0 1 .258-2.21l4.213-5.099C11.01 8.233 11.494 8 12 8Z',clipRule:'evenodd'})}),'ChevronUp'),Mt=r.createSvgIcon(e.jsxs(J.Fragment,{children:[e.jsx('path',{fill:'currentColor',stroke:'currentColor',strokeLinecap:'round',strokeLinejoin:'round',strokeMiterlimit:'10',strokeWidth:'1.2',d:'M11.74 21.48c5.38 0 9.74-4.36 9.74-9.74S17.12 2 11.74 2 2 6.36 2 11.74s4.36 9.74 9.74 9.74Z'}),e.jsx('path',{stroke:'#fff',strokeLinecap:'round',strokeLinejoin:'round',strokeMiterlimit:'10',strokeWidth:'1.2',d:'M8.773 8.934a3 3 0 0 1 3.749-2.76 2.975 2.975 0 0 1 2.081 2.024c.426 1.472-.299 2.864-1.483 3.485-.828.437-1.414 1.207-1.414 2.139v.563'}),e.jsx('path',{d:'M11.6709 17.4312C11.6704 17.4315 11.6698 17.4317 11.6692 17.432C11.6676 17.4313 11.6657 17.4306 11.6636 17.4296C11.652 17.4243 11.6418 17.4169 11.634 17.4092C11.6418 17.4015 11.652 17.3941 11.6636 17.3888C11.6657 17.3878 11.6676 17.3871 11.6692 17.3864C11.6698 17.3867 11.6704 17.3869 11.6709 17.3872C11.6711 17.3872 11.6712 17.3873 11.6713 17.3873C11.683 17.3926 11.6938 17.4006 11.7018 17.4092C11.6938 17.4178 11.683 17.4258 11.6713 17.4311C11.6712 17.4311 11.6711 17.4312 11.6709 17.4312Z',fill:'#fff',stroke:'#fff',strokeWidth:'1.2'})]}),'Help'),Bt=r.createSvgIcon(e.jsxs(J.Fragment,{children:[e.jsx('path',{fill:'currentColor',stroke:'currentColor',strokeLinecap:'round',strokeLinejoin:'round',strokeMiterlimit:'10',strokeWidth:'1.2',d:'M22.83 11.997c0 1.073-.979 1.993-1.297 2.96-.33 1.003-.083 2.312-.696 3.162-.614.849-1.947 1.014-2.784 1.64-.838.612-1.404 1.816-2.418 2.146-.979.318-2.135-.319-3.22-.319-1.073 0-2.241.637-3.22.319-1.003-.33-1.58-1.534-2.418-2.147-.85-.613-2.17-.79-2.784-1.64-.613-.837-.365-2.146-.696-3.16C2.98 13.99 2 13.07 2 11.996s.979-1.993 1.297-2.96c.33-1.003.083-2.312.696-3.162.614-.849 1.947-1.014 2.784-1.64.85-.6 1.415-1.816 2.418-2.146.979-.306 2.147.319 3.22.319 1.073 0 2.241-.637 3.22-.319 1.003.33 1.58 1.534 2.418 2.147.85.613 2.17.79 2.784 1.64.613.837.365 2.146.695 3.16.319.968 1.298 1.888 1.298 2.961Z'}),e.jsx('path',{stroke:'#fff',strokeLinecap:'round',strokeLinejoin:'round',strokeMiterlimit:'10',strokeWidth:'1.2',d:'m7.59 12.834 1.959 1.958a1.232 1.232 0 0 0 1.745 0l5.945-5.944'})]}),'Success');r.createSvgIcon(e.jsxs(J.Fragment,{children:[e.jsx('path',{d:'M15.46 6.90012L11.13 2.12012C10.98 1.96012 10.78 1.87012 10.55 1.87012H5.09999C4.67999 1.87012 4.32999 2.21012 4.32999 2.64012V17.1001C4.32999 17.5301 4.67999 17.8701 5.09999 17.8701H14.88C15.31 17.8701 15.65 17.5201 15.65 17.1001V7.43012C15.66 7.24012 15.58 7.04012 15.46 6.91012V6.90012Z',fill:'currentColor'}),e.jsx('path',{d:'M10.49 1.91992V6.89992C10.49 7.32992 10.84 7.66992 11.26 7.66992H15.67',stroke:'white',strokeLinecap:'round',strokeLinejoin:'round'})]}),'File');const zt={position:'bottom-right',autoClose:3e3,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:'colored'},Lt=(t,r)=>f.toast(t,{...zt,autoClose:2e3,...r??{},type:'success',icon:()=>e.jsx(Bt,{htmlColor:'#fff',sx:{'& path:last-child':{stroke:e=>e.palette.success.dark}}})}),Tt=(e,t)=>f.toast(e,{...zt,...t??{},type:'error'}),It=({id:i,columns:o,CollapseComponent:n,collapsableTableProps:a,row:l,isFooter:s=!1,disableCollapseColumn:d,onRowSelectionModelChange:c,getFooterStyles:p=(()=>{}),selectionModel:x,selectable:h,selected:u=!1,selectedRowClass:m,isRowCollapsable:g=(()=>!0)})=>{const[f,y]=X.default.useState(!1),b=t.useRef(),j=g(l);return e.jsxs(e.Fragment,{children:[e.jsxs(r.TableRow,{sx:[u&&{bgcolor:'primary.50',border:'1px solid black',borderColor:'primary.200'}],className:m,id:`row-${i?.toLocaleString()}`,children:[h&&e.jsx(r.TableCell,{sx:{width:'32px',boxSizing:'border-box',px:'20px'},children:e.jsx(ht,{size:'medium',checked:Array.isArray(x)?x.includes(i):x===i,onClick:()=>{c&&(x.includes(i)?c(x.filter((e=>e!==i)),{reason:'Checkbox Changed'}):c([...x,i],{reason:'Checkbox Changed'}))}})}),!d&&e.jsx(r.TableCell,{variant:'body',sx:[{width:26},s&&{...p()}],children:j&&e.jsx(r.IconButton,{'aria-label':'expand row',size:'small',onClick:()=>y(!f),color:'primary',children:f?e.jsx(Re,{fontSize:'small'}):e.jsx(Te,{fontSize:'small'})})}),o.map(((t,o)=>{const n=t.valueGetter?t.valueGetter({id:i,row:l,field:t.field,value:l[t.field]}):l[t.field]??'-',a=t.valueFormatter?t.valueFormatter({id:i,row:l,field:t.field,value:n}):n;return e.jsx(r.TableCell,{onDoubleClick:e=>((e,t)=>{e.stopPropagation(),(t||e.target.innerText)&&navigator.clipboard.writeText(t||e.target.innerText).then((()=>{Lt(`Copied to clipboard: ${t||e.target.innerText}`)})).catch((e=>{Tt(`Failed to copy to clipboard: ${e}`)}))})(e,l[t.field]),variant:'body',className:t.cellClassName,align:t.align,sx:[{minWidth:t.minWidth,width:t.width,overflow:'hidden',textOverflow:'ellipsis',paddingLeft:0},0===o&&!!d&&!h&&{pl:2},s&&{...p(t)}],children:t.renderCell&&!s?t.renderCell({id:i,row:l,field:t.field,value:n,column:t,formattedValue:a,expanded:f,onExpandChange:y}):a},t.field)}))]}),e.jsx(r.TableRow,{id:`row-${i?.toLocaleString()}-collapsed-row`,children:e.jsx(r.TableCell,{style:{paddingBottom:0,paddingTop:0,height:'auto',borderBottom:f?'1px solid #E0E0E0':'none'},colSpan:o.length+1,children:e.jsx(r.Collapse,{in:Boolean(f),timeout:'auto',unmountOnExit:!0,children:n&&e.jsx(n,{row:l,id:i,field:f,columns:o,rowRef:b,...a})})})})]})},Et=(e,t)=>{let r=[...e].sort(((e,t)=>Number(t.disableColumnInFilterMenu??!1)-Number(e.disableColumnInFilterMenu??!1))).reduce(((e,{field:r,disableColumnInFilterMenu:i})=>{let o=i||Object.values(e).filter((e=>e.selected)).length<t||!1;return e[r]={order:99,selected:o},e}),{}),i=0;return e.reduce(((e,{field:t})=>(e[t]?.selected&&(e[t].order=i,i++),e)),r)},Rt=({rows:i=[],footerRows:o=[],columns:n=[],headerProps:a,disableTableHeader:l=!1,footerProps:s,disableTableFooter:d=!1,getUniqueRowId:c=(e=>e?.id||e._id),CollapseComponent:p,collapsableTableProps:x,disableCollapseColumn:h,onRowSelectionModelChange:u,selectable:m,selectionModel:g,isLoading:f,selectedRowClass:y,isRowSelected:b,maxVisibleTableColumn:j=8,rerenderDisplayItems:C,isRowCollapsable:k,defaultSortModel:w,onSortModelChange:v,getFooterStyles:S=(()=>{}),noDataSrc:D='',NoDataIcon:F})=>{const A=r.useTheme(),M=(()=>{const{width:e}=wt();return(e=>e>2559?30:e>2249?18:e>2047?15:e>1919?14:e>1679?12:e>1599?11:e>1439?10:8)(e)})(),[B,z]=t.useState(Et(n.filter((e=>!e?.hideColumnInFilterMenu)),'auto'===j?M:j));t.useEffect((()=>{z(Et(n.filter((e=>!e?.hideColumnInFilterMenu)),'auto'===j?M:j))}),[C,j]);const[L,T]=t.useState(n);t.useEffect((()=>{T(n)}),[n]);const I=[...n.filter((e=>B?.[e.field]?.selected)).sort(((e,t)=>(B?.[e.field]?.order??999)-(B?.[t.field]?.order??999))),...n.filter((e=>e.hideColumnInFilterMenu))],[E,R]=r.useControlled({controlled:g,default:[],name:'Collapsable Table'}),P=e=>{R(e),u?.(e,{reason:'Checkbox Changed'})};((e,r)=>{const i=t.useRef(!1);t.useEffect((()=>{i.current?e():i.current=!0}),r)})((()=>{R([]),u?.([],{reason:'Rows reset'})}),[i]);const H=t.useCallback((()=>{if(E.length!==i.length){const e=i.map((e=>c(e)));R(e),u?.(e,{reason:'Selection model changed on click'})}else{const e=[];R(e),u?.(e,{reason:'Selection model changed on click'})}}),[i,E,c]),[V,O]=t.useState(w||null),W=({rows:t,isFooter:r})=>t.map(((t,i)=>e.jsx(It,{id:c(t),row:t,columns:I,CollapseComponent:p,collapsableTableProps:x,disableCollapseColumn:h,selectable:m,isRowCollapsable:k,selectedRowClass:y,selected:b?.(t)??E.includes(c(t)),selectionModel:E,onRowSelectionModelChange:P,isFooter:r,getFooterStyles:S},`${c(t)} ${I.length} ${i}`)));return e.jsxs(r.TableContainer,{style:{width:'100%',height:'100%',background:'#fff',display:'flex',flexDirection:'column',position:'relative'},children:[f&&e.jsx('div',{style:{height:'100%',width:'100%',position:'absolute',backdropFilter:'brightness(0.9)',zIndex:99},children:e.jsx(jt,{})}),!l&&e.jsx(yt,{columns:n,rows:i,selectedColumns:L,setSelectedColumns:T,maxVisibleTableColumn:'auto'===j?M:j,rerenderDisplayItems:C,order:B,setOrder:z,selectionModel:E,onRowSelectionModelChange:P,...a}),e.jsx('div',{style:{flexGrow:1,overflow:'auto'},children:e.jsxs(r.Table,{'aria-label':'collapsible table',stickyHeader:!0,sx:[0===i.length&&{height:'100%'}],children:[e.jsx(r.TableHead,{children:e.jsxs(r.TableRow,{sx:{bgcolor:'#f8f8f8'},children:[m&&e.jsx(r.TableCell,{sx:{width:'32px',boxSizing:'border-box',px:'20px',bgcolor:'#f8f8f8'},children:e.jsx(ht,{checked:Array.isArray(E)&&Boolean(i.length)&&E?.length===i.length,indeterminate:Array.isArray(E)&&Boolean(i.length)&&0!==E?.length&&E?.length<i.length,onClick:H})}),!h&&e.jsx(r.TableCell,{sx:{bgcolor:'#f8f8f8'}}),I.map(((t,i)=>e.jsx(r.TableCell,{align:t.align,variant:'head',sx:[{bgcolor:'#f8f8f8',...A.typography.h5,minWidth:t.minWidth,width:t.width,overflow:'hidden',pl:0},0===i&&h&&!m&&{pl:2}],children:e.jsxs('div',{style:{...A.typography.h5,display:'flex',alignItems:'center'},children:[e.jsx('span',{style:{display:'inline-block',minWidth:t.minWidth,width:t.width,overflow:'hidden',textOverflow:'ellipsis'},children:t.headerName}),t.sortable&&e.jsx(r.Box,{component:'span',sx:{display:'flex',ml:'4px','&:hover':{bgcolor:'primary.100',borderRadius:1}},onClick:()=>{let e=null;V?.key!==t.field?e={key:t.field,order:1}:1===V.order&&(e={key:t.field,order:-1}),O(e),v?.(e)},children:V?.key===t.field?1===V?.order?e.jsx(Ne,{color:'primary',sx:{color:'primary.main'}}):e.jsx($e,{color:'primary'}):e.jsx(Ne,{})}),t?.FilterContextMenu]})},t.field)))]})}),e.jsxs(r.TableBody,{children:[!f&&0===i.length&&e.jsx(r.TableRow,{children:e.jsx(r.TableCell,{colSpan:m?L.length+1:L.length,children:e.jsx(Ct,{NoDataIcon:F,src:D})},L.length)}),W({rows:i,isFooter:!1})]}),e.jsx(r.TableFooter,{children:W({rows:o,isFooter:!0})})]})}),!d&&e.jsx(tt,{...s})]})},Pt=r.styled(r.Badge)((({theme:e})=>({'& .MuiBadge-badge':{backgroundColor:e.palette.success.main,color:e.palette.success.main,boxShadow:`0 0 0 2px ${e.palette.background.paper}`,'&::after':{position:'absolute',top:-1,left:-1,width:'100%',height:'100%',borderRadius:'50%',animation:'ripple 1.5s infinite ease-in-out',border:'1px solid currentColor',content:'""'}},'@keyframes ripple':{'0%':{transform:'scale(.5)',opacity:1},'100%':{transform:'scale(2)',opacity:0}}}))),Ht={success:e.jsx(Bt,{color:'success'}),warning:e.jsx(Dt,{color:'warning'}),error:e.jsx(Bt,{color:'error'})},Vt=({color:t,htmlColor:i,sx:o,...n})=>e.jsx(r.SvgIcon,{viewBox:'0 0 24 24',sx:{...o,fill:'none'},...n,children:e.jsx('path',{d:'M9 6L14.91 11.985L9 18',stroke:t||'currentColor',strokeMiterlimit:'10',strokeLinecap:'round',strokeLinejoin:'round'})}),Ot=({links:t,text:i,sx:o,separator:n,color:a})=>{const l=r.useTheme();return e.jsxs(xe.default,{sx:{...o},separator:n||e.jsx(Vt,{sx:{width:'12px',height:'12px',mr:'-6px',ml:'-6px',color:a||o?.color||l.palette.common.black}})||'>','aria-label':'breadcrumb',children:[t?.map((t=>e.jsx(he.default,{component:t.component??he.default,color:'primary',href:t.url,sx:[{color:a||o?.color||l.palette.common.black,height:'20px',textDecoration:'none'}],children:e.jsx(le.default,{variant:'body2',children:t.name})},`${t.name}-${t.url}`))),e.jsx(le.default,{variant:'body2',color:a||o?.color||l.palette.common.black,children:i})]})},Wt=({children:t,actions:r,containerProps:i})=>e.jsxs(ee.default,{...i,sx:{width:'100%',minHeight:'56px',boxSizing:'border-box',padding:'16px 24px',borderTop:1,borderColor:'grey.300',background:'grey.700',display:'flex',alignIems:'center',justifyContent:'space-between',...i?.sx??{}},children:[e.jsx(ee.default,{children:t}),e.jsx(ee.default,{children:r})]}),qt=({title:t,actions:r,containerProps:i={}})=>e.jsxs(ee.default,{...i,sx:[{width:'100%',minHeight:'56px',boxSizing:'border-box',padding:'16px 24px',borderBottom:1,borderColor:'grey.300',display:'flex',alignItems:'center',justifyContent:'space-between'},...Boolean(i?.sx)&&Array.isArray(i?.sx)?i?.sx:[],Boolean(i?.sx)&&!Array.isArray(i?.sx)?i?.sx:{}],children:[e.jsx(le.default,{variant:'h4',children:t}),e.jsx(ee.default,{sx:{display:'flex'},children:r})]}),$t=({badgeCount:t,disabled:i})=>e.jsx(r.Box,{sx:[{height:'24px',boxSizing:'border-box',width:'max-content',borderRadius:2,display:'flex',marginRight:'8px',padding:'4px',justifyContent:'center',alignItems:'center',minWidth:'28px',bgcolor:'primary.200',color:'inherit',marginLeft:'10px'},i&&{bgcolor:'#C7C7C7',color:'#666666'}],children:e.jsx(r.Typography,{variant:'body2',children:t})}),Nt=({children:t,xs:i=12,sx:o})=>{const n=(100/12*i).toFixed(2);return e.jsx(r.Box,{display:'flex',sx:{minWidth:`calc(${n}% - 16px)`,width:'100%',maxWidth:`${n}%`,flex:1,...o},children:t})},_t=t=>e.jsx(r.SvgIcon,{width:'20',height:'20',viewBox:'0 0 20 20',fill:'transparent',xmlns:'http://www.w3.org/2000/svg',...t,children:e.jsx('path',{d:'M13.47 2L6 9.5607L13.47 17.1819',stroke:'#2C63E5',strokeWidth:'1.2',strokeMiterlimit:'10',strokeLinecap:'round',strokeLinejoin:'round',fill:'transparent'})}),Gt=t=>e.jsx(r.SvgIcon,{width:'20',height:'20',viewBox:'0 0 20 20',fill:'transparent',xmlns:'http://www.w3.org/2000/svg',...t,children:e.jsx('path',{d:'M6 2L13.47 9.5607L6 17.1819',stroke:'#2C63E5',strokeWidth:'1.2',strokeMiterlimit:'10',strokeLinecap:'round',strokeLinejoin:'round',fill:'transparent'})}),Zt=['January','February','March','April','May','June','July','August','September','October','November','December'],Yt=['AM','PM'],Ut=t.forwardRef((({sx:t,alert:i=!1,width:o=312,size:n='small',label:a,disabled:l=!1,...s},d)=>{const c=r.useTheme();return e.jsx(fe.default,{size:n,sx:[{'& .MuiInputBase-input':{...'small'===n&&{...c.typography.h6},...'medium'===n&&{...c.typography.h5},borderRadius:'4px',position:'relative',border:`1px solid ${c.palette.grey[200]}`,backgroundColor:l?c.palette.grey[150]:'#ffffff',width:o||'312px',cursor:l?'not-allowed':'text',borderColor:i&&!l?c.palette?.error?.main:c.palette.grey[100],'&::placeholder':{color:l?c.palette.grey[100]:`${c.palette.grey[650]} !important`,opacity:'1 !important'},alignSelf:'flex-end',...'small'===n?{...c.typography.body2}:{...c.typography.body1},height:'small'===n?'32px':'40px',padding:'small'===n?'8px 12px':'10px 16px',color:l?c.palette.grey[100]:c.palette.common.black,'&:focus':{borderColor:c.palette.primary.main},'&:not(:placeholder-shown):invalid':{borderColor:c.palette?.error?.main},boxSizing:'border-box'}},...Boolean(t)&&Array.isArray(t)?t:[],Boolean(t)&&!Array.isArray(t)?t:{}],disabled:l,style:{width:'100%'},inputRef:d,...s})}));Ut.displayName='Input';const Kt=t.forwardRef((({label:t,sx:r,size:i='small',alert:o,id:n,required:a,disabled:l,action:s,...d},c)=>e.jsxs(ee.default,{sx:[{flexWrap:'wrap',position:'relative',width:'max-content',...!t&&!a&&{height:'small'===i?'32px':'40px'}}],children:[(t||a)&&e.jsx(dt,{label:t,required:a,variant:'small'===i?'h6':'h5',mb:'small'===i?'4px':1}),e.jsx(Ut,{size:i,required:a,alert:o,id:n,sx:r,label:t,disabled:l,ref:c,...d}),s&&e.jsx(st,{variant:'text',size:'small',color:'primary',disabled:l,onClick:s.onClick,inputAlert:o,fromTextbox:!0,inputSize:i,inputReq:a,inputLabel:!!t&&t.length>0,children:s.text})]})));Kt.displayName='Textbox';const Jt=({color:t,...r})=>e.jsxs(se.default,{viewBox:'0 0 16 16',sx:{height:'16px',width:'16px',fill:'none'},...r,children:[e.jsx('path',{d:'M7.47453 13.3499C10.7192 13.3499 13.3495 10.7197 13.3495 7.47502C13.3495 4.23039 10.7192 1.6001 7.47453 1.6001C4.2299 1.6001 1.59961 4.23039 1.59961 7.47502C1.59961 10.7197 4.2299 13.3499 7.47453 13.3499Z',stroke:t||'currentColor',strokeWidth:'0.75',strokeMiterlimit:'10',strokeLinecap:'round',strokeLinejoin:'round'}),e.jsx('path',{d:'M11.834 11.8242L14.3999 14.4001',stroke:t||'currentColor',strokeMiterlimit:'10',strokeLinecap:'round',strokeLinejoin:'round'}),e.jsx('path',{d:'M7.47453 13.3499C10.7192 13.3499 13.3495 10.7197 13.3495 7.47502C13.3495 4.23039 10.7192 1.6001 7.47453 1.6001C4.2299 1.6001 1.59961 4.23039 1.59961 7.47502C1.59961 10.7197 4.2299 13.3499 7.47453 13.3499Z',stroke:t||'currentColor',strokeWidth:'0.75',strokeMiterlimit:'10',strokeLinecap:'round',strokeLinejoin:'round'}),e.jsx('path',{d:'M7.47461 3.45264C9.6938 3.45264 11.4771 5.22601 11.5068 7.4353',stroke:t||'currentColor',strokeWidth:'0.5',strokeMiterlimit:'10',strokeLinecap:'round',strokeLinejoin:'round'}),e.jsx('path',{d:'M7.47461 3.45264C9.6938 3.45264 11.4771 5.22601 11.5068 7.4353',stroke:t||'currentColor',strokeWidth:'0.75',strokeMiterlimit:'10',strokeLinecap:'round',strokeLinejoin:'round'})]}),Xt=({buttonVariant:o='outlined',size:n='small',value:a,onChange:l,onClear:s,onSearch:d,disabled:c,width:p,placeholder:x='Search',textboxProps:h,defaultValue:u,showDropdownSelection:m=!1,isHighLighted:g=!1,dropdownSelectionProps:f})=>{const y=i.useTheme(),b=t.useRef(null),[j,C]=r.useControlled({controlled:a,default:u??'',name:'Searchbox'});return e.jsxs(ee.default,{sx:{display:'flex',position:'relative',width:'max-content','&:focus-within':{'.MuiButtonBase-root':{borderColor:y.palette.primary.main||'#2C63E5',borderLeftColor:y.palette.primary[200]||'#BFD2FD'},'.MuiInputBase-input':{borderColor:y.palette.primary.main||'#2C63E5'}}},children:[m&&e.jsx(ar,{options:[],size:n,width:'104px',hideCrossIcon:!0,hideTickIcon:!0,sx:{'& .MuiInputBase-input':{borderRight:'none !important',borderTopRightRadius:'0px !important',borderBottomRightRadius:'0px !important'}},disabled:c,...f}),e.jsx(Kt,{placeholder:x,size:n,width:p??('small'===n?'208px':'272px'),sx:[{'& .MuiInputBase-input':{borderRight:'none',borderTopRightRadius:'0px !important',borderBottomRightRadius:'0px !important',cursor:'text',paddingRight:'30px'}},m&&{'& .MuiInputBase-input':{borderRadius:'0px !important'}},g&&{'& .MuiInputBase-input':{borderColor:y.palette.primary.main,color:y.palette.primary.main}}],...h,disabled:c,value:j,ref:b,onChange:e=>(e=>{C(e.target.value),l&&l(e)})(e),onKeyDown:e=>{'Enter'===e.key&&(e.preventDefault(),d&&d(e.target.value))}}),j&&e.jsx(te.default,{onClick:()=>{b?.current?.focus&&b?.current?.focus(),C(''),l&&l({target:{value:''}}),s&&s()},disabled:c,sx:[{padding:0,position:'absolute',right:'small'===n?'42px':'48px',top:'small'===n?'8px':'12px'},g&&{color:y.palette.primary.main}],children:e.jsx(nt,{sx:{fontSize:'16px'}})}),'outlined'===o?e.jsx(ot,{size:n,disableRipple:!0,variant:'outlined',disabled:c,icon:e.jsx(Jt,{}),onClick:()=>d&&d(j),sx:{borderTopLeftRadius:0,borderLeft:`1px solid ${y.palette.primary[200]}`,borderBottomLeftRadius:0,borderColor:g?y.palette.primary.main:y.palette.grey[100]||'#A1A1A1',': hover':{borderColor:y.palette.grey[100]||'#A1A1A1',backgroundColor:'#ffffff',borderLeft:`1px solid ${y.palette.primary[200]}`}}}):e.jsx(ot,{size:n,icon:e.jsx(Jt,{}),disabled:c,onClick:()=>d&&d(j),sx:{borderTopLeftRadius:0,borderBottomLeftRadius:0}})]})},Qt=e=>{const t='string'==typeof e?parseFloat(e):Number(e),r=new Intl.NumberFormat('en-US',{notation:'compact',compactDisplay:'short'}).format(t);return isNaN(parseInt(r))?'0':r},er=e=>{const t='string'==typeof e?parseFloat(e):Number(e),r=new Intl.NumberFormat('en-IN').format(t);return isNaN(parseInt(r))?'0':r},tr={small:'240px',medium:'312px'},rr=t.forwardRef((({id:i,size:o='medium',options:n,width:a,getOptionLabel:l,getOptionProps:s,getOptionValue:d,isOptionSelected:c,isOptionDisabled:p,getBadgeLabel:x,multiple:h=!1,onSelectAll:u,showSearch:m=!1,showSelectAll:g=!1,allOptionsSelected:f,selectedOptions:y,hideTickIcon:b=!1},j)=>{const[C,k]=t.useState(''),w=t.useDeferredValue(C),v=t.createRef(),S=r.debounce((e=>{k(e.target.value)}),300),F=t.useMemo((()=>n?.filter((e=>l(e).toLocaleLowerCase().includes(w.toLocaleLowerCase())))),[w,n]),A='small'===o?36:44;return t.useEffect((()=>{if(v.current&&y&&y?.length>0){const e=F?.findIndex((e=>d(e)===d(y[0])));-1!==e&&v.current?.scrollToItem(e,'center')}}),[y]),e.jsxs(r.Paper,{component:'div',ref:j,sx:{width:a??tr[o],boxShadow:'0px 4px 8px 0px #1A1A1A33',borderRadius:'4px',position:'relative',height:'min-content',maxHeight:'375px',backgroundColor:'#fff',zIndex:999,paddingTop:m?'14px':0},id:i,className:'listbox',children:[m&&e.jsx('div',{style:{display:'flex',justifyContent:'center'},children:e.jsx(Xt,{placeholder:'Search',size:o,defaultValue:C,width:'string'==typeof a?`calc(${a} - 64px)`:'number'==typeof a?a-64:a,onChange:S,onClear:()=>{k('')},buttonVariant:'contained',textboxProps:{autoFocus:!0,autoComplete:'off',id:`${i}-searchbox`,onKeyPress:e=>{'Enter'===e.key&&S(e.target.value)}}})}),e.jsxs(r.List,{sx:{height:'min-content',maxHeight:'304px',overflow:'auto'},children:[h&&g&&e.jsx(r.ListItem,{disablePadding:!0,children:e.jsxs(r.ListItemButton,{disableRipple:!0,onClick:u,sx:{padding:'small'===o?'8px 16px':'10px 16px',backgroundColor:'#FFFFFF',height:'small'===o?'32px':'40px',position:'relative',boxSizing:'border-box',marginTop:'4px','&: hover':{backgroundColor:'#F5F8FF'},'&: focus':{border:'2px solid #BFD2FD',backgroundColor:'#FFFFFF',padding:'small'===o?'6px 14px':'8px 14px',boxSizing:'border-box'}},children:[e.jsx(r.ListItemIcon,{sx:{minWidth:'24px'},children:e.jsx(ht,{checked:f,tabIndex:-1,disableRipple:!0,size:o})}),e.jsx(r.Typography,{variant:'small'===o?'body2':'body1',color:'#1A1A1A',children:'All'})]})}),e.jsx(D.FixedSizeList,{height:Math.min(304-A,F.length*A),itemCount:F.length??0,itemSize:A,width:'100%',itemData:F,ref:v,children:({data:t,index:n,style:a})=>{const u=t[n],m=`checkbox-list-label-${u}`,g=c(u),f=p(u),y=Boolean(x);return e.jsx(r.ListItem,{id:(e=>`${i}-option-${d(e)}`)(u),disablePadding:!0,style:a,children:e.jsxs(r.ListItemButton,{disableRipple:!0,disabled:f,sx:{padding:'small'===o?'8px 16px':'10px 16px',backgroundColor:f?'#F8F8F8':g?'#F5F8FF':'#FFFFFF',height:'small'===o?y?'44px':'32px':y?'48px':'40px',position:'relative',boxSizing:'border-box',marginTop:'4px','&: hover':{backgroundColor:'#F5F8FF'},'&: focus':{border:'2px solid #BFD2FD',backgroundColor:g?'#F5F8FF':'#FFFFFF',padding:'small'===o?'6px 14px':'8px 14px',boxSizing:'border-box'}},...s(u),children:[h&&e.jsx(r.ListItemIcon,{sx:{minWidth:'40px'},children:e.jsx(ht,{checked:g,tabIndex:-1,disableRipple:!0,inputProps:{'aria-labelledby':m},size:o,sx:{marginLeft:'16px'}})}),e.jsxs(r.Box,{sx:{display:'flex',alignItems:'center',gap:'10px',flex:1,justifyContent:'space-between'},children:[e.jsx(r.Typography,{variant:'body2',id:m,sx:{alignText:'center'},children:l(u)}),y&&e.jsx(r.Box,{sx:{height:'24px',minWidth:'22px',display:'flex',justifyContent:'center',alignItems:'center',backgroundColor:'#91B0FA',borderRadius:'4px',boxSizing:'border-box',padding:'4px'},children:e.jsx(r.Typography,{variant:'body2',id:m,children:Qt(u.count)})})]}),!b&&!h&&g&&e.jsx(_e,{htmlColor:'#2C63E5',sx:{position:'absolute',right:'16px',fontSize:'16px'}})]})},d(u))}})]})]})}));rr.displayName='Listbox';const ir=({anchorEl:t,setAnchorEl:i,children:o,parentElement:n})=>e.jsx(r.ClickAwayListener,{onClickAway:()=>i(null),children:e.jsxs('div',{children:[n,e.jsx(r.Popper,{id:'main-menu',open:Boolean(t),anchorEl:t,placement:'bottom',style:{zIndex:999999},children:o})]})}),or=e=>''===e?[e]:e?Array.isArray(e)?e:[e]:void 0,nr=({options:e=[],defaultValue:i,getOptionValue:o=(e=>e),isOptionDisabled:n=(()=>!1),multiple:a,onChange:l,value:s})=>{const[d,c]=r.useControlled({controlled:or(s),default:or(i),name:'Dropdown'}),[p,x]=t.useState((or(i)??or(s)??[]).reduce(((e,t)=>(e[o(t)]=!0,e)),{})),h=t.useMemo((()=>e?.filter((e=>!n(e)))),[e]),[u,m]=t.useState(!1);t.useEffect((()=>{d?.length===h.length?m(!0):m(!1)}),[d,h]);const g=t.useCallback((e=>({onClick:()=>{if(a){const t=o(e);if(p[t]){const e=d?.filter((e=>o(e)!==t));c(e),x((e=>({...e,[t]:!1}))),l?.(e,e?.map((e=>o(e))))}else{const r=[...d??[],e];c(r),x((e=>({...e,[t]:!0}))),l?.(r,r?.map((e=>o(e))))}}else c(s=[e]),C(null),l?.(e,o(e))}})),[e,d]),f=t.useCallback((()=>{u?(c([]),x({}),l?.(a?[]:'',a?[]:'')):(c([...h]),x(h.reduce(((e,t)=>(e[o(t)]=!0,e)),{})),l?.(a?[...h]:[...h]?.[0],a?[...h]?.map((e=>o(e))):[...h]?.[0]&&o([...h]?.[0])))}),[u,e,d,h]),y=t.useCallback((()=>{c([]),x({}),l?.(a?[]:'',a?[]:'')}),[c]),b=t.useCallback((e=>{const t=o(e);return(d??[])?.map((e=>o(e))).includes(t)}),[d]),[j,C]=t.useState(null),k=t.useRef(),w=t.useRef();return{anchorEl:j,setAnchorEl:C,boxRef:w,isOptionSelected:b,listBoxRef:k,handleSelectAll:f,handleClearAll:y,getOptionProps:g,selectedOptions:d?.filter((e=>Object.keys(e).length>0)),allOptionsSelected:u}};function ar({label:t,placeholder:r,required:o,width:n=312,alert:a,options:l=[],defaultValue:s,value:d,size:c='medium',onChange:p,disabled:x,getOptionLabel:h=(e=>e),getOptionValue:u=(e=>e),isOptionDisabled:m=(()=>!1),getBadgeLabel:g,getBadgeOptions:f,getInputLabel:y=((e,t)=>e?.length?e?.length>1?`${e.length} items selected`:t(e[0])??'':''),showSearch:b=!1,showSelectAll:j=!1,multiple:C=!1,hideCrossIcon:k=!1,hideTickIcon:w=!1,highLightOnValue:v=!1,sx:S}){const D=i.useTheme(),F=ye.default(),{anchorEl:A,boxRef:M,getOptionProps:B,handleSelectAll:z,isOptionSelected:L,listBoxRef:T,selectedOptions:I,setAnchorEl:E,allOptionsSelected:R,handleClearAll:P}=nr({options:l,defaultValue:s,getOptionValue:u,isOptionDisabled:m,multiple:C,onChange:p,value:d}),H=Boolean(y(I,h,u)),V='small'===c?32+(t?20:0):40+(t?28:0);return e.jsx(ee.default,{ref:M,id:F,sx:[{height:V+'px',width:'max-content'},{'.listbox':{visibility:'hidden'},'&:focus-within':{'.listbox':{visibility:'visible'}}},...Boolean(S)&&Array.isArray(S)?S:[],Boolean(S)&&!Array.isArray(S)?S:{}],children:e.jsx(ir,{anchorEl:A,setAnchorEl:E,parentElement:e.jsxs(ee.default,{sx:{position:'relative'},onClick:()=>{x||E(A?null:M.current)},children:[(t||o)&&e.jsx(dt,{label:t,required:o,variant:'small'===c?'h6':'h5',mb:'small'===c?'4px':1}),e.jsx(Ut,{placeholder:r,required:o,width:n,size:c,alert:!(!a&&I)&&a,value:y(I,h,u),disabled:x,sx:[{'& .MuiInputBase-input':{...!x&&{backgroundImage:'url(/assets/DropdownIcon.svg)'},backgroundRepeat:'no-repeat',backgroundPosition:'calc(100% - 12px) calc(50%)',caretColor:'transparent',cursor:x?'not-allowed':'pointer'}},v&&H&&{'& .MuiInputBase-input':{borderColor:D.palette.primary.main,color:D.palette.primary.main}}]}),!k&&I?.length>0&&e.jsx(te.default,{onClick:e=>{e.stopPropagation(),!x&&P()},sx:[{position:'absolute',right:'28px',bottom:'small'===c?'2px':'6px'},v&&H&&{color:D.palette.primary.main}],disabled:x,children:!x&&e.jsx(nt,{sx:{fontSize:'12px'}})})]}),children:e.jsx(rr,{ref:T,id:`${F}-listbox`,width:n??('small'===c?240:266),options:l,allOptionsSelected:R,getOptionLabel:h,getOptionValue:u,getOptionProps:B,isOptionSelected:L,isOptionDisabled:m,getBadgeLabel:g,size:c,getBadgeOptions:f,multiple:C,onSelectAll:z,showSearch:b,showSelectAll:j,selectedOptions:I,hideTickIcon:w})})})}const lr={paper:{large:{width:'372px',minHeight:'443px'},medium:{width:'320px',minHeight:'395px'},small:{width:'264px',minHeight:'347px'}},cell:{large:{width:'48px',height:'48px'},medium:{width:'40px',height:'40px'},small:{width:'32px',height:'32px'}}},sr=r.styled((t=>e.jsx(r.Box,{sx:{width:'min-content',margin:'auto'},children:e.jsx(ge.default,{...t,showNavigation:!1})})))((({theme:e,size:t})=>({'& .react-calendar__viewContainer':{padding:'16px'},'& .react-calendar__month-view__weekdays':{...'small'===t&&e.typography.body2,...'medium'===t&&e.typography.body1,...'large'===t&&e.typography.h6,textAlign:'center','& > .react-calendar__month-view__weekdays__weekday':{width:lr.cell[t].width,height:lr.cell[t].height,display:'flex',alignItems:'center',justifyContent:'center'},'& abbr[title]':{textDecoration:'none !important'}},'& .react-calendar__tile':{background:'#ffffff',color:'#1A1A1A',borderRadius:'4px',border:'none',...e.typography.body1,...lr.cell[t],'&:disabled':{color:'#A1A1A1 !important'},'&:hover':{backgroundColor:'#F5F8FF'},'&:focus':{outline:'none',border:'1px solid #264CA4'}},'& .react-calendar__tile--active':{background:'#2C63E5',color:'#ffffff','&:hover':{backgroundColor:'#264CA4'}},'& .react-calendar__month-view__days__day--neighboringMonth':{color:'#A1A1A1'},'& .react-calendar__tile--active.react-calendar__month-view__days__day--neighboringMonth':{color:'#A1A1A1',backgroundColor:'#F2F2F2 !important'}}))),dr=({size:i='medium',defaultValue:o,onChange:n,value:a,maxDate:l,minDate:s,MonthLeftIcon:d=e.jsx(_t,{fontSize:'small'}),MonthRightIcon:c=e.jsx(Gt,{fontSize:'small'}),monthsLabel:p=Zt})=>{const x=(new Date).getFullYear()-25,[h,u]=r.useControlled({default:o??a??new Date,controlled:a,name:'Calendar'}),m=t.useCallback((e=>{const t=h;e.setHours(t.getHours(),t.getMinutes(),t.getSeconds()),n&&n(e),u(e)}),[h]);return e.jsxs(r.Box,{children:[e.jsxs(r.Box,{sx:{display:'flex',justifyContent:'space-between',padding:'small'===i?'0 16px':'0 20px',paddingBottom:'0px',boxSizing:'border-box'},children:[e.jsxs(r.Box,{sx:{display:'flex',gap:'small'===i?1:2},children:[e.jsx(ar,{size:'small',width:106,value:{id:p[w.getMonth(h)],name:p[w.getMonth(h)]},options:p.map((e=>({id:e,name:e}))),onChange:e=>{const t=new Date(h);t.setMonth(p.findIndex((t=>t===e?.id))),m(t)},getOptionLabel:e=>e.name,getOptionValue:e=>e.id,hideCrossIcon:!0}),e.jsx(ar,{size:'small',width:80,value:{id:w.getYear(h),name:w.getYear(h)},onChange:e=>{const t=new Date(h);t.setFullYear(e?.id),m(t)},options:new Array(50).fill(10).map(((e,t)=>({id:t+x,name:t+x}))),getOptionLabel:e=>e.name.toString(),getOptionValue:e=>e.id.toString(),hideCrossIcon:!0})]}),e.jsxs(r.Box,{sx:{display:'flex',gap:1,alignItems:'center','& > span':{cursor:'pointer'},'& svg':{lineHeight:'24px',verticalAlign:'middle'}},children:[e.jsx('span',{onClick:()=>{m(w.subMonths(h,1))},children:d}),e.jsx('span',{onClick:()=>{m(w.addMonths(h,1))},children:c})]})]}),e.jsx(sr,{size:i,showNavigation:!1,activeStartDate:h,value:h,onChange:m,maxDate:l,minDate:s})]})},cr=({size:t='medium',applyButtonProps:i,cancelButtonProps:o,containerProps:n})=>e.jsxs(r.Box,{...n,sx:[{display:'flex',backgroundColor:'#F5F8FF',height:'64px',justifyContent:'center',alignItems:'center',borderBottomLeftRadius:'4px',borderBottomRightRadius:'4px'},...n?.sx??[]],children:[e.jsx(st,{text:'Cancel',variant:'outlined',color:'secondary',sx:{marginRight:'small'===t?'16px':'24px',width:'small'===t?'98px':'117px'},...o}),e.jsx(st,{text:'Apply',variant:'contained',color:'primary',sx:{width:'small'===t?'98px':'117px'},...i})]}),pr={large:{width:'372px',minHeight:'432px'},medium:{width:'320px',minHeight:'384px'},small:{width:'280px',minHeight:'336px'}},xr=({children:t,size:i,actionProps:o,showActions:n=!0})=>e.jsxs(r.Paper,{elevation:0,sx:[{boxSizing:'border-box',paddingTop:'16px',boxShadow:'0px 24px 40px 0px #1A1A1A29',borderRadius:'4px',...pr[i]}],children:[t,n&&e.jsx(cr,{...o})]}),hr=({defaultValue:t,onApply:i,onCancel:o,onChange:n,size:a='medium',value:l})=>{const[s,d]=r.useControlled({default:t??new Date,controlled:l,name:'Date Picker'});return e.jsx(xr,{size:a,actionProps:{size:a,cancelButtonProps:{onClick:()=>o&&o(s)},applyButtonProps:{onClick:()=>i&&i(s)}},children:e.jsx(dr,{size:a,defaultValue:t,value:s,onChange:e=>{d(e),n&&n(e)}})})},ur=({anchorEl:i,setAnchorEl:o,children:n,parentElement:a,containerProps:l,popperProps:s})=>{const d=t.useId();return e.jsx(r.ClickAwayListener,{onClickAway:()=>o(null),children:e.jsxs('div',{...l,children:[a,e.jsx(r.Modal,{open:Boolean(i),onClose:()=>o(null),disableScrollLock:!1,style:{zIndex:999999},children:e.jsx(r.Popper,{modifiers:[{name:'preventOverflow',enabled:!0,options:{altAxis:!0,altBoundary:!0,tether:!0,rootBoundary:'document',padding:8}}],placement:'right',style:{zIndex:999999},...s,id:d,open:Boolean(i),anchorEl:i,children:n})})]})})},mr=({initialValue:e,value:r,isEqual:i,onChange:o})=>{const[n,a]=t.useState(e);return t.useEffect((()=>{r?o&&!i(n,r)&&o(n):o&&o(n)}),[n]),t.useEffect((()=>{r&&!i(n,r)&&a(r)}),[r]),[n,a]},gr=[{label:'Today',range:()=>({startDate:w.startOfDay(new Date),endDate:w.endOfDay(new Date)}),isSelected:e=>w.isEqual(e.startDate,w.startOfDay(new Date))&&w.isEqual(e.endDate,w.endOfDay(new Date))},{label:'Yesterday',range:()=>({startDate:w.startOfDay(w.subDays(new Date,1)),endDate:w.endOfDay(w.subDays(new Date,1))}),isSelected:e=>w.isEqual(e.startDate,w.startOfDay(w.subDays(new Date,1)))&&w.isEqual(e.endDate,w.endOfDay(w.subDays(new Date,1)))},{label:'This Week',range:()=>({startDate:w.startOfWeek(new Date),endDate:w.endOfDay(new Date)}),isSelected:e=>w.isEqual(e.startDate,w.startOfWeek(new Date))&&w.isEqual(e.endDate,w.endOfDay(new Date))},{label:'Last Week',range:()=>({startDate:w.subDays(w.startOfWeek(new Date),7),endDate:w.endOfDay(w.subDays(w.startOfWeek(new Date),1))}),isSelected:e=>w.isEqual(e.startDate,w.subDays(w.startOfWeek(new Date),7))&&w.isEqual(e.endDate,w.endOfDay(w.subDays(w.startOfWeek(new Date),1)))},{label:'This Month',range:()=>({startDate:w.startOfMonth(new Date),endDate:w.endOfDay(new Date)}),isSelected:e=>w.isEqual(e.startDate,w.startOfMonth(new Date))&&w.isEqual(e.endDate,w.endOfDay(new Date))},{label:'Last Month',range:()=>({startDate:w.subMonths(w.startOfMonth(new Date),1),endDate:w.endOfDay(w.subDays(w.startOfMonth(new Date),1))}),isSelected:e=>w.isEqual(e.startDate,w.subMonths(w.startOfMonth(new Date),1))&&w.isEqual(e.endDate,w.endOfDay(w.subDays(w.startOfMonth(new Date),1)))},{label:'Last 3 Months',range:()=>({startDate:w.subMonths(w.startOfMonth(new Date),3),endDate:w.endOfDay(w.subDays(w.startOfMonth(new Date),1))}),isSelected:e=>w.isEqual(e.startDate,w.subMonths(w.startOfMonth(new Date),3))&&w.isEqual(e.endDate,w.endOfDay(w.subDays(w.startOfMonth(new Date),1)))},{label:'Last 6 Months',range:()=>({startDate:w.subMonths(w.startOfMonth(new Date),6),endDate:w.endOfDay(w.subDays(w.startOfMonth(new Date),1))}),isSelected:e=>w.isEqual(e.startDate,w.subMonths(w.startOfMonth(new Date),6))&&w.isEqual(e.endDate,w.endOfDay(w.subDays(w.startOfMonth(new Date),1)))},{label:'Last 12 Months',range:()=>({startDate:w.startOfMonth(w.subYears(new Date,1)),endDate:w.endOfDay(new Date)}),isSelected:e=>w.isEqual(e.startDate,w.startOfMonth(w.subYears(new Date,1)))&&w.isEqual(e.endDate,w.endOfDay(new Date))}],fr=({sx:t,checked:r=!1,size:o='medium',label:n,disabled:a=!1,alert:l=!1,...s})=>{const d=i.useTheme();return e.jsxs(ee.default,{sx:[{display:'flex',alignItems:'center',flexDirection:'row',width:'max-content',height:'auto','&>span:hover':{backgroundColor:'transparent !important'},...'small'===o&&{'& svg':{fontSize:'12px'},'&>span':{width:'16px',boxSizing:'border-box',padding:0}},...'medium'===o&&{'& svg':{fontSize:'16px'},'&>span':{boxSizing:'border-box',padding:0}}},...Boolean(t)&&Array.isArray(t)?t:[],Boolean(t)&&!Array.isArray(t)?t:{}],children:[e.jsx(be.default,{checked:r,disabled:a,size:o,disableRipple:!0,disableTouchRipple:!0,disableFocusRipple:!0,color:'primary',...s,sx:[{...!r&&{color:'#C7C7C7 !important',...l&&!a&&{color:`${d.palette?.error?.main} !important`}},'&&:hover':{color:`${d.palette.primary.main} !important`},...a&&{color:`${d.palette.grey[100]} !important`}}]}),n&&e.jsx(dt,{sx:{color:a?'grey.100':'common.black',ml:'small'===o?'4px':1,cursor:'default'},label:n,variant:'small'===o?'body2':'body1'})]})},yr=({value:t,defaultValue:i,onChange:o,dateRanges:n=gr,view:a='column',sx:l})=>{const[s,d]=r.useControlled({default:i,controlled:t,name:'Date Range Selector'});return e.jsx(r.Box,{sx:['column'===a&&{width:'280px',gap:2,display:'flex',flexWrap:'wrap'},'row'===a&&{width:'144px',borderRight:'1px solid #E0E0E0'},...Boolean(l)&&Array.isArray(l)?l:[],Boolean(l)&&!Array.isArray(l)?l:{}],children:n.map((t=>e.jsx(fr,{label:t.label,size:'medium',sx:{mb:2},checked:t.isSelected(s),onClick:()=>{d(t.range()),o?.(t.range())}},t.label)))})},br=({defaultValue:t,value:i,onChange:o,onApply:n,onCancel:a,size:l,rangeSelectionView:s='row',customDateRanges:d,hideDateRange:c})=>{const[p,x]=mr({initialValue:t??i??{startDate:A.startOfDay(new Date),endDate:A.endOfDay(new Date)},value:i,onChange:o,isEqual:(e,t)=>w.isEqual(e.startDate,t.startDate)&&w.isEqual(e.endDate,t.endDate)});let h=gr;return'function'==typeof d?h=d(gr):Array.isArray(d)&&(h=d),e.jsxs(r.Paper,{elevation:0,sx:[{boxSizing:'border-box',boxShadow:'0px 24px 40px 0px #1A1A1A29',borderRadius:'4px'}],children:[e.jsxs(r.Box,{display:'flex',justifyContent:'space-between',padding:4,gap:4,children:[c?null:e.jsx(yr,{value:p,onChange:e=>x(e),view:s,dateRanges:h}),e.jsxs(r.Box,{children:[e.jsx(r.Typography,{variant:'h5',color:'primary',mb:2,children:'Start Date'}),e.jsx(dr,{size:l,maxDate:p.endDate,value:p.startDate,onChange:e=>x((t=>({...t,startDate:e})))})]}),e.jsxs(r.Box,{children:[e.jsx(r.Typography,{variant:'h5',color:'primary',mb:2,children:'End Date'}),e.jsx(dr,{size:l,minDate:p.startDate,value:p.endDate,onChange:e=>x((t=>({...t,endDate:e})))})]})]}),e.jsx(cr,{containerProps:{sx:[{justifyContent:'flex-end',height:'80px !important',px:5,py:0}]},applyButtonProps:{disabled:w.isAfter(p.startDate,p.endDate),onClick:()=>n&&n(p)},cancelButtonProps:{onClick:()=>a&&a(p)}})]})},jr=t=>e.jsx(r.SvgIcon,{width:'16',height:'16',viewBox:'0 0 16 16',fill:'none',xmlns:'http://www.w3.org/2000/svg',...t,children:e.jsx('path',{d:'M4 6L8.48875 10.4325L13 6',stroke:'#2C63E5',strokeMiterlimit:'10',strokeLinecap:'round',strokeLinejoin:'round',fill:'transparent'})}),Cr=t=>e.jsx(r.SvgIcon,{width:'16',height:'16',viewBox:'0 0 16 16',fill:'none',xmlns:'http://www.w3.org/2000/svg',...t,children:e.jsx('path',{d:'M4 10.4326L8.48875 6.00012L13 10.4326',stroke:'#2C63E5',strokeMiterlimit:'10',strokeLinecap:'round',strokeLinejoin:'round',fill:'transparent'})}),kr={small:{root:{width:28,height:16},switchBase:{transform:12},thumb:{width:12,height:12}},medium:{root:{width:36,height:20},switchBase:{transform:16},thumb:{width:16,height:16}}},wr=({checked:t,label:r,sx:o,size:n='medium',disabled:a,colored:l,...s})=>{const d=i.useTheme();return e.jsxs(ee.default,{sx:[{display:'flex','&>p':{marginRight:'4px'}}],children:[r&&e.jsx(le.default,{variant:'small'===n?'body2':'body1',sx:[a&&{color:d.palette.grey[100]}],children:r}),e.jsx(je.default,{focusVisibleClassName:'.Mui-focusVisible',disableRipple:!0,size:n,checked:t,disabled:a,sx:[{width:`${kr[n].root.width}px`,height:`${kr[n].root.height}px`,padding:0,borderRadius:'5000px','& .MuiSwitch-switchBase':{padding:0,margin:'1.5px',transitionDuration:'300ms','& + .MuiSwitch-track':{backgroundColor:`${l?d.palette?.primary?.main:d.palette?.error?.main}`},'&.Mui-disabled + .MuiSwitch-track':{opacity:1,backgroundColor:d.palette[l?'primary':'error'].light},'&.Mui-checked':{transform:`translateX(${kr[n].switchBase.transform}px)`,color:'#fff','& + .MuiSwitch-track':{opacity:1,border:0,backgroundColor:`${l?d.palette?.primary?.[a?'light':'main']:d.palette?.error?.[a?'light':'main']}`}}},'& .MuiSwitch-thumb':{boxSizing:'border-box',width:`${kr[n].thumb.width}px`,height:`${kr[n].thumb.height}px`,color:'#ffffff',boxShadow:'none'},'& .MuiSwitch-track':{opacity:1}},...Boolean(o)&&Array.isArray(o)?o:[],Boolean(o)&&!Array.isArray(o)?o:{}],...s})]})},vr={paper:{large:{width:'372px',minHeight:'443px'},medium:{width:'320px',minHeight:'395px'},small:{width:'280px',minHeight:'347px'}},container:{large:{width:'230px',height:'347px'},medium:{width:'230px',height:'297px'},small:{width:'194px',height:'160px'}},timeInput:{box:{large:{width:'64px',height:'118px'},medium:{width:'64px',height:'118px'},small:{width:'56px',height:'118px'}},button:{border:'1px solid #BFD2FD',background:'#F5F8FF',flex:1},large:{width:'48px',height:'48px'},medium:{width:'40px',height:'40px'},small:{width:'32px',height:'32px'}}},Sr=({defaultValue:t,value:i,size:o,type:n='hour',timeFormat:a=24,onChange:l})=>{const s=r.useTheme(),{currentValue:d,handleInput:c,handleNext:p,handlePrev:x}=(({defaultValue:e,value:t,type:i='hour',onChange:o})=>{const[n,a]=r.useControlled({default:e??t??new Date,controlled:t,name:'Time'});return{currentValue:n,handleInput:e=>{let t,r=parseInt(e.target.value)??0;t='hour'===i?w.setHours(n,r%24):w.setMinutes(n,r%60),a(t),o&&o(t)},handleNext:()=>{let e;if('hour'===i){const t=n.getHours();e=w.setHours(n,t+1)}else{const t=n.getMinutes();e=w.setMinutes(n,t+1)}e.setDate(n.getDate()),e.setMonth(n.getMonth()),e.setFullYear(n.getFullYear()),a(e),o&&o(e)},handlePrev:()=>{let e;if('hour'===i){const t=n.getHours();e=w.setHours(n,t-1)}else{const t=n.getMinutes();e=w.setMinutes(n,t-1)}e.setDate(n.getDate()),e.setMonth(n.getMonth()),e.setFullYear(n.getFullYear()),a(e),o&&o(e)}}})({defaultValue:t,value:i,type:n,onChange:l});return e.jsxs(r.Box,{sx:[{display:'flex',flexDirection:'column',...vr.timeInput.box[o]},{'& input::-webkit-outer-spin-button,input::-webkit-inner-spin-button':{WebkitAppearance:'none',margin:0},'& input[type=number]':{MozAppearance:'textfield'},'& input':{color:'#666666','&: focus':{border:'1px solid #2C63E5 !important'}}}],children:[e.jsx('button',{style:{...vr.timeInput.button,borderTopLeftRadius:'4px',borderTopRightRadius:'4px',borderBottom:'none',boxSizing:'border-box'},onClick:p,children:e.jsx(Cr,{})}),e.jsx('input',{style:{height:'56px',border:'1px solid #C7C7C7',backgroundColor:'#ffffff',boxSizing:'border-box',outline:'none',textAlign:'center',...s.typography.h4},type:'number',value:'hour'===n?w.format(d,12===a?'hh':'HH'):w.format(d,'mm'),onChange:c}),e.jsx('button',{style:{...vr.timeInput.button,borderBottomLeftRadius:'4px',borderBottomRightRadius:'4px',borderTop:'none',boxSizing:'border-box'},onClick:x,children:e.jsx(jr,{})})]})},Dr=({size:i='medium',defaultValue:o,onChange:n,value:a,showTimeFormatToggle:l=!0,defaultTimeFormat:s=24,meridianLabels:d=Yt})=>{const[c,p]=r.useControlled({default:o??new Date,controlled:a,name:'Time Changer'}),[x,h]=t.useState(s),u=e=>{const t=e.target.value,r=new Date(c),i=c.getHours();'AM'===t&&i>=12?r.setHours(i-12):'PM'===t&&i<12&&r.setHours(i+12),p(r),n?.(r,x)},m=e=>{p(new Date(e)),n?.(new Date(e),x)};return e.jsxs(r.Box,{children:[l&&e.jsx(r.Box,{display:'flex',justifyContent:'flex-end',paddingRight:'24px',children:e.jsx(wr,{label:'Use 24-hour format',size:'medium',checked:24===x,onClick:()=>{h((e=>12===e?24:12)),n?.(c,12===x?24:12)},sx:{'.MuiSwitch-switchBase':{margin:'2px !important'},'.MuiSwitch-switchBase+.MuiSwitch-track':{backgroundColor:'#A1A1A1 !important'},'.MuiSwitch-switchBase.Mui-checked+.MuiSwitch-track':{backgroundColor:'#2C63E5 !important'}}})}),e.jsxs(r.Box,{height:l?vr.container[i].height:'auto',width:vr.container[i].width,display:'flex',alignItems:'center',justifyContent:'center',margin:'auto',children:[e.jsxs(r.Box,{sx:{width:'small'===i?'135px':'167px'},children:[e.jsxs(r.Box,{display:'flex',alignItems:'center',justifyContent:'space-between',children:[e.jsx(Sr,{value:c,size:i,type:'hour',timeFormat:x,onChange:m}),e.jsx(r.Typography,{variant:'h2',sx:{color:'#666666'},children:':'}),e.jsx(Sr,{value:c,size:i,type:'minute',timeFormat:x,onChange:m})]}),e.jsxs(r.Box,{display:'flex',alignItems:'center',justifyContent:'space-between',marginTop:'8px',children:[e.jsx(r.Typography,{variant:'body1',sx:{color:'#666666',width:'64px'},children:'Hour'}),e.jsx(r.Typography,{variant:'body1',sx:{color:'#666666',width:'64px'},children:'Minute'})]})]}),e.jsx(r.Box,{children:12===x&&e.jsx(r.Box,{sx:{ml:1,mb:3},children:d.map((t=>e.jsx(fr,{label:t,value:t,size:'medium',sx:{height:'20px'},checked:'AM'===t?c.getHours()<12:c.getHours()>=12,onChange:u},t)))})})]})]})},Fr=({defaultValue:t,onApply:i,onCancel:o,onChange:n,size:a='medium',value:l,...s})=>{const[d,c]=r.useControlled({default:t??new Date,controlled:l,name:'Time Picker'});return e.jsx(xr,{size:a,actionProps:{size:a,cancelButtonProps:{onClick:()=>o&&o(d)},applyButtonProps:{onClick:()=>i&&i(d)}},children:e.jsx(Dr,{size:a,defaultValue:t,value:d,onChange:c,...s})})},Ar=({tabs:t,size:o='small',width:n=100,onTabChange:a,value:l,sx:s,tabSx:d,initialTabValue:c,disabled:p=!1,...x})=>{const h=i.useTheme(),[u,m]=r.useControlled({controlled:l,default:c,name:'Tabs'});return e.jsx(ee.default,{sx:{borderColor:'divider'},children:e.jsx(me.default,{value:u,indicatorColor:'primary',textColor:'primary',onChange:(e,t)=>{m(t),a&&a(t)},'aria-label':'disabled tabs example',sx:{minHeight:0,height:'small'===o?'36px':'40px','& .MuiTabs-indicator':{backgroundColor:`${p?h.palette.grey[400]:h.palette.primary.main}`},...s,'& .MuiTabs-root':{minHeight:'155px !important'}},...x,children:t?.map(((t,r)=>e.jsx(ue.default,{...x,disabled:p,...t,sx:{minHeight:0,height:'small'===o?'36px':'40px',color:h.palette.common.black,border:'none',textTransform:'none',...h.typography.h5,width:`${n}%`,'&:hover':{color:h.palette.primary.main},...d}},r)))})})},Mr={large:{width:'372px'},medium:{width:'320px'},small:{width:'280px'}},Br=({size:i='medium',defaultValue:o,onChange:n,value:a,onApply:l,onCancel:s})=>{const d=(e=>{const[r,i]=t.useState(e);return{active:r,handleActive:e=>i(e)}})(0),[c,p]=mr({initialValue:o??a??new Date,isEqual:(e,t)=>w.isEqual(e,t),onChange:n,value:a}),x=e=>p(e);return e.jsxs(r.Paper,{elevation:0,sx:[{boxSizing:'border-box',boxShadow:'0px 24px 40px 0px #1A1A1A29',height:'max-content',borderRadius:'4px',...Mr[i]}],children:[e.jsx(Ar,{tabs:[{id:0,label:'Date',style:{width:'50%'}},{id:1,label:'Time',style:{width:'50%'}}],size:'medium',value:d.active,onTabChange:d.handleActive}),0===d.active?e.jsx(hr,{size:i,value:c,onChange:x,onApply:l,onCancel:s}):e.jsx(Fr,{size:i,defaultValue:c,onChange:x,onApply:l,onCancel:s})]})},zr=({defaultValue:t,value:i,onChange:o,onApply:n,onCancel:a,size:l,rangeSelectionView:s='row',customDateRanges:d,setTimeFormat:c,timeFormat:p,hideDateRange:x})=>{const[h,u]=mr({initialValue:t??i??{startDate:w.startOfDay(new Date),endDate:w.endOfDay(new Date)},value:i,onChange:o,isEqual:(e,t)=>w.isEqual(e.startDate,t.startDate)&&w.isEqual(e.endDate,t.endDate)});let m=gr;return'function'==typeof d?m=d(gr):Array.isArray(d)&&(m=d),e.jsxs(r.Paper,{elevation:0,sx:[{width:'max-content',boxSizing:'border-box',boxShadow:'0px 24px 40px 0px #1A1A1A29',borderRadius:'4px'}],children:[e.jsxs(r.Box,{display:'flex',padding:'24px',flexWrap:'wrap',children:[x?null:e.jsxs(r.Box,{children:[e.jsx(r.Typography,{variant:'h5',color:'primary',mb:'16px',children:'Date Ranges'}),e.jsx(yr,{value:h,onChange:e=>u(e),view:s,dateRanges:m})]}),e.jsxs(r.Box,{display:'flex',px:'24px',flexWrap:'wrap',flexDirection:'column',children:[e.jsxs(r.Box,{display:'flex',flexWrap:'wrap',children:[e.jsxs(r.Box,{children:[e.jsx(r.Typography,{variant:'h5',color:'primary',mb:'16px',children:'Start Date'}),e.jsx(dr,{size:l,maxDate:h.endDate,value:h.startDate,onChange:e=>u((t=>({...t,startDate:e})))})]}),e.jsxs(r.Box,{children:[e.jsx(r.Typography,{variant:'h5',color:'primary',mb:'16px',children:'End Date'}),e.jsx(dr,{size:l,minDate:h.startDate,value:h.endDate,onChange:e=>u((t=>({...t,endDate:e})))})]})]}),e.jsxs(r.Box,{width:'100%',display:'flex',justifyContent:'space-around',children:[e.jsx(Dr,{size:l,value:h.startDate,onChange:(e,t)=>{u((t=>({...t,startDate:e}))),c&&t&&c((e=>({...e,t1:t})))},defaultTimeFormat:p?.t1}),e.jsx(Dr,{size:l,value:h.endDate,onChange:(e,t)=>{u((t=>({...t,endDate:e}))),c&&t&&c((e=>({...e,t2:t})))},defaultTimeFormat:p?.t2})]})]})]}),e.jsx(r.Box,{children:e.jsx(cr,{containerProps:{sx:[{justifyContent:'flex-end',height:'80px !important',padding:'0 40px'}]},applyButtonProps:{disabled:w.isAfter(h.startDate,h.endDate),onClick:()=>n&&n(h)},cancelButtonProps:{onClick:()=>a&&a(h)}})})]})},Lr=t.forwardRef((({label:t,sx:r,size:i='small',alert:o,id:n,required:a,disabled:l,ActionComponent:s,actionProps:d={},...c},p)=>e.jsxs(ee.default,{sx:[{flexWrap:'wrap',position:'relative',width:'max-content',...!t&&!a&&{height:'small'===i?'32px':'40px'}}],children:[(t||a)&&e.jsx(dt,{label:t,required:a,variant:'small'===i?'h6':'h5',mb:'small'===i?'4px':1}),e.jsx(Ut,{size:i,required:a,alert:o,id:n,sx:r,label:t,disabled:l,ref:p,...c}),s&&e.jsx(s,{...d,inputAlert:o,fromTextbox:!0,inputSize:i,inputReq:a,inputLabel:!!t&&t.length>0})]})));Lr.displayName='Textbox';const Tr=({onChange:r,value:i,size:o='medium',label:n,required:a,width:l=312})=>{const[s,d]=t.useState(null),c=t.useRef();return e.jsx(ur,{anchorEl:s,setAnchorEl:d,parentElement:e.jsx(Lr,{ref:c,width:l,size:'small',placeholder:'dd/mm/yy',label:n,ActionComponent:st,onClick:()=>d(c.current),onKeyDown:()=>d(c.current),value:i?w.format(i,'dd/MMM/yyyy'):'',required:a,actionProps:{sx:{minWidth:'32px !important','& .MuiButton-startIcon':{margin:0}},variant:'text',size:'small',startIcon:e.jsx(Le,{}),disableRipple:!0,onClick:()=>d(c.current)}}),popperProps:{modifiers:[]},children:e.jsx(hr,{size:o,defaultValue:i||new Date,onApply:e=>{r&&r(e),d(null)},onCancel:()=>{r?.(null),d(null)}})})},Ir=({onChange:r,value:i,size:o='medium',width:n=312,label:a,required:l,...s})=>{const[d,c]=t.useState(null),p=t.useRef();return e.jsx(ur,{anchorEl:d,setAnchorEl:c,parentElement:e.jsx(Lr,{ref:p,size:'small',placeholder:'eg: hh:mm',label:a,width:n,ActionComponent:st,onClick:()=>c(p.current),onKeyDown:()=>c(p.current),value:i?w.format(i,'HH:mm'):'',required:l,actionProps:{sx:{minWidth:'32px !important','& .MuiButton-startIcon':{margin:0}},variant:'text',size:'small',startIcon:e.jsx(Le,{}),disableRipple:!0,onClick:()=>c(p.current)}}),popperProps:{modifiers:[]},children:e.jsx(Fr,{size:o,defaultValue:i||new Date,onApply:e=>{r&&r(e),c(null)},onCancel:()=>c(null),defaultTimeFormat:24,...s})})},Er=({onChange:r,value:i,size:o='medium',label:n,required:a,width:l=312})=>{const[s,d]=t.useState(null),c=t.useRef();return e.jsx(ur,{anchorEl:s,setAnchorEl:d,parentElement:e.jsx(Lr,{ref:c,width:l,size:'small',placeholder:'dd/mm/yyyy @hh:mm a',label:n,ActionComponent:st,onClick:()=>d(c.current),onKeyDown:()=>d(c.current),value:i?w.format(i,'dd/MMM/yyyy @hh:mm a'):'',required:a,actionProps:{sx:{minWidth:'32px !important','& .MuiButton-startIcon':{margin:0}},variant:'text',size:'small',startIcon:e.jsx(Le,{}),disableRipple:!0,onClick:()=>d(c.current)}}),popperProps:{modifiers:[]},children:e.jsx(Br,{size:o,defaultValue:i||new Date,onApply:e=>{r&&r(e),d(null)},onCancel:()=>d(null)})})},Rr=({sx:t,label:r,placeholder:o,width:n=312,size:a='small',alert:l,value:s,id:d,onClick:c,required:p,disabled:x,...h})=>{const u=i.useTheme();return e.jsxs(ee.default,{sx:{flexWrap:'flex'},children:[(r||p)&&e.jsx(dt,{label:r,required:p,variant:'small'===a?'h6':'h5',mb:'small'===a?'4px':1}),e.jsx(fe.default,{multiline:!0,rows:3,sx:[{padding:0,'& .MuiInputBase-input':{resize:'none',color:u.palette.text.primary,borderRadius:'4px',position:'relative',...u.typography.body2,border:`1px solid ${u.palette.grey[300]}`,backgroundColor:x?'#F2F2F2':u.palette.common.white,width:n,borderColor:x?u.palette.grey[100]:l?u.palette.error.main:'',alignSelf:'flex-end',padding:'8px 12px',boxSizing:'border-box','&:focus':{borderColor:u.palette.primary.main}}},...Boolean(t)&&Array.isArray(t)?t:[],Boolean(t)&&!Array.isArray(t)?t:{}],placeholder:o,value:s,id:d,fullWidth:!0,required:p,disabled:x,onClick:c,...h})]})},Pr=({type:r,defaultValue:i,value:o,onChange:n,size:a,rangeSelectionView:l,customDateRanges:s,hideDateRange:d,dateButtonProps:c})=>{const p=t.useRef(null);o={startDate:o?.startDate||w.startOfToday(),endDate:o?.endDate||w.startOfTomorrow()};const[x,h]=t.useState(null),[u,m]=t.useState({t1:24,t2:24}),g=e=>{n&&n(e,u),h(null)},f=()=>{n?.(o),h(null)};return e.jsx(ur,{anchorEl:x,setAnchorEl:h,popperProps:{placement:'right-end'},parentElement:e.jsx(st,{onClick:e=>h(x?null:e.currentTarget),ref:p,text:(c&&c.value)??`${o?.startDate?w.format(o?.startDate,'dd-MM-yyyy | hh:mm a'):'-'} to ${o?.endDate?w.format(o?.endDate,'dd-MM-yyyy | hh:mm a'):'-'}`,variant:'outlined',size:'small',color:'primary',endIcon:c?.startIcon?null:e.jsx(Le,{}),...c}),children:'Date-time-range'===r?e.jsx(zr,{defaultValue:i,onApply:e=>g(e),onCancel:f,size:a,rangeSelectionView:l,setTimeFormat:m,timeFormat:u,customDateRanges:s,hideDateRange:d}):'Date-range'===r?e.jsx(br,{defaultValue:i,onApply:e=>g(e),onCancel:f,size:a,customDateRanges:s,rangeSelectionView:l,hideDateRange:d}):null})},Hr=i=>{const o=r.useTheme(),{form:n,errors:a,setFields:l,handleTextbox:s,handleValue:d}=i.form,c=e=>r.debounce((t=>{l({[e]:t.target.value})}),1e3),{config:p,highLightDropDownOnValue:x=!1}=i,{label:h,type:u,key:m}=p,{options:g,required:f,onChange:y,...b}=p?.props??{},j=(e,t)=>r=>{d(e,t)(r),y&&y(r)},C=n[p.key]??'',k=a[p?.key]??'',w=p?.props?.placeholder??h,v=t.useCallback((e=>()=>{C?.includes(e)?l({[m]:C.filter((t=>t!==e))}):l({[m]:[...C,e]})}),[C]);switch(u){case'Textbox':return e.jsxs(e.Fragment,{children:[e.jsx(Kt,{label:h,id:m,width:264,placeholder:w,required:f,...b,...p?.debounce&&{defaultValue:C,onChange:c(m)},...!Boolean(p?.debounce)&&{value:C,onChange:s(p.key)}}),k&&e.jsxs(r.Box,{sx:{display:'flex',alignItems:'center',pt:'4px',height:'25px',gap:'4px'},children:[e.jsx(z.Error,{sx:{color:o.palette.error.main},fontSize:'small'}),e.jsx(r.Typography,{variant:'h6',color:'error',children:k})]})]});case'Number':return e.jsxs(e.Fragment,{children:[e.jsx(Kt,{label:h,id:m,width:264,placeholder:w,required:f,type:'number',...b,...p?.debounce&&{defaultValue:C,onChange:c(m)},...!Boolean(p?.debounce)&&{value:C,onChange:s(p.key)}}),k&&e.jsxs(r.Box,{sx:{display:'flex',alignItems:'center',pt:'4px',height:'25px',gap:'4px'},children:[e.jsx(z.Error,{sx:{color:o.palette.error.main},fontSize:'small'}),e.jsx(r.Typography,{variant:'h6',color:'error',children:k})]})]});case'Textarea':return e.jsxs(e.Fragment,{children:[e.jsx(Rr,{id:m,label:h,width:264,placeholder:w,required:f,...b,...p?.debounce&&{defaultValue:C,onChange:c(m)},...!Boolean(p?.debounce)&&{value:C,onChange:s(p.key)}}),k&&e.jsxs(r.Box,{sx:{display:'flex',alignItems:'center',pt:'4px',height:'25px',gap:'4px'},children:[e.jsx(z.Error,{sx:{color:o.palette.error.main},fontSize:'small'}),e.jsx(r.Typography,{variant:'h6',color:'error',children:k})]})]});case'Checkbox':return e.jsxs(r.Box,{children:[e.jsx(dt,{required:f,label:h,variant:'h5',sx:{color:'common.black',mb:1}}),g?.map((t=>e.jsx(ht,{label:t?.label||t,sx:{mb:1},...b,checked:C?.includes(t?.key||t),onChange:v(t?.key||t)},t?.key||t))),k&&e.jsxs(r.Box,{sx:{display:'flex',alignItems:'center',pt:'4px',height:'25px',gap:'4px'},children:[e.jsx(z.Error,{sx:{color:o.palette.error.main},fontSize:'small'}),e.jsx(r.Typography,{variant:'h6',color:'error',children:k})]})]});case'Radio':return e.jsxs(r.Box,{width:b?.width,children:[e.jsx(dt,{required:f,label:h,variant:'h5',sx:{color:'common.black',mb:1}}),e.jsx(r.Box,{sx:{...b?.sx&&b.sx},children:g?.map((t=>e.jsx(fr,{label:t?.label||t,sx:{mb:1},...b,checked:n[p.key]===(t?.key||t),onChange:()=>l({[p.key]:t?.key||t})},t?.key||t)))}),k&&e.jsxs(r.Box,{sx:{display:'flex',alignItems:'center',pt:'4px',height:'25px',gap:'4px'},children:[e.jsx(z.Error,{sx:{color:o.palette.error.main},fontSize:'small'}),e.jsx(r.Typography,{variant:'h6',color:'error',children:k})]})]});case'Date':return e.jsxs(e.Fragment,{children:[e.jsx(Tr,{value:C,onChange:e=>l({[p.key]:e}),label:h,required:f,...b}),k&&e.jsxs(r.Box,{sx:{display:'flex',alignItems:'center',pt:'4px',height:'25px',gap:'4px'},children:[e.jsx(z.Error,{sx:{color:o.palette.error.main},fontSize:'small'}),e.jsx(r.Typography,{variant:'h6',color:'error',children:k})]})]});case'Time':return e.jsxs(e.Fragment,{children:[e.jsx(Ir,{value:C,onChange:e=>l({[p.key]:e}),label:h,required:f,...b}),k&&e.jsxs(r.Box,{sx:{display:'flex',alignItems:'center',pt:'4px',height:'25px',gap:'4px'},children:[e.jsx(z.Error,{sx:{color:o.palette.error.main},fontSize:'small'}),e.jsx(r.Typography,{variant:'h6',color:'error',children:k})]})]});case'Date-time':return e.jsxs(e.Fragment,{children:[e.jsx(Er,{value:C,onChange:e=>l({[p.key]:e}),label:h,required:f,...b}),e.jsx(r.Box,{sx:{display:'flex',alignItems:'center',pt:'2px',height:'25px'},children:k&&e.jsxs(r.Box,{sx:{display:'flex',alignItems:'center',pt:'2px',height:'25px',gap:'4px'},children:[e.jsx(z.Error,{sx:{color:o.palette.error.main},fontSize:'small'}),e.jsx(r.Typography,{variant:'h6',color:'error',children:k})]})})]});case'Date-range':return e.jsxs(e.Fragment,{children:[e.jsx(Pr,{type:'Date-range',required:f,value:C,defaultValue:C,onChange:e=>l({[p.key]:e}),size:'small',rangeSelectionView:p?.props?.rangeSelectionView,customDateRanges:p?.props?.customDateRanges,hideDateRange:p?.props?.hideDateRange,dateButtonProps:p?.props?.dateButtonProps,...b}),k&&e.jsxs(r.Box,{sx:{display:'flex',alignItems:'center',pt:'4px',height:'25px',gap:'4px'},children:[e.jsx(z.Error,{sx:{color:o.palette.error.main},fontSize:'small'}),e.jsx(r.Typography,{variant:'h6',color:'error',children:k})]})]});case'Date-time-range':return e.jsxs(e.Fragment,{children:[e.jsx(Pr,{type:'Date-time-range',required:f,value:C,defaultValue:C,onChange:(e,t)=>l({[p.key]:e,[p.key+'_format']:t}),size:'small',rangeSelectionView:p?.props?.rangeSelectionView,customDateRanges:p?.props?.customDateRanges,dateButtonProps:p?.props?.dateButtonProps,hideDateRange:p?.props?.hideDateRange,...b}),k&&e.jsxs(r.Box,{sx:{display:'flex',alignItems:'center',pt:'4px',height:'25px',gap:'4px'},children:[e.jsx(z.Error,{sx:{color:o.palette.error.main},fontSize:'small'}),e.jsx(r.Typography,{variant:'h6',color:'error',children:k})]})]});case'Search':return e.jsxs(e.Fragment,{children:[e.jsx(Xt,{required:f,defaultValue:C,onSearch:e=>l({[p.key]:e}),onClear:()=>l({[p.key]:''}),...b}),k&&e.jsxs(r.Box,{sx:{display:'flex',alignItems:'center',pt:'4px',height:'25px',gap:'4px'},children:[e.jsx(z.Error,{sx:{color:o.palette.error.main},fontSize:'small'}),e.jsx(r.Typography,{variant:'h6',color:'error',children:k})]})]});case'Dropdown':return e.jsxs(e.Fragment,{children:[e.jsx(ar,{label:h,width:264,placeholder:w,required:f,options:g,size:'small',...b,value:C||null,onChange:j(p.key),highLightOnValue:x}),k&&e.jsxs(r.Box,{sx:{display:'flex',alignItems:'center',pt:'4px',height:'25px',gap:'4px'},children:[e.jsx(z.Error,{sx:{color:o.palette.error.main},fontSize:'small'}),e.jsx(r.Typography,{variant:'h6',color:'error',children:k})]})]});case'MultiSelectDropdown':return e.jsxs(e.Fragment,{children:[e.jsx(ar,{label:h,width:264,placeholder:w,required:f,options:g,size:'small',...b,value:C||null,onChange:j(p.key),multiple:!0,highLightOnValue:x}),k&&e.jsxs(r.Box,{sx:{display:'flex',alignItems:'center',pt:'4px',height:'25px',gap:'4px'},children:[e.jsx(z.Error,{sx:{color:o.palette.error.main},fontSize:'small'}),e.jsx(r.Typography,{variant:'h6',color:'error',children:k})]})]});case'MultiSelectSearchDropdown':return e.jsxs(e.Fragment,{children:[e.jsx(ar,{label:h,width:264,placeholder:w,required:f,options:g,size:'small',...b,value:C||null,onChange:j(p.key),multiple:!0,showSearch:!0,highLightOnValue:x}),k&&e.jsxs(r.Box,{sx:{display:'flex',alignItems:'center',pt:'4px',height:'25px',gap:'4px'},children:[e.jsx(z.Error,{sx:{color:o.palette.error.main},fontSize:'small'}),e.jsx(r.Typography,{variant:'h6',color:'error',children:k})]})]});case'MultiSelectSearchSelectAllDropdown':return e.jsxs(e.Fragment,{children:[e.jsx(ar,{label:h,width:264,placeholder:w,required:f,options:g,size:'small',...b,value:C||null,onChange:j(p.key),multiple:!0,showSearch:!0,showSelectAll:!0,highLightOnValue:x}),k&&e.jsxs(r.Box,{sx:{display:'flex',alignItems:'center',pt:'4px',height:'25px',gap:'4px'},children:[e.jsx(z.Error,{sx:{color:o.palette.error.main},fontSize:'small'}),e.jsx(r.Typography,{variant:'h6',color:'error',children:k})]})]});default:return e.jsxs(r.Typography,{variant:'body2',children:[u,' : Not Implemented Yet']})}},Vr=({color:t,sx:r,...i})=>e.jsx(se.default,{viewBox:'0 0 20 20',sx:{width:'20px',height:'20px',fill:'none',cursor:'pointer',...r},...i,children:e.jsx('path',{d:'M17.5861 2.70416C17.8208 2.46944 17.5861 2 17.234 2H9.84027H2.44656C2.09448 2 1.85976 2.35208 2.09448 2.70416L7.61042 11.1541C7.61042 11.2715 7.72778 11.2715 7.72778 11.3888V18.1957C7.72778 18.5478 8.07986 18.6652 8.31459 18.5478L11.8354 16.5527C11.9528 16.4353 12.0701 16.318 12.0701 16.2006V11.3888C12.0701 11.2715 12.0701 11.2715 12.1875 11.1541L17.5861 2.70416Z',stroke:'currentColor',strokeMiterlimit:'10'})}),Or=({config:t})=>{const{label:i,type:o,key:n,value:a,onChange:l}=t,{options:s,required:d,...c}=t?.props??{},p=t?.props?.placeholder??i;switch(o){case'Textbox':return e.jsx(Kt,{label:i,id:n,width:264,placeholder:p,required:d,value:a,onChange:l,...c});case'Number':return e.jsx(Kt,{label:i,id:n,width:264,placeholder:p,required:d,type:'number',value:a,onChange:l,...c});case'Textarea':return e.jsx(Rr,{id:n,label:i,placeholder:p,required:d,value:a,onChange:l,...c});case'Checkbox':return e.jsxs(r.Box,{children:[e.jsx(dt,{label:i,required:d,variant:'h5',sx:{color:'common.black',mb:1}}),s?.map((t=>e.jsx(ht,{label:t,sx:{mb:1},...c,checked:a?.includes(t)},t)))]});case'Radio':return e.jsxs(r.Box,{children:[e.jsx(dt,{label:i,required:d,variant:'h5',sx:{color:'common.black',mb:1}}),s?.map((t=>e.jsx(fr,{label:t,sx:{mb:1},...c},t)))]});case'Date':return e.jsx(Tr,{value:a,onChange:l,label:i,required:d});case'Time':return e.jsx(Ir,{value:a,onChange:l,label:i,required:d});case'Date-time':return e.jsx(Er,{value:a,onChange:l,label:i,required:d,...c});case'Dropdown':return e.jsx(ar,{label:i,width:264,placeholder:p,required:d,options:s,size:'small',...c,value:a});case'MultiSelectDropdown':return e.jsx(ar,{label:i,width:264,placeholder:p,required:d,options:s,size:'small',...c,value:a,multiple:!0});case'MultiSelectSearchDropdown':return e.jsx(ar,{label:i,width:264,placeholder:p,required:d,options:s,size:'small',...c,value:a,multiple:!0,showSearch:!0});case'MultiSelectSearchSelectAllDropdown':return e.jsx(ar,{label:i,width:264,placeholder:p,required:d,options:s,size:'small',...c,value:a,multiple:!0,showSearch:!0,showSelectAll:!0});default:return e.jsx(r.Typography,{variant:'body2',children:'Not Implemented Yet'})}},Wr=({input:t,meta:i,...o})=>e.jsxs(r.Box,{display:'flex',flexDirection:'column',children:[e.jsx(Or,{config:{key:t.name,type:o.componentType,label:o.label,value:t.value,props:{alert:i.touched?i.error:'',width:312,...t,...o},onChange:e=>w.isValid(e)?t?.onChange(e):t?.onChange(e?.target?.value??e)}}),i.touched&&e.jsx(r.Typography,{variant:'h6',color:'red',children:i.error})]}),qr=e=>e?void 0:'Required',$r=({color:t,sx:r,...i})=>e.jsxs(se.default,{viewBox:'0 0 20 20',sx:{width:'20px',height:'20px',fill:'none',cursor:'pointer',...r},...i,children:[e.jsx('path',{d:'M16 9.7776H4L7.48953 6',stroke:t||'currentColor',strokeMiterlimit:'10',strokeLinecap:'round',strokeLinejoin:'round'}),e.jsx('path',{d:'M4 9.77734L7.47557 13.4664',stroke:t||'currentColor',strokeMiterlimit:'10',strokeLinecap:'round',strokeLinejoin:'round'})]}),Nr={fontFamily:'-apple-system,BlinkMacSystemFont,\'Segoe UI\',Roboto,\'Helvetica Neue\',Arial,sans-serif,\'Apple Color Emoji\',\'Segoe UI Emoji\',\'Segoe UI Symbol\'',h1:{fontSize:32,fontFamily:'\'Poppins\', sans-serif',fontWeight:700,lineHeight:'48px'},h2:{fontSize:24,fontFamily:'\'Poppins\', sans-serif',fontWeight:700,lineHeight:'36px'},h3:{fontSize:20,fontFamily:'\'Poppins\', sans-serif',fontWeight:600,lineHeight:'32px'},h4:{fontSize:16,fontFamily:'\'Poppins\', sans-serif',fontWeight:600,lineHeight:'24px'},h5:{fontSize:12,fontFamily:'\'Poppins\', sans-serif',fontWeight:500,lineHeight:'20px'},h6:{fontSize:11,fontFamily:'\'Poppins\', sans-serif',fontWeight:500,lineHeight:'16px'},subtitle1:{fontSize:20,fontFamily:'\'Source Sans Pro\', sans-serif',fontWeight:400,lineHeight:'32px'},subtitle2:{fontSize:16,fontFamily:'\'Source Sans Pro\', sans-serif',fontWeight:400,lineHeight:'24px'},body1:{fontSize:14,fontFamily:'\'Source Sans Pro\', sans-serif',fontWeight:400,lineHeight:'20px'},body2:{fontSize:12,fontFamily:'\'Source Sans Pro\', sans-serif',fontWeight:400,lineHeight:'16px'},body3:{fontFamily:'Source Sans Pro',fontSize:'11px',fontStyle:'normal',fontWeight:'400',lineHeight:'16px',letterSpacing:'0.4px'},button:{textTransform:'none'}},_r={light:'#91B0FA',main:'#2C63E5',dark:'#264CA4',50:'#F5F8FF',200:'#BFD2FD',contrastText:'#F5F8FF'},Gr={light:'#F9D7D7',main:'#FF5757',dark:'#CC3333',contrastText:'#F9D7D7'},Zr={100:'#A1A1A1',150:'#F2F2F2',200:'#E0E0E0',300:'#E3E3E3',350:'#C7C7C7',650:'#666666',700:'#EBEBEB'},Yr={black:'#1A1A1A',white:'#ffffff'};let Ur=i.createTheme({palette:{mode:'light',background:{},primary:{light:'#91B0FA',main:'#2C63E5',dark:'#264CA4',900:'#151E33',800:'#24428A',700:'#FFFBF0',200:'#BFD2FD',100:'#D7E3FE',50:'#F5F8FF',contrastText:'#F5F8FF'},secondary:{light:'#FFF7E6',main:'#FFCD59',dark:'#CC981F',50:'#FFF7E5'},support:{success:{light:'#C2FAEA',main:'#00C28B',dark:'#008F66',contrastText:'#C2FAEA',100:'#EBFFF9'},error:{light:'#F9D7D7',main:'#FF5757',dark:'#CC3333',contrastText:'#F9D7D7',100:'#FFEEEE',50:'#FFFAEF'},warning:{light:'#FFECDB',main:'#F2984A',dark:'#D97E2E',600:'#D97F30',contrastText:'#FFECDB'}},grey:{50:'#F8F8F8',100:'#A1A1A1',150:'#F2F2F2',300:'#E3E3E3',350:'#C7C7C7',650:'#666666',700:'#EBEBEB',black:'#1A1A1A'},common:{black:'#1A1A1A',dark:'#292929',light:'#3D3D3D',white:'#ffffff'}},typography:{fontFamily:'-apple-system,BlinkMacSystemFont,\'Segoe UI\',Roboto,\'Helvetica Neue\',Arial,sans-serif,\'Apple Color Emoji\',\'Segoe UI Emoji\',\'Segoe UI Symbol\'',h1:{fontSize:32,fontFamily:'\'Poppins\', sans-serif',fontWeight:700,lineHeight:'48px'},h2:{fontSize:24,fontFamily:'\'Poppins\', sans-serif',fontWeight:700,lineHeight:'36px'},h3:{fontSize:20,fontFamily:'\'Poppins\', sans-serif',fontWeight:600,lineHeight:'32px'},h4:{fontSize:16,fontFamily:'\'Poppins\', sans-serif',fontWeight:600,lineHeight:'24px'},h5:{fontSize:12,fontFamily:'\'Poppins\', sans-serif',fontWeight:500,lineHeight:'20px'},h6:{fontSize:11,fontFamily:'\'Poppins\', sans-serif',fontWeight:500,lineHeight:'16px'},subtitle1:{fontSize:20,fontFamily:'\'Source Sans Pro\', sans-serif',fontWeight:400,lineHeight:'32px'},subtitle2:{fontSize:16,fontFamily:'\'Source Sans Pro\', sans-serif',fontWeight:400,lineHeight:'24px'},body1:{fontSize:14,fontFamily:'\'Source Sans Pro\', sans-serif',fontWeight:400,lineHeight:'20px'},body2:{fontSize:12,fontFamily:'\'Source Sans Pro\', sans-serif',fontWeight:400,lineHeight:'16px'},button:{textTransform:'none'},...Nr},components:{MuiButton:{styleOverrides:{sizeSmall:{minWidth:'98px',height:32,...Nr.h6,padding:'8px 16px',textTransform:'none'},sizeMedium:{minWidth:'120px',height:'40px',...Nr.h5,padding:'10px 24px',textTransform:'none'},sizeLarge:{minWidth:'161px',height:'48px',...Nr.h4,padding:'12px 32px',textTransform:'none'}}},MuiChip:{styleOverrides:{sizeSmall:{width:'auto',height:32,padding:'8px 0px',...Nr.body2,borderRadius:5e3},sizeMedium:{height:40,padding:'10px 0px',...Nr.body1,borderRadius:5e3}}},MuiSvgIcon:{styleOverrides:{fontSizeSmall:{fontSize:'16px'},fontSizeMedium:{fontSize:'20px'},fontSizeLarge:{fontSize:'24px'}}},MuiSnackbar:{styleOverrides:{root:{borderRadius:'4px'}}},MuiSnackbarContent:{styleOverrides:{root:{width:328,position:'relative',minWidth:360,padding:'8px 16px'}}},MuiPagination:{styleOverrides:{root:{...Nr.body2,height:32,'& ul>li>button.Mui-selected':{backgroundColor:_r.main,color:Yr.white},'& ul>li>button:hover':{backgroundColor:'rgba(0, 0, 0, 0.04)'},'& ul>li>button:hover.Mui-selected':{color:_r.contrastText,backgroundColor:_r.main},'& ul>li>button:hover.Mui-selected:hover':{backgroundColor:_r.dark},'& svg':{fill:_r.main}}}},MuiPaper:{styleOverrides:{root:{margin:0,padding:0}}},MuiInputLabel:{styleOverrides:{root:{marginBottom:'4px','&>span':{color:Gr?.main}}}},MuiInputBase:{styleOverrides:{input:e=>({'&::placeholder':{color:e.disabled?Zr[100]:Zr[300],opacity:'1 !important',fontFamily:'Source Sans Pro, sans-serif, FontAwesome'},backgroundColor:e.disabled?Zr[100]:Yr.white})}},MuiCheckbox:{styleOverrides:{root:{'&.Mui-disabled':{color:Zr[100],cursor:'not-allowed'}}}},MuiTableCell:{styleOverrides:{root:{padding:'8px',...Nr.body2}}},MuiToolbar:{styleOverrides:{root:{paddingLeft:2,paddingRight:1}}}}});const Kr=(e,t)=>{let r=e.path.split('/'),i=t.split('/'),o=0,n=Math.min(r.length,i.length);for(;o<n&&r[o]===i[o];)o++;if(o===n)return!0;if(e.children)for(let r of e?.children)if(Kr(r,t))return!0;return!1},Jr=({active:r,Icon:o,ActiveIcon:n,moduleName:a,type:l='single',onNavItemClick:s})=>{const d=i.useTheme();return e.jsxs(ee.default,{sx:{display:'flex',alignItems:'center',height:40,color:r?'primary.dark':'grey.650',bgcolor:r?'primary.contrastText':'transparent',padding:'0 10px',borderRadius:'8px',cursor:'pointer','&:hover':{backgroundColor:'primary.contrastText','& > .nav-menu-icon':{rotate:'-30deg'}}},onClick:s,children:[o&&e.jsx(ee.default,{component:'span',className:'nav-menu-icon',style:{marginRight:'8px',display:'flex',alignItems:'center',height:24,width:24,fontSize:'24px',color:r?d.palette.primary.dark:d.palette.grey[600],transition:'all 0.15s ease-in'},children:e.jsx(t.Suspense,{fallback:e.jsx(Ye,{}),children:r?n?e.jsx(n,{}):e.jsx(o,{color:d.palette.primary.dark}):e.jsx(o,{})})}),e.jsxs(e.Fragment,{children:[e.jsx(le.default,{variant:'h6',sx:{textDecoration:'none !important',overflow:'hidden',whiteSpace:'nowrap'},color:'inherit',children:a}),'multi'===l&&e.jsx('span',{style:{height:24,width:24},children:e.jsx(Vt,{style:{position:'absolute',right:16,fontSize:24}})})]})]})},Xr=({navigation:r,active:i,activePath:o,rect:n,LinkElement:a='a',linkElementProps:l,onNavItemClick:s})=>{const d=t.useRef(null),[c,p]=t.useState({x:0,y:0,width:0,top:0,right:0,bottom:0,left:0});return e.jsx(Ce.default,{elevation:0,ref:d,style:{top:globalThis.window?.innerHeight>40*r.length+n?.top?n?.top:globalThis.window?.innerHeight-40*r.length,left:n?.left+n?.width},sx:{display:'none',position:'fixed',zIndex:999,padding:'8px',boxShadow:'0px 0px 15px 0px #31313114',marginTop:'4px'},children:e.jsx('div',{style:{minWidth:200,minHeight:r.length<5?40*r.length:250},children:r?.map(((r,n)=>r?.children?e.jsxs(ee.default,{style:{minWidth:200},sx:{position:'relative',padding:'4px 0','&:hover':{zIndex:999,'& > .MuiPaper-root':{display:'block !important'}}},onMouseEnter:e=>{p(e.currentTarget.getBoundingClientRect())},children:[e.jsx(Jr,{moduleName:r.moduleName,type:r?.children?.length>0?'multi':'single',active:!!i&&Kr(r,o),onNavItemClick:s,Icon:r.Icon,ActiveIcon:r.ActiveIcon}),e.jsx(Xr,{moduleName:r.moduleName,rect:c,navigation:r.children,activePath:o,active:!!i&&Kr(r,o),LinkElement:a,linkElementProps:l,onNavItemClick:s})]},n):t.createElement(a,{to:r?.path,href:r?.path,...l,key:n},e.jsx(ee.default,{sx:{position:'relative',p:'4px 0'},children:e.jsx(Jr,{moduleName:r.moduleName,type:r?.children?.length>0?'multi':'single',active:!!i&&Kr(r,o),onNavItemClick:s,Icon:r.Icon,ActiveIcon:r.ActiveIcon})}))))})})},Qr=({navigation:r,activePath:i,LinkElement:o='a',linkElementProps:n,onNavItemClick:a})=>{const{moduleName:l,path:s,children:d,Icon:c,ActiveIcon:p}=r,x=Kr(r,i),[h,u]=t.useState({x:0,y:0,width:0,height:0,top:0,right:0,bottom:0,left:0});if(d&&d?.length>1)return e.jsxs(ee.default,{onMouseEnter:e=>{u(e.currentTarget.getBoundingClientRect())},sx:{position:'relative',p:'4px 12px','&:hover':{zIndex:999,'& > .MuiPaper-root':{display:'block !important'}}},children:[e.jsx(Jr,{active:x,moduleName:l,Icon:c,ActiveIcon:p,type:'multi',onNavItemClick:a}),e.jsx(Xr,{moduleName:l,rect:h,navigation:d,active:x,activePath:i,LinkElement:o,linkElementProps:n,onNavItemClick:a})]});if(d&&1==d?.length){const t=d[0].path;return e.jsx(o,{to:t,href:t,...n,children:e.jsxs(ee.default,{onMouseEnter:e=>{u(e.currentTarget.getBoundingClientRect())},sx:{position:'relative',p:'4px 12px','&:hover':{zIndex:999,'& > .MuiPaper-root':{display:'block !important'}}},children:[e.jsx(Jr,{active:x,moduleName:l,Icon:c,ActiveIcon:p,type:'multi',onNavItemClick:a}),e.jsx(Xr,{moduleName:l,rect:h,navigation:d,active:x,activePath:i,LinkElement:o,linkElementProps:n,onNavItemClick:a})]})})}return e.jsx(o,{to:s,href:s,...n,children:e.jsx(ee.default,{sx:{position:'relative',p:'4px 12px'},children:e.jsx(Jr,{active:x,moduleName:l,type:'single',Icon:c,ActiveIcon:p,onNavItemClick:a})})})},ei=({navigation:r,LinkElement:i,onNavItemClick:o,getPathName:n})=>{const a=n();return e.jsx('div',{children:e.jsx(t.Suspense,{fallback:e.jsx('p',{children:'...loading'}),children:r?.map(((t,r)=>e.jsx(Qr,{navigation:t,activePath:'object'==typeof a?a.pathname:a,LinkElement:i,onNavItemClick:o,linkElementProps:{style:{textDecoration:'none'}}},r)))})})},ti='Powered by Intugine',ri='https://assetsstatic.s3.ap-south-1.amazonaws.com/intugine-logo.png',ii=({deleteRoleDialogOpen:t,setDeleteRoleDialogOpen:r,handleDeleteRole:i})=>e.jsx(lt,{sx:{overflowY:'visible'},open:!!t,'aria-labelledby':'alert-dialog-title','aria-describedby':'alert-dialog-description',title:'Confirmation',onClose:()=>r(null),showDialogFooter:!0,buttonAction:e.jsxs(ke.default,{container:!0,spacing:3,sx:{display:'flex',justifyContent:'end'},children:[e.jsx(ke.default,{item:!0,children:e.jsx(st,{text:'No',variant:'outlined',color:'secondary',size:'small',onClick:()=>r(null)})}),e.jsx(ke.default,{item:!0,children:e.jsx(st,{text:'Yes, Delete',variant:'contained',color:'error',size:'small',onClick:i})})]}),children:e.jsx(e.Fragment,{children:e.jsxs(ee.default,{sx:{marginLeft:'40px',height:160,padding:0,display:'flex',flexDirection:'column',justifyContent:'space-around'},children:[e.jsxs(ee.default,{sx:{display:'inline',width:416,marginBottom:'17px'},children:[e.jsx(le.default,{variant:'h4',color:'error',sx:{display:'inline',marginRight:1},children:'ATTENTION!'}),e.jsx(le.default,{variant:'subtitle2',sx:{display:'inline'},children:'Deleting this role will delete all the data depending on this role.'})]}),e.jsx(le.default,{variant:'subtitle2',color:'error',children:'THIS ACTION IS NOT REVERSIBLE!'}),e.jsx(le.default,{variant:'subtitle2',children:'Are you sure you want to delete this role?'})]})})}),oi=({cancelEditDialogOpen:t,setCancelEditDialogOpen:r,handleCancelEdit:i})=>e.jsx(lt,{title:'Confirmation',onClose:()=>r(!1),showDialogFooter:!0,sx:{overflowY:'visible'},open:!!t,'aria-labelledby':'alert-dialog-title','aria-describedby':'alert-dialog-description',buttonAction:e.jsxs(ke.default,{container:!0,spacing:3,sx:{display:'flex',justifyContent:'end'},children:[e.jsx(ke.default,{item:!0,children:e.jsx(st,{text:'No',variant:'outlined',color:'secondary',size:'small',onClick:()=>r(null)})}),e.jsx(ke.default,{item:!0,children:e.jsx(st,{text:'Yes, Cancel',variant:'contained',color:'error',size:'small',onClick:i})})]}),children:e.jsx(e.Fragment,{children:e.jsxs(ee.default,{sx:{marginLeft:'40px',height:110,padding:0,display:'flex',flexDirection:'column',justifyContent:'space-around'},children:[e.jsx(ee.default,{sx:{display:'inline',width:416,marginBottom:'17px'},children:e.jsx(le.default,{variant:'subtitle2',children:'Are you sure you want to cancel this operation?'})}),e.jsx(le.default,{variant:'subtitle2',children:'The data will not be saved.'})]})})}),ni=['Approval (Transporter)','Freight Bill'],ai=['Analytics','Track And Trace','Trip Scheduling','Device Management','Reports','Live View','Notification','Contract Management','Approval (Client)','Freight Bill','Help And Support','Master','User Management'],li=({table:t,open:o,handleClick:n,handleClose:a,anchorEl:l,onClickEditHandler:s,editDisabledColumns:d,userManagementPolicy:c,columnToBeHandled:p,flexRender:x,isBeingEdited:h,handleDeleteRoleDialog:u})=>{const m=i.useTheme();return e.jsx(e.Fragment,{children:t.getHeaderGroups().map((t=>e.jsx(we.default,{children:t.headers.map((t=>e.jsx(ve.default,{colSpan:t.colSpan,sx:{...m.typography.h5,color:`${m.palette.common.black}`,borderLeft:`1px solid ${m.palette.grey[150]||'#F2F2F2'}`,bgcolor:t.getContext().column.id===h?m.palette.secondary[50]||'#FFF7E5':'none',p:1},children:t?.isPlaceholder?null:e.jsxs(ee.default,{children:['intracityModules'!==t.getContext().column.id?e.jsxs(ee.default,{sx:{display:'flex'},children:[e.jsx(ee.default,{children:e.jsxs(le.default,{variant:'h5',sx:{color:m.palette.grey[650]||'#666666'},children:['Role ',t.getContext().header.index]})}),e.jsxs(ee.default,{sx:{marginLeft:'auto'},children:[e.jsx(ot,{sx:{p:0,height:'20px'},variant:'text',id:'action-positioned-button','aria-controls':o?'action-positioned-menu':void 0,'aria-haspopup':'true','aria-expanded':o?'true':void 0,onClick:e=>n(e,t.getContext().column.id,t.column.columnDef.header().props.children),icon:e.jsx(Se.default,{fontSize:'small'})}),e.jsxs(r.Menu,{id:'action-positioned-menu','aria-labelledby':'action-positioned-button',anchorEl:l,open:!!o,onClose:a,anchorOrigin:{vertical:'bottom',horizontal:'left'},transformOrigin:{vertical:'top',horizontal:'left'},slotProps:{paper:{style:{width:'144px',boxShadow:'2px 2px 8px rgb(26 26 26 / 10%)'}}},children:[e.jsxs(r.MenuItem,{color:'primary',onClick:s,sx:{color:d.includes(p)?m.palette.grey[650]||'#666666':m.palette.primary.main},disabled:!c||!c?.action?.includes('update'),children:[e.jsx(z.Edit,{fontSize:'small',color:d.includes(p)?m.palette.grey[650]||'#666666':m.palette.primary.main}),e.jsx(le.default,{variant:'h6',sx:{marginLeft:'6px'},children:'Edit Role'}),d.includes(p)&&e.jsx(it,{color:'dark',placement:'top',size:'small',title:'Oops! You can’t edit your own role permissions. Please request a different role higher than yours to edit.',children:e.jsx(Ue,{color:'disabled',fontSize:'small',style:{marginLeft:'auto'}})})]}),e.jsxs(r.MenuItem,{id:t.getContext().column.id,onClick:u,sx:{color:d.includes(p)?m.palette.grey[650]||'#666666':m.palette.error.main},disabled:!c||!c?.action?.includes('delete'),children:[e.jsx(z.Delete,{fontSize:'small',color:d.includes(p)?m.palette.grey[650]||'#666666':m.palette.error.main}),e.jsx(le.default,{variant:'h6',sx:{marginLeft:'6px'},children:'Delete Role'}),d.includes(p)&&e.jsx(it,{color:'dark',placement:'top',size:'small',title:'Oops! You can’t delete your own role permissions. Please request a different role higher than yours to delete.',children:e.jsx(Ue,{color:'disabled',fontSize:'small',style:{marginLeft:'auto'}})})]})]})]})]}):e.jsx(e.Fragment,{}),x(t.column.columnDef.header,t.getContext())]})},t.id)))},t.id)))})},si=({table:t,flexRender:r})=>{const o=i.useTheme();return e.jsx(e.Fragment,{children:t.getRowModel().rows.map((t=>e.jsx(we.default,{sx:{height:'auto'},children:t.getVisibleCells().map((i=>e.jsx(ve.default,{sx:{height:'36px',backgroundColor:t.original.module_name===t.original.intracityModules?o.palette.grey[50]:o.palette.common.white,borderLeft:`1px solid ${o.palette.grey[150]||'#F2F2F2'}`,marginTop:'10px',p:0},children:e.jsxs(ee.default,{sx:{display:'flex',alignItems:'center',justifyContent:'center'},children:[e.jsx(le.default,{variant:'h5',sx:{paddingLeft:'1.5em',textIndent:'-1.75em',marginRight:'intracityModules'===i.column.id?'auto':''},children:r(i.column.columnDef.cell,i.getContext())}),t?.original?.tooltip_message&&'intracityModules'===i.column.id&&e.jsx(ee.default,{sx:{marginLeft:'auto'},children:e.jsx(it,{color:'dark',placement:'top',size:'small',title:t.original.tooltip_message,children:e.jsx(Ue,{stroke:o.palette.grey[100]})})})]})},i.id)))},t.id)))})},di=({row:t,getValue:r})=>e.jsx('div',{style:{paddingLeft:2*t.depth+'rem'},children:e.jsxs(e.Fragment,{children:[t.getCanExpand()?e.jsx(ot,{sx:{backgroundColor:'transparent',':hover':{backgroundColor:'transparent'},color:'black'},size:'small',variant:'text',onClick:t.getToggleExpandedHandler(),style:{cursor:'pointer'},icon:t.getIsExpanded()?e.jsx(Te,{style:{transform:'rotate(180deg)',height:'12px',width:'12px'},strokeWidth:2}):e.jsx(Te,{strokeWidth:20,style:{strokeWidth:20,height:'12px',width:'12px'}})}):e.jsx(e.Fragment,{}),r()]})}),ci=({indeterminate:r,className:i='',...o})=>{const n=t.useRef(null),{disabled:a}=o;return t.useEffect((()=>{'boolean'==typeof r&&n.current&&(n.current.indeterminate=!o.checked&&r)}),[n,r]),e.jsx('input',{type:'checkbox',ref:n,style:{cursor:a?'not-allowed':'pointer'},className:i+' cursor-pointer',...o})},pi=({editHandler:t,setCancelEditDialogOpen:r,isBeingEdited:i})=>{const o=De.default();return e.jsx('div',{style:{padding:16,display:'flex',justifyContent:'space-between',alignItems:'center',height:67,boxSizing:'border-box',bottom:50,backgroundColor:o.palette.grey[50],borderTop:`1px solid ${o.palette.grey[350]||'#C7C7C7'}`,borderRadius:' 0  0 5px 5px'},children:e.jsx('div',{style:{flexGrow:1,display:'flex',justifyContent:'flex-end'},children:e.jsx(ke.default,{container:!0,spacing:3,sx:{display:'flex',justifyContent:'end',marginRight:'40px'},children:i&&e.jsxs(e.Fragment,{children:[e.jsx(ke.default,{item:!0,children:e.jsx(st,{text:'Cancel',variant:'outlined',color:'secondary',size:'small',onClick:()=>r(!0)})}),e.jsx(ke.default,{item:!0,children:e.jsx(st,{text:'Set Permissions',variant:'contained',color:'success',size:'small',onClick:t})})]})})})})},xi=({color:t,anchorOrigin:r={vertical:'bottom',horizontal:'right'},...o})=>{const n=i.useTheme();return e.jsx(Fe.default,{autoHideDuration:3e3,anchorOrigin:r,ContentProps:{sx:{backgroundColor:(()=>{switch(t){case'primary':default:return n.palette.primary.main;case'error':return n.palette?.error?.dark;case'warning':return n.palette?.warning?.[600]||'#D97F30';case'success':return n.palette?.success?.dark}})(),cursor:'pointer'}},...o})};const hi=e=>{const t='string'==typeof e?parseFloat(e):Number(e),r=new Intl.NumberFormat('en-IN',{style:'decimal',maximumFractionDigits:2,minimumFractionDigits:2,notation:'compact',compactDisplay:'short',useGrouping:!0,currency:'INR'}).format(t);return isNaN(parseInt(r))?'0':r.replace('T','K')},ui=(e,t,r)=>e?.sort(((e,i)=>t.findIndex((t=>t.key===e[r]))-t.findIndex((e=>e.key===i[r])))),mi=e=>{let t=Math.max(...e?.map((e=>e?.percentage??0)));return t||0===t?`${t}%`:NaN},gi=({data:i,entities:o,type:n,count:a})=>{const l=i?.reduce(((e,t)=>e+t.percentage),0),s=[70,45,35],d=[0,80,180],c=[0,50,130],p=[0,25,65],x=t.useRef(),[h,u]=t.useState(null),m=t.useId();t.useEffect((()=>{u(globalThis.document.getElementById(m))}),[n]);const g='string'==typeof a?a:hi(a??0);return e.jsx(r.Box,{flexGrow:1,height:'100%',width:'100%',display:'flex',justifyContent:'center',children:e.jsxs(e.Fragment,{children:[('pie'===n||'overviewPie'===n)&&e.jsxs(e.Fragment,{children:['pie'===n&&e.jsx(r.Box,{sx:{gap:3,alignSelf:'center',display:'flex',flexDirection:'column',width:'calc(30%)'},children:o?.[0]?.subEntities?.map((t=>{const n=i?.find((e=>e[o?.[0]?.xAxis]===t.key));return e.jsxs(r.Box,{display:'flex',flexDirection:'column',children:[e.jsxs(r.Box,{sx:{gap:1,alignItems:'center',display:'flex',justifyContent:'flex-start'},children:[e.jsx('svg',{width:'12',height:'12',viewBox:'0 0 12 12',fill:'none',xmlns:'http://www.w3.org/2000/svg',children:e.jsx('rect',{width:'12',height:'12',rx:'6',fill:t?.color})}),e.jsx(r.Typography,{children:t.label})]}),e.jsx(r.Typography,{variant:'h4',style:{paddingLeft:'18px'},children:n?.count||0===n?.count?hi(n?.count):`${n?.percentage}%`})]},t?.key)}))}),e.jsx(r.Box,{width:'calc(70%)',justifyContent:'center',position:'relative',id:m,children:h?e.jsxs('svg',{height:h?.clientHeight,width:h?.clientWidth,children:[e.jsx(_.VictoryPie,{padding:{right:0,left:0,top:0,bottom:0},colorScale:0===l?['#F8F8F8']:o?.[0]?.subEntities?.map((e=>e.color)),data:0===l?[{[o?.[0]?.xAxis]:'',[o?.[0]?.yAxis]:100}]:ui(i,o?.[0]?.subEntities,o?.[0]?.xAxis),x:e=>e[o?.[0]?.xAxis],y:e=>e[o?.[0]?.yAxis],standalone:!1,height:h?.clientHeight,width:h?.clientWidth,innerRadius:'overviewPie'===n?25:65,labels:()=>''}),'overviewPie'===n?e.jsx('text',{xmlns:'http://www.w3.org/2000/svg',y:'50%',x:'50%',dy:'5px',dx:'2px','text-anchor':'middle',style:{alignSelf:'center',fontFamily:'Poppins',color:'#666666',fill:'#666666',fontSize:'16px',fontStyle:'normal',fontWeight:'600',lineHeight:'24px',letterSpacing:'0.4px'},children:g}):e.jsx('text',{xmlns:'http://www.w3.org/2000/svg',y:'50%',x:'50%',dy:'9px','text-anchor':'middle',style:{alignSelf:'center',fontFamily:'Poppins',color:'#1A1A1A',fill:'#1A1A1A',fontSize:'24px',fontStyle:'normal',fontWeight:'600',lineHeight:'2.25rem',letterSpacing:'0.4px'},children:(a||0===a?hi(a):mi(i))||0})]}):e.jsx(r.Skeleton,{variant:'rectangular',width:'100%',height:'100%'})})]}),'groupedPie'===n&&e.jsxs(e.Fragment,{children:[e.jsx(r.Box,{sx:{gap:3,alignSelf:'center',display:'flex',flexDirection:'column',width:'calc(30%)'},children:o?.map((t=>{const n=i?.find((e=>e[o?.[0]?.xAxis]===t.key));return e.jsxs(r.Box,{display:'flex',flexDirection:'column',children:[e.jsxs(r.Box,{sx:{gap:1,alignItems:'center',display:'flex',justifyContent:'flex-start'},children:[e.jsx('svg',{width:'12',height:'12',viewBox:'0 0 12 12',fill:'none',xmlns:'http://www.w3.org/2000/svg',children:e.jsx('rect',{width:'12',height:'12',rx:'6',fill:t?.color})}),e.jsx(r.Typography,{children:t.label})]}),e.jsx(r.Typography,{variant:'h4',style:{paddingLeft:'18px'},children:n?.count||0===n?.count?hi(n?.count):`${n?.percentage}%`})]},t?.key)}))}),e.jsx(r.Box,{width:'calc(70%)',ref:x,justifyContent:'center',id:m,children:h?e.jsx(_.VictoryGroup,{width:h?.clientWidth,height:h?.clientHeight,children:o?.map(((t,r)=>{const o=i?.map((e=>[e,{pod:'',percentage:100-e.percentage}]))??[];return e.jsxs('svg',{height:h?.clientHeight-d[r],width:h?.clientWidth-d[r],x:p[r],y:p[r],children:[e.jsx(_.VictoryPie,{padding:{right:0,left:0,top:0,bottom:0},colorScale:[t.color??'#00C28B','#F8F8F8'],data:o?.find((e=>e?.[0]?.[t.xAxis]===t.key)),x:e=>e[t.xAxis],y:e=>e[t.yAxis],standalone:!1,height:h?.clientHeight-c[r],width:h?.clientWidth-c[r],innerRadius:s[r],labels:()=>'',labelComponent:e.jsx(e.Fragment,{})}),0===r&&e.jsx('text',{xmlns:'http://www.w3.org/2000/svg',y:'50%',x:'50%',dy:'9px','text-anchor':'middle',style:{alignSelf:'center',fontFamily:'Poppins',color:'#1A1A1A',fill:'#1A1A1A',fontSize:'24px',fontStyle:'normal',fontWeight:'600',lineHeight:'2.25rem',letterSpacing:'0.4px'},children:`${o?.[o?.length-1]?.[0].percentage??0}%`})]},t?.label)}))}):e.jsx(r.Skeleton,{variant:'rectangular',width:'100%',height:'100%'})})]})]})})},fi=({config:t,data:i,navigateHook:o})=>{const n=o(),{title:a,width:l,color:s,bgColor:d,redirectURI:c,extraStatsType:p,counters:x,indicatorColor:h,entities:u}=t??{},{count:m,changePercentage:g,data:f,timePeriod:y}=i??{},b='inverted'===h?g<=0?'success':'error':g<0?'error':'success',j='counter'===p?'max-context':'pieChart'===p?'calc(60%)':'calc(100%)',C='counter'===p?'10px 15px 10px 20px':'pieChart'===p?'10px 5px 10px 20px':'10px 10px 10px 20px';return e.jsxs(Nt,{xs:l,sx:{boxSizing:'border-box',height:'130px',bgcolor:'background.paper',gap:1,borderRadius:2,border:'1px solid #E0E0E0',justifyContent:'space-between'},children:[e.jsxs(r.Box,{sx:{display:'flex',flexDirection:'column',padding:C,borderRadius:p?'8px 0px 0px 8px':'8px',width:j,gap:2,borderRight:'counter'===p?'1px solid #E0E0E0':'0px',bgcolor:d??'background.paper'},children:[e.jsxs(r.Box,{display:'flex',justifyContent:'space-between',children:[e.jsx(r.Typography,{variant:'h4',color:s??'grey.650',children:a}),e.jsx(ot,{icon:e.jsx(Ee,{}),size:'small',variant:'text',onClick:()=>'object'==typeof n?n.push(c):n(c),sx:{width:'12px'}})]}),e.jsxs(r.Box,{sx:{display:'flex',flexDirection:'column',gap:1},children:[e.jsx(r.Typography,{variant:'h2',color:'common.black',children:er(m)}),e.jsxs(r.Box,{sx:{display:'flex',alignItems:'center',gap:1,width:'max-content'},children:[e.jsxs(r.Typography,{variant:'body1',color:`${b}.dark`??'grey.650',sx:{display:'flex',alignItems:'center'},children:[g<0?e.jsx(Ft,{color:b}):e.jsx(At,{color:b}),`${Math.abs(g??0)}%`]}),e.jsx(r.Typography,{variant:'body1',color:'grey.650',children:y})]})]})]}),'pieChart'===p&&e.jsxs(e.Fragment,{children:[e.jsx(r.Divider,{id:'dividerVerticalLine',variant:'middle',orientation:'vertical',flexItem:!0}),e.jsx(r.Box,{sx:{display:'flex',justifyContent:'center',flexDirection:'column',alignItems:'center',height:'100%',width:'calc(30%)',boxSizing:'border-box',padding:'5px 5px 10px 5px',gap:1},children:f?.map((t=>e.jsxs(e.Fragment,{children:[e.jsx(r.Box,{sx:{height:'calc(100% - 40px)',width:'calc(100%)',justifyContent:'center'},children:e.jsx(gi,{entities:u??[],data:[{tat:'onTime',percentage:t.percentage},{tat:'delay',percentage:100-t.percentage}],type:'overviewPie',count:`${t.percentage??0}%`})}),e.jsxs(r.Box,{sx:{display:'flex',justifyContent:'space-between',alignItems:'center',gap:.5},children:[e.jsx(r.Typography,{variant:'body1',color:'grey.650',children:`${x?.find((e=>e.key===t.key))?.label}: `}),e.jsx(r.Typography,{variant:'body1',color:'common.black',children:er(t.count)})]},t.key)]})))})]}),'counter'===p&&e.jsx(r.Box,{display:'flex',sx:{width:'calc(100%)',justifySelf:'flex-start'},children:f?.map(((t,i)=>e.jsxs(e.Fragment,{children:[e.jsxs(r.Box,{sx:{boxSizing:'border-box',display:'flex',flexDirection:'column',padding:'20px 5px',width:(100/f?.length).toString()+'%',justifyContent:'space-between',height:'100%',paddingLeft:'15px'},children:[e.jsx(r.Typography,{variant:'h4',color:'grey.650',children:`${x?.find((e=>e.key===t.key))?.label}`}),e.jsxs(r.Box,{sx:{display:'flex',gap:1.5,alignItems:'center'},children:[t?.count?.toString()?.length>3?e.jsx(r.Tooltip,{title:t.count,children:e.jsx(r.Typography,{variant:'h2',children:Qt(t.count)})}):e.jsx(r.Typography,{variant:'h2',children:t.count}),e.jsx(r.Box,{sx:{display:'flex',bgcolor:'primary.100',height:'16px',width:'max-content',justifyContent:'space-around',padding:'4px',borderRadius:'4px',alignItems:'center'},children:e.jsx(r.Typography,{variant:'body2',color:'primary.600',children:`${t.percentage}%`})})]})]},t.key),i!==f?.length-1&&e.jsx(r.Divider,{id:'dividerVerticalLine',orientation:'vertical',flexItem:!0})]})))})]})},yi=({config:t,data:i,navigateHook:o})=>{const{width:n,counters:a}=t??{},{data:l}=i??{},s=o();return e.jsx(Nt,{xs:n,sx:{boxSizing:'border-box',height:'130px',bgcolor:'background.paper',borderRadius:2,border:'1px solid #E0E0E0'},children:l?.map(((t,i)=>{const o=a?.find((e=>e.key===t.key));return e.jsxs(r.Box,{sx:{bgcolor:o?.color??'#ffffff',display:'flex',gap:2,justifyContent:'space-between',position:'relative',borderRadius:'inherit',width:'245px'},children:[e.jsxs(r.Box,{sx:{display:'flex',flexDirection:'column',justifyContent:'space-between',padding:'22px'},children:[e.jsx(r.Typography,{variant:'h4',color:'grey.650',children:`${o?.label}`}),e.jsxs(r.Box,{sx:{display:'flex',gap:2,alignItems:'center'},children:[e.jsx(r.Typography,{variant:'h2',children:er(t?.count)}),e.jsx(r.Box,{sx:{display:'flex',bgcolor:'#d7e3fe',height:'16px',width:'max-content',justifyContent:'space-around',padding:'4px',borderRadius:'4px',alignItems:'center'},children:e.jsx(r.Typography,{variant:'body2',color:'primary.600',children:`${t?.percentage??0}%`})})]})]},t.key),e.jsx(r.Box,{sx:{padding:'15px 10px 0px 0px'},children:e.jsx(ot,{icon:e.jsx(Ee,{}),size:'small',variant:'text',onClick:()=>'object'==typeof s?s.push(o?.redirectURI):s(o?.redirectURI),sx:{width:'12px'}})}),i!==a?.length-1&&e.jsx(r.Divider,{sx:{position:'absolute',right:0,height:'100%'},id:'dividerVerticalLine',orientation:'vertical',flexItem:!0})]},t.key)}))})},bi=(e,t='Descending')=>{const r=e?.slice().sort(((e,r)=>'Ascending'===t?e.percentage-r.percentage:r.percentage-e.percentage));return r},ji=t=>{const{x:r,datum:{x:i},data:o}=t,n=o[Math.round(i-1)],a=r-88;return e.jsxs('g',{transform:`translate(${a}, -50)`,children:[e.jsx('path',{'fill-rule':'evenodd','clip-rule':'evenodd',d:'M4 0C1.79086 0 0 1.79086 0 4V44C0 46.2091 1.79086 48 4 48H78L81 51.515C81.552 52.162 82.448 52.162 83 51.515L86 48H160C162.209 48 164 46.2091 164 44V4C164 1.79086 162.209 0 160 0H4Z'}),e.jsx('path',{'fill-rule':'evenodd','clip-rule':'evenodd',d:'M4 0C1.79086 0 0 1.79086 0 4V44C0 46.2091 1.79086 48 4 48H78L81 51.515C81.552 52.162 82.448 52.162 83 51.515L86 48H160C162.209 48 164 46.2091 164 44V4C164 1.79086 162.209 0 160 0H4Z',fill:'#F5F8FF'}),e.jsx('rect',{xmlns:'http://www.w3.org/2000/svg',x:'120',y:'8',width:'36',height:'32',rx:'4',fill:'#D7E3FE'}),e.jsx('path',{d:'M78 48L78.7606 47.3508L78.4612 47H78V48ZM81 51.515L81.7607 50.866L81.7606 50.8658L81 51.515ZM83 51.515L82.2394 50.8658L82.2393 50.866L83 51.515ZM86 48V47H85.5388L85.2394 47.3508L86 48ZM1 4C1 2.34315 2.34315 1 4 1V-1C1.23858 -1 -1 1.23858 -1 4H1ZM1 44V4H-1V44H1ZM4 47C2.34314 47 1 45.6569 1 44H-1C-1 46.7614 1.23857 49 4 49V47ZM78 47H4V49H78V47ZM77.2394 48.6492L80.2394 52.1642L81.7606 50.8658L78.7606 47.3508L77.2394 48.6492ZM80.2393 52.164C81.1905 53.279 82.8095 53.279 83.7607 52.164L82.2393 50.866C82.1424 50.9795 82.053 51.0002 82 51.0002C81.947 51.0002 81.8576 50.9795 81.7607 50.866L80.2393 52.164ZM83.7606 52.1642L86.7606 48.6492L85.2394 47.3508L82.2394 50.8658L83.7606 52.1642ZM160 47H86V49H160V47ZM163 44C163 45.6569 161.657 47 160 47V49C162.761 49 165 46.7614 165 44H163ZM163 4V44H165V4H163ZM160 1C161.657 1 163 2.34315 163 4H165C165 1.23858 162.761 -1 160 -1V1ZM4 1H160V-1H4V1Z',fill:'#BFD2FD',mask:'url(#path-1-inside-1_7677_327750)'}),e.jsx('text',{xmlns:'http://www.w3.org/2000/svg',x:10,y:13,style:{fontFamily:'Source Sans Pro',color:'#292929',fill:'#292929',fontSize:'11px',fontStyle:'normal',fontWeight:'400',lineHeight:'16px',letterSpacing:'0.4px'},children:'Total -'}),e.jsx('text',{xmlns:'http://www.w3.org/2000/svg',x:45,y:13,style:{fontFamily:'Source Sans Pro',color:'#292929',fill:'#292929',fontSize:'11px',fontStyle:'normal',fontWeight:'400',lineHeight:'16px',letterSpacing:'0.4px'},children:n?.totalShipment??0}),e.jsx('text',{xmlns:'http://www.w3.org/2000/svg',x:10,y:27,style:{fontFamily:'Source Sans Pro',color:'#292929',fill:'#292929',fontSize:'11px',fontStyle:'normal',fontWeight:'400',lineHeight:'16px',letterSpacing:'0.4px'},children:'On Time -'}),e.jsx('text',{xmlns:'http://www.w3.org/2000/svg',x:60,y:27,style:{fontFamily:'Source Sans Pro',color:'#292929',fill:'#292929',fontSize:'11px',fontStyle:'normal',fontWeight:'400',lineHeight:'16px',letterSpacing:'0.4px'},children:n?.onTimeShipment??0}),e.jsx('text',{xmlns:'http://www.w3.org/2000/svg',x:10,y:40,style:{fontFamily:'Source Sans Pro',color:'#292929',fill:'#292929',fontSize:'11px',fontStyle:'normal',fontWeight:'400',lineHeight:'16px',letterSpacing:'0.4px'},children:'Analyzable -'}),e.jsx('text',{xmlns:'http://www.w3.org/2000/svg',x:72,y:40,style:{fontFamily:'Source Sans Pro',color:'#292929',fill:'#292929',fontSize:'11px',fontStyle:'normal',fontWeight:'400',lineHeight:'16px',letterSpacing:'0.4px'},children:n?.analyzableShipment??0}),e.jsx('text',{xmlns:'http://www.w3.org/2000/svg',x:126,y:28,style:{color:'#264CA4',fill:'#264CA4',fontFamily:'Poppins',fontSize:'12px',fontStyle:'normal',fontWeight:'500',lineHeight:'20px'},children:`${n?.onTimePercentage??0}%`})]})},Ci=t=>{const{y1:r,y2:i,x1:o}=t;return e.jsxs('g',{transform:`translate(${o-5}, ${r})`,children:[e.jsx('rect',{width:r,height:i-10,fill:'url(#cursorGradient)',stroke:'url(#cursorGradient)'}),e.jsx('svg',{children:e.jsx('defs',{children:e.jsxs('linearGradient',{id:'cursorGradient',x1:'0%',y1:'0%',x2:'0%',y2:'100%',children:[e.jsx('stop',{offset:'0%',stopColor:'#F5F7FC '}),e.jsx('stop',{offset:'100%',stopColor:'#91B0FA'})]})})})]})},ki=({data:i,entities:o})=>{const n=r.useTheme(),[a,l]=t.useState(null),s=t.useId(),{height:d,width:c}=wt();t.useEffect((()=>{l(globalThis.document.getElementById(s))}),[]),t.useEffect((()=>{if(a)return a.addEventListener('mouseenter',h),()=>{a.removeEventListener('mouseenter',h)}}),[a]);const[p,x]=t.useState(!1),h=()=>x(!1);return e.jsxs(r.Box,{flexGrow:1,height:'100%',width:'100%',id:s,children:[a?e.jsxs(_.VictoryChart,{width:a.clientWidth??300,height:a.clientHeight??150,padding:{right:10,left:10,top:10,bottom:25},domainPadding:{y:[2,0]},containerComponent:1!==o?.length?e.jsx(_.VictoryCursorContainer,{disable:p,onCursorChange:e=>{const t=e-Math.floor(e);x(!(t<=.03||t>=.97))},cursorDimension:'x',cursorLabel:()=>'',cursorLabelComponent:e.jsx(_.VictoryTooltip,{flyoutWidth:50,cornerRadius:4,pointerLength:4,flyoutComponent:e.jsx(ji,{data:i}),dy:-16,flyoutStyle:{stroke:n.palette.primary.light,strokeWidth:1,fill:n.palette.primary.dark},style:{fill:'#FFF',fontFamily:n.typography.body2.fontFamily}}),cursorComponent:e.jsx(Ci,{})}):void 0,children:[e.jsx(_.VictoryAxis,{crossAxis:!0,tickFormat:e=>e?.length>16?e?.slice(0,16)+'...':e,axisLabelComponent:e.jsx(_.VictoryLabel,{dy:7.5,style:[{fill:'#1A1A1A',...n.typography.body2}]}),tickLabelComponent:e.jsx(_.VictoryLabel,{style:[{fill:'#666666',...n.typography.body2}]}),style:{axis:{stroke:'#E3E3E3'},grid:{stroke:'#e3e3e3',strokeDasharray:'5'}},fixLabelOverlap:!0}),o?.map((t=>{const{xAxis:r,yAxis:o,color:a}=t;return e.jsx(_.VictoryArea,{interpolation:'natural',name:'area-2',style:{data:{fill:`url(#${a})`,stroke:a}},labels:({datum:e})=>e[1],labelComponent:e.jsx(_.VictoryTooltip,{flyoutWidth:50,cornerRadius:4,pointerLength:4,dy:-16,flyoutStyle:{stroke:n.palette.primary.light,strokeWidth:1,fill:n.palette.primary.dark},style:{fill:'#FFF',fontFamily:n.typography.body2.fontFamily}}),data:i,x:e=>e?.[r],y:e=>e?.[o]},o)}))]},`${d}${c}-${p}-${i}`):null,a&&e.jsx(r.Box,{display:'flex',gap:2,mt:2,sx:{'& > div':{display:'flex',gap:'4px',alignItems:'center'}},children:1!==o?.length&&e.jsx(e.Fragment,{children:o?.map((t=>e.jsxs(r.Box,{children:[e.jsx('svg',{width:'12',height:'12',viewBox:'0 0 12 12',fill:'none',xmlns:'http://www.w3.org/2000/svg',children:e.jsx('rect',{width:'12',height:'12',rx:'6',fill:t?.color})}),e.jsx(r.Typography,{children:t.label})]},t?.yAxis)))})}),e.jsx('svg',{style:{height:0},children:e.jsx('defs',{children:o?.map((t=>e.jsxs('linearGradient',{id:`${t.color}`,x1:'0%',y1:'0%',x2:'0%',y2:'100%',children:[e.jsx('stop',{offset:'0%',stopColor:t.color}),e.jsx('stop',{offset:'100%',stopColor:'rgba(255, 255, 255, 0)'})]},t.color)))})})]})},wi=({initialPage:e=1,initialPageSize:r=10,onChange:i})=>{const[o,n]=t.useState({page:e,pageSize:r});t.useEffect((()=>{e!==o.page&&n({...o,page:e})}),[e]),t.useEffect((()=>{e!==o.pageSize&&n({...o,pageSize:r})}),[r]),t.useEffect((()=>{i&&i(o.page,o.pageSize)}),[o.page,o.pageSize]);return{page:o.page,pageSize:o.pageSize,handlePageChange:e=>n({...o,page:e}),handlePageSizeChange:e=>n({...o,page:1,pageSize:e})}},vi=t=>{const{x:i,datum:{x:o},data:n,entities:a}=t,l=n[Math.round(o-1)];let s=i-88;const d=o-Math.floor(o),c=Boolean(l?.percentage)||0===l?.percentage;return d<=.04||d>=.96?e.jsxs('g',{transform:`translate(${s}, -50)`,children:[c&&e.jsx('rect',{xmlns:'http://www.w3.org/2000/svg',x:'120',y:'8'}),e.jsx('foreignObject',{x:'0',y:'0',width:'250',height:'250',children:e.jsxs(r.Box,{display:'flex',alignItems:'center',gap:1,bgcolor:'#F5F8FF',borderRadius:2,border:'2px solid #BFD2FD',p:1,width:'max-content',position:'relative',children:[e.jsx(r.Box,{children:a.filter((e=>e?.tooltipLabel??e?.label)).map(((t,i)=>e.jsxs(r.Typography,{variant:'body2',sx:{fontSize:'11px',fontStyle:'normal',fontWeight:400,lineHeight:'16px',letterSpacing:'0.4px'},children:[t?.tooltipLabel??t?.label??'N.A.',' -',' ',l?.[t?.yAxis]??0]},i)))}),c&&e.jsx(r.Box,{width:'fit-content',minWidth:'32px',height:'32px',bgcolor:'#D7E3FE',color:'primary.main',borderRadius:1,display:'flex',alignItems:'center',justifyContent:'center',children:e.jsxs(r.Typography,{variant:'h5',children:[l.percentage,'%']})}),e.jsx(r.Box,{bgcolor:'#F5F8FF',border:'2px solid #BFD2FD',width:16,height:16,sx:{rotate:'45deg',position:'absolute',bottom:-10,left:'calc(50% - 8px)',borderBottomLeftRadius:1,borderTop:'none',borderLeft:'none'}})]})})]}):null},Si=t=>{const{x:r,y:i,horizontal:o=!1}=t;return t?.datum?.invoiceValue||t?.datum?.percentage||0===t?.datum?.percentage?e.jsx('g',{transform:`translate(${o?r+8:r}, ${o?i+4:i-8})`,children:e.jsxs('text',{xmlns:'http://www.w3.org/2000/svg',y:0,x:0,style:{color:'#264CA4',fill:'#264CA4',fontFamily:'Poppins',fontSize:'12px',fontStyle:'normal',fontWeight:'500',lineHeight:'20px'},textAnchor:'right',children:[t?.datum?.percentage?t?.datum?.percentage?.toString().slice(0,4)+'%':null,o?null:t?.datum?.invoiceValue>0?`(${hi(t?.datum?.invoiceValue)}) `:'(0)']})}):null},Di=({data:i,entities:o,maxDataPoints:n,orientation:a})=>{const l=r.useTheme(),s=t.useRef(),{handlePageChange:d,page:c,pageSize:p}=wi({initialPageSize:10}),x=o?.filter((e=>!e?.showOnlyTooltip)),[h,u]=t.useState(i?.slice((c-1)*p,c*p));t.useEffect((()=>{u(i?.slice((c-1)*p,c*p))}),[c,i]),t.useEffect((()=>{d(1)}),[i]);const m=n?h?.sort(((e,t)=>t.percentage-e.percentage)).slice(0,n).reverse():h;return e.jsxs(r.Box,{flexGrow:1,height:(x?.length??0)>0?'calc(100% - 36px)':'100%',width:'100%',ref:s,children:[e.jsxs(_.VictoryChart,{width:s.current?.clientWidth??300,height:s.current?.clientHeight??150,padding:{right:'horizontal'===a?44:40,left:'horizontal'===a?70:40,top:'horizontal'===a?10:44,bottom:30},horizontal:'horizontal'===a,containerComponent:0!==x?.length&&'horizontal'!==a?e.jsx(_.VictoryCursorContainer,{cursorDimension:'x',cursorLabel:()=>'',cursorLabelComponent:e.jsx(_.VictoryTooltip,{flyoutWidth:50,cornerRadius:4,pointerLength:4,flyoutComponent:e.jsx(vi,{data:i,entities:o}),dy:-16,flyoutStyle:{stroke:l.palette.primary.light,strokeWidth:1,fill:l.palette.primary.dark},style:{fill:'#FFF',fontFamily:l.typography.body2.fontFamily}}),cursorComponent:e.jsx(e.Fragment,{})}):void 0,children:[e.jsx(_.VictoryAxis,{crossAxis:!0,tickFormat:e=>e.length>16?e.slice(0,15)+'...':e,axisLabelComponent:e.jsx(_.VictoryLabel,{dy:7.5,style:[{fill:'#1A1A1A',...l.typography.body2}]}),tickLabelComponent:e.jsx(_.VictoryLabel,{style:[{fill:'#666666',...l.typography.body2}]}),style:{axis:{stroke:'#E3E3E3'}},fixLabelOverlap:!0}),e.jsx(_.VictoryAxis,{dependentAxis:!0,style:{axis:{stroke:'#ffffff'},grid:{stroke:'#e3e3e3',strokeDasharray:'5'}},axisLabelComponent:e.jsx(_.VictoryLabel,{dy:-12,style:[{fill:'#1A1A1A',...l.typography.body2,textAlign:'center'}]}),tickLabelComponent:e.jsx(_.VictoryLabel,{style:[{fill:'#666666',...l.typography.body2}]})}),e.jsx(_.VictoryGroup,{offset:15,style:{data:{width:15}},children:x?.map(((t,r)=>{const{xAxis:i,yAxis:o,color:n}=t;return e.jsx(_.VictoryBar,{name:'area-2',style:{data:{fill:n,stroke:n}},data:m,x:e=>e?.[i],y:e=>e?.[o],labelComponent:0===r?e.jsx(Si,{horizontal:'horizontal'===a}):void 0,labels:()=>''},o)}))})]}),e.jsxs(r.Box,{display:'flex',justifyContent:'space-between',alignItems:'center',children:[0!==x?.length&&e.jsx(r.Box,{display:'flex',gap:2,mt:2,sx:{'& > div':{display:'flex',gap:'4px',alignItems:'center'}},children:x?.map((t=>e.jsxs(r.Box,{children:[e.jsx('svg',{width:'12',height:'12',viewBox:'0 0 12 12',fill:'none',xmlns:'http://www.w3.org/2000/svg',children:e.jsx('rect',{width:'12',height:'12',rx:'6',fill:t?.color})}),e.jsx(r.Typography,{children:t.label})]},t?.yAxis)))}),'horizontal'!==a&&e.jsx(r.Box,{children:e.jsx(et,{page:c,count:Math.ceil(i?.length/p),onPageChange:d})})]})]})},Fi=t=>{const{x:r,y:i}=t;return e.jsx('g',{transform:`translate(${r}, ${i-8})`,children:e.jsxs('text',{xmlns:'http://www.w3.org/2000/svg',y:0,x:0,style:{color:'#264CA4',fill:'#264CA4',fontFamily:'Poppins',fontSize:'12px',fontStyle:'normal',fontWeight:'500',lineHeight:'20px'},textAnchor:'middle',children:[t.datum.slaPercentage?.toString().slice(0,4),'%']})})},Ai=({data:i,entities:o,orientation:n})=>{const a=r.useTheme(),l=t.useRef(),{handlePageChange:s,page:d,pageSize:c}=wi({initialPageSize:10}),[p,x]=t.useState(i?.slice((d-1)*c,d*c));return t.useEffect((()=>{x(i?.slice((d-1)*c,d*c))}),[d,i]),t.useEffect((()=>{s(1)}),[i]),e.jsxs(r.Box,{flexGrow:1,height:(o?.length??0)>1?'calc(100% - 36px)':'100%',width:'100%',ref:l,children:[e.jsxs(_.VictoryChart,{width:l.current?.clientWidth??300,height:l.current?.clientHeight??150,padding:{right:70,left:70,top:44,bottom:30},children:[e.jsx(_.VictoryAxis,{crossAxis:!0,tickFormat:e=>e||'NA',tickValues:p.map((e=>e?.[o?.[0]?.xAxis])),axisLabelComponent:e.jsx(_.VictoryLabel,{dy:7.5,style:[{fill:'#1A1A1A',...a.typography.body2}]}),tickLabelComponent:e.jsx(_.VictoryLabel,{style:[{fill:'#666666',...a.typography.body2}]}),style:{axis:{stroke:'#E3E3E3'}}}),e.jsx(_.VictoryAxis,{dependentAxis:!0,style:{axis:{stroke:'#ffffff'},grid:{strokeDasharray:'5'}},tickFormat:()=>'',axisLabelComponent:e.jsx(_.VictoryLabel,{dy:-12,style:[{fill:'#1A1A1A',...a.typography.body2,textAlign:'center'}]}),tickLabelComponent:e.jsx(_.VictoryLabel,{style:[{fill:'#666666',...a.typography.body2}]})}),o?.map((t=>{const{yAxis:r,color:i,type:o='bar',label:n}=t;return'bar'===o?e.jsx(_.VictoryBar,{name:'area-2',style:{data:{fill:i,stroke:i}},barWidth:10,standalone:!1,data:p,x:e=>e?.index-(d-1)*c,y:e=>e?.[r],labelComponent:e.jsx(Fi,{}),labels:({datum:e})=>`${n}-${e?.[r]}`},r):e.jsx(_.VictoryLine,{name:'area-3',style:{data:{stroke:i}},standalone:!1,data:p,x:e=>e?.index-(d-1)*c,y:e=>e?.[r]},r)})),o?.map((t=>{const{yAxis:r,color:i,type:n='bar'}=t;return'line'===n?e.jsx(_.VictoryScatter,{name:'area-2',data:p,style:{data:{fill:i,stroke:i,strokeWidth:4}},x:e=>e?.index-(d-1)*c,y:e=>e?.[r],labelComponent:e.jsx(_.VictoryTooltip,{constrainToVisibleArea:!0,cornerRadius:4,pointerLength:4,dy:-16,flyoutStyle:{stroke:a.palette.primary.light,strokeWidth:1,fill:a.palette.primary[50]},style:{fill:'#000',fontSize:a.typography.body2.fontSize,fontFamily:a.typography.body2.fontFamily}}),labels:({datum:e})=>o.map((({label:t,yAxis:r})=>`${t} - ${parseInt(e?.[r])}`)).join('\n')},r):e.jsx(e.Fragment,{})}))]}),e.jsxs(r.Box,{display:'flex',justifyContent:'space-between',alignItems:'center',children:[1!==o?.length&&e.jsx(r.Box,{display:'flex',gap:2,mt:2,sx:{'& > div':{display:'flex',gap:'4px',alignItems:'center'}},children:o?.map((t=>e.jsxs(r.Box,{children:[e.jsx('svg',{width:'12',height:'12',viewBox:'0 0 12 12',fill:'none',xmlns:'http://www.w3.org/2000/svg',children:e.jsx('rect',{width:'12',height:'12',rx:'6',fill:t?.color})}),e.jsx(r.Typography,{children:t.label})]},t?.yAxis)))}),'horizontal'!==n&&e.jsx(r.Box,{children:e.jsx(et,{page:d,count:Math.ceil(i?.length/c),onPageChange:s})})]})]})},Mi=({type:t,data:r,entities:i,maxDataPoints:o,orientation:n,count:a})=>{if(0===r?.length)return e.jsx('div',{style:{display:'flex',justifyContent:'center',alignItems:'center'},children:e.jsx('img',{height:'160px',src:'/assets/noData.svg',alt:'No Data'})});switch(t){case'line':case'groupedLine':return e.jsx(ki,{data:r,entities:i});case'bar':case'groupedBar':return e.jsx(Di,{data:r,entities:i,maxDataPoints:o,orientation:n});case'pie':case'groupedPie':return e.jsx(gi,{data:r,entities:i,type:t,count:a});case'lineBar':return e.jsx(Ai,{data:r,entities:i});default:return e.jsx(e.Fragment,{})}},Bi={sort:({disabled:t,visible:r=!0,label:i='Export',icon:o=e.jsx(Ne,{fontSize:'large'}),onClick:n})=>e.jsx(e.Fragment,{children:r&&e.jsx(it,{title:i,children:e.jsx('div',{children:e.jsx(ot,{icon:o,disabled:t,onClick:()=>n?.(),size:'small',variant:'text'})})})}),export:({disabled:t,visible:r=!0,label:i='Export',icon:o=e.jsx(Oe,{fontSize:'large'}),onClick:n})=>e.jsx(e.Fragment,{children:r&&e.jsx(it,{title:i,children:e.jsx('div',{children:e.jsx(ot,{icon:o,disabled:t,onClick:()=>n?.(),size:'small',variant:'text'})})})}),help:({disabled:t,visible:r=!0,label:i='Export',icon:o=e.jsx(Mt,{fontSize:'large'})})=>e.jsx(e.Fragment,{children:r&&e.jsx(it,{title:i,children:e.jsx('div',{children:e.jsx(ot,{icon:o,disabled:t,size:'small',variant:'text'})})})})},zi=({config:i,data:o})=>{const{title:n,graphType:a,width:l,action:s,entities:d,maxDataPoints:c,graphOrientation:p,height:x=250}=i??{},{data:h,count:u}=o??{},[m,g]=t.useState(h),[f,y]=t.useState('Ascending');t.useEffect((()=>{g(bi(h,f))}),[h]);const b=e=>{switch(e){case'sort':'groupedBar'===a&&(g(((e,t='Descending')=>{const r=e?.slice().sort(((e,r)=>{const i=e.ontime/e.total,o=r.ontime/r.total;return'Ascending'===t?i-o:o-i}));return r})(h,f)),y((e=>'Descending'===e?'Ascending':'Descending'))),'bar'===a&&'horizontal'===p&&(g(bi(h,f)),y((e=>'Descending'===e?'Ascending':'Descending')));break;case'export':try{((e,t=[],r)=>{var i=G.utils.json_to_sheet(t,{header:e}),o=G.utils.book_new();G.utils.book_append_sheet(o,i,'API'),G.writeFile(o,`${r}.XLSX`)})(Object.keys(h[0]),h,n??'Sheet')}catch(e){}}};return e.jsxs(Nt,{xs:l,sx:{boxSizing:'border-box',flexDirection:'column',justifyContent:'space-between',padding:'20px',height:x,bgcolor:'background.paper',borderRadius:2,border:'1px solid #E0E0E0'},children:[e.jsxs(r.Box,{sx:{display:'flex',justifyContent:'space-between'},children:[e.jsx(r.Typography,{variant:'h4',color:'common.black',children:n}),e.jsx(r.Box,{sx:{display:'flex',justifyContent:'space-between'},children:s?.map((t=>{const{active:r,visible:i,id:o,label:a}=t,l=Bi[t.id];return e.jsx(l,{visible:i,disabled:!r,label:'sort'===o?f+' '+a:a,onClick:()=>b(o)},`${o}-${n}`)}))})]}),e.jsx(r.Box,{sx:{height:'calc(100% - 36px)'},children:e.jsx(Mi,{type:a,entities:d,maxDataPoints:c,data:m,orientation:p,count:u})})]})},Li=({anchorEl:t,onFilterChange:i,initialState:o})=>{const n=r.useTheme(),[a,l]=X.default.useState(o||{});X.default.useEffect((()=>{i(a)}),[a]);return e.jsx(r.Popper,{open:Boolean(t),anchorEl:t,placement:'bottom-end',sx:[{zIndex:999}],children:e.jsxs('div',{style:{width:175,height:188,borderRadius:4,boxSizing:'border-box',padding:'16px 8px',backgroundColor:n.palette.common.white,boxShadow:'0px 24px 40px rgba(26, 26, 26, 0.16)'},children:[e.jsx('div',{style:{display:'flex',flexDirection:'row',alignItems:'center',padding:0,margin:'8px 0'},children:e.jsx(ht,{checked:Object.values(a).every((e=>!e.hide)),size:'medium',label:'All',disableRipple:!0,onClick:()=>{Object.values(a).every((e=>!e.hide))?(Object.keys(a).forEach((e=>a[e].disabled?a[e].hide=!1:a[e].hide=!0)),l({...a})):(Object.keys(a).forEach((e=>a[e].hide=!1)),l({...a}))}})}),e.jsx('div',{style:{overflow:'auto',height:'calc(100% - 28px)'},children:Object.entries(a).map(((t,r)=>{return e.jsx('div',{style:{display:'flex',flexDirection:'row',alignItems:'center',padding:0,margin:'8px 0'},children:e.jsx(ht,{checked:!t[1].hide,size:'medium',label:t[1].title,disabled:t[1].disabled,disableRipple:!0,onClick:(i=t[0],()=>{a[i].hide=!a[i].hide,l({...a})})})},r);var i}))})]})})};exports.Accordion=({title:t,children:i,defaultValue:o,onChange:n,value:a})=>{const[l,s]=r.useControlled({name:'Accordion',default:o,controlled:a});return e.jsxs(r.Box,{borderBottom:'1px solid black',borderColor:'grey.300',children:[e.jsxs(r.Box,{display:'flex',justifyContent:'space-between',alignItems:'center',px:5,py:2,onClick:()=>{n?.(l),s((e=>!e))},children:[e.jsx(r.Typography,{variant:'body1',children:t}),e.jsx(Te,{fontSize:'small',sx:[l&&{rotate:'180deg',transition:'all 0.2s ease-in'},!l&&{rotate:'0deg',transition:'all 0.2s ease-out'}]})]}),l&&e.jsx(r.Box,{px:5,py:1,children:i})]})},exports.AccordionWithTable=({accordionSummaryTitle:t,rows:o=[],columns:n=[],accordionFooter:a,defaultExpanded:l=!1,cellheight:s='20px',buttonComponent:d,getUniqueRowId:c,disableTableFooter:p=!0,collapsableTableProps:x={}})=>{const h=i.useTheme();return e.jsx(r.Box,{children:e.jsxs(r.Accordion,{defaultExpanded:l,sx:{borderRadius:'8px !important',border:`1px solid ${h.palette.grey[700]}`,'.MuiDataGrid-virtualScroller':{pb:'4px'},'.MuiDataGrid-virtualScrollerContent':{borderBottom:`1px solid ${h.palette.grey[700]}`}},elevation:0,disableGutters:!0,children:[e.jsx(r.AccordionSummary,{expandIcon:e.jsx(Te,{fontSize:'small',sx:{height:s,width:'20px'}}),children:e.jsxs(r.Box,{sx:{display:'flex',alignItems:'center',justifyContent:'center'},children:[e.jsx(r.Typography,{variant:'h5',children:t}),d&&d]})}),e.jsx(r.AccordionDetails,{sx:{p:0},children:e.jsxs(r.Box,{sx:{boxSizing:'border-box','& .super-app-theme--New':{bgcolor:h.palette.secondary[50],'&:hover':{bgcolor:()=>h.palette.secondary[50]}}},children:[e.jsx(Rt,{rows:o,columns:n,getUniqueRowId:c,disableTableFooter:p,...x}),a&&e.jsx(r.Box,{sx:{m:'10px auto 14px 20px',display:'flex'},children:a})]})})]})})},exports.ActiveBadge=Pt,exports.Alert=({title:t,color:i='success',variant:o='outlined',children:n})=>e.jsxs(r.Box,{sx:[{display:'flex',px:2,py:1,gap:1,borderRadius:'4px'},'contained'===o&&{bgcolor:`${i}.light`},'outlined'===o&&{border:1,borderColor:`${i}.main`}],children:[Ht[i],t&&e.jsx(r.Typography,{variant:'h5',children:t}),n]}),exports.Badge=({rounded:t=!0,color:r='primary',children:o,size:n='medium',sx:a,...l})=>{const s=i.useTheme();return e.jsx(pe.default,{...l,sx:[{'& .MuiBadge-badge':{backgroundColor:s.palette[r].light,color:'1A1A1A',borderRadius:'4px',fontFamily:'"Source Sans Pro", sans-serif'},'& .MuiBadge-invisible':{WebkitTransform:'scale(0) translate(50%, -50%)!important',MozTransform:' scale(0) translate(50%, -50%)!important',MsTransform:'scale(0) translate(50%, -50%)!important',transform:'scale(0) translate(50%, -50%)!important'}},'small'===n&&{'& .MuiBadge-badge':{height:'24px',width:'24px',transform:'scale(1) translate(90%, -50%)',...s.typography.body2}},'medium'===n&&{'& .MuiBadge-badge':{height:'32px',width:'32px',transform:'scale(1) translate(90%, -60%)',...s.typography.body1}},'large'===n&&{'& .MuiBadge-badge':{height:'40px  ',width:'40px',transform:'scale(1) translate(90%, -70%)',...s.typography.subtitle2}},!!t&&{'& .MuiBadge-badge':{borderRadius:'50%'}},...Boolean(a)&&Array.isArray(a)?a:[],Boolean(a)&&!Array.isArray(a)?a:{}],children:o})},exports.Breadcrumbs=Ot,exports.Button=st,exports.Card=({width:t,height:i='100%',footerProps:o,headerProps:n,children:a,title:l,sx:s,containerProps:d={}})=>e.jsxs(r.Box,{width:t,height:i,...d,sx:[{boxSizing:'border-box',borderRadius:'8px',background:'#fff',border:1,borderColor:'grey.300',display:'flex',flexDirection:'column'},...Boolean(d.sx)&&Array.isArray(d.sx)?d.sx:[],Boolean(d.sx)&&!Array.isArray(d.sx)?d.sx:{}],children:[l&&e.jsx(qt,{title:l,...n}),e.jsx(r.Box,{style:{flex:1},sx:s,children:a}),o&&e.jsx(Wt,{...o})]}),exports.Checkbox=ht,exports.Chip=({size:t='medium',variant:i='contained',label:o,badgeProps:n,selected:a=!1,disabled:l=!1,onClick:s,sx:d,deletable:c,onDelete:p})=>{const x=r.useTheme();return e.jsxs(r.Box,{sx:[...Boolean(d)&&Array.isArray(d)?d:[],Boolean(d)&&!Array.isArray(d)?d:{},{height:'small'===t?32:40,boxSizing:'border-box',width:'max-content',borderRadius:2,display:'inline-flex',alignItems:'center',cursor:'pointer',color:'#1A1A1A'},'small'===t&&{height:'32px',padding:'8px 6px'},'medium'===t&&{height:'40px',padding:'10px 8px'},'contained'===i&&{background:a?x.palette.primary.main:'#E3E3E3',color:a?'#fff':'#1A1A1A','&:hover':{background:a?x.palette.primary.dark:'#D7E3FE'}},'outlined'===i&&{bgcolor:a?'primary.50':'#FFFFFF',border:'1px solid #C7C7C7',borderColor:a?'primary.main':'#C7C7C7',color:a?'primary.main':'#1A1A1A','&:hover':{background:a?'primary.50':'#D7E3FE'}},l&&{backgroundColor:'#E3E3E3',cursor:'default',color:'#A1A1A1','&:hover':{backgroundColor:'#E3E3E3'}}],onClick:l?void 0:s,children:[Boolean(n)&&(n?.loading?e.jsx(r.Skeleton,{animation:'wave',variant:'rounded',width:24,height:24,sx:{mr:1}}):e.jsx(r.Box,{sx:[{height:'24px',boxSizing:'border-box',width:'max-content',borderRadius:2,display:'flex',marginRight:'8px',padding:'4px',justifyContent:'center',alignItems:'center',minWidth:'28px',bgcolor:n?.bgColor??'primary.200',color:n?.color??'inherit'},a&&{color:'#1a1a1a'},l&&{bgcolor:'#C7C7C7',color:'#666666'}],children:e.jsx(r.Typography,{variant:'body2',children:n?.label})})),e.jsxs(r.Box,{style:{width:'max-content',display:'flex',justifyContent:'center',alignItems:'center'},children:[e.jsx(r.Typography,{variant:'small'===t?'body2':'body1',color:'inherit',children:o}),c&&e.jsx('span',{style:{width:'16px',height:'16px',display:'flex',justifyContent:'center',alignItems:'center',marginLeft:'8px'},onClick:l?void 0:p,children:e.jsx(nt,{sx:{fontSize:'11px',color:a?'#ffffff':'#666666'}})})]})]})},exports.CollapsableTable=Rt,exports.CounterTabs=({tabs:t,size:o='small',width:n=100,onTabChange:a,value:l,sx:s,tabSx:d,initialTabValue:c,disabled:p=!1,isLoading:x=!1,...h})=>{const u=i.useTheme(),[m,g]=r.useControlled({controlled:l,default:c,name:'Tabs'});return e.jsx(me.default,{value:m,indicatorColor:'primary',textColor:'primary',onChange:(e,t)=>{g(t),a&&a(t)},'aria-label':'disabled tabs example',sx:{width:'400px',minHeight:0,'& .MuiTabs-indicator':{backgroundColor:`${p?u.palette.grey[350]:u.palette.primary.main}`},...s,height:'100%','& .MuiTabs-root':{minHeight:'155px !important'},'& .MuiTab-root':{borderColor:'transparent'},'& .MuiTab-iconWrapper':{marginLeft:'10px'},'& div, button':{height:'100%'}},...h,children:t?.map(((t,i)=>e.jsx(ue.default,{icon:x?e.jsx(r.Skeleton,{animation:'wave',variant:'rounded',width:32,height:24}):e.jsx($t,{badgeCount:t.badgeCount,disable:p}),iconPosition:'end',value:t.id,...h,disabled:p,...t,sx:{minHeight:0,height:'small'===o?'36px':'40px',color:u.palette.common.black,borderBottom:`1px solid ${u.palette.grey[350]}`,textTransform:'none',...u.typography.h5,'&:hover':{color:u.palette.primary.main},...d}},i)))})},exports.CustomGrid=Nt,exports.DatePicker=hr,exports.DatePopper=ur,exports.DateRangePicker=br,exports.DateTimePicker=Br,exports.DateTimeRangePicker=zr,exports.DefaultActions=ft,exports.Dialog=lt,exports.DialogFooter=at,exports.Dropdown=ar,exports.Filter=({quickFilterForm:t=mt(),initialValues:i,config:o=[],onApply:n,onCancel:a,applyButtonProps:l,cancelButtonProps:s,position:d='right',type:c='Button',isActive:p=!1,disabled:x=!1,visible:h=!0,icon:u=e.jsx(Vr,{fontSize:'large'}),label:m='Filters',filterButtonProps:g})=>{const f=rt(!1),y=mt(i);if(0===o.length)return null;const b=o.filter((e=>e.quick)),j=o.filter((e=>!e.quick));return e.jsxs('span',{children:[h&&e.jsxs(r.Box,{sx:{display:'flex',gap:2,flexWrap:'wrap'},children:[b?.map((i=>e.jsx(r.Box,{children:e.jsx(Hr,{config:{...i,props:{...i.props&&{...i.props},...i.props&&i.props.options&&{options:i?.props?.options?.filter((e=>!!e&&('string'==typeof e||'object'==typeof e&&'key'in e&&'label'in e))).map((e=>'string'==typeof e?{key:e,label:e}:e)),getOptionValue:e=>e.key,getOptionLabel:e=>e.label?r.capitalize(String(e.label)):''},width:i?.props?.width||280}},form:t})},i.key))),j?.length?e.jsx(it,{title:m||'Filters',children:'Button'===c?e.jsx(st,{text:m,variant:'outlined',size:'small',id:'filterIconId',leftIcon:u,onClick:f.setTrue,disabled:x,...g}):e.jsx(Pt,{invisible:!p,overlap:'circular',anchorOrigin:{vertical:'top',horizontal:'right'},variant:'dot',children:e.jsx('div',{children:e.jsx(ot,{icon:u,size:'small',variant:'text',onClick:f.setTrue,disabled:x})})})}):null]}),e.jsx(r.Drawer,{variant:'temporary',anchor:d,open:f.toggle,onClose:f.setFalse,ModalProps:{keepMounted:!1},children:e.jsxs(r.Box,{sx:{width:'328px',display:'flex',flexDirection:'column',justifyContent:'space-between',height:'100%'},children:[e.jsxs(r.Box,{style:{width:'100%',height:'calc(100% - 88px)'},children:[e.jsxs(r.Box,{sx:{px:4,py:2.5,boxSizing:'border-box',display:'flex',justifyContent:'space-between',alignItems:'center',color:'common.black'},children:[e.jsx(r.Typography,{variant:'h3',children:m}),e.jsx(te.default,{onClick:f.setFalse,color:'default',children:e.jsx(nt,{htmlColor:'common.black',fontSize:'small'})})]}),e.jsx(r.Box,{style:{height:'calc(100% - 65px)',overflow:'auto'},children:e.jsx(r.Box,{sx:{display:'flex',flexDirection:'column',justifyContent:'space-between',px:1,py:0,boxSizing:'border-box'},children:j.map((t=>e.jsx(r.ListItem,{sx:{py:2},children:e.jsx(Hr,{config:{...t,props:{...t.props&&{...t.props},...t.props&&t.props.options&&{options:t?.props?.options?.filter((e=>!!e&&('string'==typeof e||'object'==typeof e&&'key'in e&&'label'in e))).map((e=>'string'==typeof e?{key:e,label:e}:e)),getOptionValue:e=>e.key,getOptionLabel:e=>e.label?r.capitalize(String(e.label)):''},width:t?.props?.width||280}},form:y})},t.key)))})})]}),e.jsxs(r.Box,{sx:{borderTop:1,borderTopColor:'#EBEBEB',py:2.5,px:5,display:'flex',justifyContent:'space-between',zIndex:100,boxSizing:'border-box'},children:[e.jsx(st,{variant:'outlined',color:'secondary',text:'Clear All',sx:{width:116},...s,onClick:r.debounce((()=>a?.(y.initForm())),500)}),e.jsx(st,{variant:'contained',text:'Apply',sx:{width:116},...l,onClick:r.debounce((()=>{n?.(y.form),f.setFalse()}),500)})]})]})})]})},exports.FilterActionButton=({onFilterChange:t,initialFilterState:i})=>{const[o,n]=X.default.useState(null);return e.jsx('div',{children:e.jsx(r.ClickAwayListener,{onClickAway:()=>n(null),children:e.jsxs('span',{children:[e.jsx(it,{title:'Choose Visible Columns',size:'small',children:e.jsx(r.IconButton,{onClick:e=>{n(o?null:e.currentTarget)},children:e.jsx(Z.GridColumnIcon,{color:'primary',fontSize:'large'})})}),e.jsx(Li,{anchorEl:o,onFilterChange:t,initialState:i})]})})})},exports.FinalFormComponent=({config:t=[],formId:r='form',initialValues:i={},onSubmit:o})=>e.jsx(L.Form,{onSubmit:o,initialValues:i,render:({handleSubmit:i})=>e.jsx('form',{id:r,onSubmit:i,style:{boxSizing:'border-box',display:'flex',height:'calc(100%)',width:'calc(100%)',justifyContent:'center',overflow:'auto',gap:'24px',flexWrap:'wrap',padding:'32px'},children:(t??[])?.map((t=>e.jsx(L.Field,{name:t.key,label:t.label,placeholder:t.label,componentType:t.type,type:t.schemaProps?.type,required:t.props.required,disabled:t.props.disabled,options:t.props.options,component:Wr,validate:t.props.required?qr:void 0},t.key)))})}),exports.FormComponent=Hr,exports.GlobalLoader=()=>e.jsx(r.Box,{display:'flex',height:'100%',justifyContent:'center',alignItems:'center',sx:{color:'grey.300'},children:e.jsx(r.CircularProgress,{size:'5rem',color:'inherit'})}),exports.Header=({title:t,breadcrumbprops:r,children:o,containerProps:n,childrenContainerProps:a,titleContainerProps:l,navigateBack:s,navigateBackIconProps:d,badgeProps:c})=>{const p=i.useTheme(),x=Boolean(r);return e.jsxs(ee.default,{...n,sx:{minHeight:'72px',maxHeight:'min-content',backgroundColor:p.palette.primary[50]||'#F5F8FF',borderBottom:`1px solid ${p.palette.primary[200]||'#BFD2FD'}`,padding:'0 32px',display:'flex',justifyContent:'space-between',alignItems:'center',boxSizing:'border-box',...n?.sx},children:[e.jsxs(ee.default,{...l,children:[r&&e.jsx(Ot,{sx:{marginBottom:'7px'},...r}),e.jsxs(le.default,{sx:{display:'flex',alignItems:'center'},variant:x?'h4':'h3',children:[s&&e.jsx($r,{onClick:s,sx:{marginRight:'6px',color:p.palette.primary.main},...d}),t,c&&e.jsx('span',{style:{display:'flex',alignItems:'center',height:'24px',borderRadius:'4px',backgroundColor:c.color??'#D7E3FE',marginLeft:'12px',...p.typography.body2,padding:'2.5px 4px',boxSizing:'border-box'},children:c.count})]})]}),e.jsx(ee.default,{...a,children:o})]})},exports.IconButton=ot,exports.Input=Ut,exports.IntugineThemeProvider=function(t){return e.jsx(r.ThemeProvider,{theme:t.theme||Ur,children:t.children||'Your App'})},exports.Label=dt,exports.PageLoader=jt,exports.Pagination=et,exports.PersistentDrawer=({navigation:t,width:i=224,LinkElement:o,BrandLogo:n,getPathName:a,toggleButtonProps:l={}})=>{const{toggle:s,handleToggle:d,setFalse:c}=rt(!1);return e.jsxs(e.Fragment,{children:[e.jsx(te.default,{onClick:d,sx:{p:'0px'},children:e.jsx(ee.default,{...l,sx:{width:64,height:63,boxSizing:'border-box',display:'flex',justifyContent:'center',alignItems:'center',backgroundColor:'#66789F',cursor:'pointer','&:hover':{backgroundColor:'#405687'},...l.sx||{}},children:e.jsx(Ze,{fontSize:'large',sx:{color:'#fff'},...l.BurgerMenuProps||{}})})}),e.jsx(r.Drawer,{variant:'temporary',anchor:'left',open:s,onClose:d,ModalProps:{keepMounted:!1},children:e.jsxs(ee.default,{sx:{width:i,height:'100%',display:'flex',flexDirection:'column',justifyContent:'space-between'},children:[e.jsxs(ee.default,{sx:{height:'calc(100% - 56px)',flexGrow:1,display:'flex',flexDirection:'column'},children:[e.jsxs(ee.default,{sx:{width:'100%',display:'flex',alignItems:'center',height:'64px',padding:'0 14px',justifyContent:'space-between',boxSizing:'border-box'},children:[e.jsx(ee.default,{sx:{height:'64px',display:'flex',alignItems:'center',padding:'2px 0px',boxSizing:'border-box'},children:n||e.jsx('img',{src:ri,alt:'brand logo',height:32,width:0,style:{margin:'auto 0px',width:'auto'}})}),e.jsx(te.default,{disableRipple:!0,color:'primary',sx:{padding:0,width:'20px',height:'20px',color:'#fff'},onClick:d,children:e.jsx(Ge,{fontSize:'medium',color:'primary'})})]}),e.jsx(ee.default,{sx:{height:'calc(100% - 154px)',overflow:'auto',flexGrow:1,display:'flex',flexDirection:'column'},children:e.jsx(ee.default,{style:{flexGrow:1,paddingTop:''+(s?'20px':'16px')},id:'leftNavParentDiv',children:e.jsx(ei,{getPathName:a,navigation:t,LinkElement:o,onNavItemClick:c})})})]}),e.jsxs(ee.default,{sx:{maxHeight:'56px',minHeight:'56px',display:'flex',p:'12px 16px',alignItems:'center',boxSizing:'border-box'},children:[e.jsx('img',{src:ri,height:32,width:32,alt:'footer-brandLogo'}),e.jsx(ee.default,{sx:{ml:'4px'},children:e.jsx(le.default,{variant:'body1',fontWeight:'500',color:'#666666',children:ti})})]})]})})]})},exports.Radio=fr,exports.Refresh=({isRefreshing:t=!1,onRefresh:r})=>e.jsx(it,{title:'Refresh',id:'refreshIcon',children:e.jsx('div',{children:e.jsx(ot,{sx:{'.MuiButton-startIcon':{margin:'auto',svg:{padding:0}}},icon:e.jsx(We,{fontSize:'large',sx:{animation:t?'spin 1s linear infinite':void 0,'@keyframes spin':{'0%':{transform:'rotate(0deg)'},'100%':{transform:'rotate(360deg)'}}}}),size:'small',variant:'text',onClick:()=>r?.()})})}),exports.RolesTable=({isLoading:i=!1,tableRowData:o=[],columnNames:n,editDisabledColumns:a,isChecked:l,setIsChecked:s,finalIsCheckedData:d,setFinalIsCheckedData:c,actionToHeaderMapping:p,resourceToHeaderMapping:x,userManagementPolicy:h,editPermissionsHandler:u,deleteRoleHandler:m})=>{const[g,f]=t.useState(null),[y,b]=t.useState(null),[j,C]=t.useState(null),[k,w]=t.useState(''),[v,S]=t.useState(!1),[D,F]=t.useState(!1),[A,M]=t.useState(!1),[B,z]=t.useState(!1),[L,T]=t.useState([]),E=Boolean(g),[R,P]=t.useState({});t.useEffect((()=>{const t=[];n?.map((r=>r?.visibility&&t.push(((t,r,i,o,n,a,l,s)=>({accessorFn:()=>t.id,id:t.id,cell:({row:d,getValue:c})=>e.jsx('div',{style:{paddingLeft:2*d.depth+'rem'},children:e.jsx(ci,{disabled:r!==c()||!!i.includes(c())||('transporter'===t?.type?!o.includes(d.original.module_name):!n.includes(d.original.module_name)),checked:a(d,c),indeterminate:l(d,c),onChange:()=>s(d,c)})}),header:()=>e.jsx('span',{children:t?.name||''}),footer:e=>e?.column?.id}))(r,y,a,ni,ai,$,q,W)))),T(t)}),[l,n,y]);const H=[{accessorFn:e=>e.intracityModules,id:'intracityModules',cell:({row:t,getValue:r})=>e.jsx(di,{row:t,getValue:r}),header:()=>e.jsx('span',{children:'Intracity Modules'}),footer:e=>e.column.id},...L],V=I.useReactTable({data:o,columns:H,state:{expanded:R},onExpandedChange:P,getSubRows:e=>e.subRows,getCoreRowModel:I.getCoreRowModel(),getPaginationRowModel:I.getPaginationRowModel(),getFilteredRowModel:I.getFilteredRowModel(),getExpandedRowModel:I.getExpandedRowModel()}),O=()=>{f(null)},W=(e,t)=>{let r=[];$(e,t)?(e.original.module_name===e.original.intracityModules?r=l.filter((r=>!r.includes(`${t()}:${e.original.module_name}`))):(r=l.filter((r=>r!==`${t()}:${e.original.module_name}:${e.original.intracityModules}`)),r=r.filter((r=>r!==`${t()}:${e.original.module_name}:${e.original.module_name}`))),s(r)):(e.original.module_name===e.original.intracityModules?(r=e.originalSubRows.map((e=>`${t()}:${e.module_name}:${e.intracityModules}`)),r=l.concat([...r,`${t()}:${e.original.module_name}:${e.original.intracityModules}`])):(r=[...l].concat([`${t()}:${e.original.module_name}:${e.original.intracityModules}`]),o.find((t=>t.intracityModules===e.original.module_name)).subRows.length===r.filter((r=>r.includes(`${t()}:${e.original.module_name}`))).length&&(r=r.concat([`${t()}:${e.original.module_name}:${e.original.module_name}`]))),s(r)),s(r)},q=(e,t)=>!!l?.find((r=>r.includes(`${t()}:${e.original.intracityModules}`))),$=(e,t)=>!!l?.find((r=>r===`${t()}:${e.original.module_name}:${e.original.intracityModules}`));return t.useEffect((()=>{V.setPageSize(50),b(null)}),[]),e.jsx(r.Box,{sx:{width:'100%',height:'100%',borderRadius:'15px'},children:e.jsxs(r.Paper,{sx:{width:'100%',height:'100%',position:'relative',zIndex:0},elevation:3,children:[i&&e.jsx('div',{style:{height:'100%',width:'100%',position:'absolute',backdropFilter:'brightness(0.9)',zIndex:99},children:e.jsx(jt,{})}),e.jsxs(e.Fragment,{children:[e.jsx(r.TableContainer,{sx:{width:'100%',overflow:'scroll',borderRadius:'15px',height:'calc(100% - 4rem)','&::-webkit-scrollbar-track':{marginTop:'70px'}},children:e.jsxs(r.Table,{stickyHeader:!0,'aria-label':'sticky table',children:[e.jsx(r.TableHead,{children:e.jsx(li,{table:V,open:E,handleClick:(e,t,r)=>{f(e.currentTarget),C(t),w(r)},handleClose:O,anchorEl:g,onClickEditHandler:()=>{!a.includes(j)&&!y&&j&&b(j),!a.includes(j)&&y&&y!==j&&M(!0),O()},editDisabledColumns:a,userManagementPolicy:h,columnToBeHandled:j,flexRender:I.flexRender,isBeingEdited:y,handleDeleteRoleDialog:()=>{!a.includes(j)&&y?M(!0):a.includes(j)?C(null):S(!0),O()}})}),e.jsx(r.TableBody,{children:e.jsx(si,{table:V,flexRender:I.flexRender})})]})}),e.jsx(pi,{isBeingEdited:y,editHandler:()=>{const e=l.filter((e=>e.includes(j))).map((e=>e.split(':'))).filter((e=>e[1]!==e[2])).map((e=>[e[1],e[2]])),t={},r=[];e.forEach((e=>{t[e[0]]?r.find((t=>x.find((e=>e?.key?.toLowerCase()===t?.resource?.toLowerCase()))?.label.toLowerCase()===e[0].toLowerCase()))?.action.push(p.find((t=>t?.label.toLowerCase()===e[1]?.toLowerCase()))?.key):(r.push({name:k.toLowerCase().split(' ').join('_')+'_policy',desc:'',resource:x.find((t=>t?.label?.toLowerCase()===e[0].toLowerCase()))?.key,effect:'allow',action:[p.find((t=>t?.label.toLowerCase()===e[1]?.toLowerCase()))?.key]}),t[e[0]]=e.length)})),c(l),z(!0),u(j,r),b(null),F(!1)},setCancelEditDialogOpen:F})]}),e.jsx(xi,{message:'Please Save the current Changes Before Leaving',color:'error',open:!!A,onClose:()=>{M(!1)},autoHideDuration:2e3}),e.jsx(xi,{message:'Changes Saved Successfully.',color:'success',open:!!B,onClose:()=>z(!1),autoHideDuration:2e3}),e.jsx(ii,{deleteRoleDialogOpen:v,setDeleteRoleDialogOpen:S,handleDeleteRole:()=>{m(j),C(null),S(!1),b(null)}}),e.jsx(oi,{cancelEditDialogOpen:D,setCancelEditDialogOpen:F,handleCancelEdit:()=>{b(null),s(d),F(!1)}})]})})},exports.SearchBox=Xt,exports.SelectDisplayItemsDialog=ut,exports.SidebarMenu=({anchorEl:t,children:i,onClose:o,parentElement:n,topOffset:a=0})=>e.jsx(r.ClickAwayListener,{onClickAway:o,children:e.jsxs('div',{style:{width:'auto',height:'100%',position:'relative'},children:[n,e.jsx(r.Slide,{direction:'left',in:Boolean(t),mountOnEnter:!0,unmountOnExit:!0,children:e.jsx('div',{style:{position:'absolute',right:0,top:a,height:`calc(100% - ${a}px)`,zIndex:999,filter:'drop-shadow(0px 24px 40px rgba(26, 26, 26, 0.16))'},children:i})})]})}),exports.SplitButton=function({handleMenuItemClick:r,handleButtonClick:i,options:o,buttonProps:n={}}){const[a,l]=t.useState(null),s=t.useRef(null),[d,c]=t.useState(0);return e.jsx(ir,{anchorEl:a,setAnchorEl:l,parentElement:e.jsxs(Ae.default,{variant:'contained',ref:s,'aria-label':'split button',disableElevation:!0,children:[e.jsx(ie.default,{sx:{height:'32px'},onClick:()=>i&&i(),...n,children:e.jsx(le.default,{variant:'h6',children:o[d]})}),e.jsx(ie.default,{size:'small','aria-controls':Boolean(a)?'split-button-menu':void 0,'aria-expanded':Boolean(a)?'true':void 0,'aria-label':'select merge strategy','aria-haspopup':'menu',onClick:()=>{l(a?null:s.current)},sx:{width:'32px',borderColor:'#264CA4',borderLeftWidth:0,'&:hover':{borderLeftWidth:0}},...n,children:e.jsx(Me.default,{})})]}),children:e.jsx(Ce.default,{elevation:0,sx:{boxShadow:'0px 4px 8px rgba(26, 26, 26, 0.2)',borderRadius:'4px',width:s.current?.clientWidth??'max-content'},children:e.jsx(ze.default,{autoFocusItem:!0,children:o.map(((t,i)=>e.jsx(Be.default,{onClick:e=>((e,t)=>{c(t),r&&r(e,t),l(null)})(e,i),children:t},t)))})})})},exports.Switch=wr,exports.Table=({columns:i=[],rows:o=[],headerProps:n,footerProps:a,tableProps:l,components:s,componentsProps:d,containerProps:c={},hideFooter:p=!1})=>{const x=r.useTheme(),[h,u]=t.useState(i);t.useEffect((()=>{u(i)}),[i]);return e.jsx(r.Box,{...c,sx:[{backgroundColor:'#fff',width:'100%',height:'100%',borderRadius:'8px'},...Boolean(c.sx)&&Array.isArray(c.sx)?c.sx:[],Boolean(c.sx)&&!Array.isArray(c.sx)?c.sx:{}],children:e.jsx(Y.DataGrid,{onCellDoubleClick:e=>{const t=e.value;t&&navigator.clipboard.writeText(t).then((()=>{Lt(`Copied to clipboard: ${t}`)})).catch((e=>{Tt('Failed to copy to clipboard!')}))},sx:[{'& .MuiDataGrid-columnHeaderWrapper, .MuiDataGrid-columnHeaders, .MuiDataGrid-columnsContainer':{height:44,minHeight:'44px !important',maxHeight:'44px !important',lineHeight:'44px !important',backgroundColor:'#F8F8F8',paddingLeft:'12px !important'},'& .MuiDataGrid-columnsContainer':{backgroundColor:'#F8F8F8',borderBottom:'1px solid #E3E3E3'},'& .MuiDataGrid-row, .MuiDataGrid-cell':{minHeight:'40px !important',maxHeight:'40px !important'},'& .MuiDataGrid-row':{paddingLeft:'12px !important','&:hover':{backgroundColor:'primary.contrastText'}},'&.MuiDataGrid-root .MuiDataGrid-columnHeader:focus, &.MuiDataGrid-root .MuiDataGrid-cell:focus, &.MuiDataGrid-root .MuiDataGrid-cell:focus-within':{outline:'none !important'}},{'& .MuiDataGrid-columnHeader':{...x.typography.h5,height:44,boxSizing:'border-box','& .MuiDataGrid-columnSeparator':{display:'none'}}},{'& \t.MuiDataGrid-cell':{minHeight:'40px !important',maxHeight:'40px !important',lineHeight:'40px !important',paddingLeft:'16px !important','$ [aria-selected=\'true\']':{backgroundColor:x.palette.primary.contrastText},'$ [aria-selected=\'false\']':{backgroundColor:x.palette.common.white},...x.typography.body1}}],hideFooter:p,columns:h,rows:o,rowHeight:40,slots:{toolbar:yt,footer:tt,...s},slotProps:{toolbar:{columns:i,selectedColumns:h,setSelectedColumns:u,rows:o,...n},footer:{columns:i,rows:o,...a},...d},disableRowSelectionOnClick:!0,...l})})},exports.TableFooter=tt,exports.TableHeader=yt,exports.Tabs=Ar,exports.TextArea=Rr,exports.Textbox=Kt,exports.TimePicker=Fr,exports.TimeRangePicker=({defaultValue:t,value:i,onChange:o,onApply:n,onCancel:a})=>{const[l,s]=mr({initialValue:t??i??{startDate:w.startOfDay(new Date),endDate:w.endOfDay(new Date)},value:i,onChange:o,isEqual:(e,t)=>w.isEqual(e.startDate,t.startDate)&&w.isEqual(e.endDate,t.endDate)});return e.jsxs(r.Paper,{elevation:0,sx:[{width:'540px',boxSizing:'border-box',boxShadow:'0px 24px 40px 0px #1A1A1A29',borderRadius:'4px'}],children:[e.jsxs(r.Box,{display:'flex',justifyContent:'space-between',padding:'32px',flexWrap:'wrap',children:[e.jsxs(r.Box,{children:[e.jsx(r.Typography,{variant:'h5',color:'primary',mb:'16px',children:'Start Date'}),e.jsx(Dr,{value:l.startDate,onChange:e=>s((t=>({...t,startDate:e})))})]}),e.jsxs(r.Box,{children:[e.jsx(r.Typography,{variant:'h5',color:'primary',mb:'16px',children:'End Date'}),e.jsx(Dr,{value:l.endDate,onChange:e=>s((t=>({...t,endDate:e})))})]})]}),e.jsx(cr,{containerProps:{sx:[{justifyContent:'flex-end',height:'80px !important',padding:'0 40px'}]},applyButtonProps:{disabled:w.isAfter(l.startDate,l.endDate),onClick:()=>n&&n(l)},cancelButtonProps:{onClick:()=>a&&a(l)}})]})},exports.Tooltip=it,exports.Widget=({config:t,data:r,navigateHook:i})=>{const{type:o}=t;switch(o){case'overview':return e.jsx(fi,{navigateHook:i,config:t,data:r});case'detailed':return e.jsx(zi,{config:t,data:r});case'counter':return e.jsx(yi,{navigateHook:i,config:t,data:r});default:return e.jsx(e.Fragment,{})}},exports.basicToast=(e,t)=>f.toast(e,{...zt,...t??{}}),exports.errorToast=Tt,exports.progressToast=(t,i)=>f.toast(t,{...zt,...i??{},hideProgressBar:!1,autoClose:!1,type:'warning',icon:()=>e.jsx(r.Box,{sx:{height:'20px'},children:e.jsx(r.CircularProgress,{size:'1rem',color:'inherit'})})}),exports.successToast=Lt,exports.useForm=mt,exports.warningToast=(e,t)=>f.toast(e,{...zt,...t??{},type:'warning'});
