@alextheman/components 6.16.0 → 6.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,3 +1,3 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`@mui/material/Box`);c=s(c,1);let l=require(`@mui/material/Card`);l=s(l,1);let u=require(`@mui/material/CardContent`);u=s(u,1);let d=require(`@mui/material/CardHeader`);d=s(d,1);let f=require(`@mui/material/Chip`);f=s(f,1);let p=require(`@mui/material/Divider`);p=s(p,1);let m=require(`@mui/material/Stack`);m=s(m,1);let h=require(`@mui/material/Typography`);h=s(h,1);let g=require(`react/jsx-runtime`),_=require(`@mui/material/ButtonBase`);_=s(_,1);let ee=require(`@mui/material/Collapse`);ee=s(ee,1);let v=require(`react`),y=require(`react-icons/md`),b=require(`@mui/material/Link`);b=s(b,1);let x=require(`@mui/material/Button`);x=s(x,1);let S=require(`@mui/material/styles`),C=require(`@mui/material/IconButton`);C=s(C,1);let w=require(`@mui/material/List`);w=s(w,1);let T=require(`@mui/material/ListItem`);T=s(T,1);let E=require(`@mui/material/ListItemText`);E=s(E,1);let D=require(`@mui/material/Tooltip`);D=s(D,1);let te=require(`@mui/material/Switch`);te=s(te,1);let O=require(`@alextheman/utility/v6`),k=require(`@mui/material/CssBaseline`);k=s(k,1);let A=require(`@mui/material/CircularProgress`);A=s(A,1);let j=require(`@mui/material/Alert`);j=s(j,1);let M=require(`@alextheman/utility`),N=require(`@mui/material/Snackbar`);N=s(N,1);let P=require(`@mui/material/BottomNavigation`);P=s(P,1);let F=require(`@mui/material/BottomNavigationAction`);F=s(F,1);let ne=require(`@mui/material/Paper`);ne=s(ne,1);let I=require(`react-router-dom`),re=require(`common-tags`),L=require(`react-live`),R=require(`@mui/material/Skeleton`);R=s(R,1);let z=require(`@mui/material/TableCell`);z=s(z,1);let B=require(`@mui/material/TableRow`);B=s(B,1);let V=require(`@mui/material/Menu`);V=s(V,1);let H=require(`@mui/material/AppBar`);H=s(H,1);let U=require(`@mui/material/Drawer`);U=s(U,1);let W=require(`@mui/material/ListItemButton`);W=s(W,1);let G=require(`@mui/material/ListItemIcon`);G=s(G,1);let K=require(`@mui/material/Toolbar`);K=s(K,1);let q=require(`@mui/material/MenuItem`);q=s(q,1);let J=require(`@mui/material/Popover`);J=s(J,1);let ie=require(`react-hook-form`);function ae({containerLabel:e,chipLabels:t}){return(0,g.jsx)(l.default,{sx:{width:320,height:420,backgroundColor:`rgba(255,255,255,0.07)`,backdropFilter:`blur(8px)`,border:`1px solid rgba(255,255,255,0.06)`,boxShadow:`0 10px 40px rgba(0,0,0,0.35)`},children:(0,g.jsxs)(u.default,{children:[(0,g.jsx)(h.default,{variant:`h6`,gutterBottom:!0,sx:{color:`#f8fafc`},children:e}),(0,g.jsx)(m.default,{spacing:1,children:t.map(e=>(0,g.jsx)(f.default,{label:e,sx:{backgroundColor:`rgba(255,255,255,0.11)`,color:`rgba(255,255,255,0.88)`,border:`1px solid rgba(255,255,255,0.06)`}},e))})]})})}function oe(){return(0,g.jsx)(c.default,{sx:{width:120,height:6,borderRadius:3,background:`linear-gradient(90deg, #f43f5e, #a78bfa, #22d3ee)`,boxShadow:`0 0 24px rgba(167,139,250,0.55)`}})}function se(){return(0,g.jsxs)(l.default,{sx:{width:1e3,height:1e3,display:`flex`,flexDirection:`column`,justifyContent:`space-between`,p:4,background:`radial-gradient(circle at 20% 10%, rgba(167,139,250,0.35) 0%, rgba(167,139,250,0.12) 35%, rgba(0,0,0,0) 55%), linear-gradient(135deg, #3a3380 0%, #1d2e5f 40%, #2d3f55 100%)`,color:`white`},elevation:0,children:[(0,g.jsx)(d.default,{title:`An Interface For You And I`,sx:{color:`#f8fafc`,textAlign:`center`,"& .MuiCardHeader-title":{fontSize:40,fontWeight:600,letterSpacing:2}}}),(0,g.jsx)(p.default,{sx:{borderColor:`rgba(255,255,255,0.2)`}}),(0,g.jsx)(u.default,{sx:{flex:1,display:`flex`,alignItems:`center`},children:(0,g.jsxs)(m.default,{direction:`row`,spacing:4,sx:{width:`100%`,justifyContent:`center`,alignItems:`center`},children:[(0,g.jsx)(ae,{containerLabel:`You`,chipLabels:[`state`,`context`,`input`,`event`,`focus`,`value`,`history`]}),(0,g.jsx)(oe,{}),(0,g.jsx)(ae,{containerLabel:`I`,chipLabels:[`render`,`effect`,`response`,`update`,`history`,`layout`,`provider`]})]})})]})}function ce({isInitiallyOpen:e,onOpen:t,onClose:n,children:r,buttonStyles:i,buttonContents:a,buttonComponent:o=_.default,collapseProps:s,openIcon:l=(0,g.jsx)(y.MdArrowDropUp,{}),closedIcon:u=(0,g.jsx)(y.MdArrowDropDown,{}),useDefaultStyling:d=o===_.default}){let[f,p]=(0,v.useState)(!!e);return(0,v.useEffect)(()=>{f&&t?t():!f&&n&&n()},[f]),(0,g.jsxs)(c.default,{children:[(0,g.jsxs)(o,{onClick:()=>{p(e=>!e)},sx:d?{width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,paddingY:1.5,paddingX:2,textAlign:`center`,"&:hover":o===_.default?{backgroundColor:`action.hover`}:null,...i}:i,"aria-expanded":f,children:[a,f?l:u]}),(0,g.jsx)(ee.default,{in:f,...s,children:r})]})}function le({href:e,children:t,ref:n,...r}){return(0,g.jsx)(b.default,{component:`a`,href:e,ref:n,target:`_blank`,rel:`noopener noreferrer`,...r,children:t})}const ue={PDF:`application/pdf`,PNG:`image/png`,JPEG:`image/jpeg`,JPG:`image/jpg`,XLSX:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`,DOCX:`application/vnd.openxmlformats-officedocument.wordprocessingml.document`,MP3:`audio/mp3`,MP4:`video/mp4`,WAV:`audio/wav`},de=(0,S.styled)(`input`)({clip:`rect(0 0 0 0)`,clipPath:`inset(50%)`,height:1,overflow:`hidden`,position:`absolute`,bottom:0,left:0,whiteSpace:`nowrap`,width:1}),fe=(0,S.styled)(`div`)(({theme:e,$dragging:t})=>({border:`2px dashed`,borderColor:t?e.palette.primary.main:`#ccc`,backgroundColor:t?e.palette.action.hover:`transparent`,borderRadius:8,padding:`1.5rem`,textAlign:`center`,transition:`border-color 0.2s`,cursor:`pointer`}));function pe({onFileInput:e,label:t=`Upload files`,multiple:n,accept:r,useDropzone:i,...a}){let[o,s]=(0,v.useState)(!1),c=(0,v.useId)(),l=(0,g.jsxs)(x.default,{variant:`contained`,component:`label`,"aria-label":`File input button`,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),document.getElementById(c)?.click())},...a,startIcon:a.startIcon??(0,g.jsx)(y.MdCloudUpload,{}),children:[t,(0,g.jsx)(de,{id:c,type:`file`,onChange:t=>{let n=t.target;e(Array.from(n.files??[])),n.value=``},multiple:n,accept:r?.join(`,`),disabled:a.disabled})]});return i?(0,g.jsx)(fe,{$dragging:o,onDragOver:e=>{e.preventDefault(),!a.disabled&&s(!0)},onDragLeave:e=>{e.preventDefault(),s(!1)},onDrop:t=>{t.preventDefault(),s(!1),!a.disabled&&e(Array.from(t.dataTransfer.files??[]))},children:l}):l}function me({files:e,setFiles:t,multiple:n=!0,...r}){function i(e){t(t=>[...t,...e])}return(0,g.jsxs)(c.default,{children:[(0,g.jsx)(pe,{...r,multiple:n,onFileInput:i}),(0,g.jsx)(w.default,{children:e.map(e=>(0,g.jsx)(T.default,{secondaryAction:(0,g.jsx)(C.default,{"aria-label":`Delete`,edge:`end`,onClick:()=>{t(t=>t.filter(t=>t!==e))},children:(0,g.jsx)(y.MdDelete,{})}),children:(0,g.jsx)(E.default,{primary:e.name})},`${e.name}-${e.lastModified}`))})]})}const he=(0,S.styled)(te.default)(()=>({padding:8,"& .MuiSwitch-track":{borderRadius:11,"&::before, &::after":{content:`""`,position:`absolute`,top:`50%`,transform:`translateY(-50%)`,fontSize:16,width:28,height:28}}}));function ge({checkedIcon:e,checkedIconStyles:t,uncheckedIcon:n,uncheckedIconStyles:r,...i}){let a={borderRadius:`50%`,borderColor:`white`,backgroundColor:`white`,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:.25},o={color:`black`,maxWidth:16.5,maxHeight:16.5};return(0,g.jsx)(he,{checkedIcon:(0,g.jsx)(c.default,{sx:a,children:(0,g.jsx)(e,{style:{...o,...t}})}),icon:(0,g.jsx)(c.default,{sx:a,children:(0,g.jsx)(n,{style:{...o,...r}})}),...i})}const _e=(0,v.createContext)({toggleMode:()=>{},mode:`dark`});function ve({strict:e=!0}={}){let t=(0,v.useContext)(_e);if(e&&!t)throw new O.DataError({strict:e,context:t},`MODE_PROVIDER_NOT_FOUND`,`Could not find the ModeProvider context. Please double-check that it is present.`);return t}function ye({children:e,mode:t=`dark`}){let[n,r]=(0,v.useState)(t),i=(0,v.useMemo)(()=>(0,S.createTheme)({palette:{mode:n},components:{MuiPaper:{styleOverrides:{root:({theme:e})=>({border:1,borderStyle:`solid`,borderColor:e.palette.divider})}}}}),[n]);return(0,g.jsx)(_e.Provider,{value:{mode:n,toggleMode:()=>{r(e=>e===`light`?`dark`:`light`)}},children:(0,g.jsxs)(S.ThemeProvider,{theme:i,children:[(0,g.jsx)(k.default,{}),e]})})}const be=(0,v.createContext)(void 0);function Y({strict:e=!0}={}){let t=(0,v.useContext)(be);if(e&&!t)throw new O.DataError({strict:e,context:t},`LOADER_PROVIDER_NOT_FOUND`,`Could not find the QueryBoundaryProvider context. Please double-check that it is present.`);return t}function xe({children:e,loadingComponent:t=(0,g.jsx)(A.default,{}),...n}){return(0,g.jsx)(be.Provider,{value:{loadingComponent:t,...n},children:e})}function X({children:e,dataParser:t,loadingComponent:n}){let{isLoading:r,data:i,dataParser:a,loadingComponent:o,error:s}=Y(),c=t??a;return r?(0,g.jsx)(g.Fragment,{children:n??o}):s||i==null?null:(0,g.jsx)(g.Fragment,{children:typeof e==`function`?e(c?c(i):i):e})}function Se({children:e,loadingComponent:t,itemKey:n,itemParser:r,dataParser:i,emptyComponent:a=(0,g.jsx)(h.default,{children:`No data present`}),strictlyRequireArray:o=!0}){let{isLoading:s,data:c,dataParser:l,loadingComponent:u,error:d}=Y(),f=i??l,p=t??u;if(s)return(0,g.jsx)(g.Fragment,{children:p});if(d||c==null)return null;if(!Array.isArray(c)){if(o)throw new O.DataError({data:c,strictlyRequireArray:o},`NOT_AN_ARRAY`,`Expected the data to be an array but it was not an array.`);return null}if(c.length===0)return(0,g.jsx)(g.Fragment,{children:a});let m;return m=f?f(c):r?c.map(r):c,(0,g.jsx)(g.Fragment,{children:m.map((t,r)=>(0,g.jsx)(v.Fragment,{children:typeof e==`function`?e(t):e},n?n(t,r):r))})}function Z({children:e,undefinedComponent:t,nullComponent:n,nullableComponent:r,logError:i}){let{isLoading:a,data:o,error:s,errorComponent:c,logError:l}=Y(),u=i??l,d=(0,v.useRef)(!1),f=e??c;return s?(u&&!d.current&&(o!=null&&console.error(`An error has occurred but data is still present. This may indicate an invalid query state.`,{data:o,error:s}),console.error(s),d.current=!0),typeof f==`function`?f(s):f?(0,g.jsx)(g.Fragment,{children:f}):(0,g.jsx)(j.default,{severity:`error`,children:typeof s==`object`&&`message`in s&&typeof s.message==`string`?s.message:`An unknown error has occured. Please try again later.`})):!a&&o==null?r?(u&&!d.current&&(console.error(`Data is nullable after loading.`),d.current=!0),(0,g.jsx)(g.Fragment,{children:r})):o===void 0&&(u&&!d.current&&(console.error(`Data is undefined after loading. This could either be an issue with the query or you have not passed in the data to QueryBoundaryProvider. Please double-check that you have provided data.`),d.current=!0),t)?(0,g.jsx)(g.Fragment,{children:t}):o===null&&(u&&!d.current&&(console.error(`Data is null after loading.`),d.current=!0),n)?(0,g.jsx)(g.Fragment,{children:n}):(0,g.jsx)(j.default,{severity:`error`,children:`Failed to load data. Please try again later.`}):null}var Q=xe;const Ce=(0,v.createContext)({windowWidth:0,windowHeight:0,isLargeScreen:!1});function we({strict:e=!0}={}){let t=(0,v.useContext)(Ce);if(e&&!t)throw new O.DataError({strict:e,context:t},`SCREEN_SIZE_PROVIDER_NOT_FOUND`,`Could not find the ScreenSizeProvider context. Please double-check that it is present.`);return t}function Te({children:e,largeScreenWidth:t=669,largeScreenHeight:n=660}){let[r,i]=(0,v.useState)(window.innerWidth),[a,o]=(0,v.useState)(window.innerHeight);(0,v.useEffect)(()=>{function e(){i(window.innerWidth),o(window.innerHeight)}return e(),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e)}},[]);let s=(0,v.useMemo)(()=>r>t&&a>n,[r,a,t,n]);return(0,g.jsx)(Ce.Provider,{value:{isLargeScreen:s,windowWidth:r,windowHeight:a},children:e})}const Ee=(0,v.createContext)(void 0);function De({strict:e=!0}={}){let t=(0,v.useContext)(Ee);if(e&&!t)throw new O.DataError({strict:e,context:t},`SNACKBAR_PROVIDER_NOT_FOUND`,`Could not find the SnackbarProvider context. Please double-check that it is present.`);return t}function Oe({children:e,autoHideDuration:t=5e3}){let[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(t),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(`info`);function u(e,n,i){r(!0),a(i??t),l(n??`info`),s(e)}async function d(){r(!1),await(0,M.wait)(.2),s(``)}return(0,g.jsxs)(Ee.Provider,{value:{addSnackbar:u},children:[(0,g.jsx)(N.default,{open:n,autoHideDuration:i,onClose:d,children:(0,g.jsx)(j.default,{onClose:d,severity:c,children:o})}),e]})}function ke(){let{mode:e,toggleMode:t}=ve(),n=e===`dark`,r=`Enable ${n?`light`:`dark`} mode`;return(0,g.jsx)(D.default,{title:r,children:(0,g.jsx)(ge,{uncheckedIcon:y.MdOutlineLightMode,checkedIcon:y.MdOutlineDarkMode,checked:n,onChange:t,"aria-label":r})})}function Ae({children:e,navItems:t}){let[n,r]=(0,v.useState)(``);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(c.default,{sx:{paddingBottom:7},children:e}),(0,g.jsx)(ne.default,{sx:{position:`fixed`,bottom:0,left:0,right:0},children:(0,g.jsx)(P.default,{showLabels:!0,value:n,onChange:(e,t)=>{r(t)},children:t.map(e=>(0,g.jsx)(F.default,{...e,component:I.Link},e.value))})})]})}function je({title:e,subtitle:t,action:n,children:r,disablePadding:i}){return(0,g.jsxs)(l.default,{children:[(0,g.jsx)(d.default,{title:(0,g.jsxs)(g.Fragment,{children:[typeof e==`string`?(0,g.jsx)(h.default,{variant:`h6`,children:e}):e,t?typeof t==`string`?(0,g.jsx)(h.default,{variant:`body2`,color:`text.secondary`,children:t}):t:null]}),action:n}),(0,g.jsx)(p.default,{}),i?r:(0,g.jsx)(u.default,{children:r})]})}function Me({children:e,errorComponent:t,undefinedComponent:n,nullComponent:r,nullableComponent:i,logError:a,loadingComponent:o=(0,g.jsx)(A.default,{}),...s}){let c=(0,g.jsx)(Z,{logError:a});return i?c=(0,g.jsx)(Z,{nullableComponent:i,logError:a,children:t}):(n||r)&&(c=(0,g.jsx)(Z,{undefinedComponent:n,nullComponent:r,logError:a,children:t})),(0,g.jsxs)(Q,{loadingComponent:o,...s,children:[c,(0,g.jsx)(X,{children:e})]})}function Ne({loadingComponent:e,undefinedComponent:t,nullComponent:n,nullableComponent:r,logError:i,errorComponent:a,children:o,isLoading:s,error:c,data:l,...u}){let d=null;return r?d=(0,g.jsx)(Z,{nullableComponent:r,logError:i,children:a}):(t||n)&&(d=(0,g.jsx)(Z,{undefinedComponent:t,nullComponent:n,logError:i,children:a})),(0,g.jsxs)(Q,{loadingComponent:e,isLoading:s,error:c,data:l,children:[d,(0,g.jsx)(Se,{...u,children:o})]})}function Pe({code:e,previewStyles:t,...n}){let{mode:r}=ve(),i={backgroundColor:r===`dark`?`black`:`white`,border:.3,borderRadius:1,padding:2,borderColor:`darkgray`},a=t?{...i,...t}:{...i};return(0,g.jsx)(c.default,{sx:{borderRadius:1,border:.5,padding:2},children:(0,g.jsxs)(L.LiveProvider,{...n,code:(0,re.stripIndent)(e??``),children:[(0,g.jsx)(h.default,{variant:`h5`,children:`Code`}),(0,g.jsx)(c.default,{sx:{border:.3,borderRadius:.3,borderColor:`darkgray`},children:(0,g.jsx)(L.LiveEditor,{})}),(0,g.jsx)(`br`,{}),(0,g.jsx)(h.default,{variant:`h5`,children:`Result`}),(0,g.jsxs)(c.default,{sx:a,children:[(0,g.jsx)(L.LivePreview,{}),(0,g.jsx)(L.LiveError,{})]})]})})}function Fe({columns:e}){return(0,g.jsx)(B.default,{children:(0,M.fillArray)(e=>(0,g.jsx)(z.default,{children:(0,g.jsx)(R.default,{})},e),e)})}const Ie=ke;function Le({children:e,button:t=x.default,buttonChildren:n=`Menu`,buttonProps:r,isOpenIcon:i=(0,g.jsx)(y.MdArrowDropUp,{}),isClosedIcon:a=(0,g.jsx)(y.MdArrowDropDown,{}),onOpen:o,onClose:s}){let[l,u]=(0,v.useState)(null),d=(0,v.useMemo)(()=>!!l,[l]),f={...r,onClick:e=>{u(e.currentTarget)},"aria-controls":d?`dropdown-menu`:void 0,"aria-haspopup":`true`,"aria-expanded":d};return t===x.default&&(f.endIcon=d?i:a),(0,v.useEffect)(()=>{d&&o?o():!d&&s&&s()},[d,o,s]),(0,g.jsxs)(c.default,{children:[(0,g.jsx)(t,{...f,children:n}),(0,g.jsx)(V.default,{id:`dropdown-menu`,anchorEl:l,open:d,onClose:()=>{u(null)},children:typeof e==`function`?(0,g.jsx)(c.default,{children:e(()=>{u(null)})}):e})]})}const Re=(0,v.createContext)(void 0);function $({strict:e=!0}={}){let t=(0,v.useContext)(Re);if(e&&!t)throw new O.DataError({strict:e,context:t},`DROPDOWN_MENU_NOT_FOUND`,`Could not find the DropdownMenu context. Please double-check that it is present.`);return t}function ze({strict:e=!0}={}){return $({strict:e})}function Be({children:e,onClose:t,...n}){let{anchorElement:r,isDropdownOpen:i,closeMenu:a}=ze();return(0,g.jsx)(V.default,{anchorEl:r,open:i,onClose:(e,n)=>{e.defaultPrevented||a(),t&&t(e,n)},...n,children:e})}function Ve({component:e,children:t,ref:n,onClick:r,...i}){let{closeMenu:a}=$();return(0,g.jsx)(q.default,{component:e,ref:n,...i,onClick:e=>{r&&r(e),!e.defaultPrevented&&a()},children:t})}const He=$,Ue=Be,We=Ve;var Ge=Ue;function Ke({ref:e,href:t,children:n,onClick:r,...i}){let{closeMenu:a}=He();return(0,g.jsx)(q.default,{component:le,href:t,ref:e,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:n})}function qe({to:e,component:t=I.Link,children:n,ref:r,...i}){return(0,g.jsx)(b.default,{component:t,to:e,ref:r,...i,children:n})}function Je({to:e,ref:t,children:n,onClick:r,...i}){let{closeMenu:a}=He();return(0,g.jsx)(q.default,{component:qe,to:e,ref:t,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:n})}function Ye({icon:e=y.MdVisibility,onOpen:t,onClose:n,iconProps:r,children:i}){let[a,o]=(0,v.useState)(null),s=!!a,l=(0,v.useId)();function u(e){o(e.currentTarget),t&&t()}function d(){o(null),n&&n()}return(0,g.jsxs)(c.default,{children:[(0,g.jsx)(e,{"aria-owns":s?l:void 0,"aria-haspopup":`true`,onMouseEnter:u,onMouseLeave:d,...r}),(0,g.jsx)(J.default,{id:l,disablePortal:!0,disableScrollLock:!0,slotProps:{root:{disableEnforceFocus:!0,disableAutoFocus:!0,disableRestoreFocus:!0}},sx:{pointerEvents:`none`},open:s,anchorEl:a,anchorOrigin:{vertical:`bottom`,horizontal:`left`},transformOrigin:{vertical:`top`,horizontal:`left`},onClose:d,disableRestoreFocus:!0,children:i})]})}function Xe({children:e,...t}){return(0,g.jsx)(W.default,{component:qe,...t,children:e})}const Ze=Me,Qe=X,$e=Z,et=Q;function tt(e){return{width:240,transition:e.transitions.create(`width`,{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:`hidden`}}function nt(e){return{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)`}}}const rt=(0,S.styled)(`div`)(({theme:e})=>({display:`flex`,alignItems:`center`,justifyContent:`flex-end`,padding:e.spacing(0,1),...e.mixins.toolbar})),it=(0,S.styled)(H.default,{shouldForwardProp:e=>e!==`open`})(({theme:e})=>({zIndex:e.zIndex.drawer+1,transition:e.transitions.create([`width`,`margin`],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),variants:[{props:({open:e})=>e,style:{marginLeft:240,width:`calc(100% - 240px)`,transition:e.transitions.create([`width`,`margin`],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen})}}]})),at=(0,S.styled)(U.default,{shouldForwardProp:e=>e!==`open`})(({theme:e})=>({width:240,flexShrink:0,whiteSpace:`nowrap`,boxSizing:`border-box`,variants:[{props:({open:e})=>e,style:{...tt(e),"& .MuiDrawer-paper":tt(e)}},{props:({open:e})=>!e,style:{...nt(e),"& .MuiDrawer-paper":nt(e)}}]}));function ot({title:e,navItems:t,children:n,headerElements:r}){let i=(0,S.useTheme)(),[a,o]=(0,v.useState)(!0),s=(0,I.useLocation)();function l(){o(!0)}function u(){o(!1)}return(0,g.jsxs)(c.default,{sx:{display:`flex`},children:[(0,g.jsx)(k.default,{}),(0,g.jsx)(it,{position:`fixed`,open:a,children:(0,g.jsxs)(K.default,{children:[(0,g.jsx)(C.default,{color:`inherit`,"aria-label":`open drawer`,onClick:l,edge:`start`,sx:[{marginRight:5},a&&{display:`none`}],children:(0,g.jsx)(y.MdMenu,{})}),(0,g.jsx)(h.default,{variant:`h6`,noWrap:!0,component:`div`,children:e}),r]})}),(0,g.jsxs)(at,{variant:`permanent`,open:a,children:[(0,g.jsx)(rt,{children:(0,g.jsx)(C.default,{onClick:u,children:i.direction===`rtl`?(0,g.jsx)(y.MdChevronRight,{}):(0,g.jsx)(y.MdChevronLeft,{})})}),(0,g.jsx)(p.default,{}),t.map(e=>(0,g.jsxs)(v.Fragment,{children:[(0,g.jsxs)(w.default,{children:[(0,g.jsx)(h.default,{variant:a?`h5`:`h6`,sx:{paddingLeft:a?2:1},children:a?e.category:(0,M.truncate)(e.category,4)}),e.options.map(e=>(0,g.jsx)(T.default,{disablePadding:!0,sx:{display:`block`},children:(0,g.jsxs)(W.default,{sx:[{minHeight:48,px:2.5},a?{justifyContent:`initial`}:{justifyContent:`center`}],component:I.Link,to:e.to,selected:s.pathname===e.to,children:[(0,g.jsx)(G.default,{sx:[{minWidth:0,justifyContent:`center`},a?{mr:3}:{mr:`auto`}],children:e.icon?e.icon:a?null:(0,g.jsx)(h.default,{children:(0,M.truncate)(e.label,4)})}),(0,g.jsx)(E.default,{primary:e.label,sx:[a?{opacity:1}:{opacity:0}]})]})},e.to))]}),(0,g.jsx)(p.default,{})]},e.category))]}),(0,g.jsxs)(c.default,{component:`main`,sx:{flexGrow:1,p:3},children:[(0,g.jsx)(rt,{}),n]})]})}function st({text:e,sx:t,...n}){return(0,g.jsx)(g.Fragment,{children:e.split(`
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`@mui/material/Box`);c=s(c,1);let l=require(`@mui/material/Card`);l=s(l,1);let u=require(`@mui/material/CardContent`);u=s(u,1);let d=require(`@mui/material/CardHeader`);d=s(d,1);let f=require(`@mui/material/Chip`);f=s(f,1);let p=require(`@mui/material/Divider`);p=s(p,1);let m=require(`@mui/material/Stack`);m=s(m,1);let h=require(`@mui/material/Typography`);h=s(h,1);let g=require(`react/jsx-runtime`),_=require(`@mui/material/ButtonBase`);_=s(_,1);let ee=require(`@mui/material/Collapse`);ee=s(ee,1);let v=require(`react`),y=require(`react-icons/md`),b=require(`@mui/material/Link`);b=s(b,1);let x=require(`@mui/material/Button`);x=s(x,1);let S=require(`@mui/material/styles`),C=require(`@mui/material/IconButton`);C=s(C,1);let w=require(`@mui/material/List`);w=s(w,1);let T=require(`@mui/material/ListItem`);T=s(T,1);let E=require(`@mui/material/ListItemText`);E=s(E,1);let D=require(`@mui/material/Tooltip`);D=s(D,1);let te=require(`@mui/material/Switch`);te=s(te,1);let O=require(`@alextheman/utility/v6`),k=require(`@mui/material/CssBaseline`);k=s(k,1);let A=require(`@mui/material/CircularProgress`);A=s(A,1);let j=require(`@mui/material/Alert`);j=s(j,1);let M=require(`@alextheman/utility`),N=require(`@mui/material/Snackbar`);N=s(N,1);let P=require(`@mui/material/BottomNavigation`);P=s(P,1);let F=require(`@mui/material/BottomNavigationAction`);F=s(F,1);let ne=require(`@mui/material/Paper`);ne=s(ne,1);let I=require(`react-router-dom`),re=require(`common-tags`),L=require(`react-live`),R=require(`@mui/material/Skeleton`);R=s(R,1);let z=require(`@mui/material/TableCell`);z=s(z,1);let B=require(`@mui/material/TableRow`);B=s(B,1);let V=require(`@mui/material/Menu`);V=s(V,1);let H=require(`@mui/material/AppBar`);H=s(H,1);let U=require(`@mui/material/Drawer`);U=s(U,1);let W=require(`@mui/material/ListItemButton`);W=s(W,1);let G=require(`@mui/material/ListItemIcon`);G=s(G,1);let K=require(`@mui/material/Toolbar`);K=s(K,1);let q=require(`@mui/material/MenuItem`);q=s(q,1);let J=require(`@mui/material/Popover`);J=s(J,1);let ie=require(`react-hook-form`);function ae({containerLabel:e,chipLabels:t}){return(0,g.jsx)(l.default,{sx:{width:320,height:420,backgroundColor:`rgba(255,255,255,0.07)`,backdropFilter:`blur(8px)`,border:`1px solid rgba(255,255,255,0.06)`,boxShadow:`0 10px 40px rgba(0,0,0,0.35)`},children:(0,g.jsxs)(u.default,{children:[(0,g.jsx)(h.default,{variant:`h6`,gutterBottom:!0,sx:{color:`#f8fafc`},children:e}),(0,g.jsx)(m.default,{spacing:1,children:t.map(e=>(0,g.jsx)(f.default,{label:e,sx:{backgroundColor:`rgba(255,255,255,0.11)`,color:`rgba(255,255,255,0.88)`,border:`1px solid rgba(255,255,255,0.06)`}},e))})]})})}function oe(){return(0,g.jsx)(c.default,{sx:{width:120,height:6,borderRadius:3,background:`linear-gradient(90deg, #f43f5e, #a78bfa, #22d3ee)`,boxShadow:`0 0 24px rgba(167,139,250,0.55)`}})}function se(){return(0,g.jsxs)(l.default,{sx:{width:1e3,height:1e3,display:`flex`,flexDirection:`column`,justifyContent:`space-between`,p:4,background:`radial-gradient(circle at 20% 10%, rgba(167,139,250,0.35) 0%, rgba(167,139,250,0.12) 35%, rgba(0,0,0,0) 55%), linear-gradient(135deg, #3a3380 0%, #1d2e5f 40%, #2d3f55 100%)`,color:`white`},elevation:0,children:[(0,g.jsx)(d.default,{title:`An Interface For You And I`,sx:{color:`#f8fafc`,textAlign:`center`,"& .MuiCardHeader-title":{fontSize:40,fontWeight:600,letterSpacing:2}}}),(0,g.jsx)(p.default,{sx:{borderColor:`rgba(255,255,255,0.2)`}}),(0,g.jsx)(u.default,{sx:{flex:1,display:`flex`,alignItems:`center`},children:(0,g.jsxs)(m.default,{direction:`row`,spacing:4,sx:{width:`100%`,justifyContent:`center`,alignItems:`center`},children:[(0,g.jsx)(ae,{containerLabel:`You`,chipLabels:[`state`,`context`,`input`,`event`,`focus`,`value`,`history`]}),(0,g.jsx)(oe,{}),(0,g.jsx)(ae,{containerLabel:`I`,chipLabels:[`render`,`effect`,`response`,`update`,`history`,`layout`,`provider`]})]})})]})}function ce({isInitiallyOpen:e,onOpen:t,onClose:n,children:r,buttonStyles:i,buttonContents:a,buttonComponent:o=_.default,collapseProps:s,openIcon:l=(0,g.jsx)(y.MdArrowDropUp,{}),closedIcon:u=(0,g.jsx)(y.MdArrowDropDown,{}),useDefaultStyling:d=o===_.default}){let[f,p]=(0,v.useState)(!!e);return(0,v.useEffect)(()=>{f&&t?t():!f&&n&&n()},[f]),(0,g.jsxs)(c.default,{children:[(0,g.jsxs)(o,{onClick:()=>{p(e=>!e)},sx:d?{width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,paddingY:1.5,paddingX:2,textAlign:`center`,"&:hover":o===_.default?{backgroundColor:`action.hover`}:null,...i}:i,"aria-expanded":f,children:[a,f?l:u]}),(0,g.jsx)(ee.default,{in:f,...s,children:r})]})}function le({href:e,children:t,ref:n,...r}){return(0,g.jsx)(b.default,{component:`a`,href:e,ref:n,target:`_blank`,rel:`noopener noreferrer`,...r,children:t})}const ue={PDF:`application/pdf`,PNG:`image/png`,JPEG:`image/jpeg`,JPG:`image/jpg`,XLSX:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`,DOCX:`application/vnd.openxmlformats-officedocument.wordprocessingml.document`,MP3:`audio/mp3`,MP4:`video/mp4`,WAV:`audio/wav`},de=(0,S.styled)(`input`)({clip:`rect(0 0 0 0)`,clipPath:`inset(50%)`,height:1,overflow:`hidden`,position:`absolute`,bottom:0,left:0,whiteSpace:`nowrap`,width:1}),fe=(0,S.styled)(`div`)(({theme:e,$dragging:t})=>({border:`2px dashed`,borderColor:t?e.palette.primary.main:`#ccc`,backgroundColor:t?e.palette.action.hover:`transparent`,borderRadius:8,padding:`1.5rem`,textAlign:`center`,transition:`border-color 0.2s`,cursor:`pointer`}));function pe({onFileInput:e,label:t=`Upload files`,multiple:n,accept:r,useDropzone:i,...a}){let[o,s]=(0,v.useState)(!1),c=(0,v.useId)(),l=(0,g.jsxs)(x.default,{variant:`contained`,component:`label`,"aria-label":`File input button`,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),document.getElementById(c)?.click())},...a,startIcon:a.startIcon??(0,g.jsx)(y.MdCloudUpload,{}),children:[t,(0,g.jsx)(de,{id:c,type:`file`,onChange:t=>{let n=t.target;e(Array.from(n.files??[])),n.value=``},multiple:n,accept:r?.join(`,`),disabled:a.disabled})]});return i?(0,g.jsx)(fe,{$dragging:o,onDragOver:e=>{e.preventDefault(),!a.disabled&&s(!0)},onDragLeave:e=>{e.preventDefault(),s(!1)},onDrop:t=>{t.preventDefault(),s(!1),!a.disabled&&e(Array.from(t.dataTransfer.files??[]))},children:l}):l}function me({files:e,setFiles:t,multiple:n=!0,...r}){function i(e){t(t=>[...t,...e])}return(0,g.jsxs)(c.default,{children:[(0,g.jsx)(pe,{...r,multiple:n,onFileInput:i}),(0,g.jsx)(w.default,{children:e.map(e=>(0,g.jsx)(T.default,{secondaryAction:(0,g.jsx)(C.default,{"aria-label":`Delete`,edge:`end`,onClick:()=>{t(t=>t.filter(t=>t!==e))},children:(0,g.jsx)(y.MdDelete,{})}),children:(0,g.jsx)(E.default,{primary:e.name})},`${e.name}-${e.lastModified}`))})]})}const he=(0,S.styled)(te.default)(()=>({padding:8,"& .MuiSwitch-track":{borderRadius:11,"&::before, &::after":{content:`""`,position:`absolute`,top:`50%`,transform:`translateY(-50%)`,fontSize:16,width:28,height:28}}}));function ge({checkedIcon:e,checkedIconStyles:t,uncheckedIcon:n,uncheckedIconStyles:r,...i}){let a={borderRadius:`50%`,borderColor:`white`,backgroundColor:`white`,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:.25},o={color:`black`,maxWidth:16.5,maxHeight:16.5};return(0,g.jsx)(he,{checkedIcon:(0,g.jsx)(c.default,{sx:a,children:(0,g.jsx)(e,{style:{...o,...t}})}),icon:(0,g.jsx)(c.default,{sx:a,children:(0,g.jsx)(n,{style:{...o,...r}})}),...i})}const _e=(0,v.createContext)({toggleMode:()=>{},mode:`dark`});function ve({strict:e=!0}={}){let t=(0,v.useContext)(_e);if(e&&!t)throw new O.DataError({strict:e,context:t},`MODE_PROVIDER_NOT_FOUND`,`Could not find the ModeProvider context. Please double-check that it is present.`);return t}function ye({children:e,mode:t=`dark`}){let[n,r]=(0,v.useState)(t),i=(0,v.useMemo)(()=>(0,S.createTheme)({palette:{mode:n},components:{MuiPaper:{styleOverrides:{root:({theme:e})=>({border:1,borderStyle:`solid`,borderColor:e.palette.divider})}}}}),[n]);return(0,g.jsx)(_e.Provider,{value:{mode:n,toggleMode:()=>{r(e=>e===`light`?`dark`:`light`)}},children:(0,g.jsxs)(S.ThemeProvider,{theme:i,children:[(0,g.jsx)(k.default,{}),e]})})}const be=(0,v.createContext)(void 0);function Y({strict:e=!0}={}){let t=(0,v.useContext)(be);if(e&&!t)throw new O.DataError({strict:e,context:t},`LOADER_PROVIDER_NOT_FOUND`,`Could not find the QueryBoundaryProvider context. Please double-check that it is present.`);return t}function xe({children:e,loadingComponent:t=(0,g.jsx)(A.default,{}),...n}){return(0,g.jsx)(be.Provider,{value:{loadingComponent:t,...n},children:e})}function X({children:e,dataParser:t,loadingComponent:n}){let{isLoading:r,data:i,dataParser:a,loadingComponent:o,error:s}=Y(),c=t??a;return r?(0,g.jsx)(g.Fragment,{children:n??o}):s||i==null?null:(0,g.jsx)(g.Fragment,{children:typeof e==`function`?e(c?c(i):i):e})}function Se({children:e,loadingComponent:t,itemKey:n,itemParser:r,dataParser:i,emptyComponent:a=(0,g.jsx)(h.default,{children:`No data present`}),strictlyRequireArray:o=!0}){let{isLoading:s,data:c,dataParser:l,loadingComponent:u,error:d}=Y(),f=i??l,p=t??u;if(s)return(0,g.jsx)(g.Fragment,{children:p});if(d||c==null)return null;if(!Array.isArray(c)){if(o)throw new O.DataError({data:c,strictlyRequireArray:o},`NOT_AN_ARRAY`,`Expected the data to be an array but it was not an array.`);return null}if(c.length===0)return(0,g.jsx)(g.Fragment,{children:a});let m;return m=f?f(c):r?c.map(r):c,(0,g.jsx)(g.Fragment,{children:m.map((t,r)=>(0,g.jsx)(v.Fragment,{children:typeof e==`function`?e(t):e},n?n(t,r):r))})}function Z({children:e,undefinedComponent:t,nullComponent:n,nullableComponent:r,logError:i}){let{isLoading:a,data:o,error:s,errorComponent:c,logError:l}=Y(),u=i??l,d=(0,v.useRef)(!1),f=e??c;return s?(u&&!d.current&&(o!=null&&console.error(`An error has occurred but data is still present. This may indicate an invalid query state.`,{data:o,error:s}),console.error(s),d.current=!0),typeof f==`function`?f(s):f?(0,g.jsx)(g.Fragment,{children:f}):(0,g.jsx)(j.default,{severity:`error`,children:typeof s==`object`&&`message`in s&&typeof s.message==`string`?s.message:`An unknown error has occured. Please try again later.`})):!a&&o==null?r?(u&&!d.current&&(console.error(`Data is nullable after loading.`),d.current=!0),(0,g.jsx)(g.Fragment,{children:r})):o===void 0&&(u&&!d.current&&(console.error(`Data is undefined after loading. This could either be an issue with the query or you have not passed in the data to QueryBoundaryProvider. Please double-check that you have provided data.`),d.current=!0),t)?(0,g.jsx)(g.Fragment,{children:t}):o===null&&(u&&!d.current&&(console.error(`Data is null after loading.`),d.current=!0),n)?(0,g.jsx)(g.Fragment,{children:n}):(0,g.jsx)(j.default,{severity:`error`,children:`Failed to load data. Please try again later.`}):null}var Q=xe;const Ce=(0,v.createContext)({windowWidth:0,windowHeight:0,isLargeScreen:!1});function we({strict:e=!0}={}){let t=(0,v.useContext)(Ce);if(e&&!t)throw new O.DataError({strict:e,context:t},`SCREEN_SIZE_PROVIDER_NOT_FOUND`,`Could not find the ScreenSizeProvider context. Please double-check that it is present.`);return t}function Te({children:e,largeScreenWidth:t=669,largeScreenHeight:n=660}){let[r,i]=(0,v.useState)(window.innerWidth),[a,o]=(0,v.useState)(window.innerHeight);(0,v.useEffect)(()=>{function e(){i(window.innerWidth),o(window.innerHeight)}return e(),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e)}},[]);let s=(0,v.useMemo)(()=>r>t&&a>n,[r,a,t,n]);return(0,g.jsx)(Ce.Provider,{value:{isLargeScreen:s,windowWidth:r,windowHeight:a},children:e})}const Ee=(0,v.createContext)(void 0);function De({strict:e=!0}={}){let t=(0,v.useContext)(Ee);if(e&&!t)throw new O.DataError({strict:e,context:t},`SNACKBAR_PROVIDER_NOT_FOUND`,`Could not find the SnackbarProvider context. Please double-check that it is present.`);return t}function Oe({children:e,autoHideDuration:t=5e3}){let[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(t),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(`info`);function u(e,n,i){r(!0),a(i??t),l(n??`info`),s(e)}async function d(){r(!1),await(0,M.wait)(.2),s(``)}return(0,g.jsxs)(Ee.Provider,{value:{addSnackbar:u},children:[(0,g.jsx)(N.default,{open:n,autoHideDuration:i,onClose:d,children:(0,g.jsx)(j.default,{onClose:d,severity:c,children:o})}),e]})}function ke(){let{mode:e,toggleMode:t}=ve(),n=e===`dark`,r=`Enable ${n?`light`:`dark`} mode`;return(0,g.jsx)(D.default,{title:r,children:(0,g.jsx)(ge,{uncheckedIcon:y.MdOutlineLightMode,checkedIcon:y.MdOutlineDarkMode,checked:n,onChange:t,"aria-label":r})})}function Ae({children:e,navItems:t}){let[n,r]=(0,v.useState)(``);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(c.default,{sx:{paddingBottom:7},children:e}),(0,g.jsx)(ne.default,{sx:{position:`fixed`,bottom:0,left:0,right:0},children:(0,g.jsx)(P.default,{showLabels:!0,value:n,onChange:(e,t)=>{r(t)},children:t.map(e=>(0,g.jsx)(F.default,{...e,component:I.Link},e.value))})})]})}function je({title:e,subtitle:t,action:n,children:r,disablePadding:i}){return(0,g.jsxs)(l.default,{children:[(0,g.jsx)(d.default,{title:(0,g.jsxs)(g.Fragment,{children:[typeof e==`string`?(0,g.jsx)(h.default,{variant:`h6`,children:e}):e,t?typeof t==`string`?(0,g.jsx)(h.default,{variant:`body2`,color:`text.secondary`,children:t}):t:null]}),action:n}),(0,g.jsx)(p.default,{}),i?r:(0,g.jsx)(u.default,{children:r})]})}function Me({children:e,errorComponent:t,undefinedComponent:n,nullComponent:r,nullableComponent:i,logError:a,loadingComponent:o=(0,g.jsx)(A.default,{}),...s}){let c=(0,g.jsx)(Z,{logError:a,children:t});return i?c=(0,g.jsx)(Z,{nullableComponent:i,logError:a,children:t}):(n||r)&&(c=(0,g.jsx)(Z,{undefinedComponent:n,nullComponent:r,logError:a,children:t})),(0,g.jsxs)(Q,{loadingComponent:o,...s,children:[c,(0,g.jsx)(X,{children:e})]})}function Ne({loadingComponent:e,undefinedComponent:t,nullComponent:n,nullableComponent:r,logError:i,errorComponent:a,children:o,isLoading:s,error:c,data:l,...u}){let d=(0,g.jsx)(Z,{logError:i,children:a});return r?d=(0,g.jsx)(Z,{nullableComponent:r,logError:i,children:a}):(t||n)&&(d=(0,g.jsx)(Z,{undefinedComponent:t,nullComponent:n,logError:i,children:a})),(0,g.jsxs)(Q,{loadingComponent:e,isLoading:s,error:c,data:l,children:[d,(0,g.jsx)(Se,{...u,children:o})]})}function Pe({code:e,previewStyles:t,...n}){let{mode:r}=ve(),i={backgroundColor:r===`dark`?`black`:`white`,border:.3,borderRadius:1,padding:2,borderColor:`darkgray`},a=t?{...i,...t}:{...i};return(0,g.jsx)(c.default,{sx:{borderRadius:1,border:.5,padding:2},children:(0,g.jsxs)(L.LiveProvider,{...n,code:(0,re.stripIndent)(e??``),children:[(0,g.jsx)(h.default,{variant:`h5`,children:`Code`}),(0,g.jsx)(c.default,{sx:{border:.3,borderRadius:.3,borderColor:`darkgray`},children:(0,g.jsx)(L.LiveEditor,{})}),(0,g.jsx)(`br`,{}),(0,g.jsx)(h.default,{variant:`h5`,children:`Result`}),(0,g.jsxs)(c.default,{sx:a,children:[(0,g.jsx)(L.LivePreview,{}),(0,g.jsx)(L.LiveError,{})]})]})})}function Fe({columns:e}){return(0,g.jsx)(B.default,{children:(0,M.fillArray)(e=>(0,g.jsx)(z.default,{children:(0,g.jsx)(R.default,{})},e),e)})}const Ie=ke;function Le({children:e,button:t=x.default,buttonChildren:n=`Menu`,buttonProps:r,isOpenIcon:i=(0,g.jsx)(y.MdArrowDropUp,{}),isClosedIcon:a=(0,g.jsx)(y.MdArrowDropDown,{}),onOpen:o,onClose:s}){let[l,u]=(0,v.useState)(null),d=(0,v.useMemo)(()=>!!l,[l]),f={...r,onClick:e=>{u(e.currentTarget)},"aria-controls":d?`dropdown-menu`:void 0,"aria-haspopup":`true`,"aria-expanded":d};return t===x.default&&(f.endIcon=d?i:a),(0,v.useEffect)(()=>{d&&o?o():!d&&s&&s()},[d,o,s]),(0,g.jsxs)(c.default,{children:[(0,g.jsx)(t,{...f,children:n}),(0,g.jsx)(V.default,{id:`dropdown-menu`,anchorEl:l,open:d,onClose:()=>{u(null)},children:typeof e==`function`?(0,g.jsx)(c.default,{children:e(()=>{u(null)})}):e})]})}const Re=(0,v.createContext)(void 0);function $({strict:e=!0}={}){let t=(0,v.useContext)(Re);if(e&&!t)throw new O.DataError({strict:e,context:t},`DROPDOWN_MENU_NOT_FOUND`,`Could not find the DropdownMenu context. Please double-check that it is present.`);return t}function ze({strict:e=!0}={}){return $({strict:e})}function Be({children:e,onClose:t,...n}){let{anchorElement:r,isDropdownOpen:i,closeMenu:a}=ze();return(0,g.jsx)(V.default,{anchorEl:r,open:i,onClose:(e,n)=>{e.defaultPrevented||a(),t&&t(e,n)},...n,children:e})}function Ve({component:e,children:t,ref:n,onClick:r,...i}){let{closeMenu:a}=$();return(0,g.jsx)(q.default,{component:e,ref:n,...i,onClick:e=>{r&&r(e),!e.defaultPrevented&&a()},children:t})}const He=$,Ue=Be,We=Ve;var Ge=Ue;function Ke({ref:e,href:t,children:n,onClick:r,...i}){let{closeMenu:a}=He();return(0,g.jsx)(q.default,{component:le,href:t,ref:e,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:n})}function qe({to:e,component:t=I.Link,children:n,ref:r,...i}){return(0,g.jsx)(b.default,{component:t,to:e,ref:r,...i,children:n})}function Je({to:e,ref:t,children:n,onClick:r,...i}){let{closeMenu:a}=He();return(0,g.jsx)(q.default,{component:qe,to:e,ref:t,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:n})}function Ye({icon:e=y.MdVisibility,onOpen:t,onClose:n,iconProps:r,children:i}){let[a,o]=(0,v.useState)(null),s=!!a,l=(0,v.useId)();function u(e){o(e.currentTarget),t&&t()}function d(){o(null),n&&n()}return(0,g.jsxs)(c.default,{children:[(0,g.jsx)(e,{"aria-owns":s?l:void 0,"aria-haspopup":`true`,onMouseEnter:u,onMouseLeave:d,...r}),(0,g.jsx)(J.default,{id:l,disablePortal:!0,disableScrollLock:!0,slotProps:{root:{disableEnforceFocus:!0,disableAutoFocus:!0,disableRestoreFocus:!0}},sx:{pointerEvents:`none`},open:s,anchorEl:a,anchorOrigin:{vertical:`bottom`,horizontal:`left`},transformOrigin:{vertical:`top`,horizontal:`left`},onClose:d,disableRestoreFocus:!0,children:i})]})}function Xe({children:e,...t}){return(0,g.jsx)(W.default,{component:qe,...t,children:e})}const Ze=Me,Qe=X,$e=Z,et=Q;function tt(e){return{width:240,transition:e.transitions.create(`width`,{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:`hidden`}}function nt(e){return{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)`}}}const rt=(0,S.styled)(`div`)(({theme:e})=>({display:`flex`,alignItems:`center`,justifyContent:`flex-end`,padding:e.spacing(0,1),...e.mixins.toolbar})),it=(0,S.styled)(H.default,{shouldForwardProp:e=>e!==`open`})(({theme:e})=>({zIndex:e.zIndex.drawer+1,transition:e.transitions.create([`width`,`margin`],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),variants:[{props:({open:e})=>e,style:{marginLeft:240,width:`calc(100% - 240px)`,transition:e.transitions.create([`width`,`margin`],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen})}}]})),at=(0,S.styled)(U.default,{shouldForwardProp:e=>e!==`open`})(({theme:e})=>({width:240,flexShrink:0,whiteSpace:`nowrap`,boxSizing:`border-box`,variants:[{props:({open:e})=>e,style:{...tt(e),"& .MuiDrawer-paper":tt(e)}},{props:({open:e})=>!e,style:{...nt(e),"& .MuiDrawer-paper":nt(e)}}]}));function ot({title:e,navItems:t,children:n,headerElements:r}){let i=(0,S.useTheme)(),[a,o]=(0,v.useState)(!0),s=(0,I.useLocation)();function l(){o(!0)}function u(){o(!1)}return(0,g.jsxs)(c.default,{sx:{display:`flex`},children:[(0,g.jsx)(k.default,{}),(0,g.jsx)(it,{position:`fixed`,open:a,children:(0,g.jsxs)(K.default,{children:[(0,g.jsx)(C.default,{color:`inherit`,"aria-label":`open drawer`,onClick:l,edge:`start`,sx:[{marginRight:5},a&&{display:`none`}],children:(0,g.jsx)(y.MdMenu,{})}),(0,g.jsx)(h.default,{variant:`h6`,noWrap:!0,component:`div`,children:e}),r]})}),(0,g.jsxs)(at,{variant:`permanent`,open:a,children:[(0,g.jsx)(rt,{children:(0,g.jsx)(C.default,{onClick:u,children:i.direction===`rtl`?(0,g.jsx)(y.MdChevronRight,{}):(0,g.jsx)(y.MdChevronLeft,{})})}),(0,g.jsx)(p.default,{}),t.map(e=>(0,g.jsxs)(v.Fragment,{children:[(0,g.jsxs)(w.default,{children:[(0,g.jsx)(h.default,{variant:a?`h5`:`h6`,sx:{paddingLeft:a?2:1},children:a?e.category:(0,M.truncate)(e.category,4)}),e.options.map(e=>(0,g.jsx)(T.default,{disablePadding:!0,sx:{display:`block`},children:(0,g.jsxs)(W.default,{sx:[{minHeight:48,px:2.5},a?{justifyContent:`initial`}:{justifyContent:`center`}],component:I.Link,to:e.to,selected:s.pathname===e.to,children:[(0,g.jsx)(G.default,{sx:[{minWidth:0,justifyContent:`center`},a?{mr:3}:{mr:`auto`}],children:e.icon?e.icon:a?null:(0,g.jsx)(h.default,{children:(0,M.truncate)(e.label,4)})}),(0,g.jsx)(E.default,{primary:e.label,sx:[a?{opacity:1}:{opacity:0}]})]})},e.to))]}),(0,g.jsx)(p.default,{})]},e.category))]}),(0,g.jsxs)(c.default,{component:`main`,sx:{flexGrow:1,p:3},children:[(0,g.jsx)(rt,{}),n]})]})}function st({text:e,sx:t,...n}){return(0,g.jsx)(g.Fragment,{children:e.split(`
2
2
  `).map((e,r)=>(0,g.jsx)(h.default,{sx:{margin:1,...t},...n,children:e},r))})}function ct({disableClean:e,label:t,...n}){let{formState:{disabled:r,isDirty:i,isSubmitting:a}}=(0,ie.useFormContext)();return(0,g.jsx)(x.default,{color:`primary`,disabled:n.disabled||e&&!i||r,loading:a,type:`submit`,variant:`contained`,...n,children:t})}function lt(e){let[t,n]=(0,v.useState)(()=>{let t=window.location.hash.replace(`#`,``);return e&&t===``?e:t}),r=(0,v.useCallback)(()=>{let t=window.location.hash.replace(`#`,``);n(e&&t===``?e:t)},[n,e]);return(0,v.useEffect)(()=>(window.addEventListener(`hashchange`,r),()=>{window.removeEventListener(`hashchange`,r)}),[r]),[t,(0,v.useCallback)(e=>{let n=typeof e==`function`?e(t):e;n!==t&&(window.location.hash=n)},[t])]}exports.Artwork=se,exports.CollapsableItem=ce,exports.DarkModeToggle=Ie,exports.DropdownMenu=Le,exports.DropdownMenu2=Ge,exports.DropdownMenuExternalLink=Ke,exports.DropdownMenuInternalLink=Je,exports.DropdownMenuItem=We,exports.ExternalLink=le,exports.FileInput=pe,exports.FileInputList=me,exports.FileType=ue,exports.IconWithPopover=Ye,exports.InternalLink=qe,exports.ListItemInternalLink=Xe,exports.Loader=Ze,exports.LoaderData=Qe,exports.LoaderError=$e,exports.LoaderProvider=et,exports.ModeProvider=ye,exports.ModeToggle=ke,exports.NavigationBottom=Ae,exports.NavigationDrawer=ot,exports.Page=je,exports.PopoverText=st,exports.QueryBoundary=Me,exports.QueryBoundaryData=X,exports.QueryBoundaryDataMap=Se,exports.QueryBoundaryError=Z,exports.QueryBoundaryMap=Ne,exports.QueryBoundaryProvider=Q,exports.ReactPlayground=Pe,exports.ScreenSizeProvider=Te,exports.SkeletonRow=Fe,exports.SnackbarProvider=Oe,exports.SubmitButton=ct,exports.SwitchWithIcons=ge,exports.useDropdownMenu=He,exports.useHash=lt,exports.useMode=ve,exports.useScreenSize=we,exports.useSnackbar=De;
3
3
  //# sourceMappingURL=index.cjs.map