"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.MainSidebarNavigationContent = MainSidebarNavigationContent;
exports.default = SidebarNavigationScreenMain;
var _components = require("@wordpress/components");
var _i18n = require("@wordpress/i18n");
var _icons = require("@wordpress/icons");
var _data = require("@wordpress/data");
var _element = require("@wordpress/element");
var _coreData = require("@wordpress/core-data");
var _sidebarNavigationScreen = _interopRequireDefault(require("../sidebar-navigation-screen"));
var _sidebarNavigationItem = _interopRequireDefault(require("../sidebar-navigation-item"));
var _sidebarNavigationScreenGlobalStyles = require("../sidebar-navigation-screen-global-styles");
var _lockUnlock = require("../../lock-unlock");
var _store = require("../../store");
var _jsxRuntime = require("react/jsx-runtime");
/**
 * WordPress dependencies
 */

/**
 * Internal dependencies
 */

function MainSidebarNavigationContent({
  isBlockBasedTheme = true
}) {
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalItemGroup, {
    className: "edit-site-sidebar-navigation-screen-main",
    children: [isBlockBasedTheme && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
      children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
        uid: "navigation-navigation-item",
        to: "/navigation",
        withChevron: true,
        icon: _icons.navigation,
        children: (0, _i18n.__)('Navigation')
      }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenGlobalStyles.SidebarNavigationItemGlobalStyles, {
        to: "/styles",
        uid: "global-styles-navigation-item",
        icon: _icons.styles,
        children: (0, _i18n.__)('Styles')
      }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
        uid: "page-navigation-item",
        to: "/page",
        withChevron: true,
        icon: _icons.page,
        children: (0, _i18n.__)('Pages')
      }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
        uid: "template-navigation-item",
        to: "/template",
        withChevron: true,
        icon: _icons.layout,
        children: (0, _i18n.__)('Templates')
      })]
    }), !isBlockBasedTheme && /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
      uid: "stylebook-navigation-item",
      to: "/stylebook",
      withChevron: true,
      icon: _icons.styles,
      children: (0, _i18n.__)('Styles')
    }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
      uid: "patterns-navigation-item",
      to: "/pattern",
      withChevron: true,
      icon: _icons.symbol,
      children: (0, _i18n.__)('Patterns')
    })]
  });
}
function SidebarNavigationScreenMain() {
  const isBlockBasedTheme = (0, _data.useSelect)(select => select(_coreData.store).getCurrentTheme()?.is_block_theme, []);
  const {
    setEditorCanvasContainerView
  } = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_store.store));

  // Clear the editor canvas container view when accessing the main navigation screen.
  (0, _element.useEffect)(() => {
    setEditorCanvasContainerView(undefined);
  }, [setEditorCanvasContainerView]);
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreen.default, {
    isRoot: true,
    title: (0, _i18n.__)('Design'),
    description: isBlockBasedTheme ? (0, _i18n.__)('Customize the appearance of your website using the block editor.') : (0, _i18n.__)('Explore block styles and patterns to refine your site'),
    content: /*#__PURE__*/(0, _jsxRuntime.jsx)(MainSidebarNavigationContent, {
      isBlockBasedTheme: isBlockBasedTheme
    })
  });
}
//# sourceMappingURL=index.js.map