"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = LPPage;

var _tslib = require("tslib");

var _classnames = _interopRequireDefault(require("classnames"));

var _react = _interopRequireDefault(require("react"));

var _header = _interopRequireDefault(require("../header"));

var _silderNav = _interopRequireDefault(require("../silder-nav"));

var _topNav = _interopRequireDefault(require("../top-nav"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function LPPage(props) {
  var style = props.style,
      className = props.className,
      children = props.children,
      headerStyle = props.headerStyle,
      headerClassName = props.headerClassName,
      nav = props.nav,
      top = props.top,
      collapsible = props.collapsible,
      collapsed = props.collapsed,
      defaultCollapsed = props.defaultCollapsed,
      onCollapseTriggerClick = props.onCollapseTriggerClick,
      rest = (0, _tslib.__rest)(props, ["style", "className", "children", "headerStyle", "headerClassName", "nav", "top", "collapsible", "collapsed", "defaultCollapsed", "onCollapseTriggerClick"]);
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: "lp-app-layout"
  }, top ? /*#__PURE__*/_react["default"].createElement(_topNav["default"], (0, _tslib.__assign)({}, top)) : null, nav ? /*#__PURE__*/_react["default"].createElement(_silderNav["default"], {
    className: top ? "layout-silder-nav" : undefined,
    nav: nav,
    collapsible: collapsible,
    collapsed: collapsed,
    defaultCollapsed: defaultCollapsed,
    onCollapseTriggerClick: onCollapseTriggerClick
  }) : null, /*#__PURE__*/_react["default"].createElement("div", {
    style: style,
    className: (0, _classnames["default"])("lp-page", className, {
      "layout-only-silder-content": nav
    }, {
      "layout-silder-content": top
    })
  }, /*#__PURE__*/_react["default"].createElement(_header["default"], (0, _tslib.__assign)({}, rest, {
    style: headerStyle,
    className: headerClassName,
    isNest: true
  })), children && /*#__PURE__*/_react["default"].createElement("div", {
    className: "lp-page-container"
  }, _react["default"].Children.map(children, function (child) {
    return /*#__PURE__*/_react["default"].isValidElement(child) ? /*#__PURE__*/_react["default"].cloneElement(child, {
      nest: 1
    }) : child;
  }))));
}