text: 'use strict';
  
  Object.defineProperty(exports, '__esModule', {
      value: true
  });
  
  var _extends = Object.assign || function (target) {
          for (var i = 1; i < arguments.length; i++) {
              var source = arguments[i];
              for (var key in source) {
                  if (Object.prototype.hasOwnProperty.call(source, key)) {
                      target[key] = source[key];
                  }
              }
          }
          return target;
      };
  
  function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : {'default': obj};
  }
  
  var _react = require('react');
  
  var _react2 = _interopRequireDefault(_react);
  
  var _BootstrapMixin = require('./BootstrapMixin');
  
  var _BootstrapMixin2 = _interopRequireDefault(_BootstrapMixin);
  
  var _classnames = require('classnames');
  
  var _classnames2 = _interopRequireDefault(_classnames);
  
  var ListGroupItem = _react2['default'].createClass({
      displayName: 'ListGroupItem',
  
      mixins: [_BootstrapMixin2['default']],
  
      propTypes: {
          bsStyle: _react2['default'].PropTypes.oneOf(['danger', 'info', 'success', 'warning']),
          className: _react2['default'].PropTypes.string,
          active: _react2['default'].PropTypes.any,
          disabled: _react2['default'].PropTypes.any,
          header: _react2['default'].PropTypes.node,
          listItem: _react2['default'].PropTypes.bool,
          onClick: _react2['default'].PropTypes.func,
          eventKey: _react2['default'].PropTypes.any,
          href: _react2['default'].PropTypes.string,
          target: _react2['default'].PropTypes.string
      },
  
      getDefaultProps: function getDefaultProps() {
          return {
              bsClass: 'list-group-item'
          };
      },
  
      render: function render() {
          var classes = this.getBsClassSet();
  
          classes.active = this.props.active;
          classes.disabled = this.props.disabled;
  
          if (this.props.href || this.props.onClick) {
              return this.renderAnchor(classes);
          } else if (this.props.listItem) {
              return this.renderLi(classes);
          } else {
              return this.renderSpan(classes);
          }
      },
  
      renderLi: function renderLi(classes) {
          return _react2['default'].createElement(
              'li',
              _extends({}, this.props, {className: (0, _classnames2['default'])(this.props.className, classes)}),
              this.props.header ? this.renderStructuredContent() : this.props.children
          );
      },
  
      renderAnchor: function renderAnchor(classes) {
          return _react2['default'].createElement(
              'a',
              _extends({}, this.props, {
                  className: (0, _classnames2['default'])(this.props.className, classes)
              }),
              this.props.header ? this.renderStructuredContent() : this.props.children
          );
      },
  
      renderSpan: function renderSpan(classes) {
          return _react2['default'].createElement(
              'span',
              _extends({}, this.props, {className: (0, _classnames2['default'])(this.props.className, classes)}),
              this.props.header ? this.renderStructuredContent() : this.props.children
          );
      },
  
      renderStructuredContent: function renderStructuredContent() {
          var header = undefined;
          if (_react2['default'].isValidElement(this.props.header)) {
              header = (0, _react.cloneElement)(this.props.header, {
                  key: 'header',
                  className: (0, _classnames2['default'])(this.props.header.props.className, 'list-group-item-heading')
              });
          } else {
              header = _react2['default'].createElement(
                  'h4',
                  {key: 'header', className: 'list-group-item-heading'},
                  this.props.header
              );
          }
  
          var content = _react2['default'].createElement(
              'p',
              {key: 'content', className: 'list-group-item-text'},
              this.props.children
          );
  
          return [header, content];
      }
  });
  
  exports['default'] = ListGroupItem;
  module.exports = exports['default'];