/**
 * WordPress dependencies
 */
import { __experimentalItemGroup as ItemGroup } from '@wordpress/components';
import { background, typography, color, layout, shadow as shadowIcon } from '@wordpress/icons';
import { __ } from '@wordpress/i18n';
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';

/**
 * Internal dependencies
 */
import { NavigationButtonAsItem } from './navigation-button';
import { unlock } from '../../lock-unlock';
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
const {
  useHasDimensionsPanel,
  useHasTypographyPanel,
  useHasColorPanel,
  useGlobalSetting,
  useSettingsForBlockElement,
  useHasBackgroundPanel
} = unlock(blockEditorPrivateApis);
function RootMenu() {
  const [rawSettings] = useGlobalSetting('');
  const settings = useSettingsForBlockElement(rawSettings);
  /*
   * Use the raw settings to determine if the background panel should be displayed,
   * as the background panel is not dependent on the block element settings.
   */
  const hasBackgroundPanel = useHasBackgroundPanel(rawSettings);
  const hasTypographyPanel = useHasTypographyPanel(settings);
  const hasColorPanel = useHasColorPanel(settings);
  const hasShadowPanel = true; // useHasShadowPanel( settings );
  const hasDimensionsPanel = useHasDimensionsPanel(settings);
  const hasLayoutPanel = hasDimensionsPanel;
  return /*#__PURE__*/_jsx(_Fragment, {
    children: /*#__PURE__*/_jsxs(ItemGroup, {
      children: [hasTypographyPanel && /*#__PURE__*/_jsx(NavigationButtonAsItem, {
        icon: typography,
        path: "/typography",
        children: __('Typography')
      }), hasColorPanel && /*#__PURE__*/_jsx(NavigationButtonAsItem, {
        icon: color,
        path: "/colors",
        children: __('Colors')
      }), hasBackgroundPanel && /*#__PURE__*/_jsx(NavigationButtonAsItem, {
        icon: background,
        path: "/background",
        "aria-label": __('Background styles'),
        children: __('Background')
      }), hasShadowPanel && /*#__PURE__*/_jsx(NavigationButtonAsItem, {
        icon: shadowIcon,
        path: "/shadows",
        children: __('Shadows')
      }), hasLayoutPanel && /*#__PURE__*/_jsx(NavigationButtonAsItem, {
        icon: layout,
        path: "/layout",
        children: __('Layout')
      })]
    })
  });
}
export default RootMenu;
//# sourceMappingURL=root-menu.js.map