"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.LogoTitle = void 0;

var _vue = require("vue");

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

function _isSlot(s) {
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !(0, _vue.isVNode)(s);
}

var LogoTitle = function LogoTitle(props, _ref) {
  var slots = _ref.slots;
  var logo = props.logo,
      title = props.title;
  var defLogo = (0, _utils.getRenderComponent)('logo', props, slots, '', {
    propsArgs: [props],
    slotArg: props
  });
  var logoDom = (0, _vue.computed)(function () {
    return typeof logo === 'string' ? (0, _vue.createVNode)("img", {
      "src": logo,
      "alt": "Logo"
    }, null) : defLogo;
  });
  var showTitle = (0, _vue.computed)(function () {
    if (props.layout === 'side' && props.collapsed) {
      return false;
    }

    return true;
  });
  return (0, _vue.createVNode)("div", {
    "class": 'logo-container'
  }, [(0, _vue.createVNode)("div", {
    "class": 'logo'
  }, [(0, _vue.unref)(logoDom)]), (0, _vue.unref)(showTitle) && (0, _vue.createVNode)("div", {
    "class": 'title'
  }, _isSlot(title) ? title : {
    default: function _default() {
      return [title];
    }
  })]);
};

exports.LogoTitle = LogoTitle;
LogoTitle.displayName = 'LogoTitle';
LogoTitle.inheritAttrs = false;
LogoTitle.props = {
  layout: _utils.PropTypes.string,
  collapsed: _utils.PropTypes.bool.def(false),
  logo: {
    type: [String, Boolean, Function, Object],
    default: ''
  },
  title: {
    type: [String, Boolean],
    default: 'Antd Pro Layout'
  }
};

var _default2 = (0, _utils.withInstall)(LogoTitle);

exports.default = _default2;