import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs2/core-js/object/get-own-property-descriptor";
import _inheritsLoose from "../../inheritsLoose";
import _defineProperty from "@babel/runtime-corejs2/helpers/defineProperty";
import _applyDecoratedDescriptor from "@babel/runtime-corejs2/helpers/applyDecoratedDescriptor";

var _dec, _class, _init, _class2, _temp;

import Intact from 'intact-angular';
import template from './index.vdt';
import '../../styles/kpc.css';
import './index.css';
import Aside from './aside';
import Header from './header';
import Body from './body';
import Footer from './footer';
import { mapChildren } from '../utils';
var Layout = (_dec = Intact.template(), (_class = (_temp = _class2 =
/*#__PURE__*/
function (_Intact) {
  _inheritsLoose(Layout, _Intact);

  function Layout() {
    return _Intact.apply(this, arguments) || this;
  }

  var _proto = Layout.prototype;

  _proto.defaults = function defaults() {
    return {
      _className: {
        'k-layout': true
      }
    };
  };

  _proto._beforeCreate = function _beforeCreate() {
    var _this$get = this.get(),
        children = _this$get.children;

    var hasAside = false;
    mapChildren(children, function (vNode) {
      if (vNode.tag === Aside) {
        hasAside = true;
      }
    });

    if (hasAside) {
      this.set('_className', {
        'k-layout k-has-aside': true
      });
    }
  };

  return Layout;
}(Intact), _defineProperty(_class2, "template", template), _temp), (_applyDecoratedDescriptor(_class, "template", [_dec], (_init = _Object$getOwnPropertyDescriptor(_class, "template"), _init = _init ? _init.value : undefined, {
  enumerable: true,
  configurable: true,
  writable: true,
  initializer: function initializer() {
    return _init;
  }
}), _class)), _class));
export { Layout as default };
export { Layout, Aside, Header, Body, Footer };