import { extend, mergeData } from '../../vue';
import { NAME_NAVBAR_BRAND } from '../../constants/components';
import { PROP_TYPE_STRING } from '../../constants/props';
import { omit, sortKeys } from '../../utils/object';
import { makePropsConfigurable, makeProp, pluckProps } from '../../utils/props';
import { props as props$1, BLink } from '../link/link';

// --- Props ---

const linkProps = omit(props$1, ['event', 'routerTag']);
linkProps.href.default = undefined;
linkProps.to.default = undefined;
const props = makePropsConfigurable(sortKeys({
  ...linkProps,
  tag: makeProp(PROP_TYPE_STRING, 'div')
}), NAME_NAVBAR_BRAND);

// --- Main component ---

// @vue/component
const BNavbarBrand = /*#__PURE__*/extend({
  name: NAME_NAVBAR_BRAND,
  functional: true,
  props,
  render(h, _ref) {
    let {
      props,
      data,
      children
    } = _ref;
    const isLink = props.to || props.href;
    const tag = isLink ? BLink : props.tag;
    return h(tag, mergeData(data, {
      staticClass: 'navbar-brand',
      props: isLink ? pluckProps(linkProps, props) : {}
    }), children);
  }
});

export { BNavbarBrand, props };
