{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport * as React from 'react';\nimport { isFragment } from 'react-is';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { HTMLElementType } from '@material-ui/utils';\nimport withStyles from '../styles/withStyles';\nimport Popover from '../Popover';\nimport MenuList from '../MenuList';\nimport * as ReactDOM from 'react-dom';\nimport setRef from '../utils/setRef';\nimport useTheme from '../styles/useTheme';\nvar RTL_ORIGIN = {\n  vertical: 'top',\n  horizontal: 'right'\n};\nvar LTR_ORIGIN = {\n  vertical: 'top',\n  horizontal: 'left'\n};\nexport var styles = {\n  /* Styles applied to the `Paper` component. */\n  paper: {\n    // specZ: The maximum height of a simple menu should be one or more rows less than the view\n    // height. This ensures a tapable area outside of the simple menu with which to dismiss\n    // the menu.\n    maxHeight: 'calc(100% - 96px)',\n    // Add iOS momentum scrolling.\n    WebkitOverflowScrolling: 'touch'\n  },\n\n  /* Styles applied to the `List` component via `MenuList`. */\n  list: {\n    // We disable the focus ring for mouse, touch and keyboard users.\n    outline: 0\n  }\n};\nvar Menu = /*#__PURE__*/React.forwardRef(function Menu(props, ref) {\n  var _props$autoFocus = props.autoFocus,\n      autoFocus = _props$autoFocus === void 0 ? true : _props$autoFocus,\n      children = props.children,\n      classes = props.classes,\n      _props$disableAutoFoc = props.disableAutoFocusItem,\n      disableAutoFocusItem = _props$disableAutoFoc === void 0 ? false : _props$disableAutoFoc,\n      _props$MenuListProps = props.MenuListProps,\n      MenuListProps = _props$MenuListProps === void 0 ? {} : _props$MenuListProps,\n      onClose = props.onClose,\n      onEntering = props.onEntering,\n      open = props.open,\n      _props$PaperProps = props.PaperProps,\n      PaperProps = _props$PaperProps === void 0 ? {} : _props$PaperProps,\n      PopoverClasses = props.PopoverClasses,\n      _props$transitionDura = props.transitionDuration,\n      transitionDuration = _props$transitionDura === void 0 ? 'auto' : _props$transitionDura,\n      _props$variant = props.variant,\n      variant = _props$variant === void 0 ? 'selectedMenu' : _props$variant,\n      other = _objectWithoutProperties(props, [\"autoFocus\", \"children\", \"classes\", \"disableAutoFocusItem\", \"MenuListProps\", \"onClose\", \"onEntering\", \"open\", \"PaperProps\", \"PopoverClasses\", \"transitionDuration\", \"variant\"]);\n\n  var theme = useTheme();\n  var autoFocusItem = autoFocus && !disableAutoFocusItem && open;\n  var menuListActionsRef = React.useRef(null);\n  var contentAnchorRef = React.useRef(null);\n\n  var getContentAnchorEl = function getContentAnchorEl() {\n    return contentAnchorRef.current;\n  };\n\n  var handleEntering = function handleEntering(element, isAppearing) {\n    if (menuListActionsRef.current) {\n      menuListActionsRef.current.adjustStyleForScrollbar(element, theme);\n    }\n\n    if (onEntering) {\n      onEntering(element, isAppearing);\n    }\n  };\n\n  var handleListKeyDown = function handleListKeyDown(event) {\n    if (event.key === 'Tab') {\n      event.preventDefault();\n\n      if (onClose) {\n        onClose(event, 'tabKeyDown');\n      }\n    }\n  };\n  /**\n   * the index of the item should receive focus\n   * in a `variant=\"selectedMenu\"` it's the first `selected` item\n   * otherwise it's the very first item.\n   */\n\n\n  var activeItemIndex = -1; // since we inject focus related props into children we have to do a lookahead\n  // to check if there is a `selected` item. We're looking for the last `selected`\n  // item and use the first valid item as a fallback\n\n  React.Children.map(children, function (child, index) {\n    if (! /*#__PURE__*/React.isValidElement(child)) {\n      return;\n    }\n\n    if (process.env.NODE_ENV !== 'production') {\n      if (isFragment(child)) {\n        console.error([\"Material-UI: The Menu component doesn't accept a Fragment as a child.\", 'Consider providing an array instead.'].join('\\n'));\n      }\n    }\n\n    if (!child.props.disabled) {\n      if (variant !== \"menu\" && child.props.selected) {\n        activeItemIndex = index;\n      } else if (activeItemIndex === -1) {\n        activeItemIndex = index;\n      }\n    }\n  });\n  var items = React.Children.map(children, function (child, index) {\n    if (index === activeItemIndex) {\n      return /*#__PURE__*/React.cloneElement(child, {\n        ref: function ref(instance) {\n          // #StrictMode ready\n          contentAnchorRef.current = ReactDOM.findDOMNode(instance);\n          setRef(child.ref, instance);\n        }\n      });\n    }\n\n    return child;\n  });\n  return /*#__PURE__*/React.createElement(Popover, _extends({\n    getContentAnchorEl: getContentAnchorEl,\n    classes: PopoverClasses,\n    onClose: onClose,\n    onEntering: handleEntering,\n    anchorOrigin: theme.direction === 'rtl' ? RTL_ORIGIN : LTR_ORIGIN,\n    transformOrigin: theme.direction === 'rtl' ? RTL_ORIGIN : LTR_ORIGIN,\n    PaperProps: _extends({}, PaperProps, {\n      classes: _extends({}, PaperProps.classes, {\n        root: classes.paper\n      })\n    }),\n    open: open,\n    ref: ref,\n    transitionDuration: transitionDuration\n  }, other), /*#__PURE__*/React.createElement(MenuList, _extends({\n    onKeyDown: handleListKeyDown,\n    actions: menuListActionsRef,\n    autoFocus: autoFocus && (activeItemIndex === -1 || disableAutoFocusItem),\n    autoFocusItem: autoFocusItem,\n    variant: variant\n  }, MenuListProps, {\n    className: clsx(classes.list, MenuListProps.className)\n  }), items));\n});\nprocess.env.NODE_ENV !== \"production\" ? Menu.propTypes = {\n  // ----------------------------- Warning --------------------------------\n  // | These PropTypes are generated from the TypeScript type definitions |\n  // |     To update them edit the d.ts file and run \"yarn proptypes\"     |\n  // ----------------------------------------------------------------------\n\n  /**\n   * A HTML element, or a function that returns it.\n   * It's used to set the position of the menu.\n   */\n  anchorEl: PropTypes\n  /* @typescript-to-proptypes-ignore */\n  .oneOfType([HTMLElementType, PropTypes.func]),\n\n  /**\n   * If `true` (Default) will focus the `[role=\"menu\"]` if no focusable child is found. Disabled\n   * children are not focusable. If you set this prop to `false` focus will be placed\n   * on the parent modal container. This has severe accessibility implications\n   * and should only be considered if you manage focus otherwise.\n   */\n  autoFocus: PropTypes.bool,\n\n  /**\n   * Menu contents, normally `MenuItem`s.\n   */\n  children: PropTypes.node,\n\n  /**\n   * Override or extend the styles applied to the component.\n   * See [CSS API](#css) below for more details.\n   */\n  classes: PropTypes.object,\n\n  /**\n   * When opening the menu will not focus the active item but the `[role=\"menu\"]`\n   * unless `autoFocus` is also set to `false`. Not using the default means not\n   * following WAI-ARIA authoring practices. Please be considerate about possible\n   * accessibility implications.\n   */\n  disableAutoFocusItem: PropTypes.bool,\n\n  /**\n   * Props applied to the [`MenuList`](/api/menu-list/) element.\n   */\n  MenuListProps: PropTypes.object,\n\n  /**\n   * Callback fired when the component requests to be closed.\n   *\n   * @param {object} event The event source of the callback.\n   * @param {string} reason Can be: `\"escapeKeyDown\"`, `\"backdropClick\"`, `\"tabKeyDown\"`.\n   */\n  onClose: PropTypes.func,\n\n  /**\n   * Callback fired before the Menu enters.\n   */\n  onEnter: PropTypes.func,\n\n  /**\n   * Callback fired when the Menu has entered.\n   */\n  onEntered: PropTypes.func,\n\n  /**\n   * Callback fired when the Menu is entering.\n   */\n  onEntering: PropTypes.func,\n\n  /**\n   * Callback fired before the Menu exits.\n   */\n  onExit: PropTypes.func,\n\n  /**\n   * Callback fired when the Menu has exited.\n   */\n  onExited: PropTypes.func,\n\n  /**\n   * Callback fired when the Menu is exiting.\n   */\n  onExiting: PropTypes.func,\n\n  /**\n   * If `true`, the menu is visible.\n   */\n  open: PropTypes.bool.isRequired,\n\n  /**\n   * @ignore\n   */\n  PaperProps: PropTypes.object,\n\n  /**\n   * `classes` prop applied to the [`Popover`](/api/popover/) element.\n   */\n  PopoverClasses: PropTypes.object,\n\n  /**\n   * The length of the transition in `ms`, or 'auto'\n   */\n  transitionDuration: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.shape({\n    appear: PropTypes.number,\n    enter: PropTypes.number,\n    exit: PropTypes.number\n  })]),\n\n  /**\n   * The variant to use. Use `menu` to prevent selected items from impacting the initial focus\n   * and the vertical alignment relative to the anchor element.\n   */\n  variant: PropTypes.oneOf(['menu', 'selectedMenu'])\n} : void 0;\nexport default withStyles(styles, {\n  name: 'MuiMenu'\n})(Menu);","map":{"version":3,"sources":["C:/laragon/www/itokin/DriverOPCDA/frontend/node_modules/@material-ui/core/esm/Menu/Menu.js"],"names":["_extends","_objectWithoutProperties","React","isFragment","PropTypes","clsx","HTMLElementType","withStyles","Popover","MenuList","ReactDOM","setRef","useTheme","RTL_ORIGIN","vertical","horizontal","LTR_ORIGIN","styles","paper","maxHeight","WebkitOverflowScrolling","list","outline","Menu","forwardRef","props","ref","_props$autoFocus","autoFocus","children","classes","_props$disableAutoFoc","disableAutoFocusItem","_props$MenuListProps","MenuListProps","onClose","onEntering","open","_props$PaperProps","PaperProps","PopoverClasses","_props$transitionDura","transitionDuration","_props$variant","variant","other","theme","autoFocusItem","menuListActionsRef","useRef","contentAnchorRef","getContentAnchorEl","current","handleEntering","element","isAppearing","adjustStyleForScrollbar","handleListKeyDown","event","key","preventDefault","activeItemIndex","Children","map","child","index","isValidElement","process","env","NODE_ENV","console","error","join","disabled","selected","items","cloneElement","instance","findDOMNode","createElement","anchorOrigin","direction","transformOrigin","root","onKeyDown","actions","className","propTypes","anchorEl","oneOfType","func","bool","node","object","onEnter","onEntered","onExit","onExited","onExiting","isRequired","oneOf","number","shape","appear","enter","exit","name"],"mappings":"AAAA,OAAOA,QAAP,MAAqB,oCAArB;AACA,OAAOC,wBAAP,MAAqC,oDAArC;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SAASC,UAAT,QAA2B,UAA3B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,IAAP,MAAiB,MAAjB;AACA,SAASC,eAAT,QAAgC,oBAAhC;AACA,OAAOC,UAAP,MAAuB,sBAAvB;AACA,OAAOC,OAAP,MAAoB,YAApB;AACA,OAAOC,QAAP,MAAqB,aAArB;AACA,OAAO,KAAKC,QAAZ,MAA0B,WAA1B;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,OAAOC,QAAP,MAAqB,oBAArB;AACA,IAAIC,UAAU,GAAG;AACfC,EAAAA,QAAQ,EAAE,KADK;AAEfC,EAAAA,UAAU,EAAE;AAFG,CAAjB;AAIA,IAAIC,UAAU,GAAG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AAEhC,SAAS,CAACsF,IAnEiC;;AAqEvD;AACF;AACA;AACEM,EAAAA,MAAM,EAAE5F,SAAS,CAACsF,IAxEqC;;AA0EvD;AACF;AACA;AACEO,EAAAA,QAAQ,EAAE7F,SAAS,CAACsF,IA7EmC;;AA+EvD;AACF;AACA;AACEQ,EAAAA,SAAS,EAAE9F,SAAS,CAACsF,IAlFkC;;AAoFvD;AACF;AACA;AACErD,EAAAA,IAAI,EAAEjC,SAAS,CAACuF,IAAV,CAAeQ,UAvFkC;;AAyFvD;AACF;AACA;AACE5D,EAAAA,UAAU,EAAEnC,SAAS,CAACyF,MA5FiC;;AA8FvD;AACF;AACA;AACErD,EAAAA,cAAc,EAAEpC,SAAS,CAACyF,MAjG6B;;AAmGvD;AACF;AACA;AACEnD,EAAAA,kBAAkB,EAAEtC,SAAS,CAACqF,SAAV,CAAoB,CAACrF,SAAS,CAACgG,KAAV,CAAgB,CAAC,MAAD,CAAhB,CAAD,EAA4BhG,SAAS,CAACiG,MAAtC,EAA8CjG,SAAS,CAACkG,KAAV,CAAgB;AACpGC,IAAAA,MAAM,EAAEnG,SAAS,CAACiG,MADkF;AAEpGG,IAAAA,KAAK,EAAEpG,SAAS,CAACiG,MAFmF;AAGpGI,IAAAA,IAAI,EAAErG,SAAS,CAACiG;AAHoF,GAAhB,CAA9C,CAApB,CAtGmC;;AA4GvD;AACF;AACA;AACA;AACEzD,EAAAA,OAAO,EAAExC,SAAS,CAACgG,KAAV,CAAgB,CAAC,MAAD,EAAS,cAAT,CAAhB;AAhH8C,CAAzD,GAiHI,KAAK,CAjHT;AAkHA,eAAe7F,UAAU,CAACU,MAAD,EAAS;AAChCyF,EAAAA,IAAI,EAAE;AAD0B,CAAT,CAAV,CAEZnF,IAFY,CAAf","sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport * as React from 'react';\nimport { isFragment } from 'react-is';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { HTMLElementType } from '@material-ui/utils';\nimport withStyles from '../styles/withStyles';\nimport Popover from '../Popover';\nimport MenuList from '../MenuList';\nimport * as ReactDOM from 'react-dom';\nimport setRef from '../utils/setRef';\nimport useTheme from '../styles/useTheme';\nvar RTL_ORIGIN = {\n  vertical: 'top',\n  horizontal: 'right'\n};\nvar LTR_ORIGIN = {\n  vertical: 'top',\n  horizontal: 'left'\n};\nexport var styles = {\n  /* Styles applied to the `Paper` component. */\n  paper: {\n    // specZ: The maximum height of a simple menu should be one or more rows less than the view\n    // height. This ensures a tapable area outside of the simple menu with which to dismiss\n    // the menu.\n    maxHeight: 'calc(100% - 96px)',\n    // Add iOS momentum scrolling.\n    WebkitOverflowScrolling: 'touch'\n  },\n\n  /* Styles applied to the `List` component via `MenuList`. */\n  list: {\n    // We disable the focus ring for mouse, touch and keyboard users.\n    outline: 0\n  }\n};\nvar Menu = /*#__PURE__*/React.forwardRef(function Menu(props, ref) {\n  var _props$autoFocus = props.autoFocus,\n      autoFocus = _props$autoFocus === void 0 ? true : _props$autoFocus,\n      children = props.children,\n      classes = props.classes,\n      _props$disableAutoFoc = props.disableAutoFocusItem,\n      disableAutoFocusItem = _props$disableAutoFoc === void 0 ? false : _props$disableAutoFoc,\n      _props$MenuListProps = props.MenuListProps,\n      MenuListProps = _props$MenuListProps === void 0 ? {} : _props$MenuListProps,\n      onClose = props.onClose,\n      onEntering = props.onEntering,\n      open = props.open,\n      _props$PaperProps = props.PaperProps,\n      PaperProps = _props$PaperProps === void 0 ? {} : _props$PaperProps,\n      PopoverClasses = props.PopoverClasses,\n      _props$transitionDura = props.transitionDuration,\n      transitionDuration = _props$transitionDura === void 0 ? 'auto' : _props$transitionDura,\n      _props$variant = props.variant,\n      variant = _props$variant === void 0 ? 'selectedMenu' : _props$variant,\n      other = _objectWithoutProperties(props, [\"autoFocus\", \"children\", \"classes\", \"disableAutoFocusItem\", \"MenuListProps\", \"onClose\", \"onEntering\", \"open\", \"PaperProps\", \"PopoverClasses\", \"transitionDuration\", \"variant\"]);\n\n  var theme = useTheme();\n  var autoFocusItem = autoFocus && !disableAutoFocusItem && open;\n  var menuListActionsRef = React.useRef(null);\n  var contentAnchorRef = React.useRef(null);\n\n  var getContentAnchorEl = function getContentAnchorEl() {\n    return contentAnchorRef.current;\n  };\n\n  var handleEntering = function handleEntering(element, isAppearing) {\n    if (menuListActionsRef.current) {\n      menuListActionsRef.current.adjustStyleForScrollbar(element, theme);\n    }\n\n    if (onEntering) {\n      onEntering(element, isAppearing);\n    }\n  };\n\n  var handleListKeyDown = function handleListKeyDown(event) {\n    if (event.key === 'Tab') {\n      event.preventDefault();\n\n      if (onClose) {\n        onClose(event, 'tabKeyDown');\n      }\n    }\n  };\n  /**\n   * the index of the item should receive focus\n   * in a `variant=\"selectedMenu\"` it's the first `selected` item\n   * otherwise it's the very first item.\n   */\n\n\n  var activeItemIndex = -1; // since we inject focus related props into children we have to do a lookahead\n  // to check if there is a `selected` item. We're looking for the last `selected`\n  // item and use the first valid item as a fallback\n\n  React.Children.map(children, function (child, index) {\n    if (! /*#__PURE__*/React.isValidElement(child)) {\n      return;\n    }\n\n    if (process.env.NODE_ENV !== 'production') {\n      if (isFragment(child)) {\n        console.error([\"Material-UI: The Menu component doesn't accept a Fragment as a child.\", 'Consider providing an array instead.'].join('\\n'));\n      }\n    }\n\n    if (!child.props.disabled) {\n      if (variant !== \"menu\" && child.props.selected) {\n        activeItemIndex = index;\n      } else if (activeItemIndex === -1) {\n        activeItemIndex = index;\n      }\n    }\n  });\n  var items = React.Children.map(children, function (child, index) {\n    if (index === activeItemIndex) {\n      return /*#__PURE__*/React.cloneElement(child, {\n        ref: function ref(instance) {\n          // #StrictMode ready\n          contentAnchorRef.current = ReactDOM.findDOMNode(instance);\n          setRef(child.ref, instance);\n        }\n      });\n    }\n\n    return child;\n  });\n  return /*#__PURE__*/React.createElement(Popover, _extends({\n    getContentAnchorEl: getContentAnchorEl,\n    classes: PopoverClasses,\n    onClose: onClose,\n    onEntering: handleEntering,\n    anchorOrigin: theme.direction === 'rtl' ? RTL_ORIGIN : LTR_ORIGIN,\n    transformOrigin: theme.direction === 'rtl' ? RTL_ORIGIN : LTR_ORIGIN,\n    PaperProps: _extends({}, PaperProps, {\n      classes: _extends({}, PaperProps.classes, {\n        root: classes.paper\n      })\n    }),\n    open: open,\n    ref: ref,\n    transitionDuration: transitionDuration\n  }, other), /*#__PURE__*/React.createElement(MenuList, _extends({\n    onKeyDown: handleListKeyDown,\n    actions: menuListActionsRef,\n    autoFocus: autoFocus && (activeItemIndex === -1 || disableAutoFocusItem),\n    autoFocusItem: autoFocusItem,\n    variant: variant\n  }, MenuListProps, {\n    className: clsx(classes.list, MenuListProps.className)\n  }), items));\n});\nprocess.env.NODE_ENV !== \"production\" ? Menu.propTypes = {\n  // ----------------------------- Warning --------------------------------\n  // | These PropTypes are generated from the TypeScript type definitions |\n  // |     To update them edit the d.ts file and run \"yarn proptypes\"     |\n  // ----------------------------------------------------------------------\n\n  /**\n   * A HTML element, or a function that returns it.\n   * It's used to set the position of the menu.\n   */\n  anchorEl: PropTypes\n  /* @typescript-to-proptypes-ignore */\n  .oneOfType([HTMLElementType, PropTypes.func]),\n\n  /**\n   * If `true` (Default) will focus the `[role=\"menu\"]` if no focusable child is found. Disabled\n   * children are not focusable. If you set this prop to `false` focus will be placed\n   * on the parent modal container. This has severe accessibility implications\n   * and should only be considered if you manage focus otherwise.\n   */\n  autoFocus: PropTypes.bool,\n\n  /**\n   * Menu contents, normally `MenuItem`s.\n   */\n  children: PropTypes.node,\n\n  /**\n   * Override or extend the styles applied to the component.\n   * See [CSS API](#css) below for more details.\n   */\n  classes: PropTypes.object,\n\n  /**\n   * When opening the menu will not focus the active item but the `[role=\"menu\"]`\n   * unless `autoFocus` is also set to `false`. Not using the default means not\n   * following WAI-ARIA authoring practices. Please be considerate about possible\n   * accessibility implications.\n   */\n  disableAutoFocusItem: PropTypes.bool,\n\n  /**\n   * Props applied to the [`MenuList`](/api/menu-list/) element.\n   */\n  MenuListProps: PropTypes.object,\n\n  /**\n   * Callback fired when the component requests to be closed.\n   *\n   * @param {object} event The event source of the callback.\n   * @param {string} reason Can be: `\"escapeKeyDown\"`, `\"backdropClick\"`, `\"tabKeyDown\"`.\n   */\n  onClose: PropTypes.func,\n\n  /**\n   * Callback fired before the Menu enters.\n   */\n  onEnter: PropTypes.func,\n\n  /**\n   * Callback fired when the Menu has entered.\n   */\n  onEntered: PropTypes.func,\n\n  /**\n   * Callback fired when the Menu is entering.\n   */\n  onEntering: PropTypes.func,\n\n  /**\n   * Callback fired before the Menu exits.\n   */\n  onExit: PropTypes.func,\n\n  /**\n   * Callback fired when the Menu has exited.\n   */\n  onExited: PropTypes.func,\n\n  /**\n   * Callback fired when the Menu is exiting.\n   */\n  onExiting: PropTypes.func,\n\n  /**\n   * If `true`, the menu is visible.\n   */\n  open: PropTypes.bool.isRequired,\n\n  /**\n   * @ignore\n   */\n  PaperProps: PropTypes.object,\n\n  /**\n   * `classes` prop applied to the [`Popover`](/api/popover/) element.\n   */\n  PopoverClasses: PropTypes.object,\n\n  /**\n   * The length of the transition in `ms`, or 'auto'\n   */\n  transitionDuration: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.shape({\n    appear: PropTypes.number,\n    enter: PropTypes.number,\n    exit: PropTypes.number\n  })]),\n\n  /**\n   * The variant to use. Use `menu` to prevent selected items from impacting the initial focus\n   * and the vertical alignment relative to the anchor element.\n   */\n  variant: PropTypes.oneOf(['menu', 'selectedMenu'])\n} : void 0;\nexport default withStyles(styles, {\n  name: 'MuiMenu'\n})(Menu);"]},"metadata":{},"sourceType":"module"}