@oc-digital/react-component-library 3.0.1-beta.0 → 3.0.1-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import type { AutoSaveSelectFieldProps } from "./AutoSave.types";
3
+ export declare const AutoSaveSelectField: React.FC<AutoSaveSelectFieldProps>;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import { AutoSaveTextFieldProps } from "./AutoSave.types";
3
+ export declare const AutoSaveTextField: React.FC<AutoSaveTextFieldProps>;
package/build/index.d.ts CHANGED
@@ -28,5 +28,7 @@ import { ISelectProps } from "./Select/Select.types";
28
28
  import { NavbarLayout, NavbarLayoutTabs } from "./NavbarLayout";
29
29
  import { FORM_SUCCESS, FORM_ERROR, FORM_LOADING, FORM_ENABLED, FORM_WARNING, FORM_DELETING, FormStatuses } from "./globals";
30
30
  import MobileDatePicker from "./MobileDatePicker/MobileDatePicker";
31
- export { ImageDisplayAndUpload, Alert, Button, ContentLabel, ContentBox, StaticTable, LoadingSpinner, Breadcrumbs, EntityList, ErrorIndicator, LeftNavigation, MainLayout, SearchBar, TextField, Select, DatePicker, KeyboardDatePicker, MobileDatePicker, ButtonWithConfirm, EditableTable, TableTextField, TableSelect, TableMultipleSelect, NonEditableField, TableDatePicker, tableNumericStringField, tableNumericStringFixedDecimalField, tableDateField, tableCheckbox, didCellValueChange, useDebounceEffect, useInterval, useWhyDidYouUpdate, AlphabeticalList, NumberFormatField, NavbarLayout, FORM_SUCCESS, FORM_ERROR, FORM_LOADING, FORM_ENABLED, FORM_WARNING, FORM_DELETING, };
31
+ import { AutoSaveTextField } from "./AutoSave/Text";
32
+ import { AutoSaveSelectField } from "./AutoSave/Select";
33
+ export { ImageDisplayAndUpload, Alert, Button, ContentLabel, ContentBox, StaticTable, LoadingSpinner, Breadcrumbs, EntityList, ErrorIndicator, LeftNavigation, MainLayout, SearchBar, TextField, Select, DatePicker, AutoSaveTextField, AutoSaveSelectField, KeyboardDatePicker, MobileDatePicker, ButtonWithConfirm, EditableTable, TableTextField, TableSelect, TableMultipleSelect, NonEditableField, TableDatePicker, tableNumericStringField, tableNumericStringFixedDecimalField, tableDateField, tableCheckbox, didCellValueChange, useDebounceEffect, useInterval, useWhyDidYouUpdate, AlphabeticalList, NumberFormatField, NavbarLayout, FORM_SUCCESS, FORM_ERROR, FORM_LOADING, FORM_ENABLED, FORM_WARNING, FORM_DELETING, };
32
34
  export type { FieldConfig, RowData, ITableHeader, TableCellValues, SynchCellWithStateFn, ICustomRenderFnProps, IEssentialRenderFnProps, ISelectProps, IEntity, INavigationLink, ISecondaryNavigationItem, ISecondaryNavigationSubItem, NavbarLayoutTabs, FormStatuses, };
package/build/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import e,{memo as t,useState as r,useMemo as n,useCallback as a,useEffect as o,useRef as i,forwardRef as l,Fragment as c}from"react";import d from"@mui/material/Button";import s from"@mui/material/CircularProgress";import m from"@mui/styles/makeStyles";import{string as u}from"yup";import{Typography as p,Box as g,CircularProgress as f,TableRow as h,TableHead as v,Table as b,TableBody as y,Pagination as x,TableCell as w,Link as C,ButtonBase as E,Grid as k,Button as S,ListItem as B,ListItemIcon as N,ListItemText as R,Collapse as I,List as T,IconButton as F,Container as L,Divider as P,InputBase as A,InputAdornment as W,TextField as D,MenuItem as H,Checkbox as O,FormControl as M,Select as z,FormHelperText as j,Tooltip as G,Alert as K,Avatar as U}from"@mui/material";import V from"@mui/styles/createStyles";import Y from"@mui/styles/withStyles";import{Link as J,useLocation as q,useHistory as X}from"react-router-dom";import Z from"@mui/icons-material/Error";import{ExpandLess as Q,ExpandMore as $,CloudUpload as _,Forward as ee}from"@mui/icons-material";import{isValid as te}from"date-fns";import re from"@mui/icons-material/Close";import ne from"@mui/icons-material/AddBoxOutlined";import ae from"@mui/icons-material/Search";import{isEqual as oe}from"lodash";import ie from"react-number-format";import{DatePicker as le}from"@mui/x-date-pickers/DatePicker";import{useTable as ce,useFilters as de,useGlobalFilter as se,usePagination as me,useRowSelect as ue,useAsyncDebounce as pe}from"react-table";import{MobileDatePicker as ge}from"@mui/x-date-pickers/MobileDatePicker";import{useVirtual as fe}from"react-virtual";var he=function(){return he=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},he.apply(this,arguments)};function ve(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}function be(e,t,r,n){return new(r||(r=Promise))((function(a,o){function i(e){try{c(n.next(e))}catch(e){o(e)}}function l(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,l)}c((n=n.apply(e,t||[])).next())}))}function ye(e,t){var r,n,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(l){return function(c){return function(l){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(i=0)),i;)try{if(r=1,n&&(a=2&l[0]?n.return:l[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,l[1])).done)return a;switch(n=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,n=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(a=i.trys,(a=a.length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){i.label=l[1];break}if(6===l[0]&&i.label<a[1]){i.label=a[1],a=l;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(l);break}a[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],n=0}finally{r=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}function xe(e,t,r){if(r||2===arguments.length)for(var n,a=0,o=t.length;a<o;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var we="0.5rem",Ce="1rem",Ee="1.5rem",ke="3rem",Se="EDITED",Be="Required";u().trim().required(Be),u().trim().required(Be).matches(/^\d*\.?\d*$/,"Must be a Number");var Ne="success",Re="error",Ie="loading",Te="enabled",Fe="warning",Le="deleting",Pe="read",Ae="noAccess",We="14px",De=m({labelBreak:{marginBottom:we},contentBreak:{marginBottom:Ce},sectionBreak:{marginBottom:Ee},doubleSectionBreak:{marginBottom:ke},rightSpacer1:{marginRight:we},rightSpacer2:{marginRight:Ce},leftSpacer1:{marginLeft:we},leftSpacer2:{marginLeft:Ce},buttonSpacing:{marginLeft:we,marginRight:we,marginBottom:Ce},leftRightPadding1:{paddingLeft:we,paddingRight:we},leftRightPadding2:{paddingLeft:Ce,paddingRight:Ce},topBottomPadding1:{paddingTop:we,paddingBottom:we},topBottomPadding2:{paddingTop:Ce,paddingBottom:Ce}},{classNamePrefix:"spacing",index:2}),He=m((function(e){return{boldText:{fontWeight:700},bolderText:{fontWeight:500},smallText:{fontSize:"0.7rem"},warningColor:{color:e.palette.warning.main},centerText:{textAlign:"center"}}}),{classNamePrefix:"font"}),Oe=m({contentBox:{background:"white",borderRadius:We,marginBottom:Ce,padding:ke},limitWidth60rem:{maxWidth:"60rem",marginLeft:"auto",marginRight:"auto"},limitWidth50rem:{maxWidth:"50rem",marginLeft:"auto",marginRight:"auto"},limitWidth45rem:{maxWidth:"45rem",marginLeft:"auto",marginRight:"auto"},limitWidth40rem:{maxWidth:"40rem",marginLeft:"auto",marginRight:"auto"},limitWidth35rem:{maxWidth:"35rem",marginLeft:"auto",marginRight:"auto"},limitWidth30rem:{maxWidth:"30rem",marginLeft:"auto",marginRight:"auto"},limitWidth25rem:{maxWidth:"25rem",marginLeft:"auto",marginRight:"auto"},centeredText:{textAlign:"center"},startAlignedText:{textAlign:"start"},width20:{width:"20%"},width49:{width:"49%"},width50:{width:"50%"},width60:{width:"60%"},width100:{width:"100%"},flexCenter:{display:"flex",alignItems:"center",justifyContent:"center"},centerJustify:{justifyContent:"center"},leftJustify:{justifyContent:"left"},rightJustify:{justifyContent:"right"}},{classNamePrefix:"layout",index:2}),Me=m((function(e){return{submitButton:{borderRadius:Ee,padding:"0.4rem 1rem",textTransform:"none"},containedText:{color:"white"},spinnerColour:{color:e.palette.grey[500]}}}));function ze(t){var r=t.loading,n=void 0!==r&&r,a=t.children,o=t.errors,i=void 0!==o&&o,l=t.type,c=void 0===l?"submit":l,m=t.onClick,u=t.disabled,p=void 0!==u&&u,g=t.variant,f=void 0===g?"outlined":g,h=t.styling,v=void 0===h?"":h,b=t.color,y=void 0===b?"primary":b,x=t.accessLevel,w=ve(t,["loading","children","errors","type","onClick","disabled","variant","styling","color","accessLevel"]),C=he(he({},De()),Me());if(x&&[Ae,Pe].includes(x))return null;var E=p;return p||!n&&!i||(E=!0),e.createElement(d,he({},w,{variant:f,color:y,type:c,className:"".concat(C.submitButton," ").concat("contained"===f&&C.containedText," ").concat(v),disabled:E,onClick:m}),a,n?e.createElement(s,{className:"".concat(C.leftSpacer1," ").concat(C.spinnerColour),size:"1.1rem",thickness:6}):"")}var je=function(t){var r=t.children,n=t.styling,a=void 0===n?null:n,o=He();return e.createElement(p,{variant:"h6",className:"".concat(o.bolderText," ").concat(a||"")},r)},Ge=function(t){var r=t.limitWidth,n=void 0!==r&&r,a=t.children,o=t.styling,i=t.id,l=he(he({},De()),Oe());return e.createElement(g,{id:i,boxShadow:3,className:"".concat(l.contentBox," ").concat(o||"")},e.createElement(g,{className:"".concat(l.centeredText," ").concat(n?l.limitWidth50rem:"")},a))},Ke=function(t){var r=t.text,n=void 0===r?"Loading data...":r,a=t.styling,o=he(he({},De()),Oe());return e.createElement(g,{className:"".concat(o.flexCenter," ").concat(a||"")},e.createElement(p,{variant:"body2",color:"textSecondary",className:o.rightSpacer1},n),e.createElement(f,{size:"1.5rem"}))},Ue=Y(V({root:{"&:hover td":{backgroundColor:"rgba(0, 0, 0, 0.06)"}}}))(h),Ve=Y(V({root:{"&:nth-of-type(even) td":{backgroundColor:"rgba(0, 0, 0, 0.03)"},"&:hover td":{backgroundColor:"rgba(0, 0, 0, 0.06)"}}}))(h),Ye=m((function(e){return{root:{borderBottom:"none",paddingTop:"8px",paddingBottom:"8px","&:first-child":{borderTopLeftRadius:We,borderBottomLeftRadius:We},"&:last-child":{borderTopRightRadius:We,borderBottomRightRadius:We}},head:function(t){var r=t.background,n=t.border,a=t.text;return{backgroundColor:r||"HSLA(204, 58.3%, 81.2%, 0.1)",borderTop:"1px solid ".concat(n||"HSLA(204, 58.3%, 81.2%, 0.3)"),borderBottom:"1px solid ".concat(n||"HSLA(204, 58.3%, 81.2%, 0.3)"),color:a||e.palette.text.primary,fontWeight:500,"&:first-child":{borderLeft:"1px solid ".concat(n||"HSLA(204, 58.3%, 81.2%, 0.3)")},"&:last-child":{borderRight:"1px solid ".concat(n||"HSLA(204, 58.3%, 81.2%, 0.3)")}}}}})),Je=function(t){var r=t.children,n=t.align,a=void 0===n?"centerJustify":n,o=t.headerColours,i=ve(t,["children","align","headerColours"]),l=he(he({},Oe()),Ye(he({},o||{})));return e.createElement(w,he({},i,{classes:{root:l.root,head:l.head}}),e.createElement("div",{className:"".concat(l.flexCenter," ").concat(l[a])},r))},qe=function(t){var r=t.rowBorderSeparation,n=void 0!==r&&r,a=t.children,o=ve(t,["rowBorderSeparation","children"]);return n?e.createElement(Ue,he({},o),a):e.createElement(Ve,he({},o),a)},Xe=function(t){var r=t.colSpan,n=t.children,a=Ze();return e.createElement(qe,null,e.createElement(Je,{className:a.adjustedCellPadding,colSpan:r},n))},Ze=m({tableStyles:{borderCollapse:"separate",borderBottom:"1px solid rgb(224, 224, 224)"},pointer:{cursor:"pointer"},bottomBorder:{borderBottom:"1px solid rgba(224, 224, 224, 1)"},noShading:{backgroundColor:"transparent !important"},adjustedCellPadding:{paddingTop:"11px",paddingBottom:"11px"}}),Qe=t((function(t){var r=t.headers,n=t.headerCellAlignment,a=void 0===n?[]:n,o=t.headerColours;return r?e.createElement(v,null,e.createElement(h,null,r.map((function(t,r){return e.createElement(Je,{align:a[r]||"centerJustify",key:"header-cell-".concat(r),headerColours:o},t)})))):null})),$e=t((function(t){var i=t.rowBorderSeparation,l=void 0!==i&&i,c=t.headers,d=t.rows,s=t.headerCellAlignment,m=void 0===s?[]:s,u=t.rowCellAlignment,p=void 0===u?[]:u,g=t.styling,f=t.headerColours,h=t.paginate,v=void 0!==h&&h,w=t.itemsPerPage,C=void 0===w?30:w,E=he(he(he({},Oe()),De()),Ze()),k=r(1),S=k[0],B=k[1],N=n((function(){return!!(v&&((null==d?void 0:d.length)||0)>C)}),[C,v,d]),R=r(N?d.slice(0,C):d),I=R[0],T=R[1],F=a((function(e,t){B(t)}),[]);return o((function(){T(N?d.slice(C*(S-1),C*S):d)}),[N,C,S,d]),e.createElement(e.Fragment,null,e.createElement(b,{className:"".concat(E.tableStyles," ").concat(N?E.contentBreak:""," ").concat(g||"")},e.createElement(Qe,{headers:c,headerCellAlignment:m,headerColours:f}),e.createElement(y,null,I?I.length?I.map((function(t,r){var n=!!t.onClick;return e.createElement(qe,{rowBorderSeparation:l,className:n?E.pointer:void 0,key:"row-".concat(r),onClick:n?t.onClick:void 0},t.row.map((function(t,n){return e.createElement(Je,{align:p[n]||"centerJustify",className:l&&I.length!==r+1?E.bottomBorder:void 0,key:"row-".concat(r,"-cell-").concat(n)},t)})))})):e.createElement(Xe,{colSpan:(null==c?void 0:c.length)||0},"Table is empty"):e.createElement(Xe,{colSpan:(null==c?void 0:c.length)||0},e.createElement(Ke,null)))),N?e.createElement(x,{className:E.flexCenter,count:Math.ceil(d.length/C),page:S,onChange:F,shape:"rounded",showFirstButton:!0,showLastButton:!0}):null)})),_e=m((function(e){return{logoContainer:{width:"3rem",height:"3rem",display:"flex",justifyContent:"center",alignItems:"center"},logo:{width:"100%",height:"100%","& > div":{width:"100%",height:"100%"},"& > svg":{width:"100%",height:"100%"}},logoInBreadcrumb:{width:"2rem",height:"2rem",margin:"0.125rem 0 0.125rem 0.313rem"},logoSpacing:{marginRight:e.spacing(1)},flexItemsCenter:{display:"flex",alignItems:"center"},nonPrimaryBreadcrumbOffset:{marginLeft:"2.5rem"},BreadcrumbsContainer:{height:"2.25rem",marginLeft:"0.875rem",marginRight:"1.5rem"},primaryBreadcrumbItem:function(t){var r=t.primary;return{backgroundColor:(null==r?void 0:r.background)||e.palette.common.white,color:(null==r?void 0:r.color)||e.palette.text.primary,borderRadius:"2rem",zIndex:3,height:"100%",display:"flex",alignItems:"center"}},secondaryBreadcrumbItem:function(t){var r=t.secondary;return{height:"2.25rem",backgroundColor:(null==r?void 0:r.background)||"#D7D4E4",borderRadius:"2rem",zIndex:2,marginLeft:"-2rem",color:(null==r?void 0:r.color)||e.palette.text.primary}},tertiaryBreadcrumbItem:function(t){var r=t.tertiary;return{height:"2.25rem",backgroundColor:(null==r?void 0:r.background)||"#D7D4E4",borderRadius:"2rem",zIndex:1,marginLeft:"-2rem",color:(null==r?void 0:r.color)||e.palette.common.white}},breadCrumbShadow:{boxShadow:e.shadows[2]},breadcrumbRightMargin:{marginRight:"1rem"},breadcrumbTextOverflow:{display:"block",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"12rem"},boldText:{fontWeight:500},activeBreadcrumb:function(t){var r=t.tertiary;return{backgroundColor:(null==r?void 0:r.background)||"#D7D4E4",color:(null==r?void 0:r.color)||e.palette.common.white}},noWrap:{whiteSpace:"nowrap"},fullBorderRadius:{borderRadius:"100%"}}})),et=function(t){var r=t.logo,n=t.content,a=t.colors,o=_e(he({},a||{})),i=n.first,l=void 0===i?null:i,c=n.second,d=void 0===c?null:c,s=n.third,m=void 0===s?null:s;return e.createElement(g,{className:"".concat(o.BreadcrumbsContainer," ").concat(o.flexItemsCenter)},e.createElement(g,{className:"".concat(l?"".concat(o.primaryBreadcrumbItem," ").concat(o.breadCrumbShadow):""," ").concat(o.flexItemsCenter)},e.createElement(C,{component:J,to:"/",className:o.logoSpacing},e.createElement(g,{className:"".concat(o.logoContainer," \n ").concat(l?o.logoInBreadcrumb:"")},e.createElement(E,{className:"".concat(o.logo," ").concat(o.fullBorderRadius)},r))),l&&e.createElement(p,{color:"textPrimary",className:"".concat(o.boldText," ").concat(o.noWrap," ").concat(o.primaryBreadcrumbItem)},e.createElement(C,{underline:"none",component:J,to:l.link,color:"inherit",className:"".concat(o.breadcrumbRightMargin," ").concat(o.breadcrumbTextOverflow)},l.name))),d&&e.createElement(g,{className:"".concat(o.flexItemsCenter," ").concat(o.secondaryBreadcrumbItem," ").concat(o.breadCrumbShadow," ").concat(m?"":o.activeBreadcrumb)},e.createElement(p,{color:"inherit",className:"".concat(o.boldText," ").concat(o.noWrap)},e.createElement(C,{component:J,underline:"none",to:d.link,color:"inherit",className:"".concat(o.nonPrimaryBreadcrumbOffset," ").concat(o.breadcrumbRightMargin," ").concat(o.breadcrumbTextOverflow)},d.name))),m&&e.createElement(g,{className:"".concat(o.flexItemsCenter," ").concat(o.tertiaryBreadcrumbItem," ").concat(o.breadCrumbShadow)},e.createElement(p,{color:"inherit",className:"".concat(o.boldText," ").concat(o.noWrap)},e.createElement(C,{component:J,underline:"none",to:m.link,color:"inherit",className:"".concat(o.nonPrimaryBreadcrumbOffset," ").concat(o.breadcrumbRightMargin," ").concat(o.breadcrumbTextOverflow)},m.name))))},tt=m((function(e){return{container:{marginRight:e.spacing(-1.5),marginLeft:e.spacing(-1.5)},svgContainer:{marginLeft:"auto",marginRight:"auto"},button:{display:"block",textDecoration:"none",borderRadius:We,height:"100%",width:"100%",textAlign:"center",color:e.palette.text.primary},orgLabel:{padding:e.spacing(1),paddingTop:0}}})),rt=function(t){var r=t.entities,n=t.icon,a=t.loadingMessage,o=void 0===a?"Loading list...":a,i=t.emptyMessage,l=void 0===i?"List is empty":i,c=t.onClick,d=he(he(he({},tt()),De()),He());return e.createElement(g,{className:d.container},r?r.length?e.createElement(k,{container:!0,spacing:3},r.map((function(t,r){return e.createElement(k,{key:"".concat(t.name,"-").concat(r),item:!0,xs:4,md:3},e.createElement(S,he({className:d.button,key:t.name},c?{onClick:function(){return c(t)}}:{component:J,to:t.link}),e.createElement(g,{className:"".concat(d.svgContainer," ").concat(d.labelBreak)},n(t)),e.createElement(p,{className:d.orgLabel,variant:"body1"},t.name)))}))):e.createElement(p,{className:d.centerText,variant:"body2",color:"text.primary"},l):e.createElement(Ke,{text:o}))},nt=function(t){var r=t.text,n=void 0===r?"Something went wrong":r,a=he(he({},De()),Oe());return e.createElement(g,{className:a.flexCenter},e.createElement(Z,{fontSize:"medium",className:a.rightSpacer1,color:"error"}),e.createElement(p,{variant:"body2",color:"textSecondary"},n))},at=m((function(e){return{listIcon:{minWidth:"auto",paddingRight:"0.25rem"},mainIconSize:{fontSize:"1rem"},mainIconMarginAdjustment:{marginTop:"3px"},textOverflowEllipsis:{overflow:"hidden",textOverflow:"ellipsis"},mainListItem:function(t){return{padding:"8px 24px 8px 16px",alignItems:"flex-start",backgroundColor:t.mainBackground||e.palette.common.white,color:t.mainText||e.palette.text.primary,borderRadius:e.spacing(.6),"&:hover":{backgroundColor:t.mainHover||e.palette.action.hover}}},mainIconColor:function(t){return{color:t.mainIcon||e.palette.grey[500]}},activeMainIconColor:function(e){return{color:e.mainActiveText||"#8FC1FF"}},subListItem:function(t){return{backgroundColor:t.subItemBackground||"#FFFFFF",color:t.subItemText||e.palette.text.secondary,borderRadius:"8px","&:hover":{backgroundColor:t.subItemHover||"rgba(143,193,255,0.3)"}}},activeSubListItem:function(e){return{backgroundColor:e.subItemActiveBackground||"#FFFFFF",color:e.subItemActiveText||"#8FC1FF","&:hover":{backgroundColor:e.subItemActiveHover||"rgba(143,193,255,0.3)"}}},subItemBorder:{borderLeft:"1px solid ".concat(e.palette.grey[600]),marginLeft:"1px",marginRight:"1px",width:"100%",height:"100%"},relativeWrapper:{position:"relative"},subItemBorderMask:function(e){return{borderLeft:"3px solid ".concat(e.subItemActiveText||"#8FC1FF"),borderRadius:"1px",position:"absolute",top:"50%",bottom:"50%",transition:"all 0.2s ease-in-out"}},activeSubItemBorder:{top:"0 !important",bottom:"0 !important"},subItemWrapper:{display:"flex",marginLeft:"13px",marginRight:"16px"},noYMargin:{marginTop:"unset",marginBottom:"unset"}}})),ot=function(e,t){return!!e.split("/").includes(t)},it=function(t){var n,a,o=t.mainItem,i=t.subItems,l=t.config,c=t.Icon,d=he(he(he({},He()),De()),at(he(he({},(null===(n=l.secondary)||void 0===n?void 0:n.mainItemColors)||{}),(null===(a=l.secondary)||void 0===a?void 0:a.subItemColors)||{}))),s=q(),m=ot(s.pathname,o.id),u=r(!!(null==i?void 0:i.length)&&m),f=u[0],h=u[1];return e.createElement(e.Fragment,null,e.createElement(B,{button:!0,dense:!0,className:d.mainListItem,component:J,to:o.route},e.createElement(N,{className:"".concat(d.listIcon," ").concat(d.mainIconMarginAdjustment," ").concat(d.rightSpacer1)},e.createElement(c,{id:"second-nav-item",styling:"".concat(d.mainIconSize," ").concat(d.mainIconColor," ").concat(m?d.activeMainIconColor:"")})),e.createElement(R,{disableTypography:!0,className:d.noYMargin,primary:e.createElement(p,{variant:"body2",className:"".concat(d.bolderText," ").concat(d.textOverflowEllipsis),color:"inherit"},o.name,(null==i?void 0:i.length)?e.createElement(p,{component:"span",variant:"body2",className:d.bolderText,color:"inherit"}," ","(",i.length,")"):null)}),(null==i?void 0:i.length)?e.createElement(N,{className:d.listIcon,onClick:function(e){e.preventDefault(),e.stopPropagation(),h((function(e){return!e}))}},f?e.createElement(Q,null):e.createElement($,null)):null),(null==i?void 0:i.length)?e.createElement(I,{in:f,timeout:"auto",unmountOnExit:!0},e.createElement(T,{component:"div",disablePadding:!0},i.map((function(t){var r=t.name,n=t.route,a=t.id;return e.createElement(g,{key:a,className:d.subItemWrapper},e.createElement(g,{className:"".concat(d.relativeWrapper," ").concat(d.rightSpacer1)},e.createElement(g,{className:"".concat(d.subItemBorder," ")}),e.createElement(g,{className:"".concat(d.subItemBorderMask," ").concat(ot(s.pathname,a)?d.activeSubItemBorder:""," ")})),e.createElement(B,{key:n,component:J,to:n,button:!0,dense:!0,className:"".concat(d.subListItem," ").concat(ot(s.pathname,a)?d.activeSubListItem:"")},e.createElement(R,{disableTypography:!0,primary:e.createElement(p,{variant:"body2",className:d.textOverflowEllipsis,color:"inherit"},r)})))})))):null)};function lt(e){return e.sort((function(e,t){return+t.startDate.split("T")[0].replaceAll("-","")-+e.startDate.split("T")[0].replaceAll("-","")}))}var ct=function(e,t,r){return r?(e&&te(e)?e:new Date(0)).getTime()===(t&&te(t)?t:new Date(0)).getTime():e===t},dt=m((function(e){return{secondaryNavWrapper:{height:"100%",width:"300px",background:"white",overflowY:"auto",overflowX:"hidden",borderTopRightRadius:We,borderBottomRightRadius:We,marginLeft:"-16px",paddingLeft:"16px",border:"1px solid ".concat(e.palette.grey[300]),boxShadow:"0 2px 4px 0 rgba(0, 0, 0, 0.3)",boxSizing:"border-box"},titleWrapper:{marginTop:"24px",display:"flex",alignItems:"center",paddingLeft:"16px",paddingRight:"16px"},title:{fontSize:"18px",fontWeight:500,color:function(e){return e.titleColor||"#8FC1FF"}},titleIcons:{color:function(e){return e.titleIconColor||"#8FC1FF"}},closeButton:{marginLeft:"auto"},archivedSeparator:{paddingLeft:"8px",color:e.palette.grey[500]},archivedBorder:{marginTop:"3rem",border:"1px solid ".concat(e.palette.grey[200]),width:"33%",marginLeft:"8px"},listWrapper:{marginLeft:e.spacing(1),marginRight:e.spacing(1)}}})),st=function(t){var r,n,a,o,i=t.secondaryNavItems,l=t.primaryNavItems,c=t.expandedOptions,d=t.setExpandedOptions,s=t.config,m={titleColor:null===(r=s.secondary)||void 0===r?void 0:r.titleColor,titleIconColor:null===(n=s.secondary)||void 0===n?void 0:n.titleIconColor},u=he(he(he({},De()),He()),dt(m)),f=X(),h=i[c.view];if(!h)return null;var v=l.find((function(e){return e.field===c.view})).Icon;return e.createElement(g,{className:u.secondaryNavWrapper},e.createElement(g,{className:u.titleWrapper},e.createElement(p,{className:"".concat(u.rightSpacer1," ").concat(u.title)},c.view),h.button?e.createElement(F,{className:u.titleIcons,size:"small",type:"button",onClick:function(){return f.push(h.button.url)}},e.createElement(ne,null)):null,e.createElement(F,{className:"".concat(u.titleIcons," ").concat(u.closeButton),size:"small",type:"button",onClick:function(){return d({view:"",expanded:!1})}},(null===(a=s.secondary)||void 0===a?void 0:a.closeButtonSvg)||e.createElement(re,null))),e.createElement(T,{className:u.listWrapper,component:"div"},lt(h.items).map((function(t){return e.createElement(it,he({key:t.mainItem.route},t,{config:s,Icon:v}))})),(null===(o=h.archivedItems)||void 0===o?void 0:o.length)?e.createElement(e.Fragment,null,e.createElement(g,{className:"".concat(u.archivedBorder," ").concat(u.contentBreak)}),e.createElement(p,{variant:"body2",className:"".concat(u.archivedSeparator," ").concat(u.bolderText)},"Archived ",c.view),lt(h.archivedItems).map((function(t){return e.createElement(it,he({key:t.mainItem.route},t,{config:s,Icon:v}))}))):null))},mt=m((function(e){return{primaryNavContainer:function(e){return{background:e.background||"linear-gradient(to bottom, #253a68 40%, #73c4ca)",border:"2px solid ".concat(e.activeBorderColor||"#8FC1FF"),borderLeft:"none",borderTopRightRadius:We,borderBottomRightRadius:We,minWidth:"4.5rem",overflowY:"auto",overflowX:"hidden"}},listWrapper:{display:"flex",flexDirection:"column",paddingTop:0},itemWrapper:{display:"flex",flexDirection:"column",padding:"0.75rem 0.5rem 0.5rem 0.5rem"},itemBorder:{borderRight:function(e){return"6px solid ".concat(e.activeBorderColor||"#8FC1FF")},position:"absolute",bottom:"50%",top:"50%",transition:"all 0.2s ease-in-out",right:"-3px"},activeBorder:{top:"15%",bottom:"15%"},iconWrapper:{minWidth:0,marginBottom:"4px",position:"relative"},itemName:{fontSize:"0.7rem",maxWidth:"3.5rem",textAlign:"center",textOverflow:"ellipsis",overflow:"hidden"},textColour:{color:function(e){return e.text||"#FFFFFF"}},activeTextColour:{color:function(e){return e.activeText||"#8FC1FF"}},lastItem:{marginTop:"auto"}}})),ut=function(t){var r=t.expandedOptions,n=t.setExpandedOptions,a=t.navigationLinks,o=t.config,i=q(),l=mt(he({},o.primary||{})),c=function(e,t){return""===r.view?i.pathname===t||!(e===o.rootRouteName||!i.pathname.startsWith(t)):r.view===e};return e.createElement(T,{className:"".concat(l.primaryNavContainer," ").concat(l.listWrapper)},a.map((function(t,r,a){var i;return e.createElement(B,he({key:t.field,button:!0,className:"".concat(l.itemWrapper," ").concat(l.textColour," ").concat((null===(i=o.primary)||void 0===i?void 0:i.moveLastItemToBottom)&&r===a.length-1?l.lastItem:"")},t.hasSecondary?{}:{component:J,to:t.path},{onClick:function(){n({view:t.field,expanded:!!t.hasSecondary})}}),e.createElement(N,{className:l.iconWrapper},e.createElement(t.Icon,{styling:"".concat(l.textColour," ").concat(c(t.field,t.path)?l.activeTextColour:"")})),e.createElement(p,{variant:"caption",className:"".concat(l.itemName," ").concat(l.textColour," ").concat(c(t.field,t.path)?l.activeTextColour:"")},t.field),e.createElement(g,{className:"".concat(l.itemBorder," ").concat(c(t.field,t.path)?l.activeBorder:"")}))})))},pt=m({leftNavContainer:{height:"100%",display:"flex",position:"relative",width:"max-content"}}),gt=function(t){var n=t.primaryNavItems,a=t.secondaryNavItems,i=t.config,l=r({view:"",expanded:!1}),c=l[0],d=l[1],s=pt(),m=q(),u=n.reduce((function(e,t){return t.hasSecondary?xe(xe([],e,!0),[t.field],!1):e}),[]);return o((function(){d((function(e){return u.includes(e.view)&&!0===e.expanded?e:{view:"",expanded:!1}}))}),[m.pathname]),e.createElement(g,{component:"nav",className:s.leftNavContainer},e.createElement(ut,{expandedOptions:c,setExpandedOptions:d,navigationLinks:n,config:i}),c.expanded&&e.createElement(st,{secondaryNavItems:a,primaryNavItems:n,expandedOptions:c,setExpandedOptions:d,config:i}))},ft=m((function(e){return{remainingHeightBox:{position:"absolute",top:function(e){var t;return null!==(t=e.topOffset)&&void 0!==t?t:"4rem"},bottom:0,left:0,right:0,display:"flex"},fullHeightFlexbox:{display:"flex",height:"100%"},relativeContainer:{position:"relative"},scrollWrapper:{overflow:"auto",overflowX:"hidden"},componentWrapper:{padding:e.spacing(2),paddingBottom:e.spacing(2),position:"relative"}}})),ht=function(t){var r=t.sideNavigation,n=t.children,a=t.desktopWidth,o=t.topOffset,i=t.id,l=ft({topOffset:o});return e.createElement(g,{className:l.remainingHeightBox},r?e.createElement(g,{className:"".concat(l.fullHeightFlexbox," ").concat(l.relativeContainer)},r):null,e.createElement(L,{id:i,disableGutters:!0,maxWidth:!1,className:l.scrollWrapper},e.createElement(L,{disableGutters:!0,maxWidth:a?"xl":"lg",className:l.componentWrapper},n)))},vt=function(e,t,r){void 0===r&&(r=250);var n=a(e,t);o((function(){var e=setTimeout(n,r);return function(){return clearTimeout(e)}}),[n,r])},bt=function(e,t){var r=i();o((function(){r.current=e})),o((function(){if(null!==t){var e=setInterval((function(){r.current&&r.current()}),t);return function(){return clearInterval(e)}}}),[t])};function yt(e,t){var r=i(t);o((function(){var n=Object.keys(he(he({},r.current),t)),a={};n.forEach((function(e){r.current[e]!==t[e]&&(a[e]={from:r.current[e],to:t[e],changedKeys:t[e]&&"object"==typeof t[e]?Object.keys(r.current[e]).map((function(n){return r.current[e][n]===t[e][n]?"":n})).filter(Boolean):void 0,isDeepEqual:oe(r.current[e],t[e])})})),Object.keys(a).length&&console.log("[why-did-you-update]",e,{changes:a,props:{from:r.current,to:t}}),r.current=t}),Object.values(t))}var xt=m((function(e){return{divider:{background:e.palette.primary.main,height:"0.2rem"},letterHeader:{cursor:"default",color:e.palette.primary.main,marginTop:"1rem"},listItem:{borderRadius:We,border:"1px solid ".concat(e.palette.grey[300]),marginBottom:"0.5rem",paddingLeft:"24px",boxShadow:e.shadows[1]},topMargin:{marginTop:e.spacing(2),display:"block"}}})),wt=function(t){var r=t.array,n=t.sortFn,a=t.sortKey,o=void 0===a?"name":a,i=t.buttonClick,l=t.linkTo,c=t.ItemTemplate,d=t.arrayKey,s=void 0===d?"id":d,m=t.loading,u=void 0!==m&&m,g=t.loadingMessage,f=void 0===g?"Loading list...":g,h=t.emptyMessage,v=void 0===h?"List is empty":h,b=t.alphabetisedHeader,y=void 0===b||b,x=he(he(he({},xt()),De()),Oe());if(void 0===r||u)return e.createElement(Ke,{styling:x.topMargin,text:f});if(!(null==r?void 0:r.length))return e.createElement(p,{className:x.topMargin,align:"center",variant:"body2",color:"textSecondary"},v);var w=n?xe([],r,!0).sort(n):r,C="";return e.createElement(T,{className:x.limitWidth50rem},w.map((function(t,r){var n,a=!1;if(y){var d=((null===(n=t[o])||void 0===n?void 0:n[0])||"???").toLowerCase();d!==C&&(C=d,a=!0)}return e.createElement(e.Fragment,{key:t[s]||"alphabetical-list-".concat(r)},y&&a?e.createElement(e.Fragment,null,e.createElement(p,{className:"".concat(x.letterHeader),align:"left"},C.toUpperCase()),e.createElement(P,{className:"".concat(x.contentBreak," ").concat(x.divider)})):null,e.createElement(B,he({className:x.listItem,alignItems:"flex-start",button:!(!i&&!l)||void 0,onClick:i?function(){return i(t)}:void 0},l&&!i?{component:J,to:l(t)}:{}),e.createElement(c,{item:t})))})))},Ct=m((function(e){return{searchBox:{display:"flex",alignContent:"center",alignItems:"center",padding:"8px",border:"2px solid ".concat(e.palette.grey[300]),borderRadius:We},searchField:{borderRadius:We,width:"100%",background:function(e){return e.background||"RGBA(179, 213, 235, 0.1)"},height:"46px",paddingLeft:"24px",color:e.palette.grey[600]},searchIcon:{color:e.palette.grey[600]}}})),Et=function(t){var n=t.array,a=t.sortFn,i=t.sortKey,l=void 0===i?"name":i,c=t.buttonClick,d=t.linkTo,s=t.ItemTemplate,m=t.arrayKey,u=void 0===m?"id":m,p=t.loading,f=void 0!==p&&p,h=t.loadingMessage,v=void 0===h?"Loading list...":h,b=t.emptyMessage,y=void 0===b?"List is empty":b,x=t.dynamicEmptyMessage,w=t.inputBackgroundColor,C=t.placeholder,E=t.disabledSearch,k=t.delay,S=void 0===k?500:k,B=t.minQueryLength,N=void 0===B?3:B,R=t.handleOnChange,I=t.searchKeys,T=void 0===I?["name"]:I,F=t.alphabetisedHeader,L=void 0===F||F,P=t.initialSearchQuery,D=void 0===P?"":P,H=he(he(he({},De()),Oe()),Ct({background:w})),O=r(D),M=O[0],z=O[1],j=r(!1),G=j[0],K=j[1],U=r(n),V=U[0],Y=U[1];return vt((function(){!R&&!G&&M.length>=N&&Y(null==n?void 0:n.filter((function(e){var t=T.some((function(t){var r;return null===(r=e[t])||void 0===r?void 0:r.toLowerCase().includes(M.toLowerCase())}));return t})))}),[M,n],S),vt((function(){R&&!G&&M.length>=N&&R(M)}),[M],S),o((function(){Y(n)}),[n]),e.createElement(e.Fragment,null,e.createElement(g,{className:"".concat(H.searchBox," ").concat(H.limitWidth50rem)},e.createElement(A,{disabled:E,type:"text",value:M,placeholder:C||"Enter to search",onChange:function(e){G&&K(!1),z(e.target.value)},className:H.searchField,endAdornment:e.createElement(W,{position:"end",className:H.rightSpacer2},e.createElement(ae,{className:H.searchIcon}))})),null!==n&&e.createElement(wt,{array:V,sortFn:a,sortKey:l,buttonClick:c,linkTo:d,ItemTemplate:s,arrayKey:u,loading:f,loadingMessage:v,emptyMessage:x?x(M):y,alphabetisedHeader:L}))},kt=m((function(e){return{inputField:function(t){var r=t.size;return he({borderRadius:We},"small"===r?e.typography.body2:{})},labelStyles:function(t){var r=t.size;return he({},"small"===r?he(he({transform:"translate(14px, 9px) scale(1) !important"},e.typography.body2),{"&.MuiInputLabel-outlined.MuiInputLabel-shrink":{transform:"translate(15px, -9px) scale(0.75) !important"}}):{})}}})),St=function(t){var r=t.size,n=void 0===r?"small":r,a=t.styling,o=t.numberField,i=t.inputProps,l=void 0===i?{}:i,c=t.InputProps,d=void 0===c?{}:c,s=t.accessLevel,m=t.disabled,u=t.fixedDecimalScale,p=ve(t,["size","styling","numberField","inputProps","InputProps","accessLevel","disabled","fixedDecimalScale"]),g=kt({size:n});if(s===Ae)return null;var f=m;s===Pe&&(f=!0);var h=he({},o&&{fixedDecimalScale:!!u});return e.createElement(D,he({className:a||"",disabled:f},p,{inputProps:he(he({},l),h),InputProps:he(he({},d),{className:g.inputField,inputComponent:o?Bt:void 0}),InputLabelProps:{className:g.labelStyles},variant:"outlined",size:n}))},Bt=function(t){var r=t.onChange,n=ve(t,["onChange"]);return e.createElement(ie,he({},n,{onValueChange:function(e){r({target:{name:t.name||"",value:e.value}})},thousandSeparator:!0,decimalScale:2,isNumericString:!0}))},Nt=m((function(e){return{listItem:function(t){var r=t.background,n=t.size;return he(he({overflow:"auto",scrollbarWidth:"thin"},"small"===n?e.typography.body2:{}),{"&:hover":{backgroundColor:"".concat(r," !important")}})},inputStyles:function(t){var r=t.background,n=t.size;return he(he({borderRadius:"".concat(We," !important")},"small"===n?he({paddingTop:"9.5px",paddingBottom:"8.5px"},e.typography.body2):{}),{"&:focus":{backgroundColor:r}})},selectedListItem:function(e){var t=e.background;return{"&:focus":{background:"".concat(t," !important")}}}}})),Rt=function(t){var r=t.selectOptions,n=t.background,a=void 0===n?"#EFEDFF":n,o=t.size,i=void 0===o?"small":o,l=t.styling,c=t.disabled,d=t.accessLevel,s=ve(t,["selectOptions","background","size","styling","disabled","accessLevel"]),m=Nt({background:a,size:i});if(d===Ae)return null;var u=c;return d===Pe&&(u=!0),e.createElement(St,he({className:l||""},s,{disabled:u,size:i,SelectProps:{inputProps:{className:m.inputStyles}},select:!0}),r.map((function(t){var r;return e.createElement(H,{key:t.value,value:t.value,disabled:null!==(r=null==t?void 0:t.disabled)&&void 0!==r&&r,className:m.listItem,classes:{selected:m.selectedListItem}},t.description)})))},It=function(t){var r=t.styling,n=t.format,a=void 0===n?"dd MMM yyyy":n,o=t.minDate,i=void 0===o?new Date("1856-09-25"):o,l=t.accessLevel,c=t.disabled,d=t.slots,s=ve(t,["styling","format","minDate","accessLevel","disabled","slots"]);if(l===Ae)return null;var m=c;return l===Pe&&(m=!0),e.createElement(le,he({className:r||""},s,{disabled:m,format:a,minDate:i,slots:he({textField:St},d||{})}))},Tt=function(t){var r=t.styling,n=t.format,a=void 0===n?"dd/MM/yyyy":n,o=t.minDate,i=void 0===o?new Date("1856-09-25"):o,l=t.accessLevel,c=t.disabled,d=t.slots,s=ve(t,["styling","format","minDate","accessLevel","disabled","slots"]);if(l===Ae)return null;var m=c;return l===Pe&&(m=!0),e.createElement(le,he({className:r||""},s,{disabled:m,format:a,minDate:i,slots:he({textField:St},d||{})}))},Ft=m((function(e){return{confirmWrapper:{display:"inline-block"},confirmContainer:{display:"flex",alignItems:"center"},whiteText:{color:e.palette.common.white}}})),Lt=function(t){var n=t.children,a=t.onClick,i=t.styling,l=t.disabled,c=void 0!==l&&l,d=t.variant,s=void 0===d?"outlined":d,m=t.color,u=void 0===m?"primary":m,f=t.accessLevel,h=void 0===f?"":f,v=t.confirmButtonLabel,b=void 0===v?"Are you sure?":v,y=ve(t,["children","onClick","styling","disabled","variant","color","accessLevel","confirmButtonLabel"]),x=he(he({},De()),Ft()),w=r(!1),C=w[0],E=w[1],k=r(!1),S=k[0],B=k[1];return bt((function(){return E(!1)}),!C||S?null:4500),o((function(){B(y.loading),E(y.loading)}),[y.loading]),[Ae,Pe].includes(h)?null:C?e.createElement(g,{className:x.confirmWrapper},e.createElement(g,{className:x.confirmContainer},e.createElement(p,{className:x.rightSpacer1,variant:"body1"},b),e.createElement(ze,he({},y,{type:"button",onClick:function(e){B(!0),a(e)},variant:"contained",styling:x.whiteText,disabled:c,color:u}),"Confirm",y.loading?"ing":""))):e.createElement(ze,{type:"button",variant:s,disabled:c,styling:i,color:u,onClick:function(){return E(!0)}},n)},Pt=function(e,t){var r=t?(+e).toFixed(2).length:e.toString().length;return r?"".concat(r+1+Math.floor(r/3)/3,"ch"):"6ch"},At=m((function(e){return{inputBase:function(e){return{height:"unset",padding:0,textAlign:e.textAlign||"center"}},input:function(e){return{textAlign:e.textAlign||"center",marginRight:"0.4rem",marginLeft:"0.4rem"}},startAdornment:{color:e.palette.text.secondary},modifiedUnderline:{"&:not(.Mui-disabled):before":{borderBottom:"none",transition:"none"},"&:hover:not(.Mui-disabled):before":{borderBottom:"1px solid ".concat(e.palette.grey[500]," !important")}},body2Text:he({},e.typography.body2),dateFieldWidth:{width:"8ch"},fullDateWidth:{width:"11ch"},justifyStart:{justifyContent:"flex-start"},justifyCenter:{justifyContent:"center"},justifyEnd:{justifyContent:"flex-end"},totalContainer:{display:"flex",alignItems:"center",cursor:"default"},selectFocusBackground:{"&:focus":{backgroundColor:"unset"}}}})),Wt=function(t){var r=t.error,n=t.disabled,a=t.value,o=t.onBlur,i=t.onChange,l=t.prefix,c=t.suffix,d=t.numberField,s=void 0!==d&&d,m=t.textAlign,u=t.fixedDecimalScale,g=t.inputStyling,f=void 0===g?"":g,h=t.wrapperStyling,v=void 0===h?"":h,b=t.widthOverride,y=void 0===b?void 0:b,x=t.name,w=void 0===x?void 0:x,C=At({textAlign:m}),E=he({},s&&{fixedDecimalScale:!!u});return"string"==typeof a||"number"==typeof a?e.createElement(D,{variant:"standard",name:w,className:v,error:!!r,inputProps:he({className:"".concat(C.inputBase," ").concat(f),style:{width:y||Pt(a,!!u)}},E),value:a,onChange:i,onBlur:o,InputProps:{startAdornment:l?e.createElement(W,{position:"end",className:C.startAdornment},l):null,endAdornment:c?e.createElement(W,{position:"start",className:C.startAdornment},c):null,inputComponent:s?Bt:void 0,className:"".concat(C.body2Text," ").concat(C.modifiedUnderline),classes:{input:C.input}},helperText:r||void 0,disabled:n}):e.createElement(p,{variant:"body2"},"Incorrect value type")},Dt=function(t){return e.createElement(Wt,he({},he(he({},t),{numberField:!0})))},Ht=function(t){return e.createElement(Wt,he({},he(he({},t),{numberField:!0,fixedDecimalScale:!0})))},Ot=Y(V({root:{padding:"3px"}}))(O),Mt=function(t){var r=t.disabled,n=t.fullDate,a=void 0!==n&&n,o=t.value,i=t.error,l=t.onChange;t.onBlur;var c=t.textAlign,d=At({textAlign:c});return e.createElement(ge,{disabled:r,views:a?void 0:["year","month"],value:o,format:a?"dd MMM yyyy":"MMM yyyy",onChange:l,slotProps:{textField:{helperText:i||void 0,error:!!i,InputProps:{className:"".concat(d.body2Text," ").concat(d.modifiedUnderline)},inputProps:{className:"".concat(d.inputBase," ").concat(a?d.fullDateWidth:d.dateFieldWidth),classes:{input:d.input}},variant:"standard"}}})},zt=function(t){return e.createElement(Mt,he({fullDate:!0},t))},jt=function(t){var r=t.value,n=t.disabled,a=t.onChange;return e.createElement(O,{disabled:n,checked:r,onChange:a,color:"primary",size:"small"})},Gt=function(t){return e.createElement(jt,he({},t))},Kt=function(t){var r=t.text,n=t.numberField,a=void 0!==n&&n,o=t.prefix,i=void 0===o?null:o,l=t.suffix,c=void 0===l?null:l,d=t.textAlign,s=t.fixedDecimalScale,m=t.styling,u=void 0===m?"":m,p=t.inputStyling,f=void 0===p?"":p,h=t.widthOverride,v=void 0===h?void 0:h,b=At({});return e.createElement(g,{className:"".concat(b.totalContainer," ").concat(b.body2Text," ").concat("left"===d?b.justifyStart:"right"===d?b.justifyEnd:b.justifyCenter," ").concat(u),style:{width:v}},i&&i,e.createElement(g,{className:b.body2Text,style:{width:v}},a?e.createElement(ie,{className:f,value:r,displayType:"text",thousandSeparator:!0,isNumericString:!0,decimalScale:2,fixedDecimalScale:s}):r),c&&c)},Ut=function(t){var r=t.error,n=t.value,a=t.onBlur,o=t.onChange,i=t.selectOptions,l=t.disabled,c=At({});return e.createElement(M,{variant:"standard",margin:"none",error:!!r},e.createElement(z,{variant:"standard",className:"".concat(c.body2Text," ").concat(c.modifiedUnderline),inputProps:{className:c.selectFocusBackground},value:n,onChange:o,onBlur:a,disabled:l},Object.entries(i).map((function(t){var r=t[0],n=t[1];return e.createElement(H,{className:c.body2Text,key:r,value:r},n)}))),r&&e.createElement(j,null,r))},Vt=function(t){var r=t.error,n=t.value,a=t.onBlur,o=t.onChange,i=t.selectOptions,l=t.disabled,c=t.renderValue,d=At({});return e.createElement(M,{variant:"standard",margin:"none",error:!!r},e.createElement(z,{variant:"standard",className:"".concat(d.body2Text," ").concat(d.modifiedUnderline),inputProps:{className:d.selectFocusBackground},value:n,onChange:o,onBlur:a,disabled:l,renderValue:c,multiple:!0},Object.entries(i).map((function(t){var r=t[0],n=t[1];return e.createElement(H,{className:d.body2Text,key:r,value:r},n)}))),r&&e.createElement(j,null,r))},Yt=m((function(e){return{newRowHighlight:{backgroundColor:"#73c4ca30"},editedCellHighlight:{backgroundColor:"#5840f52e !important",backgroundClip:"padding-box"},editedBorder:{border:"3px solid #5840f52e",borderWidth:"2px 4px"},errorBorder:{border:"3px solid ".concat(e.palette.error.light),borderWidth:"2px 4px"},emptyLoadingPadding:{paddingTop:"0.75rem",paddingBottom:"0.75rem"},centeredText:{textAlign:"center"},disabled:{backgroundColor:e.palette.action.hover},pagination:{marginTop:"1rem",marginBottom:"1rem"},virtualisationContainer:{maxHeight:"500px",overflow:"auto"},cellPadding:{padding:".5rem .75rem"},shadedHeader:{"&:nth-of-type(even).shadedHeader":{backgroundColor:"#eeeeee"}},shadedBodyCell:{"&:nth-of-type(even).shadedBodyCell":{backgroundColor:"rgba(0, 0, 0, 0.07)",backgroundClip:"padding-box"}},shadedHeaderGroupParent:{"&:nth-of-type(even).shadedHeaderGroupParent":{backgroundColor:"#eeeeee"}},shadedHeaderGroup2Children:{"&:nth-of-type(4n-2).shadedHeaderGroup2Children":{backgroundColor:"#eeeeee"},"&:nth-of-type(4n-1).shadedHeaderGroup2Children":{backgroundColor:"#eeeeee"}},shadedBody2CellsInsideGroup:{"&:nth-of-type(4n-2).shadedBody2CellsInsideGroup":{backgroundColor:"rgba(0, 0, 0, 0.07)",backgroundClip:"padding-box"},"&:nth-of-type(4n-1).shadedBody2CellsInsideGroup":{backgroundColor:"rgba(0, 0, 0, 0.07)",backgroundClip:"padding-box"}},offsetStickyPosition:{top:0,left:"-3px",zIndex:2,position:"sticky"},stickyHeaderZIndex:{zIndex:3},headerCellColour:{backgroundColor:e.palette.grey[50]},rowCellColour:{backgroundColor:e.palette.common.white,backgroundClip:"padding-box"},rowHoverForStickyCell:{"&:hover .stickyRowCell":{backgroundColor:"rgb(245,245,245)"}},headerBorders:{"& :not(tr:last-child th)":{border:"none"}}}})),Jt=function(t){var n=t.value,a=void 0===n?"":n,i=t.row,l=i.index,c=i.values,d=i.original,s=t.column.id,m=t.syncCellWithState,u=t.setRows,p=t.fieldConfig,g=t.disabled,f=p[s],h=f.validationRule,v=f.dependentValidationRule,b=f.isCheckbox,y=f.isDateField,x=f.customRenderFn,w=f.prefix,C=f.suffix,E=f.textAlign,k=f.onBlur,S=f.onChangeValueModifier,B=r(!1),N=B[0],R=B[1],I=r(a),T=I[0],F=I[1],L=b,P=function(e){var t=!1;if(h)try{h.validateSync(e),N&&R(!1)}catch(e){t=!0,!N&&R(e.message)}if(v)try{v(c).validateSync(e),N&&R(!1)}catch(e){t=!0,!N&&R(e.message)}return t},A=function(e,t){return be(void 0,void 0,void 0,(function(){return ye(this,(function(r){switch(r.label){case 0:return L?m(l,s,e,!1):y?m(l,s,e,!!t):m(l,s,T,!!N),!k||!u||N||ct(c[s],T,y)?[3,2]:[4,k({rowIndex:l,value:T,setRows:u,values:d})];case 1:r.sent(),r.label=2;case 2:return[2]}}))}))};o((function(){F(a);var e=P(a);N!==e&&m(l,s,a,e,!0)}),[a]),o((function(){d.errors&&!!d.errors[s]!=!!N&&P(a)}),[d.errors]);var W,D={value:T,values:c,disabled:g||d.disabledRow,error:N,onChange:function(e){var t;if(y){t=e;var r=S?S(t):t;F(r);var n=P(r);A(r,n)}else{t=e;var a=L?t.target.checked:t.target.value;L?(F(a),A(a)):(F(a),P(a))}},onBlur:A,prefix:w,suffix:C,textAlign:E,originalValues:d};return x?x(D):(W=D,e.createElement(Wt,he({},he({},W))))},qt=l((function(t,r){var n=t.row,a=t.classes,o=t.disabled,i=t.includeRowSelect,l=ve(t,["row","classes","disabled","includeRowSelect"]);return e.createElement(h,he({},l,{ref:r,hover:!0,className:"".concat("NEW"===n.original.rowStatus?a.newRowHighlight:""," ").concat(n.original.rowStatus===Se?a.editedBorder:"","\n").concat(Object.values(n.original.errors||{}).includes(!0)?a.errorBorder:""," ").concat(n.original.disabledRow||o?a.disabled:"","\n ").concat(a.rowHoverForStickyCell)}),n.cells.map((function(t,r){return e.createElement(w,he({},t.getCellProps(),{align:t.column.textAlign||"center",className:"".concat(t.row.original.rowStatus===Se&&t.row.original.edited[t.column.id]?a.editedCellHighlight:""," ").concat(a.cellPadding,"\n ").concat(t.column.shadedHeaderGroup?"".concat(a.shadedBody2CellsInsideGroup," shadedBody2CellsInsideGroup"):"","\n ").concat(t.column.shadedHeader?"".concat(a.shadedBodyCell," shadedBodyCell"):"","\n ").concat(t.column.stickyCell?"".concat(a.offsetStickyPosition," ").concat(a.rowCellColour," stickyRowCell"):"","\n "),padding:i&&0===r?"checkbox":"normal"}),t.render("Cell"))})))})),Xt=[],Zt=t((function(t){var r=t.tableRows,n=t.tableHeaders,i=t.syncCellWithState,l=t.setRows,c=void 0===l?void 0:l,d=t.skipPageReset,s=void 0!==d&&d,m=t.fieldConfig,u=t.disabled,f=void 0!==u&&u,h=t.setSelectedRows,v=t.includeRowSelect,b=void 0===v||v,y=t.filterData,w=t.filterTypes,C=t.emptyTableText,E=void 0===C?"Table is empty":C,k=t.paginate,S=void 0!==k&&k,B=t.defaultPageSize,N=void 0===B?50:B,R=t.virtContainerStyling,I=t.overscan,T=t.rowHeight,F=t.includeGlobalSearch,L=t.disableHeaderSelect,P=he(he({},Yt()),Oe()),A=e.useRef(null),W=e.useMemo((function(){return{Cell:Jt}}),[]),D=ce({columns:n,data:r||Xt,defaultColumn:W,autoResetPage:!!S&&!s,filterTypes:w,initialState:{pageSize:S?N:void 0},syncCellWithState:i,setRows:c,fieldConfig:m,disabled:f,autoResetGlobalFilter:!1},de,se,me,ue,(function(t){b&&t.visibleColumns.push((function(t){return xe([{id:"selection",Header:function(t){var r=t.getToggleAllRowsSelectedProps,n=t.getToggleAllPageRowsSelectedProps;return L?"Select":e.createElement(Ot,he({},S?n():r(),{disabled:f,size:"small"}))},Cell:function(t){var r=t.row;return e.createElement(Ot,he({},r.getToggleRowSelectedProps(),{disabled:f||r.original.disableSelection,size:"small"}))}}],t,!0)}))})),H=D.getTableProps,O=D.getTableBodyProps,M=D.headerGroups,z=D.rows,j=D.page,G=D.prepareRow,K=D.state,U=K.selectedRowIds,V=K.pageIndex,Y=D.state,J=D.setFilter,q=D.pageCount,X=D.gotoPage,Z=D.preGlobalFilteredRows,Q=D.setGlobalFilter,$=D.isAllRowsSelected,_=D.selectedFlatRows,ee=fe({size:(S?j:z).length,parentRef:A,overscan:I||5,estimateSize:a((function(){return T||54}),[T])}),te=S?j:z,re=ee.virtualItems,ne=re.length>0?re[0].start:0,ae=re.length>0?ee.totalSize-re[re.length-1].end:0,oe=a((function(e,t){X(t-1)}),[]);return o((function(){y&&J(y.filterRow,y.filterValues)}),[y]),o((function(){h&&h(Object.keys(U).map((function(e){return+e})))}),[U]),e.createElement(e.Fragment,null,F?e.createElement($t,{preGlobalFilteredRows:Z,globalFilter:Y.globalFilter,setGlobalFilter:Q}):null,e.createElement("div",{ref:A,className:R||P.virtualisationContainer},e.createElement(_t,he({},{disabled:f,includeRowSelect:b,getTableProps:H,headerGroups:M,getTableBodyProps:O,rowsToRender:te,prepareRow:G,paddingTop:ne,paddingBottom:ae,virtualRows:re,isAllRowsSelected:$,selectedFlatRows:_}))),null===r?e.createElement(g,{className:P.emptyLoadingPadding},e.createElement(Ke,null)):null,r&&!r.length?e.createElement(g,{className:"".concat(P.emptyLoadingPadding," ").concat(P.centeredText)},e.createElement(p,{variant:"body2"},E)):null,S&&(null==r?void 0:r.length)?e.createElement(x,{className:"".concat(P.flexCenter," ").concat(P.pagination),count:q,page:V+1,onChange:oe,shape:"rounded",showFirstButton:!0,showLastButton:!0}):null)})),Qt=m((function(e){return{container:{display:"flex",justifyContent:"center",alignItems:"center",border:"1px solid ".concat(e.palette.grey[600]),borderRadius:"8px",width:"100%",maxWidth:"20rem",marginInline:"auto",color:e.palette.grey[600],"&:hover":{borderColor:e.palette.grey[800],color:e.palette.grey[800]},"&:focus-within":{borderColor:e.palette.grey[800],color:e.palette.grey[800]}},input:he({width:"100%",maxWidth:"18rem",color:"inherit"},e.typography.body2)}})),$t=t((function(t){var n=t.preGlobalFilteredRows,a=t.globalFilter,o=t.setGlobalFilter,i=r(a),l=i[0],c=i[1],d=he(he({},De()),Qt()),s=pe((function(e){o(e||void 0)}),200),m=n.length;return e.createElement("div",{className:"".concat(d.container," ").concat(d.contentBreak)},e.createElement(ae,{className:"".concat(d.rightSpacer1," ").concat(d.leftSpacer1)}),e.createElement(A,{className:"".concat(d.input),value:l||"",onChange:function(e){c(e.target.value),s(e.target.value)},placeholder:"Search ".concat(m," records..."),inputProps:{"aria-label":"search"}}))})),_t=t((function(t){var r=t.disabled,n=t.includeRowSelect,a=t.getTableProps,o=t.headerGroups,i=t.getTableBodyProps,l=t.rowsToRender,c=t.prepareRow,d=t.paddingTop,s=t.paddingBottom,m=t.virtualRows,u=t.isAllRowsSelected,p=t.selectedFlatRows;return e.createElement(b,he({},a(),{style:{borderCollapse:"collapse"}}),e.createElement(er,{headerGroups:o,includeRowSelect:n,isAllRowsSelected:u}),e.createElement(y,he({},i()),d>0&&e.createElement("tr",null,e.createElement("td",{style:{height:"".concat(d,"px")}})),e.createElement(tr,he({},{disabled:r,includeRowSelect:n,rowsToRender:l,prepareRow:c,virtualRows:m,selectedFlatRows:p})),s>0&&e.createElement("tr",null,e.createElement("td",{style:{height:"".concat(s,"px")}}))))})),er=t((function(t){var r=t.headerGroups,n=t.includeRowSelect;t.isAllRowsSelected;var a=Yt();return e.createElement(v,{className:"".concat(a.offsetStickyPosition," ").concat(a.stickyHeaderZIndex," ").concat(a.headerBorders)},r.map((function(t){return e.createElement(h,he({},t.getHeaderGroupProps()),t.headers.map((function(t,r){var o;return e.createElement(w,he({},t.getHeaderProps(),{align:t.textAlign||"center",padding:n&&0===r?"checkbox":"normal",className:"".concat(a.headerCellColour,"\n ").concat(t.shadedHeaderGroup?t.columns?"".concat(a.shadedHeaderGroupParent," shadedHeaderGroupParent"):t.parent?"".concat(a.shadedHeaderGroup2Children," shadedHeaderGroup2Children"):"":""," ").concat(t.shadedHeader?"".concat(a.shadedHeader," shadedHeader"):"","\n ").concat(t.stickyCell||(null===(o=t.placeholderOf)||void 0===o?void 0:o.stickyCell)?"".concat(a.offsetStickyPosition," ").concat(a.stickyHeaderZIndex):"")}),t.render("Header"))})))})))})),tr=t((function(t){var r=t.rowsToRender,n=t.virtualRows,a=t.prepareRow,o=ve(t,["rowsToRender","virtualRows","prepareRow"]),i=he(he({},Yt()),Oe());return e.createElement(e.Fragment,null,n.map((function(t){var n=r[t.index];return a(n),e.createElement(c,{key:n.original.rowKey||n.getRowProps().key},n.original.disabledRow?e.createElement(G,{title:n.original.tooltipText||"This row is disabled",arrow:!0},e.createElement(qt,he({},he(he({},o),{row:n,classes:i})))):e.createElement(qt,he({},he(he({},o),{row:n,classes:i}))))})))})),rr=m((function(e){return{alertStyling:{borderRadius:We},closeButton:{color:e.palette.text.secondary,marginRight:e.spacing(2)},showCursor:{cursor:"pointer"}}})),nr=function(t){var r=t.alertActionHandler,n=t.formStatus,a=t.actionButton,o=t.alertMessage,i=t.addBreak,l=void 0===i||i,c=t.styling,d=he(he({},De()),rr());return e.createElement(I,{in:[Ne,Re,Fe].includes(n)},e.createElement(K,{onClick:r,className:"".concat(d.alertStyling," ").concat(l?d.sectionBreak:""," ").concat(c||""," ").concat(r?d.showCursor:""),severity:n===Re?Re:n===Ne?Ne:Fe,action:a?e.createElement(S,{className:d.closeButton,"aria-label":"close",color:"inherit",size:"small",onClick:function(e){e.stopPropagation(),a.handler()}},a.text):null},o))},ar=m((function(e){return{greyBox:{backgroundColor:e.palette.grey[200],display:"flex",justifyContent:"center",alignItems:"center",padding:"1.5rem",borderRadius:We,position:"relative",height:"13.25rem"},widthLimiter:{width:"100%",maxWidth:"28rem",marginLeft:"auto",marginRight:"auto"},hiddenInput:{display:"none"},buttonColor:{backgroundColor:e.palette.primary.main},iconStyling:{color:e.palette.common.white,fontSize:"3rem"},sectionBreak:{marginBottom:e.spacing(3)},dropBox:{height:"100%",width:"100%",display:"flex",justifyContent:"center",alignItems:"center"},dropArrowStyling:{color:e.palette.text.secondary,fontSize:"3rem"},topLeftArrow:{position:"absolute",top:0,left:0,transform:"rotate(45deg)"},topRightArrow:{position:"absolute",top:0,right:0,transform:"rotate(135deg)"},bottomLeftArrow:{position:"absolute",bottom:0,left:0,transform:"rotate(-45deg)"},bottomRightArrow:{position:"absolute",bottom:0,right:0,transform:"rotate(225deg)"},hiddenDisplay:{display:"none"},loadingCircle:{marginLeft:e.spacing(1)},roundedAvatarButton:{borderRadius:"100%"},roundedAvatar:{width:"16vmax",height:"16vmax",maxWidth:"13rem",maxHeight:"13rem"},organisationImage:{maxWidth:"8rem",minWidth:"5rem",maxHeight:"8rem"}}})),or="dragEnter",ir="input",lr="dragDrop",cr=function(t){var n=t.id,a=void 0===n?"image-upload":n,i=t.url,l=t.roundedAvatar,c=void 0!==l&&l,d=t.handleSaveImage,s=t.alt,m=t.accessLevel,u=he(he({},ar()),De()),h=r(!!i),v=h[0],b=h[1],y=r(Te),x=y[0],w=y[1],C=r(null),E=C[0],k=C[1];if(o((function(){i&&b(!0)}),[i]),m===Ae)return null;var B=!1;m===Pe&&(B=!0);var N,R=function(e,t){return be(void 0,void 0,void 0,(function(){var r,n;return ye(this,(function(a){switch(a.label){case 0:return B?[2]:(k(null),e!==ir?[3,4]:(r=t.target).files&&r.files[0]?[4,I(r.files[0])]:[3,2]);case 1:return a.sent(),[3,3];case 2:w(Re),b(!!i),a.label=3;case 3:return[3,7];case 4:return e!==lr?[3,7]:(n=t.dataTransfer).files&&n.files[0]?[4,I(n.files[0])]:[3,6];case 5:return a.sent(),[3,7];case 6:w(Re),b(!!i),a.label=7;case 7:return[2]}}))}))},I=function(e){return be(void 0,void 0,void 0,(function(){var t,r,n;return ye(this,(function(a){switch(a.label){case 0:return w(Ie),e.size>=524288?(k("Image size should be less than 0.5MB"),w(Re),b(!!i),[2]):(t=e.name.split(".")[1].toLowerCase(),["png","jpg","jpeg"].includes(t)?[4,e.arrayBuffer()]:(k("Please provide an image in png, jpg or jpeg format"),w(Re),b(!!i),[2]));case 1:r=a.sent(),a.label=2;case 2:return a.trys.push([2,4,,5]),[4,d(t,r,e)];case 3:return a.sent(),w(Ne),b(!0),[3,5];case 4:return n=a.sent(),console.log(n),w(Re),b(!!i),[3,5];case 5:return[2]}}))}))};switch(x){case or:N=e.createElement(g,{className:u.dropBox,style:{pointerEvents:"none"}},e.createElement(ee,{className:"".concat(u.dropArrowStyling," ").concat(u.topLeftArrow)}),e.createElement(ee,{className:"".concat(u.dropArrowStyling," ").concat(u.topRightArrow)}),e.createElement(p,{variant:"h5",color:"textSecondary"},"Drop Here"),e.createElement(ee,{className:"".concat(u.dropArrowStyling," ").concat(u.bottomLeftArrow)}),e.createElement(ee,{className:"".concat(u.dropArrowStyling," ").concat(u.bottomRightArrow)}));break;case Ie:N=e.createElement(g,{className:u.dropBox},e.createElement(p,{color:"textSecondary"},"Loading..."),e.createElement(f,{className:u.loadingCircle,size:25}));break;default:N=e.createElement("label",{htmlFor:a},e.createElement(F,{className:"".concat(u.buttonColor," ").concat(u.sectionBreak),"aria-label":"upload picture",component:"span",size:"large"},e.createElement(_,{className:u.iconStyling})),e.createElement(p,{variant:"body2",color:"textSecondary"},"Drag and drop or browse to upload your image or logo."))}return e.createElement(g,{className:u.labelBreak,onDragEnter:function(e){B||(e.preventDefault(),e.stopPropagation(),b(!1))},onDragOver:function(e){B||(e.preventDefault(),e.stopPropagation(),b(!1))}},v&&e.createElement(g,{className:u.labelBreak},e.createElement("label",{htmlFor:a},e.createElement(S,{className:"".concat(c?u.roundedAvatarButton:""),"aria-label":"upload picture",component:"span"},c?e.createElement(U,{className:u.roundedAvatar,src:i,alt:s||"Profile Avatar"}):e.createElement("img",{className:u.organisationImage,src:i,alt:s||"Company Logo"})))),e.createElement(g,{className:"".concat(u.greyBox," ").concat(u.widthLimiter," ").concat(u.sectionBreak," ").concat(v?u.hiddenDisplay:""),onDragEnter:function(e){B||(e.preventDefault(),e.stopPropagation(),w(or))},onDragLeave:function(e){B||(e.preventDefault(),e.stopPropagation(),w(Te),b(!!i))},onDragOver:function(e){B||(e.preventDefault(),e.stopPropagation(),w(or))},onDrop:function(e){B||(e.preventDefault(),e.stopPropagation(),R(lr,e))}},e.createElement("input",{id:a,className:u.hiddenInput,type:"file",accept:".png, .jpg, .jpeg",disabled:B,onChange:function(e){return R(ir,e)}}),N),e.createElement(g,{className:u.widthLimiter},e.createElement(nr,{formStatus:x,alertMessage:E||(x===Ne?"Uploaded successfully!":"Something went wrong.")})))},dr=m((function(e){var t,r;return{container:(t={minWidth:"4.5rem",height:"100%",background:"linear-gradient(180deg, #B3D6EC 0%, #B3D6EC 40%, #E97FAB 100%)",display:"flex",flexDirection:"column",overflowY:"auto",borderTopRightRadius:"1rem",borderBottomRightRadius:"1rem",border:"solid 2px rgb(188, 172, 242)",borderLeft:"none",boxSize:"border-box"},t[e.breakpoints.down("sm")]={flexDirection:"row",justifyContent:"center",background:"linear-gradient(90deg, #B3D6EC 0%, #B3D6EC 40%, #E97FAB 100%)",borderRadius:0,borderTopLeftRadius:"1rem",borderTopRightRadius:"1rem",width:"100dvw",margin:"auto",border:"solid 2px rgb(188, 172, 242)",borderBottom:"none",overflowY:"hidden",overflowX:"scroll"},t),item:(r={position:"relative",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",textAlign:"center",color:"black",textDecoration:"none",fontSize:"0.725rem",padding:"0.75rem 0.5rem",gap:"0.25rem",backgroundColor:"transparent",transition:"background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)"},"&::after":{content:'" "',position:"absolute",top:"15%",bottom:"15%",right:0,width:3,zIndex:1,transition:"background-color 80ms cubic-bezier(0.4, 0, 0.2, 1) 0ms"}},r[e.breakpoints.down("sm")]={padding:"0.5rem 1.0rem","&::after":{top:0,left:"15%",right:"15%",bottom:"auto",height:4,width:"auto"}},r),itemActive:{"&::after":{backgroundColor:"rgb(188, 172, 242)"}},separateItem:{marginTop:"auto"}}})),sr=function(t){var r=t.tabs,n=dr(),a=q();return e.createElement("div",{className:n.container},r.map((function(t){var r=t.Icon,o=t.field,i=t.path,l=t.separate,c=void 0!==l&&l;return e.createElement(J,{key:i,to:i,className:[n.item,c?n.separateItem:null,a.pathname===i?n.itemActive:null].filter(Boolean).join(" ")},e.createElement(e.Fragment,null,e.createElement(r,null),o))})))},mr=m((function(e){var t;return{tablessGrid:{},grid:function(t){var r,n=t.hideTabs,a=t.leaveHeightForMenu;return n?{}:((r={display:"grid",gridTemplateRows:"auto 1fr",gridTemplateColumns:"auto 1fr",height:a?"calc(100dvh - 4rem)":"100dvh",boxSize:"border-box"})[e.breakpoints.down("sm")]={gridTemplateColumns:"1fr",gridTemplateRows:"1fr auto"},r)},tabs:(t={height:function(e){return e.leaveHeightForMenu?"calc(100dvh - 4rem)":"100dvh"}},t[e.breakpoints.down("sm")]={order:1,height:"max-content !important"},t),content:{padding:"1rem",boxSizing:"border-box",height:"100%",overflowY:"scroll"}}})),ur=function(t){var r=t.tabs,n=t.hideTabs,a=void 0!==n&&n,o=t.leaveHeightForMenu,i=void 0===o||o,l=t.children,c=mr({hideTabs:a,leaveHeightForMenu:i});return e.createElement("div",{className:"".concat(c.grid)},e.createElement("div",{className:c.tabs},e.createElement(sr,{tabs:r})),e.createElement("div",{className:c.content},e.createElement(L,{disableGutters:!0},e.createElement(e.Fragment,null,l))))},pr=function(t){var r=t.styling,n=t.format,a=void 0===n?"dd MMM yyyy":n,o=t.minDate,i=void 0===o?new Date("1856-09-25"):o,l=t.accessLevel,c=t.disabled,d=t.slots,s=ve(t,["styling","format","minDate","accessLevel","disabled","slots"]);if(l===Ae)return null;var m=c;return l===Pe&&(m=!0),e.createElement(ge,he({className:r||"",closeOnSelect:!0},s,{disabled:m,format:a,minDate:i,slots:he({textField:St},d||{})}))};export{nr as Alert,wt as AlphabeticalList,et as Breadcrumbs,ze as Button,Lt as ButtonWithConfirm,Ge as ContentBox,je as ContentLabel,It as DatePicker,Zt as EditableTable,rt as EntityList,nt as ErrorIndicator,Le as FORM_DELETING,Te as FORM_ENABLED,Re as FORM_ERROR,Ie as FORM_LOADING,Ne as FORM_SUCCESS,Fe as FORM_WARNING,cr as ImageDisplayAndUpload,Tt as KeyboardDatePicker,gt as LeftNavigation,Ke as LoadingSpinner,ht as MainLayout,pr as MobileDatePicker,ur as NavbarLayout,Kt as NonEditableField,Bt as NumberFormatField,Et as SearchBar,Rt as Select,$e as StaticTable,Mt as TableDatePicker,Vt as TableMultipleSelect,Ut as TableSelect,Wt as TableTextField,St as TextField,ct as didCellValueChange,Gt as tableCheckbox,zt as tableDateField,Dt as tableNumericStringField,Ht as tableNumericStringFixedDecimalField,vt as useDebounceEffect,bt as useInterval,yt as useWhyDidYouUpdate};
1
+ import e,{memo as t,useState as r,useMemo as n,useCallback as a,useEffect as o,useRef as i,forwardRef as l,Fragment as c}from"react";import d from"@mui/material/Button";import s from"@mui/material/CircularProgress";import u from"@mui/styles/makeStyles";import{string as m}from"yup";import{Typography as p,Box as g,CircularProgress as f,TableRow as h,TableHead as v,Table as b,TableBody as y,Pagination as x,TableCell as w,Link as E,ButtonBase as C,Grid as k,Button as S,ListItem as B,ListItemIcon as N,ListItemText as R,Collapse as I,List as T,IconButton as F,Container as L,Divider as P,InputBase as A,InputAdornment as W,TextField as D,MenuItem as O,Checkbox as H,FormControl as M,Select as z,FormHelperText as j,Tooltip as G,Alert as K,Avatar as U}from"@mui/material";import V from"@mui/styles/createStyles";import Y from"@mui/styles/withStyles";import{Link as J,useLocation as q,useHistory as X}from"react-router-dom";import Z from"@mui/icons-material/Error";import{ExpandLess as Q,ExpandMore as $,CloudUpload as _,Forward as ee,CheckCircleOutline as te}from"@mui/icons-material";import{isValid as re}from"date-fns";import ne from"@mui/icons-material/Close";import ae from"@mui/icons-material/AddBoxOutlined";import oe from"@mui/icons-material/Search";import{isEqual as ie}from"lodash";import le from"react-number-format";import{DatePicker as ce}from"@mui/x-date-pickers/DatePicker";import{useTable as de,useFilters as se,useGlobalFilter as ue,usePagination as me,useRowSelect as pe,useAsyncDebounce as ge}from"react-table";import{MobileDatePicker as fe}from"@mui/x-date-pickers/MobileDatePicker";import{useVirtual as he}from"react-virtual";var ve=function(){return ve=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},ve.apply(this,arguments)};function be(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}function ye(e,t,r,n){return new(r||(r=Promise))((function(a,o){function i(e){try{c(n.next(e))}catch(e){o(e)}}function l(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,l)}c((n=n.apply(e,t||[])).next())}))}function xe(e,t){var r,n,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(l){return function(c){return function(l){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(i=0)),i;)try{if(r=1,n&&(a=2&l[0]?n.return:l[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,l[1])).done)return a;switch(n=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,n=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(a=i.trys,(a=a.length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){i.label=l[1];break}if(6===l[0]&&i.label<a[1]){i.label=a[1],a=l;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(l);break}a[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],n=0}finally{r=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}function we(e,t,r){if(r||2===arguments.length)for(var n,a=0,o=t.length;a<o;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var Ee="0.5rem",Ce="1rem",ke="1.5rem",Se="3rem",Be="EDITED",Ne="Required";m().trim().required(Ne),m().trim().required(Ne).matches(/^\d*\.?\d*$/,"Must be a Number");var Re="success",Ie="error",Te="loading",Fe="enabled",Le="warning",Pe="deleting",Ae="read",We="noAccess",De="14px",Oe=u({labelBreak:{marginBottom:Ee},contentBreak:{marginBottom:Ce},sectionBreak:{marginBottom:ke},doubleSectionBreak:{marginBottom:Se},rightSpacer1:{marginRight:Ee},rightSpacer2:{marginRight:Ce},leftSpacer1:{marginLeft:Ee},leftSpacer2:{marginLeft:Ce},buttonSpacing:{marginLeft:Ee,marginRight:Ee,marginBottom:Ce},leftRightPadding1:{paddingLeft:Ee,paddingRight:Ee},leftRightPadding2:{paddingLeft:Ce,paddingRight:Ce},topBottomPadding1:{paddingTop:Ee,paddingBottom:Ee},topBottomPadding2:{paddingTop:Ce,paddingBottom:Ce}},{classNamePrefix:"spacing",index:2}),He=u((function(e){return{boldText:{fontWeight:700},bolderText:{fontWeight:500},smallText:{fontSize:"0.7rem"},warningColor:{color:e.palette.warning.main},centerText:{textAlign:"center"}}}),{classNamePrefix:"font"}),Me=u({contentBox:{background:"white",borderRadius:De,marginBottom:Ce,padding:Se},limitWidth60rem:{maxWidth:"60rem",marginLeft:"auto",marginRight:"auto"},limitWidth50rem:{maxWidth:"50rem",marginLeft:"auto",marginRight:"auto"},limitWidth45rem:{maxWidth:"45rem",marginLeft:"auto",marginRight:"auto"},limitWidth40rem:{maxWidth:"40rem",marginLeft:"auto",marginRight:"auto"},limitWidth35rem:{maxWidth:"35rem",marginLeft:"auto",marginRight:"auto"},limitWidth30rem:{maxWidth:"30rem",marginLeft:"auto",marginRight:"auto"},limitWidth25rem:{maxWidth:"25rem",marginLeft:"auto",marginRight:"auto"},centeredText:{textAlign:"center"},startAlignedText:{textAlign:"start"},width20:{width:"20%"},width49:{width:"49%"},width50:{width:"50%"},width60:{width:"60%"},width100:{width:"100%"},flexCenter:{display:"flex",alignItems:"center",justifyContent:"center"},centerJustify:{justifyContent:"center"},leftJustify:{justifyContent:"left"},rightJustify:{justifyContent:"right"}},{classNamePrefix:"layout",index:2}),ze=u((function(e){return{submitButton:{borderRadius:ke,padding:"0.4rem 1rem",textTransform:"none"},containedText:{color:"white"},spinnerColour:{color:e.palette.grey[500]}}}));function je(t){var r=t.loading,n=void 0!==r&&r,a=t.children,o=t.errors,i=void 0!==o&&o,l=t.type,c=void 0===l?"submit":l,u=t.onClick,m=t.disabled,p=void 0!==m&&m,g=t.variant,f=void 0===g?"outlined":g,h=t.styling,v=void 0===h?"":h,b=t.color,y=void 0===b?"primary":b,x=t.accessLevel,w=be(t,["loading","children","errors","type","onClick","disabled","variant","styling","color","accessLevel"]),E=ve(ve({},Oe()),ze());if(x&&[We,Ae].includes(x))return null;var C=p;return p||!n&&!i||(C=!0),e.createElement(d,ve({},w,{variant:f,color:y,type:c,className:"".concat(E.submitButton," ").concat("contained"===f&&E.containedText," ").concat(v),disabled:C,onClick:u}),a,n?e.createElement(s,{className:"".concat(E.leftSpacer1," ").concat(E.spinnerColour),size:"1.1rem",thickness:6}):"")}var Ge=function(t){var r=t.children,n=t.styling,a=void 0===n?null:n,o=He();return e.createElement(p,{variant:"h6",className:"".concat(o.bolderText," ").concat(a||"")},r)},Ke=function(t){var r=t.limitWidth,n=void 0!==r&&r,a=t.children,o=t.styling,i=t.id,l=ve(ve({},Oe()),Me());return e.createElement(g,{id:i,boxShadow:3,className:"".concat(l.contentBox," ").concat(o||"")},e.createElement(g,{className:"".concat(l.centeredText," ").concat(n?l.limitWidth50rem:"")},a))},Ue=function(t){var r=t.text,n=void 0===r?"Loading data...":r,a=t.styling,o=ve(ve({},Oe()),Me());return e.createElement(g,{className:"".concat(o.flexCenter," ").concat(a||"")},e.createElement(p,{variant:"body2",color:"textSecondary",className:o.rightSpacer1},n),e.createElement(f,{size:"1.5rem"}))},Ve=Y(V({root:{"&:hover td":{backgroundColor:"rgba(0, 0, 0, 0.06)"}}}))(h),Ye=Y(V({root:{"&:nth-of-type(even) td":{backgroundColor:"rgba(0, 0, 0, 0.03)"},"&:hover td":{backgroundColor:"rgba(0, 0, 0, 0.06)"}}}))(h),Je=u((function(e){return{root:{borderBottom:"none",paddingTop:"8px",paddingBottom:"8px","&:first-child":{borderTopLeftRadius:De,borderBottomLeftRadius:De},"&:last-child":{borderTopRightRadius:De,borderBottomRightRadius:De}},head:function(t){var r=t.background,n=t.border,a=t.text;return{backgroundColor:r||"HSLA(204, 58.3%, 81.2%, 0.1)",borderTop:"1px solid ".concat(n||"HSLA(204, 58.3%, 81.2%, 0.3)"),borderBottom:"1px solid ".concat(n||"HSLA(204, 58.3%, 81.2%, 0.3)"),color:a||e.palette.text.primary,fontWeight:500,"&:first-child":{borderLeft:"1px solid ".concat(n||"HSLA(204, 58.3%, 81.2%, 0.3)")},"&:last-child":{borderRight:"1px solid ".concat(n||"HSLA(204, 58.3%, 81.2%, 0.3)")}}}}})),qe=function(t){var r=t.children,n=t.align,a=void 0===n?"centerJustify":n,o=t.headerColours,i=be(t,["children","align","headerColours"]),l=ve(ve({},Me()),Je(ve({},o||{})));return e.createElement(w,ve({},i,{classes:{root:l.root,head:l.head}}),e.createElement("div",{className:"".concat(l.flexCenter," ").concat(l[a])},r))},Xe=function(t){var r=t.rowBorderSeparation,n=void 0!==r&&r,a=t.children,o=be(t,["rowBorderSeparation","children"]);return n?e.createElement(Ve,ve({},o),a):e.createElement(Ye,ve({},o),a)},Ze=function(t){var r=t.colSpan,n=t.children,a=Qe();return e.createElement(Xe,null,e.createElement(qe,{className:a.adjustedCellPadding,colSpan:r},n))},Qe=u({tableStyles:{borderCollapse:"separate",borderBottom:"1px solid rgb(224, 224, 224)"},pointer:{cursor:"pointer"},bottomBorder:{borderBottom:"1px solid rgba(224, 224, 224, 1)"},noShading:{backgroundColor:"transparent !important"},adjustedCellPadding:{paddingTop:"11px",paddingBottom:"11px"}}),$e=t((function(t){var r=t.headers,n=t.headerCellAlignment,a=void 0===n?[]:n,o=t.headerColours;return r?e.createElement(v,null,e.createElement(h,null,r.map((function(t,r){return e.createElement(qe,{align:a[r]||"centerJustify",key:"header-cell-".concat(r),headerColours:o},t)})))):null})),_e=t((function(t){var i=t.rowBorderSeparation,l=void 0!==i&&i,c=t.headers,d=t.rows,s=t.headerCellAlignment,u=void 0===s?[]:s,m=t.rowCellAlignment,p=void 0===m?[]:m,g=t.styling,f=t.headerColours,h=t.paginate,v=void 0!==h&&h,w=t.itemsPerPage,E=void 0===w?30:w,C=ve(ve(ve({},Me()),Oe()),Qe()),k=r(1),S=k[0],B=k[1],N=n((function(){return!!(v&&((null==d?void 0:d.length)||0)>E)}),[E,v,d]),R=r(N?d.slice(0,E):d),I=R[0],T=R[1],F=a((function(e,t){B(t)}),[]);return o((function(){T(N?d.slice(E*(S-1),E*S):d)}),[N,E,S,d]),e.createElement(e.Fragment,null,e.createElement(b,{className:"".concat(C.tableStyles," ").concat(N?C.contentBreak:""," ").concat(g||"")},e.createElement($e,{headers:c,headerCellAlignment:u,headerColours:f}),e.createElement(y,null,I?I.length?I.map((function(t,r){var n=!!t.onClick;return e.createElement(Xe,{rowBorderSeparation:l,className:n?C.pointer:void 0,key:"row-".concat(r),onClick:n?t.onClick:void 0},t.row.map((function(t,n){return e.createElement(qe,{align:p[n]||"centerJustify",className:l&&I.length!==r+1?C.bottomBorder:void 0,key:"row-".concat(r,"-cell-").concat(n)},t)})))})):e.createElement(Ze,{colSpan:(null==c?void 0:c.length)||0},"Table is empty"):e.createElement(Ze,{colSpan:(null==c?void 0:c.length)||0},e.createElement(Ue,null)))),N?e.createElement(x,{className:C.flexCenter,count:Math.ceil(d.length/E),page:S,onChange:F,shape:"rounded",showFirstButton:!0,showLastButton:!0}):null)})),et=u((function(e){return{logoContainer:{width:"3rem",height:"3rem",display:"flex",justifyContent:"center",alignItems:"center"},logo:{width:"100%",height:"100%","& > div":{width:"100%",height:"100%"},"& > svg":{width:"100%",height:"100%"}},logoInBreadcrumb:{width:"2rem",height:"2rem",margin:"0.125rem 0 0.125rem 0.313rem"},logoSpacing:{marginRight:e.spacing(1)},flexItemsCenter:{display:"flex",alignItems:"center"},nonPrimaryBreadcrumbOffset:{marginLeft:"2.5rem"},BreadcrumbsContainer:{height:"2.25rem",marginLeft:"0.875rem",marginRight:"1.5rem"},primaryBreadcrumbItem:function(t){var r=t.primary;return{backgroundColor:(null==r?void 0:r.background)||e.palette.common.white,color:(null==r?void 0:r.color)||e.palette.text.primary,borderRadius:"2rem",zIndex:3,height:"100%",display:"flex",alignItems:"center"}},secondaryBreadcrumbItem:function(t){var r=t.secondary;return{height:"2.25rem",backgroundColor:(null==r?void 0:r.background)||"#D7D4E4",borderRadius:"2rem",zIndex:2,marginLeft:"-2rem",color:(null==r?void 0:r.color)||e.palette.text.primary}},tertiaryBreadcrumbItem:function(t){var r=t.tertiary;return{height:"2.25rem",backgroundColor:(null==r?void 0:r.background)||"#D7D4E4",borderRadius:"2rem",zIndex:1,marginLeft:"-2rem",color:(null==r?void 0:r.color)||e.palette.common.white}},breadCrumbShadow:{boxShadow:e.shadows[2]},breadcrumbRightMargin:{marginRight:"1rem"},breadcrumbTextOverflow:{display:"block",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"12rem"},boldText:{fontWeight:500},activeBreadcrumb:function(t){var r=t.tertiary;return{backgroundColor:(null==r?void 0:r.background)||"#D7D4E4",color:(null==r?void 0:r.color)||e.palette.common.white}},noWrap:{whiteSpace:"nowrap"},fullBorderRadius:{borderRadius:"100%"}}})),tt=function(t){var r=t.logo,n=t.content,a=t.colors,o=et(ve({},a||{})),i=n.first,l=void 0===i?null:i,c=n.second,d=void 0===c?null:c,s=n.third,u=void 0===s?null:s;return e.createElement(g,{className:"".concat(o.BreadcrumbsContainer," ").concat(o.flexItemsCenter)},e.createElement(g,{className:"".concat(l?"".concat(o.primaryBreadcrumbItem," ").concat(o.breadCrumbShadow):""," ").concat(o.flexItemsCenter)},e.createElement(E,{component:J,to:"/",className:o.logoSpacing},e.createElement(g,{className:"".concat(o.logoContainer," \n ").concat(l?o.logoInBreadcrumb:"")},e.createElement(C,{className:"".concat(o.logo," ").concat(o.fullBorderRadius)},r))),l&&e.createElement(p,{color:"textPrimary",className:"".concat(o.boldText," ").concat(o.noWrap," ").concat(o.primaryBreadcrumbItem)},e.createElement(E,{underline:"none",component:J,to:l.link,color:"inherit",className:"".concat(o.breadcrumbRightMargin," ").concat(o.breadcrumbTextOverflow)},l.name))),d&&e.createElement(g,{className:"".concat(o.flexItemsCenter," ").concat(o.secondaryBreadcrumbItem," ").concat(o.breadCrumbShadow," ").concat(u?"":o.activeBreadcrumb)},e.createElement(p,{color:"inherit",className:"".concat(o.boldText," ").concat(o.noWrap)},e.createElement(E,{component:J,underline:"none",to:d.link,color:"inherit",className:"".concat(o.nonPrimaryBreadcrumbOffset," ").concat(o.breadcrumbRightMargin," ").concat(o.breadcrumbTextOverflow)},d.name))),u&&e.createElement(g,{className:"".concat(o.flexItemsCenter," ").concat(o.tertiaryBreadcrumbItem," ").concat(o.breadCrumbShadow)},e.createElement(p,{color:"inherit",className:"".concat(o.boldText," ").concat(o.noWrap)},e.createElement(E,{component:J,underline:"none",to:u.link,color:"inherit",className:"".concat(o.nonPrimaryBreadcrumbOffset," ").concat(o.breadcrumbRightMargin," ").concat(o.breadcrumbTextOverflow)},u.name))))},rt=u((function(e){return{container:{marginRight:e.spacing(-1.5),marginLeft:e.spacing(-1.5)},svgContainer:{marginLeft:"auto",marginRight:"auto"},button:{display:"block",textDecoration:"none",borderRadius:De,height:"100%",width:"100%",textAlign:"center",color:e.palette.text.primary},orgLabel:{padding:e.spacing(1),paddingTop:0}}})),nt=function(t){var r=t.entities,n=t.icon,a=t.loadingMessage,o=void 0===a?"Loading list...":a,i=t.emptyMessage,l=void 0===i?"List is empty":i,c=t.onClick,d=ve(ve(ve({},rt()),Oe()),He());return e.createElement(g,{className:d.container},r?r.length?e.createElement(k,{container:!0,spacing:3},r.map((function(t,r){return e.createElement(k,{key:"".concat(t.name,"-").concat(r),item:!0,xs:4,md:3},e.createElement(S,ve({className:d.button,key:t.name},c?{onClick:function(){return c(t)}}:{component:J,to:t.link}),e.createElement(g,{className:"".concat(d.svgContainer," ").concat(d.labelBreak)},n(t)),e.createElement(p,{className:d.orgLabel,variant:"body1"},t.name)))}))):e.createElement(p,{className:d.centerText,variant:"body2",color:"text.primary"},l):e.createElement(Ue,{text:o}))},at=function(t){var r=t.text,n=void 0===r?"Something went wrong":r,a=ve(ve({},Oe()),Me());return e.createElement(g,{className:a.flexCenter},e.createElement(Z,{fontSize:"medium",className:a.rightSpacer1,color:"error"}),e.createElement(p,{variant:"body2",color:"textSecondary"},n))},ot=u((function(e){return{listIcon:{minWidth:"auto",paddingRight:"0.25rem"},mainIconSize:{fontSize:"1rem"},mainIconMarginAdjustment:{marginTop:"3px"},textOverflowEllipsis:{overflow:"hidden",textOverflow:"ellipsis"},mainListItem:function(t){return{padding:"8px 24px 8px 16px",alignItems:"flex-start",backgroundColor:t.mainBackground||e.palette.common.white,color:t.mainText||e.palette.text.primary,borderRadius:e.spacing(.6),"&:hover":{backgroundColor:t.mainHover||e.palette.action.hover}}},mainIconColor:function(t){return{color:t.mainIcon||e.palette.grey[500]}},activeMainIconColor:function(e){return{color:e.mainActiveText||"#8FC1FF"}},subListItem:function(t){return{backgroundColor:t.subItemBackground||"#FFFFFF",color:t.subItemText||e.palette.text.secondary,borderRadius:"8px","&:hover":{backgroundColor:t.subItemHover||"rgba(143,193,255,0.3)"}}},activeSubListItem:function(e){return{backgroundColor:e.subItemActiveBackground||"#FFFFFF",color:e.subItemActiveText||"#8FC1FF","&:hover":{backgroundColor:e.subItemActiveHover||"rgba(143,193,255,0.3)"}}},subItemBorder:{borderLeft:"1px solid ".concat(e.palette.grey[600]),marginLeft:"1px",marginRight:"1px",width:"100%",height:"100%"},relativeWrapper:{position:"relative"},subItemBorderMask:function(e){return{borderLeft:"3px solid ".concat(e.subItemActiveText||"#8FC1FF"),borderRadius:"1px",position:"absolute",top:"50%",bottom:"50%",transition:"all 0.2s ease-in-out"}},activeSubItemBorder:{top:"0 !important",bottom:"0 !important"},subItemWrapper:{display:"flex",marginLeft:"13px",marginRight:"16px"},noYMargin:{marginTop:"unset",marginBottom:"unset"}}})),it=function(e,t){return!!e.split("/").includes(t)},lt=function(t){var n,a,o=t.mainItem,i=t.subItems,l=t.config,c=t.Icon,d=ve(ve(ve({},He()),Oe()),ot(ve(ve({},(null===(n=l.secondary)||void 0===n?void 0:n.mainItemColors)||{}),(null===(a=l.secondary)||void 0===a?void 0:a.subItemColors)||{}))),s=q(),u=it(s.pathname,o.id),m=r(!!(null==i?void 0:i.length)&&u),f=m[0],h=m[1];return e.createElement(e.Fragment,null,e.createElement(B,{button:!0,dense:!0,className:d.mainListItem,component:J,to:o.route},e.createElement(N,{className:"".concat(d.listIcon," ").concat(d.mainIconMarginAdjustment," ").concat(d.rightSpacer1)},e.createElement(c,{id:"second-nav-item",styling:"".concat(d.mainIconSize," ").concat(d.mainIconColor," ").concat(u?d.activeMainIconColor:"")})),e.createElement(R,{disableTypography:!0,className:d.noYMargin,primary:e.createElement(p,{variant:"body2",className:"".concat(d.bolderText," ").concat(d.textOverflowEllipsis),color:"inherit"},o.name,(null==i?void 0:i.length)?e.createElement(p,{component:"span",variant:"body2",className:d.bolderText,color:"inherit"}," ","(",i.length,")"):null)}),(null==i?void 0:i.length)?e.createElement(N,{className:d.listIcon,onClick:function(e){e.preventDefault(),e.stopPropagation(),h((function(e){return!e}))}},f?e.createElement(Q,null):e.createElement($,null)):null),(null==i?void 0:i.length)?e.createElement(I,{in:f,timeout:"auto",unmountOnExit:!0},e.createElement(T,{component:"div",disablePadding:!0},i.map((function(t){var r=t.name,n=t.route,a=t.id;return e.createElement(g,{key:a,className:d.subItemWrapper},e.createElement(g,{className:"".concat(d.relativeWrapper," ").concat(d.rightSpacer1)},e.createElement(g,{className:"".concat(d.subItemBorder," ")}),e.createElement(g,{className:"".concat(d.subItemBorderMask," ").concat(it(s.pathname,a)?d.activeSubItemBorder:""," ")})),e.createElement(B,{key:n,component:J,to:n,button:!0,dense:!0,className:"".concat(d.subListItem," ").concat(it(s.pathname,a)?d.activeSubListItem:"")},e.createElement(R,{disableTypography:!0,primary:e.createElement(p,{variant:"body2",className:d.textOverflowEllipsis,color:"inherit"},r)})))})))):null)};function ct(e){return e.sort((function(e,t){return+t.startDate.split("T")[0].replaceAll("-","")-+e.startDate.split("T")[0].replaceAll("-","")}))}var dt=function(e,t,r){return r?(e&&re(e)?e:new Date(0)).getTime()===(t&&re(t)?t:new Date(0)).getTime():e===t},st=u((function(e){return{secondaryNavWrapper:{height:"100%",width:"300px",background:"white",overflowY:"auto",overflowX:"hidden",borderTopRightRadius:De,borderBottomRightRadius:De,marginLeft:"-16px",paddingLeft:"16px",border:"1px solid ".concat(e.palette.grey[300]),boxShadow:"0 2px 4px 0 rgba(0, 0, 0, 0.3)",boxSizing:"border-box"},titleWrapper:{marginTop:"24px",display:"flex",alignItems:"center",paddingLeft:"16px",paddingRight:"16px"},title:{fontSize:"18px",fontWeight:500,color:function(e){return e.titleColor||"#8FC1FF"}},titleIcons:{color:function(e){return e.titleIconColor||"#8FC1FF"}},closeButton:{marginLeft:"auto"},archivedSeparator:{paddingLeft:"8px",color:e.palette.grey[500]},archivedBorder:{marginTop:"3rem",border:"1px solid ".concat(e.palette.grey[200]),width:"33%",marginLeft:"8px"},listWrapper:{marginLeft:e.spacing(1),marginRight:e.spacing(1)}}})),ut=function(t){var r,n,a,o,i=t.secondaryNavItems,l=t.primaryNavItems,c=t.expandedOptions,d=t.setExpandedOptions,s=t.config,u={titleColor:null===(r=s.secondary)||void 0===r?void 0:r.titleColor,titleIconColor:null===(n=s.secondary)||void 0===n?void 0:n.titleIconColor},m=ve(ve(ve({},Oe()),He()),st(u)),f=X(),h=i[c.view];if(!h)return null;var v=l.find((function(e){return e.field===c.view})).Icon;return e.createElement(g,{className:m.secondaryNavWrapper},e.createElement(g,{className:m.titleWrapper},e.createElement(p,{className:"".concat(m.rightSpacer1," ").concat(m.title)},c.view),h.button?e.createElement(F,{className:m.titleIcons,size:"small",type:"button",onClick:function(){return f.push(h.button.url)}},e.createElement(ae,null)):null,e.createElement(F,{className:"".concat(m.titleIcons," ").concat(m.closeButton),size:"small",type:"button",onClick:function(){return d({view:"",expanded:!1})}},(null===(a=s.secondary)||void 0===a?void 0:a.closeButtonSvg)||e.createElement(ne,null))),e.createElement(T,{className:m.listWrapper,component:"div"},ct(h.items).map((function(t){return e.createElement(lt,ve({key:t.mainItem.route},t,{config:s,Icon:v}))})),(null===(o=h.archivedItems)||void 0===o?void 0:o.length)?e.createElement(e.Fragment,null,e.createElement(g,{className:"".concat(m.archivedBorder," ").concat(m.contentBreak)}),e.createElement(p,{variant:"body2",className:"".concat(m.archivedSeparator," ").concat(m.bolderText)},"Archived ",c.view),ct(h.archivedItems).map((function(t){return e.createElement(lt,ve({key:t.mainItem.route},t,{config:s,Icon:v}))}))):null))},mt=u((function(e){return{primaryNavContainer:function(e){return{background:e.background||"linear-gradient(to bottom, #253a68 40%, #73c4ca)",border:"2px solid ".concat(e.activeBorderColor||"#8FC1FF"),borderLeft:"none",borderTopRightRadius:De,borderBottomRightRadius:De,minWidth:"4.5rem",overflowY:"auto",overflowX:"hidden"}},listWrapper:{display:"flex",flexDirection:"column",paddingTop:0},itemWrapper:{display:"flex",flexDirection:"column",padding:"0.75rem 0.5rem 0.5rem 0.5rem"},itemBorder:{borderRight:function(e){return"6px solid ".concat(e.activeBorderColor||"#8FC1FF")},position:"absolute",bottom:"50%",top:"50%",transition:"all 0.2s ease-in-out",right:"-3px"},activeBorder:{top:"15%",bottom:"15%"},iconWrapper:{minWidth:0,marginBottom:"4px",position:"relative"},itemName:{fontSize:"0.7rem",maxWidth:"3.5rem",textAlign:"center",textOverflow:"ellipsis",overflow:"hidden"},textColour:{color:function(e){return e.text||"#FFFFFF"}},activeTextColour:{color:function(e){return e.activeText||"#8FC1FF"}},lastItem:{marginTop:"auto"}}})),pt=function(t){var r=t.expandedOptions,n=t.setExpandedOptions,a=t.navigationLinks,o=t.config,i=q(),l=mt(ve({},o.primary||{})),c=function(e,t){return""===r.view?i.pathname===t||!(e===o.rootRouteName||!i.pathname.startsWith(t)):r.view===e};return e.createElement(T,{className:"".concat(l.primaryNavContainer," ").concat(l.listWrapper)},a.map((function(t,r,a){var i;return e.createElement(B,ve({key:t.field,button:!0,className:"".concat(l.itemWrapper," ").concat(l.textColour," ").concat((null===(i=o.primary)||void 0===i?void 0:i.moveLastItemToBottom)&&r===a.length-1?l.lastItem:"")},t.hasSecondary?{}:{component:J,to:t.path},{onClick:function(){n({view:t.field,expanded:!!t.hasSecondary})}}),e.createElement(N,{className:l.iconWrapper},e.createElement(t.Icon,{styling:"".concat(l.textColour," ").concat(c(t.field,t.path)?l.activeTextColour:"")})),e.createElement(p,{variant:"caption",className:"".concat(l.itemName," ").concat(l.textColour," ").concat(c(t.field,t.path)?l.activeTextColour:"")},t.field),e.createElement(g,{className:"".concat(l.itemBorder," ").concat(c(t.field,t.path)?l.activeBorder:"")}))})))},gt=u({leftNavContainer:{height:"100%",display:"flex",position:"relative",width:"max-content"}}),ft=function(t){var n=t.primaryNavItems,a=t.secondaryNavItems,i=t.config,l=r({view:"",expanded:!1}),c=l[0],d=l[1],s=gt(),u=q(),m=n.reduce((function(e,t){return t.hasSecondary?we(we([],e,!0),[t.field],!1):e}),[]);return o((function(){d((function(e){return m.includes(e.view)&&!0===e.expanded?e:{view:"",expanded:!1}}))}),[u.pathname]),e.createElement(g,{component:"nav",className:s.leftNavContainer},e.createElement(pt,{expandedOptions:c,setExpandedOptions:d,navigationLinks:n,config:i}),c.expanded&&e.createElement(ut,{secondaryNavItems:a,primaryNavItems:n,expandedOptions:c,setExpandedOptions:d,config:i}))},ht=u((function(e){return{remainingHeightBox:{position:"absolute",top:function(e){var t;return null!==(t=e.topOffset)&&void 0!==t?t:"4rem"},bottom:0,left:0,right:0,display:"flex"},fullHeightFlexbox:{display:"flex",height:"100%"},relativeContainer:{position:"relative"},scrollWrapper:{overflow:"auto",overflowX:"hidden"},componentWrapper:{padding:e.spacing(2),paddingBottom:e.spacing(2),position:"relative"}}})),vt=function(t){var r=t.sideNavigation,n=t.children,a=t.desktopWidth,o=t.topOffset,i=t.id,l=ht({topOffset:o});return e.createElement(g,{className:l.remainingHeightBox},r?e.createElement(g,{className:"".concat(l.fullHeightFlexbox," ").concat(l.relativeContainer)},r):null,e.createElement(L,{id:i,disableGutters:!0,maxWidth:!1,className:l.scrollWrapper},e.createElement(L,{disableGutters:!0,maxWidth:a?"xl":"lg",className:l.componentWrapper},n)))},bt=function(e,t,r){void 0===r&&(r=250);var n=a(e,t);o((function(){var e=setTimeout(n,r);return function(){return clearTimeout(e)}}),[n,r])},yt=function(e,t){var r=i();o((function(){r.current=e})),o((function(){if(null!==t){var e=setInterval((function(){r.current&&r.current()}),t);return function(){return clearInterval(e)}}}),[t])};function xt(e,t){var r=i(t);o((function(){var n=Object.keys(ve(ve({},r.current),t)),a={};n.forEach((function(e){r.current[e]!==t[e]&&(a[e]={from:r.current[e],to:t[e],changedKeys:t[e]&&"object"==typeof t[e]?Object.keys(r.current[e]).map((function(n){return r.current[e][n]===t[e][n]?"":n})).filter(Boolean):void 0,isDeepEqual:ie(r.current[e],t[e])})})),Object.keys(a).length&&console.log("[why-did-you-update]",e,{changes:a,props:{from:r.current,to:t}}),r.current=t}),Object.values(t))}var wt=u((function(e){return{divider:{background:e.palette.primary.main,height:"0.2rem"},letterHeader:{cursor:"default",color:e.palette.primary.main,marginTop:"1rem"},listItem:{borderRadius:De,border:"1px solid ".concat(e.palette.grey[300]),marginBottom:"0.5rem",paddingLeft:"24px",boxShadow:e.shadows[1]},topMargin:{marginTop:e.spacing(2),display:"block"}}})),Et=function(t){var r=t.array,n=t.sortFn,a=t.sortKey,o=void 0===a?"name":a,i=t.buttonClick,l=t.linkTo,c=t.ItemTemplate,d=t.arrayKey,s=void 0===d?"id":d,u=t.loading,m=void 0!==u&&u,g=t.loadingMessage,f=void 0===g?"Loading list...":g,h=t.emptyMessage,v=void 0===h?"List is empty":h,b=t.alphabetisedHeader,y=void 0===b||b,x=ve(ve(ve({},wt()),Oe()),Me());if(void 0===r||m)return e.createElement(Ue,{styling:x.topMargin,text:f});if(!(null==r?void 0:r.length))return e.createElement(p,{className:x.topMargin,align:"center",variant:"body2",color:"textSecondary"},v);var w=n?we([],r,!0).sort(n):r,E="";return e.createElement(T,{className:x.limitWidth50rem},w.map((function(t,r){var n,a=!1;if(y){var d=((null===(n=t[o])||void 0===n?void 0:n[0])||"???").toLowerCase();d!==E&&(E=d,a=!0)}return e.createElement(e.Fragment,{key:t[s]||"alphabetical-list-".concat(r)},y&&a?e.createElement(e.Fragment,null,e.createElement(p,{className:"".concat(x.letterHeader),align:"left"},E.toUpperCase()),e.createElement(P,{className:"".concat(x.contentBreak," ").concat(x.divider)})):null,e.createElement(B,ve({className:x.listItem,alignItems:"flex-start",button:!(!i&&!l)||void 0,onClick:i?function(){return i(t)}:void 0},l&&!i?{component:J,to:l(t)}:{}),e.createElement(c,{item:t})))})))},Ct=u((function(e){return{searchBox:{display:"flex",alignContent:"center",alignItems:"center",padding:"8px",border:"2px solid ".concat(e.palette.grey[300]),borderRadius:De},searchField:{borderRadius:De,width:"100%",background:function(e){return e.background||"RGBA(179, 213, 235, 0.1)"},height:"46px",paddingLeft:"24px",color:e.palette.grey[600]},searchIcon:{color:e.palette.grey[600]}}})),kt=function(t){var n=t.array,a=t.sortFn,i=t.sortKey,l=void 0===i?"name":i,c=t.buttonClick,d=t.linkTo,s=t.ItemTemplate,u=t.arrayKey,m=void 0===u?"id":u,p=t.loading,f=void 0!==p&&p,h=t.loadingMessage,v=void 0===h?"Loading list...":h,b=t.emptyMessage,y=void 0===b?"List is empty":b,x=t.dynamicEmptyMessage,w=t.inputBackgroundColor,E=t.placeholder,C=t.disabledSearch,k=t.delay,S=void 0===k?500:k,B=t.minQueryLength,N=void 0===B?3:B,R=t.handleOnChange,I=t.searchKeys,T=void 0===I?["name"]:I,F=t.alphabetisedHeader,L=void 0===F||F,P=t.initialSearchQuery,D=void 0===P?"":P,O=ve(ve(ve({},Oe()),Me()),Ct({background:w})),H=r(D),M=H[0],z=H[1],j=r(!1),G=j[0],K=j[1],U=r(n),V=U[0],Y=U[1];return bt((function(){!R&&!G&&M.length>=N&&Y(null==n?void 0:n.filter((function(e){var t=T.some((function(t){var r;return null===(r=e[t])||void 0===r?void 0:r.toLowerCase().includes(M.toLowerCase())}));return t})))}),[M,n],S),bt((function(){R&&!G&&M.length>=N&&R(M)}),[M],S),o((function(){Y(n)}),[n]),e.createElement(e.Fragment,null,e.createElement(g,{className:"".concat(O.searchBox," ").concat(O.limitWidth50rem)},e.createElement(A,{disabled:C,type:"text",value:M,placeholder:E||"Enter to search",onChange:function(e){G&&K(!1),z(e.target.value)},className:O.searchField,endAdornment:e.createElement(W,{position:"end",className:O.rightSpacer2},e.createElement(oe,{className:O.searchIcon}))})),null!==n&&e.createElement(Et,{array:V,sortFn:a,sortKey:l,buttonClick:c,linkTo:d,ItemTemplate:s,arrayKey:m,loading:f,loadingMessage:v,emptyMessage:x?x(M):y,alphabetisedHeader:L}))},St=u((function(e){return{inputField:function(t){var r=t.size;return ve({borderRadius:De},"small"===r?e.typography.body2:{})},labelStyles:function(t){var r=t.size;return ve({},"small"===r?ve(ve({transform:"translate(14px, 9px) scale(1) !important"},e.typography.body2),{"&.MuiInputLabel-outlined.MuiInputLabel-shrink":{transform:"translate(15px, -9px) scale(0.75) !important"}}):{})}}})),Bt=function(t){var r=t.size,n=void 0===r?"small":r,a=t.styling,o=t.numberField,i=t.inputProps,l=void 0===i?{}:i,c=t.InputProps,d=void 0===c?{}:c,s=t.accessLevel,u=t.disabled,m=t.fixedDecimalScale,p=be(t,["size","styling","numberField","inputProps","InputProps","accessLevel","disabled","fixedDecimalScale"]),g=St({size:n});if(s===We)return null;var f=u;s===Ae&&(f=!0);var h=ve({},o&&{fixedDecimalScale:!!m});return e.createElement(D,ve({className:a||"",disabled:f},p,{inputProps:ve(ve({},l),h),InputProps:ve(ve({},d),{className:g.inputField,inputComponent:o?Nt:void 0}),InputLabelProps:{className:g.labelStyles},variant:"outlined",size:n}))},Nt=function(t){var r=t.onChange,n=be(t,["onChange"]);return e.createElement(le,ve({},n,{onValueChange:function(e){r({target:{name:t.name||"",value:e.value}})},thousandSeparator:!0,decimalScale:2,isNumericString:!0}))},Rt=u((function(e){return{listItem:function(t){var r=t.background,n=t.size;return ve(ve({overflow:"auto",scrollbarWidth:"thin"},"small"===n?e.typography.body2:{}),{"&:hover":{backgroundColor:"".concat(r," !important")}})},inputStyles:function(t){var r=t.background,n=t.size;return ve(ve({borderRadius:"".concat(De," !important")},"small"===n?ve({paddingTop:"9.5px",paddingBottom:"8.5px"},e.typography.body2):{}),{"&:focus":{backgroundColor:r}})},selectedListItem:function(e){var t=e.background;return{"&:focus":{background:"".concat(t," !important")}}}}})),It=function(t){var r=t.selectOptions,n=t.background,a=void 0===n?"#EFEDFF":n,o=t.size,i=void 0===o?"small":o,l=t.styling,c=t.disabled,d=t.accessLevel,s=be(t,["selectOptions","background","size","styling","disabled","accessLevel"]),u=Rt({background:a,size:i});if(d===We)return null;var m=c;return d===Ae&&(m=!0),e.createElement(Bt,ve({className:l||""},s,{disabled:m,size:i,SelectProps:{inputProps:{className:u.inputStyles}},select:!0}),r.map((function(t){var r;return e.createElement(O,{key:t.value,value:t.value,disabled:null!==(r=null==t?void 0:t.disabled)&&void 0!==r&&r,className:u.listItem,classes:{selected:u.selectedListItem}},t.description)})))},Tt=function(t){var r=t.styling,n=t.format,a=void 0===n?"dd MMM yyyy":n,o=t.minDate,i=void 0===o?new Date("1856-09-25"):o,l=t.accessLevel,c=t.disabled,d=t.slots,s=be(t,["styling","format","minDate","accessLevel","disabled","slots"]);if(l===We)return null;var u=c;return l===Ae&&(u=!0),e.createElement(ce,ve({className:r||""},s,{disabled:u,format:a,minDate:i,slots:ve({textField:Bt},d||{})}))},Ft=function(t){var r=t.styling,n=t.format,a=void 0===n?"dd/MM/yyyy":n,o=t.minDate,i=void 0===o?new Date("1856-09-25"):o,l=t.accessLevel,c=t.disabled,d=t.slots,s=be(t,["styling","format","minDate","accessLevel","disabled","slots"]);if(l===We)return null;var u=c;return l===Ae&&(u=!0),e.createElement(ce,ve({className:r||""},s,{disabled:u,format:a,minDate:i,slots:ve({textField:Bt},d||{})}))},Lt=u((function(e){return{confirmWrapper:{display:"inline-block"},confirmContainer:{display:"flex",alignItems:"center"},whiteText:{color:e.palette.common.white}}})),Pt=function(t){var n=t.children,a=t.onClick,i=t.styling,l=t.disabled,c=void 0!==l&&l,d=t.variant,s=void 0===d?"outlined":d,u=t.color,m=void 0===u?"primary":u,f=t.accessLevel,h=void 0===f?"":f,v=t.confirmButtonLabel,b=void 0===v?"Are you sure?":v,y=be(t,["children","onClick","styling","disabled","variant","color","accessLevel","confirmButtonLabel"]),x=ve(ve({},Oe()),Lt()),w=r(!1),E=w[0],C=w[1],k=r(!1),S=k[0],B=k[1];return yt((function(){return C(!1)}),!E||S?null:4500),o((function(){B(y.loading),C(y.loading)}),[y.loading]),[We,Ae].includes(h)?null:E?e.createElement(g,{className:x.confirmWrapper},e.createElement(g,{className:x.confirmContainer},e.createElement(p,{className:x.rightSpacer1,variant:"body1"},b),e.createElement(je,ve({},y,{type:"button",onClick:function(e){B(!0),a(e)},variant:"contained",styling:x.whiteText,disabled:c,color:m}),"Confirm",y.loading?"ing":""))):e.createElement(je,{type:"button",variant:s,disabled:c,styling:i,color:m,onClick:function(){return C(!0)}},n)},At=function(e,t){var r=t?(+e).toFixed(2).length:e.toString().length;return r?"".concat(r+1+Math.floor(r/3)/3,"ch"):"6ch"},Wt=u((function(e){return{inputBase:function(e){return{height:"unset",padding:0,textAlign:e.textAlign||"center"}},input:function(e){return{textAlign:e.textAlign||"center",marginRight:"0.4rem",marginLeft:"0.4rem"}},startAdornment:{color:e.palette.text.secondary},modifiedUnderline:{"&:not(.Mui-disabled):before":{borderBottom:"none",transition:"none"},"&:hover:not(.Mui-disabled):before":{borderBottom:"1px solid ".concat(e.palette.grey[500]," !important")}},body2Text:ve({},e.typography.body2),dateFieldWidth:{width:"8ch"},fullDateWidth:{width:"11ch"},justifyStart:{justifyContent:"flex-start"},justifyCenter:{justifyContent:"center"},justifyEnd:{justifyContent:"flex-end"},totalContainer:{display:"flex",alignItems:"center",cursor:"default"},selectFocusBackground:{"&:focus":{backgroundColor:"unset"}}}})),Dt=function(t){var r=t.error,n=t.disabled,a=t.value,o=t.onBlur,i=t.onChange,l=t.prefix,c=t.suffix,d=t.numberField,s=void 0!==d&&d,u=t.textAlign,m=t.fixedDecimalScale,g=t.inputStyling,f=void 0===g?"":g,h=t.wrapperStyling,v=void 0===h?"":h,b=t.widthOverride,y=void 0===b?void 0:b,x=t.name,w=void 0===x?void 0:x,E=Wt({textAlign:u}),C=ve({},s&&{fixedDecimalScale:!!m});return"string"==typeof a||"number"==typeof a?e.createElement(D,{variant:"standard",name:w,className:v,error:!!r,inputProps:ve({className:"".concat(E.inputBase," ").concat(f),style:{width:y||At(a,!!m)}},C),value:a,onChange:i,onBlur:o,InputProps:{startAdornment:l?e.createElement(W,{position:"end",className:E.startAdornment},l):null,endAdornment:c?e.createElement(W,{position:"start",className:E.startAdornment},c):null,inputComponent:s?Nt:void 0,className:"".concat(E.body2Text," ").concat(E.modifiedUnderline),classes:{input:E.input}},helperText:r||void 0,disabled:n}):e.createElement(p,{variant:"body2"},"Incorrect value type")},Ot=function(t){return e.createElement(Dt,ve({},ve(ve({},t),{numberField:!0})))},Ht=function(t){return e.createElement(Dt,ve({},ve(ve({},t),{numberField:!0,fixedDecimalScale:!0})))},Mt=Y(V({root:{padding:"3px"}}))(H),zt=function(t){var r=t.disabled,n=t.fullDate,a=void 0!==n&&n,o=t.value,i=t.error,l=t.onChange;t.onBlur;var c=t.textAlign,d=Wt({textAlign:c});return e.createElement(fe,{disabled:r,views:a?void 0:["year","month"],value:o,format:a?"dd MMM yyyy":"MMM yyyy",onChange:l,slotProps:{textField:{helperText:i||void 0,error:!!i,InputProps:{className:"".concat(d.body2Text," ").concat(d.modifiedUnderline)},inputProps:{className:"".concat(d.inputBase," ").concat(a?d.fullDateWidth:d.dateFieldWidth),classes:{input:d.input}},variant:"standard"}}})},jt=function(t){return e.createElement(zt,ve({fullDate:!0},t))},Gt=function(t){var r=t.value,n=t.disabled,a=t.onChange;return e.createElement(H,{disabled:n,checked:r,onChange:a,color:"primary",size:"small"})},Kt=function(t){return e.createElement(Gt,ve({},t))},Ut=function(t){var r=t.text,n=t.numberField,a=void 0!==n&&n,o=t.prefix,i=void 0===o?null:o,l=t.suffix,c=void 0===l?null:l,d=t.textAlign,s=t.fixedDecimalScale,u=t.styling,m=void 0===u?"":u,p=t.inputStyling,f=void 0===p?"":p,h=t.widthOverride,v=void 0===h?void 0:h,b=Wt({});return e.createElement(g,{className:"".concat(b.totalContainer," ").concat(b.body2Text," ").concat("left"===d?b.justifyStart:"right"===d?b.justifyEnd:b.justifyCenter," ").concat(m),style:{width:v}},i&&i,e.createElement(g,{className:b.body2Text,style:{width:v}},a?e.createElement(le,{className:f,value:r,displayType:"text",thousandSeparator:!0,isNumericString:!0,decimalScale:2,fixedDecimalScale:s}):r),c&&c)},Vt=function(t){var r=t.error,n=t.value,a=t.onBlur,o=t.onChange,i=t.selectOptions,l=t.disabled,c=Wt({});return e.createElement(M,{variant:"standard",margin:"none",error:!!r},e.createElement(z,{variant:"standard",className:"".concat(c.body2Text," ").concat(c.modifiedUnderline),inputProps:{className:c.selectFocusBackground},value:n,onChange:o,onBlur:a,disabled:l},Object.entries(i).map((function(t){var r=t[0],n=t[1];return e.createElement(O,{className:c.body2Text,key:r,value:r},n)}))),r&&e.createElement(j,null,r))},Yt=function(t){var r=t.error,n=t.value,a=t.onBlur,o=t.onChange,i=t.selectOptions,l=t.disabled,c=t.renderValue,d=Wt({});return e.createElement(M,{variant:"standard",margin:"none",error:!!r},e.createElement(z,{variant:"standard",className:"".concat(d.body2Text," ").concat(d.modifiedUnderline),inputProps:{className:d.selectFocusBackground},value:n,onChange:o,onBlur:a,disabled:l,renderValue:c,multiple:!0},Object.entries(i).map((function(t){var r=t[0],n=t[1];return e.createElement(O,{className:d.body2Text,key:r,value:r},n)}))),r&&e.createElement(j,null,r))},Jt=u((function(e){return{newRowHighlight:{backgroundColor:"#73c4ca30"},editedCellHighlight:{backgroundColor:"#5840f52e !important",backgroundClip:"padding-box"},editedBorder:{border:"3px solid #5840f52e",borderWidth:"2px 4px"},errorBorder:{border:"3px solid ".concat(e.palette.error.light),borderWidth:"2px 4px"},emptyLoadingPadding:{paddingTop:"0.75rem",paddingBottom:"0.75rem"},centeredText:{textAlign:"center"},disabled:{backgroundColor:e.palette.action.hover},pagination:{marginTop:"1rem",marginBottom:"1rem"},virtualisationContainer:{maxHeight:"500px",overflow:"auto"},cellPadding:{padding:".5rem .75rem"},shadedHeader:{"&:nth-of-type(even).shadedHeader":{backgroundColor:"#eeeeee"}},shadedBodyCell:{"&:nth-of-type(even).shadedBodyCell":{backgroundColor:"rgba(0, 0, 0, 0.07)",backgroundClip:"padding-box"}},shadedHeaderGroupParent:{"&:nth-of-type(even).shadedHeaderGroupParent":{backgroundColor:"#eeeeee"}},shadedHeaderGroup2Children:{"&:nth-of-type(4n-2).shadedHeaderGroup2Children":{backgroundColor:"#eeeeee"},"&:nth-of-type(4n-1).shadedHeaderGroup2Children":{backgroundColor:"#eeeeee"}},shadedBody2CellsInsideGroup:{"&:nth-of-type(4n-2).shadedBody2CellsInsideGroup":{backgroundColor:"rgba(0, 0, 0, 0.07)",backgroundClip:"padding-box"},"&:nth-of-type(4n-1).shadedBody2CellsInsideGroup":{backgroundColor:"rgba(0, 0, 0, 0.07)",backgroundClip:"padding-box"}},offsetStickyPosition:{top:0,left:"-3px",zIndex:2,position:"sticky"},stickyHeaderZIndex:{zIndex:3},headerCellColour:{backgroundColor:e.palette.grey[50]},rowCellColour:{backgroundColor:e.palette.common.white,backgroundClip:"padding-box"},rowHoverForStickyCell:{"&:hover .stickyRowCell":{backgroundColor:"rgb(245,245,245)"}},headerBorders:{"& :not(tr:last-child th)":{border:"none"}}}})),qt=function(t){var n=t.value,a=void 0===n?"":n,i=t.row,l=i.index,c=i.values,d=i.original,s=t.column.id,u=t.syncCellWithState,m=t.setRows,p=t.fieldConfig,g=t.disabled,f=p[s],h=f.validationRule,v=f.dependentValidationRule,b=f.isCheckbox,y=f.isDateField,x=f.customRenderFn,w=f.prefix,E=f.suffix,C=f.textAlign,k=f.onBlur,S=f.onChangeValueModifier,B=r(!1),N=B[0],R=B[1],I=r(a),T=I[0],F=I[1],L=b,P=function(e){var t=!1;if(h)try{h.validateSync(e),N&&R(!1)}catch(e){t=!0,!N&&R(e.message)}if(v)try{v(c).validateSync(e),N&&R(!1)}catch(e){t=!0,!N&&R(e.message)}return t},A=function(e,t){return ye(void 0,void 0,void 0,(function(){return xe(this,(function(r){switch(r.label){case 0:return L?u(l,s,e,!1):y?u(l,s,e,!!t):u(l,s,T,!!N),!k||!m||N||dt(c[s],T,y)?[3,2]:[4,k({rowIndex:l,value:T,setRows:m,values:d})];case 1:r.sent(),r.label=2;case 2:return[2]}}))}))};o((function(){F(a);var e=P(a);N!==e&&u(l,s,a,e,!0)}),[a]),o((function(){d.errors&&!!d.errors[s]!=!!N&&P(a)}),[d.errors]);var W,D={value:T,values:c,disabled:g||d.disabledRow,error:N,onChange:function(e){var t;if(y){t=e;var r=S?S(t):t;F(r);var n=P(r);A(r,n)}else{t=e;var a=L?t.target.checked:t.target.value;L?(F(a),A(a)):(F(a),P(a))}},onBlur:A,prefix:w,suffix:E,textAlign:C,originalValues:d};return x?x(D):(W=D,e.createElement(Dt,ve({},ve({},W))))},Xt=l((function(t,r){var n=t.row,a=t.classes,o=t.disabled,i=t.includeRowSelect,l=be(t,["row","classes","disabled","includeRowSelect"]);return e.createElement(h,ve({},l,{ref:r,hover:!0,className:"".concat("NEW"===n.original.rowStatus?a.newRowHighlight:""," ").concat(n.original.rowStatus===Be?a.editedBorder:"","\n").concat(Object.values(n.original.errors||{}).includes(!0)?a.errorBorder:""," ").concat(n.original.disabledRow||o?a.disabled:"","\n ").concat(a.rowHoverForStickyCell)}),n.cells.map((function(t,r){return e.createElement(w,ve({},t.getCellProps(),{align:t.column.textAlign||"center",className:"".concat(t.row.original.rowStatus===Be&&t.row.original.edited[t.column.id]?a.editedCellHighlight:""," ").concat(a.cellPadding,"\n ").concat(t.column.shadedHeaderGroup?"".concat(a.shadedBody2CellsInsideGroup," shadedBody2CellsInsideGroup"):"","\n ").concat(t.column.shadedHeader?"".concat(a.shadedBodyCell," shadedBodyCell"):"","\n ").concat(t.column.stickyCell?"".concat(a.offsetStickyPosition," ").concat(a.rowCellColour," stickyRowCell"):"","\n "),padding:i&&0===r?"checkbox":"normal"}),t.render("Cell"))})))})),Zt=[],Qt=t((function(t){var r=t.tableRows,n=t.tableHeaders,i=t.syncCellWithState,l=t.setRows,c=void 0===l?void 0:l,d=t.skipPageReset,s=void 0!==d&&d,u=t.fieldConfig,m=t.disabled,f=void 0!==m&&m,h=t.setSelectedRows,v=t.includeRowSelect,b=void 0===v||v,y=t.filterData,w=t.filterTypes,E=t.emptyTableText,C=void 0===E?"Table is empty":E,k=t.paginate,S=void 0!==k&&k,B=t.defaultPageSize,N=void 0===B?50:B,R=t.virtContainerStyling,I=t.overscan,T=t.rowHeight,F=t.includeGlobalSearch,L=t.disableHeaderSelect,P=ve(ve({},Jt()),Me()),A=e.useRef(null),W=e.useMemo((function(){return{Cell:qt}}),[]),D=de({columns:n,data:r||Zt,defaultColumn:W,autoResetPage:!!S&&!s,filterTypes:w,initialState:{pageSize:S?N:void 0},syncCellWithState:i,setRows:c,fieldConfig:u,disabled:f,autoResetGlobalFilter:!1},se,ue,me,pe,(function(t){b&&t.visibleColumns.push((function(t){return we([{id:"selection",Header:function(t){var r=t.getToggleAllRowsSelectedProps,n=t.getToggleAllPageRowsSelectedProps;return L?"Select":e.createElement(Mt,ve({},S?n():r(),{disabled:f,size:"small"}))},Cell:function(t){var r=t.row;return e.createElement(Mt,ve({},r.getToggleRowSelectedProps(),{disabled:f||r.original.disableSelection,size:"small"}))}}],t,!0)}))})),O=D.getTableProps,H=D.getTableBodyProps,M=D.headerGroups,z=D.rows,j=D.page,G=D.prepareRow,K=D.state,U=K.selectedRowIds,V=K.pageIndex,Y=D.state,J=D.setFilter,q=D.pageCount,X=D.gotoPage,Z=D.preGlobalFilteredRows,Q=D.setGlobalFilter,$=D.isAllRowsSelected,_=D.selectedFlatRows,ee=he({size:(S?j:z).length,parentRef:A,overscan:I||5,estimateSize:a((function(){return T||54}),[T])}),te=S?j:z,re=ee.virtualItems,ne=re.length>0?re[0].start:0,ae=re.length>0?ee.totalSize-re[re.length-1].end:0,oe=a((function(e,t){X(t-1)}),[]);return o((function(){y&&J(y.filterRow,y.filterValues)}),[y]),o((function(){h&&h(Object.keys(U).map((function(e){return+e})))}),[U]),e.createElement(e.Fragment,null,F?e.createElement(_t,{preGlobalFilteredRows:Z,globalFilter:Y.globalFilter,setGlobalFilter:Q}):null,e.createElement("div",{ref:A,className:R||P.virtualisationContainer},e.createElement(er,ve({},{disabled:f,includeRowSelect:b,getTableProps:O,headerGroups:M,getTableBodyProps:H,rowsToRender:te,prepareRow:G,paddingTop:ne,paddingBottom:ae,virtualRows:re,isAllRowsSelected:$,selectedFlatRows:_}))),null===r?e.createElement(g,{className:P.emptyLoadingPadding},e.createElement(Ue,null)):null,r&&!r.length?e.createElement(g,{className:"".concat(P.emptyLoadingPadding," ").concat(P.centeredText)},e.createElement(p,{variant:"body2"},C)):null,S&&(null==r?void 0:r.length)?e.createElement(x,{className:"".concat(P.flexCenter," ").concat(P.pagination),count:q,page:V+1,onChange:oe,shape:"rounded",showFirstButton:!0,showLastButton:!0}):null)})),$t=u((function(e){return{container:{display:"flex",justifyContent:"center",alignItems:"center",border:"1px solid ".concat(e.palette.grey[600]),borderRadius:"8px",width:"100%",maxWidth:"20rem",marginInline:"auto",color:e.palette.grey[600],"&:hover":{borderColor:e.palette.grey[800],color:e.palette.grey[800]},"&:focus-within":{borderColor:e.palette.grey[800],color:e.palette.grey[800]}},input:ve({width:"100%",maxWidth:"18rem",color:"inherit"},e.typography.body2)}})),_t=t((function(t){var n=t.preGlobalFilteredRows,a=t.globalFilter,o=t.setGlobalFilter,i=r(a),l=i[0],c=i[1],d=ve(ve({},Oe()),$t()),s=ge((function(e){o(e||void 0)}),200),u=n.length;return e.createElement("div",{className:"".concat(d.container," ").concat(d.contentBreak)},e.createElement(oe,{className:"".concat(d.rightSpacer1," ").concat(d.leftSpacer1)}),e.createElement(A,{className:"".concat(d.input),value:l||"",onChange:function(e){c(e.target.value),s(e.target.value)},placeholder:"Search ".concat(u," records..."),inputProps:{"aria-label":"search"}}))})),er=t((function(t){var r=t.disabled,n=t.includeRowSelect,a=t.getTableProps,o=t.headerGroups,i=t.getTableBodyProps,l=t.rowsToRender,c=t.prepareRow,d=t.paddingTop,s=t.paddingBottom,u=t.virtualRows,m=t.isAllRowsSelected,p=t.selectedFlatRows;return e.createElement(b,ve({},a(),{style:{borderCollapse:"collapse"}}),e.createElement(tr,{headerGroups:o,includeRowSelect:n,isAllRowsSelected:m}),e.createElement(y,ve({},i()),d>0&&e.createElement("tr",null,e.createElement("td",{style:{height:"".concat(d,"px")}})),e.createElement(rr,ve({},{disabled:r,includeRowSelect:n,rowsToRender:l,prepareRow:c,virtualRows:u,selectedFlatRows:p})),s>0&&e.createElement("tr",null,e.createElement("td",{style:{height:"".concat(s,"px")}}))))})),tr=t((function(t){var r=t.headerGroups,n=t.includeRowSelect;t.isAllRowsSelected;var a=Jt();return e.createElement(v,{className:"".concat(a.offsetStickyPosition," ").concat(a.stickyHeaderZIndex," ").concat(a.headerBorders)},r.map((function(t){return e.createElement(h,ve({},t.getHeaderGroupProps()),t.headers.map((function(t,r){var o;return e.createElement(w,ve({},t.getHeaderProps(),{align:t.textAlign||"center",padding:n&&0===r?"checkbox":"normal",className:"".concat(a.headerCellColour,"\n ").concat(t.shadedHeaderGroup?t.columns?"".concat(a.shadedHeaderGroupParent," shadedHeaderGroupParent"):t.parent?"".concat(a.shadedHeaderGroup2Children," shadedHeaderGroup2Children"):"":""," ").concat(t.shadedHeader?"".concat(a.shadedHeader," shadedHeader"):"","\n ").concat(t.stickyCell||(null===(o=t.placeholderOf)||void 0===o?void 0:o.stickyCell)?"".concat(a.offsetStickyPosition," ").concat(a.stickyHeaderZIndex):"")}),t.render("Header"))})))})))})),rr=t((function(t){var r=t.rowsToRender,n=t.virtualRows,a=t.prepareRow,o=be(t,["rowsToRender","virtualRows","prepareRow"]),i=ve(ve({},Jt()),Me());return e.createElement(e.Fragment,null,n.map((function(t){var n=r[t.index];return a(n),e.createElement(c,{key:n.original.rowKey||n.getRowProps().key},n.original.disabledRow?e.createElement(G,{title:n.original.tooltipText||"This row is disabled",arrow:!0},e.createElement(Xt,ve({},ve(ve({},o),{row:n,classes:i})))):e.createElement(Xt,ve({},ve(ve({},o),{row:n,classes:i}))))})))})),nr=u((function(e){return{alertStyling:{borderRadius:De},closeButton:{color:e.palette.text.secondary,marginRight:e.spacing(2)},showCursor:{cursor:"pointer"}}})),ar=function(t){var r=t.alertActionHandler,n=t.formStatus,a=t.actionButton,o=t.alertMessage,i=t.addBreak,l=void 0===i||i,c=t.styling,d=ve(ve({},Oe()),nr());return e.createElement(I,{in:[Re,Ie,Le].includes(n)},e.createElement(K,{onClick:r,className:"".concat(d.alertStyling," ").concat(l?d.sectionBreak:""," ").concat(c||""," ").concat(r?d.showCursor:""),severity:n===Ie?Ie:n===Re?Re:Le,action:a?e.createElement(S,{className:d.closeButton,"aria-label":"close",color:"inherit",size:"small",onClick:function(e){e.stopPropagation(),a.handler()}},a.text):null},o))},or=u((function(e){return{greyBox:{backgroundColor:e.palette.grey[200],display:"flex",justifyContent:"center",alignItems:"center",padding:"1.5rem",borderRadius:De,position:"relative",height:"13.25rem"},widthLimiter:{width:"100%",maxWidth:"28rem",marginLeft:"auto",marginRight:"auto"},hiddenInput:{display:"none"},buttonColor:{backgroundColor:e.palette.primary.main},iconStyling:{color:e.palette.common.white,fontSize:"3rem"},sectionBreak:{marginBottom:e.spacing(3)},dropBox:{height:"100%",width:"100%",display:"flex",justifyContent:"center",alignItems:"center"},dropArrowStyling:{color:e.palette.text.secondary,fontSize:"3rem"},topLeftArrow:{position:"absolute",top:0,left:0,transform:"rotate(45deg)"},topRightArrow:{position:"absolute",top:0,right:0,transform:"rotate(135deg)"},bottomLeftArrow:{position:"absolute",bottom:0,left:0,transform:"rotate(-45deg)"},bottomRightArrow:{position:"absolute",bottom:0,right:0,transform:"rotate(225deg)"},hiddenDisplay:{display:"none"},loadingCircle:{marginLeft:e.spacing(1)},roundedAvatarButton:{borderRadius:"100%"},roundedAvatar:{width:"16vmax",height:"16vmax",maxWidth:"13rem",maxHeight:"13rem"},organisationImage:{maxWidth:"8rem",minWidth:"5rem",maxHeight:"8rem"}}})),ir="dragEnter",lr="input",cr="dragDrop",dr=function(t){var n=t.id,a=void 0===n?"image-upload":n,i=t.url,l=t.roundedAvatar,c=void 0!==l&&l,d=t.handleSaveImage,s=t.alt,u=t.accessLevel,m=ve(ve({},or()),Oe()),h=r(!!i),v=h[0],b=h[1],y=r(Fe),x=y[0],w=y[1],E=r(null),C=E[0],k=E[1];if(o((function(){i&&b(!0)}),[i]),u===We)return null;var B=!1;u===Ae&&(B=!0);var N,R=function(e,t){return ye(void 0,void 0,void 0,(function(){var r,n;return xe(this,(function(a){switch(a.label){case 0:return B?[2]:(k(null),e!==lr?[3,4]:(r=t.target).files&&r.files[0]?[4,I(r.files[0])]:[3,2]);case 1:return a.sent(),[3,3];case 2:w(Ie),b(!!i),a.label=3;case 3:return[3,7];case 4:return e!==cr?[3,7]:(n=t.dataTransfer).files&&n.files[0]?[4,I(n.files[0])]:[3,6];case 5:return a.sent(),[3,7];case 6:w(Ie),b(!!i),a.label=7;case 7:return[2]}}))}))},I=function(e){return ye(void 0,void 0,void 0,(function(){var t,r,n;return xe(this,(function(a){switch(a.label){case 0:return w(Te),e.size>=524288?(k("Image size should be less than 0.5MB"),w(Ie),b(!!i),[2]):(t=e.name.split(".")[1].toLowerCase(),["png","jpg","jpeg"].includes(t)?[4,e.arrayBuffer()]:(k("Please provide an image in png, jpg or jpeg format"),w(Ie),b(!!i),[2]));case 1:r=a.sent(),a.label=2;case 2:return a.trys.push([2,4,,5]),[4,d(t,r,e)];case 3:return a.sent(),w(Re),b(!0),[3,5];case 4:return n=a.sent(),console.log(n),w(Ie),b(!!i),[3,5];case 5:return[2]}}))}))};switch(x){case ir:N=e.createElement(g,{className:m.dropBox,style:{pointerEvents:"none"}},e.createElement(ee,{className:"".concat(m.dropArrowStyling," ").concat(m.topLeftArrow)}),e.createElement(ee,{className:"".concat(m.dropArrowStyling," ").concat(m.topRightArrow)}),e.createElement(p,{variant:"h5",color:"textSecondary"},"Drop Here"),e.createElement(ee,{className:"".concat(m.dropArrowStyling," ").concat(m.bottomLeftArrow)}),e.createElement(ee,{className:"".concat(m.dropArrowStyling," ").concat(m.bottomRightArrow)}));break;case Te:N=e.createElement(g,{className:m.dropBox},e.createElement(p,{color:"textSecondary"},"Loading..."),e.createElement(f,{className:m.loadingCircle,size:25}));break;default:N=e.createElement("label",{htmlFor:a},e.createElement(F,{className:"".concat(m.buttonColor," ").concat(m.sectionBreak),"aria-label":"upload picture",component:"span",size:"large"},e.createElement(_,{className:m.iconStyling})),e.createElement(p,{variant:"body2",color:"textSecondary"},"Drag and drop or browse to upload your image or logo."))}return e.createElement(g,{className:m.labelBreak,onDragEnter:function(e){B||(e.preventDefault(),e.stopPropagation(),b(!1))},onDragOver:function(e){B||(e.preventDefault(),e.stopPropagation(),b(!1))}},v&&e.createElement(g,{className:m.labelBreak},e.createElement("label",{htmlFor:a},e.createElement(S,{className:"".concat(c?m.roundedAvatarButton:""),"aria-label":"upload picture",component:"span"},c?e.createElement(U,{className:m.roundedAvatar,src:i,alt:s||"Profile Avatar"}):e.createElement("img",{className:m.organisationImage,src:i,alt:s||"Company Logo"})))),e.createElement(g,{className:"".concat(m.greyBox," ").concat(m.widthLimiter," ").concat(m.sectionBreak," ").concat(v?m.hiddenDisplay:""),onDragEnter:function(e){B||(e.preventDefault(),e.stopPropagation(),w(ir))},onDragLeave:function(e){B||(e.preventDefault(),e.stopPropagation(),w(Fe),b(!!i))},onDragOver:function(e){B||(e.preventDefault(),e.stopPropagation(),w(ir))},onDrop:function(e){B||(e.preventDefault(),e.stopPropagation(),R(cr,e))}},e.createElement("input",{id:a,className:m.hiddenInput,type:"file",accept:".png, .jpg, .jpeg",disabled:B,onChange:function(e){return R(lr,e)}}),N),e.createElement(g,{className:m.widthLimiter},e.createElement(ar,{formStatus:x,alertMessage:C||(x===Re?"Uploaded successfully!":"Something went wrong.")})))},sr=u((function(e){var t,r;return{container:(t={minWidth:"4.5rem",height:"100%",background:"linear-gradient(180deg, #B3D6EC 0%, #B3D6EC 40%, #E97FAB 100%)",display:"flex",flexDirection:"column",overflowY:"auto",borderTopRightRadius:"1rem",borderBottomRightRadius:"1rem",border:"solid 2px rgb(188, 172, 242)",borderLeft:"none",boxSize:"border-box"},t[e.breakpoints.down("sm")]={flexDirection:"row",justifyContent:"center",background:"linear-gradient(90deg, #B3D6EC 0%, #B3D6EC 40%, #E97FAB 100%)",borderRadius:0,borderTopLeftRadius:"1rem",borderTopRightRadius:"1rem",width:"100dvw",margin:"auto",border:"solid 2px rgb(188, 172, 242)",borderBottom:"none",overflowY:"hidden",overflowX:"scroll"},t),item:(r={position:"relative",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",textAlign:"center",color:"black",textDecoration:"none",fontSize:"0.725rem",padding:"0.75rem 0.5rem",gap:"0.25rem",backgroundColor:"transparent",transition:"background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)"},"&::after":{content:'" "',position:"absolute",top:"15%",bottom:"15%",right:0,width:3,zIndex:1,transition:"background-color 80ms cubic-bezier(0.4, 0, 0.2, 1) 0ms"}},r[e.breakpoints.down("sm")]={padding:"0.5rem 1.0rem","&::after":{top:0,left:"15%",right:"15%",bottom:"auto",height:4,width:"auto"}},r),itemActive:{"&::after":{backgroundColor:"rgb(188, 172, 242)"}},separateItem:{marginTop:"auto"}}})),ur=function(t){var r=t.tabs,n=sr(),a=q();return e.createElement("div",{className:n.container},r.map((function(t){var r=t.Icon,o=t.field,i=t.path,l=t.separate,c=void 0!==l&&l;return e.createElement(J,{key:i,to:i,className:[n.item,c?n.separateItem:null,a.pathname===i?n.itemActive:null].filter(Boolean).join(" ")},e.createElement(e.Fragment,null,e.createElement(r,null),o))})))},mr=u((function(e){var t;return{tablessGrid:{},grid:function(t){var r,n=t.hideTabs,a=t.leaveHeightForMenu;return n?{}:((r={display:"grid",gridTemplateRows:"auto 1fr",gridTemplateColumns:"auto 1fr",height:a?"calc(100dvh - 4rem)":"100dvh",boxSize:"border-box"})[e.breakpoints.down("sm")]={gridTemplateColumns:"1fr",gridTemplateRows:"1fr auto"},r)},tabs:(t={height:function(e){return e.leaveHeightForMenu?"calc(100dvh - 4rem)":"100dvh"}},t[e.breakpoints.down("sm")]={order:1,height:"max-content !important"},t),content:{padding:"1rem",boxSizing:"border-box",height:"100%",overflowY:"scroll"}}})),pr=function(t){var r=t.tabs,n=t.hideTabs,a=void 0!==n&&n,o=t.leaveHeightForMenu,i=void 0===o||o,l=t.children,c=mr({hideTabs:a,leaveHeightForMenu:i});return e.createElement("div",{className:"".concat(c.grid)},e.createElement("div",{className:c.tabs},e.createElement(ur,{tabs:r})),e.createElement("div",{className:c.content},e.createElement(L,{disableGutters:!0},e.createElement(e.Fragment,null,l))))},gr=function(t){var r=t.styling,n=t.format,a=void 0===n?"dd MMM yyyy":n,o=t.minDate,i=void 0===o?new Date("1856-09-25"):o,l=t.accessLevel,c=t.disabled,d=t.slots,s=be(t,["styling","format","minDate","accessLevel","disabled","slots"]);if(l===We)return null;var u=c;return l===Ae&&(u=!0),e.createElement(fe,ve({className:r||"",closeOnSelect:!0},s,{disabled:u,format:a,minDate:i,slots:ve({textField:Bt},d||{})}))},fr=function(t){var n=t.autoSave;t.onBlur;var a=be(t,["autoSave","onBlur"]),o=r(!1),i=o[0],l=o[1],c=r(Fe),d=c[0],s=c[1];return yt((function(){return ye(void 0,void 0,void 0,(function(){return xe(this,(function(e){switch(e.label){case 0:return s(Te),[4,n(a.value)];case 1:return e.sent(),s(Re),l(!1),[2]}}))}))}),i?1e4:null),e.createElement(e.Fragment,null,e.createElement(Bt,ve({InputProps:{endAdornment:i&&(d===Te?e.createElement(Ue,{text:""}):d===Re?e.createElement(te,{color:"primary"}):null)},onFocus:function(){l(!0)},onBlur:function(){return ye(void 0,void 0,void 0,(function(){return xe(this,(function(e){switch(e.label){case 0:return l(!1),s(Te),n?[4,n(a.value)]:[3,2];case 1:e.sent(),e.label=2;case 2:return s(Re),[2]}}))}))}},a)))},hr=function(t){var r=t.autoSave,n=t.selectOptions,a=be(t,["autoSave","selectOptions"]);return e.createElement(It,ve({selectOptions:n},a,{onChange:function(e){r&&r(e.target.value)}}))};export{ar as Alert,Et as AlphabeticalList,hr as AutoSaveSelectField,fr as AutoSaveTextField,tt as Breadcrumbs,je as Button,Pt as ButtonWithConfirm,Ke as ContentBox,Ge as ContentLabel,Tt as DatePicker,Qt as EditableTable,nt as EntityList,at as ErrorIndicator,Pe as FORM_DELETING,Fe as FORM_ENABLED,Ie as FORM_ERROR,Te as FORM_LOADING,Re as FORM_SUCCESS,Le as FORM_WARNING,dr as ImageDisplayAndUpload,Ft as KeyboardDatePicker,ft as LeftNavigation,Ue as LoadingSpinner,vt as MainLayout,gr as MobileDatePicker,pr as NavbarLayout,Ut as NonEditableField,Nt as NumberFormatField,kt as SearchBar,It as Select,_e as StaticTable,zt as TableDatePicker,Yt as TableMultipleSelect,Vt as TableSelect,Dt as TableTextField,Bt as TextField,dt as didCellValueChange,Kt as tableCheckbox,jt as tableDateField,Ot as tableNumericStringField,Ht as tableNumericStringFixedDecimalField,bt as useDebounceEffect,yt as useInterval,xt as useWhyDidYouUpdate};
2
2
  //# sourceMappingURL=index.js.map