"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = PostsApp;
var _editor = require("@wordpress/editor");
var _router = require("@wordpress/router");
var _useInitEditedEntityFromUrl = _interopRequireDefault(require("../sync-state-with-url/use-init-edited-entity-from-url"));
var _layout = _interopRequireDefault(require("../layout"));
var _router2 = _interopRequireDefault(require("./router"));
var _lockUnlock = require("../../lock-unlock");
var _jsxRuntime = require("react/jsx-runtime");
/**
 * WordPress dependencies
 */

/**
 * Internal dependencies
 */

const {
  RouterProvider
} = (0, _lockUnlock.unlock)(_router.privateApis);
const {
  GlobalStylesProvider
} = (0, _lockUnlock.unlock)(_editor.privateApis);
function PostsLayout() {
  // This ensures the edited entity id and type are initialized properly.
  (0, _useInitEditedEntityFromUrl.default)();
  const route = (0, _router2.default)();
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_layout.default, {
    route: route
  });
}
function PostsApp() {
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(GlobalStylesProvider, {
    children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.UnsavedChangesWarning, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(RouterProvider, {
      children: /*#__PURE__*/(0, _jsxRuntime.jsx)(PostsLayout, {})
    })]
  });
}
//# sourceMappingURL=index.js.map