text: 'use strict';
  
  var _extends = require('babel-runtime/helpers/extends')['default'];
  
  var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default'];
  
  exports.__esModule = true;
  
  var _react = require('react');
  
  var _react2 = _interopRequireDefault(_react);
  
  var _classnames = require('classnames');
  
  var _classnames2 = _interopRequireDefault(_classnames);
  
  var _BootstrapMixin = require('./BootstrapMixin');
  
  var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin);
  
  var _utilsCustomPropTypes = require('./utils/CustomPropTypes');
  
  var _utilsCustomPropTypes2 = _interopRequireDefault(_utilsCustomPropTypes);
  
  var _ButtonInput = require('./ButtonInput');
  
  var _ButtonInput2 = _interopRequireDefault(_ButtonInput);
  
  var Button = _react2['default'].createClass({
    displayName: 'Button',
  
    mixins: [_BootstrapMixin2['default']],
  
    propTypes: {
      active: _react2['default'].PropTypes.bool,
      disabled: _react2['default'].PropTypes.bool,
      block: _react2['default'].PropTypes.bool,
      navItem: _react2['default'].PropTypes.bool,
      navDropdown: _react2['default'].PropTypes.bool,
      /**
       * You can use a custom element for this component
       */
      componentClass: _utilsCustomPropTypes2['default'].elementType,
      href: _react2['default'].PropTypes.string,
      target: _react2['default'].PropTypes.string,
      /**
       * Defines HTML button type Attribute
       * @type {("button"|"reset"|"submit")}
       */
      type: _react2['default'].PropTypes.oneOf(_ButtonInput2['default'].types)
    },
  
    getDefaultProps: function getDefaultProps() {
      return {
        active: false,
        block: false,
        bsClass: 'button',
        bsStyle: 'default',
        disabled: false,
        navItem: false,
        navDropdown: false
      };
    },
  
    render: function render() {
      var classes = this.props.navDropdown ? {} : this.getBsClassSet();
      var renderFuncName = undefined;
  
      classes = _extends({
        active: this.props.active,
        'btn-block': this.props.block
      }, classes);
  
      if (this.props.navItem) {
        return this.renderNavItem(classes);
      }
  
      renderFuncName = this.props.href || this.props.target || this.props.navDropdown ? 'renderAnchor' : 'renderButton';
  
      return this[renderFuncName](classes);
    },
  
    renderAnchor: function renderAnchor(classes) {
  
      var Component = this.props.componentClass || 'a';
      var href = this.props.href || '#';
      classes.disabled = this.props.disabled;
  
      return _react2['default'].createElement(
        Component,
        _extends({}, this.props, {
          href: href,
          className: _classnames2['default'](this.props.className, classes),
          role: 'button' }),
        this.props.children
      );
    },
  
    renderButton: function renderButton(classes) {
      var Component = this.props.componentClass || 'button';
  
      return _react2['default'].createElement(
        Component,
        _extends({}, this.props, {
          type: this.props.type || 'button',
          className: _classnames2['default'](this.props.className, classes) }),
        this.props.children
      );
    },
  
    renderNavItem: function renderNavItem(classes) {
      var liClasses = {
        active: this.props.active
      };
  
      return _react2['default'].createElement(
        'li',
        { className: _classnames2['default'](liClasses) },
        this.renderAnchor(classes)
      );
    }
  });
  
  exports['default'] = Button;
  module.exports = exports['default'];