@pautena/react-design-system 0.14.7 → 0.14.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import n,{alertClasses as i}from"@mui/material/Alert";import o from"@mui/material/Box";import a from"@mui/material/Collapse";import l,{iconButtonClasses as c}from"@mui/material/IconButton";import s from"@mui/material/AlertTitle";import d from"@mui/icons-material/ExpandMore";import u from"@mui/icons-material/ExpandLess";import p from"@mui/icons-material/Close";import*as m from"react";import{forwardRef as f,useState as h,createContext as y,useContext as g,useRef as b,useEffect as v,createElement as x,useId as C,useMemo as S}from"react";import w,{paperClasses as $}from"@mui/material/Paper";import T from"@mui/material/Tooltip";import k from"@mui/material/Typography";import{useTheme as E,styled as I}from"@mui/material/styles";import{blueGrey as P,grey as O}from"@mui/material/colors";import z from"@mui/material/Link";import R from"markdown-to-jsx";import A from"@mui/icons-material/ContentCopy";import j from"@mui/material/Container";import W from"@mui/material/Grid";import D from"@mui/material/List";import M from"@mui/material/ListItemButton";import N from"@mui/material/ListItemText";import{useTheme as V}from"@mui/material";import{Link as B,useLocation as L,matchPath as F,useNavigate as _,useParams as q,Routes as H,Route as U}from"react-router-dom";import Y from"@mui/material/Badge";import J from"@mui/material/Breadcrumbs";import X from"@mui/material/Tabs";import G from"@mui/material/Tab";import K from"@mui/material/Button";import Q,{circularProgressClasses as Z}from"@mui/material/CircularProgress";import ee from"@mui/material/Dialog";import te from"@mui/material/DialogTitle";import re from"@mui/material/DialogActions";import ne from"@mui/material/DialogContent";import ie from"@mui/lab/LoadingButton";import oe from"@mui/material/TextField";import ae,{drawerClasses as le}from"@mui/material/Drawer";import ce from"@mui/material/Divider";import se from"@mui/icons-material/ChevronLeft";import de from"@mui/material/ListSubheader";import ue from"@mui/material/ListItemIcon";import pe from"@mui/material/Popover";import me from"@mui/icons-material/ChevronRight";import fe from"@mui/material/Avatar";import he from"@mui/material/ListItemAvatar";import ye from"@mui/material/AppBar";import ge from"@mui/material/Toolbar";import be from"@mui/icons-material/Menu";import ve,{linearProgressClasses as xe}from"@mui/material/LinearProgress";import Ce from"@mui/material/FormControl";import Se,{inputLabelClasses as we}from"@mui/material/InputLabel";import $e from"@mui/material/Select";import Te from"@mui/material/Stack";import ke,{autocompleteClasses as Ee}from"@mui/material/Autocomplete";import Ie from"@mui/material/FormHelperText";import Pe,{outlinedInputClasses as Oe}from"@mui/material/OutlinedInput";import ze from"@mui/material/InputAdornment";import{isAfter as Re,isSameDay as Ae,startOfWeek as je,endOfWeek as We,format as De}from"date-fns";import Me from"@mui/icons-material/Event";import{DateCalendar as Ne,PickersDay as Ve,DesktopDatePicker as Be,TimePicker as Le,DateTimePicker as Fe}from"@mui/x-date-pickers";import{isBefore as _e}from"date-fns/esm";import qe from"@mui/material/DialogContentText";import He from"@mui/material/Skeleton";import{loremIpsum as Ue}from"lorem-ipsum";import Ye from"@mui/material/TableContainer";import Je from"@mui/material/TableBody";import Xe from"@mui/material/Table";import Ge from"@mui/material/TableCell";import Ke from"@mui/material/TableRow";import Qe from"@mui/icons-material/Search";import Ze from"@mui/material/TableSortLabel";import et from"@mui/material/TableHead";import tt from"@mui/icons-material/Check";import rt from"@mui/icons-material/Clear";import nt from"@mui/icons-material/Edit";import it from"@mui/material/Switch";import{DatePicker as ot}from"@mui/x-date-pickers/DatePicker";import{DateTimePicker as at}from"@mui/x-date-pickers/DateTimePicker";import{TimePicker as lt}from"@mui/x-date-pickers/TimePicker";import ct from"@mui/material/Rating";import st from"@mui/icons-material/ReportProblem";import dt from"@mui/material/Snackbar";import{DataGrid as ut}from"@mui/x-data-grid";import pt from"@mui/material/FormControlLabel";import mt from"@mui/material/Checkbox";import ft from"@mui/material/MenuItem";import ht from"@mui/material/Menu";import yt from"@mui/icons-material/MoreVert";const gt={overrides:{h1:{component:k,props:{gutterBottom:!0,variant:"h5"}},h2:{component:k,props:{gutterBottom:!0,variant:"h6"}},h3:{component:k,props:{gutterBottom:!0,variant:"subtitle1"}},h4:{component:k,props:{gutterBottom:!0,variant:"caption",paragraph:!0}},p:{component:k,props:{paragraph:!0}},a:{component:z},li:{component:"li"}}},bt=({content:t,options:r=gt})=>e(R,{options:r,children:t}),vt=({markdown:r,content:n,spacing:i=0,children:a,sx:c})=>{const{spacing:s,typography:d}=E();let u,p;r?u=r||"":Array.isArray(n)?(p=n.map(((t,r)=>e(k,{sx:{pb:i},children:t},r))),u=n.join("\n")):(p=e(k,{children:n}),u=n||"");const m=r&&e(bt,{content:r});return e(w,{sx:{position:"relative",pl:2,pr:4,py:1,backgroundColor:P[800],color:"white",...c},children:t(o,{display:"flex",flexDirection:"row",children:[e(o,{width:1,children:a||m||p}),e(o,{sx:{position:"absolute",top:s(.5),right:s(.5)},children:u&&e(l,{"aria-label":"copy board content",color:"inherit",onClick:()=>navigator.clipboard.writeText(u),children:e(T,{title:"Copy",children:e(A,{sx:{fontSize:d.pxToRem(18)}})})})})]})})},xt={[`& .${i.message}`]:{width:1}},Ct=f((({severity:r,iconMapping:i,title:c,message:m,metadata:f,metadataComponent:y,onClose:g,sx:b={}},v)=>{const[x,C]=h(!1);return e(n,{ref:v,severity:r,iconMapping:i,onClose:g,action:t(o,{display:"flex",flexDirection:"column",children:[e(l,{color:"inherit",onClick:g,children:e(p,{fontSize:"small"})}),f&&e(l,{color:"inherit",onClick:()=>C((e=>!e)),children:e(x?u:d,{fontSize:"small"})})]}),sx:{...xt,...b},children:t(o,{sx:{w:1},children:[c&&e(s,{children:c}),m,f&&e(a,{in:x,sx:{mt:2},children:e(vt,{content:f,children:y})})]})})})),St=({children:t})=>e(j,{component:"main",sx:{py:3,flexGrow:1},children:t});function wt({children:t,centerVertical:r=!0,centerHorizontal:n=!0,sx:i}){return e(o,{width:1,height:1,sx:{...i,display:"flex",flexDirection:"column",justifyContent:r?"center":"flex-start",alignItems:n?"center":"flex-start"},children:t})}const $t=(e,t)=>new Array(e).fill(t),Tt=e=>{const t=Math.floor(Math.random()*e.length);return{index:t,item:e[t]}},kt=({lightWeight:e=100,darkWeight:t=900}={})=>{const{palette:r}=V();return"light"===r.mode?r.grey[e]:r.grey[t]},Et=(e=12)=>{const t=(t,r,n)=>{const i=t[r];return t[r]+=n,t[r]>e?(t[r]=n,!1):(t[r]==e&&(t[r]=0),i>0)};return{xs:0,sm:0,md:0,lg:0,xl:0,increment:function({xs:e=0,sm:r=0,md:n=0,lg:i=0,xl:o=0}){const a=r||e,l=n||a,c=i||l,s=o||c;return{xs:t(this,"xs",e),sm:t(this,"sm",a),md:t(this,"md",l),lg:t(this,"lg",c),xl:t(this,"xl",s)}}}},It=e=>{const t=new FormData(e.currentTarget),r={};return t.forEach(((e,t)=>{r[t]=e})),r},Pt=y(void 0),Ot=Pt.Provider,zt=()=>g(Pt),Rt=f(((t,r)=>{const{href:n,...i}=t;return e(B,{ref:r,to:n,...i})})),At=f(((t,r)=>e(z,{...t,component:Rt}))),jt=(e,t,{from:r,to:n})=>{const i=b(),o=_();v((()=>{i.current===r&&t===n&&o(e),i.current=t}),[t])},Wt=e=>{const{pathname:t}=L();for(let r=0;r<e.length;r+=1){const n=e[r],i=F(n,t);if(null!==i)return i}return null},Dt=({items:r,defaultSelectedItem:n,colBreakpoint:i=3,listMode:o="panel",children:a,onSelectedItemChange:l=(()=>null)})=>{const c=r.map((e=>e.path)).filter(Boolean),s=Wt(c),d=kt(),{palette:u,typography:p}=V(),[m,f]=h(n);return e(Ot,{value:m,children:t(W,{container:!0,bgcolor:d,height:1,children:[e(W,{item:!0,xs:i,pl:1,height:1,children:e(D,{sx:{height:1,overflowY:"auto"},children:r.map((({id:t,text:r,tooltip:n,path:i,href:a})=>{const c="panel"===o?t===m:s?.pattern?.path===i,d=x(M,{..."navigation"===o?{component:At,href:a}:{},key:t,dense:!0,selected:c,onClick:()=>(e=>{f(e),l(e)})(t),"aria-label":r,sx:{backgroundColor:c?`${u.grey[300]} !important`:void 0}},e(N,{primary:r,primaryTypographyProps:{fontWeight:c?p.fontWeightMedium:void 0,color:c?p.body1.color:O[600]}}));return n?e(T,{title:n,enterDelay:1500,placement:"right",children:d},t):d}))})}),e(W,{item:!0,xs:12-i,pl:1,py:1,pr:1,children:e(w,{elevation:0,sx:{width:1,height:1,backgroundColor:u.background.paper},children:a})})]})})},Mt={root:"RdsBullet-root"},Nt=({variant:t="primary",sx:r})=>e(Y,{color:t,variant:"dot",className:Mt.root,role:"bullet","aria-describedby":t,sx:r}),Vt={root:"RdsLabel-root"},Bt=({text:t,variant:r="default",textTransform:n="capitalize",sx:i})=>{const{palette:a,typography:l}=E(),c={default:"light"===a.mode?a.grey[100]:a.grey[900],primary:a.primary.light,secondary:a.secondary.light,info:a.info.light,warning:a.warning.light,error:a.error.light,success:a.success.light},s={default:a.getContrastText(c.default),primary:a.primary.contrastText,secondary:a.secondary.contrastText,info:a.info.contrastText,warning:a.warning.contrastText,error:a.error.contrastText,success:a.success.contrastText};return e(o,{height:24,minWidth:22,display:"inline-flex",justifyContent:"center",alignItems:"center",bgcolor:c[r],color:s[r],fontSize:l.caption.fontSize,fontWeight:l.fontWeightBold,lineHeight:0,textTransform:n,whiteSpace:"nowrap",borderRadius:2,role:"label","aria-label":`${t} ${r} label`,py:0,px:1,sx:{cursor:"default",...i},children:t})},Lt=y([0,()=>null]),Ft=Lt.Provider,_t=()=>g(Lt),qt=({children:t,initialValue:r=0})=>{const n=h(r);return e(Ft,{value:n,children:t})},Ht=({loading:t,children:n})=>{const{typography:i}=E();return t?e(Q,{color:"inherit",size:i.h4.fontSize,"aria-label":"title loading"}):"string"==typeof n?e(k,{variant:"h4",role:"heading","aria-level":1,children:n}):e(r,{children:n})},Ut=({loading:t,children:n})=>{const{typography:i}=E();return t?e(Q,{color:"inherit",size:i.body1.fontSize,"aria-label":"subtitle loading"}):"string"==typeof n?e(k,{variant:"body1",role:"heading","aria-level":2,children:n}):e(r,{children:n})},Yt=({title:r="",loadingTitle:n,subtitle:i,loadingSubtitle:a,preset:l="default",actionsVariant:c="outlined",breadcrumbs:s,actions:d,tabs:u,tabsMode:p="panel",navigationButton:m})=>{const f=(u||[]).map((e=>e.path)).filter(Boolean),{palette:h}=E(),y=kt(),[g,b]=_t(),v=Wt(f),x={default:y,primary:h.primary.main,secondary:h.secondary.main,inherit:"inherit",transparent:"transparent"},C=x[l],S={default:h.getContrastText(x.default),primary:h.primary.contrastText,secondary:h.secondary.contrastText,inherit:"inherit",transparent:h.text.primary}[l],w="panel"===p?g:v?.pattern?.path;return e(o,{bgcolor:C,color:S,children:t(j,{children:[t(o,{sx:{py:3,display:"flex",flexDirection:"row",justifyContent:"space-between"},children:[t(o,{children:[m&&e(K,{href:m.href,size:"small",color:"inherit",LinkComponent:At,startIcon:m.icon,sx:{mb:1},children:m.text}),s?.length&&e(J,{color:"inherit",separator:"›","aria-label":"breadcrumb",sx:{marginTop:1},children:s.map((({id:t,link:r,text:n})=>e(At,{underline:"hover",color:"inherit",href:r,variant:"body2",role:"link",children:n},t)))}),e(Ht,{loading:n,children:r}),(i||a)&&e(Ut,{loading:a,children:i})]}),d&&e(o,{children:d.map((({disabled:t,id:r,href:n,onClick:i,text:o},a)=>e(K,{component:n?At:"button",role:"button",color:"inherit",disabled:t,variant:c,size:"small",href:n,onClick:i,sx:{mr:a!=d.length-1?1:0},children:o},r)))})]}),u&&e(X,{value:w,textColor:"inherit",onChange:"panel"===p?(e,t)=>b(t):void 0,children:u.map((({id:t,label:r,disabled:n,path:i,href:o})=>{const a={label:r,disabled:n};return e(G,"panel"===p?{...a}:{...a,component:At,href:o,value:i},t)}))})]})})},Jt=({open:r,title:n,component:i,componentProps:a={},disabled:c,disableAccept:s,disableCancel:d,actions:u=[],children:m,loading:f,cancelable:h,callCloseWhenCancel:y=!0,acceptable:g,acceptText:b="Accept",cancelText:v="Cancel",onAccept:x,onCancel:C=(()=>null),onClose:S,acceptType:w="button"})=>{const $=u.length>0||g||h;return t(ee,{open:r,onClose:S,children:[t(te,{sx:{display:"flex",alignItems:"center"},children:[n,f&&!g&&e(Q,{size:20,sx:{ml:2,color:e=>e.palette.grey[500]}}),e(l,{disabled:c,"aria-label":"close",onClick:S,sx:{position:"absolute",right:8,top:8,color:e=>e.palette.grey[500]},children:e(p,{})})]}),t(o,{component:i,...a,children:[e(ne,{dividers:!0,children:m}),$&&t(re,{children:[u.map((({id:t,text:r,type:n="button",onClick:i,color:o="primary"})=>e(K,{type:n,disabled:c,onClick:i,color:o,children:r},t))),h&&e(K,{color:"error",disabled:c||d,onClick:()=>{C(),y&&S()},children:v}),g&&e(ie,{type:w,loading:f,disabled:c||s,onClick:x,children:b})]})]})]})},Xt=({open:r,title:n,loading:i,disabled:o,confirmText:a="Confirm",cancelText:l="Cancel",passphrase:c,children:s,onConfirm:d,onCancel:u})=>{const[p,m]=h("");return t(Jt,{title:n,loading:i,disabled:i||o,disableAccept:!(!c||p===c),open:r,onClose:u,acceptable:!0,cancelable:!0,callCloseWhenCancel:!1,acceptText:a,cancelText:l,onCancel:u,onAccept:d,children:[s,c&&e(oe,{size:"small",fullWidth:!0,value:p,onChange:e=>m(e.target.value),placeholder:c})]})},Gt=({open:t,title:r,loading:n,disabled:i,submitText:o="Submit",cancelText:a="Cancel",children:l,onSubmit:c,onCancel:s})=>e(Jt,{component:"form",componentProps:{onSubmit:e=>{e.preventDefault(),c(It(e))}},title:r,loading:n,disabled:n||i,open:t,onClose:s,callCloseWhenCancel:!1,cancelable:!0,acceptable:!0,cancelText:a,onCancel:s,acceptText:o,acceptType:"submit",children:l}),Kt=(e=!1)=>{const[t,r]=h(e);return{isOpen:t,open:()=>r(!0),close:()=>r(!1),setIsOpen:r}},Qt=y(void 0),Zt=new Error("DrawerContext.Provider is required and was undefined"),er=()=>{const e=g(Qt);if(void 0===e)throw Zt;return e},tr=e=>({width:240,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:"hidden"}),rr=e=>({transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),overflowX:"hidden",width:`calc(${e.spacing(7)} + 1px)`,[e.breakpoints.up("sm")]:{width:`calc(${e.spacing(8)} + 1px)`}}),nr=I("div")((({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-end",padding:e.spacing(0,1),...e.mixins.toolbar}))),ir={temporary:!0,mini:!0,persistent:!0,clipped:!1},or={temporary:"temporary",mini:"permanent",clipped:"permanent",persistent:"persistent"},ar=()=>({}),lr={mini:(e,t)=>({boxSizing:"border-box",[`& .${$.root}`]:{zIndex:t.zIndex.drawer-1}}),temporary:ar,clipped:ar,persistent:ar},cr=({children:r,...n})=>{const i=E(),{state:o,switchState:a,underAppBar:c,close:s,drawerWidth:d,variant:u}=er(),p={width:d,flexShrink:0,whiteSpace:"nowrap",..."open"===o&&{...tr(i),[`& .${le.paper}`]:tr(i)},..."open"!==o&&{...rr(i),[`& .${le.paper}`]:rr(i)},...lr[u](o,i)};return t(ae,{open:"open"===o,variant:or[u],role:"menu","aria-hidden":"close"===o,onClose:s,sx:p,...n,children:[e(nr,{children:!c&&ir[u]&&e(l,{onClick:a,children:e(se,{})})}),e(ce,{}),r]})},sr={temporary:"close",mini:"collapse",clipped:"open",persistent:"close"},dr={temporary:["close","open"],mini:["collapse","open"],clipped:["open","open"],persistent:["close","open"]},ur=({children:t,initialState:r,variant:n="temporary",drawerWidth:i=240,underAppBar:o=!1,selectedItemId:a,onStateChange:l=(()=>null)})=>{const[c,s]=h(r||sr[n]),d=e=>{l(e),s(e)};return e(Qt.Provider,{value:{state:c,variant:n,selectedItemId:a,underAppBar:o,drawerWidth:i,switchState:()=>d(dr[n]["open"===c?0:1]),collapse:()=>d("collapse"),close:()=>d("close"),open:()=>d("open"),setState:s},children:t})},pr=I(de,{shouldForwardProp:e=>"size"!==e})((({size:e,theme:t})=>({lineHeight:"small"===e?t.typography.pxToRem(40):void 0}))),mr=(e,t)=>({color:t?e.palette.primary.main:void 0,fontWeight:t?e.typography.fontWeightBold:e.typography.fontWeightMedium}),fr=I(At)((({theme:e})=>({color:e.palette.text.primary}))),hr={minWidth:0,justifyContent:"center",marginRight:"auto"},yr=({text:r,icon:n,avatar:i,label:o,bullet:a,href:l,selected:c,size:s="medium",level:d,sx:u})=>{const{state:p}=er(),m=E(),{color:f,fontWeight:h}=mr(m,c);return t(M,{LinkComponent:fr,dense:"small"===s,"aria-label":r,href:l,selected:c,sx:{...u,pl:"open"===p?m.spacing(2+1.5*d):void 0,..."collapse"===p&&{paddingHorizontal:m.spacing(2.5),justifyContent:"center"}},children:[n&&e(ue,{sx:{color:f,..."collapse"===p&&0===d&&hr},children:n}),i&&e(he,{sx:{..."collapse"===p&&0===d&&hr},children:e(fe,{alt:i.alt,src:i.src,sx:{..."small"===s&&{width:24,height:24},..."collapse"===p&&{width:30,height:30}}})}),e(N,{disableTypography:!0,primary:r,sx:{color:f,fontWeight:h,opacity:"collapse"===p&&0===d?0:void 0}}),o&&"open"===p&&e(Bt,{text:o.text,variant:o.variant,sx:{ml:2}}),a&&"open"===p&&e(Nt,{variant:a.variant,sx:{ml:2}})]})},gr=({item:t,size:r="medium",level:n=0})=>{const{selectedItemId:i}=er();if("items"in t){const{id:o,text:a,icon:l,items:c}=t,s=c.some((e=>e.id===i));return e(br,{size:r,selected:o===i||s,text:a,icon:l,items:c,level:n})}{const{id:o,text:a,icon:l,avatar:c,label:s,bullet:d,href:u}=t;return e(yr,{selected:o===i,size:r,text:a,icon:l,avatar:c,label:s,bullet:d,href:u,level:n})}},br=({text:n,icon:i,selected:o,items:l,size:c="medium",level:s,sx:u={}})=>{const{state:p}=er(),m=b(null),{palette:f,spacing:y}=E(),[g,v]=h(!1),{color:x,fontWeight:C}=mr(E(),o),S=e(D,{component:"div",disablePadding:!0,children:l.map((t=>e(gr,{level:s+1,item:t,size:c},t.id)))}),w="collapse"===p&&0===s?{position:"absolute",right:0}:{};return t(r,{children:[t(M,{ref:m,selected:o,"aria-label":n,onClick:()=>v((e=>!e)),dense:"small"===c,sx:{...u,pl:"open"===p?y(2+1.5*s):void 0,backgroundColor:g?f.action.hover:void 0},children:[i&&e(ue,{sx:{color:x},children:i}),e(N,{disableTypography:!0,primary:n,sx:{color:x,fontWeight:C,opacity:"collapse"===p&&0===s?0:void 0}}),e(g&&"open"===p?d:me,{sx:[{color:x,ml:2},w]})]}),"open"===p?e(a,{in:g,timeout:"auto",unmountOnExit:!0,"aria-label":`${n} collapse submenu`,children:S}):e(pe,{open:g,PaperProps:{elevation:0,variant:"outlined"},"aria-label":`${n} popover submenu`,anchorEl:m.current,onClose:()=>v(!1),anchorOrigin:{vertical:"top",horizontal:"right"},children:S})]})},vr=({title:n,items:i,size:o="medium"})=>{const{state:a}=er(),{spacing:l}=E();return t(r,{children:[n&&"open"===a&&e(pr,{size:o,role:"heading",children:n}),e(D,{sx:{paddingTop:"small"===o?l(0):void 0,paddingY:"collapse"===a?0:void 0},children:i.map((t=>e(gr,{item:t,size:o},t.id)))})]})},xr=({nav:{items:t},size:n="medium"})=>e(r,{children:t.map((({title:t,items:r},i)=>e(vr,{title:t,items:r,size:n},i)))}),Cr={temporary:!1,mini:!0,persistent:!0,clipped:!0},Sr={temporary:()=>!0,mini:e=>"open"!==e,persistent:()=>!0,clipped:()=>!1},wr=({title:r,sx:n,children:i,...o})=>{const a=E(),{state:c,variant:s,switchState:d,drawerWidth:u,underAppBar:p}=er(),m=Cr[s]&&!p&&{transition:a.transitions.create(["width","margin"],{easing:a.transitions.easing.sharp,duration:a.transitions.duration.leavingScreen}),..."open"===c&&{marginLeft:u,width:`calc(100% - ${u}px)`,transition:a.transitions.create(["width","margin"],{easing:a.transitions.easing.sharp,duration:a.transitions.duration.enteringScreen})}}||{};return e(ye,{position:p?"fixed":void 0,...o,sx:{...n,...m,zIndex:e=>e.zIndex.drawer+(p?1:0)},children:t(ge,{children:[e(l,{color:"inherit","aria-label":"open drawer",onClick:d,edge:"start",sx:{marginRight:5,display:Sr[s](c)?void 0:"none"},children:e(be,{})}),r&&e(k,{variant:"h6",component:"h1",role:"heading","aria-level":1,noWrap:!0,children:r}),i]})})},$r={temporary:!1,mini:!0,clipped:!0,persistent:!0},Tr=I("div")((({theme:e})=>{const{spacing:t}=E(),{drawerWidth:r,state:n,variant:i}=er();return{marginLeft:$r[i]?"open"===n?r:"collapse"===n?t(8):0:0,transition:e.transitions.create("margin",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen})}})),kr=({children:r})=>t(Tr,{children:[e(nr,{}),r]}),Er=()=>e(o,{width:1,height:1,display:"flex",justifyContent:"center",alignItems:"center",children:e(Q,{})});function Ir({fetching:r=!1,loading:i=!1,error:a,success:l,children:c}){const d=Array.isArray(r)?r.some((e=>e)):r;return(Array.isArray(i)?i.some((e=>e)):i)?e(Er,{}):a?t(n,{severity:"error",role:"alert","aria-describedby":"error",children:[a.name&&e(s,{role:"heading",children:a.name}),a.message]}):t(o,{children:[l&&t(n,{severity:"success",role:"alert","aria-describedby":"success",sx:{mb:2},children:[l.name&&e(s,{role:"heading",children:l.name}),l.message]}),d&&e(ve,{sx:{width:1,mb:1}}),c]})}const Pr={small:15,medium:20},Or=({label:r,value:n,loading:i=!1,fetching:a=!1,size:l="medium",fullWidth:c=!1,color:s,children:d,onChange:u})=>{const p=C(),m=I(Ce)((()=>s?{label:{color:s},".MuiOutlinedInput-notchedOutline":{borderColor:`${s} !important`},".MuiInputBase-root":{color:s},".MuiSelect-icon":{fill:s}}:{}));return t(m,{fullWidth:c,children:[e(Se,{id:p,children:r}),e($e,{labelId:p,id:p,value:n,label:r,onChange:u,disabled:a,size:l,renderValue:r=>a?e(wt,{centerVertical:!0,centerHorizontal:!0,children:e(Q,{color:"inherit",size:Pr[l]})}):i?t(o,{display:"flex",flexDirection:"column",children:[r,e(ve,{color:"inherit",sx:{position:"absolute",left:0,right:0,bottom:0}})]}):r,children:d})]})},zr=({title:i,subtitle:a,loading:l,error:c,onSubmitSignIn:s})=>{const[d,u]=h(""),[p,m]=h("");return t(r,{children:[t(o,{marginBottom:2,children:[e(k,{component:"h1",variant:"h4",children:i}),e(k,{variant:"body1",children:a})]}),t(o,{component:"form",onSubmit:function(e){e.preventDefault(),u(""),m("");const t=new FormData(e.currentTarget),r=t.get("email")?.toString(),n=t.get("password")?.toString();r||u("Please fill out this field"),n||m("Please fill out this field"),r&&n&&s(r,n)},children:[c&&e(Te,{width:"100%",marginTop:1,children:e(n,{variant:"filled",severity:"error",children:c.message})}),e(oe,{margin:"normal",fullWidth:!0,id:"email",label:"Email Address",name:"email",autoComplete:"email",autoFocus:!0,disabled:l,type:"email",inputProps:{role:"input"},error:!!d,helperText:d}),e(oe,{margin:"normal",fullWidth:!0,role:"input",name:"password",label:"Password",type:"password",id:"password",disabled:l,autoComplete:"current-password",inputProps:{role:"input"},error:!!p,helperText:p}),e(ie,{type:"submit",fullWidth:!0,variant:"contained",loading:l,disabled:l,role:"button",sx:{mt:2},children:"Sign In"})]})]})};let Rr=0;const Ar=m["useId".toString()];function jr(e){if(void 0!==Ar){const t=Ar();return null!=e?e:t}return function(e){const[t,r]=m.useState(e),n=e||t;return m.useEffect((()=>{null==t&&(Rr+=1,r(`mui-${Rr}`))}),[t]),n}(e)}const Wr=({id:r,label:n,InputLabelProps:i,InputProps:o,fetching:a,loading:l,helperText:s,hexColor:d,size:u,fullWidth:p,sx:m,...f})=>{const h=jr(r),y=s&&h?`${h}-helper-text`:void 0,g=n&&h?`${h}-label`:void 0,b=d?{[`& .${Oe.notchedOutline}`]:{borderColor:`${d} !important`},[`& .${we.root}`]:{color:d},[`& .${Oe.input}`]:{color:d},[`& .${Z.root}`]:{color:d},[`& .${xe.bar}`]:{backgroundColor:d},[`& .${Ee.endAdornment} .${c.root}`]:{color:d}}:{};return t(Ce,{sx:b,fullWidth:p,children:[e(Se,{size:"small"===u?"small":"normal",id:g,htmlFor:h,...i,children:n}),e(Pe,{...o,id:h,label:n,size:u,fullWidth:p,endAdornment:t(ze,{position:"end",children:[o?.endAdornment,l?e(Q,{color:"inherit",size:20,sx:{ml:1}}):null]}),sx:m,...f}),a&&!l&&e(ve,{color:"inherit",sx:{position:"absolute",left:0,right:0,bottom:0}}),s&&e(Ie,{id:y,children:s})]})},Dr=t=>{const{label:r,loading:n,fetching:i,options:o,helperText:a,color:l,onChangeValue:c=(()=>null),sx:s,...d}=t;return e(ke,{loading:n||i,options:i?[]:o,onChange:(e,t)=>c(t),...d,renderInput:t=>e(Wr,{...t,label:r,fullWidth:!0,fetching:i,loading:n,hexColor:l,helperText:a}),sx:s})},Mr=I(o,{shouldForwardProp:e=>"dayIsBetween"!==e&&"isFirstDay"!==e&&"isLastDay"!==e&&"isStartOfWeek"!==e&&"isEndOfWeek"!==e})((({theme:e,dayIsBetween:t,isFirstDay:r,isLastDay:n})=>({...(r||n||t)&&{borderRadius:0,backgroundColor:`${e.palette.primary.light}40`,margin:0},...r&&{borderTopLeftRadius:"50%",borderBottomLeftRadius:"50%"},...n&&{borderTopRightRadius:"50%",borderBottomRightRadius:"50%"}}))),Nr=t=>{const{day:r,dateRange:n,...i}=t;if(null==n)return e(Ve,{day:r,...i});const[o,a]=n,l=!!a&&Re(r,o)&&_e(r,a),c=Ae(r,o),s=!!a&&Ae(r,a),d=Ae(r,je(r)),u=Ae(r,We(r));return e(Mr,{dayIsBetween:l,isFirstDay:c||l&&d,isLastDay:s||l&&u,"aria-label":De(r,"yyyy-MM-dd"),"aria-selected":l||c||s,role:"gridcell",children:e(Ve,{...i,day:r,selected:c||s})})},Vr=({defaultValue:t,onValueChange:r})=>{const[n,i]=h(t),[o,a]=h(0),l=(e,t,n)=>{i(e),r(e,t),a(n)};return e(Ne,{value:null,onChange:e=>{if(e)return 1===o&&e<n[0]||0===o&&n[1]&&e>n[1]?l([e,void 0],0,1):void l([0===o?e:n[0],1===o?e:n[1]],o,0===o?1:0)},slots:{day:Nr},slotProps:{day:{dateRange:n}},"aria-label":"calendar range picker"})},Br=({defaultValue:n,format:i,label:o,fullWidth:c,onValueChange:s,size:d="medium"})=>{const[u,p]=h(!1),[m,f]=h(n);return t(r,{children:[e(oe,{label:o,fullWidth:c,size:d,value:`${De(m[0],i)} - ${m[1]?De(m[1],i):i.toUpperCase()}`,InputProps:{endAdornment:e(ze,{position:"end",children:e(l,{onClick:()=>p((e=>!e)),"aria-label":"open calendar",children:e(Me,{})})})}}),e(w,{children:e(a,{in:u,"aria-label":"calendar collapse",children:e(Vr,{defaultValue:n,onValueChange:(e,t)=>{f(e),s(e,t),p(t<1)}})})})]})},Lr=({title:t,titleVariant:r="h4",variant:n="primary"})=>{const{palette:i}=E(),o={primary:void 0,error:"error",warning:i.warning.main,success:i.success.main};return e(k,{color:o[n],variant:r,pb:1,borderBottom:1,borderColor:"grey.300",children:t})},Fr=({variant:n="primary",title:i,titleVariant:o="h4",description:a,descriptionVariant:l="body2",buttonText:c,helperText:s,helperTextVariant:d="caption",confirmable:u,passphrase:p,confirmTitle:m="",confirmDescription:f="",onAction:h})=>{const{isOpen:y,open:g,close:b}=Kt();return t(r,{children:[t(W,{container:!0,spacing:1,children:[e(W,{item:!0,xs:12,mb:2,children:e(Lr,{title:i,titleVariant:o})}),a&&e(W,{item:!0,xs:12,children:e(k,{variant:l,children:a})}),e(W,{item:!0,xs:12,mt:1,children:e(K,{color:n,variant:"contained",onClick:()=>{u?g():h()},children:c})}),s&&e(W,{item:!0,xs:12,children:e(k,{variant:d,children:s})})]}),e(Xt,{open:y,title:m,passphrase:p,onCancel:b,onConfirm:()=>{h()},children:e(qe,{children:f})})]})},_r=y([0,()=>null]),qr=_r.Provider,Hr=I((t=>e(X,{...t,TabIndicatorProps:{children:e("span",{className:"MuiTabs-indicatorSpan"})}})))((({theme:e})=>({minHeight:e.spacing(5),"& .MuiTabs-indicator":{display:"flex",justifyContent:"center",backgroundColor:"transparent"},"& .MuiTabs-indicatorSpan":{maxWidth:40,width:"100%",backgroundColor:e.palette.primary.main}}))),Ur=I(G)((({theme:e})=>({textTransform:"none",fontWeight:e.typography.fontWeightRegular,marginRight:e.spacing(1),color:e.palette.text.secondary,paddingTop:0,paddingBottom:0,minHeight:e.spacing(5),"&.Mui-selected":{color:e.palette.text.secondary,fontWeight:e.typography.fontWeightBold}}))),Yr=({children:r,tabs:n,initialTab:i=0,onChangeTab:a=(()=>null)})=>{const l=kt(),[c,s]=h(i);return e(qr,{value:[c,s],children:t(w,{variant:"outlined",children:[e(o,{bgcolor:l,children:e(Hr,{value:c,onChange:(e,t)=>{s(t),a(n[t],t)},children:n.map((({text:t,icon:r})=>e(Ur,{iconPosition:"start",disableRipple:!0,label:t,icon:r},t)))})}),r]})})},Jr=({index:t,children:r,sx:n})=>{const[i]=g(_r);let a=i===t;return Array.isArray(t)&&(a=t.includes(i)),a?e(o,{sx:n,children:r}):null};function Xr({children:t,index:r}){const[n]=_t();let i=n===r;return Array.isArray(r)&&(i=r.includes(n)),e("div",{role:"tabpanel",hidden:!i,id:`simple-tabpanel-${r}`,"aria-labelledby":`simple-tab-${r}`,children:i&&e(o,{sx:{p:3},children:t})})}const Gr=({title:r,subtitle:n,icon:i,iconSize:a=200,actions:l})=>t(o,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",textAlign:"center",children:[i&&i({size:a,color:"primary"}),e(k,{variant:"h4",role:"heading","aria-level":1,children:r}),e(k,{variant:"subtitle1",role:"heading","aria-level":2,sx:{mt:2},children:n}),l&&e(o,{sx:{pt:2},children:l.map((({id:t,text:r,href:n,onClick:i},o)=>e(K,{role:"button",variant:"contained",href:n,onClick:i,sx:{mr:o<l.length-1?2:0},children:r},t)))})]}),Kr=({width:r="100%",animation:n=!1})=>t(o,{width:r,children:[e(He,{animation:n,variant:"rectangular",height:118}),e(He,{animation:n,variant:"rectangular",height:16,sx:{my:1}}),e(He,{animation:n,variant:"rectangular",width:"80%",height:16})]}),Qr=({size:t=20})=>e(W,{container:!0,spacing:2,children:$t(t,0).map(((t,r)=>e(W,{item:!0,xs:4,children:e(Kr,{width:1})},r)))}),Zr=({size:r=20,children:n,p:i})=>t(j,{component:"main",sx:{p:i},"data-testid":"content-placeholder-test",children:[n,e(Qr,{size:r})]}),en=({count:t=3,units:r="paragraph",variant:n="body1"})=>e(k,{variant:n,children:Ue({count:t,units:r})});function tn(e,t){return"production"===process.env.NODE_ENV?()=>null:function(...r){return e(...r)||t(...r)}}var rn,nn={exports:{}},on={exports:{}},an={};var ln,cn,sn,dn,un,pn,mn,fn,hn,yn,gn,bn,vn,xn,Cn={};
1
+ import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import n,{alertClasses as i}from"@mui/material/Alert";import o from"@mui/material/Box";import a from"@mui/material/Collapse";import l,{iconButtonClasses as c}from"@mui/material/IconButton";import s from"@mui/material/AlertTitle";import d from"@mui/icons-material/ExpandMore";import u from"@mui/icons-material/ExpandLess";import p from"@mui/icons-material/Close";import*as m from"react";import{forwardRef as f,useState as h,createContext as y,useContext as g,useRef as b,useEffect as v,createElement as x,useId as C,useMemo as S}from"react";import w,{paperClasses as $}from"@mui/material/Paper";import T from"@mui/material/Tooltip";import k from"@mui/material/Typography";import{useTheme as E,styled as I}from"@mui/material/styles";import{blueGrey as P,grey as O}from"@mui/material/colors";import z from"@mui/material/Link";import R from"markdown-to-jsx";import A from"@mui/icons-material/ContentCopy";import j from"@mui/material/Container";import W from"@mui/material/Grid";import D from"@mui/material/List";import M from"@mui/material/ListItemButton";import N from"@mui/material/ListItemText";import{useTheme as V}from"@mui/material";import{Link as B,useLocation as L,matchPath as F,useNavigate as _,useParams as q,Routes as H,Route as U}from"react-router-dom";import Y from"@mui/material/Badge";import J from"@mui/material/Breadcrumbs";import X from"@mui/material/Tabs";import G from"@mui/material/Tab";import K from"@mui/material/Button";import Q,{circularProgressClasses as Z}from"@mui/material/CircularProgress";import ee from"@mui/material/Dialog";import te from"@mui/material/DialogTitle";import re from"@mui/material/DialogActions";import ne from"@mui/material/DialogContent";import ie from"@mui/lab/LoadingButton";import oe from"@mui/material/TextField";import ae,{drawerClasses as le}from"@mui/material/Drawer";import ce from"@mui/material/Divider";import se from"@mui/icons-material/ChevronLeft";import de from"@mui/material/ListSubheader";import ue from"@mui/material/ListItemIcon";import pe from"@mui/material/Popover";import me from"@mui/icons-material/ChevronRight";import fe from"@mui/material/Avatar";import he from"@mui/material/ListItemAvatar";import ye from"@mui/material/AppBar";import ge from"@mui/material/Toolbar";import be from"@mui/icons-material/Menu";import ve,{linearProgressClasses as xe}from"@mui/material/LinearProgress";import Ce from"@mui/material/FormControl";import Se,{inputLabelClasses as we}from"@mui/material/InputLabel";import $e from"@mui/material/Select";import Te from"@mui/material/Stack";import ke,{autocompleteClasses as Ee}from"@mui/material/Autocomplete";import Ie from"@mui/material/FormHelperText";import Pe,{outlinedInputClasses as Oe}from"@mui/material/OutlinedInput";import ze from"@mui/material/InputAdornment";import{isAfter as Re,isSameDay as Ae,startOfWeek as je,endOfWeek as We,format as De}from"date-fns";import Me from"@mui/icons-material/Event";import{DateCalendar as Ne,PickersDay as Ve,DesktopDatePicker as Be,TimePicker as Le,DateTimePicker as Fe}from"@mui/x-date-pickers";import{isBefore as _e}from"date-fns/esm";import qe from"@mui/material/DialogContentText";import He from"@mui/material/Skeleton";import{loremIpsum as Ue}from"lorem-ipsum";import Ye from"@mui/material/TableContainer";import Je from"@mui/material/TableBody";import Xe from"@mui/material/Table";import Ge from"@mui/material/TableCell";import Ke from"@mui/material/TableRow";import Qe from"@mui/icons-material/Search";import Ze from"@mui/material/TableSortLabel";import et from"@mui/material/TableHead";import tt from"@mui/icons-material/Check";import rt from"@mui/icons-material/Clear";import nt from"@mui/icons-material/Edit";import it from"@mui/material/Switch";import{DatePicker as ot}from"@mui/x-date-pickers/DatePicker";import{DateTimePicker as at}from"@mui/x-date-pickers/DateTimePicker";import{TimePicker as lt}from"@mui/x-date-pickers/TimePicker";import ct from"@mui/material/Rating";import st from"@mui/icons-material/ReportProblem";import dt from"@mui/material/Snackbar";import{DataGrid as ut}from"@mui/x-data-grid";import pt from"@mui/material/FormControlLabel";import mt from"@mui/material/Checkbox";import ft from"@mui/material/MenuItem";import ht from"@mui/material/Menu";import yt from"@mui/icons-material/MoreVert";const gt={overrides:{h1:{component:k,props:{gutterBottom:!0,variant:"h5"}},h2:{component:k,props:{gutterBottom:!0,variant:"h6"}},h3:{component:k,props:{gutterBottom:!0,variant:"subtitle1"}},h4:{component:k,props:{gutterBottom:!0,variant:"caption",paragraph:!0}},p:{component:k,props:{paragraph:!0}},a:{component:z},li:{component:"li"}}},bt=({content:t,options:r=gt})=>e(R,{options:r,children:t}),vt=({markdown:r,content:n,spacing:i=0,children:a,sx:c})=>{const{spacing:s,typography:d}=E();let u,p;r?u=r||"":Array.isArray(n)?(p=n.map(((t,r)=>e(k,{sx:{pb:i},children:t},r))),u=n.join("\n")):(p=e(k,{children:n}),u=n||"");const m=r&&e(bt,{content:r});return e(w,{sx:{position:"relative",pl:2,pr:4,py:1,backgroundColor:P[800],color:"white",...c},children:t(o,{display:"flex",flexDirection:"row",children:[e(o,{width:1,children:a||m||p}),e(o,{sx:{position:"absolute",top:s(.5),right:s(.5)},children:u&&e(l,{"aria-label":"copy board content",color:"inherit",onClick:()=>navigator.clipboard.writeText(u),children:e(T,{title:"Copy",children:e(A,{sx:{fontSize:d.pxToRem(18)}})})})})]})})},xt={[`& .${i.message}`]:{width:1}},Ct=f((({severity:r,iconMapping:i,title:c,message:m,metadata:f,metadataComponent:y,onClose:g,sx:b={}},v)=>{const[x,C]=h(!1);return e(n,{ref:v,severity:r,iconMapping:i,onClose:g,action:t(o,{display:"flex",flexDirection:"column",children:[e(l,{color:"inherit",onClick:g,children:e(p,{fontSize:"small"})}),f&&e(l,{color:"inherit",onClick:()=>C((e=>!e)),children:e(x?u:d,{fontSize:"small"})})]}),sx:{...xt,...b},children:t(o,{sx:{w:1},children:[c&&e(s,{children:c}),m,f&&e(a,{in:x,sx:{mt:2},children:e(vt,{content:f,children:y})})]})})})),St=({children:t})=>e(j,{component:"main",sx:{py:3,flexGrow:1},children:t});function wt({children:t,centerVertical:r=!0,centerHorizontal:n=!0,sx:i}){return e(o,{width:1,height:1,sx:{...i,display:"flex",flexDirection:"column",justifyContent:r?"center":"flex-start",alignItems:n?"center":"flex-start"},children:t})}const $t=(e,t)=>new Array(e).fill(t),Tt=e=>{const t=Math.floor(Math.random()*e.length);return{index:t,item:e[t]}},kt=({lightWeight:e=100,darkWeight:t=900}={})=>{const{palette:r}=V();return"light"===r.mode?r.grey[e]:r.grey[t]},Et=(e=12)=>{const t=(t,r,n)=>{const i=t[r];return t[r]+=n,t[r]>e?(t[r]=n,!1):(t[r]==e&&(t[r]=0),i>0)};return{xs:0,sm:0,md:0,lg:0,xl:0,increment:function({xs:e=0,sm:r=0,md:n=0,lg:i=0,xl:o=0}){const a=r||e,l=n||a,c=i||l,s=o||c;return{xs:t(this,"xs",e),sm:t(this,"sm",a),md:t(this,"md",l),lg:t(this,"lg",c),xl:t(this,"xl",s)}}}},It=e=>{const t=new FormData(e.currentTarget),r={};return t.forEach(((e,t)=>{r[t]=e})),r},Pt=y(void 0),Ot=Pt.Provider,zt=()=>g(Pt),Rt=f(((t,r)=>{const{href:n,...i}=t;return e(B,{ref:r,to:n,...i})})),At=f(((t,r)=>e(z,{...t,component:Rt}))),jt=(e,t,{from:r,to:n})=>{const i=b(),o=_();v((()=>{i.current===r&&t===n&&o(e),i.current=t}),[t])},Wt=e=>{const{pathname:t}=L();for(let r=0;r<e.length;r+=1){const n=e[r],i=F(n,t);if(null!==i)return i}return null},Dt=({items:r,defaultSelectedItem:n,colBreakpoint:i=3,listMode:o="panel",children:a,onSelectedItemChange:l=(()=>null)})=>{const c=r.map((e=>e.path)).filter(Boolean),s=Wt(c),d=kt(),{palette:u,typography:p}=V(),[m,f]=h(n);return e(Ot,{value:m,children:t(W,{container:!0,bgcolor:d,height:1,children:[e(W,{item:!0,xs:i,pl:1,height:1,children:e(D,{sx:{height:1,overflowY:"auto"},children:r.map((({id:t,text:r,tooltip:n,path:i,href:a})=>{const c="panel"===o?t===m:s?.pattern?.path===i,d=x(M,{..."navigation"===o?{component:At,href:a}:{},key:t,dense:!0,selected:c,onClick:()=>(e=>{f(e),l(e)})(t),"aria-label":r,sx:{backgroundColor:c?`${u.grey[300]} !important`:void 0}},e(N,{primary:r,primaryTypographyProps:{fontWeight:c?p.fontWeightMedium:void 0,color:c?p.body1.color:O[600]}}));return n?e(T,{title:n,enterDelay:1500,placement:"right",children:d},t):d}))})}),e(W,{item:!0,xs:12-i,pl:1,py:1,pr:1,children:e(w,{elevation:0,sx:{width:1,height:1,backgroundColor:u.background.paper},children:a})})]})})},Mt={root:"RdsBullet-root"},Nt=({variant:t="primary",sx:r})=>e(Y,{color:t,variant:"dot",className:Mt.root,role:"bullet","aria-describedby":t,sx:r}),Vt={root:"RdsLabel-root"},Bt=({text:t,color:r,variant:n="default",textTransform:i="capitalize",sx:a})=>{const{palette:l,typography:c}=E(),s={default:"light"===l.mode?l.grey[100]:l.grey[900],primary:l.primary.light,secondary:l.secondary.light,info:l.info.light,warning:l.warning.light,error:l.error.light,success:l.success.light},d={default:l.getContrastText(s.default),primary:l.primary.contrastText,secondary:l.secondary.contrastText,info:l.info.contrastText,warning:l.warning.contrastText,error:l.error.contrastText,success:l.success.contrastText},u=r||s[n],p=r?l.getContrastText(r):d[n];return e(o,{height:24,minWidth:22,display:"inline-flex",justifyContent:"center",alignItems:"center",bgcolor:u,color:p,fontSize:c.caption.fontSize,fontWeight:c.fontWeightBold,lineHeight:0,textTransform:i,whiteSpace:"nowrap",borderRadius:2,role:"label","aria-label":`${t} ${n} label`,py:0,px:1,sx:{cursor:"default",...a},children:t})},Lt=y([0,()=>null]),Ft=Lt.Provider,_t=()=>g(Lt),qt=({children:t,initialValue:r=0})=>{const n=h(r);return e(Ft,{value:n,children:t})},Ht=({loading:t,children:n})=>{const{typography:i}=E();return t?e(Q,{color:"inherit",size:i.h4.fontSize,"aria-label":"title loading"}):"string"==typeof n?e(k,{variant:"h4",role:"heading","aria-level":1,children:n}):e(r,{children:n})},Ut=({loading:t,children:n})=>{const{typography:i}=E();return t?e(Q,{color:"inherit",size:i.body1.fontSize,"aria-label":"subtitle loading"}):"string"==typeof n?e(k,{variant:"body1",role:"heading","aria-level":2,children:n}):e(r,{children:n})},Yt=({title:r="",loadingTitle:n,subtitle:i,loadingSubtitle:a,preset:l="default",actionsVariant:c="outlined",breadcrumbs:s,actions:d,tabs:u,tabsMode:p="panel",navigationButton:m})=>{const f=(u||[]).map((e=>e.path)).filter(Boolean),{palette:h}=E(),y=kt(),[g,b]=_t(),v=Wt(f),x={default:y,primary:h.primary.main,secondary:h.secondary.main,inherit:"inherit",transparent:"transparent"},C=x[l],S={default:h.getContrastText(x.default),primary:h.primary.contrastText,secondary:h.secondary.contrastText,inherit:"inherit",transparent:h.text.primary}[l],w="panel"===p?g:v?.pattern?.path;return e(o,{bgcolor:C,color:S,children:t(j,{children:[t(o,{sx:{py:3,display:"flex",flexDirection:"row",justifyContent:"space-between"},children:[t(o,{children:[m&&e(K,{href:m.href,size:"small",color:"inherit",LinkComponent:At,startIcon:m.icon,sx:{mb:1},children:m.text}),s?.length&&e(J,{color:"inherit",separator:"›","aria-label":"breadcrumb",sx:{marginTop:1},children:s.map((({id:t,link:r,text:n})=>e(At,{underline:"hover",color:"inherit",href:r,variant:"body2",role:"link",children:n},t)))}),e(Ht,{loading:n,children:r}),(i||a)&&e(Ut,{loading:a,children:i})]}),d&&e(o,{children:d.map((({disabled:t,id:r,href:n,onClick:i,text:o},a)=>e(K,{component:n?At:"button",role:"button",color:"inherit",disabled:t,variant:c,size:"small",href:n,onClick:i,sx:{mr:a!=d.length-1?1:0},children:o},r)))})]}),u&&e(X,{value:w,textColor:"inherit",onChange:"panel"===p?(e,t)=>b(t):void 0,children:u.map((({id:t,label:r,disabled:n,path:i,href:o})=>{const a={label:r,disabled:n};return e(G,"panel"===p?{...a}:{...a,component:At,href:o,value:i},t)}))})]})})},Jt=({open:r,title:n,component:i,componentProps:a={},disabled:c,disableAccept:s,disableCancel:d,actions:u=[],children:m,loading:f,cancelable:h,callCloseWhenCancel:y=!0,acceptable:g,acceptText:b="Accept",cancelText:v="Cancel",onAccept:x,onCancel:C=(()=>null),onClose:S,acceptType:w="button"})=>{const $=u.length>0||g||h;return t(ee,{open:r,onClose:S,children:[t(te,{sx:{display:"flex",alignItems:"center"},children:[n,f&&!g&&e(Q,{size:20,sx:{ml:2,color:e=>e.palette.grey[500]}}),e(l,{disabled:c,"aria-label":"close",onClick:S,sx:{position:"absolute",right:8,top:8,color:e=>e.palette.grey[500]},children:e(p,{})})]}),t(o,{component:i,...a,children:[e(ne,{dividers:!0,children:m}),$&&t(re,{children:[u.map((({id:t,text:r,type:n="button",onClick:i,color:o="primary"})=>e(K,{type:n,disabled:c,onClick:i,color:o,children:r},t))),h&&e(K,{color:"error",disabled:c||d,onClick:()=>{C(),y&&S()},children:v}),g&&e(ie,{type:w,loading:f,disabled:c||s,onClick:x,children:b})]})]})]})},Xt=({open:r,title:n,loading:i,disabled:o,confirmText:a="Confirm",cancelText:l="Cancel",passphrase:c,children:s,onConfirm:d,onCancel:u})=>{const[p,m]=h("");return t(Jt,{title:n,loading:i,disabled:i||o,disableAccept:!(!c||p===c),open:r,onClose:u,acceptable:!0,cancelable:!0,callCloseWhenCancel:!1,acceptText:a,cancelText:l,onCancel:u,onAccept:d,children:[s,c&&e(oe,{size:"small",fullWidth:!0,value:p,onChange:e=>m(e.target.value),placeholder:c})]})},Gt=({open:t,title:r,loading:n,disabled:i,submitText:o="Submit",cancelText:a="Cancel",children:l,onSubmit:c,onCancel:s})=>e(Jt,{component:"form",componentProps:{onSubmit:e=>{e.preventDefault(),c(It(e))}},title:r,loading:n,disabled:n||i,open:t,onClose:s,callCloseWhenCancel:!1,cancelable:!0,acceptable:!0,cancelText:a,onCancel:s,acceptText:o,acceptType:"submit",children:l}),Kt=(e=!1)=>{const[t,r]=h(e);return{isOpen:t,open:()=>r(!0),close:()=>r(!1),setIsOpen:r}},Qt=y(void 0),Zt=new Error("DrawerContext.Provider is required and was undefined"),er=()=>{const e=g(Qt);if(void 0===e)throw Zt;return e},tr=e=>({width:240,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:"hidden"}),rr=e=>({transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),overflowX:"hidden",width:`calc(${e.spacing(7)} + 1px)`,[e.breakpoints.up("sm")]:{width:`calc(${e.spacing(8)} + 1px)`}}),nr=I("div")((({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-end",padding:e.spacing(0,1),...e.mixins.toolbar}))),ir={temporary:!0,mini:!0,persistent:!0,clipped:!1},or={temporary:"temporary",mini:"permanent",clipped:"permanent",persistent:"persistent"},ar=()=>({}),lr={mini:(e,t)=>({boxSizing:"border-box",[`& .${$.root}`]:{zIndex:t.zIndex.drawer-1}}),temporary:ar,clipped:ar,persistent:ar},cr=({children:r,...n})=>{const i=E(),{state:o,switchState:a,underAppBar:c,close:s,drawerWidth:d,variant:u}=er(),p={width:d,flexShrink:0,whiteSpace:"nowrap",..."open"===o&&{...tr(i),[`& .${le.paper}`]:tr(i)},..."open"!==o&&{...rr(i),[`& .${le.paper}`]:rr(i)},...lr[u](o,i)};return t(ae,{open:"open"===o,variant:or[u],role:"menu","aria-hidden":"close"===o,onClose:s,sx:p,...n,children:[e(nr,{children:!c&&ir[u]&&e(l,{onClick:a,children:e(se,{})})}),e(ce,{}),r]})},sr={temporary:"close",mini:"collapse",clipped:"open",persistent:"close"},dr={temporary:["close","open"],mini:["collapse","open"],clipped:["open","open"],persistent:["close","open"]},ur=({children:t,initialState:r,variant:n="temporary",drawerWidth:i=240,underAppBar:o=!1,selectedItemId:a,onStateChange:l=(()=>null)})=>{const[c,s]=h(r||sr[n]),d=e=>{l(e),s(e)};return e(Qt.Provider,{value:{state:c,variant:n,selectedItemId:a,underAppBar:o,drawerWidth:i,switchState:()=>d(dr[n]["open"===c?0:1]),collapse:()=>d("collapse"),close:()=>d("close"),open:()=>d("open"),setState:s},children:t})},pr=I(de,{shouldForwardProp:e=>"size"!==e})((({size:e,theme:t})=>({lineHeight:"small"===e?t.typography.pxToRem(40):void 0}))),mr=(e,t)=>({color:t?e.palette.primary.main:void 0,fontWeight:t?e.typography.fontWeightBold:e.typography.fontWeightMedium}),fr=I(At)((({theme:e})=>({color:e.palette.text.primary}))),hr={minWidth:0,justifyContent:"center",marginRight:"auto"},yr=({text:r,icon:n,avatar:i,label:o,bullet:a,href:l,selected:c,size:s="medium",level:d,sx:u})=>{const{state:p}=er(),m=E(),{color:f,fontWeight:h}=mr(m,c);return t(M,{LinkComponent:fr,dense:"small"===s,"aria-label":r,href:l,selected:c,sx:{...u,pl:"open"===p?m.spacing(2+1.5*d):void 0,..."collapse"===p&&{paddingHorizontal:m.spacing(2.5),justifyContent:"center"}},children:[n&&e(ue,{sx:{color:f,..."collapse"===p&&0===d&&hr},children:n}),i&&e(he,{sx:{..."collapse"===p&&0===d&&hr},children:e(fe,{alt:i.alt,src:i.src,sx:{..."small"===s&&{width:24,height:24},..."collapse"===p&&{width:30,height:30}}})}),e(N,{disableTypography:!0,primary:r,sx:{color:f,fontWeight:h,opacity:"collapse"===p&&0===d?0:void 0}}),o&&"open"===p&&e(Bt,{text:o.text,variant:o.variant,sx:{ml:2}}),a&&"open"===p&&e(Nt,{variant:a.variant,sx:{ml:2}})]})},gr=({item:t,size:r="medium",level:n=0})=>{const{selectedItemId:i}=er();if("items"in t){const{id:o,text:a,icon:l,items:c}=t,s=c.some((e=>e.id===i));return e(br,{size:r,selected:o===i||s,text:a,icon:l,items:c,level:n})}{const{id:o,text:a,icon:l,avatar:c,label:s,bullet:d,href:u}=t;return e(yr,{selected:o===i,size:r,text:a,icon:l,avatar:c,label:s,bullet:d,href:u,level:n})}},br=({text:n,icon:i,selected:o,items:l,size:c="medium",level:s,sx:u={}})=>{const{state:p}=er(),m=b(null),{palette:f,spacing:y}=E(),[g,v]=h(!1),{color:x,fontWeight:C}=mr(E(),o),S=e(D,{component:"div",disablePadding:!0,children:l.map((t=>e(gr,{level:s+1,item:t,size:c},t.id)))}),w="collapse"===p&&0===s?{position:"absolute",right:0}:{};return t(r,{children:[t(M,{ref:m,selected:o,"aria-label":n,onClick:()=>v((e=>!e)),dense:"small"===c,sx:{...u,pl:"open"===p?y(2+1.5*s):void 0,backgroundColor:g?f.action.hover:void 0},children:[i&&e(ue,{sx:{color:x},children:i}),e(N,{disableTypography:!0,primary:n,sx:{color:x,fontWeight:C,opacity:"collapse"===p&&0===s?0:void 0}}),e(g&&"open"===p?d:me,{sx:[{color:x,ml:2},w]})]}),"open"===p?e(a,{in:g,timeout:"auto",unmountOnExit:!0,"aria-label":`${n} collapse submenu`,children:S}):e(pe,{open:g,PaperProps:{elevation:0,variant:"outlined"},"aria-label":`${n} popover submenu`,anchorEl:m.current,onClose:()=>v(!1),anchorOrigin:{vertical:"top",horizontal:"right"},children:S})]})},vr=({title:n,items:i,size:o="medium"})=>{const{state:a}=er(),{spacing:l}=E();return t(r,{children:[n&&"open"===a&&e(pr,{size:o,role:"heading",children:n}),e(D,{sx:{paddingTop:"small"===o?l(0):void 0,paddingY:"collapse"===a?0:void 0},children:i.map((t=>e(gr,{item:t,size:o},t.id)))})]})},xr=({nav:{items:t},size:n="medium"})=>e(r,{children:t.map((({title:t,items:r},i)=>e(vr,{title:t,items:r,size:n},i)))}),Cr={temporary:!1,mini:!0,persistent:!0,clipped:!0},Sr={temporary:()=>!0,mini:e=>"open"!==e,persistent:()=>!0,clipped:()=>!1},wr=({title:r,sx:n,children:i,...o})=>{const a=E(),{state:c,variant:s,switchState:d,drawerWidth:u,underAppBar:p}=er(),m=Cr[s]&&!p&&{transition:a.transitions.create(["width","margin"],{easing:a.transitions.easing.sharp,duration:a.transitions.duration.leavingScreen}),..."open"===c&&{marginLeft:u,width:`calc(100% - ${u}px)`,transition:a.transitions.create(["width","margin"],{easing:a.transitions.easing.sharp,duration:a.transitions.duration.enteringScreen})}}||{};return e(ye,{position:p?"fixed":void 0,...o,sx:{...n,...m,zIndex:e=>e.zIndex.drawer+(p?1:0)},children:t(ge,{children:[e(l,{color:"inherit","aria-label":"open drawer",onClick:d,edge:"start",sx:{marginRight:5,display:Sr[s](c)?void 0:"none"},children:e(be,{})}),r&&e(k,{variant:"h6",component:"h1",role:"heading","aria-level":1,noWrap:!0,children:r}),i]})})},$r={temporary:!1,mini:!0,clipped:!0,persistent:!0},Tr=I("div")((({theme:e})=>{const{spacing:t}=E(),{drawerWidth:r,state:n,variant:i}=er();return{marginLeft:$r[i]?"open"===n?r:"collapse"===n?t(8):0:0,transition:e.transitions.create("margin",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen})}})),kr=({children:r})=>t(Tr,{children:[e(nr,{}),r]}),Er=()=>e(o,{width:1,height:1,display:"flex",justifyContent:"center",alignItems:"center",children:e(Q,{})});function Ir({fetching:r=!1,loading:i=!1,error:a,success:l,children:c}){const d=Array.isArray(r)?r.some((e=>e)):r;return(Array.isArray(i)?i.some((e=>e)):i)?e(Er,{}):a?t(n,{severity:"error",role:"alert","aria-describedby":"error",children:[a.name&&e(s,{role:"heading",children:a.name}),a.message]}):t(o,{children:[l&&t(n,{severity:"success",role:"alert","aria-describedby":"success",sx:{mb:2},children:[l.name&&e(s,{role:"heading",children:l.name}),l.message]}),d&&e(ve,{sx:{width:1,mb:1}}),c]})}const Pr={small:15,medium:20},Or=({label:r,value:n,loading:i=!1,fetching:a=!1,size:l="medium",fullWidth:c=!1,color:s,children:d,onChange:u})=>{const p=C(),m=I(Ce)((()=>s?{label:{color:s},".MuiOutlinedInput-notchedOutline":{borderColor:`${s} !important`},".MuiInputBase-root":{color:s},".MuiSelect-icon":{fill:s}}:{}));return t(m,{fullWidth:c,children:[e(Se,{id:p,children:r}),e($e,{labelId:p,id:p,value:n,label:r,onChange:u,disabled:a,size:l,renderValue:r=>a?e(wt,{centerVertical:!0,centerHorizontal:!0,children:e(Q,{color:"inherit",size:Pr[l]})}):i?t(o,{display:"flex",flexDirection:"column",children:[r,e(ve,{color:"inherit",sx:{position:"absolute",left:0,right:0,bottom:0}})]}):r,children:d})]})},zr=({title:i,subtitle:a,loading:l,error:c,onSubmitSignIn:s})=>{const[d,u]=h(""),[p,m]=h("");return t(r,{children:[t(o,{marginBottom:2,children:[e(k,{component:"h1",variant:"h4",children:i}),e(k,{variant:"body1",children:a})]}),t(o,{component:"form",onSubmit:function(e){e.preventDefault(),u(""),m("");const t=new FormData(e.currentTarget),r=t.get("email")?.toString(),n=t.get("password")?.toString();r||u("Please fill out this field"),n||m("Please fill out this field"),r&&n&&s(r,n)},children:[c&&e(Te,{width:"100%",marginTop:1,children:e(n,{variant:"filled",severity:"error",children:c.message})}),e(oe,{margin:"normal",fullWidth:!0,id:"email",label:"Email Address",name:"email",autoComplete:"email",autoFocus:!0,disabled:l,type:"email",inputProps:{role:"input"},error:!!d,helperText:d}),e(oe,{margin:"normal",fullWidth:!0,role:"input",name:"password",label:"Password",type:"password",id:"password",disabled:l,autoComplete:"current-password",inputProps:{role:"input"},error:!!p,helperText:p}),e(ie,{type:"submit",fullWidth:!0,variant:"contained",loading:l,disabled:l,role:"button",sx:{mt:2},children:"Sign In"})]})]})};let Rr=0;const Ar=m["useId".toString()];function jr(e){if(void 0!==Ar){const t=Ar();return null!=e?e:t}return function(e){const[t,r]=m.useState(e),n=e||t;return m.useEffect((()=>{null==t&&(Rr+=1,r(`mui-${Rr}`))}),[t]),n}(e)}const Wr=({id:r,label:n,InputLabelProps:i,InputProps:o,fetching:a,loading:l,helperText:s,hexColor:d,size:u,fullWidth:p,sx:m,...f})=>{const h=jr(r),y=s&&h?`${h}-helper-text`:void 0,g=n&&h?`${h}-label`:void 0,b=d?{[`& .${Oe.notchedOutline}`]:{borderColor:`${d} !important`},[`& .${we.root}`]:{color:d},[`& .${Oe.input}`]:{color:d},[`& .${Z.root}`]:{color:d},[`& .${xe.bar}`]:{backgroundColor:d},[`& .${Ee.endAdornment} .${c.root}`]:{color:d}}:{};return t(Ce,{sx:b,fullWidth:p,children:[e(Se,{size:"small"===u?"small":"normal",id:g,htmlFor:h,...i,children:n}),e(Pe,{...o,id:h,label:n,size:u,fullWidth:p,endAdornment:t(ze,{position:"end",children:[o?.endAdornment,l?e(Q,{color:"inherit",size:20,sx:{ml:1}}):null]}),sx:m,...f}),a&&!l&&e(ve,{color:"inherit",sx:{position:"absolute",left:0,right:0,bottom:0}}),s&&e(Ie,{id:y,children:s})]})},Dr=t=>{const{label:r,loading:n,fetching:i,options:o,helperText:a,color:l,onChangeValue:c=(()=>null),sx:s,...d}=t;return e(ke,{loading:n||i,options:i?[]:o,onChange:(e,t)=>c(t),...d,renderInput:t=>e(Wr,{...t,label:r,fullWidth:!0,fetching:i,loading:n,hexColor:l,helperText:a}),sx:s})},Mr=I(o,{shouldForwardProp:e=>"dayIsBetween"!==e&&"isFirstDay"!==e&&"isLastDay"!==e&&"isStartOfWeek"!==e&&"isEndOfWeek"!==e})((({theme:e,dayIsBetween:t,isFirstDay:r,isLastDay:n})=>({...(r||n||t)&&{borderRadius:0,backgroundColor:`${e.palette.primary.light}40`,margin:0},...r&&{borderTopLeftRadius:"50%",borderBottomLeftRadius:"50%"},...n&&{borderTopRightRadius:"50%",borderBottomRightRadius:"50%"}}))),Nr=t=>{const{day:r,dateRange:n,...i}=t;if(null==n)return e(Ve,{day:r,...i});const[o,a]=n,l=!!a&&Re(r,o)&&_e(r,a),c=Ae(r,o),s=!!a&&Ae(r,a),d=Ae(r,je(r)),u=Ae(r,We(r));return e(Mr,{dayIsBetween:l,isFirstDay:c||l&&d,isLastDay:s||l&&u,"aria-label":De(r,"yyyy-MM-dd"),"aria-selected":l||c||s,role:"gridcell",children:e(Ve,{...i,day:r,selected:c||s})})},Vr=({defaultValue:t,onValueChange:r})=>{const[n,i]=h(t),[o,a]=h(0),l=(e,t,n)=>{i(e),r(e,t),a(n)};return e(Ne,{value:null,onChange:e=>{if(e)return 1===o&&e<n[0]||0===o&&n[1]&&e>n[1]?l([e,void 0],0,1):void l([0===o?e:n[0],1===o?e:n[1]],o,0===o?1:0)},slots:{day:Nr},slotProps:{day:{dateRange:n}},"aria-label":"calendar range picker"})},Br=({defaultValue:n,format:i,label:o,fullWidth:c,onValueChange:s,size:d="medium"})=>{const[u,p]=h(!1),[m,f]=h(n);return t(r,{children:[e(oe,{label:o,fullWidth:c,size:d,value:`${De(m[0],i)} - ${m[1]?De(m[1],i):i.toUpperCase()}`,InputProps:{endAdornment:e(ze,{position:"end",children:e(l,{onClick:()=>p((e=>!e)),"aria-label":"open calendar",children:e(Me,{})})})}}),e(w,{children:e(a,{in:u,"aria-label":"calendar collapse",children:e(Vr,{defaultValue:n,onValueChange:(e,t)=>{f(e),s(e,t),p(t<1)}})})})]})},Lr=({title:t,titleVariant:r="h4",variant:n="primary"})=>{const{palette:i}=E(),o={primary:void 0,error:"error",warning:i.warning.main,success:i.success.main};return e(k,{color:o[n],variant:r,pb:1,borderBottom:1,borderColor:"grey.300",children:t})},Fr=({variant:n="primary",title:i,titleVariant:o="h4",description:a,descriptionVariant:l="body2",buttonText:c,helperText:s,helperTextVariant:d="caption",confirmable:u,passphrase:p,confirmTitle:m="",confirmDescription:f="",onAction:h})=>{const{isOpen:y,open:g,close:b}=Kt();return t(r,{children:[t(W,{container:!0,spacing:1,children:[e(W,{item:!0,xs:12,mb:2,children:e(Lr,{title:i,titleVariant:o})}),a&&e(W,{item:!0,xs:12,children:e(k,{variant:l,children:a})}),e(W,{item:!0,xs:12,mt:1,children:e(K,{color:n,variant:"contained",onClick:()=>{u?g():h()},children:c})}),s&&e(W,{item:!0,xs:12,children:e(k,{variant:d,children:s})})]}),e(Xt,{open:y,title:m,passphrase:p,onCancel:b,onConfirm:()=>{h()},children:e(qe,{children:f})})]})},_r=y([0,()=>null]),qr=_r.Provider,Hr=I((t=>e(X,{...t,TabIndicatorProps:{children:e("span",{className:"MuiTabs-indicatorSpan"})}})))((({theme:e})=>({minHeight:e.spacing(5),"& .MuiTabs-indicator":{display:"flex",justifyContent:"center",backgroundColor:"transparent"},"& .MuiTabs-indicatorSpan":{maxWidth:40,width:"100%",backgroundColor:e.palette.primary.main}}))),Ur=I(G)((({theme:e})=>({textTransform:"none",fontWeight:e.typography.fontWeightRegular,marginRight:e.spacing(1),color:e.palette.text.secondary,paddingTop:0,paddingBottom:0,minHeight:e.spacing(5),"&.Mui-selected":{color:e.palette.text.secondary,fontWeight:e.typography.fontWeightBold}}))),Yr=({children:r,tabs:n,initialTab:i=0,onChangeTab:a=(()=>null)})=>{const l=kt(),[c,s]=h(i);return e(qr,{value:[c,s],children:t(w,{variant:"outlined",children:[e(o,{bgcolor:l,children:e(Hr,{value:c,onChange:(e,t)=>{s(t),a(n[t],t)},children:n.map((({text:t,icon:r})=>e(Ur,{iconPosition:"start",disableRipple:!0,label:t,icon:r},t)))})}),r]})})},Jr=({index:t,children:r,sx:n})=>{const[i]=g(_r);let a=i===t;return Array.isArray(t)&&(a=t.includes(i)),a?e(o,{sx:n,children:r}):null};function Xr({children:t,index:r}){const[n]=_t();let i=n===r;return Array.isArray(r)&&(i=r.includes(n)),e("div",{role:"tabpanel",hidden:!i,id:`simple-tabpanel-${r}`,"aria-labelledby":`simple-tab-${r}`,children:i&&e(o,{sx:{p:3},children:t})})}const Gr=({title:r,subtitle:n,icon:i,iconSize:a=200,actions:l})=>t(o,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",textAlign:"center",children:[i&&i({size:a,color:"primary"}),e(k,{variant:"h4",role:"heading","aria-level":1,children:r}),e(k,{variant:"subtitle1",role:"heading","aria-level":2,sx:{mt:2},children:n}),l&&e(o,{sx:{pt:2},children:l.map((({id:t,text:r,href:n,onClick:i},o)=>e(K,{role:"button",variant:"contained",href:n,onClick:i,sx:{mr:o<l.length-1?2:0},children:r},t)))})]}),Kr=({width:r="100%",animation:n=!1})=>t(o,{width:r,children:[e(He,{animation:n,variant:"rectangular",height:118}),e(He,{animation:n,variant:"rectangular",height:16,sx:{my:1}}),e(He,{animation:n,variant:"rectangular",width:"80%",height:16})]}),Qr=({size:t=20})=>e(W,{container:!0,spacing:2,children:$t(t,0).map(((t,r)=>e(W,{item:!0,xs:4,children:e(Kr,{width:1})},r)))}),Zr=({size:r=20,children:n,p:i})=>t(j,{component:"main",sx:{p:i},"data-testid":"content-placeholder-test",children:[n,e(Qr,{size:r})]}),en=({count:t=3,units:r="paragraph",variant:n="body1"})=>e(k,{variant:n,children:Ue({count:t,units:r})});function tn(e,t){return"production"===process.env.NODE_ENV?()=>null:function(...r){return e(...r)||t(...r)}}var rn,nn={exports:{}},on={exports:{}},an={};var ln,cn,sn,dn,un,pn,mn,fn,hn,yn,gn,bn,vn,xn,Cn={};
2
2
  /** @license React v16.13.1
3
3
  * react-is.development.js
4
4
  *
@@ -20,5 +20,5 @@ object-assign
20
20
  *
21
21
  * This source code is licensed under the MIT license found in the
22
22
  * LICENSE file in the root directory of this source tree.
23
- */zn={exports:{}},"production"===process.env.NODE_ENV?zn.exports=function(){if(In)return Pn;In=1;var e,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.server_context"),s=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen");function h(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:switch(e=e.type){case n:case o:case i:case d:case u:return e;default:switch(e=e&&e.$$typeof){case c:case l:case s:case m:case p:case a:return e;default:return f}}case r:return f}}}return e=Symbol.for("react.module.reference"),Pn.ContextConsumer=l,Pn.ContextProvider=a,Pn.Element=t,Pn.ForwardRef=s,Pn.Fragment=n,Pn.Lazy=m,Pn.Memo=p,Pn.Portal=r,Pn.Profiler=o,Pn.StrictMode=i,Pn.Suspense=d,Pn.SuspenseList=u,Pn.isAsyncMode=function(){return!1},Pn.isConcurrentMode=function(){return!1},Pn.isContextConsumer=function(e){return h(e)===l},Pn.isContextProvider=function(e){return h(e)===a},Pn.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Pn.isForwardRef=function(e){return h(e)===s},Pn.isFragment=function(e){return h(e)===n},Pn.isLazy=function(e){return h(e)===m},Pn.isMemo=function(e){return h(e)===p},Pn.isPortal=function(e){return h(e)===r},Pn.isProfiler=function(e){return h(e)===o},Pn.isStrictMode=function(e){return h(e)===i},Pn.isSuspense=function(e){return h(e)===d},Pn.isSuspenseList=function(e){return h(e)===u},Pn.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===n||t===o||t===i||t===d||t===u||t===f||"object"==typeof t&&null!==t&&(t.$$typeof===m||t.$$typeof===p||t.$$typeof===a||t.$$typeof===l||t.$$typeof===s||t.$$typeof===e||void 0!==t.getModuleId)},Pn.typeOf=h,Pn}():zn.exports=(On||(On=1,"production"!==process.env.NODE_ENV&&function(){var e,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.server_context"),s=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen");function h(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:var h=e.type;switch(h){case n:case o:case i:case d:case u:return h;default:var y=h&&h.$$typeof;switch(y){case c:case l:case s:case m:case p:case a:return y;default:return f}}case r:return f}}}e=Symbol.for("react.module.reference");var y=l,g=a,b=t,v=s,x=n,C=m,S=p,w=r,$=o,T=i,k=d,E=u,I=!1,P=!1;Rn.ContextConsumer=y,Rn.ContextProvider=g,Rn.Element=b,Rn.ForwardRef=v,Rn.Fragment=x,Rn.Lazy=C,Rn.Memo=S,Rn.Portal=w,Rn.Profiler=$,Rn.StrictMode=T,Rn.Suspense=k,Rn.SuspenseList=E,Rn.isAsyncMode=function(e){return I||(I=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1},Rn.isConcurrentMode=function(e){return P||(P=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1},Rn.isContextConsumer=function(e){return h(e)===l},Rn.isContextProvider=function(e){return h(e)===a},Rn.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Rn.isForwardRef=function(e){return h(e)===s},Rn.isFragment=function(e){return h(e)===n},Rn.isLazy=function(e){return h(e)===m},Rn.isMemo=function(e){return h(e)===p},Rn.isPortal=function(e){return h(e)===r},Rn.isProfiler=function(e){return h(e)===o},Rn.isStrictMode=function(e){return h(e)===i},Rn.isSuspense=function(e){return h(e)===d},Rn.isSuspenseList=function(e){return h(e)===u},Rn.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===n||t===o||t===i||t===d||t===u||t===f||"object"==typeof t&&null!==t&&(t.$$typeof===m||t.$$typeof===p||t.$$typeof===a||t.$$typeof===l||t.$$typeof===s||t.$$typeof===e||void 0!==t.getModuleId)},Rn.typeOf=h}()),Rn),"undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),nn.exports.oneOfType([nn.exports.func,nn.exports.object]);const An={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};const jn=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};function Wn(e,t,r,n){const i=e[t];if(null==i||!jn(i)){const e=function(e){const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":Number.isFinite(e)?e!==Math.floor(e)?"float":"number":"Infinity";case"object":return null===e?"null":e.constructor.name;default:return t}}(i);return new RangeError(`Invalid ${n} \`${t}\` of type \`${e}\` supplied to \`${r}\`, expected \`integer\`.`)}return null}function Dn(e,t,...r){return void 0===e[t]?null:Wn(e,t,...r)}function Mn(){return null}Dn.isRequired=Wn,Mn.isRequired=Mn,process.env.NODE_ENV;const Nn=({order:r,orderBy:n,headCells:i,onRequestSort:a})=>e(et,{children:e(Ke,{children:i.map((i=>{return e(Ge,{variant:"head",padding:i.disablePadding?"none":"normal",sortDirection:n===i.id&&r,sx:{fontWeight:"bold"},children:i.sort?t(Ze,{active:n===i.id,direction:n===i.id?r:"asc",onClick:(l=i.id,()=>{a(l)}),children:[i.label,n===i.id?e(o,{component:"span",sx:An,children:"desc"===r?"sorted descending":"sorted ascending"}):null]}):i.label},String(i.id));var l}))})});function Vn(e,t,r){return t[r]<e[r]?-1:t[r]>e[r]?1:0}const Bn=({children:n,data:i,search:a,columns:l,defaultSort:c,defaultOrder:s="asc",loading:d=!1})=>{const[u,p]=h(""),[m,f]=h(s),[y,g]=h(c),b=i.slice().filter(function(e,t){return r=>!t||e.some((e=>{let n=r[e.id];return n?.toLowerCase&&(n=n.toLowerCase()),n?.toString().includes(t.toLowerCase())}))}(l,u)).sort(function(e,t){return"desc"===e?(e,r)=>Vn(e,r,t):(e,r)=>-Vn(e,r,t)}(m,y));return e(r,{children:t(o,{sx:{paddingX:1,paddingBottom:2},children:[a&&e(o,{paddingY:2,children:e(oe,{fullWidth:!0,placeholder:"Search",InputProps:{role:"search",startAdornment:e(ze,{position:"start",children:e(Qe,{})})},onChange:e=>p(e.target.value)})}),e(Ye,{children:t(Xe,{children:[e(Nn,{order:m,orderBy:y,headCells:l,onRequestSort:e=>{f(y===e&&"asc"===m?"desc":"asc"),g(e)}}),e(Je,{children:d?e(Ke,{children:e(Ge,{colSpan:l.length,sx:{textAlign:"center"},children:e(Q,{})})}):0===b.length?e(Ke,{children:e(Ge,{colSpan:l.length,sx:{textAlign:"center"},children:"No data"})}):n(b)})]})})]})})};Bn.defaultProps={defaultOrder:"asc"};const Ln=({children:n,data:i,loading:o,columns:a,defaultSort:l,defaultOrder:c,onRequestSort:s})=>{const[d,u]=h({orderBy:l,order:c||"asc"});return e(r,{children:e(Ye,{children:t(Xe,{children:[e(Nn,{order:d.order,orderBy:d.orderBy,headCells:a,onRequestSort:e=>{u((({orderBy:t,order:r})=>{const n=t===e&&"asc"===r?"desc":"asc";return s(e,n),{orderBy:e,order:n}}))}}),e(Je,{children:o?e(Ke,{children:e(Ge,{colSpan:a.length,sx:{textAlign:"center"},children:e(Q,{})})}):i.map(((e,t)=>n(e,t)))})]})})})},Fn=({onClickCancel:r,onClickSubmit:n,sx:i})=>t(ze,{position:"end",sx:i,children:[e(K,{variant:"contained",size:"small",color:"error","aria-label":"cancel button",startIcon:e(rt,{sx:{fontSize:12}}),onClick:r,sx:{paddingRight:0,minWidth:0,marginRight:1}}),e(K,{variant:"contained",size:"small",color:"primary","aria-label":"submit button",startIcon:e(tt,{sx:{fontSize:12}}),onClick:n,sx:{paddingRight:0,minWidth:0}})]}),_n=(e,t)=>{const[r,n]=h(!1),[i,o]=h(e),a=()=>{n(!1),o(e)};return{isEditing:r,cancelEdit:a,editValue:i,setEditValue:o,startEdit:()=>{n(!0)},submitEdit:()=>{t(i),a()}}},qn=({dense:t,onClick:r})=>{const{typography:n}=E();return e(l,{size:"small",onClick:r,sx:{ml:t?.5:1},"aria-label":"edit button",children:e(nt,{sx:{fontSize:n.pxToRem(t?18:24)}})})},Hn="-",Un=e=>`label-${e.replace(/ /g,"-")}`,Yn=({label:r,hideLabel:n,tooltip:i,tooltipEnterDelay:a=2e3,children:l,dense:c,sx:s})=>{const{typography:d}=E(),u=Un(r);return t(o,{width:1,lineHeight:c?0:void 0,sx:s,children:[!n&&e(k,{variant:c?"caption":"subtitle2",role:"label",id:u,lineHeight:c?d.pxToRem(15):void 0,children:r}),i?e(T,{title:i,placement:"top",enterDelay:a,children:l}):l]})},Jn=({label:r,value:n,placeholder:i=Hn,editable:a,dense:l,onEdit:c=(()=>null)})=>{const s=b(null),{isEditing:d,editValue:u,startEdit:p,cancelEdit:m,setEditValue:f,submitEdit:h}=_n(n?.toString(),c),y=Un(r),g=n?.toString()||i,x=e=>{"Enter"===e.key&&c(e.target.value)};return v((()=>(s.current?.addEventListener("keypress",x),()=>s.current?.removeEventListener("keypress",x))),[s.current]),e(Yn,{hideLabel:d,label:r,tooltip:g,dense:l,children:d?e(oe,{inputRef:s,value:u,label:r,size:"small",onChange:e=>f(e.target.value),InputProps:{endAdornment:e(Fn,{onClickCancel:m,onClickSubmit:h})},sx:{marginY:l?0:1}}):t(o,{display:"flex","aria-labelledby":y,children:[e(k,{variant:l?"body1":"h5",noWrap:!0,children:g}),a&&e(qn,{dense:l,onClick:p})]})})},Xn=({children:t})=>e(w,{sx:{p:2},children:t}),Gn=({label:r,value:n,placeholder:i=Hn,editable:a,dense:l,onEdit:c=(()=>null)})=>{const s=Un(r),{typography:d}=E(),{isEditing:u,editValue:m,startEdit:f,cancelEdit:h,setEditValue:y,submitEdit:g}=_n(n,c),b={fontSize:l?d.h6.fontSize:d.h5.fontSize};return e(Yn,{label:r,dense:l,children:t(o,u?{display:"flex",alignItems:"center",children:[e(it,{size:l?"small":"medium",checked:m,onChange:e=>y(e.target.checked)}),e(Fn,{onClickCancel:h,onClickSubmit:g})]}:{display:"flex",alignItems:"center","aria-labelledby":s,role:"checkbox","aria-checked":n,children:[void 0===n?e(k,{variant:"h5",children:i}):n?e(tt,{color:"success",sx:b}):e(p,{color:"error",sx:b}),a&&e(qn,{dense:l,onClick:f})]})})},Kn=({label:n,value:i,format:a,placeholder:l=Hn,editable:c,editInputType:s="datetime",dense:d,onEdit:u=(()=>null)})=>{const{isEditing:p,editValue:m,startEdit:f,cancelEdit:h,setEditValue:y,submitEdit:g}=_n(i,u),b=Un(n),v=i&&De(i,a)||l;return e(Yn,{label:n,hideLabel:p,tooltip:v,dense:d,sx:{display:"flex",flexDirection:"column"},children:p?e("datetime"===s?at:"time"===s?lt:ot,{value:m,format:a,label:n,onChange:e=>y(e||void 0),slots:{textField:n=>e(oe,{...n,size:"small",InputProps:{...n.InputProps,endAdornment:t(r,{children:[n.InputProps?.endAdornment,e(Fn,{onClickCancel:h,onClickSubmit:g,sx:{ml:2}})]}),sx:{marginY:d?.2:1}}})}}):t(o,{display:"flex",alignItems:"center","aria-labelledby":b,children:[e(k,{variant:d?"body1":"h5",noWrap:!0,children:v}),c&&e(qn,{dense:d,onClick:f})]})})},Qn=({title:r,subtitle:n,centered:i,children:a,dense:l})=>{const{typography:c}=E(),s=kt({lightWeight:200,darkWeight:800});return t(w,{sx:{paddingBottom:l?0:1},children:[t(o,{bgcolor:s,px:l?1:2,py:l?.5:1,lineHeight:l?0:void 0,children:[e(k,{variant:l?"body1":"h6",role:"heading","aria-level":1,children:r}),n&&e(k,{variant:l?"caption":"body2",role:"heading","aria-level":2,lineHeight:l?c.pxToRem(15):void 0,children:n})]}),e(W,{container:!0,padding:1,rowSpacing:l?1:2,justifyContent:i?"center":"flex-start",children:a})]})},Zn=({label:r,value:n=0,maxRating:i=5,editable:a,dense:l,onEdit:c=(()=>null)})=>{const{isEditing:s,editValue:d,startEdit:u,cancelEdit:p,setEditValue:m,submitEdit:f}=_n(n,c),h=Un(r);return e(Yn,{label:r,tooltip:n.toString(),dense:l,children:t(o,{display:"flex",alignItems:"center","aria-labelledby":h,children:[e(ct,{readOnly:!s,max:i,size:l?"small":"medium",value:s?d:n,onChange:(e,t)=>{Number.isNaN(t)&&e.currentTarget.value?m(parseInt(e.currentTarget.value,10)):t&&m(t)}}),a&&!s&&e(qn,{dense:l,onClick:u}),s&&e(Fn,{onClickCancel:p,onClickSubmit:f})]})})},ei={root:"RdsValueItem-root",content:"RdsValueItem-content"},ti=({children:t,bordered:r=!0,...n})=>{const i=((e,t)=>{const r=`solid ${t} 1px`,n="none";if(e){if(Array.isArray(e))return e.map((e=>e?r:n));if("object"==typeof e){const t={};return Object.entries(e).forEach((([e,i])=>{t[e]=i?r:n})),t}return r}})(r,kt({lightWeight:200,darkWeight:800}));return e(W,{item:!0,className:ei.root,...n,children:e(o,{className:ei.content,px:1,borderLeft:i,children:t})})},ri=({label:t,value:r,placeholder:n=Hn,variant:i})=>{const o=Un(t);let a;return a=Array.isArray(r)?r.map(((t,r)=>e(Bt,{text:t.toString()||n,variant:Array.isArray(i)?i[r]:i},r))):e(Bt,{text:r?.toString()||n,variant:Array.isArray(i)?i[0]:i}),e(Yn,{label:t,children:e(W,{container:!0,gap:1,"aria-labelledby":o,children:a})})},ni=({drawerProviderProps:r,children:n})=>{const[i,o,a]=n;return t(ur,{...r,children:[i,o,e(kr,{children:a})]})},ii=()=>e(st,{color:"error",sx:{width:200,height:200}}),oi=({loading:r,children:n,fetching:i,error:a})=>{const[l,c]=n;return e(qt,{children:t(o,{display:"flex",flexDirection:"column",height:1,children:[l,i&&e(o,{width:1,children:e(ve,{})}),r&&e(Er,{}),a&&e(o,{mt:4,children:e(Gr,{icon:a.icon||ii,title:a.title||"There has been an error",subtitle:a.message})}),!r&&!a&&c]})})},ai=new Error("NotificationCenterContext.Provider is required and was undefined"),li=y(void 0),ci=()=>{const e=g(li);if(void 0===e)throw ai;return e},si=({children:r,autoHideDuration:i=6e3})=>{const[o,a]=h(void 0),[l,c]=h(!1),d=()=>{c(!1)};return t(li.Provider,{value:{show:e=>{a(e),c(!0)},hide:d},children:[e(dt,{open:l,autoHideDuration:i,onClose:d,anchorOrigin:{vertical:"top",horizontal:"right"},children:t(n,{onClose:d,severity:o?.severity,"aria-label":o?.severity,sx:{width:"100%"},children:[o?.title&&e(s,{children:o?.title}),o?.message]})}),r]})},di=(e,t,{from:r,to:n})=>{const i=b(),{show:o}=ci();v((()=>{i.current===r&&t===n&&o(e),i.current=t}),[t])},ui=(t,r,{dense:n}={})=>{const{id:i,name:o,type:a}=t,l=r[i];return"boolean"===a?e(Gn,{dense:n,label:o,value:l}):"date"===a||"time"===a||"datetime"===a?e(Kn,{dense:n,label:o,value:l,format:t.format}):"object"!=typeof l||Array.isArray(l)?e(Jn,{dense:n,label:o,value:l?.toString()}):e(Jn,{dense:n,label:o,value:JSON.stringify(l)})},pi=({field:{name:t,description:r,value:n},instance:i,dense:o})=>{const a=[{field:"id",headerName:"ID",width:70}];n.forEach((e=>{a.push({field:e.id,headerName:e.name})}));const l=i.map(((e,t)=>({id:t,...e})));return e(Qn,{title:t,subtitle:r,dense:o,children:e(W,{item:!0,xs:12,children:e(ut,{rows:l,columns:a,density:o?"compact":"standard",disableRowSelectionOnClick:!0,pageSizeOptions:[5],initialState:{pagination:{paginationModel:{pageSize:5}}},sx:{height:400}})})})},mi=({field:{name:t,description:r,value:n},instance:i,dense:o})=>{const a=Et();return e(Qn,{title:t,subtitle:r,dense:o,children:n.map((t=>{const{id:r,xs:n,sm:l,md:c,lg:s,xl:d}=t,u=a.increment(t);return e(ti,{xs:n,sm:l,md:c,lg:s,xl:d,bordered:u,children:ui(t,i,{dense:o})},r)}))})},fi=({model:t,instance:r,dense:n})=>{const i=Et();return e(W,{container:!0,spacing:n?1:2,children:t.fields.map((t=>{const{id:o,type:a,xs:l=3,sm:c=0,md:s=0,lg:d=0,xl:u=0}=t;if("group"===a)return i.increment({xs:12}),e(W,{item:!0,xs:12,children:e(mi,{field:t,instance:r[o],dense:n})},o);if("group[]"===a)return i.increment({xs:12}),e(W,{item:!0,xs:12,children:e(pi,{field:t,instance:r[o],dense:n})},o);const p=i.increment(t);return e(ti,{xs:l,sm:c,md:s,lg:d,xl:u,bordered:p,children:ui(t,r,{dense:n})},o)}))})},hi={string:"",number:0,boolean:!1,enum:"",multienum:[],date:new Date(1970,0,1,0,0),time:new Date(1970,0,1,0,0),datetime:new Date(1970,0,1,0,0),group:{},"group[]":[],"string[]":[],"number[]":[]},yi=(e,t)=>t&&t[e.id]||"default"in e&&e.default||hi[e.type],gi=(e,t=undefined)=>{const r={};return e.fields.forEach((e=>{if("group"===e.type){const n={};e.value.forEach((r=>{n[r.id]=yi(r,t&&t[e.id])})),r[e.id]=n}else r[e.id]=yi(e,t)})),r},bi=({field:r,path:n=[],value:i,dense:a,update:l,onChangeValue:c})=>{const s=e=>{e.preventDefault(),c([...n,e.target.name],e.target.checked)},d=e=>{e.preventDefault(),c([...n,e.target.name],e.target.value)},u=e=>{e.preventDefault();const{value:t}=e.target,r="string"==typeof t?t.split(","):t;c([...n,e.target.name],r)},p=(e,t)=>{e.preventDefault();let r=e.target.value;"number"===t&&"string"==typeof r?r=parseInt(e.target.value,10):t.includes("[]")&&(r=e.target.value.split(",")),c([...n,e.target.name],r)},m=(e,t)=>{c([...n,t],e)};kt({lightWeight:200,darkWeight:800});const{id:f,type:h,name:y,description:g,updatable:b=!0,required:v=!0,xs:x,sm:C,md:S,lg:w,xl:$}=r,T=!b&&l;let k;const E=a?"small":"medium";if("group"===h)k=e(Qn,{title:y,subtitle:g,dense:a,children:e(W,{container:!0,spacing:2,sx:{p:2},children:r.value.map((t=>e(bi,{field:t,dense:a,path:[...n,f],value:i[t.id],update:l,onChangeValue:c},t.id)))})});else if("boolean"===h)k=e(o,{sx:{height:1,display:"flex",alignItems:"center"},children:e(pt,{control:e(mt,{name:f,size:E,onChange:s,checked:i,disabled:T}),label:y})});else if("enum"===h)k=t(Ce,{fullWidth:!0,children:[e(Se,{id:`${f}-select-label`,children:y}),e($e,{labelId:`${f}-select-label`,id:`${f}-select`,value:i,label:y,name:f,size:E,onChange:d,required:v,disabled:T,children:r.value.map((t=>e(ft,{value:t,children:t},t)))})]});else if("multienum"===h)k=t(Ce,{fullWidth:!0,children:[e(Se,{id:`${f}-select-label`,children:y}),e($e,{labelId:`${f}-select-label`,id:`${f}-select`,value:i||[],renderValue:e=>e.join(", "),label:y,name:f,size:E,onChange:u,required:v,disabled:T,multiple:!0,children:r.value.map((r=>t(ft,{value:r,children:[e(mt,{checked:(i||[]).includes(r)}),e(N,{primary:r})]},r)))})]});else if("date"===h)k=e(Be,{label:y,format:r.format,value:i,slotProps:{field:{size:E}},disabled:T,onChange:e=>m(e,f)});else if("time"===h)k=e(Le,{label:y,format:r.format,value:i,slotProps:{field:{size:E}},disabled:T,onChange:e=>m(e,f)});else if("datetime"===h)k=e(Fe,{label:y,format:r.format,value:i,slotProps:{field:{size:E}},disabled:T,onChange:e=>m(e,f)});else{if("group[]"===h)return null;k=h.includes("[]")?e(oe,{required:v,type:"text",label:y,name:f,size:E,variant:"outlined",helperText:"Use comas to separate multiple values",fullWidth:!0,disabled:T,value:i.join(","),onChange:e=>p(e,h)}):e(oe,{required:v,type:h,label:y,size:E,name:f,variant:"outlined",fullWidth:!0,value:i,disabled:T,onChange:e=>p(e,h)})}return e(W,{item:!0,xs:x,sm:C,md:S,lg:w,xl:$,children:k},f)};function vi(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function xi(e){return function t(r){return 0===arguments.length||vi(r)?t:e.apply(this,arguments)}}function Ci(e){return function t(r,n){switch(arguments.length){case 0:return t;case 1:return vi(r)?t:xi((function(t){return e(r,t)}));default:return vi(r)&&vi(n)?t:vi(r)?xi((function(t){return e(t,n)})):vi(n)?xi((function(t){return e(r,t)})):e(r,n)}}}function Si(e){return function t(r,n,i){switch(arguments.length){case 0:return t;case 1:return vi(r)?t:Ci((function(t,n){return e(r,t,n)}));case 2:return vi(r)&&vi(n)?t:vi(r)?Ci((function(t,r){return e(t,n,r)})):vi(n)?Ci((function(t,n){return e(r,t,n)})):xi((function(t){return e(r,n,t)}));default:return vi(r)&&vi(n)&&vi(i)?t:vi(r)&&vi(n)?Ci((function(t,r){return e(t,r,i)})):vi(r)&&vi(i)?Ci((function(t,r){return e(t,n,r)})):vi(n)&&vi(i)?Ci((function(t,n){return e(r,t,n)})):vi(r)?xi((function(t){return e(t,n,i)})):vi(n)?xi((function(t){return e(r,t,i)})):vi(i)?xi((function(t){return e(r,n,t)})):e(r,n,i)}}}var wi=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)};var $i=Number.isInteger||function(e){return e<<0===e};var Ti=xi((function(e){return null==e})),ki=Si((function e(t,r,n){if(0===t.length)return r;var i=t[0];if(t.length>1){var o=!Ti(n)&&function(e,t){return Object.prototype.hasOwnProperty.call(t,e)}(i,n)&&"object"==typeof n[i]?n[i]:$i(t[1])?[]:{};r=e(Array.prototype.slice.call(t,1),r,o)}return function(e,t,r){if($i(e)&&wi(r)){var n=[].concat(r);return n[e]=t,n}var i={};for(var o in r)i[o]=r[o];return i[e]=t,i}(i,r,n)}));const Ei=({model:r,saveButtonText:n,dense:i,onSubmit:o,initialValues:a})=>{const l=S((()=>gi(r,a)),[r,a]),[c,s]=h(l),d=(e,t)=>{s((r=>ki(e,t,r)))};return t(W,{container:!0,component:"form",spacing:2,onSubmit:e=>{e.preventDefault(),o(c)},children:[r.fields.map((t=>e(bi,{dense:i,field:t,value:c[t.id],update:!!a,onChangeValue:d},t.id))),e(W,{item:!0,xs:12,children:e(K,{type:"submit",variant:"contained",size:i?"small":"medium",children:n})})]})},Ii=({model:r,modelName:n,basePath:i="",submitUpdateItemRequest:o,updateItemRequest:a,updateItem:l,onSubmitUpdateItem:c,onRequestUpdateItem:s})=>{const{id:d=""}=q(),u=a.loading||o.loading;return v((()=>{s(d)}),[d]),di({title:"Item updated",message:`The item ${d} has been updated successfully`,severity:"success"},!!o.success,{from:!1,to:!0}),jt(`${i}/`,!!o.success,{from:!1,to:!0}),di({title:"We had an error",message:o.error||"",severity:"error"},!!o.error,{from:!1,to:!0}),t(oi,{loading:u,children:[e(Yt,{title:`Edit ${d}`,preset:"default",breadcrumbs:[{id:"list",text:n,link:`${i}/`},{id:"update",text:`Edit ${d}`,link:`${i}/${d}/update`}]}),e(St,{children:e(Ei,{model:r,initialValues:l,saveButtonText:"Save",onSubmit:c})})]})},Pi=({columns:n,options:i,data:o,onClick:a,search:c,defaultSort:s,defaultOrder:d,loading:u})=>{const p=[...n,{id:"__options",label:"",disablePadding:!1,numeric:!1,sort:!1}],[m,f]=h(null);return t(r,{children:[e(Bn,{columns:p,data:o,search:c,defaultSort:s,defaultOrder:d,loading:u,children:r=>r.map(((r,n)=>t(Ke,{onClick:()=>a&&a(r),role:"row","aria-rowindex":n,sx:{cursor:a&&"pointer"},children:[p.map((({id:t},i)=>e(Ge,{role:"cell",scope:"row","aria-rowindex":n,"aria-colindex":i,children:r[t]},t.toString()))),i&&e(Ge,{children:e(l,{"data-testid":`options-${r.id}`,onClick:e=>{e.stopPropagation(),f({item:r,anchor:e.currentTarget})},children:e(yt,{})})})]},r.id)))}),i&&e(ht,{anchorEl:m?.anchor,open:!!m,onClose:()=>f(null),anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:i.map((({id:t,label:r,onClick:n})=>e(ft,{onClick:()=>{m&&n(m?.item),f(null)},children:r},t)))})]})},Oi=({model:r,modelName:n,listData:i,listRequest:o,deleteRequest:a,basePath:l="",deleteFeature:c=!0,updateFeature:s=!0,addFeature:d=!0,detailsFeature:u=!0,onRequestList:p,onClickDeleteItem:m})=>{const f=_();v((()=>{p()}),[]),di({title:"Item deleted",message:"The item has been deleted successfully",severity:"success"},!!a.success,{from:!1,to:!0}),di({title:"We had an error",message:a.error||"",severity:"error"},!!a.error,{from:!1,to:!0});const h=u?e=>{f(`${l}/${e.id}`)}:void 0,y=(e,t)=>{"edit"===e?f(`${l}/${t.id}/update`):m(t)},g=[];s&&g.push({id:"edit",label:"Edit",onClick:e=>y("edit",e)}),c&&g.push({id:"remove",label:"Remove",onClick:e=>y("remove",e)});const b=[];return d&&b.push({id:"add",text:"Add",href:`${l}/add`}),t(oi,{loading:o.loading||a.loading,children:[e(Yt,{title:n,preset:"default",actions:b.length>0?b:void 0}),e(St,{children:e(Pi,{columns:r.fields.filter((({listable:e})=>e)).map((({id:e,name:t,type:r})=>({disablePadding:!1,id:e,label:t,numeric:"number"===r,sort:!1}))),data:i,defaultSort:r.fields[0].id,onClick:h,options:g.length>0?g:void 0})})]})},zi=({model:r,modelName:n,basePath:i="",onSubmitNewItem:o,newItemRequest:a})=>(di({message:"Item added successfully",severity:"success"},!!a.success,{from:!1,to:!0}),jt(`${i}/`,!!a.success,{from:!1,to:!0}),di({title:"We had an error",message:a.error||"",severity:"error"},!!a.error,{from:!1,to:!0}),t(oi,{loading:a.loading,children:[e(Yt,{title:`Add ${n}`,preset:"default",breadcrumbs:[{id:"list",text:n,link:`${i}/`},{id:"add",text:`Add new ${n}`,link:`${i}/add`}]}),e(St,{children:e(Ei,{model:r,saveButtonText:"Save",onSubmit:o})})]})),Ri=({model:r,modelName:n,basePath:i="",onRequestItem:o,itemRequest:a,detailsItem:l})=>{const{id:c=""}=q();return v((()=>{o(c)}),[c]),t(oi,{loading:a.loading,children:[e(Yt,{title:c,preset:"default",breadcrumbs:[{id:"list",text:n,link:`${i}/`},{id:"detail",text:c,link:`${i}/${c}`}]}),e(St,{children:l&&e(fi,{model:r,instance:l})})]})},Ai=r=>{const{updateFeature:n=!0,addFeature:i=!0,detailsFeature:o=!0}=r;return t(H,{children:[e(U,{path:"",element:e(Oi,{...r})}),o&&e(U,{path:":id",element:e(Ri,{...r})}),i&&e(U,{path:"add",element:e(zi,{...r})}),n&&e(U,{path:":id/update",element:e(Ii,{...r})})]})},ji={idle:!0},Wi={loading:!0},Di={success:!0};export{Fr as Action,Lr as ActionHeader,Dr as Autocomplete,vt as Board,Jt as BootstrapDialog,Nt as Bullet,wt as CenterContainer,Xt as ConfirmDialog,St as Content,Zr as ContentPlaceholder,Vr as DateRangeCalendar,Br as DateRangePicker,Hn as DefaultPlaceholder,cr as Drawer,wr as DrawerAppBar,xr as DrawerContent,Qt as DrawerContext,nr as DrawerHeader,ni as DrawerLayout,kr as DrawerMain,ur as DrawerProvider,vr as DrawerSection,pr as DrawerSubheader,Ln as EnhancedRemoteTable,Bn as EnhancedTable,Nn as EnhancedTableHead,Ct as ExpandableAlert,Gt as FormDialog,Qn as GroupValueCard,Yt as Header,oi as HeaderLayout,Ut as HeaderSubtitle,Ht as HeaderTitle,ji as IdleRequest,Bt as Label,Dt as ListPanel,Pt as ListPanelContext,Ot as ListPanelContextProvider,Er as LoadingArea,Wi as LoadingRequest,en as LoremIpsumPlaceholder,bt as Markdown,Ei as ModelForm,Ai as ModelRouter,li as NotificationCenterContext,si as NotificationCenterProvider,ai as NotificationCenterProviderUndefinedError,fi as ObjectDetails,Gr as Placeholder,Ir as QueryContainer,Or as Select,zr as SignIn,Kr as SkeletonCard,Qr as SkeletonGrid,Di as SuccessRequest,Yr as TabCard,Jr as TabCardPanel,Lt as TabContext,Ft as TabContextProvider,Xr as TabPanel,qt as TabProvider,Pi as TableList,Wr as TextField,Zt as UndefinedProvider,Gn as ValueBoolean,Xn as ValueCard,Kn as ValueDatetime,qn as ValueEditButton,Fn as ValueEditButtons,ti as ValueItem,ri as ValueLabel,Zn as ValueRating,Jn as ValueText,Mt as bulletClasses,mr as getDrawerItemColors,It as getFormData,Tt as getRandomItem,Vt as labelClasses,gt as markdownDefaultOptions,$t as newArrayWithSize,Et as newBreakpointsCounter,gi as newInstanceFromValuesOrZeroValue,Kt as useDialog,er as useDrawer,_n as useEditableValueDisplay,kt as useGetDefaultThemeColor,zt as useListPanel,ci as useNotificationCenter,di as useNotifyWhenValueChanges,_t as useTab,ei as valueItemClasses};
23
+ */zn={exports:{}},"production"===process.env.NODE_ENV?zn.exports=function(){if(In)return Pn;In=1;var e,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.server_context"),s=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen");function h(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:switch(e=e.type){case n:case o:case i:case d:case u:return e;default:switch(e=e&&e.$$typeof){case c:case l:case s:case m:case p:case a:return e;default:return f}}case r:return f}}}return e=Symbol.for("react.module.reference"),Pn.ContextConsumer=l,Pn.ContextProvider=a,Pn.Element=t,Pn.ForwardRef=s,Pn.Fragment=n,Pn.Lazy=m,Pn.Memo=p,Pn.Portal=r,Pn.Profiler=o,Pn.StrictMode=i,Pn.Suspense=d,Pn.SuspenseList=u,Pn.isAsyncMode=function(){return!1},Pn.isConcurrentMode=function(){return!1},Pn.isContextConsumer=function(e){return h(e)===l},Pn.isContextProvider=function(e){return h(e)===a},Pn.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Pn.isForwardRef=function(e){return h(e)===s},Pn.isFragment=function(e){return h(e)===n},Pn.isLazy=function(e){return h(e)===m},Pn.isMemo=function(e){return h(e)===p},Pn.isPortal=function(e){return h(e)===r},Pn.isProfiler=function(e){return h(e)===o},Pn.isStrictMode=function(e){return h(e)===i},Pn.isSuspense=function(e){return h(e)===d},Pn.isSuspenseList=function(e){return h(e)===u},Pn.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===n||t===o||t===i||t===d||t===u||t===f||"object"==typeof t&&null!==t&&(t.$$typeof===m||t.$$typeof===p||t.$$typeof===a||t.$$typeof===l||t.$$typeof===s||t.$$typeof===e||void 0!==t.getModuleId)},Pn.typeOf=h,Pn}():zn.exports=(On||(On=1,"production"!==process.env.NODE_ENV&&function(){var e,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.server_context"),s=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen");function h(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:var h=e.type;switch(h){case n:case o:case i:case d:case u:return h;default:var y=h&&h.$$typeof;switch(y){case c:case l:case s:case m:case p:case a:return y;default:return f}}case r:return f}}}e=Symbol.for("react.module.reference");var y=l,g=a,b=t,v=s,x=n,C=m,S=p,w=r,$=o,T=i,k=d,E=u,I=!1,P=!1;Rn.ContextConsumer=y,Rn.ContextProvider=g,Rn.Element=b,Rn.ForwardRef=v,Rn.Fragment=x,Rn.Lazy=C,Rn.Memo=S,Rn.Portal=w,Rn.Profiler=$,Rn.StrictMode=T,Rn.Suspense=k,Rn.SuspenseList=E,Rn.isAsyncMode=function(e){return I||(I=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1},Rn.isConcurrentMode=function(e){return P||(P=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1},Rn.isContextConsumer=function(e){return h(e)===l},Rn.isContextProvider=function(e){return h(e)===a},Rn.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Rn.isForwardRef=function(e){return h(e)===s},Rn.isFragment=function(e){return h(e)===n},Rn.isLazy=function(e){return h(e)===m},Rn.isMemo=function(e){return h(e)===p},Rn.isPortal=function(e){return h(e)===r},Rn.isProfiler=function(e){return h(e)===o},Rn.isStrictMode=function(e){return h(e)===i},Rn.isSuspense=function(e){return h(e)===d},Rn.isSuspenseList=function(e){return h(e)===u},Rn.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===n||t===o||t===i||t===d||t===u||t===f||"object"==typeof t&&null!==t&&(t.$$typeof===m||t.$$typeof===p||t.$$typeof===a||t.$$typeof===l||t.$$typeof===s||t.$$typeof===e||void 0!==t.getModuleId)},Rn.typeOf=h}()),Rn),"undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),nn.exports.oneOfType([nn.exports.func,nn.exports.object]);const An={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};const jn=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};function Wn(e,t,r,n){const i=e[t];if(null==i||!jn(i)){const e=function(e){const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":Number.isFinite(e)?e!==Math.floor(e)?"float":"number":"Infinity";case"object":return null===e?"null":e.constructor.name;default:return t}}(i);return new RangeError(`Invalid ${n} \`${t}\` of type \`${e}\` supplied to \`${r}\`, expected \`integer\`.`)}return null}function Dn(e,t,...r){return void 0===e[t]?null:Wn(e,t,...r)}function Mn(){return null}Dn.isRequired=Wn,Mn.isRequired=Mn,process.env.NODE_ENV;const Nn=({order:r,orderBy:n,headCells:i,onRequestSort:a})=>e(et,{children:e(Ke,{children:i.map((i=>{return e(Ge,{variant:"head",padding:i.disablePadding?"none":"normal",sortDirection:n===i.id&&r,sx:{fontWeight:"bold"},children:i.sort?t(Ze,{active:n===i.id,direction:n===i.id?r:"asc",onClick:(l=i.id,()=>{a(l)}),children:[i.label,n===i.id?e(o,{component:"span",sx:An,children:"desc"===r?"sorted descending":"sorted ascending"}):null]}):i.label},String(i.id));var l}))})});function Vn(e,t,r){return t[r]<e[r]?-1:t[r]>e[r]?1:0}const Bn=({children:n,data:i,search:a,columns:l,defaultSort:c,defaultOrder:s="asc",loading:d=!1})=>{const[u,p]=h(""),[m,f]=h(s),[y,g]=h(c),b=i.slice().filter(function(e,t){return r=>!t||e.some((e=>{let n=r[e.id];return n?.toLowerCase&&(n=n.toLowerCase()),n?.toString().includes(t.toLowerCase())}))}(l,u)).sort(function(e,t){return"desc"===e?(e,r)=>Vn(e,r,t):(e,r)=>-Vn(e,r,t)}(m,y));return e(r,{children:t(o,{sx:{paddingX:1,paddingBottom:2},children:[a&&e(o,{paddingY:2,children:e(oe,{fullWidth:!0,placeholder:"Search",InputProps:{role:"search",startAdornment:e(ze,{position:"start",children:e(Qe,{})})},onChange:e=>p(e.target.value)})}),e(Ye,{children:t(Xe,{children:[e(Nn,{order:m,orderBy:y,headCells:l,onRequestSort:e=>{f(y===e&&"asc"===m?"desc":"asc"),g(e)}}),e(Je,{children:d?e(Ke,{children:e(Ge,{colSpan:l.length,sx:{textAlign:"center"},children:e(Q,{})})}):0===b.length?e(Ke,{children:e(Ge,{colSpan:l.length,sx:{textAlign:"center"},children:"No data"})}):n(b)})]})})]})})};Bn.defaultProps={defaultOrder:"asc"};const Ln=({children:n,data:i,loading:o,columns:a,defaultSort:l,defaultOrder:c,onRequestSort:s})=>{const[d,u]=h({orderBy:l,order:c||"asc"});return e(r,{children:e(Ye,{children:t(Xe,{children:[e(Nn,{order:d.order,orderBy:d.orderBy,headCells:a,onRequestSort:e=>{u((({orderBy:t,order:r})=>{const n=t===e&&"asc"===r?"desc":"asc";return s(e,n),{orderBy:e,order:n}}))}}),e(Je,{children:o?e(Ke,{children:e(Ge,{colSpan:a.length,sx:{textAlign:"center"},children:e(Q,{})})}):i.map(((e,t)=>n(e,t)))})]})})})},Fn=({onClickCancel:r,onClickSubmit:n,sx:i})=>t(ze,{position:"end",sx:i,children:[e(K,{variant:"contained",size:"small",color:"error","aria-label":"cancel button",startIcon:e(rt,{sx:{fontSize:12}}),onClick:r,sx:{paddingRight:0,minWidth:0,marginRight:1}}),e(K,{variant:"contained",size:"small",color:"primary","aria-label":"submit button",startIcon:e(tt,{sx:{fontSize:12}}),onClick:n,sx:{paddingRight:0,minWidth:0}})]}),_n=(e,t)=>{const[r,n]=h(!1),[i,o]=h(e),a=()=>{n(!1),o(e)};return{isEditing:r,cancelEdit:a,editValue:i,setEditValue:o,startEdit:()=>{n(!0)},submitEdit:()=>{t(i),a()}}},qn=({dense:t,onClick:r})=>{const{typography:n}=E();return e(l,{size:"small",onClick:r,sx:{ml:t?.5:1},"aria-label":"edit button",children:e(nt,{sx:{fontSize:n.pxToRem(t?18:24)}})})},Hn="-",Un=e=>`label-${e.replace(/ /g,"-")}`,Yn=({label:r,hideLabel:n,tooltip:i,tooltipEnterDelay:a=2e3,children:l,dense:c,sx:s})=>{const{typography:d}=E(),u=Un(r);return t(o,{width:1,lineHeight:c?0:void 0,sx:s,children:[!n&&e(k,{variant:c?"caption":"subtitle2",role:"label",id:u,lineHeight:c?d.pxToRem(15):void 0,children:r}),i?e(T,{title:i,placement:"top",enterDelay:a,children:l}):l]})},Jn=({label:r,value:n,placeholder:i=Hn,editable:a,dense:l,onEdit:c=(()=>null)})=>{const s=b(null),{isEditing:d,editValue:u,startEdit:p,cancelEdit:m,setEditValue:f,submitEdit:h}=_n(n?.toString(),c),y=Un(r),g=n?.toString()||i,x=e=>{"Enter"===e.key&&c(e.target.value)};return v((()=>(s.current?.addEventListener("keypress",x),()=>s.current?.removeEventListener("keypress",x))),[s.current]),e(Yn,{hideLabel:d,label:r,tooltip:g,dense:l,children:d?e(oe,{inputRef:s,value:u,label:r,size:"small",onChange:e=>f(e.target.value),InputProps:{endAdornment:e(Fn,{onClickCancel:m,onClickSubmit:h})},sx:{marginY:l?0:1}}):t(o,{display:"flex","aria-labelledby":y,children:[e(k,{variant:l?"body1":"h5",noWrap:!0,children:g}),a&&e(qn,{dense:l,onClick:p})]})})},Xn=({children:t})=>e(w,{sx:{p:2},children:t}),Gn=({label:r,value:n,placeholder:i=Hn,editable:a,dense:l,onEdit:c=(()=>null)})=>{const s=Un(r),{typography:d}=E(),{isEditing:u,editValue:m,startEdit:f,cancelEdit:h,setEditValue:y,submitEdit:g}=_n(n,c),b={fontSize:l?d.h6.fontSize:d.h5.fontSize};return e(Yn,{label:r,dense:l,children:t(o,u?{display:"flex",alignItems:"center",children:[e(it,{size:l?"small":"medium",checked:m,onChange:e=>y(e.target.checked)}),e(Fn,{onClickCancel:h,onClickSubmit:g})]}:{display:"flex",alignItems:"center","aria-labelledby":s,role:"checkbox","aria-checked":n,children:[void 0===n?e(k,{variant:"h5",children:i}):n?e(tt,{color:"success",sx:b}):e(p,{color:"error",sx:b}),a&&e(qn,{dense:l,onClick:f})]})})},Kn=({label:n,value:i,format:a,placeholder:l=Hn,editable:c,editInputType:s="datetime",dense:d,onEdit:u=(()=>null)})=>{const{isEditing:p,editValue:m,startEdit:f,cancelEdit:h,setEditValue:y,submitEdit:g}=_n(i,u),b=Un(n),v=i&&De(i,a)||l;return e(Yn,{label:n,hideLabel:p,tooltip:v,dense:d,sx:{display:"flex",flexDirection:"column"},children:p?e("datetime"===s?at:"time"===s?lt:ot,{value:m,format:a,label:n,onChange:e=>y(e||void 0),slots:{textField:n=>e(oe,{...n,size:"small",InputProps:{...n.InputProps,endAdornment:t(r,{children:[n.InputProps?.endAdornment,e(Fn,{onClickCancel:h,onClickSubmit:g,sx:{ml:2}})]}),sx:{marginY:d?.2:1}}})}}):t(o,{display:"flex",alignItems:"center","aria-labelledby":b,children:[e(k,{variant:d?"body1":"h5",noWrap:!0,children:v}),c&&e(qn,{dense:d,onClick:f})]})})},Qn=({title:r,subtitle:n,centered:i,children:a,dense:l})=>{const{typography:c}=E(),s=kt({lightWeight:200,darkWeight:800});return t(w,{sx:{paddingBottom:l?0:1},children:[t(o,{bgcolor:s,px:l?1:2,py:l?.5:1,lineHeight:l?0:void 0,children:[e(k,{variant:l?"body1":"h6",role:"heading","aria-level":1,children:r}),n&&e(k,{variant:l?"caption":"body2",role:"heading","aria-level":2,lineHeight:l?c.pxToRem(15):void 0,children:n})]}),e(W,{container:!0,padding:1,rowSpacing:l?1:2,justifyContent:i?"center":"flex-start",children:a})]})},Zn=({label:r,value:n=0,maxRating:i=5,editable:a,dense:l,onEdit:c=(()=>null)})=>{const{isEditing:s,editValue:d,startEdit:u,cancelEdit:p,setEditValue:m,submitEdit:f}=_n(n,c),h=Un(r);return e(Yn,{label:r,tooltip:n.toString(),dense:l,children:t(o,{display:"flex",alignItems:"center","aria-labelledby":h,children:[e(ct,{readOnly:!s,max:i,size:l?"small":"medium",value:s?d:n,onChange:(e,t)=>{Number.isNaN(t)&&e.currentTarget.value?m(parseInt(e.currentTarget.value,10)):t&&m(t)}}),a&&!s&&e(qn,{dense:l,onClick:u}),s&&e(Fn,{onClickCancel:p,onClickSubmit:f})]})})},ei={root:"RdsValueItem-root",content:"RdsValueItem-content"},ti=({children:t,bordered:r=!0,...n})=>{const i=((e,t)=>{const r=`solid ${t} 1px`,n="none";if(e){if(Array.isArray(e))return e.map((e=>e?r:n));if("object"==typeof e){const t={};return Object.entries(e).forEach((([e,i])=>{t[e]=i?r:n})),t}return r}})(r,kt({lightWeight:200,darkWeight:800}));return e(W,{item:!0,className:ei.root,...n,children:e(o,{className:ei.content,px:1,borderLeft:i,children:t})})},ri=({label:t,value:r,placeholder:n=Hn,color:i,variant:o})=>{const a=Un(t);let l;return l=Array.isArray(r)?r.map(((t,r)=>e(Bt,{text:t.toString()||n,variant:Array.isArray(o)?o[r]:o,color:Array.isArray(i)?i[r]:i},r))):e(Bt,{text:r?.toString()||n,variant:Array.isArray(o)?o[0]:o,color:Array.isArray(i)?i[0]:i}),e(Yn,{label:t,children:e(W,{container:!0,gap:1,"aria-labelledby":a,children:l})})},ni=({drawerProviderProps:r,children:n})=>{const[i,o,a]=n;return t(ur,{...r,children:[i,o,e(kr,{children:a})]})},ii=()=>e(st,{color:"error",sx:{width:200,height:200}}),oi=({loading:r,children:n,fetching:i,error:a})=>{const[l,c]=n;return e(qt,{children:t(o,{display:"flex",flexDirection:"column",height:1,children:[l,i&&e(o,{width:1,children:e(ve,{})}),r&&e(Er,{}),a&&e(o,{mt:4,children:e(Gr,{icon:a.icon||ii,title:a.title||"There has been an error",subtitle:a.message})}),!r&&!a&&c]})})},ai=new Error("NotificationCenterContext.Provider is required and was undefined"),li=y(void 0),ci=()=>{const e=g(li);if(void 0===e)throw ai;return e},si=({children:r,autoHideDuration:i=6e3})=>{const[o,a]=h(void 0),[l,c]=h(!1),d=()=>{c(!1)};return t(li.Provider,{value:{show:e=>{a(e),c(!0)},hide:d},children:[e(dt,{open:l,autoHideDuration:i,onClose:d,anchorOrigin:{vertical:"top",horizontal:"right"},children:t(n,{onClose:d,severity:o?.severity,"aria-label":o?.severity,sx:{width:"100%"},children:[o?.title&&e(s,{children:o?.title}),o?.message]})}),r]})},di=(e,t,{from:r,to:n})=>{const i=b(),{show:o}=ci();v((()=>{i.current===r&&t===n&&o(e),i.current=t}),[t])},ui=(t,r,{dense:n}={})=>{const{id:i,name:o,type:a}=t,l=r[i];return"boolean"===a?e(Gn,{dense:n,label:o,value:l}):"date"===a||"time"===a||"datetime"===a?e(Kn,{dense:n,label:o,value:l,format:t.format}):"object"!=typeof l||Array.isArray(l)?e(Jn,{dense:n,label:o,value:l?.toString()}):e(Jn,{dense:n,label:o,value:JSON.stringify(l)})},pi=({field:{name:t,description:r,value:n},instance:i,dense:o})=>{const a=[{field:"id",headerName:"ID",width:70}];n.forEach((e=>{a.push({field:e.id,headerName:e.name})}));const l=i.map(((e,t)=>({id:t,...e})));return e(Qn,{title:t,subtitle:r,dense:o,children:e(W,{item:!0,xs:12,children:e(ut,{rows:l,columns:a,density:o?"compact":"standard",disableRowSelectionOnClick:!0,pageSizeOptions:[5],initialState:{pagination:{paginationModel:{pageSize:5}}},sx:{height:400}})})})},mi=({field:{name:t,description:r,value:n},instance:i,dense:o})=>{const a=Et();return e(Qn,{title:t,subtitle:r,dense:o,children:n.map((t=>{const{id:r,xs:n,sm:l,md:c,lg:s,xl:d}=t,u=a.increment(t);return e(ti,{xs:n,sm:l,md:c,lg:s,xl:d,bordered:u,children:ui(t,i,{dense:o})},r)}))})},fi=({model:t,instance:r,dense:n})=>{const i=Et();return e(W,{container:!0,spacing:n?1:2,children:t.fields.map((t=>{const{id:o,type:a,xs:l=3,sm:c=0,md:s=0,lg:d=0,xl:u=0}=t;if("group"===a)return i.increment({xs:12}),e(W,{item:!0,xs:12,children:e(mi,{field:t,instance:r[o],dense:n})},o);if("group[]"===a)return i.increment({xs:12}),e(W,{item:!0,xs:12,children:e(pi,{field:t,instance:r[o],dense:n})},o);const p=i.increment(t);return e(ti,{xs:l,sm:c,md:s,lg:d,xl:u,bordered:p,children:ui(t,r,{dense:n})},o)}))})},hi={string:"",number:0,boolean:!1,enum:"",multienum:[],date:new Date(1970,0,1,0,0),time:new Date(1970,0,1,0,0),datetime:new Date(1970,0,1,0,0),group:{},"group[]":[],"string[]":[],"number[]":[]},yi=(e,t)=>t&&t[e.id]||"default"in e&&e.default||hi[e.type],gi=(e,t=undefined)=>{const r={};return e.fields.forEach((e=>{if("group"===e.type){const n={};e.value.forEach((r=>{n[r.id]=yi(r,t&&t[e.id])})),r[e.id]=n}else r[e.id]=yi(e,t)})),r},bi=({field:r,path:n=[],value:i,dense:a,update:l,onChangeValue:c})=>{const s=e=>{e.preventDefault(),c([...n,e.target.name],e.target.checked)},d=e=>{e.preventDefault(),c([...n,e.target.name],e.target.value)},u=e=>{e.preventDefault();const{value:t}=e.target,r="string"==typeof t?t.split(","):t;c([...n,e.target.name],r)},p=(e,t)=>{e.preventDefault();let r=e.target.value;"number"===t&&"string"==typeof r?r=parseInt(e.target.value,10):t.includes("[]")&&(r=e.target.value.split(",")),c([...n,e.target.name],r)},m=(e,t)=>{c([...n,t],e)};kt({lightWeight:200,darkWeight:800});const{id:f,type:h,name:y,description:g,updatable:b=!0,required:v=!0,xs:x,sm:C,md:S,lg:w,xl:$}=r,T=!b&&l;let k;const E=a?"small":"medium";if("group"===h)k=e(Qn,{title:y,subtitle:g,dense:a,children:e(W,{container:!0,spacing:2,sx:{p:2},children:r.value.map((t=>e(bi,{field:t,dense:a,path:[...n,f],value:i[t.id],update:l,onChangeValue:c},t.id)))})});else if("boolean"===h)k=e(o,{sx:{height:1,display:"flex",alignItems:"center"},children:e(pt,{control:e(mt,{name:f,size:E,onChange:s,checked:i,disabled:T}),label:y})});else if("enum"===h)k=t(Ce,{fullWidth:!0,children:[e(Se,{id:`${f}-select-label`,children:y}),e($e,{labelId:`${f}-select-label`,id:`${f}-select`,value:i,label:y,name:f,size:E,onChange:d,required:v,disabled:T,children:r.value.map((t=>e(ft,{value:t,children:t},t)))})]});else if("multienum"===h)k=t(Ce,{fullWidth:!0,children:[e(Se,{id:`${f}-select-label`,children:y}),e($e,{labelId:`${f}-select-label`,id:`${f}-select`,value:i||[],renderValue:e=>e.join(", "),label:y,name:f,size:E,onChange:u,required:v,disabled:T,multiple:!0,children:r.value.map((r=>t(ft,{value:r,children:[e(mt,{checked:(i||[]).includes(r)}),e(N,{primary:r})]},r)))})]});else if("date"===h)k=e(Be,{label:y,format:r.format,value:i,slotProps:{field:{size:E}},disabled:T,onChange:e=>m(e,f)});else if("time"===h)k=e(Le,{label:y,format:r.format,value:i,slotProps:{field:{size:E}},disabled:T,onChange:e=>m(e,f)});else if("datetime"===h)k=e(Fe,{label:y,format:r.format,value:i,slotProps:{field:{size:E}},disabled:T,onChange:e=>m(e,f)});else{if("group[]"===h)return null;k=h.includes("[]")?e(oe,{required:v,type:"text",label:y,name:f,size:E,variant:"outlined",helperText:"Use comas to separate multiple values",fullWidth:!0,disabled:T,value:i.join(","),onChange:e=>p(e,h)}):e(oe,{required:v,type:h,label:y,size:E,name:f,variant:"outlined",fullWidth:!0,value:i,disabled:T,onChange:e=>p(e,h)})}return e(W,{item:!0,xs:x,sm:C,md:S,lg:w,xl:$,children:k},f)};function vi(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function xi(e){return function t(r){return 0===arguments.length||vi(r)?t:e.apply(this,arguments)}}function Ci(e){return function t(r,n){switch(arguments.length){case 0:return t;case 1:return vi(r)?t:xi((function(t){return e(r,t)}));default:return vi(r)&&vi(n)?t:vi(r)?xi((function(t){return e(t,n)})):vi(n)?xi((function(t){return e(r,t)})):e(r,n)}}}function Si(e){return function t(r,n,i){switch(arguments.length){case 0:return t;case 1:return vi(r)?t:Ci((function(t,n){return e(r,t,n)}));case 2:return vi(r)&&vi(n)?t:vi(r)?Ci((function(t,r){return e(t,n,r)})):vi(n)?Ci((function(t,n){return e(r,t,n)})):xi((function(t){return e(r,n,t)}));default:return vi(r)&&vi(n)&&vi(i)?t:vi(r)&&vi(n)?Ci((function(t,r){return e(t,r,i)})):vi(r)&&vi(i)?Ci((function(t,r){return e(t,n,r)})):vi(n)&&vi(i)?Ci((function(t,n){return e(r,t,n)})):vi(r)?xi((function(t){return e(t,n,i)})):vi(n)?xi((function(t){return e(r,t,i)})):vi(i)?xi((function(t){return e(r,n,t)})):e(r,n,i)}}}var wi=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)};var $i=Number.isInteger||function(e){return e<<0===e};var Ti=xi((function(e){return null==e})),ki=Si((function e(t,r,n){if(0===t.length)return r;var i=t[0];if(t.length>1){var o=!Ti(n)&&function(e,t){return Object.prototype.hasOwnProperty.call(t,e)}(i,n)&&"object"==typeof n[i]?n[i]:$i(t[1])?[]:{};r=e(Array.prototype.slice.call(t,1),r,o)}return function(e,t,r){if($i(e)&&wi(r)){var n=[].concat(r);return n[e]=t,n}var i={};for(var o in r)i[o]=r[o];return i[e]=t,i}(i,r,n)}));const Ei=({model:r,saveButtonText:n,dense:i,onSubmit:o,initialValues:a})=>{const l=S((()=>gi(r,a)),[r,a]),[c,s]=h(l),d=(e,t)=>{s((r=>ki(e,t,r)))};return t(W,{container:!0,component:"form",spacing:2,onSubmit:e=>{e.preventDefault(),o(c)},children:[r.fields.map((t=>e(bi,{dense:i,field:t,value:c[t.id],update:!!a,onChangeValue:d},t.id))),e(W,{item:!0,xs:12,children:e(K,{type:"submit",variant:"contained",size:i?"small":"medium",children:n})})]})},Ii=({model:r,modelName:n,basePath:i="",submitUpdateItemRequest:o,updateItemRequest:a,updateItem:l,onSubmitUpdateItem:c,onRequestUpdateItem:s})=>{const{id:d=""}=q(),u=a.loading||o.loading;return v((()=>{s(d)}),[d]),di({title:"Item updated",message:`The item ${d} has been updated successfully`,severity:"success"},!!o.success,{from:!1,to:!0}),jt(`${i}/`,!!o.success,{from:!1,to:!0}),di({title:"We had an error",message:o.error||"",severity:"error"},!!o.error,{from:!1,to:!0}),t(oi,{loading:u,children:[e(Yt,{title:`Edit ${d}`,preset:"default",breadcrumbs:[{id:"list",text:n,link:`${i}/`},{id:"update",text:`Edit ${d}`,link:`${i}/${d}/update`}]}),e(St,{children:e(Ei,{model:r,initialValues:l,saveButtonText:"Save",onSubmit:c})})]})},Pi=({columns:n,options:i,data:o,onClick:a,search:c,defaultSort:s,defaultOrder:d,loading:u})=>{const p=[...n,{id:"__options",label:"",disablePadding:!1,numeric:!1,sort:!1}],[m,f]=h(null);return t(r,{children:[e(Bn,{columns:p,data:o,search:c,defaultSort:s,defaultOrder:d,loading:u,children:r=>r.map(((r,n)=>t(Ke,{onClick:()=>a&&a(r),role:"row","aria-rowindex":n,sx:{cursor:a&&"pointer"},children:[p.map((({id:t},i)=>e(Ge,{role:"cell",scope:"row","aria-rowindex":n,"aria-colindex":i,children:r[t]},t.toString()))),i&&e(Ge,{children:e(l,{"data-testid":`options-${r.id}`,onClick:e=>{e.stopPropagation(),f({item:r,anchor:e.currentTarget})},children:e(yt,{})})})]},r.id)))}),i&&e(ht,{anchorEl:m?.anchor,open:!!m,onClose:()=>f(null),anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:i.map((({id:t,label:r,onClick:n})=>e(ft,{onClick:()=>{m&&n(m?.item),f(null)},children:r},t)))})]})},Oi=({model:r,modelName:n,listData:i,listRequest:o,deleteRequest:a,basePath:l="",deleteFeature:c=!0,updateFeature:s=!0,addFeature:d=!0,detailsFeature:u=!0,onRequestList:p,onClickDeleteItem:m})=>{const f=_();v((()=>{p()}),[]),di({title:"Item deleted",message:"The item has been deleted successfully",severity:"success"},!!a.success,{from:!1,to:!0}),di({title:"We had an error",message:a.error||"",severity:"error"},!!a.error,{from:!1,to:!0});const h=u?e=>{f(`${l}/${e.id}`)}:void 0,y=(e,t)=>{"edit"===e?f(`${l}/${t.id}/update`):m(t)},g=[];s&&g.push({id:"edit",label:"Edit",onClick:e=>y("edit",e)}),c&&g.push({id:"remove",label:"Remove",onClick:e=>y("remove",e)});const b=[];return d&&b.push({id:"add",text:"Add",href:`${l}/add`}),t(oi,{loading:o.loading||a.loading,children:[e(Yt,{title:n,preset:"default",actions:b.length>0?b:void 0}),e(St,{children:e(Pi,{columns:r.fields.filter((({listable:e})=>e)).map((({id:e,name:t,type:r})=>({disablePadding:!1,id:e,label:t,numeric:"number"===r,sort:!1}))),data:i,defaultSort:r.fields[0].id,onClick:h,options:g.length>0?g:void 0})})]})},zi=({model:r,modelName:n,basePath:i="",onSubmitNewItem:o,newItemRequest:a})=>(di({message:"Item added successfully",severity:"success"},!!a.success,{from:!1,to:!0}),jt(`${i}/`,!!a.success,{from:!1,to:!0}),di({title:"We had an error",message:a.error||"",severity:"error"},!!a.error,{from:!1,to:!0}),t(oi,{loading:a.loading,children:[e(Yt,{title:`Add ${n}`,preset:"default",breadcrumbs:[{id:"list",text:n,link:`${i}/`},{id:"add",text:`Add new ${n}`,link:`${i}/add`}]}),e(St,{children:e(Ei,{model:r,saveButtonText:"Save",onSubmit:o})})]})),Ri=({model:r,modelName:n,basePath:i="",onRequestItem:o,itemRequest:a,detailsItem:l})=>{const{id:c=""}=q();return v((()=>{o(c)}),[c]),t(oi,{loading:a.loading,children:[e(Yt,{title:c,preset:"default",breadcrumbs:[{id:"list",text:n,link:`${i}/`},{id:"detail",text:c,link:`${i}/${c}`}]}),e(St,{children:l&&e(fi,{model:r,instance:l})})]})},Ai=r=>{const{updateFeature:n=!0,addFeature:i=!0,detailsFeature:o=!0}=r;return t(H,{children:[e(U,{path:"",element:e(Oi,{...r})}),o&&e(U,{path:":id",element:e(Ri,{...r})}),i&&e(U,{path:"add",element:e(zi,{...r})}),n&&e(U,{path:":id/update",element:e(Ii,{...r})})]})},ji={idle:!0},Wi={loading:!0},Di={success:!0};export{Fr as Action,Lr as ActionHeader,Dr as Autocomplete,vt as Board,Jt as BootstrapDialog,Nt as Bullet,wt as CenterContainer,Xt as ConfirmDialog,St as Content,Zr as ContentPlaceholder,Vr as DateRangeCalendar,Br as DateRangePicker,Hn as DefaultPlaceholder,cr as Drawer,wr as DrawerAppBar,xr as DrawerContent,Qt as DrawerContext,nr as DrawerHeader,ni as DrawerLayout,kr as DrawerMain,ur as DrawerProvider,vr as DrawerSection,pr as DrawerSubheader,Ln as EnhancedRemoteTable,Bn as EnhancedTable,Nn as EnhancedTableHead,Ct as ExpandableAlert,Gt as FormDialog,Qn as GroupValueCard,Yt as Header,oi as HeaderLayout,Ut as HeaderSubtitle,Ht as HeaderTitle,ji as IdleRequest,Bt as Label,Dt as ListPanel,Pt as ListPanelContext,Ot as ListPanelContextProvider,Er as LoadingArea,Wi as LoadingRequest,en as LoremIpsumPlaceholder,bt as Markdown,Ei as ModelForm,Ai as ModelRouter,li as NotificationCenterContext,si as NotificationCenterProvider,ai as NotificationCenterProviderUndefinedError,fi as ObjectDetails,Gr as Placeholder,Ir as QueryContainer,Or as Select,zr as SignIn,Kr as SkeletonCard,Qr as SkeletonGrid,Di as SuccessRequest,Yr as TabCard,Jr as TabCardPanel,Lt as TabContext,Ft as TabContextProvider,Xr as TabPanel,qt as TabProvider,Pi as TableList,Wr as TextField,Zt as UndefinedProvider,Gn as ValueBoolean,Xn as ValueCard,Kn as ValueDatetime,qn as ValueEditButton,Fn as ValueEditButtons,ti as ValueItem,ri as ValueLabel,Zn as ValueRating,Jn as ValueText,Mt as bulletClasses,mr as getDrawerItemColors,It as getFormData,Tt as getRandomItem,Vt as labelClasses,gt as markdownDefaultOptions,$t as newArrayWithSize,Et as newBreakpointsCounter,gi as newInstanceFromValuesOrZeroValue,Kt as useDialog,er as useDrawer,_n as useEditableValueDisplay,kt as useGetDefaultThemeColor,zt as useListPanel,ci as useNotificationCenter,di as useNotifyWhenValueChanges,_t as useTab,ei as valueItemClasses};
24
24
  //# sourceMappingURL=index.js.map