} event The event source of the callback.
- * You can pull out the new value by accessing `event.target.value` (string).
- * You can pull out the new checked state by accessing `event.target.checked` (boolean).
- */
- onChange: import_prop_types.default.func,
- /**
- * If `true`, the `input` element is required.
- * @default false
- */
- required: import_prop_types.default.bool,
- /**
- * The size of the component.
- * `small` is equivalent to the dense switch styling.
- * @default 'medium'
- */
- size: import_prop_types.default.oneOfType([import_prop_types.default.oneOf(["medium", "small"]), import_prop_types.default.string]),
- /**
- * The props used for each slot inside.
- * @default {}
- */
- slotProps: import_prop_types.default.shape({
- input: import_prop_types.default.oneOfType([import_prop_types.default.func, import_prop_types.default.object]),
- root: import_prop_types.default.oneOfType([import_prop_types.default.func, import_prop_types.default.object]),
- switchBase: import_prop_types.default.oneOfType([import_prop_types.default.func, import_prop_types.default.object]),
- thumb: import_prop_types.default.oneOfType([import_prop_types.default.func, import_prop_types.default.object]),
- track: import_prop_types.default.oneOfType([import_prop_types.default.func, import_prop_types.default.object])
- }),
- /**
- * The components used for each slot inside.
- * @default {}
- */
- slots: import_prop_types.default.shape({
- input: import_prop_types.default.elementType,
- root: import_prop_types.default.elementType,
- switchBase: import_prop_types.default.elementType,
- thumb: import_prop_types.default.elementType,
- track: import_prop_types.default.elementType
- }),
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx: import_prop_types.default.oneOfType([
- import_prop_types.default.arrayOf(import_prop_types.default.oneOfType([
- import_prop_types.default.func,
- import_prop_types.default.object,
- import_prop_types.default.bool
- ])),
- import_prop_types.default.func,
- import_prop_types.default.object
- ]),
- /**
- * The value of the component. The DOM API casts this to a string.
- * The browser uses "on" as the default value.
- */
- value: import_prop_types.default.any
-};
-//#endregion
-//#region node_modules/@mui/material/Table/TableContext.mjs
-/**
-* @ignore - internal component.
-*/
-var TableContext = /*#__PURE__*/ import_react.createContext();
-TableContext.displayName = "TableContext";
-//#endregion
-//#region node_modules/@mui/material/Table/Tablelvl2Context.mjs
-/**
-* @ignore - internal component.
-*/
-var Tablelvl2Context = /*#__PURE__*/ import_react.createContext();
-Tablelvl2Context.displayName = "Tablelvl2Context";
-//#endregion
-//#region node_modules/@mui/material/TableCell/tableCellClasses.mjs
-function getTableCellUtilityClass(slot) {
- return generateUtilityClass("MuiTableCell", slot);
-}
-var tableCellClasses = generateUtilityClasses("MuiTableCell", [
- "root",
- "head",
- "body",
- "footer",
- "sizeSmall",
- "sizeMedium",
- "paddingCheckbox",
- "paddingNone",
- "alignLeft",
- "alignCenter",
- "alignRight",
- "alignJustify",
- "stickyHeader"
-]);
-//#endregion
-//#region node_modules/@mui/material/TableCell/TableCell.mjs
-var useUtilityClasses$4 = (ownerState) => {
- const { classes, variant, align, padding, size, stickyHeader } = ownerState;
- const slots = { root: [
- "root",
- variant,
- stickyHeader && "stickyHeader",
- align !== "inherit" && `align${capitalize_default(align)}`,
- padding !== "normal" && `padding${capitalize_default(padding)}`,
- `size${capitalize_default(size)}`
- ] };
- return composeClasses(slots, getTableCellUtilityClass, classes);
-};
-var TableCellRoot = styled("td", {
- name: "MuiTableCell",
- slot: "Root",
- overridesResolver: (props, styles) => {
- const { ownerState } = props;
- return [
- styles.root,
- styles[ownerState.variant],
- styles[`size${capitalize_default(ownerState.size)}`],
- ownerState.padding !== "normal" && styles[`padding${capitalize_default(ownerState.padding)}`],
- ownerState.align !== "inherit" && styles[`align${capitalize_default(ownerState.align)}`],
- ownerState.stickyHeader && styles.stickyHeader
- ];
- }
-})(memoTheme(({ theme }) => ({
- ...theme.typography.body2,
- display: "table-cell",
- verticalAlign: "inherit",
- borderBottom: theme.vars ? `1px solid ${theme.vars.palette.TableCell.border}` : `1px solid
- ${theme.palette.mode === "light" ? theme.lighten(theme.alpha(theme.palette.divider, 1), .88) : theme.darken(theme.alpha(theme.palette.divider, 1), .68)}`,
- textAlign: "left",
- padding: 16,
- variants: [
- {
- props: { variant: "head" },
- style: {
- color: (theme.vars || theme).palette.text.primary,
- lineHeight: theme.typography.pxToRem(24),
- fontWeight: theme.typography.fontWeightMedium
- }
- },
- {
- props: { variant: "body" },
- style: { color: (theme.vars || theme).palette.text.primary }
- },
- {
- props: { variant: "footer" },
- style: {
- color: (theme.vars || theme).palette.text.secondary,
- lineHeight: theme.typography.pxToRem(21),
- fontSize: theme.typography.pxToRem(12)
- }
- },
- {
- props: { size: "small" },
- style: {
- padding: "6px 16px",
- [`&.${tableCellClasses.paddingCheckbox}`]: {
- width: 24,
- padding: "0 12px 0 16px",
- "& > *": { padding: 0 }
- }
- }
- },
- {
- props: { padding: "checkbox" },
- style: {
- width: 48,
- padding: "0 0 0 4px"
- }
- },
- {
- props: { padding: "none" },
- style: { padding: 0 }
- },
- {
- props: { align: "left" },
- style: { textAlign: "left" }
- },
- {
- props: { align: "center" },
- style: { textAlign: "center" }
- },
- {
- props: { align: "right" },
- style: {
- textAlign: "right",
- flexDirection: "row-reverse"
- }
- },
- {
- props: { align: "justify" },
- style: { textAlign: "justify" }
- },
- {
- props: ({ ownerState }) => ownerState.stickyHeader,
- style: {
- position: "sticky",
- top: 0,
- zIndex: 2,
- backgroundColor: (theme.vars || theme).palette.background.default
- }
- }
- ]
-})));
-/**
-* The component renders a `| ` element when the parent context is a header
-* or otherwise a ` | ` element.
-*/
-var TableCell = /*#__PURE__*/ import_react.forwardRef(function TableCell(inProps, ref) {
- const props = useDefaultProps({
- props: inProps,
- name: "MuiTableCell"
- });
- const { align = "inherit", className, component: componentProp, padding: paddingProp, scope: scopeProp, size: sizeProp, sortDirection, variant: variantProp, ...other } = props;
- const table = import_react.useContext(TableContext);
- const tablelvl2 = import_react.useContext(Tablelvl2Context);
- const isHeadCell = tablelvl2 && tablelvl2.variant === "head";
- let component;
- if (componentProp) component = componentProp;
- else component = isHeadCell ? "th" : "td";
- let scope = scopeProp;
- if (component === "td") scope = void 0;
- else if (!scope && isHeadCell) scope = "col";
- const variant = variantProp || tablelvl2 && tablelvl2.variant;
- const ownerState = {
- ...props,
- align,
- component,
- padding: paddingProp || (table && table.padding ? table.padding : "normal"),
- size: sizeProp || (table && table.size ? table.size : "medium"),
- sortDirection,
- stickyHeader: variant === "head" && table && table.stickyHeader,
- variant
- };
- const classes = useUtilityClasses$4(ownerState);
- let ariaSort = null;
- if (sortDirection) ariaSort = sortDirection === "asc" ? "ascending" : "descending";
- return /*#__PURE__*/ (0, import_jsx_runtime.jsx)(TableCellRoot, {
- as: component,
- ref,
- className: clsx(classes.root, className),
- "aria-sort": ariaSort,
- scope,
- ownerState,
- ...other
- });
-});
-TableCell.propTypes = {
- /**
- * Set the text-align on the table cell content.
- *
- * Monetary or generally number fields **should be right aligned** as that allows
- * you to add them up quickly in your head without having to worry about decimals.
- * @default 'inherit'
- */
- align: import_prop_types.default.oneOf([
- "center",
- "inherit",
- "justify",
- "left",
- "right"
- ]),
- /**
- * The content of the component.
- */
- children: import_prop_types.default.node,
- /**
- * Override or extend the styles applied to the component.
- */
- classes: import_prop_types.default.object,
- /**
- * @ignore
- */
- className: import_prop_types.default.string,
- /**
- * The component used for the root node.
- * Either a string to use a HTML element or a component.
- */
- component: import_prop_types.default.elementType,
- /**
- * Sets the padding applied to the cell.
- * The prop defaults to the value (`'default'`) inherited from the parent Table component.
- */
- padding: import_prop_types.default.oneOf([
- "checkbox",
- "none",
- "normal"
- ]),
- /**
- * Set scope attribute.
- */
- scope: import_prop_types.default.string,
- /**
- * Specify the size of the cell.
- * The prop defaults to the value (`'medium'`) inherited from the parent Table component.
- */
- size: import_prop_types.default.oneOfType([import_prop_types.default.oneOf(["medium", "small"]), import_prop_types.default.string]),
- /**
- * Set aria-sort direction.
- */
- sortDirection: import_prop_types.default.oneOf([
- "asc",
- "desc",
- false
- ]),
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx: import_prop_types.default.oneOfType([
- import_prop_types.default.arrayOf(import_prop_types.default.oneOfType([
- import_prop_types.default.func,
- import_prop_types.default.object,
- import_prop_types.default.bool
- ])),
- import_prop_types.default.func,
- import_prop_types.default.object
- ]),
- /**
- * Specify the cell type.
- * The prop defaults to the value inherited from the parent TableHead, TableBody, or TableFooter components.
- */
- variant: import_prop_types.default.oneOfType([import_prop_types.default.oneOf([
- "body",
- "footer",
- "head"
- ]), import_prop_types.default.string])
-};
-//#endregion
-//#region node_modules/@mui/material/Toolbar/toolbarClasses.mjs
-function getToolbarUtilityClass(slot) {
- return generateUtilityClass("MuiToolbar", slot);
-}
-var toolbarClasses = generateUtilityClasses("MuiToolbar", [
- "root",
- "gutters",
- "regular",
- "dense"
-]);
-//#endregion
-//#region node_modules/@mui/material/Toolbar/Toolbar.mjs
-var useUtilityClasses$3 = (ownerState) => {
- const { classes, disableGutters, variant } = ownerState;
- return composeClasses({ root: [
- "root",
- !disableGutters && "gutters",
- variant
- ] }, getToolbarUtilityClass, classes);
-};
-var ToolbarRoot = styled("div", {
- name: "MuiToolbar",
- slot: "Root",
- overridesResolver: (props, styles) => {
- const { ownerState } = props;
- return [
- styles.root,
- !ownerState.disableGutters && styles.gutters,
- styles[ownerState.variant]
- ];
- }
-})(memoTheme(({ theme }) => ({
- position: "relative",
- display: "flex",
- alignItems: "center",
- variants: [
- {
- props: ({ ownerState }) => !ownerState.disableGutters,
- style: {
- paddingLeft: theme.spacing(2),
- paddingRight: theme.spacing(2),
- [theme.breakpoints.up("sm")]: {
- paddingLeft: theme.spacing(3),
- paddingRight: theme.spacing(3)
- }
- }
- },
- {
- props: { variant: "dense" },
- style: { minHeight: 48 }
- },
- {
- props: { variant: "regular" },
- style: theme.mixins.toolbar
- }
- ]
-})));
-var Toolbar = /*#__PURE__*/ import_react.forwardRef(function Toolbar(inProps, ref) {
- const props = useDefaultProps({
- props: inProps,
- name: "MuiToolbar"
- });
- const { className, component = "div", disableGutters = false, variant = "regular", ...other } = props;
- const ownerState = {
- ...props,
- component,
- disableGutters,
- variant
- };
- const classes = useUtilityClasses$3(ownerState);
- return /*#__PURE__*/ (0, import_jsx_runtime.jsx)(ToolbarRoot, {
- as: component,
- className: clsx(classes.root, className),
- ref,
- ownerState,
- ...other
- });
-});
-Toolbar.propTypes = {
- /**
- * The Toolbar children, usually a mixture of `IconButton`, `Button` and `Typography`.
- * The Toolbar is a flex container, allowing flex item properties to be used to lay out the children.
- */
- children: import_prop_types.default.node,
- /**
- * Override or extend the styles applied to the component.
- */
- classes: import_prop_types.default.object,
- /**
- * @ignore
- */
- className: import_prop_types.default.string,
- /**
- * The component used for the root node.
- * Either a string to use a HTML element or a component.
- */
- component: import_prop_types.default.elementType,
- /**
- * If `true`, disables gutter padding.
- * @default false
- */
- disableGutters: import_prop_types.default.bool,
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx: import_prop_types.default.oneOfType([
- import_prop_types.default.arrayOf(import_prop_types.default.oneOfType([
- import_prop_types.default.func,
- import_prop_types.default.object,
- import_prop_types.default.bool
- ])),
- import_prop_types.default.func,
- import_prop_types.default.object
- ]),
- /**
- * The variant to use.
- * @default 'regular'
- */
- variant: import_prop_types.default.oneOfType([import_prop_types.default.oneOf(["dense", "regular"]), import_prop_types.default.string])
-};
-//#endregion
-//#region node_modules/@mui/material/TablePaginationActions/tablePaginationActionsClasses.mjs
-function getTablePaginationActionsUtilityClass(slot) {
- return generateUtilityClass("MuiTablePaginationActions", slot);
-}
-var tablePaginationActionsClasses = generateUtilityClasses("MuiTablePaginationActions", ["root"]);
-//#endregion
-//#region node_modules/@mui/material/TablePaginationActions/TablePaginationActions.mjs
-var useUtilityClasses$2 = (ownerState) => {
- const { classes } = ownerState;
- return composeClasses({ root: ["root"] }, getTablePaginationActionsUtilityClass, classes);
-};
-var TablePaginationActionsRoot = styled("div", {
- name: "MuiTablePaginationActions",
- slot: "Root"
-})({});
-var TablePaginationActions = /*#__PURE__*/ import_react.forwardRef(function TablePaginationActions(inProps, ref) {
- const props = useDefaultProps({
- props: inProps,
- name: "MuiTablePaginationActions"
- });
- const { className, count, disabled = false, getItemAriaLabel, onPageChange, page, rowsPerPage, showFirstButton, showLastButton, slots = {}, slotProps = {}, ...other } = props;
- const isRtl = useRtl();
- const classes = useUtilityClasses$2(props);
- const handleFirstPageButtonClick = (event) => {
- onPageChange(event, 0);
- };
- const handleBackButtonClick = (event) => {
- onPageChange(event, page - 1);
- };
- const handleNextButtonClick = (event) => {
- onPageChange(event, page + 1);
- };
- const handleLastPageButtonClick = (event) => {
- onPageChange(event, Math.max(0, Math.ceil(count / rowsPerPage) - 1));
- };
- const FirstButton = slots.firstButton ?? IconButton;
- const LastButton = slots.lastButton ?? IconButton;
- const NextButton = slots.nextButton ?? IconButton;
- const PreviousButton = slots.previousButton ?? IconButton;
- const FirstButtonIcon = slots.firstButtonIcon ?? FirstPage_default;
- const LastButtonIcon = slots.lastButtonIcon ?? LastPage_default;
- const NextButtonIcon = slots.nextButtonIcon ?? KeyboardArrowRight_default;
- const PreviousButtonIcon = slots.previousButtonIcon ?? KeyboardArrowLeft_default;
- const FirstButtonSlot = isRtl ? LastButton : FirstButton;
- const PreviousButtonSlot = isRtl ? NextButton : PreviousButton;
- const NextButtonSlot = isRtl ? PreviousButton : NextButton;
- const LastButtonSlot = isRtl ? FirstButton : LastButton;
- const firstButtonSlotProps = isRtl ? slotProps.lastButton : slotProps.firstButton;
- const previousButtonSlotProps = isRtl ? slotProps.nextButton : slotProps.previousButton;
- const nextButtonSlotProps = isRtl ? slotProps.previousButton : slotProps.nextButton;
- const lastButtonSlotProps = isRtl ? slotProps.firstButton : slotProps.lastButton;
- return /*#__PURE__*/ (0, import_jsx_runtime.jsxs)(TablePaginationActionsRoot, {
- ref,
- className: clsx(classes.root, className),
- ...other,
- children: [
- showFirstButton && /*#__PURE__*/ (0, import_jsx_runtime.jsx)(FirstButtonSlot, {
- onClick: handleFirstPageButtonClick,
- disabled: disabled || page === 0,
- "aria-label": getItemAriaLabel("first", page),
- title: getItemAriaLabel("first", page),
- ...firstButtonSlotProps,
- children: isRtl ? /*#__PURE__*/ (0, import_jsx_runtime.jsx)(LastButtonIcon, { ...slotProps.lastButtonIcon }) : /*#__PURE__*/ (0, import_jsx_runtime.jsx)(FirstButtonIcon, { ...slotProps.firstButtonIcon })
- }),
- /*#__PURE__*/ (0, import_jsx_runtime.jsx)(PreviousButtonSlot, {
- onClick: handleBackButtonClick,
- disabled: disabled || page === 0,
- color: "inherit",
- "aria-label": getItemAriaLabel("previous", page),
- title: getItemAriaLabel("previous", page),
- ...previousButtonSlotProps,
- children: isRtl ? /*#__PURE__*/ (0, import_jsx_runtime.jsx)(NextButtonIcon, { ...slotProps.nextButtonIcon }) : /*#__PURE__*/ (0, import_jsx_runtime.jsx)(PreviousButtonIcon, { ...slotProps.previousButtonIcon })
- }),
- /*#__PURE__*/ (0, import_jsx_runtime.jsx)(NextButtonSlot, {
- onClick: handleNextButtonClick,
- disabled: disabled || (count !== -1 ? page >= Math.ceil(count / rowsPerPage) - 1 : false),
- color: "inherit",
- "aria-label": getItemAriaLabel("next", page),
- title: getItemAriaLabel("next", page),
- ...nextButtonSlotProps,
- children: isRtl ? /*#__PURE__*/ (0, import_jsx_runtime.jsx)(PreviousButtonIcon, { ...slotProps.previousButtonIcon }) : /*#__PURE__*/ (0, import_jsx_runtime.jsx)(NextButtonIcon, { ...slotProps.nextButtonIcon })
- }),
- showLastButton && /*#__PURE__*/ (0, import_jsx_runtime.jsx)(LastButtonSlot, {
- onClick: handleLastPageButtonClick,
- disabled: disabled || page >= Math.ceil(count / rowsPerPage) - 1,
- "aria-label": getItemAriaLabel("last", page),
- title: getItemAriaLabel("last", page),
- ...lastButtonSlotProps,
- children: isRtl ? /*#__PURE__*/ (0, import_jsx_runtime.jsx)(FirstButtonIcon, { ...slotProps.firstButtonIcon }) : /*#__PURE__*/ (0, import_jsx_runtime.jsx)(LastButtonIcon, { ...slotProps.lastButtonIcon })
- })
- ]
- });
-});
-TablePaginationActions.propTypes = {
- /**
- * @ignore
- */
- children: import_prop_types.default.node,
- /**
- * Override or extend the styles applied to the component.
- */
- classes: import_prop_types.default.object,
- /**
- * @ignore
- */
- className: import_prop_types.default.string,
- /**
- * @ignore
- */
- count: import_prop_types.default.number.isRequired,
- /**
- * If `true`, the component is disabled.
- * @default false
- */
- disabled: import_prop_types.default.bool,
- /**
- * Accepts a function which returns a string value that provides a user-friendly name for the current page.
- * This is important for screen reader users.
- *
- * For localization purposes, you can use the provided [translations](https://mui.com/material-ui/guides/localization/).
- * @param {string} type The link or button type to format ('first' | 'last' | 'next' | 'previous').
- * @returns {string}
- */
- getItemAriaLabel: import_prop_types.default.func.isRequired,
- /**
- * @ignore
- */
- onPageChange: import_prop_types.default.func.isRequired,
- /**
- * @ignore
- */
- page: import_prop_types.default.number.isRequired,
- /**
- * @ignore
- */
- rowsPerPage: import_prop_types.default.number.isRequired,
- /**
- * @ignore
- */
- showFirstButton: import_prop_types.default.bool.isRequired,
- /**
- * @ignore
- */
- showLastButton: import_prop_types.default.bool.isRequired,
- /**
- * @ignore
- */
- slotProps: import_prop_types.default.shape({
- firstButton: import_prop_types.default.object,
- firstButtonIcon: import_prop_types.default.object,
- lastButton: import_prop_types.default.object,
- lastButtonIcon: import_prop_types.default.object,
- nextButton: import_prop_types.default.object,
- nextButtonIcon: import_prop_types.default.object,
- previousButton: import_prop_types.default.object,
- previousButtonIcon: import_prop_types.default.object
- }),
- /**
- * @ignore
- */
- slots: import_prop_types.default.shape({
- firstButton: import_prop_types.default.elementType,
- firstButtonIcon: import_prop_types.default.elementType,
- lastButton: import_prop_types.default.elementType,
- lastButtonIcon: import_prop_types.default.elementType,
- nextButton: import_prop_types.default.elementType,
- nextButtonIcon: import_prop_types.default.elementType,
- previousButton: import_prop_types.default.elementType,
- previousButtonIcon: import_prop_types.default.elementType
- })
-};
-//#endregion
-//#region node_modules/@mui/material/TablePagination/tablePaginationClasses.mjs
-function getTablePaginationUtilityClass(slot) {
- return generateUtilityClass("MuiTablePagination", slot);
-}
-var tablePaginationClasses = generateUtilityClasses("MuiTablePagination", [
- "root",
- "toolbar",
- "spacer",
- "selectLabel",
- "selectRoot",
- "select",
- "selectIcon",
- "input",
- "menuItem",
- "displayedRows",
- "actions"
-]);
-//#endregion
-//#region node_modules/@mui/material/locale/utils/buildFormatNumber.mjs
-var buildFormatNumber = (locale) => {
- let formatter;
- if (typeof Intl !== "undefined" && Intl.NumberFormat) try {
- formatter = new Intl.NumberFormat(locale);
- } catch {}
- return (value) => {
- if (!Number.isFinite(value)) return String(value);
- return formatter ? formatter.format(value) : String(value);
- };
-};
-//#endregion
-//#region node_modules/@mui/material/TablePagination/TablePagination.mjs
-var _TablePaginationInput;
-var formatNumber = buildFormatNumber("en-US");
-var TablePaginationRoot = styled(TableCell, {
- name: "MuiTablePagination",
- slot: "Root"
-})(memoTheme(({ theme }) => ({
- overflow: "auto",
- color: (theme.vars || theme).palette.text.primary,
- fontSize: theme.typography.pxToRem(14),
- "&:last-child": { padding: 0 }
-})));
-var TablePaginationToolbar = styled(Toolbar, {
- name: "MuiTablePagination",
- slot: "Toolbar",
- overridesResolver: (props, styles) => ({
- [`& .${tablePaginationClasses.actions}`]: styles.actions,
- ...styles.toolbar
- })
-})(memoTheme(({ theme }) => ({
- minHeight: 52,
- paddingRight: 2,
- [`${theme.breakpoints.up("xs")} and (orientation: landscape)`]: { minHeight: 52 },
- [theme.breakpoints.up("sm")]: {
- minHeight: 52,
- paddingRight: 2
- },
- [`& .${tablePaginationClasses.actions}`]: {
- flexShrink: 0,
- marginLeft: 20
- }
-})));
-var TablePaginationSpacer = styled("div", {
- name: "MuiTablePagination",
- slot: "Spacer"
-})({ flex: "1 1 100%" });
-var TablePaginationSelectLabel = styled("p", {
- name: "MuiTablePagination",
- slot: "SelectLabel"
-})(memoTheme(({ theme }) => ({
- ...theme.typography.body2,
- flexShrink: 0
-})));
-var TablePaginationSelect = styled(Select, {
- name: "MuiTablePagination",
- slot: "Select",
- overridesResolver: (props, styles) => ({
- [`& .${tablePaginationClasses.selectIcon}`]: styles.selectIcon,
- [`& .${tablePaginationClasses.select}`]: styles.select,
- ...styles.input,
- ...styles.selectRoot
- })
-})({
- color: "inherit",
- fontSize: "inherit",
- flexShrink: 0,
- marginRight: 32,
- marginLeft: 8,
- [`& .${tablePaginationClasses.select}`]: {
- paddingLeft: 8,
- paddingRight: 24,
- textAlign: "right",
- textAlignLast: "right"
- }
-});
-var TablePaginationInputBase = styled(InputBase)(memoTheme(({ theme }) => ({ [`& .${tablePaginationClasses.select}:focus`]: { backgroundColor: (theme.vars || theme).palette.action.focus } })));
-var TablePaginationMenuItem = styled(MenuItem, {
- name: "MuiTablePagination",
- slot: "MenuItem"
-})({});
-var TablePaginationDisplayedRows = styled("p", {
- name: "MuiTablePagination",
- slot: "DisplayedRows"
-})(memoTheme(({ theme }) => ({
- ...theme.typography.body2,
- flexShrink: 0
-})));
-function defaultLabelDisplayedRows({ from, to, count }) {
- return `${formatNumber(from)}–${formatNumber(to)} of ${count !== -1 ? formatNumber(count) : `more than ${formatNumber(to)}`}`;
-}
-function defaultGetAriaLabel(type) {
- return `Go to ${type} page`;
-}
-var useUtilityClasses$1 = (ownerState) => {
- const { classes } = ownerState;
- return composeClasses({
- root: ["root"],
- toolbar: ["toolbar"],
- spacer: ["spacer"],
- selectLabel: ["selectLabel"],
- select: ["select"],
- input: ["input"],
- selectIcon: ["selectIcon"],
- menuItem: ["menuItem"],
- displayedRows: ["displayedRows"],
- actions: ["actions"]
- }, getTablePaginationUtilityClass, classes);
-};
-/**
-* A `TableCell` based component for placing inside `TableFooter` for pagination.
-*/
-var TablePagination = /*#__PURE__*/ import_react.forwardRef(function TablePagination(inProps, ref) {
- const props = useDefaultProps({
- props: inProps,
- name: "MuiTablePagination"
- });
- const { ActionsComponent = TablePaginationActions, colSpan: colSpanProp, component = TableCell, count, disabled = false, getItemAriaLabel = defaultGetAriaLabel, labelDisplayedRows = defaultLabelDisplayedRows, labelRowsPerPage = "Rows per page:", onPageChange, onRowsPerPageChange, page, rowsPerPage, rowsPerPageOptions = [
- 10,
- 25,
- 50,
- 100
- ], showFirstButton = false, showLastButton = false, slotProps = {}, slots = {}, ...other } = props;
- const ownerState = props;
- const classes = useUtilityClasses$1(ownerState);
- const selectProps = typeof slotProps?.select === "function" ? slotProps.select(ownerState) : slotProps?.select ?? {};
- const MenuItemComponent = selectProps.native ? "option" : TablePaginationMenuItem;
- let colSpan;
- if (component === TableCell || component === "td") colSpan = colSpanProp || 1e3;
- const selectId = useId_default(selectProps.id);
- const labelId = useId_default(selectProps.labelId);
- const getLabelDisplayedRowsTo = () => {
- if (count === -1) return (page + 1) * rowsPerPage;
- return rowsPerPage === -1 ? count : Math.min(count, (page + 1) * rowsPerPage);
- };
- const externalForwardedProps = {
- slots,
- slotProps
- };
- const [RootSlot, rootSlotProps] = useSlot("root", {
- ref,
- className: classes.root,
- elementType: TablePaginationRoot,
- externalForwardedProps: {
- ...externalForwardedProps,
- component,
- ...other
- },
- ownerState,
- additionalProps: { colSpan }
- });
- const [ToolbarSlot, toolbarSlotProps] = useSlot("toolbar", {
- className: classes.toolbar,
- elementType: TablePaginationToolbar,
- externalForwardedProps,
- ownerState
- });
- const [SpacerSlot, spacerSlotProps] = useSlot("spacer", {
- className: classes.spacer,
- elementType: TablePaginationSpacer,
- externalForwardedProps,
- ownerState
- });
- const [SelectLabelSlot, selectLabelSlotProps] = useSlot("selectLabel", {
- className: classes.selectLabel,
- elementType: TablePaginationSelectLabel,
- externalForwardedProps,
- ownerState,
- additionalProps: { id: labelId }
- });
- const [SelectSlot, selectSlotProps] = useSlot("select", {
- className: classes.select,
- elementType: TablePaginationSelect,
- externalForwardedProps,
- ownerState
- });
- const [MenuItemSlot, menuItemSlotProps] = useSlot("menuItem", {
- className: classes.menuItem,
- elementType: MenuItemComponent,
- externalForwardedProps,
- ownerState
- });
- const [DisplayedRows, displayedRowsProps] = useSlot("displayedRows", {
- className: classes.displayedRows,
- elementType: TablePaginationDisplayedRows,
- externalForwardedProps,
- ownerState
- });
- return /*#__PURE__*/ (0, import_jsx_runtime.jsx)(RootSlot, {
- ...rootSlotProps,
- children: /*#__PURE__*/ (0, import_jsx_runtime.jsxs)(ToolbarSlot, {
- ...toolbarSlotProps,
- children: [
- /*#__PURE__*/ (0, import_jsx_runtime.jsx)(SpacerSlot, { ...spacerSlotProps }),
- rowsPerPageOptions.length > 1 && /*#__PURE__*/ (0, import_jsx_runtime.jsx)(SelectLabelSlot, {
- ...selectLabelSlotProps,
- children: labelRowsPerPage
- }),
- rowsPerPageOptions.length > 1 && /*#__PURE__*/ (0, import_jsx_runtime.jsx)(SelectSlot, {
- variant: "standard",
- ...!selectProps.variant && { input: _TablePaginationInput || (_TablePaginationInput = /*#__PURE__*/ (0, import_jsx_runtime.jsx)(TablePaginationInputBase, {})) },
- value: rowsPerPage,
- onChange: onRowsPerPageChange,
- id: selectId,
- labelId,
- ...selectProps,
- classes: {
- ...selectProps.classes,
- root: clsx(classes.input, classes.selectRoot, (selectProps.classes || {}).root),
- select: clsx(classes.select, (selectProps.classes || {}).select),
- icon: clsx(classes.selectIcon, (selectProps.classes || {}).icon)
- },
- disabled,
- ...selectSlotProps,
- children: rowsPerPageOptions.map((rowsPerPageOption) => /*#__PURE__*/ (0, import_react.createElement)(MenuItemSlot, {
- ...menuItemSlotProps,
- key: rowsPerPageOption.label ? rowsPerPageOption.label : rowsPerPageOption,
- value: rowsPerPageOption.value ? rowsPerPageOption.value : rowsPerPageOption
- }, rowsPerPageOption.label ? rowsPerPageOption.label : rowsPerPageOption))
- }),
- /*#__PURE__*/ (0, import_jsx_runtime.jsx)(DisplayedRows, {
- ...displayedRowsProps,
- children: labelDisplayedRows({
- from: count === 0 ? 0 : page * rowsPerPage + 1,
- to: getLabelDisplayedRowsTo(),
- count: count === -1 ? -1 : count,
- page
- })
- }),
- /*#__PURE__*/ (0, import_jsx_runtime.jsx)(ActionsComponent, {
- className: classes.actions,
- count,
- onPageChange,
- page,
- rowsPerPage,
- showFirstButton,
- showLastButton,
- slotProps: slotProps.actions,
- slots: slots.actions,
- getItemAriaLabel,
- disabled
- })
- ]
- })
- });
-});
-TablePagination.propTypes = {
- /**
- * The component used for displaying the actions.
- * Either a string to use a HTML element or a component.
- * @default TablePaginationActions
- */
- ActionsComponent: import_prop_types.default.elementType,
- /**
- * Override or extend the styles applied to the component.
- */
- classes: import_prop_types.default.object,
- /**
- * @ignore
- */
- colSpan: import_prop_types.default.number,
- /**
- * The component used for the root node.
- * Either a string to use a HTML element or a component.
- */
- component: import_prop_types.default.elementType,
- /**
- * The total number of rows.
- *
- * To enable server side pagination for an unknown number of items, provide -1.
- */
- count: integerPropType.isRequired,
- /**
- * If `true`, the component is disabled.
- * @default false
- */
- disabled: import_prop_types.default.bool,
- /**
- * Accepts a function which returns a string value that provides a user-friendly name for the current page.
- * This is important for screen reader users.
- *
- * For localization purposes, you can use the provided [translations](https://mui.com/material-ui/guides/localization/).
- * @param {string} type The link or button type to format ('first' | 'last' | 'next' | 'previous').
- * @returns {string}
- * @default function defaultGetAriaLabel(type) {
- * return `Go to ${type} page`;
- * }
- */
- getItemAriaLabel: import_prop_types.default.func,
- /**
- * Customize the displayed rows label. Invoked with a `{ from, to, count, page }`
- * object.
- *
- * For localization purposes, you can use the provided [translations](https://mui.com/material-ui/guides/localization/).
- * @default function defaultLabelDisplayedRows({ from, to, count }) {
- * return `${formatNumber(from)}–${formatNumber(to)} of ${count !== -1 ? formatNumber(count) : `more than ${formatNumber(to)}`}`;
- * }
- */
- labelDisplayedRows: import_prop_types.default.func,
- /**
- * Customize the rows per page label.
- *
- * For localization purposes, you can use the provided [translations](https://mui.com/material-ui/guides/localization/).
- * @default 'Rows per page:'
- */
- labelRowsPerPage: import_prop_types.default.node,
- /**
- * Callback fired when the page is changed.
- *
- * @param {React.MouseEvent | null} event The event source of the callback.
- * @param {number} page The page selected.
- */
- onPageChange: import_prop_types.default.func.isRequired,
- /**
- * Callback fired when the number of rows per page is changed.
- *
- * @param {React.ChangeEvent} event The event source of the callback.
- */
- onRowsPerPageChange: import_prop_types.default.func,
- /**
- * The zero-based index of the current page.
- */
- page: chainPropTypes(integerPropType.isRequired, (props) => {
- const { count, page, rowsPerPage } = props;
- if (count === -1) return null;
- const newLastPage = Math.max(0, Math.ceil(count / rowsPerPage) - 1);
- if (page < 0 || page > newLastPage) return /* @__PURE__ */ new Error(`MUI: The page prop of a TablePagination is out of range (0 to ${newLastPage}, but page is ${page}).`);
- return null;
- }),
- /**
- * The number of rows per page.
- *
- * Set -1 to display all the rows.
- */
- rowsPerPage: integerPropType.isRequired,
- /**
- * Customizes the options of the rows per page select field. If less than two options are
- * available, no select field will be displayed.
- * Use -1 for the value with a custom label to show all the rows.
- * @default [10, 25, 50, 100]
- */
- rowsPerPageOptions: import_prop_types.default.arrayOf(import_prop_types.default.oneOfType([import_prop_types.default.number, import_prop_types.default.shape({
- label: import_prop_types.default.string.isRequired,
- value: import_prop_types.default.number.isRequired
- })]).isRequired),
- /**
- * If `true`, show the first-page button.
- * @default false
- */
- showFirstButton: import_prop_types.default.bool,
- /**
- * If `true`, show the last-page button.
- * @default false
- */
- showLastButton: import_prop_types.default.bool,
- /**
- * The props used for each slot inside.
- * @default {}
- */
- slotProps: import_prop_types.default.shape({
- actions: import_prop_types.default.shape({
- firstButton: import_prop_types.default.object,
- firstButtonIcon: import_prop_types.default.object,
- lastButton: import_prop_types.default.object,
- lastButtonIcon: import_prop_types.default.object,
- nextButton: import_prop_types.default.object,
- nextButtonIcon: import_prop_types.default.object,
- previousButton: import_prop_types.default.object,
- previousButtonIcon: import_prop_types.default.object
- }),
- displayedRows: import_prop_types.default.oneOfType([import_prop_types.default.func, import_prop_types.default.object]),
- menuItem: import_prop_types.default.oneOfType([import_prop_types.default.func, import_prop_types.default.object]),
- root: import_prop_types.default.oneOfType([import_prop_types.default.func, import_prop_types.default.object]),
- select: import_prop_types.default.object,
- selectLabel: import_prop_types.default.oneOfType([import_prop_types.default.func, import_prop_types.default.object]),
- spacer: import_prop_types.default.oneOfType([import_prop_types.default.func, import_prop_types.default.object]),
- toolbar: import_prop_types.default.oneOfType([import_prop_types.default.func, import_prop_types.default.object])
- }),
- /**
- * The components used for each slot inside.
- * @default {}
- */
- slots: import_prop_types.default.shape({
- actions: import_prop_types.default.shape({
- firstButton: import_prop_types.default.elementType,
- firstButtonIcon: import_prop_types.default.elementType,
- lastButton: import_prop_types.default.elementType,
- lastButtonIcon: import_prop_types.default.elementType,
- nextButton: import_prop_types.default.elementType,
- nextButtonIcon: import_prop_types.default.elementType,
- previousButton: import_prop_types.default.elementType,
- previousButtonIcon: import_prop_types.default.elementType
- }),
- displayedRows: import_prop_types.default.elementType,
- menuItem: import_prop_types.default.elementType,
- root: import_prop_types.default.elementType,
- select: import_prop_types.default.elementType,
- selectLabel: import_prop_types.default.elementType,
- spacer: import_prop_types.default.elementType,
- toolbar: import_prop_types.default.elementType
- }),
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx: import_prop_types.default.oneOfType([
- import_prop_types.default.arrayOf(import_prop_types.default.oneOfType([
- import_prop_types.default.func,
- import_prop_types.default.object,
- import_prop_types.default.bool
- ])),
- import_prop_types.default.func,
- import_prop_types.default.object
- ])
-};
-//#endregion
-//#region node_modules/@mui/material/ToggleButtonGroup/ToggleButtonGroupContext.mjs
-/**
-* @ignore - internal component.
-*/
-var ToggleButtonGroupContext = /*#__PURE__*/ import_react.createContext({});
-ToggleButtonGroupContext.displayName = "ToggleButtonGroupContext";
-//#endregion
-//#region node_modules/@mui/material/ToggleButtonGroup/ToggleButtonGroupButtonContext.mjs
-/**
-* @ignore - internal component.
-*/
-var ToggleButtonGroupButtonContext = /*#__PURE__*/ import_react.createContext(void 0);
-ToggleButtonGroupButtonContext.displayName = "ToggleButtonGroupButtonContext";
-//#endregion
-//#region node_modules/@mui/material/ToggleButtonGroup/isValueSelected.mjs
-function isValueSelected(value, candidate) {
- if (candidate === void 0 || value === void 0) return false;
- if (Array.isArray(candidate)) return candidate.includes(value);
- return value === candidate;
-}
-//#endregion
-//#region node_modules/@mui/material/ToggleButton/RovingToggleButton.mjs
-function RovingToggleButton(props, ref) {
- const { children, disabled = false, selected = false, value } = props;
- const rovingContext = useRovingTabIndexContext();
- const rovingItemProps = useRovingTabIndexItem({
- id: value,
- ref,
- disabled,
- selected
- });
- const tabIndex = rovingContext.getItemMap().size === 0 && selected ? 0 : rovingItemProps.tabIndex;
- return /*#__PURE__*/ import_react.cloneElement(import_react.Children.only(children), {
- ...rovingItemProps,
- tabIndex: children.props.tabIndex ?? tabIndex
- });
-}
-var RovingToggleButton_default = /*#__PURE__*/ import_react.forwardRef(RovingToggleButton);
-//#endregion
-//#region node_modules/@mui/material/ToggleButton/ToggleButton.mjs
-var useUtilityClasses = (ownerState) => {
- const { classes, fullWidth, selected, disabled, size, color } = ownerState;
- const slots = { root: [
- "root",
- selected && "selected",
- disabled && "disabled",
- fullWidth && "fullWidth",
- `size${capitalize_default(size)}`,
- color
- ] };
- return composeClasses(slots, getToggleButtonUtilityClass, classes);
-};
-var ToggleButtonRoot = styled(ButtonBase, {
- name: "MuiToggleButton",
- slot: "Root",
- overridesResolver: (props, styles) => {
- const { ownerState } = props;
- return [styles.root, styles[`size${capitalize_default(ownerState.size)}`]];
- }
-})(memoTheme(({ theme }) => ({
- ...theme.typography.button,
- borderRadius: (theme.vars || theme).shape.borderRadius,
- padding: 11,
- border: `1px solid ${(theme.vars || theme).palette.divider}`,
- color: (theme.vars || theme).palette.action.active,
- [`&.${toggleButtonClasses.disabled}`]: {
- color: (theme.vars || theme).palette.action.disabled,
- border: `1px solid ${(theme.vars || theme).palette.action.disabledBackground}`
- },
- "&:hover": {
- textDecoration: "none",
- backgroundColor: theme.alpha((theme.vars || theme).palette.text.primary, (theme.vars || theme).palette.action.hoverOpacity),
- "@media (hover: none)": { backgroundColor: "transparent" }
- },
- variants: [
- {
- props: { color: "standard" },
- style: { [`&.${toggleButtonClasses.selected}`]: {
- color: (theme.vars || theme).palette.text.primary,
- backgroundColor: theme.alpha((theme.vars || theme).palette.text.primary, (theme.vars || theme).palette.action.selectedOpacity),
- "&:hover": {
- backgroundColor: theme.alpha((theme.vars || theme).palette.text.primary, `${(theme.vars || theme).palette.action.selectedOpacity} + ${(theme.vars || theme).palette.action.hoverOpacity}`),
- "@media (hover: none)": { backgroundColor: theme.alpha((theme.vars || theme).palette.text.primary, (theme.vars || theme).palette.action.selectedOpacity) }
- }
- } }
- },
- ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color]) => ({
- props: { color },
- style: { [`&.${toggleButtonClasses.selected}`]: {
- color: (theme.vars || theme).palette[color].main,
- backgroundColor: theme.alpha((theme.vars || theme).palette[color].main, (theme.vars || theme).palette.action.selectedOpacity),
- "&:hover": {
- backgroundColor: theme.alpha((theme.vars || theme).palette[color].main, `${(theme.vars || theme).palette.action.selectedOpacity} + ${(theme.vars || theme).palette.action.hoverOpacity}`),
- "@media (hover: none)": { backgroundColor: theme.alpha((theme.vars || theme).palette[color].main, (theme.vars || theme).palette.action.selectedOpacity) }
- }
- } }
- })),
- {
- props: { fullWidth: true },
- style: { width: "100%" }
- },
- {
- props: { size: "small" },
- style: {
- padding: 7,
- fontSize: theme.typography.pxToRem(13)
- }
- },
- {
- props: { size: "large" },
- style: {
- padding: 15,
- fontSize: theme.typography.pxToRem(15)
- }
- }
- ]
-})));
-var ToggleButton = /*#__PURE__*/ import_react.forwardRef(function ToggleButton(inProps, ref) {
- const { value: contextValue, isRovingTabIndex, ...contextProps } = import_react.useContext(ToggleButtonGroupContext);
- const toggleButtonGroupButtonContextPositionClassName = import_react.useContext(ToggleButtonGroupButtonContext);
- const resolvedProps = resolveProps({
- ...contextProps,
- selected: isValueSelected(inProps.value, contextValue)
- }, inProps);
- const props = useDefaultProps({
- props: resolvedProps,
- name: "MuiToggleButton"
- });
- const { children, className, color = "standard", disabled = false, disableFocusRipple = false, fullWidth = false, onChange, onClick, selected, size = "medium", value, ...other } = props;
- const ownerState = {
- ...props,
- color,
- disabled,
- disableFocusRipple,
- fullWidth,
- size
- };
- const classes = useUtilityClasses(ownerState);
- const handleChange = (event) => {
- if (onClick) {
- onClick(event, value);
- if (event.defaultPrevented) return;
- }
- if (onChange) onChange(event, value);
- };
- const positionClassName = toggleButtonGroupButtonContextPositionClassName || "";
- const button = /*#__PURE__*/ (0, import_jsx_runtime.jsx)(ToggleButtonRoot, {
- className: clsx(contextProps.className, classes.root, className, positionClassName),
- internalNativeButton: true,
- disabled,
- focusRipple: !disableFocusRipple,
- ref: isRovingTabIndex ? void 0 : ref,
- onClick: handleChange,
- onChange,
- value,
- ownerState,
- "aria-pressed": selected,
- ...other,
- children
- });
- if (isRovingTabIndex) return /*#__PURE__*/ (0, import_jsx_runtime.jsx)(RovingToggleButton_default, {
- disabled,
- selected,
- ref,
- value,
- children: button
- });
- return button;
-});
-ToggleButton.propTypes = {
- /**
- * The content of the component.
- */
- children: import_prop_types.default.node,
- /**
- * Override or extend the styles applied to the component.
- */
- classes: import_prop_types.default.object,
- /**
- * @ignore
- */
- className: import_prop_types.default.string,
- /**
- * The color of the button when it is in an active state.
- * It supports both default and custom theme colors, which can be added as shown in the
- * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
- * @default 'standard'
- */
- color: import_prop_types.default.oneOfType([import_prop_types.default.oneOf([
- "standard",
- "primary",
- "secondary",
- "error",
- "info",
- "success",
- "warning"
- ]), import_prop_types.default.string]),
- /**
- * If `true`, the component is disabled.
- * @default false
- */
- disabled: import_prop_types.default.bool,
- /**
- * If `true`, the keyboard focus ripple is disabled.
- * @default false
- */
- disableFocusRipple: import_prop_types.default.bool,
- /**
- * If `true`, the ripple effect is disabled.
- *
- * ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
- * to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
- * @default false
- */
- disableRipple: import_prop_types.default.bool,
- /**
- * If `true`, the button will take up the full width of its container.
- * @default false
- */
- fullWidth: import_prop_types.default.bool,
- /**
- * Callback fired when the state changes.
- *
- * @param {React.MouseEvent} event The event source of the callback.
- * @param {any} value of the selected button.
- */
- onChange: import_prop_types.default.func,
- /**
- * Callback fired when the button is clicked.
- *
- * @param {React.MouseEvent} event The event source of the callback.
- * @param {any} value of the selected button.
- */
- onClick: import_prop_types.default.func,
- /**
- * If `true`, the button is rendered in an active state.
- */
- selected: import_prop_types.default.bool,
- /**
- * The size of the component.
- * The prop defaults to the value inherited from the parent ToggleButtonGroup component.
- * @default 'medium'
- */
- size: import_prop_types.default.oneOfType([import_prop_types.default.oneOf([
- "small",
- "medium",
- "large"
- ]), import_prop_types.default.string]),
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx: import_prop_types.default.oneOfType([
- import_prop_types.default.arrayOf(import_prop_types.default.oneOfType([
- import_prop_types.default.func,
- import_prop_types.default.object,
- import_prop_types.default.bool
- ])),
- import_prop_types.default.func,
- import_prop_types.default.object
- ]),
- /**
- * The value to associate with the button when selected in a
- * ToggleButtonGroup.
- */
- value: import_prop_types.default.any.isRequired
-};
-//#endregion
-export { convertLength as $, getListItemIconUtilityClass as A, Badge as B, LastPage_default as C, getListItemTextUtilityClass as D, ListItemText as E, FormControlLabel as F, chipClasses as G, getBadgeUtilityClass as H, Divider as I, getListSubheaderUtilityClass as J, getChipUtilityClass as K, dividerClasses as L, LinearProgress as M, getLinearProgressUtilityClass as N, listItemTextClasses as O, linearProgressClasses as P, alignProperty as Q, getDividerUtilityClass as R, skeletonClasses as S, MenuItem as T, Autocomplete as U, badgeClasses as V, Chip as W, createFilterOptions as X, listSubheaderClasses as Y, useAutocomplete as Z, Switch as _, getTablePaginationUtilityClass as a, getToggleButtonUtilityClass as at, Skeleton as b, tablePaginationActionsClasses as c, menuItemClasses as ct, toolbarClasses as d, autocompleteClasses as dt, fontGrid as et, TableCell as f, getAutocompleteUtilityClass as ft, TableContext as g, Tablelvl2Context as h, TablePagination as i, toUnitless as it, listItemIconClasses as j, ListItemIcon as k, Toolbar as l, formControlLabelClasses as lt, tableCellClasses as m, ToggleButtonGroupButtonContext as n, isUnitless as nt, tablePaginationClasses as o, toggleButtonClasses as ot, getTableCellUtilityClass as p, ListSubheader as q, ToggleButtonGroupContext as r, responsiveProperty as rt, TablePaginationActions as s, getMenuItemUtilityClass as st, ToggleButton as t, getUnit as tt, getToolbarUtilityClass as u, getFormControlLabelUtilityClasses as ut, getSwitchUtilityClass as v, FirstPage_default as w, getSkeletonUtilityClass as x, switchClasses as y, ClickAwayListener as z };
diff --git a/buildtime/client/material-editor/node_modules/.vite/deps/ToggleButton-BvgFYNT2.js.map b/buildtime/client/material-editor/node_modules/.vite/deps/ToggleButton-BvgFYNT2.js.map
deleted file mode 100644
index 5024e89a2..000000000
--- a/buildtime/client/material-editor/node_modules/.vite/deps/ToggleButton-BvgFYNT2.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"ToggleButton-BvgFYNT2.js","names":["useUtilityClasses","capitalize","PropTypes","useUtilityClasses","capitalize","useForkRef","CancelIcon","PropTypes","unsupportedProp","useUtilityClasses","capitalize","ClearIcon","ArrowDropDownIcon","PropTypes","useUtilityClasses","capitalize","PropTypes","PropTypes","useUtilityClasses","PropTypes","useUtilityClasses","capitalize","PropTypes","useUtilityClasses","capitalize","PropTypes","useUtilityClasses","PropTypes","useUtilityClasses","PropTypes","useUtilityClasses","useId","useForkRef","PropTypes","useUtilityClasses","PropTypes","useUtilityClasses","capitalize","PropTypes","useUtilityClasses","capitalize","PropTypes","useUtilityClasses","PropTypes","useUtilityClasses","ownerState","FirstPageIconDefault","LastPageIconDefault","KeyboardArrowRight","KeyboardArrowLeft","PropTypes","useUtilityClasses","useId","PropTypes","capitalize","RovingToggleButton","PropTypes"],"sources":["../../@mui/material/Autocomplete/autocompleteClasses.mjs","../../@mui/material/FormControlLabel/formControlLabelClasses.mjs","../../@mui/material/MenuItem/menuItemClasses.mjs","../../@mui/material/ToggleButton/toggleButtonClasses.mjs","../../@mui/material/styles/cssUtils.mjs","../../@mui/utils/useForcedRerendering/useForcedRerendering.mjs","../../@mui/utils/usePreviousProps/usePreviousProps.mjs","../../@mui/material/useAutocomplete/useAutocomplete.mjs","../../@mui/material/ListSubheader/listSubheaderClasses.mjs","../../@mui/material/ListSubheader/ListSubheader.mjs","../../@mui/material/internal/svg-icons/Cancel.mjs","../../@mui/material/Chip/chipClasses.mjs","../../@mui/material/Chip/Chip.mjs","../../@mui/material/Autocomplete/Autocomplete.mjs","../../@mui/material/Badge/useBadge.mjs","../../@mui/material/Badge/badgeClasses.mjs","../../@mui/material/Badge/Badge.mjs","../../@mui/material/ClickAwayListener/ClickAwayListener.mjs","../../@mui/material/Divider/dividerClasses.mjs","../../@mui/material/Divider/Divider.mjs","../../@mui/material/FormControlLabel/FormControlLabel.mjs","../../@mui/material/LinearProgress/linearProgressClasses.mjs","../../@mui/material/LinearProgress/LinearProgress.mjs","../../@mui/material/ListItemIcon/listItemIconClasses.mjs","../../@mui/material/ListItemIcon/ListItemIcon.mjs","../../@mui/material/ListItemText/listItemTextClasses.mjs","../../@mui/material/ListItemText/ListItemText.mjs","../../@mui/material/MenuItem/MenuItem.mjs","../../@mui/material/internal/svg-icons/FirstPage.mjs","../../@mui/material/internal/svg-icons/LastPage.mjs","../../@mui/material/Skeleton/skeletonClasses.mjs","../../@mui/material/Skeleton/Skeleton.mjs","../../@mui/material/Switch/switchClasses.mjs","../../@mui/material/Switch/Switch.mjs","../../@mui/material/Table/TableContext.mjs","../../@mui/material/Table/Tablelvl2Context.mjs","../../@mui/material/TableCell/tableCellClasses.mjs","../../@mui/material/TableCell/TableCell.mjs","../../@mui/material/Toolbar/toolbarClasses.mjs","../../@mui/material/Toolbar/Toolbar.mjs","../../@mui/material/TablePaginationActions/tablePaginationActionsClasses.mjs","../../@mui/material/TablePaginationActions/TablePaginationActions.mjs","../../@mui/material/TablePagination/tablePaginationClasses.mjs","../../@mui/material/locale/utils/buildFormatNumber.mjs","../../@mui/material/TablePagination/TablePagination.mjs","../../@mui/material/ToggleButtonGroup/ToggleButtonGroupContext.mjs","../../@mui/material/ToggleButtonGroup/ToggleButtonGroupButtonContext.mjs","../../@mui/material/ToggleButtonGroup/isValueSelected.mjs","../../@mui/material/ToggleButton/RovingToggleButton.mjs","../../@mui/material/ToggleButton/ToggleButton.mjs"],"sourcesContent":["import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getAutocompleteUtilityClass(slot) {\n return generateUtilityClass('MuiAutocomplete', slot);\n}\nconst autocompleteClasses = generateUtilityClasses('MuiAutocomplete', ['root', 'expanded', 'fullWidth', 'focused', 'focusVisible', 'tag', 'tagSizeSmall', 'tagSizeMedium', 'hasPopupIcon', 'hasClearIcon', 'inputRoot', 'input', 'inputFocused', 'endAdornment', 'clearIndicator', 'popupIndicator', 'popupIndicatorOpen', 'popper', 'popperDisablePortal', 'paper', 'listbox', 'loading', 'noOptions', 'status', 'option', 'groupLabel', 'groupUl']);\nexport default autocompleteClasses;","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getFormControlLabelUtilityClasses(slot) {\n return generateUtilityClass('MuiFormControlLabel', slot);\n}\nconst formControlLabelClasses = generateUtilityClasses('MuiFormControlLabel', ['root', 'labelPlacementStart', 'labelPlacementEnd', 'labelPlacementTop', 'labelPlacementBottom', 'disabled', 'label', 'error', 'required', 'asterisk']);\nexport default formControlLabelClasses;","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getMenuItemUtilityClass(slot) {\n return generateUtilityClass('MuiMenuItem', slot);\n}\nconst menuItemClasses = generateUtilityClasses('MuiMenuItem', ['root', 'focusVisible', 'dense', 'disabled', 'divider', 'gutters', 'selected']);\nexport default menuItemClasses;","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getToggleButtonUtilityClass(slot) {\n return generateUtilityClass('MuiToggleButton', slot);\n}\nconst toggleButtonClasses = generateUtilityClasses('MuiToggleButton', ['root', 'disabled', 'selected', 'standard', 'primary', 'secondary', 'sizeSmall', 'sizeMedium', 'sizeLarge', 'fullWidth']);\nexport default toggleButtonClasses;","export function isUnitless(value) {\n return String(parseFloat(value)).length === String(value).length;\n}\n\n// Ported from Compass\n// https://github.com/Compass/compass/blob/master/core/stylesheets/compass/typography/_units.scss\n// Emulate the sass function \"unit\"\nexport function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n}\n\n// Emulate the sass function \"unitless\"\nexport function toUnitless(length) {\n return parseFloat(length);\n}\n\n// Convert any CSS or value to any another.\n// From https://github.com/KyleAMathews/convert-css-length\nexport function convertLength(baseFontSize) {\n return (length, toUnit) => {\n const fromUnit = getUnit(length);\n\n // Optimize for cases where `from` and `to` units are accidentally the same.\n if (fromUnit === toUnit) {\n return length;\n }\n\n // Convert input length to pixels.\n let pxLength = toUnitless(length);\n if (fromUnit !== 'px') {\n if (fromUnit === 'em') {\n pxLength = toUnitless(length) * toUnitless(baseFontSize);\n } else if (fromUnit === 'rem') {\n pxLength = toUnitless(length) * toUnitless(baseFontSize);\n }\n }\n\n // Convert length in pixels to the output unit\n let outputLength = pxLength;\n if (toUnit !== 'px') {\n if (toUnit === 'em') {\n outputLength = pxLength / toUnitless(baseFontSize);\n } else if (toUnit === 'rem') {\n outputLength = pxLength / toUnitless(baseFontSize);\n } else {\n return length;\n }\n }\n return parseFloat(outputLength.toFixed(5)) + toUnit;\n };\n}\nexport function alignProperty({\n size,\n grid\n}) {\n const sizeBelow = size - size % grid;\n const sizeAbove = sizeBelow + grid;\n return size - sizeBelow < sizeAbove - size ? sizeBelow : sizeAbove;\n}\n\n// fontGrid finds a minimal grid (in rem) for the fontSize values so that the\n// lineHeight falls under a x pixels grid, 4px in the case of Material Design,\n// without changing the relative line height\nexport function fontGrid({\n lineHeight,\n pixels,\n htmlFontSize\n}) {\n return pixels / (lineHeight * htmlFontSize);\n}\n\n/**\n * generate a responsive version of a given CSS property\n * @example\n * responsiveProperty({\n * cssProperty: 'fontSize',\n * min: 15,\n * max: 20,\n * unit: 'px',\n * breakpoints: [300, 600],\n * })\n *\n * // this returns\n *\n * {\n * fontSize: '15px',\n * '@media (min-width:300px)': {\n * fontSize: '17.5px',\n * },\n * '@media (min-width:600px)': {\n * fontSize: '20px',\n * },\n * }\n * @param {Object} params\n * @param {string} params.cssProperty - The CSS property to be made responsive\n * @param {number} params.min - The smallest value of the CSS property\n * @param {number} params.max - The largest value of the CSS property\n * @param {string} [params.unit] - The unit to be used for the CSS property\n * @param {Array.number} [params.breakpoints] - An array of breakpoints\n * @param {number} [params.alignStep] - Round scaled value to fall under this grid\n * @returns {Object} responsive styles for {params.cssProperty}\n */\nexport function responsiveProperty({\n cssProperty,\n min,\n max,\n unit = 'rem',\n breakpoints = [600, 900, 1200],\n transform = null\n}) {\n const output = {\n [cssProperty]: `${min}${unit}`\n };\n const factor = (max - min) / breakpoints[breakpoints.length - 1];\n breakpoints.forEach(breakpoint => {\n let value = min + factor * breakpoint;\n if (transform !== null) {\n value = transform(value);\n }\n output[`@media (min-width:${breakpoint}px)`] = {\n [cssProperty]: `${Math.round(value * 10000) / 10000}${unit}`\n };\n });\n return output;\n}","'use client';\n\nimport * as React from 'react';\n\n/**\n * Copied from @base-ui/utils\n *\n * Returns a function that forces a rerender.\n */\nexport default function useForcedRerendering() {\n const [, setState] = React.useState({});\n return React.useCallback(() => {\n setState({});\n }, []);\n}","'use client';\n\nimport * as React from 'react';\nfunction usePreviousProps(value) {\n const ref = React.useRef({});\n React.useEffect(() => {\n ref.current = value;\n });\n return ref.current;\n}\nexport default usePreviousProps;","'use client';\n\nimport * as React from 'react';\nimport contains from '@mui/utils/contains';\nimport setRef from '@mui/utils/setRef';\nimport useEventCallback from '@mui/utils/useEventCallback';\nimport useControlled from '@mui/utils/useControlled';\nimport useId from '@mui/utils/useId';\nimport usePreviousProps from '@mui/utils/usePreviousProps';\nfunction areArraysSame({\n array1,\n array2,\n parser = value => value\n}) {\n return array1 && array2 && array1.length === array2.length && array1.every((prevOption, index) => parser(prevOption) === parser(array2[index]));\n}\n\n// https://stackoverflow.com/questions/990904/remove-accents-diacritics-in-a-string-in-javascript\nfunction stripDiacritics(string) {\n return string.normalize('NFD').replace(/[\\u0300-\\u036f]/g, '');\n}\nexport function createFilterOptions(config = {}) {\n const {\n ignoreAccents = true,\n ignoreCase = true,\n limit,\n matchFrom = 'any',\n stringify,\n trim = false\n } = config;\n return (options, {\n inputValue,\n getOptionLabel\n }) => {\n let input = trim ? inputValue.trim() : inputValue;\n if (ignoreCase) {\n input = input.toLowerCase();\n }\n if (ignoreAccents) {\n input = stripDiacritics(input);\n }\n const filteredOptions = !input ? options : options.filter(option => {\n let candidate = (stringify || getOptionLabel)(option);\n if (ignoreCase) {\n candidate = candidate.toLowerCase();\n }\n if (ignoreAccents) {\n candidate = stripDiacritics(candidate);\n }\n return matchFrom === 'start' ? candidate.startsWith(input) : candidate.includes(input);\n });\n return typeof limit === 'number' ? filteredOptions.slice(0, limit) : filteredOptions;\n };\n}\nconst defaultFilterOptions = createFilterOptions();\n\n// Number of options to jump in list box when `Page Up` and `Page Down` keys are used.\nconst pageSize = 5;\nconst defaultIsActiveElementInListbox = listboxRef => listboxRef.current !== null && contains(listboxRef.current.parentElement, document.activeElement);\nconst defaultIsOptionEqualToValue = (option, value) => option === value;\nconst MULTIPLE_DEFAULT_VALUE = [];\nfunction getInputValue(value, multiple, getOptionLabel, renderValue) {\n if (multiple || value == null || renderValue) {\n return '';\n }\n const optionLabel = getOptionLabel(value);\n return typeof optionLabel === 'string' ? optionLabel : '';\n}\nfunction useAutocomplete(props) {\n const {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n unstable_isActiveElementInListbox = defaultIsActiveElementInListbox,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n unstable_classNamePrefix = 'Mui',\n autoComplete = false,\n autoHighlight = false,\n autoSelect = false,\n blurOnSelect = false,\n clearOnBlur = !props.freeSolo,\n clearOnEscape = false,\n componentName = 'useAutocomplete',\n defaultValue = props.multiple ? MULTIPLE_DEFAULT_VALUE : null,\n disableClearable = false,\n disableCloseOnSelect = false,\n disabled: disabledProp,\n disabledItemsFocusable = false,\n disableListWrap = false,\n filterOptions = defaultFilterOptions,\n filterSelectedOptions = false,\n freeSolo = false,\n getOptionDisabled,\n getOptionKey,\n getOptionLabel: getOptionLabelProp = option => option.label ?? option,\n groupBy,\n handleHomeEndKeys = !props.freeSolo,\n id: idProp,\n includeInputInList = false,\n inputValue: inputValueProp,\n isOptionEqualToValue = defaultIsOptionEqualToValue,\n multiple = false,\n onChange,\n onClose,\n onHighlightChange,\n onInputChange,\n onOpen,\n open: openProp,\n openOnFocus = false,\n options,\n readOnly = false,\n renderValue,\n resetHighlightOnMouseLeave = false,\n selectOnFocus = !props.freeSolo,\n value: valueProp\n } = props;\n const id = useId(idProp);\n let getOptionLabel = getOptionLabelProp;\n getOptionLabel = option => {\n const optionLabel = getOptionLabelProp(option);\n if (typeof optionLabel !== 'string') {\n if (process.env.NODE_ENV !== 'production') {\n const erroneousReturn = optionLabel === undefined ? 'undefined' : `${typeof optionLabel} (${optionLabel})`;\n console.error(`MUI: The \\`getOptionLabel\\` method of ${componentName} returned ${erroneousReturn} instead of a string for ${JSON.stringify(option)}.`);\n }\n return String(optionLabel);\n }\n return optionLabel;\n };\n const ignoreFocus = React.useRef(false);\n const firstFocus = React.useRef(true);\n const inputRef = React.useRef(null);\n const listboxRef = React.useRef(null);\n // VoiceOver synthesises a spurious Backspace on the input after a chip\n // deletion moves DOM focus back to it. This flag suppresses that one event.\n const ignoreNextBackspaceRef = React.useRef(false);\n const windowLostFocus = React.useRef(false);\n const [anchorEl, setAnchorEl] = React.useState(null);\n const [focusedItem, setFocusedItem] = React.useState(-1);\n const defaultHighlighted = autoHighlight ? 0 : -1;\n const highlightedIndexRef = React.useRef(defaultHighlighted);\n\n // Tracks how the current highlight was set:\n // - 'keyboard' — arrow keys, Home/End, PageUp/PageDown\n // - 'mouse' — handleOptionMouseMove\n // - 'touch' — handleOptionTouchStart\n // - null — programmatic (autoHighlight, value sync)\n //\n // This lets handleBlur and the Enter handler distinguish intentional\n // interactions from incidental ones — e.g. autoSelect should not commit\n // a highlight that came from a casual mouse hover.\n /** @type {React.RefObject} */\n const highlightReasonRef = React.useRef(null);\n const touchScrolledRef = React.useRef(false);\n const isTouchRef = React.useRef(false);\n\n // Calculate the initial inputValue on mount only.\n // useRef ensures it doesn't update dynamically with defaultValue or value props.\n const initialInputValue = React.useRef(getInputValue(defaultValue ?? valueProp, multiple, getOptionLabel)).current;\n const [value, setValueState] = useControlled({\n controlled: valueProp,\n default: defaultValue,\n name: componentName\n });\n const [inputValue, setInputValueState] = useControlled({\n controlled: inputValueProp,\n default: initialInputValue,\n name: componentName,\n state: 'inputValue'\n });\n const [focused, setFocused] = React.useState(false);\n const resetInputValue = React.useCallback((event, newValue, reason) => {\n // Retain the current `inputValue` when no new option is selected and `clearOnBlur` is false.\n // In `multiple` mode, `newValue` is the next value array, so only length growth counts as a selection.\n const isOptionSelected = multiple ? value.length < newValue.length : newValue !== null;\n // A controlled single-value `freeSolo` reset to `null` should still clear the input.\n const shouldClearOnReset = reason === 'reset' && freeSolo && !multiple && newValue === null;\n if (!isOptionSelected && !clearOnBlur && !shouldClearOnReset) {\n return;\n }\n const newInputValue = getInputValue(newValue, multiple, getOptionLabel, renderValue);\n if (inputValue === newInputValue) {\n return;\n }\n setInputValueState(newInputValue);\n if (onInputChange) {\n onInputChange(event, newInputValue, reason);\n }\n }, [getOptionLabel, inputValue, multiple, onInputChange, setInputValueState, clearOnBlur, freeSolo, value, renderValue]);\n const [open, setOpenState] = useControlled({\n controlled: openProp,\n default: false,\n name: componentName,\n state: 'open'\n });\n const [inputPristine, setInputPristine] = React.useState(true);\n const inputValueIsSelectedValue = !multiple && value != null && inputValue === getOptionLabel(value);\n const popupOpen = open && !readOnly;\n const selectedValues = React.useMemo(() => {\n if (multiple) {\n return value;\n }\n if (value != null) {\n return [value];\n }\n return [];\n }, [multiple, value]);\n const selectedValuesSet = React.useMemo(() => {\n // Fast path for the default strict equality comparator to avoid O(n^2) option checks.\n if (isOptionEqualToValue !== defaultIsOptionEqualToValue || selectedValues.length === 0) {\n return null;\n }\n return new Set(selectedValues);\n }, [isOptionEqualToValue, selectedValues]);\n const isOptionSelected = React.useCallback(option => {\n if (selectedValuesSet) {\n return selectedValuesSet.has(option);\n }\n return selectedValues.some(value2 => value2 != null && isOptionEqualToValue(option, value2));\n }, [isOptionEqualToValue, selectedValues, selectedValuesSet]);\n const filteredOptions = popupOpen ? filterOptions(options.filter(option => {\n if (filterSelectedOptions && isOptionSelected(option)) {\n return false;\n }\n return true;\n }),\n // we use the empty string to manipulate `filterOptions` to not filter any options\n // i.e. the filter predicate always returns true\n {\n inputValue: inputValueIsSelectedValue && inputPristine ? '' : inputValue,\n getOptionLabel\n }) : [];\n const previousProps = usePreviousProps({\n filteredOptions,\n value,\n inputValue\n });\n React.useEffect(() => {\n const valueChange = value !== previousProps.value;\n if (focused && !valueChange) {\n return;\n }\n\n // In freeSolo mode, only reset the input after a real value change.\n // Also prevent the initial default value of `null` from clearing controlled values.\n const shouldSkipFreeSoloReset = freeSolo && (!valueChange || value == null && previousProps.value === undefined);\n if (shouldSkipFreeSoloReset) {\n return;\n }\n resetInputValue(null, value, 'reset');\n }, [value, resetInputValue, focused, previousProps.value, freeSolo]);\n const listboxAvailable = open && filteredOptions.length > 0 && !readOnly;\n const focusItem = useEventCallback(itemToFocus => {\n if (itemToFocus === -1) {\n inputRef.current.focus();\n } else {\n anchorEl.querySelector(`[data-item-index=\"${itemToFocus}\"]`).focus();\n }\n });\n\n // Ensure the focusedItem is never inconsistent\n React.useEffect(() => {\n if (multiple && focusedItem > value.length - 1) {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setFocusedItem(-1);\n focusItem(-1);\n }\n }, [value, multiple, focusedItem, focusItem]);\n function validOptionIndex(index, direction) {\n if (!listboxRef.current || index < 0 || index >= filteredOptions.length) {\n return -1;\n }\n let nextFocus = index;\n while (true) {\n const option = listboxRef.current.querySelector(`[data-option-index=\"${nextFocus}\"]`);\n\n // Same logic as MenuList.js\n const nextFocusDisabled = disabledItemsFocusable ? false : !option || option.disabled || option.getAttribute('aria-disabled') === 'true';\n if (option && option.hasAttribute('tabindex') && !nextFocusDisabled) {\n // The next option is available\n return nextFocus;\n }\n\n // The next option is disabled, move to the next element.\n // with looped index\n if (direction === 'next') {\n nextFocus = (nextFocus + 1) % filteredOptions.length;\n } else {\n nextFocus = (nextFocus - 1 + filteredOptions.length) % filteredOptions.length;\n }\n\n // We end up with initial index, that means we don't have available options.\n // All of them are disabled\n if (nextFocus === index) {\n return -1;\n }\n }\n }\n const syncHighlightedIndexToDOM = useEventCallback(({\n index,\n reason,\n preserveScroll = false\n }) => {\n // React can clear refs before pending passive effects run during unmount.\n // If both refs are gone, there is no DOM left to sync.\n if (inputRef.current == null && listboxRef.current == null) {\n return;\n }\n\n // does the index exist?\n if (index === -1) {\n inputRef.current.removeAttribute('aria-activedescendant');\n } else {\n inputRef.current.setAttribute('aria-activedescendant', `${id}-option-${index}`);\n }\n if (!listboxRef.current) {\n return;\n }\n const prev = listboxRef.current.querySelector(`[role=\"option\"].${unstable_classNamePrefix}-focused`);\n if (prev) {\n prev.classList.remove(`${unstable_classNamePrefix}-focused`);\n prev.classList.remove(`${unstable_classNamePrefix}-focusVisible`);\n }\n let listboxNode = listboxRef.current;\n if (listboxRef.current.getAttribute('role') !== 'listbox') {\n listboxNode = listboxRef.current.parentElement.querySelector('[role=\"listbox\"]');\n }\n\n // \"No results\"\n if (!listboxNode) {\n return;\n }\n if (index === -1) {\n if (!preserveScroll) {\n listboxNode.scrollTop = 0;\n }\n return;\n }\n const option = listboxRef.current.querySelector(`[data-option-index=\"${index}\"]`);\n if (!option) {\n return;\n }\n option.classList.add(`${unstable_classNamePrefix}-focused`);\n if (reason === 'keyboard') {\n option.classList.add(`${unstable_classNamePrefix}-focusVisible`);\n }\n\n // Scroll active descendant into view.\n // Logic copied from https://www.w3.org/WAI/content-assets/wai-aria-practices/patterns/combobox/examples/js/select-only.js\n // In case of mouse clicks and touch (in mobile devices) we avoid scrolling the element and keep both behaviors same.\n // Consider this API instead once it has a better browser support:\n // .scrollIntoView({ scrollMode: 'if-needed', block: 'nearest' });\n if (listboxNode.scrollHeight > listboxNode.clientHeight && reason !== 'mouse' && reason !== 'touch') {\n const element = option;\n const scrollBottom = listboxNode.clientHeight + listboxNode.scrollTop;\n const elementBottom = element.offsetTop + element.offsetHeight;\n if (elementBottom > scrollBottom) {\n listboxNode.scrollTop = elementBottom - listboxNode.clientHeight;\n } else if (element.offsetTop - element.offsetHeight * (groupBy ? 1.3 : 0) < listboxNode.scrollTop) {\n listboxNode.scrollTop = element.offsetTop - element.offsetHeight * (groupBy ? 1.3 : 0);\n }\n }\n });\n const setHighlightedIndex = useEventCallback(({\n event,\n index,\n reason,\n preserveScroll = false\n }) => {\n highlightedIndexRef.current = index;\n highlightReasonRef.current = reason ?? null;\n if (onHighlightChange && ['mouse', 'keyboard', 'touch'].includes(reason)) {\n onHighlightChange(event, index === -1 ? null : filteredOptions[index], reason);\n }\n syncHighlightedIndexToDOM({\n index,\n reason,\n preserveScroll\n });\n });\n const setHighlightedIndexFromSync = useEventCallback(({\n index\n }) => {\n highlightedIndexRef.current = index;\n syncHighlightedIndexToDOM({\n index,\n reason: highlightReasonRef.current\n });\n });\n const changeHighlightedIndex = useEventCallback(({\n event,\n diff,\n direction = 'next',\n reason,\n preserveScroll\n }) => {\n if (!popupOpen) {\n return;\n }\n if (reason === 'keyboard') {\n touchScrolledRef.current = false;\n isTouchRef.current = false;\n }\n const getNextIndex = () => {\n const maxIndex = filteredOptions.length - 1;\n if (diff === 'reset') {\n return defaultHighlighted;\n }\n if (diff === 'start') {\n return 0;\n }\n if (diff === 'end') {\n return maxIndex;\n }\n const newIndex = highlightedIndexRef.current + diff;\n if (newIndex < 0) {\n if (newIndex === -1 && includeInputInList) {\n return -1;\n }\n if (disableListWrap && highlightedIndexRef.current !== -1 || Math.abs(diff) > 1) {\n return 0;\n }\n return maxIndex;\n }\n if (newIndex > maxIndex) {\n if (newIndex === maxIndex + 1 && includeInputInList) {\n return -1;\n }\n if (disableListWrap || Math.abs(diff) > 1) {\n return maxIndex;\n }\n return 0;\n }\n return newIndex;\n };\n const nextIndex = validOptionIndex(getNextIndex(), direction);\n setHighlightedIndex({\n index: nextIndex,\n reason,\n event,\n preserveScroll\n });\n\n // Sync the content of the input with the highlighted option.\n if (autoComplete && diff !== 'reset') {\n if (nextIndex === -1) {\n inputRef.current.value = inputValue;\n } else {\n const option = getOptionLabel(filteredOptions[nextIndex]);\n inputRef.current.value = option;\n\n // The portion of the selected suggestion that has not been typed by the user,\n // a completion string, appears inline after the input cursor in the textbox.\n const index = option.toLowerCase().indexOf(inputValue.toLowerCase());\n if (index === 0 && inputValue.length > 0) {\n inputRef.current.setSelectionRange(inputValue.length, option.length);\n }\n }\n }\n });\n const filteredOptionsChanged = !areArraysSame({\n array1: previousProps.filteredOptions,\n array2: filteredOptions,\n parser: getOptionLabel\n });\n const getPreviousHighlightedOptionIndex = () => {\n const isSameValue = (value1, value2) => {\n const label1 = value1 ? getOptionLabel(value1) : '';\n const label2 = value2 ? getOptionLabel(value2) : '';\n return label1 === label2;\n };\n if (highlightedIndexRef.current !== -1 && !areArraysSame({\n array1: previousProps.filteredOptions,\n array2: filteredOptions,\n parser: getOptionLabel\n }) && previousProps.inputValue === inputValue && (multiple ? value.length === previousProps.value.length && previousProps.value.every((val, i) => getOptionLabel(value[i]) === getOptionLabel(val)) : isSameValue(previousProps.value, value))) {\n const previousHighlightedOption = previousProps.filteredOptions[highlightedIndexRef.current];\n if (previousHighlightedOption) {\n return filteredOptions.findIndex(option => {\n return getOptionLabel(option) === getOptionLabel(previousHighlightedOption);\n });\n }\n }\n return -1;\n };\n const syncHighlightedIndex = React.useCallback(() => {\n if (!popupOpen) {\n return;\n }\n\n // Check if the previously highlighted option still exists in the updated filtered options list and if the value and inputValue haven't changed\n // If it exists and the value and the inputValue haven't changed, just update its index, otherwise continue execution\n const previousHighlightedOptionIndex = getPreviousHighlightedOptionIndex();\n if (previousHighlightedOptionIndex !== -1) {\n // Keep the original highlight reason while re-syncing the DOM state.\n // The highlighted option still exists after the filteredOptions array changed\n // (e.g. async fetch returns new options while the user is mid-navigation),\n // so the original interaction reason (keyboard, mouse, etc.) still applies.\n setHighlightedIndexFromSync({\n index: previousHighlightedOptionIndex\n });\n return;\n }\n const valueItem = multiple ? value[0] : value;\n\n // The popup is empty, reset\n if (filteredOptions.length === 0 || valueItem == null) {\n // Preserve scroll when new options are appended without changing the current filter.\n const isAppendOnly = filteredOptionsChanged && previousProps.inputValue === inputValue && previousProps.filteredOptions?.length > 0 && filteredOptions.length > previousProps.filteredOptions.length && previousProps.filteredOptions.every((option, index) => getOptionLabel(option) === getOptionLabel(filteredOptions[index]));\n changeHighlightedIndex({\n diff: 'reset',\n preserveScroll: isAppendOnly\n });\n return;\n }\n if (!listboxRef.current) {\n return;\n }\n\n // Synchronize the value with the highlighted index\n if (valueItem != null) {\n const currentOption = filteredOptions[highlightedIndexRef.current];\n\n // Keep the current selected highlight while the popup stays open;\n // on reopen, resync from the selected value.\n if (multiple && currentOption && value.findIndex(val => isOptionEqualToValue(currentOption, val)) !== -1 && previousProps.filteredOptions?.length > 0) {\n setHighlightedIndexFromSync({\n index: highlightedIndexRef.current\n });\n return;\n }\n const itemIndex = filteredOptions.findIndex(optionItem => isOptionEqualToValue(optionItem, valueItem));\n if (itemIndex === -1) {\n changeHighlightedIndex({\n diff: 'reset'\n });\n } else {\n setHighlightedIndex({\n index: itemIndex\n });\n }\n return;\n }\n\n // Prevent the highlighted index to leak outside the boundaries.\n if (highlightedIndexRef.current >= filteredOptions.length - 1) {\n setHighlightedIndex({\n index: filteredOptions.length - 1\n });\n return;\n }\n\n // Restore the focus to the previous index.\n setHighlightedIndex({\n index: highlightedIndexRef.current\n });\n // Ignore filteredOptions (and options, isOptionEqualToValue, getOptionLabel) not to break the scroll position\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n // Only sync the highlighted index when the option switch between empty and not\n filteredOptions.length,\n // Don't sync the highlighted index with the value when multiple\n // eslint-disable-next-line react-hooks/exhaustive-deps\n multiple ? false : value, changeHighlightedIndex, setHighlightedIndex, setHighlightedIndexFromSync, popupOpen, inputValue, multiple]);\n const handleListboxRef = useEventCallback(node => {\n setRef(listboxRef, node);\n if (!node) {\n return;\n }\n syncHighlightedIndex();\n });\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (!inputRef.current || inputRef.current.nodeName !== 'INPUT') {\n if (inputRef.current && inputRef.current.nodeName === 'TEXTAREA') {\n console.warn([`A textarea element was provided to ${componentName} where input was expected.`, `This is not a supported scenario but it may work under certain conditions.`, `A textarea keyboard navigation may conflict with Autocomplete controls (for example enter and arrow keys).`, `Make sure to test keyboard navigation and add custom event handlers if necessary.`].join('\\n'));\n } else {\n console.error([`MUI: Unable to find the input element. It was resolved to ${inputRef.current} while an HTMLInputElement was expected.`, `Instead, ${componentName} expects an input element.`, '', componentName === 'useAutocomplete' ? 'Make sure you have bound getInputProps correctly and that the normal ref/effect resolutions order is guaranteed.' : 'Make sure you have customized the input component correctly.'].join('\\n'));\n }\n }\n }, [componentName]);\n }\n React.useEffect(() => {\n if (filteredOptionsChanged || popupOpen && !disableCloseOnSelect) {\n syncHighlightedIndex();\n }\n }, [syncHighlightedIndex, filteredOptionsChanged, popupOpen, disableCloseOnSelect]);\n\n // Listen for browser window blur to detect when the user switches tabs or windows.\n // This helps prevent the popup from reopening automatically when the window regains focus.\n React.useEffect(() => {\n if (typeof window === 'undefined') {\n return undefined;\n }\n const handleWindowBlur = () => {\n windowLostFocus.current = true;\n };\n window.addEventListener('blur', handleWindowBlur);\n return () => {\n window.removeEventListener('blur', handleWindowBlur);\n };\n }, []);\n const handleOpen = event => {\n if (open) {\n return;\n }\n setOpenState(true);\n setInputPristine(true);\n isTouchRef.current = false;\n if (onOpen) {\n onOpen(event);\n }\n };\n const handleClose = (event, reason) => {\n if (!open) {\n return;\n }\n setOpenState(false);\n touchScrolledRef.current = false;\n highlightReasonRef.current = null;\n if (onClose) {\n onClose(event, reason);\n }\n };\n const handleValue = (event, newValue, reason, details) => {\n if (multiple) {\n if (value.length === newValue.length && value.every((val, i) => val === newValue[i])) {\n return;\n }\n } else if (value === newValue) {\n return;\n }\n if (onChange) {\n onChange(event, newValue, reason, details);\n }\n setValueState(newValue);\n };\n const selectNewValue = (event, option, reasonProp = 'selectOption', origin = 'options') => {\n let reason = reasonProp;\n let newValue = option;\n if (multiple) {\n newValue = Array.isArray(value) ? value.slice() : [];\n if (process.env.NODE_ENV !== 'production') {\n const matches = newValue.filter(val => isOptionEqualToValue(option, val));\n if (matches.length > 1) {\n console.error([`MUI: The \\`isOptionEqualToValue\\` method of ${componentName} does not handle the arguments correctly.`, `The component expects a single value to match a given option but found ${matches.length} matches.`].join('\\n'));\n }\n }\n const itemIndex = newValue.findIndex(valueItem => isOptionEqualToValue(option, valueItem));\n if (itemIndex === -1) {\n newValue.push(option);\n } else if (origin !== 'freeSolo') {\n newValue.splice(itemIndex, 1);\n reason = 'removeOption';\n }\n }\n resetInputValue(event, newValue, reason);\n handleValue(event, newValue, reason, {\n option\n });\n if (!disableCloseOnSelect && (!event || !event.ctrlKey && !event.metaKey)) {\n handleClose(event, reason);\n }\n if (blurOnSelect === true || blurOnSelect === 'touch' && isTouchRef.current || blurOnSelect === 'mouse' && !isTouchRef.current) {\n inputRef.current.blur();\n }\n };\n function validItemIndex(index, direction) {\n if (index === -1) {\n return -1;\n }\n let nextFocus = index;\n while (true) {\n // Out of range\n if (direction === 'next' && nextFocus === value.length || direction === 'previous' && nextFocus === -1) {\n return -1;\n }\n const option = anchorEl.querySelector(`[data-item-index=\"${nextFocus}\"]`);\n\n // Same logic as MenuList.js\n if (!option || !option.hasAttribute('tabindex') || option.disabled || option.getAttribute('aria-disabled') === 'true') {\n nextFocus += direction === 'next' ? 1 : -1;\n } else {\n return nextFocus;\n }\n }\n }\n const handleFocusItem = (event, direction) => {\n if (!multiple) {\n return;\n }\n if (inputValue === '') {\n handleClose(event, 'toggleInput');\n }\n let nextItem = focusedItem;\n\n // When moving focus from the input to tags with ArrowLeft,\n // always jump to the last tag (if any) from the input.\n if (focusedItem === -1 && direction === 'previous') {\n nextItem = value.length - 1;\n // In freeSolo, clear any draft text so it doesn't \"come back\" later.\n if (freeSolo && inputValue !== '') {\n setInputValueState('');\n if (onInputChange) {\n onInputChange(event, '', 'reset');\n }\n }\n } else {\n nextItem += direction === 'next' ? 1 : -1;\n if (nextItem < 0) {\n nextItem = 0;\n }\n if (nextItem === value.length) {\n nextItem = -1;\n }\n }\n nextItem = validItemIndex(nextItem, direction);\n setFocusedItem(nextItem);\n focusItem(nextItem);\n };\n const handleClear = event => {\n setInputValueState('');\n if (onInputChange) {\n onInputChange(event, '', 'clear');\n }\n handleValue(event, multiple ? [] : null, 'clear');\n };\n const handleKeyDown = other => event => {\n if (other.onKeyDown) {\n other.onKeyDown(event);\n }\n if (event.defaultMuiPrevented) {\n return;\n }\n if (focusedItem !== -1 && !['ArrowLeft', 'ArrowRight'].includes(event.key)) {\n setFocusedItem(-1);\n focusItem(-1);\n }\n\n // Wait until IME is settled.\n if (event.which !== 229) {\n switch (event.key) {\n case 'Home':\n if (popupOpen && handleHomeEndKeys) {\n // Prevent scroll of the page\n event.preventDefault();\n changeHighlightedIndex({\n diff: 'start',\n direction: 'next',\n reason: 'keyboard',\n event\n });\n }\n break;\n case 'End':\n if (popupOpen && handleHomeEndKeys) {\n // Prevent scroll of the page\n event.preventDefault();\n changeHighlightedIndex({\n diff: 'end',\n direction: 'previous',\n reason: 'keyboard',\n event\n });\n }\n break;\n case 'PageUp':\n // Prevent scroll of the page\n event.preventDefault();\n changeHighlightedIndex({\n diff: -pageSize,\n direction: 'previous',\n reason: 'keyboard',\n event\n });\n handleOpen(event);\n break;\n case 'PageDown':\n // Prevent scroll of the page\n event.preventDefault();\n changeHighlightedIndex({\n diff: pageSize,\n direction: 'next',\n reason: 'keyboard',\n event\n });\n handleOpen(event);\n break;\n case 'ArrowDown':\n // Prevent cursor move\n event.preventDefault();\n changeHighlightedIndex({\n diff: 1,\n direction: 'next',\n reason: 'keyboard',\n event\n });\n handleOpen(event);\n break;\n case 'ArrowUp':\n // Prevent cursor move\n event.preventDefault();\n changeHighlightedIndex({\n diff: -1,\n direction: 'previous',\n reason: 'keyboard',\n event\n });\n handleOpen(event);\n break;\n case 'ArrowLeft':\n {\n const input = inputRef.current;\n // Only handle ArrowLeft when the caret is at the start of the input.\n // Otherwise let the browser move the caret normally.\n const caretAtStart = input && input.selectionStart === 0 && input.selectionEnd === 0;\n if (!caretAtStart) {\n // Let the browser handle normal cursor movement\n return;\n }\n\n // Single-value rendering: move focus from input to the single tag.\n if (!multiple && renderValue && value != null) {\n // Moving from input to single tag; clear freeSolo draft text,\n // so it doesn't reappear when we move back.\n if (freeSolo && inputValue !== '') {\n setInputValueState('');\n if (onInputChange) {\n onInputChange(event, '', 'reset');\n }\n }\n setFocusedItem(0);\n focusItem(0);\n } else {\n // Multi-value: delegate to tag navigation helper.\n handleFocusItem(event, 'previous');\n }\n break;\n }\n case 'ArrowRight':\n if (!multiple && renderValue) {\n setFocusedItem(-1);\n focusItem(-1);\n } else {\n handleFocusItem(event, 'next');\n }\n break;\n case 'Enter':\n {\n // In freeSolo, once the user has typed new text, Enter should commit that text instead\n // of treating a programmatic highlight as an intentional selection. Programmatic\n // highlights include autoHighlight and syncHighlightedIndex matching a previous value.\n const hasProgrammaticHighlight = popupOpen && highlightedIndexRef.current !== -1 && highlightReasonRef.current === null;\n const shouldCommitFreeSoloOverProgrammaticHighlight = freeSolo && !inputPristine && hasProgrammaticHighlight;\n const shouldSelectHighlighted = !freeSolo || inputPristine || !hasProgrammaticHighlight;\n const shouldPreventSubmitAfterFreeSoloCommit = shouldCommitFreeSoloOverProgrammaticHighlight && !touchScrolledRef.current;\n if (highlightedIndexRef.current !== -1 && popupOpen && shouldSelectHighlighted &&\n // After a touch-scroll the highlight is stale (the user scrolled\n // past it), so skip selection until the next deliberate interaction.\n !touchScrolledRef.current) {\n const option = filteredOptions[highlightedIndexRef.current];\n const disabled = getOptionDisabled ? getOptionDisabled(option) : false;\n\n // Avoid early form validation, let the end-users continue filling the form.\n event.preventDefault();\n if (disabled) {\n return;\n }\n selectNewValue(event, option, 'selectOption');\n\n // Move the selection to the end.\n if (autoComplete) {\n inputRef.current.setSelectionRange(inputRef.current.value.length, inputRef.current.value.length);\n }\n } else if (freeSolo && inputValue !== '' && inputValueIsSelectedValue === false) {\n if (multiple || shouldPreventSubmitAfterFreeSoloCommit) {\n // Allow people to commit the freeSolo value before they submit the form.\n event.preventDefault();\n }\n selectNewValue(event, inputValue, 'createOption', 'freeSolo');\n } else if (popupOpen && touchScrolledRef.current) {\n // The highlight is stale from a touch-scroll - close without selecting.\n event.preventDefault();\n // This happens on Enter, but re-using \"escape\" as the closest `AutocompleteCloseReason`\n // to avoid creating a new reason\n handleClose(event, 'escape');\n }\n break;\n }\n case 'Escape':\n if (popupOpen) {\n // Avoid Opera to exit fullscreen mode.\n event.preventDefault();\n // Avoid the Modal to handle the event.\n event.stopPropagation();\n handleClose(event, 'escape');\n } else if (clearOnEscape && (inputValue !== '' || multiple && value.length > 0 || renderValue)) {\n // Avoid Opera to exit fullscreen mode.\n event.preventDefault();\n // Avoid the Modal to handle the event.\n event.stopPropagation();\n handleClear(event);\n }\n break;\n case 'Backspace':\n // Remove the value on the left of the \"cursor\"\n if (ignoreNextBackspaceRef.current) {\n ignoreNextBackspaceRef.current = false;\n break;\n }\n if (multiple && !readOnly && inputValue === '' && value.length > 0) {\n const index = focusedItem === -1 ? value.length - 1 : focusedItem;\n const newValue = value.slice();\n newValue.splice(index, 1);\n handleValue(event, newValue, 'removeOption', {\n option: value[index]\n });\n if (focusedItem !== -1) {\n // Suppress the spurious Backspace VoiceOver synthesises on the\n // input after focus returns to it. Clear it shortly after\n // deletion so a later real Backspace is not ignored if the\n // synthetic follow-up event never arrives.\n ignoreNextBackspaceRef.current = true;\n setTimeout(() => {\n if (ignoreNextBackspaceRef.current) {\n ignoreNextBackspaceRef.current = false;\n }\n }, 0);\n }\n }\n if (!multiple && renderValue && !readOnly && inputValue === '') {\n handleValue(event, null, 'removeOption', {\n option: value\n });\n }\n break;\n case 'Delete':\n // Remove the value on the right of the \"cursor\"\n if (multiple && !readOnly && inputValue === '' && value.length > 0 && focusedItem !== -1) {\n const index = focusedItem;\n const newValue = value.slice();\n newValue.splice(index, 1);\n handleValue(event, newValue, 'removeOption', {\n option: value[index]\n });\n }\n if (!multiple && renderValue && !readOnly && inputValue === '') {\n // Single-value rendering: Delete on empty input removes\n // the single rendered option, same \"removeOption\" reason as multiple.\n handleValue(event, null, 'removeOption', {\n option: value\n });\n }\n break;\n default:\n }\n }\n };\n const handleFocus = event => {\n setFocused(true);\n\n // When focusing the input, ensure any previously focused item (chip)\n // is cleared so the input receives the visible caret and the\n // input-focused styling is applied.\n if (focusedItem !== -1) {\n setFocusedItem(-1);\n // Ensure DOM focus lands on the input\n focusItem(-1);\n }\n\n // If the window previously lost focus while the popup was open,\n // ignore this focus event to prevent unintended reopening.\n // Reset the flag so normal focus behavior resumes.\n if (windowLostFocus.current) {\n windowLostFocus.current = false;\n return;\n }\n if (openOnFocus && !ignoreFocus.current) {\n handleOpen(event);\n }\n };\n const handleBlur = event => {\n // Ignore the event when using the scrollbar with IE 11\n if (unstable_isActiveElementInListbox(listboxRef)) {\n inputRef.current.focus();\n return;\n }\n setFocused(false);\n firstFocus.current = true;\n ignoreFocus.current = false;\n\n // Auto-select the highlighted option on blur, but only if the highlight\n // came from keyboard navigation or was set programmatically (autoHighlight).\n // Mouse hover and touch should not trigger selection — the user may have\n // moved the pointer over an option without intending to commit to it.\n if (autoSelect && highlightedIndexRef.current !== -1 && popupOpen && highlightReasonRef.current !== 'mouse' && highlightReasonRef.current !== 'touch') {\n selectNewValue(event, filteredOptions[highlightedIndexRef.current], 'blur');\n } else if (autoSelect && freeSolo && inputValue !== '') {\n selectNewValue(event, inputValue, 'blur', 'freeSolo');\n } else if (clearOnBlur) {\n resetInputValue(event, value, 'blur');\n }\n handleClose(event, 'blur');\n };\n const handleInputChange = event => {\n const newValue = event.target.value;\n const valueChanged = inputValue !== newValue;\n if (valueChanged) {\n setInputValueState(newValue);\n touchScrolledRef.current = false;\n if (onInputChange) {\n onInputChange(event, newValue, 'input');\n }\n }\n if (newValue === '') {\n // For normal single-select, clearing the input clears the value.\n // For renderValue (chip-style single), only Backspace/Delete clear the value.\n if (!disableClearable && !multiple && !renderValue) {\n handleValue(event, null, 'clear');\n }\n } else {\n handleOpen(event);\n }\n\n // Called after handleOpen so it overrides handleOpen's setInputPristine(true)\n // when the first keystroke also opens the popup.\n if (valueChanged) {\n setInputPristine(false);\n }\n };\n const handleOptionMouseMove = event => {\n const index = Number(event.currentTarget.getAttribute('data-option-index'));\n if (highlightedIndexRef.current !== index) {\n setHighlightedIndex({\n event,\n index,\n reason: 'mouse'\n });\n } else {\n // The option is already highlighted (e.g. programmatically via autoHighlight),\n // but the user moved the mouse over it — mark as mouse-initiated so\n // autoSelect on blur correctly treats this as incidental hover.\n highlightReasonRef.current = 'mouse';\n }\n // Don't clear the touch-scroll guard while touch state is still latched.\n // After a touch gesture, browsers may fire compatibility mousemove\n // events; if those cleared the guard immediately, later compat events in\n // the same sequence could be misclassified as a real mouse interaction.\n // Touch state is cleared by the next deliberate interaction\n // (keyboard nav, handleOptionClick, or handleOpen).\n if (!isTouchRef.current) {\n touchScrolledRef.current = false;\n }\n };\n const handleListboxMouseLeave = event => {\n if (!resetHighlightOnMouseLeave || highlightedIndexRef.current === -1 || highlightReasonRef.current !== 'mouse' || isTouchRef.current) {\n return;\n }\n setHighlightedIndex({\n event,\n index: -1,\n reason: 'mouse',\n preserveScroll: true\n });\n };\n const handleOptionTouchStart = event => {\n touchScrolledRef.current = false;\n setHighlightedIndex({\n event,\n index: Number(event.currentTarget.getAttribute('data-option-index')),\n reason: 'touch'\n });\n isTouchRef.current = true;\n };\n const handleOptionClick = event => {\n const index = Number(event.currentTarget.getAttribute('data-option-index'));\n selectNewValue(event, filteredOptions[index], 'selectOption');\n isTouchRef.current = false;\n };\n const handleItemDelete = index => event => {\n const newValue = value.slice();\n newValue.splice(index, 1);\n handleValue(event, newValue, 'removeOption', {\n option: value[index]\n });\n };\n const handleSingleItemDelete = event => {\n handleValue(event, null, 'removeOption', {\n option: value\n });\n };\n const handlePopupIndicator = event => {\n if (open) {\n handleClose(event, 'toggleInput');\n } else {\n handleOpen(event);\n }\n };\n\n // Prevent input blur when interacting with the combobox\n const handleMouseDown = event => {\n // Prevent focusing the input if click is anywhere outside the Autocomplete\n if (!contains(event.currentTarget, event.target)) {\n return;\n }\n // Don't interfere with interactions outside the input area (e.g. helper text)\n if (anchorEl && !contains(anchorEl, event.target)) {\n return;\n }\n if (event.target.getAttribute('id') !== id) {\n event.preventDefault();\n }\n };\n\n // Focus the input when interacting with the combobox\n const handleClick = event => {\n // Prevent focusing the input if click is anywhere outside the Autocomplete\n if (!contains(event.currentTarget, event.target)) {\n return;\n }\n // Don't interfere with interactions outside the input area (e.g. helper text)\n if (anchorEl && !contains(anchorEl, event.target)) {\n return;\n }\n inputRef.current.focus();\n if (selectOnFocus && firstFocus.current && inputRef.current.selectionEnd - inputRef.current.selectionStart === 0) {\n inputRef.current.select();\n }\n firstFocus.current = false;\n };\n const handleInputMouseDown = event => {\n if (!disabledProp && (inputValue === '' || !open) &&\n // Only handle event when the main button is pressed (left click).\n event.button === 0) {\n handlePopupIndicator(event);\n }\n };\n let dirty = freeSolo && inputValue.length > 0;\n dirty = dirty || (multiple ? value.length > 0 : value !== null);\n let groupedOptions = filteredOptions;\n if (groupBy) {\n // used to keep track of key and indexes in the result array\n const indexBy = new Map();\n let warn = false;\n groupedOptions = filteredOptions.reduce((acc, option, index) => {\n const group = groupBy(option);\n if (acc.length > 0 && acc[acc.length - 1].group === group) {\n acc[acc.length - 1].options.push(option);\n } else {\n if (process.env.NODE_ENV !== 'production') {\n if (indexBy.get(group) && !warn) {\n console.warn(`MUI: The options provided combined with the \\`groupBy\\` method of ${componentName} returns duplicated headers.`, 'You can solve the issue by sorting the options with the output of `groupBy`.');\n warn = true;\n }\n indexBy.set(group, true);\n }\n acc.push({\n key: index,\n index,\n group,\n options: [option]\n });\n }\n return acc;\n }, []);\n }\n if (disabledProp && focused) {\n handleBlur();\n }\n return {\n getRootProps: (other = {}) => ({\n ...other,\n onKeyDown: handleKeyDown(other),\n onMouseDown: handleMouseDown,\n onClick: handleClick\n }),\n getInputLabelProps: () => ({\n id: `${id}-label`,\n htmlFor: id\n }),\n getInputProps: () => ({\n id,\n value: inputValue,\n onBlur: handleBlur,\n onFocus: handleFocus,\n onChange: handleInputChange,\n onMouseDown: handleInputMouseDown,\n // if open then this is handled imperatively so don't let react override\n // only have an opinion about this when closed\n 'aria-activedescendant': popupOpen ? '' : null,\n 'aria-autocomplete': autoComplete ? 'both' : 'list',\n 'aria-controls': listboxAvailable ? `${id}-listbox` : undefined,\n 'aria-expanded': listboxAvailable,\n // Disable browser's suggestion that might overlap with the popup.\n // Handle autocomplete but not autofill.\n autoComplete: 'off',\n ref: inputRef,\n autoCapitalize: 'none',\n spellCheck: 'false',\n role: 'combobox',\n disabled: disabledProp\n }),\n getClearProps: () => ({\n tabIndex: -1,\n type: 'button',\n onClick: event => {\n ignoreFocus.current = true;\n handleClear(event);\n }\n }),\n getItemProps: ({\n index = 0\n } = {}) => ({\n ...(multiple && {\n key: index\n }),\n 'data-item-index': index,\n tabIndex: -1,\n onFocus: () => {\n // If focus on the item doesn't come from keyboard events, we update the state via onFocus.\n if (focusedItem !== index) {\n setFocusedItem(index);\n }\n },\n ...(!readOnly && {\n onDelete: multiple ? handleItemDelete(index) : handleSingleItemDelete\n })\n }),\n getPopupIndicatorProps: () => ({\n tabIndex: -1,\n type: 'button',\n onClick: handlePopupIndicator\n }),\n getListboxProps: (other = {}) => ({\n ...other,\n role: 'listbox',\n id: `${id}-listbox`,\n 'aria-labelledby': `${id}-label`,\n 'aria-multiselectable': multiple || undefined,\n ref: handleListboxRef,\n onMouseDown: event => {\n other.onMouseDown?.(event);\n if (event.defaultMuiPrevented) {\n return;\n }\n\n // Prevent blur\n event.preventDefault();\n },\n onScroll: event => {\n other.onScroll?.(event);\n if (event.defaultMuiPrevented) {\n return;\n }\n if (isTouchRef.current) {\n touchScrolledRef.current = true;\n }\n },\n onMouseLeave: event => {\n other.onMouseLeave?.(event);\n if (event.defaultMuiPrevented) {\n return;\n }\n handleListboxMouseLeave(event);\n }\n }),\n getOptionProps: ({\n index,\n option\n }) => {\n const selected = isOptionSelected(option);\n const disabled = getOptionDisabled ? getOptionDisabled(option) : false;\n return {\n key: getOptionKey?.(option) ?? getOptionLabel(option),\n tabIndex: -1,\n role: 'option',\n id: `${id}-option-${index}`,\n onMouseMove: handleOptionMouseMove,\n onClick: handleOptionClick,\n onTouchStart: handleOptionTouchStart,\n 'data-option-index': index,\n 'aria-disabled': disabled,\n 'aria-selected': selected\n };\n },\n id,\n inputValue,\n value,\n dirty,\n expanded: popupOpen && anchorEl,\n popupOpen,\n focused: focused || focusedItem !== -1,\n anchorEl,\n setAnchorEl,\n focusedItem,\n groupedOptions\n };\n}\nexport default useAutocomplete;","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getListSubheaderUtilityClass(slot) {\n return generateUtilityClass('MuiListSubheader', slot);\n}\nconst listSubheaderClasses = generateUtilityClasses('MuiListSubheader', ['root', 'colorPrimary', 'colorInherit', 'gutters', 'inset', 'sticky']);\nexport default listSubheaderClasses;","'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { styled } from \"../zero-styled/index.mjs\";\nimport memoTheme from \"../utils/memoTheme.mjs\";\nimport { useDefaultProps } from \"../DefaultPropsProvider/index.mjs\";\nimport capitalize from \"../utils/capitalize.mjs\";\nimport { getListSubheaderUtilityClass } from \"./listSubheaderClasses.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes,\n color,\n disableGutters,\n inset,\n disableSticky\n } = ownerState;\n const slots = {\n root: ['root', color !== 'default' && `color${capitalize(color)}`, !disableGutters && 'gutters', inset && 'inset', !disableSticky && 'sticky']\n };\n return composeClasses(slots, getListSubheaderUtilityClass, classes);\n};\nconst ListSubheaderRoot = styled('li', {\n name: 'MuiListSubheader',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, ownerState.color !== 'default' && styles[`color${capitalize(ownerState.color)}`], !ownerState.disableGutters && styles.gutters, ownerState.inset && styles.inset, !ownerState.disableSticky && styles.sticky];\n }\n})(memoTheme(({\n theme\n}) => ({\n boxSizing: 'border-box',\n lineHeight: '48px',\n listStyle: 'none',\n color: (theme.vars || theme).palette.text.secondary,\n fontFamily: theme.typography.fontFamily,\n fontWeight: theme.typography.fontWeightMedium,\n fontSize: theme.typography.pxToRem(14),\n variants: [{\n props: {\n color: 'primary'\n },\n style: {\n color: (theme.vars || theme).palette.primary.main\n }\n }, {\n props: {\n color: 'inherit'\n },\n style: {\n color: 'inherit'\n }\n }, {\n props: ({\n ownerState\n }) => !ownerState.disableGutters,\n style: {\n paddingLeft: 16,\n paddingRight: 16\n }\n }, {\n props: ({\n ownerState\n }) => ownerState.inset,\n style: {\n paddingLeft: 72\n }\n }, {\n props: ({\n ownerState\n }) => !ownerState.disableSticky,\n style: {\n position: 'sticky',\n top: 0,\n zIndex: 1,\n backgroundColor: (theme.vars || theme).palette.background.paper\n }\n }]\n})));\nconst ListSubheader = /*#__PURE__*/React.forwardRef(function ListSubheader(inProps, ref) {\n const props = useDefaultProps({\n props: inProps,\n name: 'MuiListSubheader'\n });\n const {\n className,\n color = 'default',\n component = 'li',\n disableGutters = false,\n disableSticky = false,\n inset = false,\n ...other\n } = props;\n const ownerState = {\n ...props,\n color,\n component,\n disableGutters,\n disableSticky,\n inset\n };\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsx(ListSubheaderRoot, {\n as: component,\n className: clsx(classes.root, className),\n ref: ref,\n ownerState: ownerState,\n ...other\n });\n});\nprocess.env.NODE_ENV !== \"production\" ? ListSubheader.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * The color of the component. It supports those theme colors that make sense for this component.\n * @default 'default'\n */\n color: PropTypes.oneOf(['default', 'inherit', 'primary']),\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n /**\n * If `true`, the List Subheader will not have gutters.\n * @default false\n */\n disableGutters: PropTypes.bool,\n /**\n * If `true`, the List Subheader will not stick to the top during scroll.\n * @default false\n */\n disableSticky: PropTypes.bool,\n /**\n * If `true`, the List Subheader is indented.\n * @default false\n */\n inset: PropTypes.bool,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport default ListSubheader;","'use client';\n\nimport createSvgIcon from \"../../utils/createSvgIcon.mjs\";\n\n/**\n * @ignore - internal component.\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z\"\n}), 'Cancel');","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getChipUtilityClass(slot) {\n return generateUtilityClass('MuiChip', slot);\n}\nconst chipClasses = generateUtilityClasses('MuiChip', ['root', 'sizeSmall', 'sizeMedium', 'colorDefault', 'colorError', 'colorInfo', 'colorPrimary', 'colorSecondary', 'colorSuccess', 'colorWarning', 'disabled', 'clickable', 'deletable', 'outlined', 'filled', 'avatar', 'icon', 'label', 'deleteIcon', 'focusVisible']);\nexport default chipClasses;","'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport composeClasses from '@mui/utils/composeClasses';\nimport CancelIcon from \"../internal/svg-icons/Cancel.mjs\";\nimport useForkRef from \"../utils/useForkRef.mjs\";\nimport unsupportedProp from \"../utils/unsupportedProp.mjs\";\nimport capitalize from \"../utils/capitalize.mjs\";\nimport ButtonBase from \"../ButtonBase/index.mjs\";\nimport { styled } from \"../zero-styled/index.mjs\";\nimport memoTheme from \"../utils/memoTheme.mjs\";\nimport createSimplePaletteValueFilter from \"../utils/createSimplePaletteValueFilter.mjs\";\nimport { useDefaultProps } from \"../DefaultPropsProvider/index.mjs\";\nimport rootShouldForwardProp from \"../styles/rootShouldForwardProp.mjs\";\nimport chipClasses, { getChipUtilityClass } from \"./chipClasses.mjs\";\nimport useSlot from \"../utils/useSlot.mjs\";\nimport { getTransitionStyles } from \"../transitions/utils.mjs\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes,\n disabled,\n size,\n color,\n onDelete,\n clickable,\n variant\n } = ownerState;\n const slots = {\n root: ['root', variant, disabled && 'disabled', `size${capitalize(size)}`, `color${capitalize(color)}`, clickable && 'clickable', onDelete && 'deletable'],\n label: ['label'],\n avatar: ['avatar'],\n icon: ['icon'],\n deleteIcon: ['deleteIcon']\n };\n return composeClasses(slots, getChipUtilityClass, classes);\n};\nconst ChipRoot = styled('div', {\n name: 'MuiChip',\n slot: 'Root',\n shouldForwardProp: prop => rootShouldForwardProp(prop) && prop !== 'focusableWhenDisabled' && prop !== 'skipFocusWhenDisabled',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n const {\n color,\n clickable,\n onDelete,\n size,\n variant\n } = ownerState;\n return [{\n [`& .${chipClasses.avatar}`]: styles.avatar\n }, {\n [`& .${chipClasses.icon}`]: styles.icon\n }, {\n [`& .${chipClasses.deleteIcon}`]: styles.deleteIcon\n }, styles.root, styles[`size${capitalize(size)}`], styles[`color${capitalize(color)}`], clickable && styles.clickable, onDelete && styles.deletable, styles[variant]];\n }\n})(memoTheme(({\n theme\n}) => {\n const textColor = theme.palette.mode === 'light' ? theme.palette.grey[700] : theme.palette.grey[300];\n return {\n maxWidth: '100%',\n fontFamily: theme.typography.fontFamily,\n fontSize: theme.typography.pxToRem(13),\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n height: 32,\n lineHeight: 1.5,\n color: (theme.vars || theme).palette.text.primary,\n backgroundColor: (theme.vars || theme).palette.action.selected,\n borderRadius: 32 / 2,\n whiteSpace: 'nowrap',\n ...getTransitionStyles(theme, ['background-color', 'box-shadow']),\n // reset cursor explicitly in case ButtonBase is used\n cursor: 'unset',\n // We disable the focus ring for mouse, touch and keyboard users.\n outline: 0,\n textDecoration: 'none',\n border: 0,\n // Remove `button` border\n padding: 0,\n // Remove `button` padding\n verticalAlign: 'middle',\n boxSizing: 'border-box',\n [`&.${chipClasses.disabled}`]: {\n opacity: (theme.vars || theme).palette.action.disabledOpacity,\n pointerEvents: 'none'\n },\n [`& .${chipClasses.avatar}`]: {\n marginLeft: 5,\n marginRight: -6,\n width: 24,\n height: 24,\n color: theme.vars ? theme.vars.palette.Chip.defaultAvatarColor : textColor,\n fontSize: theme.typography.pxToRem(12)\n },\n [`& .${chipClasses.icon}`]: {\n marginLeft: 5,\n marginRight: -6\n },\n [`& .${chipClasses.deleteIcon}`]: {\n WebkitTapHighlightColor: 'transparent',\n color: theme.alpha((theme.vars || theme).palette.text.primary, 0.26),\n fontSize: 22,\n cursor: 'pointer',\n margin: '0 5px 0 -6px',\n '&:hover': {\n color: theme.alpha((theme.vars || theme).palette.text.primary, 0.4)\n }\n },\n variants: [{\n props: {\n color: 'primary'\n },\n style: {\n [`& .${chipClasses.avatar}`]: {\n color: (theme.vars || theme).palette.primary.contrastText,\n backgroundColor: (theme.vars || theme).palette.primary.dark\n }\n }\n }, {\n props: {\n color: 'secondary'\n },\n style: {\n [`& .${chipClasses.avatar}`]: {\n color: (theme.vars || theme).palette.secondary.contrastText,\n backgroundColor: (theme.vars || theme).palette.secondary.dark\n }\n }\n }, {\n props: {\n size: 'small'\n },\n style: {\n height: 24,\n [`& .${chipClasses.avatar}`]: {\n marginLeft: 4,\n marginRight: -4,\n width: 18,\n height: 18,\n fontSize: theme.typography.pxToRem(10)\n },\n [`& .${chipClasses.icon}`]: {\n fontSize: 18,\n marginLeft: 4,\n marginRight: -4\n },\n [`& .${chipClasses.deleteIcon}`]: {\n fontSize: 16,\n marginRight: 4,\n marginLeft: -4\n }\n }\n }, ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter(['contrastText'])).map(([color]) => {\n return {\n props: {\n color\n },\n style: {\n backgroundColor: (theme.vars || theme).palette[color].main,\n color: (theme.vars || theme).palette[color].contrastText,\n [`& .${chipClasses.deleteIcon}`]: {\n color: theme.alpha((theme.vars || theme).palette[color].contrastText, 0.7),\n '&:hover, &:active': {\n color: (theme.vars || theme).palette[color].contrastText\n }\n }\n }\n };\n }), {\n props: props => props.iconColor === props.color,\n style: {\n [`& .${chipClasses.icon}`]: {\n color: theme.vars ? theme.vars.palette.Chip.defaultIconColor : textColor\n }\n }\n }, {\n props: props => props.iconColor === props.color && props.color !== 'default',\n style: {\n [`& .${chipClasses.icon}`]: {\n color: 'inherit'\n }\n }\n }, {\n props: {\n onDelete: true\n },\n style: {\n [`&.${chipClasses.focusVisible}`]: {\n backgroundColor: theme.alpha((theme.vars || theme).palette.action.selected, `${(theme.vars || theme).palette.action.selectedOpacity} + ${(theme.vars || theme).palette.action.focusOpacity}`)\n }\n }\n }, ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter(['dark'])).map(([color]) => {\n return {\n props: {\n color,\n onDelete: true\n },\n style: {\n [`&.${chipClasses.focusVisible}`]: {\n background: (theme.vars || theme).palette[color].dark\n }\n }\n };\n }), {\n props: {\n clickable: true\n },\n style: {\n userSelect: 'none',\n WebkitTapHighlightColor: 'transparent',\n cursor: 'pointer',\n '&:hover': {\n backgroundColor: theme.alpha((theme.vars || theme).palette.action.selected, `${(theme.vars || theme).palette.action.selectedOpacity} + ${(theme.vars || theme).palette.action.hoverOpacity}`)\n },\n [`&.${chipClasses.focusVisible}`]: {\n backgroundColor: theme.alpha((theme.vars || theme).palette.action.selected, `${(theme.vars || theme).palette.action.selectedOpacity} + ${(theme.vars || theme).palette.action.focusOpacity}`)\n },\n '&:active': {\n boxShadow: (theme.vars || theme).shadows[1]\n }\n }\n }, ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter(['dark'])).map(([color]) => ({\n props: {\n color,\n clickable: true\n },\n style: {\n [`&:hover, &.${chipClasses.focusVisible}`]: {\n backgroundColor: (theme.vars || theme).palette[color].dark\n }\n }\n })), {\n props: {\n variant: 'outlined'\n },\n style: {\n backgroundColor: 'transparent',\n border: theme.vars ? `1px solid ${theme.vars.palette.Chip.defaultBorder}` : `1px solid ${theme.palette.mode === 'light' ? theme.palette.grey[400] : theme.palette.grey[700]}`,\n [`&.${chipClasses.clickable}:hover`]: {\n backgroundColor: (theme.vars || theme).palette.action.hover\n },\n [`&.${chipClasses.focusVisible}`]: {\n backgroundColor: (theme.vars || theme).palette.action.focus\n },\n [`& .${chipClasses.avatar}`]: {\n marginLeft: 4\n },\n [`& .${chipClasses.icon}`]: {\n marginLeft: 4\n },\n [`& .${chipClasses.deleteIcon}`]: {\n marginRight: 5\n }\n }\n }, {\n props: {\n size: 'small',\n variant: 'outlined'\n },\n style: {\n [`& .${chipClasses.avatar}`]: {\n marginLeft: 2\n },\n [`& .${chipClasses.icon}`]: {\n marginLeft: 2\n },\n [`& .${chipClasses.deleteIcon}`]: {\n marginRight: 3\n }\n }\n }, ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()) // no need to check for mainChannel as it's calculated from main\n .map(([color]) => ({\n props: {\n variant: 'outlined',\n color\n },\n style: {\n color: (theme.vars || theme).palette[color].main,\n border: `1px solid ${theme.alpha((theme.vars || theme).palette[color].main, 0.7)}`,\n [`&.${chipClasses.clickable}:hover`]: {\n backgroundColor: theme.alpha((theme.vars || theme).palette[color].main, (theme.vars || theme).palette.action.hoverOpacity)\n },\n [`&.${chipClasses.focusVisible}`]: {\n backgroundColor: theme.alpha((theme.vars || theme).palette[color].main, (theme.vars || theme).palette.action.focusOpacity)\n },\n [`& .${chipClasses.deleteIcon}`]: {\n color: theme.alpha((theme.vars || theme).palette[color].main, 0.7),\n '&:hover, &:active': {\n color: (theme.vars || theme).palette[color].main\n }\n }\n }\n }))]\n };\n}));\nconst ChipLabel = styled('span', {\n name: 'MuiChip',\n slot: 'Label'\n})({\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n paddingLeft: 12,\n paddingRight: 12,\n whiteSpace: 'nowrap',\n variants: [{\n props: {\n variant: 'outlined'\n },\n style: {\n paddingLeft: 11,\n paddingRight: 11\n }\n }, {\n props: {\n size: 'small'\n },\n style: {\n paddingLeft: 8,\n paddingRight: 8\n }\n }, {\n props: {\n size: 'small',\n variant: 'outlined'\n },\n style: {\n paddingLeft: 7,\n paddingRight: 7\n }\n }]\n});\nfunction isDeleteKeyboardEvent(keyboardEvent) {\n return keyboardEvent.key === 'Backspace' || keyboardEvent.key === 'Delete';\n}\n\n/**\n * Chips represent complex entities in small blocks, such as a contact.\n */\nconst Chip = /*#__PURE__*/React.forwardRef(function Chip(inProps, ref) {\n const props = useDefaultProps({\n props: inProps,\n name: 'MuiChip'\n });\n const {\n avatar: avatarProp,\n className,\n clickable: clickableProp,\n color = 'default',\n component: ComponentProp,\n deleteIcon: deleteIconProp,\n disabled = false,\n icon: iconProp,\n label,\n onClick,\n onDelete,\n onKeyDown,\n onKeyUp,\n size = 'medium',\n variant = 'filled',\n tabIndex,\n skipFocusWhenDisabled = false,\n // TODO v6: Rename to `focusableWhenDisabled`.\n slots = {},\n slotProps = {},\n ...other\n } = props;\n const {\n nativeButton,\n ...buttonBaseProps\n } = other;\n const chipRef = React.useRef(null);\n const handleRef = useForkRef(chipRef, ref);\n const handleDeleteIconClick = event => {\n // Stop the event from bubbling up to the `Chip`\n event.stopPropagation();\n onDelete(event);\n };\n const handleKeyDown = event => {\n // Ignore events from children of `Chip`.\n if (event.currentTarget === event.target && isDeleteKeyboardEvent(event)) {\n // Will be handled in keyUp, otherwise some browsers\n // might init navigation\n event.preventDefault();\n }\n if (onKeyDown) {\n onKeyDown(event);\n }\n };\n const handleKeyUp = event => {\n // Ignore events from children of `Chip`.\n if (event.currentTarget === event.target) {\n if (onDelete && isDeleteKeyboardEvent(event)) {\n onDelete(event);\n }\n }\n if (onKeyUp) {\n onKeyUp(event);\n }\n };\n const clickable = clickableProp !== false && onClick ? true : clickableProp;\n const component = clickable || onDelete ? ButtonBase : ComponentProp || 'div';\n const ownerState = {\n ...props,\n component,\n disabled,\n size,\n color,\n iconColor: /*#__PURE__*/React.isValidElement(iconProp) ? iconProp.props.color || color : color,\n onDelete: !!onDelete,\n clickable,\n variant\n };\n const classes = useUtilityClasses(ownerState);\n const moreProps = component === ButtonBase ? {\n component: ComponentProp || 'div',\n internalNativeButton: false,\n focusVisibleClassName: classes.focusVisible,\n ...(onDelete && {\n disableRipple: true\n }),\n ...(nativeButton !== undefined && {\n nativeButton\n })\n } : {};\n let deleteIcon = null;\n if (onDelete) {\n deleteIcon = deleteIconProp && /*#__PURE__*/React.isValidElement(deleteIconProp) ? (/*#__PURE__*/React.cloneElement(deleteIconProp, {\n className: clsx(deleteIconProp.props.className, classes.deleteIcon),\n onClick: handleDeleteIconClick\n })) : /*#__PURE__*/_jsx(CancelIcon, {\n className: classes.deleteIcon,\n onClick: handleDeleteIconClick\n });\n }\n let avatar = null;\n if (avatarProp && /*#__PURE__*/React.isValidElement(avatarProp)) {\n avatar = /*#__PURE__*/React.cloneElement(avatarProp, {\n className: clsx(classes.avatar, avatarProp.props.className)\n });\n }\n let icon = null;\n if (iconProp && /*#__PURE__*/React.isValidElement(iconProp)) {\n icon = /*#__PURE__*/React.cloneElement(iconProp, {\n className: clsx(classes.icon, iconProp.props.className)\n });\n }\n if (process.env.NODE_ENV !== 'production') {\n if (avatar && icon) {\n console.error('MUI: The Chip component can not handle the avatar ' + 'and the icon prop at the same time. Pick one.');\n }\n }\n const externalForwardedProps = {\n slots,\n slotProps\n };\n const [RootSlot, rootProps] = useSlot('root', {\n elementType: ChipRoot,\n externalForwardedProps: {\n ...externalForwardedProps,\n ...buttonBaseProps\n },\n ownerState,\n // The `component` prop is preserved because `Chip` relies on it for internal logic. If `shouldForwardComponentProp` were `false`, `useSlot` would remove the `component` prop, potentially breaking the component's behavior.\n shouldForwardComponentProp: true,\n ref: handleRef,\n className: clsx(classes.root, className),\n additionalProps: {\n disabled: clickable && disabled ? true : undefined,\n tabIndex: skipFocusWhenDisabled && disabled ? -1 : tabIndex,\n ...moreProps\n },\n getSlotProps: handlers => ({\n ...handlers,\n onClick: event => {\n handlers.onClick?.(event);\n onClick?.(event);\n },\n onKeyDown: event => {\n handlers.onKeyDown?.(event);\n handleKeyDown(event);\n },\n onKeyUp: event => {\n handlers.onKeyUp?.(event);\n handleKeyUp(event);\n }\n })\n });\n const [LabelSlot, labelProps] = useSlot('label', {\n elementType: ChipLabel,\n externalForwardedProps,\n ownerState,\n className: classes.label\n });\n return /*#__PURE__*/_jsxs(RootSlot, {\n as: component,\n ...rootProps,\n children: [avatar || icon, /*#__PURE__*/_jsx(LabelSlot, {\n ...labelProps,\n children: label\n }), deleteIcon]\n });\n});\nprocess.env.NODE_ENV !== \"production\" ? Chip.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * The Avatar element to display.\n */\n avatar: PropTypes.element,\n /**\n * This prop isn't supported.\n * Use the `component` prop if you need to change the children structure.\n */\n children: unsupportedProp,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * If `true`, the chip will appear clickable, and will raise when pressed,\n * even if the onClick prop is not defined.\n * If `false`, the chip will not appear clickable, even if onClick prop is defined.\n * This can be used, for example,\n * along with the component prop to indicate an anchor Chip is clickable.\n * Note: this controls the UI and does not affect the onClick event.\n */\n clickable: PropTypes.bool,\n /**\n * The color of the component.\n * It supports both default and custom theme colors, which can be added as shown in the\n * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).\n * @default 'default'\n */\n color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['default', 'primary', 'secondary', 'error', 'info', 'success', 'warning']), PropTypes.string]),\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n /**\n * Override the default delete icon element. Shown only if `onDelete` is set.\n */\n deleteIcon: PropTypes.element,\n /**\n * If `true`, the component is disabled.\n * @default false\n */\n disabled: PropTypes.bool,\n /**\n * Icon element.\n */\n icon: PropTypes.element,\n /**\n * The content of the component.\n */\n label: PropTypes.node,\n /**\n * If `true`, the component is expected to resolve to a native ` |