@alextheman/components 6.24.0 → 6.25.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 +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +58 -1
- package/dist/index.d.ts +58 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/v7/index.cjs +1 -1
- package/dist/v7/index.cjs.map +1 -1
- package/dist/v7/index.d.cts +2 -187
- package/dist/v7/index.d.ts +2 -187
- package/dist/v7/index.js +1 -1
- package/dist/v7/index.js.map +1 -1
- package/package.json +1 -1
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 O=require(`@mui/material/Switch`);O=s(O,1);let k=require(`@alextheman/utility/v6`),A=require(`@mui/material/CssBaseline`);A=s(A,1);let j=require(`@alextheman/utility`),M=require(`@mui/material/Alert`);M=s(M,1);let N=require(`@mui/material/Snackbar`);N=s(N,1);let P=require(`@mui/material/CircularProgress`);P=s(P,1);let te=require(`common-tags`),F=require(`react-live`),I=require(`@mui/material/Skeleton`);I=s(I,1);let L=require(`@mui/material/TableCell`);L=s(L,1);let R=require(`@mui/material/TableRow`);R=s(R,1);let z=require(`@mui/material/Menu`);z=s(z,1);let ne=require(`@mui/material/BottomNavigation`);ne=s(ne,1);let re=require(`@mui/material/BottomNavigationAction`);re=s(re,1);let ie=require(`@mui/material/Paper`);ie=s(ie,1);let ae=require(`@mui/material/AppBar`);ae=s(ae,1);let oe=require(`@mui/material/Drawer`);oe=s(oe,1);let B=require(`@mui/material/ListItemButton`);B=s(B,1);let V=require(`@mui/material/ListItemIcon`);V=s(V,1);let H=require(`@mui/material/Toolbar`);H=s(H,1);let U=require(`@mui/material/MenuItem`);U=s(U,1);let W=require(`react-router-dom`),G=require(`@mui/material/Popover`);G=s(G,1);let se=require(`react-hook-form`);function ce({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 le(){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 ue(){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)(ce,{containerLabel:`You`,chipLabels:[`state`,`context`,`input`,`event`,`focus`,`value`,`history`]}),(0,g.jsx)(le,{}),(0,g.jsx)(ce,{containerLabel:`I`,chipLabels:[`render`,`effect`,`response`,`update`,`history`,`layout`,`provider`]})]})})]})}function de({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 fe({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 pe={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`},me=(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}),he=(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 ge({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)(me,{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)(he,{$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 _e({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)(ge,{...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 ve=(0,S.styled)(O.default)(()=>({padding:8,"& .MuiSwitch-track":{borderRadius:11,"&::before, &::after":{content:`""`,position:`absolute`,top:`50%`,transform:`translateY(-50%)`,fontSize:16,width:28,height:28}}}));function ye({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)(ve,{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 be=(0,v.createContext)({toggleMode:()=>{},mode:`dark`});function K({strict:e=!0}={}){let t=(0,v.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,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)(be.Provider,{value:{mode:n,toggleMode:()=>{r(e=>e===`light`?`dark`:`light`)}},children:(0,g.jsxs)(S.ThemeProvider,{theme:i,children:[(0,g.jsx)(A.default,{}),e]})})}const Se=(0,v.createContext)({windowWidth:0,windowHeight:0,isLargeScreen:!1});function Ce({strict:e=!0}={}){let t=(0,v.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,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)(Se.Provider,{value:{isLargeScreen:s,windowWidth:r,windowHeight:a},children:e})}const Te=(0,v.createContext)(void 0);function Ee({strict:e=!0}={}){let t=(0,v.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,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,j.wait)(.2),s(``)}return(0,g.jsxs)(Te.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 Oe(){let{mode:e,toggleMode:t}=K(),n=e===`dark`,r=`Enable ${n?`light`:`dark`} mode`;return(0,g.jsx)(D.default,{title:r,children:(0,g.jsx)(ye,{uncheckedIcon:y.MdOutlineLightMode,checkedIcon:y.MdOutlineDarkMode,checked:n,onChange:t,"aria-label":r})})}function ke({title:e,subtitle:t,action:n,children:r,tabs:i,disablePadding:a}){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}),i,(0,g.jsx)(p.default,{}),a?r:(0,g.jsx)(u.default,{children:r})]})}const Ae=(0,v.createContext)(void 0);function q({strict:e=!0}={}){let t=(0,v.useContext)(Ae);if(e&&!t)throw new k.DataError({strict:e,context:t},`QUERY_BOUNDARY_PROVIDER_NOT_FOUND`,`Could not find the QueryBoundaryProvider context. Please double-check that it is present.`);return t}function J({children:e,loadingComponent:t=(0,g.jsx)(P.default,{}),...n}){return(0,g.jsx)(Ae.Provider,{value:{loadingComponent:t,...n},children:e})}function Y({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}=q(),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 k.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 X({children:e,logError:t}){let{data:n,error:r,errorComponent:i,logError:a}=q(),o=t??a,s=(0,v.useRef)(!1),c=e??i;return r?(o&&!s.current&&(n!=null&&console.error(`An error has occurred but data is still present. This may indicate an invalid query state.`,{data:n,error:r}),console.error(r),s.current=!0),typeof c==`function`?c(r):c?(0,g.jsx)(g.Fragment,{children:c}):(0,g.jsx)(M.default,{severity:`error`,children:typeof r==`object`&&`message`in r&&typeof r.message==`string`?r.message:`An unknown error has occured. Please try again later.`})):null}function Z({undefinedComponent:e,nullComponent:t,nullableComponent:n}){let{isLoading:r,data:i,error:a}=q();return r||a?null:i==null?n?(0,g.jsx)(g.Fragment,{children:n}):i===void 0&&e?(0,g.jsx)(g.Fragment,{children:e}):i===null&&t?(0,g.jsx)(g.Fragment,{children:t}):(0,g.jsx)(M.default,{severity:`error`,children:`Failed to load data. Please try again later.`}):null}function Q({errorComponent:e,logError:t,...n}){return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(X,{logError:t,children:e}),(0,g.jsx)(Z,{...n})]})}function je({query:e}){return{Context:({children:t})=>(0,g.jsx)(J,{isLoading:e.isLoading,error:e.error,data:e.data,children:t}),Error:X,Fallback:Q,Nullable:Z}}function Me({query:e}){return{...je({query:e}),DataMap:Y}}function Ne({loadingComponent:e,undefinedComponent:t,nullComponent:n,nullableComponent:r,logError:i,errorComponent:a,children:o,isLoading:s,error:c,data:l,dataParser:u,itemParser:d,itemKey:f}){let p=Me({query:{isLoading:s,error:c,data:l}}),m=(0,g.jsx)(p.Fallback,{logError:i,errorComponent:a});r?m=(0,g.jsx)(p.Fallback,{nullableComponent:r,logError:i,errorComponent:a}):(t||n)&&(m=(0,g.jsx)(p.Fallback,{undefinedComponent:t,nullComponent:n,logError:i,errorComponent:a}));let h=(0,g.jsx)(p.DataMap,{loadingComponent:e,itemKey:f,children:o});return u?h=(0,g.jsx)(p.DataMap,{loadingComponent:e,itemKey:f,dataParser:u,children:o}):d&&(h=(0,g.jsx)(p.DataMap,{loadingComponent:e,itemKey:f,itemParser:d,children:o})),(0,g.jsxs)(p.Context,{children:[m,h]})}function $({children:e,dataParser:t,loadingComponent:n}){let{isLoading:r,data:i,dataParser:a,loadingComponent:o,error:s}=q(),c=t??a;return s?null:r?(0,g.jsx)(g.Fragment,{children:n??o}):i==null?null:(0,g.jsx)(g.Fragment,{children:typeof e==`function`?e(c?c(i):i):e})}function Pe({query:e}){return{...je({query:e}),Data:$}}function Fe({children:e,errorComponent:t,undefinedComponent:n,nullComponent:r,nullableComponent:i,logError:a,loadingComponent:o=(0,g.jsx)(P.default,{}),isLoading:s,error:c,data:l,dataParser:u}){let d=Pe({query:{isLoading:s,error:c,data:l}}),f=(0,g.jsx)(d.Fallback,{logError:a,errorComponent:t});return i?f=(0,g.jsx)(d.Fallback,{nullableComponent:i,logError:a,errorComponent:t}):(n||r)&&(f=(0,g.jsx)(d.Fallback,{undefinedComponent:n,nullComponent:r,logError:a,errorComponent:t})),(0,g.jsxs)(d.Context,{children:[f,(0,g.jsx)(d.Data,{loadingComponent:o,dataParser:u,children:e})]})}function Ie({code:e,previewStyles:t,...n}){let{mode:r}=K(),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)(F.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)(F.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)(F.LivePreview,{}),(0,g.jsx)(F.LiveError,{})]})]})})}function Le({columns:e}){return(0,g.jsx)(R.default,{children:(0,j.fillArray)(e=>(0,g.jsx)(L.default,{children:(0,g.jsx)(I.default,{})},e),e)})}const Re=Oe;function ze({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)(z.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 Be=(0,v.createContext)(void 0);function Ve({strict:e=!0}={}){let t=(0,v.useContext)(Be);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 He({strict:e=!0}={}){return Ve({strict:e})}function Ue({children:e,onClose:t,...n}){let{anchorElement:r,isDropdownOpen:i,closeMenu:a}=He();return(0,g.jsx)(z.default,{anchorEl:r,open:i,onClose:(e,n)=>{e.defaultPrevented||a(),t&&t(e,n)},...n,children:e})}function We({component:e,children:t,ref:n,onClick:r,...i}){let{closeMenu:a}=Ve();return(0,g.jsx)(U.default,{component:e,ref:n,...i,onClick:e=>{r&&r(e),!e.defaultPrevented&&a()},children:t})}const Ge=Ve,Ke=Ue,qe=We;var Je=Ke;function Ye({ref:e,href:t,children:n,onClick:r,...i}){let{closeMenu:a}=Ge();return(0,g.jsx)(U.default,{component:fe,href:t,ref:e,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:n})}function Xe({to:e,component:t=W.Link,children:n,ref:r,...i}){return(0,g.jsx)(b.default,{component:t,to:e,ref:r,...i,children:n})}function Ze({to:e,ref:t,children:n,onClick:r,...i}){let{closeMenu:a}=Ge();return(0,g.jsx)(U.default,{component:Xe,to:e,ref:t,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:n})}function Qe({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)(G.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 $e({children:e,...t}){return(0,g.jsx)(B.default,{component:Xe,...t,children:e})}const et=Fe;function tt({query:e}){return{Context:({children:t})=>(0,g.jsx)(J,{isLoading:e.isLoading,error:e.error,data:`data`in e?e.data:e.dataCollection,children:t}),Error:X,Data:$,DataMap:Y,Fallback:Q,Nullable:Z}}const nt=$,rt=Q,it=J;function at({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)(ie.default,{sx:{position:`fixed`,bottom:0,left:0,right:0},children:(0,g.jsx)(ne.default,{showLabels:!0,value:n,onChange:(e,t)=>{r(t)},children:t.map(e=>(0,g.jsx)(re.default,{...e,component:W.Link},e.value))})})]})}function ot(e){return{width:240,transition:e.transitions.create(`width`,{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:`hidden`}}function st(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 ct=(0,S.styled)(`div`)(({theme:e})=>({display:`flex`,alignItems:`center`,justifyContent:`flex-end`,padding:e.spacing(0,1),...e.mixins.toolbar})),lt=(0,S.styled)(ae.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})}}]})),ut=(0,S.styled)(oe.default,{shouldForwardProp:e=>e!==`open`})(({theme:e})=>({width:240,flexShrink:0,whiteSpace:`nowrap`,boxSizing:`border-box`,variants:[{props:({open:e})=>e,style:{...ot(e),"& .MuiDrawer-paper":ot(e)}},{props:({open:e})=>!e,style:{...st(e),"& .MuiDrawer-paper":st(e)}}]}));function dt({title:e,navItems:t,children:n,headerElements:r}){let i=(0,S.useTheme)(),[a,o]=(0,v.useState)(!0),s=(0,W.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)(lt,{position:`fixed`,open:a,children:(0,g.jsxs)(H.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)(ut,{variant:`permanent`,open:a,children:[(0,g.jsx)(ct,{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,j.truncate)(e.category,4)}),e.options.map(e=>(0,g.jsx)(T.default,{disablePadding:!0,sx:{display:`block`},children:(0,g.jsxs)(B.default,{sx:[{minHeight:48,px:2.5},a?{justifyContent:`initial`}:{justifyContent:`center`}],component:W.Link,to:e.to,selected:s.pathname===e.to,children:[(0,g.jsx)(V.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,j.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)(ct,{}),n]})]})}function ft({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))})}const pt=Fe;function mt({disableClean:e,label:t,...n}){let{formState:{disabled:r,isDirty:i,isSubmitting:a}}=(0,se.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 ht(e,t=500){let[n,r]=(0,v.useState)(e);return(0,v.useEffect)(()=>{let n=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}function gt(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=ue,exports.CollapsableItem=de,exports.DarkModeToggle=Re,exports.DropdownMenu=ze,exports.DropdownMenu2=Je,exports.DropdownMenuExternalLink=Ye,exports.DropdownMenuInternalLink=Ze,exports.DropdownMenuItem=qe,exports.ExternalLink=fe,exports.FileInput=ge,exports.FileInputList=_e,exports.FileType=pe,exports.IconWithPopover=Qe,exports.InternalLink=Xe,exports.ListItemInternalLink=$e,exports.Loader=et,exports.LoaderData=nt,exports.LoaderError=rt,exports.LoaderProvider=it,exports.ModeProvider=xe,exports.ModeToggle=Oe,exports.NavigationBottom=at,exports.NavigationDrawer=dt,exports.Page=ke,exports.PopoverText=ft,exports.QueryBoundary=pt,exports.QueryBoundaryData=$,exports.QueryBoundaryDataMap=
|
|
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 O=require(`@mui/material/Switch`);O=s(O,1);let k=require(`@alextheman/utility/v6`),A=require(`@mui/material/CssBaseline`);A=s(A,1);let j=require(`@alextheman/utility`),M=require(`@mui/material/Alert`);M=s(M,1);let N=require(`@mui/material/Snackbar`);N=s(N,1);let P=require(`@mui/material/CircularProgress`);P=s(P,1);let te=require(`common-tags`),F=require(`react-live`),I=require(`@mui/material/Skeleton`);I=s(I,1);let L=require(`@mui/material/TableCell`);L=s(L,1);let R=require(`@mui/material/TableRow`);R=s(R,1);let z=require(`@mui/material/Menu`);z=s(z,1);let ne=require(`@mui/material/BottomNavigation`);ne=s(ne,1);let re=require(`@mui/material/BottomNavigationAction`);re=s(re,1);let ie=require(`@mui/material/Paper`);ie=s(ie,1);let ae=require(`@mui/material/AppBar`);ae=s(ae,1);let oe=require(`@mui/material/Drawer`);oe=s(oe,1);let B=require(`@mui/material/ListItemButton`);B=s(B,1);let V=require(`@mui/material/ListItemIcon`);V=s(V,1);let H=require(`@mui/material/Toolbar`);H=s(H,1);let U=require(`@mui/material/MenuItem`);U=s(U,1);let W=require(`react-router-dom`),G=require(`@mui/material/Popover`);G=s(G,1);let se=require(`react-hook-form`);function ce({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 le(){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 ue(){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)(ce,{containerLabel:`You`,chipLabels:[`state`,`context`,`input`,`event`,`focus`,`value`,`history`]}),(0,g.jsx)(le,{}),(0,g.jsx)(ce,{containerLabel:`I`,chipLabels:[`render`,`effect`,`response`,`update`,`history`,`layout`,`provider`]})]})})]})}function de({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 fe({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 pe={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`},me=(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}),he=(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 ge({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)(me,{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)(he,{$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 _e({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)(ge,{...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 ve=(0,S.styled)(O.default)(()=>({padding:8,"& .MuiSwitch-track":{borderRadius:11,"&::before, &::after":{content:`""`,position:`absolute`,top:`50%`,transform:`translateY(-50%)`,fontSize:16,width:28,height:28}}}));function ye({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)(ve,{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 be=(0,v.createContext)({toggleMode:()=>{},mode:`dark`});function K({strict:e=!0}={}){let t=(0,v.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,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)(be.Provider,{value:{mode:n,toggleMode:()=>{r(e=>e===`light`?`dark`:`light`)}},children:(0,g.jsxs)(S.ThemeProvider,{theme:i,children:[(0,g.jsx)(A.default,{}),e]})})}const Se=(0,v.createContext)({windowWidth:0,windowHeight:0,isLargeScreen:!1});function Ce({strict:e=!0}={}){let t=(0,v.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,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)(Se.Provider,{value:{isLargeScreen:s,windowWidth:r,windowHeight:a},children:e})}const Te=(0,v.createContext)(void 0);function Ee({strict:e=!0}={}){let t=(0,v.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,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,j.wait)(.2),s(``)}return(0,g.jsxs)(Te.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 Oe(){let{mode:e,toggleMode:t}=K(),n=e===`dark`,r=`Enable ${n?`light`:`dark`} mode`;return(0,g.jsx)(D.default,{title:r,children:(0,g.jsx)(ye,{uncheckedIcon:y.MdOutlineLightMode,checkedIcon:y.MdOutlineDarkMode,checked:n,onChange:t,"aria-label":r})})}function ke({title:e,subtitle:t,action:n,children:r,tabs:i,disablePadding:a}){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}),i,(0,g.jsx)(p.default,{}),a?r:(0,g.jsx)(u.default,{children:r})]})}const Ae=(0,v.createContext)(void 0);function q({strict:e=!0}={}){let t=(0,v.useContext)(Ae);if(e&&!t)throw new k.DataError({strict:e,context:t},`QUERY_BOUNDARY_PROVIDER_NOT_FOUND`,`Could not find the QueryBoundaryProvider context. Please double-check that it is present.`);return t}function J({children:e,loadingComponent:t=(0,g.jsx)(P.default,{}),...n}){return(0,g.jsx)(Ae.Provider,{value:{loadingComponent:t,...n},children:e})}function Y({children:e,logError:t}){let{data:n,error:r,errorComponent:i,logError:a}=q(),o=t??a,s=(0,v.useRef)(!1),c=e??i;return r?(o&&!s.current&&(n!=null&&console.error(`An error has occurred but data is still present. This may indicate an invalid query state.`,{data:n,error:r}),console.error(r),s.current=!0),typeof c==`function`?c(r):c?(0,g.jsx)(g.Fragment,{children:c}):(0,g.jsx)(M.default,{severity:`error`,children:typeof r==`object`&&`message`in r&&typeof r.message==`string`?r.message:`An unknown error has occured. Please try again later.`})):null}function X({undefinedComponent:e,nullComponent:t,nullableComponent:n}){let{isLoading:r,data:i,error:a}=q();return r||a?null:i==null?n?(0,g.jsx)(g.Fragment,{children:n}):i===void 0&&e?(0,g.jsx)(g.Fragment,{children:e}):i===null&&t?(0,g.jsx)(g.Fragment,{children:t}):(0,g.jsx)(M.default,{severity:`error`,children:`Failed to load data. Please try again later.`}):null}function Z({errorComponent:e,logError:t,...n}){return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(Y,{logError:t,children:e}),(0,g.jsx)(X,{...n})]})}function je({query:e}){return{Context:({children:t})=>(0,g.jsx)(J,{isLoading:e.isLoading,error:e.error,data:e.data,children:t}),Error:Y,Fallback:Z,Nullable:X}}function Q({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}=q(),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 k.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 Me({query:e}){return{...je({query:e}),DataMap:Q}}function Ne({loadingComponent:e,undefinedComponent:t,nullComponent:n,nullableComponent:r,logError:i,errorComponent:a,children:o,isLoading:s,error:c,data:l,dataParser:u,itemParser:d,itemKey:f}){let p=Me({query:{isLoading:s,error:c,data:l}}),m=(0,g.jsx)(p.Fallback,{logError:i,errorComponent:a});r?m=(0,g.jsx)(p.Fallback,{nullableComponent:r,logError:i,errorComponent:a}):(t||n)&&(m=(0,g.jsx)(p.Fallback,{undefinedComponent:t,nullComponent:n,logError:i,errorComponent:a}));let h=(0,g.jsx)(p.DataMap,{loadingComponent:e,itemKey:f,children:o});return u?h=(0,g.jsx)(p.DataMap,{loadingComponent:e,itemKey:f,dataParser:u,children:o}):d&&(h=(0,g.jsx)(p.DataMap,{loadingComponent:e,itemKey:f,itemParser:d,children:o})),(0,g.jsxs)(p.Context,{children:[m,h]})}function $({children:e,dataParser:t,loadingComponent:n}){let{isLoading:r,data:i,dataParser:a,loadingComponent:o,error:s}=q(),c=t??a;return s?null:r?(0,g.jsx)(g.Fragment,{children:n??o}):i==null?null:(0,g.jsx)(g.Fragment,{children:typeof e==`function`?e(c?c(i):i):e})}function Pe({query:e}){return{...je({query:e}),Data:$}}function Fe({children:e,errorComponent:t,undefinedComponent:n,nullComponent:r,nullableComponent:i,logError:a,loadingComponent:o=(0,g.jsx)(P.default,{}),isLoading:s,error:c,data:l,dataParser:u}){let d=Pe({query:{isLoading:s,error:c,data:l}}),f=(0,g.jsx)(d.Fallback,{logError:a,errorComponent:t});return i?f=(0,g.jsx)(d.Fallback,{nullableComponent:i,logError:a,errorComponent:t}):(n||r)&&(f=(0,g.jsx)(d.Fallback,{undefinedComponent:n,nullComponent:r,logError:a,errorComponent:t})),(0,g.jsxs)(d.Context,{children:[f,(0,g.jsx)(d.Data,{loadingComponent:o,dataParser:u,children:e})]})}function Ie({code:e,previewStyles:t,...n}){let{mode:r}=K(),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)(F.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)(F.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)(F.LivePreview,{}),(0,g.jsx)(F.LiveError,{})]})]})})}function Le({columns:e}){return(0,g.jsx)(R.default,{children:(0,j.fillArray)(e=>(0,g.jsx)(L.default,{children:(0,g.jsx)(I.default,{})},e),e)})}const Re=Oe;function ze({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)(z.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 Be=(0,v.createContext)(void 0);function Ve({strict:e=!0}={}){let t=(0,v.useContext)(Be);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 He({strict:e=!0}={}){return Ve({strict:e})}function Ue({children:e,onClose:t,...n}){let{anchorElement:r,isDropdownOpen:i,closeMenu:a}=He();return(0,g.jsx)(z.default,{anchorEl:r,open:i,onClose:(e,n)=>{e.defaultPrevented||a(),t&&t(e,n)},...n,children:e})}function We({component:e,children:t,ref:n,onClick:r,...i}){let{closeMenu:a}=Ve();return(0,g.jsx)(U.default,{component:e,ref:n,...i,onClick:e=>{r&&r(e),!e.defaultPrevented&&a()},children:t})}const Ge=Ve,Ke=Ue,qe=We;var Je=Ke;function Ye({ref:e,href:t,children:n,onClick:r,...i}){let{closeMenu:a}=Ge();return(0,g.jsx)(U.default,{component:fe,href:t,ref:e,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:n})}function Xe({to:e,component:t=W.Link,children:n,ref:r,...i}){return(0,g.jsx)(b.default,{component:t,to:e,ref:r,...i,children:n})}function Ze({to:e,ref:t,children:n,onClick:r,...i}){let{closeMenu:a}=Ge();return(0,g.jsx)(U.default,{component:Xe,to:e,ref:t,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:n})}function Qe({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)(G.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 $e({children:e,...t}){return(0,g.jsx)(B.default,{component:Xe,...t,children:e})}const et=Fe;function tt({query:e}){return{Context:({children:t})=>(0,g.jsx)(J,{isLoading:e.isLoading,error:e.error,data:`data`in e?e.data:e.dataCollection,children:t}),Error:Y,Data:$,DataMap:Q,Fallback:Z,Nullable:X}}const nt=$,rt=Z,it=J;function at({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)(ie.default,{sx:{position:`fixed`,bottom:0,left:0,right:0},children:(0,g.jsx)(ne.default,{showLabels:!0,value:n,onChange:(e,t)=>{r(t)},children:t.map(e=>(0,g.jsx)(re.default,{...e,component:W.Link},e.value))})})]})}function ot(e){return{width:240,transition:e.transitions.create(`width`,{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:`hidden`}}function st(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 ct=(0,S.styled)(`div`)(({theme:e})=>({display:`flex`,alignItems:`center`,justifyContent:`flex-end`,padding:e.spacing(0,1),...e.mixins.toolbar})),lt=(0,S.styled)(ae.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})}}]})),ut=(0,S.styled)(oe.default,{shouldForwardProp:e=>e!==`open`})(({theme:e})=>({width:240,flexShrink:0,whiteSpace:`nowrap`,boxSizing:`border-box`,variants:[{props:({open:e})=>e,style:{...ot(e),"& .MuiDrawer-paper":ot(e)}},{props:({open:e})=>!e,style:{...st(e),"& .MuiDrawer-paper":st(e)}}]}));function dt({title:e,navItems:t,children:n,headerElements:r}){let i=(0,S.useTheme)(),[a,o]=(0,v.useState)(!0),s=(0,W.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)(lt,{position:`fixed`,open:a,children:(0,g.jsxs)(H.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)(ut,{variant:`permanent`,open:a,children:[(0,g.jsx)(ct,{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,j.truncate)(e.category,4)}),e.options.map(e=>(0,g.jsx)(T.default,{disablePadding:!0,sx:{display:`block`},children:(0,g.jsxs)(B.default,{sx:[{minHeight:48,px:2.5},a?{justifyContent:`initial`}:{justifyContent:`center`}],component:W.Link,to:e.to,selected:s.pathname===e.to,children:[(0,g.jsx)(V.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,j.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)(ct,{}),n]})]})}function ft({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))})}const pt=Fe;function mt({disableClean:e,label:t,...n}){let{formState:{disabled:r,isDirty:i,isSubmitting:a}}=(0,se.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 ht(e,t=500){let[n,r]=(0,v.useState)(e);return(0,v.useEffect)(()=>{let n=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}function gt(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=ue,exports.CollapsableItem=de,exports.DarkModeToggle=Re,exports.DropdownMenu=ze,exports.DropdownMenu2=Je,exports.DropdownMenuExternalLink=Ye,exports.DropdownMenuInternalLink=Ze,exports.DropdownMenuItem=qe,exports.ExternalLink=fe,exports.FileInput=ge,exports.FileInputList=_e,exports.FileType=pe,exports.IconWithPopover=Qe,exports.InternalLink=Xe,exports.ListItemInternalLink=$e,exports.Loader=et,exports.LoaderData=nt,exports.LoaderError=rt,exports.LoaderProvider=it,exports.ModeProvider=xe,exports.ModeToggle=Oe,exports.NavigationBottom=at,exports.NavigationDrawer=dt,exports.Page=ke,exports.PopoverText=ft,exports.QueryBoundary=pt,exports.QueryBoundaryData=$,exports.QueryBoundaryDataMap=Q,exports.QueryBoundaryError=Y,exports.QueryBoundaryFallback=Z,exports.QueryBoundaryMap=Ne,exports.QueryBoundaryNullable=X,exports.QueryBoundaryProvider=J,exports.QueryBoundaryWrapper=Fe,exports.ReactPlayground=Ie,exports.ScreenSizeProvider=we,exports.SkeletonRow=Le,exports.SnackbarProvider=De,exports.SubmitButton=mt,exports.SwitchWithIcons=ye,exports.createBaseQueryBoundary=je,exports.createItemQueryBoundary=Pe,exports.createListQueryBoundary=Me,exports.createQueryBoundary=tt,exports.useDebounce=ht,exports.useDropdownMenu=Ge,exports.useHash=gt,exports.useMode=K,exports.useQueryBoundary=q,exports.useScreenSize=Ce,exports.useSnackbar=Ee;
|
|
3
3
|
//# sourceMappingURL=index.cjs.map
|