@alextheman/components 6.2.0 → 6.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { CollapseProps } from "@mui/material/Collapse";
2
2
  import * as react0 from "react";
3
3
  import { CSSProperties, ComponentProps, ComponentPropsWithRef, ComponentPropsWithoutRef, ComponentType, Dispatch, ElementType, JSX, MouseEvent, MouseEventHandler, ReactNode, Ref, SetStateAction } from "react";
4
- import * as react_jsx_runtime2 from "react/jsx-runtime";
4
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
5
5
  import MUIButton, { ButtonOwnProps, ButtonProps } from "@mui/material/Button";
6
6
  import { MenuItemOwnProps } from "@mui/material/MenuItem";
7
7
  import { AlertColor } from "@mui/material/Alert";
@@ -41,10 +41,10 @@ declare function CollapsableItem({
41
41
  openIcon,
42
42
  closedIcon,
43
43
  useDefaultStyling
44
- }: CollapsableItemProps): react_jsx_runtime2.JSX.Element;
44
+ }: CollapsableItemProps): react_jsx_runtime0.JSX.Element;
45
45
  //#endregion
46
46
  //#region src/components/DarkModeToggle.d.ts
47
- declare function DarkModeToggle(): react_jsx_runtime2.JSX.Element;
47
+ declare function DarkModeToggle(): react_jsx_runtime0.JSX.Element;
48
48
  //#endregion
49
49
  //#region src/components/DropdownMenu.d.ts
50
50
  interface DropdownMenuProps {
@@ -57,7 +57,18 @@ interface DropdownMenuProps {
57
57
  onOpen?: () => void;
58
58
  onClose?: () => void;
59
59
  }
60
- /** @deprecated This component does not support the new context-based pattern and individual DropdownMenuItem components. Please use DropdownMenu2 instead. */
60
+ /**
61
+ * @param root0
62
+ * @param root0.children
63
+ * @param root0.button
64
+ * @param root0.buttonChildren
65
+ * @param root0.buttonProps
66
+ * @param root0.isOpenIcon
67
+ * @param root0.isClosedIcon
68
+ * @param root0.onOpen
69
+ * @param root0.onClose
70
+ * @deprecated This component does not support the new context-based pattern and individual DropdownMenuItem components. Please use DropdownMenu2 instead.
71
+ */
61
72
  declare function DropdownMenu({
62
73
  children,
63
74
  button: Button,
@@ -67,7 +78,7 @@ declare function DropdownMenu({
67
78
  isClosedIcon,
68
79
  onOpen,
69
80
  onClose
70
- }: DropdownMenuProps): react_jsx_runtime2.JSX.Element;
81
+ }: DropdownMenuProps): react_jsx_runtime0.JSX.Element;
71
82
  //#endregion
72
83
  //#region src/components/ExternalLink.d.ts
73
84
  interface ExternalLinkProps extends Omit<LinkProps, "to" | "target" | "rel"> {
@@ -81,7 +92,7 @@ declare function ExternalLink({
81
92
  children,
82
93
  ref,
83
94
  ...linkProps
84
- }: ExternalLinkProps): react_jsx_runtime2.JSX.Element;
95
+ }: ExternalLinkProps): react_jsx_runtime0.JSX.Element;
85
96
  //#endregion
86
97
  //#region src/components/FileInput.d.ts
87
98
  declare const FileType: {
@@ -110,7 +121,7 @@ declare function FileInput({
110
121
  accept,
111
122
  useDropzone,
112
123
  ...buttonProps
113
- }: FileInputProps): react_jsx_runtime2.JSX.Element;
124
+ }: FileInputProps): react_jsx_runtime0.JSX.Element;
114
125
  //#endregion
115
126
  //#region src/components/FileInputList.d.ts
116
127
  interface FileInputListProps extends Omit<FileInputProps, "onFileInput"> {
@@ -121,7 +132,7 @@ declare function FileInputList({
121
132
  files,
122
133
  setFiles,
123
134
  ...fileInputProps
124
- }: FileInputListProps): react_jsx_runtime2.JSX.Element;
135
+ }: FileInputListProps): react_jsx_runtime0.JSX.Element;
125
136
  //#endregion
126
137
  //#region src/components/IconWithPopover.d.ts
127
138
  interface IconWithPopoverProps {
@@ -139,7 +150,7 @@ declare function IconWithPopover({
139
150
  onClose,
140
151
  iconProps,
141
152
  children
142
- }: IconWithPopoverProps): react_jsx_runtime2.JSX.Element;
153
+ }: IconWithPopoverProps): react_jsx_runtime0.JSX.Element;
143
154
  //#endregion
144
155
  //#region src/components/InternalLink.d.ts
145
156
  interface InternalLinkProps extends Omit<LinkProps, "href"> {
@@ -153,7 +164,7 @@ declare function InternalLink({
153
164
  children,
154
165
  ref,
155
166
  ...linkProps
156
- }: InternalLinkProps): react_jsx_runtime2.JSX.Element;
167
+ }: InternalLinkProps): react_jsx_runtime0.JSX.Element;
157
168
  //#endregion
158
169
  //#region src/components/ListItemInternalLink.d.ts
159
170
  interface ListItemInternalLinkProps extends Omit<ListItemButtonProps, "href"> {
@@ -163,7 +174,7 @@ interface ListItemInternalLinkProps extends Omit<ListItemButtonProps, "href"> {
163
174
  declare function ListItemInternalLink({
164
175
  children,
165
176
  ...listItemButtonProps
166
- }: ListItemInternalLinkProps): react_jsx_runtime2.JSX.Element;
177
+ }: ListItemInternalLinkProps): react_jsx_runtime0.JSX.Element;
167
178
  //#endregion
168
179
  //#region src/types/ContextHookOptions.d.ts
169
180
  interface ContextHookOptions<S extends boolean = true> {
@@ -193,7 +204,7 @@ declare function DropdownMenu2({
193
204
  buttonProps,
194
205
  openIcon,
195
206
  closedIcon
196
- }: DropdownMenu2Props): react_jsx_runtime2.JSX.Element;
207
+ }: DropdownMenu2Props): react_jsx_runtime0.JSX.Element;
197
208
  //#endregion
198
209
  //#region src/providers/DropdownMenu2/DropdownMenuExternalLink.d.ts
199
210
  interface DropdownMenuExternalLinkProps extends MenuItemOwnProps {
@@ -208,7 +219,7 @@ declare function DropdownMenuExternalLink({
208
219
  children,
209
220
  onClick,
210
221
  ...menuItemProps
211
- }: DropdownMenuExternalLinkProps): react_jsx_runtime2.JSX.Element;
222
+ }: DropdownMenuExternalLinkProps): react_jsx_runtime0.JSX.Element;
212
223
  //#endregion
213
224
  //#region src/providers/DropdownMenu2/DropdownMenuInternalLink.d.ts
214
225
  interface DropdownMenuInternalLinkProps extends MenuItemOwnProps {
@@ -223,7 +234,7 @@ declare function DropdownMenuInternalLink({
223
234
  children,
224
235
  onClick,
225
236
  ...menuItemProps
226
- }: DropdownMenuInternalLinkProps): react_jsx_runtime2.JSX.Element;
237
+ }: DropdownMenuInternalLinkProps): react_jsx_runtime0.JSX.Element;
227
238
  //#endregion
228
239
  //#region src/providers/DropdownMenu2/DropdownMenuItem.d.ts
229
240
  type DropdownMenuItemProps<RootComponent extends ElementType = typeof MUIButton> = {
@@ -238,25 +249,25 @@ declare function DropdownMenuItem<RootComponent extends ElementType>({
238
249
  ref,
239
250
  onClick,
240
251
  ...menuItemProps
241
- }: DropdownMenuItemProps<RootComponent>): react_jsx_runtime2.JSX.Element;
252
+ }: DropdownMenuItemProps<RootComponent>): react_jsx_runtime0.JSX.Element;
242
253
  //#endregion
243
254
  //#region src/providers/LoaderProvider/LoaderProvider.d.ts
244
- interface LoaderProviderBaseProps<T> {
255
+ interface LoaderProviderBaseProps<DataType> {
245
256
  /** The current loading status (true if loading, false if not) */
246
257
  isLoading: boolean;
247
258
  /** The data being loaded. */
248
- data?: T;
259
+ data?: DataType;
249
260
  /** A parser for the data. */
250
- dataParser?: (data: unknown) => NonNullable<T>;
261
+ dataParser?: (data: unknown) => NonNullable<DataType>;
251
262
  /** The component to show when the data is being fetched. */
252
263
  loadingComponent?: ReactNode;
253
264
  }
254
- interface LoaderProviderPropsWithNoError<T> extends LoaderProviderBaseProps<T> {
265
+ interface LoaderProviderPropsWithNoError<DataType> extends LoaderProviderBaseProps<DataType> {
255
266
  error?: never;
256
267
  errorComponent?: never;
257
268
  logError?: never;
258
269
  }
259
- interface LoaderProviderPropsWithError<T> extends LoaderProviderBaseProps<T> {
270
+ interface LoaderProviderPropsWithError<DataType> extends LoaderProviderBaseProps<DataType> {
260
271
  /** The error given if the request gave an error. */
261
272
  error: unknown;
262
273
  /** The component to show if an error has been thrown. Note that this may not be provided unless the error prop has also been provided. */
@@ -268,18 +279,28 @@ type LoaderContextValue<T> = LoaderProviderPropsWithNoError<T> | LoaderProviderP
268
279
  type LoaderProviderProps<T> = LoaderContextValue<T> & {
269
280
  children: ReactNode;
270
281
  };
271
- /** A provider for a context that deals with state management when fetching data from an API.
282
+ /**
283
+ * A provider for a context that deals with state management when fetching data from an API.
272
284
  * This may be used over Loader if you require more control over the placement of the error message and data display.
285
+ * @template DataType - The type of data being loaded.
286
+ * @param root0 - Props to pass to LoaderProvider.
287
+ * @param root0.children - The components that may receive access to the LoaderContext value.
288
+ * @param root0.loadingComponent - The component to show when the data is being fetched.
289
+ * @param root0.isLoading - The current loading status (true if loading, false if not)
290
+ * @param root0.error - The error given if the request gave an error.
291
+ * @param root0.errorComponent - The component to show if an error has been thrown. Note that this may not be provided unless the error prop has also been provided.
292
+ * @param root0.logError - An option to log the error to the console. Note that this may not be provided unless the error prop has also been provided.
273
293
  */
274
- declare function LoaderProvider<T>({
294
+ declare function LoaderProvider<DataType>({
275
295
  children,
276
296
  loadingComponent,
277
297
  ...contextProps
278
- }: LoaderProviderProps<T>): react_jsx_runtime2.JSX.Element;
298
+ }: LoaderProviderProps<DataType>): react_jsx_runtime0.JSX.Element;
279
299
  //#endregion
280
300
  //#region src/providers/LoaderProvider/LoaderData.d.ts
281
301
  interface LoaderDataProps<T> {
282
- /** The elements to show after data has been loaded.
302
+ /**
303
+ * The elements to show after data has been loaded.
283
304
  * This is best provided as a function with a data argument that guarantees the data will not be undefined by the time you receive it here.
284
305
  */
285
306
  children: ReactNode | ((data: NonNullable<T>) => ReactNode);
@@ -288,23 +309,26 @@ interface LoaderDataProps<T> {
288
309
  /** The component to show when the data is being fetched. */
289
310
  loadingComponent?: ReactNode;
290
311
  }
291
- /** The component responsible for showing the data provided by LoaderProvider. */
292
- declare function LoaderData<T>({
312
+ /**
313
+ * The component responsible for showing the data provided by LoaderProvider.
314
+ * @template DataType - The type of data being loaded.
315
+ * @param root0 - Props to pass to LoaderData.
316
+ * @param root0.children - The elements to show after data has been loaded.
317
+ * This is best provided as a function with a data argument that guarantees the data will not be undefined by the time you receive it here.
318
+ * @param root0.dataParser - A parser for the data.
319
+ * @param root0.loadingComponent - The component to show when the data is being fetched.
320
+ */
321
+ declare function LoaderData<DataType>({
293
322
  children,
294
323
  dataParser: loaderDataParser,
295
324
  loadingComponent
296
- }: LoaderDataProps<T>): react_jsx_runtime2.JSX.Element;
325
+ }: LoaderDataProps<DataType>): react_jsx_runtime0.JSX.Element;
297
326
  //#endregion
298
327
  //#region src/providers/LoaderProvider/LoaderError.d.ts
299
328
  interface LoaderErrorBaseProps {
300
- /**
301
- * The component to show if an error has been thrown.
302
- * @deprecated Please pass in the content to show on error as children instead.
303
- */
304
- errorComponent?: ReactNode | ((error: unknown) => ReactNode);
305
329
  /** The component to show if an error has been thrown. */
306
330
  children?: ReactNode | ((error: unknown) => ReactNode);
307
- /** Whether you want to log the error to the console or not. */
331
+ /** An option to log the error to the console. */
308
332
  logError?: boolean;
309
333
  }
310
334
  interface LoaderErrorPropsWithUndefinedOrNull extends LoaderErrorBaseProps {
@@ -321,14 +345,22 @@ interface LoaderErrorPropsWithNullable extends LoaderErrorBaseProps {
321
345
  nullableComponent?: ReactNode;
322
346
  }
323
347
  type LoaderErrorProps = LoaderErrorPropsWithUndefinedOrNull | LoaderErrorPropsWithNullable;
324
- /** The component responsible for showing any errors provided by LoaderProvider. */
348
+ /**
349
+ * The component responsible for showing any errors provided by LoaderProvider.
350
+ * @param root0 - The props to be passed to LoaderError.
351
+ * @param root0.children - The component to show if an error has been thrown.
352
+ * @param root0.undefinedComponent - The component to show if no error was thrown but the data is undefined.
353
+ * @param root0.nullComponent - The component to show if no error was thrown but the data is null.
354
+ * @param root0.nullableComponent - The component to show if no error was thrown but the data is nullable (undefined or null).
355
+ * @param root0.logError - An option to log the error to the console.
356
+ */
325
357
  declare function LoaderError({
326
358
  children,
327
359
  undefinedComponent,
328
360
  nullComponent,
329
361
  nullableComponent,
330
362
  logError: propsLogError
331
- }: LoaderErrorProps): string | number | bigint | boolean | react_jsx_runtime2.JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react0.ReactPortal | react0.ReactElement<unknown, string | react0.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
363
+ }: LoaderErrorProps): string | number | bigint | boolean | react_jsx_runtime0.JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react0.ReactPortal | react0.ReactElement<unknown, string | react0.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
332
364
  //#endregion
333
365
  //#region src/providers/ModeProvider.d.ts
334
366
  interface ModeContextValue {
@@ -345,7 +377,7 @@ interface ModeProviderProps {
345
377
  declare function ModeProvider({
346
378
  children,
347
379
  mode: modeProp
348
- }: ModeProviderProps): react_jsx_runtime2.JSX.Element;
380
+ }: ModeProviderProps): react_jsx_runtime0.JSX.Element;
349
381
  //#endregion
350
382
  //#region src/providers/ScreenSizeProvider.d.ts
351
383
  interface ScreenSizeProps {
@@ -365,7 +397,7 @@ declare function ScreenSizeProvider({
365
397
  children,
366
398
  largeScreenWidth,
367
399
  largeScreenHeight
368
- }: ScreenSizeProps): react_jsx_runtime2.JSX.Element;
400
+ }: ScreenSizeProps): react_jsx_runtime0.JSX.Element;
369
401
  //#endregion
370
402
  //#region src/providers/SnackbarProvider.d.ts
371
403
  interface SnackbarProviderProps {
@@ -381,22 +413,33 @@ declare function useSnackbar<Strict extends boolean = true>({
381
413
  declare function SnackbarProvider({
382
414
  children,
383
415
  autoHideDuration
384
- }: SnackbarProviderProps): react_jsx_runtime2.JSX.Element;
416
+ }: SnackbarProviderProps): react_jsx_runtime0.JSX.Element;
385
417
  //#endregion
386
418
  //#region src/components/Loader.d.ts
387
- type LoaderProps<T> = Omit<LoaderProviderProps<T>, "children"> & Omit<LoaderErrorProps, "errorComponent" | "children"> & Omit<LoaderDataProps<T>, "showOnError" | "onUndefined" | "onNull" | "onNullable">;
388
- /** An in-line component that deals with state management when fetching data from an API.
419
+ type LoaderProps<DataType> = Omit<LoaderProviderProps<DataType>, "children" | "logError"> & Omit<LoaderErrorProps, "errorComponent" | "children"> & Omit<LoaderDataProps<DataType>, "showOnError" | "onUndefined" | "onNull" | "onNullable">;
420
+ /**
421
+ * An in-line component that deals with state management when fetching data from an API.
389
422
  * This may be used over LoaderProvider if you don't require as much control over the placement of the error message and data display.
423
+ * @template DataType - The type of data being loaded.
424
+ * @param root0 - Props to pass to Loader.
425
+ * @param root0.children - The elements to show after data has been loaded.
426
+ * @param root0.errorComponent - The component to show if an error has been thrown. Note that this may not be provided unless the error prop has also been provided.
427
+ * @param root0.undefinedComponent - The component to show if no error was thrown but the data is undefined.
428
+ * @param root0.nullComponent - The component to show if no error was thrown but the data is null.
429
+ * @param root0.nullableComponent - The component to show if no error was thrown but the data is nullable (undefined or null).
430
+ * @param root0.loadingComponent - The component to show when the data is being fetched.
431
+ * @param root0.logError - An option to log the error to the console.
390
432
  */
391
- declare function Loader<T>({
433
+ declare function Loader<DataType>({
392
434
  children,
393
435
  errorComponent,
394
436
  undefinedComponent,
395
437
  nullComponent,
396
438
  nullableComponent,
439
+ logError,
397
440
  loadingComponent,
398
441
  ...loaderProviderProps
399
- }: LoaderProps<T>): react_jsx_runtime2.JSX.Element;
442
+ }: LoaderProps<DataType>): react_jsx_runtime0.JSX.Element;
400
443
  //#endregion
401
444
  //#region src/components/NavigationBottom.d.ts
402
445
  interface NavItemBottom {
@@ -412,7 +455,7 @@ interface NavigationBottomProps {
412
455
  declare function NavigationBottom({
413
456
  children,
414
457
  navItems
415
- }: NavigationBottomProps): react_jsx_runtime2.JSX.Element;
458
+ }: NavigationBottomProps): react_jsx_runtime0.JSX.Element;
416
459
  //#endregion
417
460
  //#region src/components/NavigationDrawer.d.ts
418
461
  interface NavMenuItem {
@@ -434,7 +477,7 @@ declare function NavigationDrawer({
434
477
  navItems,
435
478
  children,
436
479
  headerElements
437
- }: NavigationDrawerProps): react_jsx_runtime2.JSX.Element;
480
+ }: NavigationDrawerProps): react_jsx_runtime0.JSX.Element;
438
481
  //#endregion
439
482
  //#region src/components/PopoverText.d.ts
440
483
  interface PopoverTextProps extends TypographyProps {
@@ -444,7 +487,7 @@ declare function PopoverText({
444
487
  text,
445
488
  sx,
446
489
  ...typographyProps
447
- }: PopoverTextProps): react_jsx_runtime2.JSX.Element;
490
+ }: PopoverTextProps): react_jsx_runtime0.JSX.Element;
448
491
  //#endregion
449
492
  //#region src/components/ReactPlayground.d.ts
450
493
  interface ReactPlaygroundProps extends ComponentProps<typeof LiveProvider> {
@@ -454,7 +497,7 @@ declare function ReactPlayground({
454
497
  code,
455
498
  previewStyles,
456
499
  ...liveProviderProps
457
- }: ReactPlaygroundProps): react_jsx_runtime2.JSX.Element;
500
+ }: ReactPlaygroundProps): react_jsx_runtime0.JSX.Element;
458
501
  //#endregion
459
502
  //#region src/components/SkeletonRow.d.ts
460
503
  interface SkeletonRowProps {
@@ -462,7 +505,7 @@ interface SkeletonRowProps {
462
505
  }
463
506
  declare function SkeletonRow({
464
507
  columns
465
- }: SkeletonRowProps): react_jsx_runtime2.JSX.Element;
508
+ }: SkeletonRowProps): react_jsx_runtime0.JSX.Element;
466
509
  //#endregion
467
510
  //#region src/components/SubmitButton.d.ts
468
511
  interface SubmitButtonProps extends Omit<ButtonProps, "type"> {
@@ -473,7 +516,7 @@ declare function SubmitButton({
473
516
  disableClean,
474
517
  label,
475
518
  ...buttonProps
476
- }: SubmitButtonProps): react_jsx_runtime2.JSX.Element;
519
+ }: SubmitButtonProps): react_jsx_runtime0.JSX.Element;
477
520
  //#endregion
478
521
  //#region src/components/SwitchWithIcons.d.ts
479
522
  interface SwitchWithIconsProps extends Omit<SwitchProps, "icon" | "checkedIcon"> {
@@ -492,7 +535,7 @@ declare function SwitchWithIcons({
492
535
  uncheckedIcon: UncheckedIcon,
493
536
  uncheckedIconStyles,
494
537
  ...switchProps
495
- }: SwitchWithIconsProps): react_jsx_runtime2.JSX.Element;
538
+ }: SwitchWithIconsProps): react_jsx_runtime0.JSX.Element;
496
539
  //#endregion
497
540
  //#region src/hooks/useHash.d.ts
498
541
  declare function useHash<S extends string>(initialHash: S | undefined): [S, Dispatch<SetStateAction<S>>];
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import e from"@mui/icons-material/ArrowDropDown";import t from"@mui/icons-material/ArrowDropUp";import n from"@mui/material/Box";import r from"@mui/material/ButtonBase";import i from"@mui/material/Collapse";import{Fragment as a,createContext as o,useCallback as s,useContext as c,useEffect as l,useId as u,useMemo as d,useRef as f,useState as p}from"react";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";import _ from"@mui/icons-material/DarkMode";import v from"@mui/icons-material/LightMode";import y from"@mui/material/IconButton";import b from"@mui/material/Tooltip";import x from"@mui/material/Button";import S from"@mui/material/Menu";import C from"@mui/material/MenuItem";import w from"@mui/material/CircularProgress";import T from"@mui/material/Alert";import E from"@mui/material/CssBaseline";import{ThemeProvider as ee,createTheme as te,styled as D,useTheme as ne}from"@mui/material/styles";import{fillArray as re,truncate as O,wait as ie}from"@alextheman/utility";import ae from"@mui/material/Snackbar";import k from"@mui/material/Link";import oe from"@mui/icons-material/CloudUpload";import se from"@mui/icons-material/Delete";import A from"@mui/material/List";import j from"@mui/material/ListItem";import M from"@mui/material/ListItemText";import ce from"@mui/material/Popover";import{Link as N,useLocation as le}from"react-router-dom";import P from"@mui/material/ListItemButton";import ue from"@mui/material/BottomNavigation";import de from"@mui/material/BottomNavigationAction";import fe from"@mui/material/Paper";import pe from"@mui/icons-material/ChevronLeft";import me from"@mui/icons-material/ChevronRight";import he from"@mui/icons-material/Menu";import ge from"@mui/material/AppBar";import F from"@mui/material/Divider";import _e from"@mui/material/Drawer";import ve from"@mui/material/ListItemIcon";import ye from"@mui/material/Toolbar";import I from"@mui/material/Typography";import{stripIndent as be}from"common-tags";import{LiveEditor as xe,LiveError as Se,LivePreview as Ce,LiveProvider as we}from"react-live";import Te from"@mui/material/Skeleton";import Ee from"@mui/material/TableCell";import De from"@mui/material/TableRow";import{useFormContext as Oe}from"react-hook-form";import ke from"@mui/material/Switch";function Ae({isInitiallyOpen:a,onOpen:o,onClose:s,children:c,buttonStyles:u,buttonContents:d,buttonComponent:f=r,collapseProps:m,openIcon:_=h(t,{}),closedIcon:v=h(e,{}),useDefaultStyling:y=f===r}){let[b,x]=p(!!a);return l(()=>{b&&o?o():!b&&s&&s()},[b]),g(n,{children:[g(f,{onClick:()=>{x(e=>!e)},sx:y?{width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,paddingY:1.5,paddingX:2,textAlign:`center`,"&:hover":f===r?{backgroundColor:`action.hover`}:null,...u}:u,"aria-expanded":b,children:[d,b?_:v]}),h(i,{in:b,...m,children:c})]})}var je=Ae;const L=o(void 0);function R({strict:e=!0}={}){let t=c(L);if(e&&!t)throw Error(`DROPDOWN_MENU_NOT_FOUND`);return t}function Me({children:n,button:r=x,buttonProps:i,openIcon:a=h(t,{}),closedIcon:o=h(e,{})}){let[s,c]=p(null),l=d(()=>!!s,[s]);function u(){c(null)}return g(L.Provider,{value:{closeMenu:u,isDropdownOpen:l},children:[h(r,{"aria-controls":l?`dropdown-menu`:void 0,"aria-haspopup":`true`,"aria-expanded":l,endIcon:l?a:o,...i,onClick:e=>{e.defaultPrevented||c(e.currentTarget),i?.onClick&&i?.onClick(e)}}),h(S,{anchorEl:s,open:l,onClose:u,children:n})]})}var Ne=Me;function Pe({ref:e,href:t,children:n,onClick:r,...i}){let{closeMenu:a}=R();return h(C,{component:J,href:t,ref:e,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:n})}var Fe=Pe;function Ie({to:e,ref:t,children:n,onClick:r,...i}){let{closeMenu:a}=R();return h(C,{component:X,to:e,ref:t,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:n})}var Le=Ie;function Re({component:e,children:t,ref:n,onClick:r,...i}){let{closeMenu:a}=R();return h(C,{component:e??x,ref:n,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:t})}var ze=Re,Be=Ne;const z=o(void 0);function B({strict:e=!0}={}){let t=c(z);if(e&&!t)throw Error(`LOADER_PROVIDER_NOT_FOUND`);return t}function Ve({children:e,loadingComponent:t=h(w,{}),...n}){return h(z.Provider,{value:{loadingComponent:t,...n},children:e})}var He=Ve;function Ue({children:e,dataParser:t,loadingComponent:n}){let{isLoading:r,data:i,dataParser:a,loadingComponent:o,error:s}=B(),c=t??a;return r?h(m,{children:n??o}):s||i==null?h(m,{}):c?typeof e==`function`?h(m,{children:e(c(i))}):h(m,{children:e}):typeof e==`function`?h(m,{children:e(i)}):h(m,{children:e})}var V=Ue;function We({children:e,undefinedComponent:t,nullComponent:n,nullableComponent:r,logError:i}){let{isLoading:a,data:o,error:s,errorComponent:c,logError:l}=B(),u=i??l,d=f(!1),p=e??c;return s?(u&&!d.current&&(console.error(s),d.current=!0),typeof p==`function`?p(s):p?h(m,{children:p}):h(T,{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),h(m,{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)?h(m,{children:t}):o===null&&(u&&!d.current&&(console.error(`Data is null after loading.`),d.current=!0),n)?h(m,{children:n}):h(T,{severity:`error`,children:`Failed to load data. Please try again later.`}):h(m,{})}var H=We,U=He;const W=o({toggleMode:()=>{},mode:`dark`});function G({strict:e=!0}={}){let t=c(W);if(e&&!t)throw Error(`MODE_PROVIDER_NOT_FOUND`);return t}function Ge({children:e,mode:t=`dark`}){let[n,r]=p(t),i=d(()=>te({palette:{mode:n}}),[n]);return h(W.Provider,{value:{mode:n,toggleMode:()=>{r(e=>e===`light`?`dark`:`light`)}},children:g(ee,{theme:i,children:[h(E,{}),e]})})}var Ke=Ge;const K=o({windowWidth:0,windowHeight:0,isLargeScreen:!1});function qe({strict:e=!0}={}){let t=c(K);if(e&&!t)throw Error(`SCREEN_SIZE_PROVIDER_NOT_FOUND`);return t}function Je({children:e,largeScreenWidth:t=669,largeScreenHeight:n=660}){let[r,i]=p(window.innerWidth),[a,o]=p(window.innerHeight);l(()=>{function e(){i(window.innerWidth),o(window.innerHeight)}return e(),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e)}},[]);let s=d(()=>r>t&&a>n,[r,a,t,n]);return h(K.Provider,{value:{isLargeScreen:s,windowWidth:r,windowHeight:a},children:e})}var Ye=Je;const q=o(void 0);function Xe({strict:e=!0}={}){let t=c(q);if(e&&!t)throw Error(`SNACKBAR_PROVIDER_NOT_FOUND`);return t}function Ze({children:e,autoHideDuration:t=5e3}){let[n,r]=p(!1),[i,a]=p(t),[o,s]=p(``),[c,l]=p(`info`);function u(e,n,i){r(!0),a(i??t),l(n??`info`),s(e)}async function d(){r(!1),await ie(.2),s(``)}return g(q.Provider,{value:{addSnackbar:u},children:[h(ae,{open:n,autoHideDuration:i,onClose:d,children:h(T,{onClose:d,severity:c,children:o})}),e]})}var Qe=Ze;function $e(){let{mode:e,toggleMode:t}=G();return h(b,{title:`Enable ${e===`dark`?`light`:`dark`} mode`,children:h(y,{sx:{marginLeft:`auto`},onClick:t,"aria-label":`Enable ${e===`dark`?`light`:`dark`} mode`,children:h(e===`dark`?v:_,{})})})}var et=$e;function tt({children:r,button:i=x,buttonChildren:a=`Menu`,buttonProps:o,isOpenIcon:s=h(t,{}),isClosedIcon:c=h(e,{}),onOpen:u,onClose:f}){let[m,_]=p(null),v=d(()=>!!m,[m]),y={...o,onClick:e=>{_(e.currentTarget)},"aria-controls":v?`dropdown-menu`:void 0,"aria-haspopup":`true`,"aria-expanded":v};return i===x&&(y.endIcon=v?s:c),l(()=>{v&&u?u():!v&&f&&f()},[v,u,f]),g(n,{children:[h(i,{...y,children:a}),h(S,{id:`dropdown-menu`,anchorEl:m,open:v,onClose:()=>{_(null)},children:typeof r==`function`?h(n,{children:r(()=>{_(null)})}):r})]})}var nt=tt;function rt({href:e,children:t,ref:n,...r}){return h(k,{component:`a`,href:e,ref:n,target:`_blank`,rel:`noopener noreferrer`,...r,children:t})}var J=rt;const it={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`},at=D(`input`)({clip:`rect(0 0 0 0)`,clipPath:`inset(50%)`,height:1,overflow:`hidden`,position:`absolute`,bottom:0,left:0,whiteSpace:`nowrap`,width:1}),ot=D(`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 st({onFileInput:e,label:t=`Upload files`,multiple:n,accept:r,useDropzone:i,...a}){let[o,s]=p(!1),c=g(x,{variant:`contained`,component:`label`,"aria-label":`File upload button`,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),document.getElementById(`file-input`)?.click())},...a,startIcon:a.startIcon??h(oe,{}),children:[t,h(at,{id:`file-input`,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?h(ot,{$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:c}):c}var Y=st;function ct({files:e,setFiles:t,...r}){function i(e){t(t=>[...t,...e])}let a={...r,onFileInput:i};return a?.multiple===void 0&&(a.multiple=!0),g(n,{children:[h(Y,{...a}),h(A,{children:e.map(e=>h(j,{secondaryAction:h(y,{"aria-label":`Delete`,edge:`end`,onClick:()=>{t(t=>t.filter(t=>t!==e))},children:h(se,{})}),children:h(M,{primary:e.name})},e.name))})]})}var lt=ct;function ut({icon:e,onOpen:t,onClose:r,iconProps:i,children:a}){let[o,s]=p(null),c=!!o,l=u();function d(e){s(e.currentTarget),t&&t()}function f(){s(null),r&&r()}return g(n,{children:[h(e,{"aria-owns":c?l:void 0,"aria-haspopup":`true`,onMouseEnter:d,onMouseLeave:f,...i}),h(ce,{id:l,sx:{pointerEvents:`none`},open:c,anchorEl:o,anchorOrigin:{vertical:`bottom`,horizontal:`left`},transformOrigin:{vertical:`top`,horizontal:`left`},onClose:f,disableRestoreFocus:!0,children:a})]})}var dt=ut;function ft({to:e,children:t,ref:n,...r}){return h(k,{component:N,to:e,ref:n,...r,children:t})}var X=ft;function pt({children:e,...t}){return h(P,{component:X,...t,children:e})}var mt=pt;function ht({children:e,errorComponent:t,undefinedComponent:n,nullComponent:r,nullableComponent:i,loadingComponent:a=h(w,{}),...o}){return g(U,{loadingComponent:a,...o,children:[h(H,{undefinedComponent:n,nullComponent:r,nullableComponent:i,children:t}),h(V,{children:e})]})}var gt=ht;function _t({children:e,navItems:t}){let[r,i]=p(``);return g(m,{children:[h(n,{sx:{paddingBottom:7},children:e}),h(fe,{sx:{position:`fixed`,bottom:0,left:0,right:0},children:h(ue,{showLabels:!0,value:r,onChange:(e,t)=>{i(t)},children:t.map(e=>h(de,{...e,component:N},e.value))})})]})}var vt=_t;function Z(e){return{width:240,transition:e.transitions.create(`width`,{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:`hidden`}}function Q(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 $=D(`div`)(({theme:e})=>({display:`flex`,alignItems:`center`,justifyContent:`flex-end`,padding:e.spacing(0,1),...e.mixins.toolbar})),yt=D(ge,{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})}}]})),bt=D(_e,{shouldForwardProp:e=>e!==`open`})(({theme:e})=>({width:240,flexShrink:0,whiteSpace:`nowrap`,boxSizing:`border-box`,variants:[{props:({open:e})=>e,style:{...Z(e),"& .MuiDrawer-paper":Z(e)}},{props:({open:e})=>!e,style:{...Q(e),"& .MuiDrawer-paper":Q(e)}}]}));function xt({title:e,navItems:t,children:r,headerElements:i}){let o=ne(),[s,c]=p(!0),l=le();function u(){c(!0)}function d(){c(!1)}return g(n,{sx:{display:`flex`},children:[h(E,{}),h(yt,{position:`fixed`,open:s,children:g(ye,{children:[h(y,{color:`inherit`,"aria-label":`open drawer`,onClick:u,edge:`start`,sx:[{marginRight:5},s&&{display:`none`}],children:h(he,{})}),h(I,{variant:`h6`,noWrap:!0,component:`div`,children:e}),i]})}),g(bt,{variant:`permanent`,open:s,children:[h($,{children:h(y,{onClick:d,children:o.direction===`rtl`?h(me,{}):h(pe,{})})}),h(F,{}),t.map(e=>g(a,{children:[g(A,{children:[h(I,{variant:s?`h5`:`h6`,paddingLeft:s?2:1,children:s?e.category:O(e.category,4)}),e.options.map(e=>h(j,{disablePadding:!0,sx:{display:`block`},children:g(P,{sx:[{minHeight:48,px:2.5},s?{justifyContent:`initial`}:{justifyContent:`center`}],component:N,to:e.to,selected:l.pathname===e.to,children:[h(ve,{sx:[{minWidth:0,justifyContent:`center`},s?{mr:3}:{mr:`auto`}],children:e.icon?e.icon:s?null:h(I,{children:O(e.label,4)})}),h(M,{primary:e.label,sx:[s?{opacity:1}:{opacity:0}]})]})},e.to))]}),h(F,{})]},e.category))]}),g(n,{component:`main`,sx:{flexGrow:1,p:3},children:[h($,{}),r]})]})}var St=xt;function Ct({text:e,sx:t,...n}){return h(m,{children:e.split(`
1
+ import e from"@mui/icons-material/ArrowDropDown";import t from"@mui/icons-material/ArrowDropUp";import n from"@mui/material/Box";import r from"@mui/material/ButtonBase";import i from"@mui/material/Collapse";import{Fragment as a,createContext as o,useCallback as s,useContext as c,useEffect as l,useId as u,useMemo as d,useRef as f,useState as p}from"react";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";import _ from"@mui/icons-material/DarkMode";import v from"@mui/icons-material/LightMode";import y from"@mui/material/IconButton";import b from"@mui/material/Tooltip";import x from"@mui/material/Button";import S from"@mui/material/Menu";import C from"@mui/material/MenuItem";import w from"@mui/material/CircularProgress";import T from"@mui/material/Alert";import E from"@mui/material/CssBaseline";import{ThemeProvider as ee,createTheme as te,styled as D,useTheme as ne}from"@mui/material/styles";import{fillArray as re,truncate as O,wait as ie}from"@alextheman/utility";import ae from"@mui/material/Snackbar";import k from"@mui/material/Link";import oe from"@mui/icons-material/CloudUpload";import se from"@mui/icons-material/Delete";import A from"@mui/material/List";import j from"@mui/material/ListItem";import M from"@mui/material/ListItemText";import ce from"@mui/material/Popover";import{Link as N,useLocation as le}from"react-router-dom";import P from"@mui/material/ListItemButton";import ue from"@mui/material/BottomNavigation";import de from"@mui/material/BottomNavigationAction";import fe from"@mui/material/Paper";import pe from"@mui/icons-material/ChevronLeft";import me from"@mui/icons-material/ChevronRight";import he from"@mui/icons-material/Menu";import ge from"@mui/material/AppBar";import F from"@mui/material/Divider";import _e from"@mui/material/Drawer";import ve from"@mui/material/ListItemIcon";import ye from"@mui/material/Toolbar";import I from"@mui/material/Typography";import{stripIndent as be}from"common-tags";import{LiveEditor as xe,LiveError as Se,LivePreview as Ce,LiveProvider as we}from"react-live";import Te from"@mui/material/Skeleton";import Ee from"@mui/material/TableCell";import De from"@mui/material/TableRow";import{useFormContext as Oe}from"react-hook-form";import ke from"@mui/material/Switch";function Ae({isInitiallyOpen:a,onOpen:o,onClose:s,children:c,buttonStyles:u,buttonContents:d,buttonComponent:f=r,collapseProps:m,openIcon:_=h(t,{}),closedIcon:v=h(e,{}),useDefaultStyling:y=f===r}){let[b,x]=p(!!a);return l(()=>{b&&o?o():!b&&s&&s()},[b]),g(n,{children:[g(f,{onClick:()=>{x(e=>!e)},sx:y?{width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,paddingY:1.5,paddingX:2,textAlign:`center`,"&:hover":f===r?{backgroundColor:`action.hover`}:null,...u}:u,"aria-expanded":b,children:[d,b?_:v]}),h(i,{in:b,...m,children:c})]})}var je=Ae;const L=o(void 0);function R({strict:e=!0}={}){let t=c(L);if(e&&!t)throw Error(`DROPDOWN_MENU_NOT_FOUND`);return t}function Me({children:n,button:r=x,buttonProps:i,openIcon:a=h(t,{}),closedIcon:o=h(e,{})}){let[s,c]=p(null),l=d(()=>!!s,[s]);function u(){c(null)}return g(L.Provider,{value:{closeMenu:u,isDropdownOpen:l},children:[h(r,{"aria-controls":l?`dropdown-menu`:void 0,"aria-haspopup":`true`,"aria-expanded":l,endIcon:l?a:o,...i,onClick:e=>{e.defaultPrevented||c(e.currentTarget),i?.onClick&&i?.onClick(e)}}),h(S,{anchorEl:s,open:l,onClose:u,children:n})]})}var Ne=Me;function Pe({ref:e,href:t,children:n,onClick:r,...i}){let{closeMenu:a}=R();return h(C,{component:J,href:t,ref:e,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:n})}var Fe=Pe;function Ie({to:e,ref:t,children:n,onClick:r,...i}){let{closeMenu:a}=R();return h(C,{component:X,to:e,ref:t,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:n})}var Le=Ie;function Re({component:e,children:t,ref:n,onClick:r,...i}){let{closeMenu:a}=R();return h(C,{component:e??x,ref:n,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:t})}var ze=Re,Be=Ne;const z=o(void 0);function B({strict:e=!0}={}){let t=c(z);if(e&&!t)throw Error(`LOADER_PROVIDER_NOT_FOUND`);return t}function Ve({children:e,loadingComponent:t=h(w,{}),...n}){return h(z.Provider,{value:{loadingComponent:t,...n},children:e})}var He=Ve;function Ue({children:e,dataParser:t,loadingComponent:n}){let{isLoading:r,data:i,dataParser:a,loadingComponent:o,error:s}=B(),c=t??a;return r?h(m,{children:n??o}):s||i==null?h(m,{}):c?typeof e==`function`?h(m,{children:e(c(i))}):h(m,{children:e}):typeof e==`function`?h(m,{children:e(i)}):h(m,{children:e})}var V=Ue;function We({children:e,undefinedComponent:t,nullComponent:n,nullableComponent:r,logError:i}){let{isLoading:a,data:o,error:s,errorComponent:c,logError:l}=B(),u=i??l,d=f(!1),p=e??c;return s?(u&&!d.current&&(console.error(s),d.current=!0),typeof p==`function`?p(s):p?h(m,{children:p}):h(T,{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),h(m,{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)?h(m,{children:t}):o===null&&(u&&!d.current&&(console.error(`Data is null after loading.`),d.current=!0),n)?h(m,{children:n}):h(T,{severity:`error`,children:`Failed to load data. Please try again later.`}):h(m,{})}var H=We,U=He;const W=o({toggleMode:()=>{},mode:`dark`});function G({strict:e=!0}={}){let t=c(W);if(e&&!t)throw Error(`MODE_PROVIDER_NOT_FOUND`);return t}function Ge({children:e,mode:t=`dark`}){let[n,r]=p(t),i=d(()=>te({palette:{mode:n}}),[n]);return h(W.Provider,{value:{mode:n,toggleMode:()=>{r(e=>e===`light`?`dark`:`light`)}},children:g(ee,{theme:i,children:[h(E,{}),e]})})}var Ke=Ge;const K=o({windowWidth:0,windowHeight:0,isLargeScreen:!1});function qe({strict:e=!0}={}){let t=c(K);if(e&&!t)throw Error(`SCREEN_SIZE_PROVIDER_NOT_FOUND`);return t}function Je({children:e,largeScreenWidth:t=669,largeScreenHeight:n=660}){let[r,i]=p(window.innerWidth),[a,o]=p(window.innerHeight);l(()=>{function e(){i(window.innerWidth),o(window.innerHeight)}return e(),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e)}},[]);let s=d(()=>r>t&&a>n,[r,a,t,n]);return h(K.Provider,{value:{isLargeScreen:s,windowWidth:r,windowHeight:a},children:e})}var Ye=Je;const q=o(void 0);function Xe({strict:e=!0}={}){let t=c(q);if(e&&!t)throw Error(`SNACKBAR_PROVIDER_NOT_FOUND`);return t}function Ze({children:e,autoHideDuration:t=5e3}){let[n,r]=p(!1),[i,a]=p(t),[o,s]=p(``),[c,l]=p(`info`);function u(e,n,i){r(!0),a(i??t),l(n??`info`),s(e)}async function d(){r(!1),await ie(.2),s(``)}return g(q.Provider,{value:{addSnackbar:u},children:[h(ae,{open:n,autoHideDuration:i,onClose:d,children:h(T,{onClose:d,severity:c,children:o})}),e]})}var Qe=Ze;function $e(){let{mode:e,toggleMode:t}=G();return h(b,{title:`Enable ${e===`dark`?`light`:`dark`} mode`,children:h(y,{sx:{marginLeft:`auto`},onClick:t,"aria-label":`Enable ${e===`dark`?`light`:`dark`} mode`,children:h(e===`dark`?v:_,{})})})}var et=$e;function tt({children:r,button:i=x,buttonChildren:a=`Menu`,buttonProps:o,isOpenIcon:s=h(t,{}),isClosedIcon:c=h(e,{}),onOpen:u,onClose:f}){let[m,_]=p(null),v=d(()=>!!m,[m]),y={...o,onClick:e=>{_(e.currentTarget)},"aria-controls":v?`dropdown-menu`:void 0,"aria-haspopup":`true`,"aria-expanded":v};return i===x&&(y.endIcon=v?s:c),l(()=>{v&&u?u():!v&&f&&f()},[v,u,f]),g(n,{children:[h(i,{...y,children:a}),h(S,{id:`dropdown-menu`,anchorEl:m,open:v,onClose:()=>{_(null)},children:typeof r==`function`?h(n,{children:r(()=>{_(null)})}):r})]})}var nt=tt;function rt({href:e,children:t,ref:n,...r}){return h(k,{component:`a`,href:e,ref:n,target:`_blank`,rel:`noopener noreferrer`,...r,children:t})}var J=rt;const it={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`},at=D(`input`)({clip:`rect(0 0 0 0)`,clipPath:`inset(50%)`,height:1,overflow:`hidden`,position:`absolute`,bottom:0,left:0,whiteSpace:`nowrap`,width:1}),ot=D(`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 st({onFileInput:e,label:t=`Upload files`,multiple:n,accept:r,useDropzone:i,...a}){let[o,s]=p(!1),c=g(x,{variant:`contained`,component:`label`,"aria-label":`File upload button`,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),document.getElementById(`file-input`)?.click())},...a,startIcon:a.startIcon??h(oe,{}),children:[t,h(at,{id:`file-input`,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?h(ot,{$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:c}):c}var Y=st;function ct({files:e,setFiles:t,...r}){function i(e){t(t=>[...t,...e])}let a={...r,onFileInput:i};return a?.multiple===void 0&&(a.multiple=!0),g(n,{children:[h(Y,{...a}),h(A,{children:e.map(e=>h(j,{secondaryAction:h(y,{"aria-label":`Delete`,edge:`end`,onClick:()=>{t(t=>t.filter(t=>t!==e))},children:h(se,{})}),children:h(M,{primary:e.name})},e.name))})]})}var lt=ct;function ut({icon:e,onOpen:t,onClose:r,iconProps:i,children:a}){let[o,s]=p(null),c=!!o,l=u();function d(e){s(e.currentTarget),t&&t()}function f(){s(null),r&&r()}return g(n,{children:[h(e,{"aria-owns":c?l:void 0,"aria-haspopup":`true`,onMouseEnter:d,onMouseLeave:f,...i}),h(ce,{id:l,sx:{pointerEvents:`none`},open:c,anchorEl:o,anchorOrigin:{vertical:`bottom`,horizontal:`left`},transformOrigin:{vertical:`top`,horizontal:`left`},onClose:f,disableRestoreFocus:!0,children:a})]})}var dt=ut;function ft({to:e,children:t,ref:n,...r}){return h(k,{component:N,to:e,ref:n,...r,children:t})}var X=ft;function pt({children:e,...t}){return h(P,{component:X,...t,children:e})}var mt=pt;function ht({children:e,errorComponent:t,undefinedComponent:n,nullComponent:r,nullableComponent:i,logError:a,loadingComponent:o=h(w,{}),...s}){return g(U,{loadingComponent:o,...s,children:[h(H,{undefinedComponent:n,nullComponent:r,nullableComponent:i,logError:a,children:t}),h(V,{children:e})]})}var gt=ht;function _t({children:e,navItems:t}){let[r,i]=p(``);return g(m,{children:[h(n,{sx:{paddingBottom:7},children:e}),h(fe,{sx:{position:`fixed`,bottom:0,left:0,right:0},children:h(ue,{showLabels:!0,value:r,onChange:(e,t)=>{i(t)},children:t.map(e=>h(de,{...e,component:N},e.value))})})]})}var vt=_t;function Z(e){return{width:240,transition:e.transitions.create(`width`,{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:`hidden`}}function Q(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 $=D(`div`)(({theme:e})=>({display:`flex`,alignItems:`center`,justifyContent:`flex-end`,padding:e.spacing(0,1),...e.mixins.toolbar})),yt=D(ge,{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})}}]})),bt=D(_e,{shouldForwardProp:e=>e!==`open`})(({theme:e})=>({width:240,flexShrink:0,whiteSpace:`nowrap`,boxSizing:`border-box`,variants:[{props:({open:e})=>e,style:{...Z(e),"& .MuiDrawer-paper":Z(e)}},{props:({open:e})=>!e,style:{...Q(e),"& .MuiDrawer-paper":Q(e)}}]}));function xt({title:e,navItems:t,children:r,headerElements:i}){let o=ne(),[s,c]=p(!0),l=le();function u(){c(!0)}function d(){c(!1)}return g(n,{sx:{display:`flex`},children:[h(E,{}),h(yt,{position:`fixed`,open:s,children:g(ye,{children:[h(y,{color:`inherit`,"aria-label":`open drawer`,onClick:u,edge:`start`,sx:[{marginRight:5},s&&{display:`none`}],children:h(he,{})}),h(I,{variant:`h6`,noWrap:!0,component:`div`,children:e}),i]})}),g(bt,{variant:`permanent`,open:s,children:[h($,{children:h(y,{onClick:d,children:o.direction===`rtl`?h(me,{}):h(pe,{})})}),h(F,{}),t.map(e=>g(a,{children:[g(A,{children:[h(I,{variant:s?`h5`:`h6`,paddingLeft:s?2:1,children:s?e.category:O(e.category,4)}),e.options.map(e=>h(j,{disablePadding:!0,sx:{display:`block`},children:g(P,{sx:[{minHeight:48,px:2.5},s?{justifyContent:`initial`}:{justifyContent:`center`}],component:N,to:e.to,selected:l.pathname===e.to,children:[h(ve,{sx:[{minWidth:0,justifyContent:`center`},s?{mr:3}:{mr:`auto`}],children:e.icon?e.icon:s?null:h(I,{children:O(e.label,4)})}),h(M,{primary:e.label,sx:[s?{opacity:1}:{opacity:0}]})]})},e.to))]}),h(F,{})]},e.category))]}),g(n,{component:`main`,sx:{flexGrow:1,p:3},children:[h($,{}),r]})]})}var St=xt;function Ct({text:e,sx:t,...n}){return h(m,{children:e.split(`
2
2
  `).map((e,r)=>h(I,{sx:{margin:1,...t},...n,children:e},r))})}var wt=Ct;function Tt({code:e,previewStyles:t,...r}){let{mode:i}=G(),a={backgroundColor:i===`dark`?`black`:`white`,border:.3,borderRadius:1,padding:2,borderColor:`darkgray`},o=t?{...a,...t}:{...a};return h(n,{sx:{borderRadius:1,border:.5,padding:2},children:g(we,{...r,code:be(e??``),children:[h(I,{variant:`h5`,children:`Code`}),h(n,{sx:{border:.3,borderRadius:.3,borderColor:`darkgray`},children:h(xe,{})}),h(`br`,{}),h(I,{variant:`h5`,children:`Result`}),g(n,{sx:o,children:[h(Ce,{}),h(Se,{})]})]})})}var Et=Tt;function Dt({columns:e}){return h(De,{children:re(e=>h(Ee,{children:h(Te,{})},e),e)})}var Ot=Dt;function kt({disableClean:e,label:t,...n}){let{formState:{disabled:r,isDirty:i,isSubmitting:a}}=Oe();return h(x,{color:`primary`,disabled:n.disabled||e&&!i||r,loading:a,type:`submit`,variant:`contained`,...n,children:t})}var At=kt;const jt=D(ke)(()=>({padding:8,"& .MuiSwitch-track":{borderRadius:11,"&::before, &::after":{content:`""`,position:`absolute`,top:`50%`,transform:`translateY(-50%)`,fontSize:16,width:28,height:28}}}));function Mt({checkedIcon:e,checkedIconStyles:t,uncheckedIcon:r,uncheckedIconStyles:i,...a}){let o={borderRadius:`50%`,borderColor:`white`,backgroundColor:`white`,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:.25},s={color:`black`,maxWidth:16.5,maxHeight:16.5};return h(jt,{checkedIcon:h(n,{sx:o,children:h(e,{style:{...s,...t}})}),icon:h(n,{sx:o,children:h(r,{style:{...s,...i}})}),...a})}var Nt=Mt;function Pt(e){let[t,n]=p(()=>{let t=window.location.hash.replace(`#`,``);return e&&t===``?e:t}),r=s(()=>{let t=window.location.hash.replace(`#`,``);n(e&&t===``?e:t)},[n,e]);return l(()=>(window.addEventListener(`hashchange`,r),()=>{window.removeEventListener(`hashchange`,r)}),[r]),[t,s(e=>{let n=typeof e==`function`?e(t):e;n!==t&&(window.location.hash=n)},[t])]}var Ft=Pt;export{je as CollapsableItem,et as DarkModeToggle,nt as DropdownMenu,Be as DropdownMenu2,Fe as DropdownMenuExternalLink,Le as DropdownMenuInternalLink,ze as DropdownMenuItem,J as ExternalLink,Y as FileInput,lt as FileInputList,it as FileType,dt as IconWithPopover,X as InternalLink,mt as ListItemInternalLink,gt as Loader,V as LoaderData,H as LoaderError,U as LoaderProvider,Ke as ModeProvider,vt as NavigationBottom,St as NavigationDrawer,wt as PopoverText,Et as ReactPlayground,Ye as ScreenSizeProvider,Ot as SkeletonRow,Qe as SnackbarProvider,At as SubmitButton,Nt as SwitchWithIcons,R as useDropdownMenu,Ft as useHash,G as useMode,qe as useScreenSize,Xe as useSnackbar};
3
3
  //# sourceMappingURL=index.js.map