"use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;exports.__esModule = true;exports.MobilePopupHeader = void 0;var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _react = _interopRequireDefault(require("react"));

var _utils = require("../../../lib/utils");

var _Emotion = require("../../../lib/theming/Emotion");
var _ThemeContext = require("../../../lib/theming/ThemeContext");

var _MobilePopupHeader2 = require("./MobilePopupHeader.styles");var








MobilePopupHeader = exports.MobilePopupHeader = /*#__PURE__*/function (_React$Component) {function MobilePopupHeader() {return _React$Component.apply(this, arguments) || this;}(0, _inheritsLoose2.default)(MobilePopupHeader, _React$Component);var _proto = MobilePopupHeader.prototype;_proto.





  render = function render() {var _this = this;
    return /*#__PURE__*/(
      _react.default.createElement(_ThemeContext.ThemeContext.Consumer, null,
      function (theme) {
        _this.theme = theme;
        return _this.renderMain();
      }
      ));

  };_proto.

  renderMain = function renderMain() {var _cx, _cx2;
    var _this$props = this.props,caption = _this$props.caption,children = _this$props.children;

    return /*#__PURE__*/(
      _react.default.createElement("div", {
        className: (0, _Emotion.cx)((_cx = {}, _cx[
        _MobilePopupHeader2.jsStyles.root(this.theme)] = true, _cx[
        _MobilePopupHeader2.jsStyles.rootWithoutContent()] = !caption && !children, _cx)
        ) }, /*#__PURE__*/

      _react.default.createElement("div", { className: _MobilePopupHeader2.jsStyles.container() },
      caption && /*#__PURE__*/
      _react.default.createElement("div", {
        className: (0, _Emotion.cx)((_cx2 = {}, _cx2[
        _MobilePopupHeader2.jsStyles.caption(this.theme)] = true, _cx2[
        _MobilePopupHeader2.jsStyles.captionWithChildren()] = (0, _utils.isNonNullable)(children), _cx2)
        ) },

      caption
      ),

      /*#__PURE__*/_react.default.isValidElement(children) && /*#__PURE__*/_react.default.createElement("div", null, children)
      )
      ));

  };return MobilePopupHeader;}(_react.default.Component);MobilePopupHeader.__KONTUR_REACT_UI__ = 'MobileMenuHeader';MobilePopupHeader.displayName = 'MobileMenuHeader';