@alextheman/components 6.13.0 → 6.14.0

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 v=require(`@mui/material/Collapse`);v=s(v,1);let y=require(`react`),b=require(`react-icons/md`),x=require(`@mui/material/Link`);x=s(x,1);let S=require(`@mui/material/Button`);S=s(S,1);let C=require(`@mui/material/styles`),w=require(`@mui/material/IconButton`);w=s(w,1);let T=require(`@mui/material/List`);T=s(T,1);let E=require(`@mui/material/ListItem`);E=s(E,1);let D=require(`@mui/material/ListItemText`);D=s(D,1);let O=require(`@mui/material/CircularProgress`);O=s(O,1);let k=require(`@alextheman/utility`),A=require(`@mui/material/Alert`);A=s(A,1);let j=require(`@mui/material/CssBaseline`);j=s(j,1);let M=require(`@mui/material/Snackbar`);M=s(M,1);let N=require(`@mui/material/Tooltip`);N=s(N,1);let P=require(`@mui/material/Switch`);P=s(P,1);let F=require(`@mui/material/BottomNavigation`);F=s(F,1);let I=require(`@mui/material/BottomNavigationAction`);I=s(I,1);let L=require(`@mui/material/Paper`);L=s(L,1);let R=require(`react-router-dom`),ee=require(`common-tags`),z=require(`react-live`),te=require(`@mui/material/Skeleton`);te=s(te,1);let B=require(`@mui/material/TableCell`);B=s(B,1);let V=require(`@mui/material/TableRow`);V=s(V,1);let H=require(`@mui/material/Menu`);H=s(H,1);let U=require(`@mui/material/AppBar`);U=s(U,1);let W=require(`@mui/material/Drawer`);W=s(W,1);let G=require(`@mui/material/ListItemButton`);G=s(G,1);let K=require(`@mui/material/ListItemIcon`);K=s(K,1);let q=require(`@mui/material/Toolbar`);q=s(q,1),require(`wouter`),require(`@mui/material/AlertTitle`),require(`@mui/material/Container`),require(`wouter/memory-location`),require(`wouter/use-browser-location`);let ne=require(`@tanstack/react-form`);require(`@mui/material/TextField`);let J=require(`@mui/material/MenuItem`);J=s(J,1);let Y=require(`@mui/material/Popover`);Y=s(Y,1);let re=require(`react-hook-form`);function ie({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 ae(){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 oe(){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)(ie,{containerLabel:`You`,chipLabels:[`state`,`context`,`input`,`event`,`focus`,`value`,`history`]}),(0,g.jsx)(ae,{}),(0,g.jsx)(ie,{containerLabel:`I`,chipLabels:[`render`,`effect`,`response`,`update`,`history`,`layout`,`provider`]})]})})]})}function se({isInitiallyOpen:e,onOpen:t,onClose:n,children:r,buttonStyles:i,buttonContents:a,buttonComponent:o=_.default,collapseProps:s,openIcon:l=(0,g.jsx)(b.MdArrowDropUp,{}),closedIcon:u=(0,g.jsx)(b.MdArrowDropDown,{}),useDefaultStyling:d=o===_.default}){let[f,p]=(0,y.useState)(!!e);return(0,y.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)(v.default,{in:f,...s,children:r})]})}function ce({href:e,children:t,ref:n,...r}){return(0,g.jsx)(x.default,{component:`a`,href:e,ref:n,target:`_blank`,rel:`noopener noreferrer`,...r,children:t})}const le={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`},ue=(0,C.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}),de=(0,C.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 fe({onFileInput:e,label:t=`Upload files`,multiple:n,accept:r,useDropzone:i,...a}){let[o,s]=(0,y.useState)(!1),c=(0,y.useId)(),l=(0,g.jsxs)(S.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)(b.MdCloudUpload,{}),children:[t,(0,g.jsx)(ue,{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)(de,{$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 pe({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)(fe,{...r,multiple:n,onFileInput:i}),(0,g.jsx)(T.default,{children:e.map(e=>(0,g.jsx)(E.default,{secondaryAction:(0,g.jsx)(w.default,{"aria-label":`Delete`,edge:`end`,onClick:()=>{t(t=>t.filter(t=>t!==e))},children:(0,g.jsx)(b.MdDelete,{})}),children:(0,g.jsx)(D.default,{primary:e.name})},`${e.name}-${e.lastModified}`))})]})}const me=(0,y.createContext)(void 0);function he({strict:e=!0}={}){let t=(0,y.useContext)(me);if(e&&!t)throw new k.DataError({strict:e,context:t},`LOADER_PROVIDER_NOT_FOUND`,`Could not find the LoaderProvider context. Please double-check that it is present.`);return t}function ge({children:e,loadingComponent:t=(0,g.jsx)(O.default,{}),...n}){return(0,g.jsx)(me.Provider,{value:{loadingComponent:t,...n},children:e})}function _e({children:e,dataParser:t,loadingComponent:n}){let{isLoading:r,data:i,dataParser:a,loadingComponent:o,error:s}=he(),c=t??a;return r?(0,g.jsx)(g.Fragment,{children:n??o}):s||i==null?(0,g.jsx)(g.Fragment,{}):c?typeof e==`function`?(0,g.jsx)(g.Fragment,{children:e(c(i))}):(0,g.jsx)(g.Fragment,{children:e}):typeof e==`function`?(0,g.jsx)(g.Fragment,{children:e(i)}):(0,g.jsx)(g.Fragment,{children:e})}function ve({children:e,undefinedComponent:t,nullComponent:n,nullableComponent:r,logError:i}){let{isLoading:a,data:o,error:s,errorComponent:c,logError:l}=he(),u=i??l,d=(0,y.useRef)(!1),f=e??c;return s?(u&&!d.current&&(console.error(s),d.current=!0),typeof f==`function`?f(s):f?(0,g.jsx)(g.Fragment,{children:f}):(0,g.jsx)(A.default,{severity:`error`,children: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 LoaderProvider. 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)(A.default,{severity:`error`,children:`Failed to load data. Please try again later.`}):(0,g.jsx)(g.Fragment,{})}var ye=ge;const be=(0,y.createContext)({toggleMode:()=>{},mode:`dark`});function X({strict:e=!0}={}){let t=(0,y.useContext)(be);if(e&&!t)throw new k.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 xe({children:e,mode:t=`dark`}){let[n,r]=(0,y.useState)(t),i=(0,y.useMemo)(()=>(0,C.createTheme)({palette:{mode:n}}),[n]);return(0,g.jsx)(be.Provider,{value:{mode:n,toggleMode:()=>{r(e=>e===`light`?`dark`:`light`)}},children:(0,g.jsxs)(C.ThemeProvider,{theme:i,children:[(0,g.jsx)(j.default,{}),e]})})}const Se=(0,y.createContext)({windowWidth:0,windowHeight:0,isLargeScreen:!1});function Ce({strict:e=!0}={}){let t=(0,y.useContext)(Se);if(e&&!t)throw new k.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 we({children:e,largeScreenWidth:t=669,largeScreenHeight:n=660}){let[r,i]=(0,y.useState)(window.innerWidth),[a,o]=(0,y.useState)(window.innerHeight);(0,y.useEffect)(()=>{function e(){i(window.innerWidth),o(window.innerHeight)}return e(),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e)}},[]);let s=(0,y.useMemo)(()=>r>t&&a>n,[r,a,t,n]);return(0,g.jsx)(Se.Provider,{value:{isLargeScreen:s,windowWidth:r,windowHeight:a},children:e})}const Te=(0,y.createContext)(void 0);function Ee({strict:e=!0}={}){let t=(0,y.useContext)(Te);if(e&&!t)throw new k.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 De({children:e,autoHideDuration:t=5e3}){let[n,r]=(0,y.useState)(!1),[i,a]=(0,y.useState)(t),[o,s]=(0,y.useState)(``),[c,l]=(0,y.useState)(`info`);function u(e,n,i){r(!0),a(i??t),l(n??`info`),s(e)}async function d(){r(!1),await(0,k.wait)(.2),s(``)}return(0,g.jsxs)(Te.Provider,{value:{addSnackbar:u},children:[(0,g.jsx)(M.default,{open:n,autoHideDuration:i,onClose:d,children:(0,g.jsx)(A.default,{onClose:d,severity:c,children:o})}),e]})}function Oe({children:e,errorComponent:t,undefinedComponent:n,nullComponent:r,nullableComponent:i,logError:a,loadingComponent:o=(0,g.jsx)(O.default,{}),...s}){return(0,g.jsxs)(ye,{loadingComponent:o,...s,children:[(0,g.jsx)(ve,{undefinedComponent:n,nullComponent:r,nullableComponent:i,logError:a,children:t}),(0,g.jsx)(_e,{children:e})]})}const ke=(0,C.styled)(P.default)(()=>({padding:8,"& .MuiSwitch-track":{borderRadius:11,"&::before, &::after":{content:`""`,position:`absolute`,top:`50%`,transform:`translateY(-50%)`,fontSize:16,width:28,height:28}}}));function Ae({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)(ke,{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})}function je(){let{mode:e,toggleMode:t}=X(),n=e===`dark`,r=`Enable ${n?`light`:`dark`} mode`;return(0,g.jsx)(N.default,{title:r,children:(0,g.jsx)(Ae,{uncheckedIcon:b.MdOutlineLightMode,checkedIcon:b.MdOutlineDarkMode,checked:n,onChange:t,"aria-label":r})})}function Me({children:e,navItems:t}){let[n,r]=(0,y.useState)(``);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(c.default,{sx:{paddingBottom:7},children:e}),(0,g.jsx)(L.default,{sx:{position:`fixed`,bottom:0,left:0,right:0},children:(0,g.jsx)(F.default,{showLabels:!0,value:n,onChange:(e,t)=>{r(t)},children:t.map(e=>(0,g.jsx)(I.default,{...e,component:R.Link},e.value))})})]})}function Ne({title:e,subtitle:t,action:n,children:r}){return(0,g.jsxs)(l.default,{children:[(0,g.jsx)(d.default,{title:(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(h.default,{variant:`h6`,children:e}),t?(0,g.jsx)(h.default,{variant:`body2`,color:`text.secondary`,children:t}):null]}),action:n}),(0,g.jsx)(p.default,{}),(0,g.jsx)(u.default,{children:r})]})}function Pe({code:e,previewStyles:t,...n}){let{mode:r}=X(),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)(z.LiveProvider,{...n,code:(0,ee.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)(z.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)(z.LivePreview,{}),(0,g.jsx)(z.LiveError,{})]})]})})}function Fe({columns:e}){return(0,g.jsx)(V.default,{children:(0,k.fillArray)(e=>(0,g.jsx)(B.default,{children:(0,g.jsx)(te.default,{})},e),e)})}const Ie=je;function Le({children:e,button:t=S.default,buttonChildren:n=`Menu`,buttonProps:r,isOpenIcon:i=(0,g.jsx)(b.MdArrowDropUp,{}),isClosedIcon:a=(0,g.jsx)(b.MdArrowDropDown,{}),onOpen:o,onClose:s}){let[l,u]=(0,y.useState)(null),d=(0,y.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===S.default&&(f.endIcon=d?i:a),(0,y.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)(H.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})]})}function Re(e){return{width:240,transition:e.transitions.create(`width`,{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:`hidden`}}function ze(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)`}}}(0,C.styled)(`div`)(({theme:e})=>({display:`flex`,alignItems:`center`,justifyContent:`flex-end`,padding:e.spacing(0,1),...e.mixins.toolbar})),(0,C.styled)(U.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})}}]})),(0,C.styled)(W.default,{shouldForwardProp:e=>e!==`open`})(({theme:e})=>({width:240,flexShrink:0,whiteSpace:`nowrap`,boxSizing:`border-box`,variants:[{props:({open:e})=>e,style:{...Re(e),"& .MuiDrawer-paper":Re(e)}},{props:({open:e})=>!e,style:{...ze(e),"& .MuiDrawer-paper":ze(e)}}]}));const{fieldContext:Be,formContext:Ve,useFieldContext:He,useFormContext:Ue}=(0,ne.createFormHookContexts)(),We=(0,y.createContext)(void 0);function Z({strict:e=!0}={}){let t=(0,y.useContext)(We);if(e&&!t)throw new k.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 Ge({strict:e=!0}={}){return Z({strict:e})}function Ke({children:e,onClose:t,...n}){let{anchorElement:r,isDropdownOpen:i,closeMenu:a}=Ge();return(0,g.jsx)(H.default,{anchorEl:r,open:i,onClose:(e,n)=>{e.defaultPrevented||a(),t&&t(e,n)},...n,children:e})}function qe({component:e,children:t,ref:n,onClick:r,...i}){let{closeMenu:a}=Z();return(0,g.jsx)(J.default,{component:e,ref:n,...i,onClick:e=>{r&&r(e),!e.defaultPrevented&&a()},children:t})}const Q=Z,Je=Ke,Ye=qe;var Xe=Je;function Ze({ref:e,href:t,children:n,onClick:r,...i}){let{closeMenu:a}=Q();return(0,g.jsx)(J.default,{component:ce,href:t,ref:e,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:n})}function $({to:e,component:t=R.Link,children:n,ref:r,...i}){return(0,g.jsx)(x.default,{component:t,to:e,ref:r,...i,children:n})}function Qe({to:e,ref:t,children:n,onClick:r,...i}){let{closeMenu:a}=Q();return(0,g.jsx)(J.default,{component:$,to:e,ref:t,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:n})}function $e({icon:e=b.MdVisibility,onOpen:t,onClose:n,iconProps:r,children:i}){let[a,o]=(0,y.useState)(null),s=!!a,l=(0,y.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)(Y.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 et({children:e,...t}){return(0,g.jsx)(G.default,{component:$,...t,children:e})}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,C.styled)(`div`)(({theme:e})=>({display:`flex`,alignItems:`center`,justifyContent:`flex-end`,padding:e.spacing(0,1),...e.mixins.toolbar})),it=(0,C.styled)(U.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,C.styled)(W.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,C.useTheme)(),[a,o]=(0,y.useState)(!0),s=(0,R.useLocation)();function l(){o(!0)}function u(){o(!1)}return(0,g.jsxs)(c.default,{sx:{display:`flex`},children:[(0,g.jsx)(j.default,{}),(0,g.jsx)(it,{position:`fixed`,open:a,children:(0,g.jsxs)(q.default,{children:[(0,g.jsx)(w.default,{color:`inherit`,"aria-label":`open drawer`,onClick:l,edge:`start`,sx:[{marginRight:5},a&&{display:`none`}],children:(0,g.jsx)(b.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)(w.default,{onClick:u,children:i.direction===`rtl`?(0,g.jsx)(b.MdChevronRight,{}):(0,g.jsx)(b.MdChevronLeft,{})})}),(0,g.jsx)(p.default,{}),t.map(e=>(0,g.jsxs)(y.Fragment,{children:[(0,g.jsxs)(T.default,{children:[(0,g.jsx)(h.default,{variant:a?`h5`:`h6`,sx:{paddingLeft:a?2:1},children:a?e.category:(0,k.truncate)(e.category,4)}),e.options.map(e=>(0,g.jsx)(E.default,{disablePadding:!0,sx:{display:`block`},children:(0,g.jsxs)(G.default,{sx:[{minHeight:48,px:2.5},a?{justifyContent:`initial`}:{justifyContent:`center`}],component:R.Link,to:e.to,selected:s.pathname===e.to,children:[(0,g.jsx)(K.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,k.truncate)(e.label,4)})}),(0,g.jsx)(D.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
- `).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,re.useFormContext)();return(0,g.jsx)(S.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,y.useState)(()=>{let t=window.location.hash.replace(`#`,``);return e&&t===``?e:t}),r=(0,y.useCallback)(()=>{let t=window.location.hash.replace(`#`,``);n(e&&t===``?e:t)},[n,e]);return(0,y.useEffect)(()=>(window.addEventListener(`hashchange`,r),()=>{window.removeEventListener(`hashchange`,r)}),[r]),[t,(0,y.useCallback)(e=>{let n=typeof e==`function`?e(t):e;n!==t&&(window.location.hash=n)},[t])]}exports.Artwork=oe,exports.CollapsableItem=se,exports.DarkModeToggle=Ie,exports.DropdownMenu=Le,exports.DropdownMenu2=Xe,exports.DropdownMenuExternalLink=Ze,exports.DropdownMenuInternalLink=Qe,exports.DropdownMenuItem=Ye,exports.ExternalLink=ce,exports.FileInput=fe,exports.FileInputList=pe,exports.FileType=le,exports.IconWithPopover=$e,exports.InternalLink=$,exports.ListItemInternalLink=et,exports.Loader=Oe,exports.LoaderData=_e,exports.LoaderError=ve,exports.LoaderProvider=ye,exports.ModeProvider=xe,exports.ModeToggle=je,exports.NavigationBottom=Me,exports.NavigationDrawer=ot,exports.Page=Ne,exports.PopoverText=st,exports.ReactPlayground=Pe,exports.ScreenSizeProvider=we,exports.SkeletonRow=Fe,exports.SnackbarProvider=De,exports.SubmitButton=ct,exports.SwitchWithIcons=Ae,exports.useDropdownMenu=Q,exports.useHash=lt,exports.useMode=X,exports.useScreenSize=Ce,exports.useSnackbar=Ee;
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 v=require(`@mui/material/Collapse`);v=s(v,1);let y=require(`react`),b=require(`react-icons/md`),x=require(`@mui/material/Link`);x=s(x,1);let S=require(`@mui/material/Button`);S=s(S,1);let C=require(`@mui/material/styles`),w=require(`@mui/material/IconButton`);w=s(w,1);let T=require(`@mui/material/List`);T=s(T,1);let E=require(`@mui/material/ListItem`);E=s(E,1);let D=require(`@mui/material/ListItemText`);D=s(D,1);let O=require(`@mui/material/Tooltip`);O=s(O,1);let ee=require(`@mui/material/Switch`);ee=s(ee,1);let k=require(`@alextheman/utility`),A=require(`@mui/material/CssBaseline`);A=s(A,1);let j=require(`@mui/material/CircularProgress`);j=s(j,1);let M=require(`@mui/material/Alert`);M=s(M,1);let 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 I=require(`@mui/material/Paper`);I=s(I,1);let L=require(`react-router-dom`),te=require(`common-tags`),R=require(`react-live`),z=require(`@mui/material/Skeleton`);z=s(z,1);let B=require(`@mui/material/TableCell`);B=s(B,1);let V=require(`@mui/material/TableRow`);V=s(V,1);let H=require(`@mui/material/Menu`);H=s(H,1);let U=require(`@mui/material/AppBar`);U=s(U,1);let W=require(`@mui/material/Drawer`);W=s(W,1);let G=require(`@mui/material/ListItemButton`);G=s(G,1);let K=require(`@mui/material/ListItemIcon`);K=s(K,1);let q=require(`@mui/material/Toolbar`);q=s(q,1),require(`wouter`),require(`@mui/material/AlertTitle`),require(`@mui/material/Container`),require(`wouter/memory-location`),require(`wouter/use-browser-location`);let ne=require(`@tanstack/react-form`);require(`@mui/material/TextField`);let J=require(`@mui/material/MenuItem`);J=s(J,1);let Y=require(`@mui/material/Popover`);Y=s(Y,1);let re=require(`react-hook-form`);function ie({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 ae(){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 oe(){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)(ie,{containerLabel:`You`,chipLabels:[`state`,`context`,`input`,`event`,`focus`,`value`,`history`]}),(0,g.jsx)(ae,{}),(0,g.jsx)(ie,{containerLabel:`I`,chipLabels:[`render`,`effect`,`response`,`update`,`history`,`layout`,`provider`]})]})})]})}function se({isInitiallyOpen:e,onOpen:t,onClose:n,children:r,buttonStyles:i,buttonContents:a,buttonComponent:o=_.default,collapseProps:s,openIcon:l=(0,g.jsx)(b.MdArrowDropUp,{}),closedIcon:u=(0,g.jsx)(b.MdArrowDropDown,{}),useDefaultStyling:d=o===_.default}){let[f,p]=(0,y.useState)(!!e);return(0,y.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)(v.default,{in:f,...s,children:r})]})}function ce({href:e,children:t,ref:n,...r}){return(0,g.jsx)(x.default,{component:`a`,href:e,ref:n,target:`_blank`,rel:`noopener noreferrer`,...r,children:t})}const le={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`},ue=(0,C.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}),de=(0,C.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 fe({onFileInput:e,label:t=`Upload files`,multiple:n,accept:r,useDropzone:i,...a}){let[o,s]=(0,y.useState)(!1),c=(0,y.useId)(),l=(0,g.jsxs)(S.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)(b.MdCloudUpload,{}),children:[t,(0,g.jsx)(ue,{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)(de,{$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 pe({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)(fe,{...r,multiple:n,onFileInput:i}),(0,g.jsx)(T.default,{children:e.map(e=>(0,g.jsx)(E.default,{secondaryAction:(0,g.jsx)(w.default,{"aria-label":`Delete`,edge:`end`,onClick:()=>{t(t=>t.filter(t=>t!==e))},children:(0,g.jsx)(b.MdDelete,{})}),children:(0,g.jsx)(D.default,{primary:e.name})},`${e.name}-${e.lastModified}`))})]})}const me=(0,C.styled)(ee.default)(()=>({padding:8,"& .MuiSwitch-track":{borderRadius:11,"&::before, &::after":{content:`""`,position:`absolute`,top:`50%`,transform:`translateY(-50%)`,fontSize:16,width:28,height:28}}}));function he({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)(me,{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 ge=(0,y.createContext)({toggleMode:()=>{},mode:`dark`});function X({strict:e=!0}={}){let t=(0,y.useContext)(ge);if(e&&!t)throw new k.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 _e({children:e,mode:t=`dark`}){let[n,r]=(0,y.useState)(t),i=(0,y.useMemo)(()=>(0,C.createTheme)({palette:{mode:n}}),[n]);return(0,g.jsx)(ge.Provider,{value:{mode:n,toggleMode:()=>{r(e=>e===`light`?`dark`:`light`)}},children:(0,g.jsxs)(C.ThemeProvider,{theme:i,children:[(0,g.jsx)(A.default,{}),e]})})}const ve=(0,y.createContext)(void 0);function ye({strict:e=!0}={}){let t=(0,y.useContext)(ve);if(e&&!t)throw new k.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 be({children:e,loadingComponent:t=(0,g.jsx)(j.default,{}),...n}){return(0,g.jsx)(ve.Provider,{value:{loadingComponent:t,...n},children:e})}function Z({children:e,dataParser:t,loadingComponent:n}){let{isLoading:r,data:i,dataParser:a,loadingComponent:o,error:s}=ye(),c=t??a;return r?(0,g.jsx)(g.Fragment,{children:n??o}):s||i==null?(0,g.jsx)(g.Fragment,{}):c?typeof e==`function`?(0,g.jsx)(g.Fragment,{children:e(c(i))}):(0,g.jsx)(g.Fragment,{children:e}):typeof e==`function`?(0,g.jsx)(g.Fragment,{children:e(i)}):(0,g.jsx)(g.Fragment,{children:e})}function Q({children:e,undefinedComponent:t,nullComponent:n,nullableComponent:r,logError:i}){let{isLoading:a,data:o,error:s,errorComponent:c,logError:l}=ye(),u=i??l,d=(0,y.useRef)(!1),f=e??c;return s?(u&&!d.current&&(console.error(s),d.current=!0),typeof f==`function`?f(s):f?(0,g.jsx)(g.Fragment,{children:f}):(0,g.jsx)(M.default,{severity:`error`,children: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)(M.default,{severity:`error`,children:`Failed to load data. Please try again later.`}):(0,g.jsx)(g.Fragment,{})}var $=be;const xe=(0,y.createContext)({windowWidth:0,windowHeight:0,isLargeScreen:!1});function Se({strict:e=!0}={}){let t=(0,y.useContext)(xe);if(e&&!t)throw new k.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 Ce({children:e,largeScreenWidth:t=669,largeScreenHeight:n=660}){let[r,i]=(0,y.useState)(window.innerWidth),[a,o]=(0,y.useState)(window.innerHeight);(0,y.useEffect)(()=>{function e(){i(window.innerWidth),o(window.innerHeight)}return e(),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e)}},[]);let s=(0,y.useMemo)(()=>r>t&&a>n,[r,a,t,n]);return(0,g.jsx)(xe.Provider,{value:{isLargeScreen:s,windowWidth:r,windowHeight:a},children:e})}const we=(0,y.createContext)(void 0);function Te({strict:e=!0}={}){let t=(0,y.useContext)(we);if(e&&!t)throw new k.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 Ee({children:e,autoHideDuration:t=5e3}){let[n,r]=(0,y.useState)(!1),[i,a]=(0,y.useState)(t),[o,s]=(0,y.useState)(``),[c,l]=(0,y.useState)(`info`);function u(e,n,i){r(!0),a(i??t),l(n??`info`),s(e)}async function d(){r(!1),await(0,k.wait)(.2),s(``)}return(0,g.jsxs)(we.Provider,{value:{addSnackbar:u},children:[(0,g.jsx)(N.default,{open:n,autoHideDuration:i,onClose:d,children:(0,g.jsx)(M.default,{onClose:d,severity:c,children:o})}),e]})}function De(){let{mode:e,toggleMode:t}=X(),n=e===`dark`,r=`Enable ${n?`light`:`dark`} mode`;return(0,g.jsx)(O.default,{title:r,children:(0,g.jsx)(he,{uncheckedIcon:b.MdOutlineLightMode,checkedIcon:b.MdOutlineDarkMode,checked:n,onChange:t,"aria-label":r})})}function Oe({children:e,navItems:t}){let[n,r]=(0,y.useState)(``);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(c.default,{sx:{paddingBottom:7},children:e}),(0,g.jsx)(I.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:L.Link},e.value))})})]})}function ke({title:e,subtitle:t,action:n,children:r}){return(0,g.jsxs)(l.default,{children:[(0,g.jsx)(d.default,{title:(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(h.default,{variant:`h6`,children:e}),t?(0,g.jsx)(h.default,{variant:`body2`,color:`text.secondary`,children:t}):null]}),action:n}),(0,g.jsx)(p.default,{}),(0,g.jsx)(u.default,{children:r})]})}function Ae({children:e,errorComponent:t,undefinedComponent:n,nullComponent:r,nullableComponent:i,logError:a,loadingComponent:o=(0,g.jsx)(j.default,{}),...s}){return(0,g.jsxs)($,{loadingComponent:o,...s,children:[(0,g.jsx)(Q,{undefinedComponent:n,nullComponent:r,nullableComponent:i,logError:a,children:t}),(0,g.jsx)(Z,{children:e})]})}function je({code:e,previewStyles:t,...n}){let{mode:r}=X(),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)(R.LiveProvider,{...n,code:(0,te.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)(R.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)(R.LivePreview,{}),(0,g.jsx)(R.LiveError,{})]})]})})}function Me({columns:e}){return(0,g.jsx)(V.default,{children:(0,k.fillArray)(e=>(0,g.jsx)(B.default,{children:(0,g.jsx)(z.default,{})},e),e)})}const Ne=De;function Pe({children:e,button:t=S.default,buttonChildren:n=`Menu`,buttonProps:r,isOpenIcon:i=(0,g.jsx)(b.MdArrowDropUp,{}),isClosedIcon:a=(0,g.jsx)(b.MdArrowDropDown,{}),onOpen:o,onClose:s}){let[l,u]=(0,y.useState)(null),d=(0,y.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===S.default&&(f.endIcon=d?i:a),(0,y.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)(H.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})]})}function Fe(e){return{width:240,transition:e.transitions.create(`width`,{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:`hidden`}}function Ie(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)`}}}(0,C.styled)(`div`)(({theme:e})=>({display:`flex`,alignItems:`center`,justifyContent:`flex-end`,padding:e.spacing(0,1),...e.mixins.toolbar})),(0,C.styled)(U.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})}}]})),(0,C.styled)(W.default,{shouldForwardProp:e=>e!==`open`})(({theme:e})=>({width:240,flexShrink:0,whiteSpace:`nowrap`,boxSizing:`border-box`,variants:[{props:({open:e})=>e,style:{...Fe(e),"& .MuiDrawer-paper":Fe(e)}},{props:({open:e})=>!e,style:{...Ie(e),"& .MuiDrawer-paper":Ie(e)}}]}));const{fieldContext:Le,formContext:Re,useFieldContext:ze,useFormContext:Be}=(0,ne.createFormHookContexts)(),Ve=(0,y.createContext)(void 0);function He({strict:e=!0}={}){let t=(0,y.useContext)(Ve);if(e&&!t)throw new k.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 Ue({strict:e=!0}={}){return He({strict:e})}function We({children:e,onClose:t,...n}){let{anchorElement:r,isDropdownOpen:i,closeMenu:a}=Ue();return(0,g.jsx)(H.default,{anchorEl:r,open:i,onClose:(e,n)=>{e.defaultPrevented||a(),t&&t(e,n)},...n,children:e})}function Ge({component:e,children:t,ref:n,onClick:r,...i}){let{closeMenu:a}=He();return(0,g.jsx)(J.default,{component:e,ref:n,...i,onClick:e=>{r&&r(e),!e.defaultPrevented&&a()},children:t})}const Ke=He,qe=We,Je=Ge;var Ye=qe;function Xe({ref:e,href:t,children:n,onClick:r,...i}){let{closeMenu:a}=Ke();return(0,g.jsx)(J.default,{component:ce,href:t,ref:e,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:n})}function Ze({to:e,component:t=L.Link,children:n,ref:r,...i}){return(0,g.jsx)(x.default,{component:t,to:e,ref:r,...i,children:n})}function Qe({to:e,ref:t,children:n,onClick:r,...i}){let{closeMenu:a}=Ke();return(0,g.jsx)(J.default,{component:Ze,to:e,ref:t,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:n})}function $e({icon:e=b.MdVisibility,onOpen:t,onClose:n,iconProps:r,children:i}){let[a,o]=(0,y.useState)(null),s=!!a,l=(0,y.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)(Y.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 et({children:e,...t}){return(0,g.jsx)(G.default,{component:Ze,...t,children:e})}const tt=Z,nt=Q,rt=$;function it(e){return{width:240,transition:e.transitions.create(`width`,{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:`hidden`}}function at(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 ot=(0,C.styled)(`div`)(({theme:e})=>({display:`flex`,alignItems:`center`,justifyContent:`flex-end`,padding:e.spacing(0,1),...e.mixins.toolbar})),st=(0,C.styled)(U.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})}}]})),ct=(0,C.styled)(W.default,{shouldForwardProp:e=>e!==`open`})(({theme:e})=>({width:240,flexShrink:0,whiteSpace:`nowrap`,boxSizing:`border-box`,variants:[{props:({open:e})=>e,style:{...it(e),"& .MuiDrawer-paper":it(e)}},{props:({open:e})=>!e,style:{...at(e),"& .MuiDrawer-paper":at(e)}}]}));function lt({title:e,navItems:t,children:n,headerElements:r}){let i=(0,C.useTheme)(),[a,o]=(0,y.useState)(!0),s=(0,L.useLocation)();function l(){o(!0)}function u(){o(!1)}return(0,g.jsxs)(c.default,{sx:{display:`flex`},children:[(0,g.jsx)(A.default,{}),(0,g.jsx)(st,{position:`fixed`,open:a,children:(0,g.jsxs)(q.default,{children:[(0,g.jsx)(w.default,{color:`inherit`,"aria-label":`open drawer`,onClick:l,edge:`start`,sx:[{marginRight:5},a&&{display:`none`}],children:(0,g.jsx)(b.MdMenu,{})}),(0,g.jsx)(h.default,{variant:`h6`,noWrap:!0,component:`div`,children:e}),r]})}),(0,g.jsxs)(ct,{variant:`permanent`,open:a,children:[(0,g.jsx)(ot,{children:(0,g.jsx)(w.default,{onClick:u,children:i.direction===`rtl`?(0,g.jsx)(b.MdChevronRight,{}):(0,g.jsx)(b.MdChevronLeft,{})})}),(0,g.jsx)(p.default,{}),t.map(e=>(0,g.jsxs)(y.Fragment,{children:[(0,g.jsxs)(T.default,{children:[(0,g.jsx)(h.default,{variant:a?`h5`:`h6`,sx:{paddingLeft:a?2:1},children:a?e.category:(0,k.truncate)(e.category,4)}),e.options.map(e=>(0,g.jsx)(E.default,{disablePadding:!0,sx:{display:`block`},children:(0,g.jsxs)(G.default,{sx:[{minHeight:48,px:2.5},a?{justifyContent:`initial`}:{justifyContent:`center`}],component:L.Link,to:e.to,selected:s.pathname===e.to,children:[(0,g.jsx)(K.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,k.truncate)(e.label,4)})}),(0,g.jsx)(D.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)(ot,{}),n]})]})}function ut({text:e,sx:t,...n}){return(0,g.jsx)(g.Fragment,{children:e.split(`
2
+ `).map((e,r)=>(0,g.jsx)(h.default,{sx:{margin:1,...t},...n,children:e},r))})}function dt({disableClean:e,label:t,...n}){let{formState:{disabled:r,isDirty:i,isSubmitting:a}}=(0,re.useFormContext)();return(0,g.jsx)(S.default,{color:`primary`,disabled:n.disabled||e&&!i||r,loading:a,type:`submit`,variant:`contained`,...n,children:t})}function ft(e){let[t,n]=(0,y.useState)(()=>{let t=window.location.hash.replace(`#`,``);return e&&t===``?e:t}),r=(0,y.useCallback)(()=>{let t=window.location.hash.replace(`#`,``);n(e&&t===``?e:t)},[n,e]);return(0,y.useEffect)(()=>(window.addEventListener(`hashchange`,r),()=>{window.removeEventListener(`hashchange`,r)}),[r]),[t,(0,y.useCallback)(e=>{let n=typeof e==`function`?e(t):e;n!==t&&(window.location.hash=n)},[t])]}exports.Artwork=oe,exports.CollapsableItem=se,exports.DarkModeToggle=Ne,exports.DropdownMenu=Pe,exports.DropdownMenu2=Ye,exports.DropdownMenuExternalLink=Xe,exports.DropdownMenuInternalLink=Qe,exports.DropdownMenuItem=Je,exports.ExternalLink=ce,exports.FileInput=fe,exports.FileInputList=pe,exports.FileType=le,exports.IconWithPopover=$e,exports.InternalLink=Ze,exports.ListItemInternalLink=et,exports.LoaderData=tt,exports.LoaderError=nt,exports.LoaderProvider=rt,exports.ModeProvider=_e,exports.ModeToggle=De,exports.NavigationBottom=Oe,exports.NavigationDrawer=lt,exports.Page=ke,exports.PopoverText=ut,exports.QueryBoundary=Ae,exports.QueryBoundaryData=Z,exports.QueryBoundaryError=Q,exports.QueryBoundaryProvider=$,exports.ReactPlayground=je,exports.ScreenSizeProvider=Ce,exports.SkeletonRow=Me,exports.SnackbarProvider=Ee,exports.SubmitButton=dt,exports.SwitchWithIcons=he,exports.useDropdownMenu=Ke,exports.useHash=ft,exports.useMode=X,exports.useScreenSize=Se,exports.useSnackbar=Te;
3
3
  //# sourceMappingURL=index.cjs.map