/* wp:polyfill */
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useRegisterSiteEditorRoutes = useRegisterSiteEditorRoutes;
var _data = require("@wordpress/data");
var _element = require("@wordpress/element");
var _lockUnlock = require("../../lock-unlock");
var _store = require("../../store");
var _home = require("./home");
var _styles = require("./styles");
var _navigation = require("./navigation");
var _navigationItem = require("./navigation-item");
var _patterns = require("./patterns");
var _patternItem = require("./pattern-item");
var _templatePartItem = require("./template-part-item");
var _templates = require("./templates");
var _templateItem = require("./template-item");
var _pages = require("./pages");
var _pageItem = require("./page-item");
var _stylebook = require("./stylebook");
/**
 * WordPress dependencies
 */

/**
 * Internal dependencies
 */

const routes = [_pageItem.pageItemRoute, _pages.pagesRoute, _templateItem.templateItemRoute, _templates.templatesRoute, _templatePartItem.templatePartItemRoute, _patternItem.patternItemRoute, _patterns.patternsRoute, _navigationItem.navigationItemRoute, _navigation.navigationRoute, _styles.stylesRoute, _home.homeRoute, _stylebook.stylebookRoute];
function useRegisterSiteEditorRoutes() {
  const registry = (0, _data.useRegistry)();
  const {
    registerRoute
  } = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_store.store));
  (0, _element.useEffect)(() => {
    registry.batch(() => {
      routes.forEach(registerRoute);
    });
  }, [registry, registerRoute]);
}
//# sourceMappingURL=index.js.map