"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.stylesRoute = void 0;
var _router = require("@wordpress/router");
var _editor = _interopRequireDefault(require("../editor"));
var _lockUnlock = require("../../lock-unlock");
var _sidebarNavigationScreenGlobalStyles = _interopRequireDefault(require("../sidebar-navigation-screen-global-styles"));
var _sidebarGlobalStylesWrapper = _interopRequireDefault(require("../sidebar-global-styles-wrapper"));
var _styleBook = require("../style-book");
var _jsxRuntime = require("react/jsx-runtime");
/**
 * WordPress dependencies
 */

/**
 * Internal dependencies
 */

const {
  useLocation
} = (0, _lockUnlock.unlock)(_router.privateApis);
function MobileGlobalStylesUI() {
  const {
    query = {}
  } = useLocation();
  const {
    canvas
  } = query;
  if (canvas === 'edit') {
    return /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {});
  }
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarGlobalStylesWrapper.default, {});
}
const stylesRoute = exports.stylesRoute = {
  name: 'styles',
  path: '/styles',
  areas: {
    content: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarGlobalStylesWrapper.default, {}),
    sidebar: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenGlobalStyles.default, {
      backPath: "/"
    }),
    preview({
      query
    }) {
      const isStylebook = query.preview === 'stylebook';
      return isStylebook ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_styleBook.StyleBookPreview, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.default, {});
    },
    mobile: /*#__PURE__*/(0, _jsxRuntime.jsx)(MobileGlobalStylesUI, {})
  },
  widths: {
    content: 380
  }
};
//# sourceMappingURL=styles.js.map