"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.EntityPage = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _react = _interopRequireWildcard(require("react"));
var _EntityPageHeader = require("../EntityPageHeader");
var _EntityPageContent = require("../EntityPageContent");
var _EntityPageCard = require("../EntityPageCard");
var _EntityPageExtensions = require("../EntityPageExtensions");
var _EntityPageMainContent = require("../EntityPageMainContent");
var _EntityPageAdditionalContent = require("../EntityPageAdditionalContent");
var _mobxReactLite = require("mobx-react-lite");
var _EntityPageWrapper = require("./EntityPageWrapper");
var _providers = require("../../providers");
var _reactHookForm = require("react-hook-form");
var _minimalRequiredWdsRuntimeCheck = require("../../minimalRequiredWdsRuntimeCheck");
var _FormPage = require("../FormPage");
var _useEntityPageLoadReporting = require("./useEntityPageLoadReporting");
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/cairo/dist/cjs/components/EntityPage/EntityPage.tsx";
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
function _EntityPage({
  state,
  actionsBarConfig,
  ...rest
}) {
  if (process.env.NODE_ENV !== 'production') {
    (0, _minimalRequiredWdsRuntimeCheck.minimalRequiredWdsRuntimeCheck)({
      required: '^1.73.0',
      requiredBy: 'WixPatterns/EntityPage'
    });
  }
  (0, _react.useState)(() => state.actionsBarConfig = actionsBarConfig);
  (0, _react.useEffect)(() => state.init(), []);
  const {
    bi: {
      startTime
    },
    _withinRouter,
    isFetching,
    initTask
  } = state;
  (0, _useEntityPageLoadReporting.useEntityPageLoadReporting)({
    withinRouter: !!_withinRouter,
    startTime,
    isFetching,
    initTask
  });
  return /*#__PURE__*/_react.default.createElement(_providers.EntityPageContextProvider, {
    value: state,
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 62,
      columnNumber: 5
    }
  }, /*#__PURE__*/_react.default.createElement(_FormPage.FormPageProvider, {
    state: state.formPage,
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 63,
      columnNumber: 7
    }
  }, /*#__PURE__*/_react.default.createElement(_reactHookForm.FormProvider, (0, _extends2.default)({}, state.form, {
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 64,
      columnNumber: 9
    }
  }), /*#__PURE__*/_react.default.createElement(_EntityPageWrapper.EntityPageWrapper, (0, _extends2.default)({
    state: state
  }, rest, {
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 65,
      columnNumber: 11
    }
  })))));
}
_EntityPage.Header = _EntityPageHeader.EntityPageHeader;
_EntityPage.Content = _EntityPageContent.EntityPageContent;
_EntityPage.MainContent = _EntityPageMainContent.EntityPageMainContent;
_EntityPage.AdditionalContent = _EntityPageAdditionalContent.EntityPageAdditionalContent;
_EntityPage.Card = _EntityPageCard.EntityPageCard;
_EntityPage.Slots = _EntityPageExtensions.EntityPageSlots;
_EntityPage.Extensions = _EntityPageExtensions.EntityPageSlots;
_EntityPage.displayName = 'EntityPage';
const EntityPage = exports.EntityPage = (0, _mobxReactLite.observer)(_EntityPage);
//# sourceMappingURL=EntityPage.js.map