text: 'use strict';
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  
  var _react = require('react');
  
  var _react2 = _interopRequireDefault(_react);
  
  var _Const = require('./Const');
  
  var _Const2 = _interopRequireDefault(_Const);
  
  var _classnames = require('classnames');
  
  var _classnames2 = _interopRequireDefault(_classnames);
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  
  var _default = {
    renderReactSortCaret: function renderReactSortCaret(order) {
      var orderClass = (0, _classnames2.default)('order', {
        'dropup': order === _Const2.default.SORT_ASC
      });
      return _react2.default.createElement(
        'span',
        { className: orderClass },
        _react2.default.createElement('span', { className: 'caret', style: { margin: '10px 5px' } })
      );
    },
    isFunction: function isFunction(obj) {
      return obj && typeof obj === 'function';
    },
    getScrollBarWidth: function getScrollBarWidth() {
      var inner = document.createElement('p');
      inner.style.width = '100%';
      inner.style.height = '200px';
  
      var outer = document.createElement('div');
      outer.style.position = 'absolute';
      outer.style.top = '0px';
      outer.style.left = '0px';
      outer.style.visibility = 'hidden';
      outer.style.width = '200px';
      outer.style.height = '150px';
      outer.style.overflow = 'hidden';
      outer.appendChild(inner);
  
      document.body.appendChild(outer);
      var w1 = inner.getBoundingClientRect().width;
      outer.style.overflow = 'scroll';
      var w2 = inner.getBoundingClientRect().width;
  
      if (w1 === w2) w2 = outer.clientWidth;
  
      document.body.removeChild(outer);
  
      return w1 - w2;
    },
    canUseDOM: function canUseDOM() {
      return typeof window !== 'undefined' && typeof window.document !== 'undefined';
    },
  
  
    // We calculate an offset here in order to properly fetch the indexed data,
    // despite the page start index not always being 1
    getNormalizedPage: function getNormalizedPage(pageStartIndex, page) {
      pageStartIndex = this.getFirstPage(pageStartIndex);
      if (page === undefined) page = pageStartIndex;
      var offset = Math.abs(_Const2.default.PAGE_START_INDEX - pageStartIndex);
      return page + offset;
    },
    getFirstPage: function getFirstPage(pageStartIndex) {
      return pageStartIndex !== undefined ? pageStartIndex : _Const2.default.PAGE_START_INDEX;
    },
    renderColGroup: function renderColGroup(columns, selectRow) {
      var expandColumnOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  
      var selectRowHeader = null;
      var expandRowHeader = null;
      var isSelectRowDefined = selectRow.mode === _Const2.default.ROW_SELECT_SINGLE || selectRow.mode === _Const2.default.ROW_SELECT_MULTI;
      if (isSelectRowDefined) {
        var style = {
          width: selectRow.columnWidth || '30px',
          minWidth: selectRow.columnWidth || '30px'
        };
        if (!selectRow.hideSelectColumn) {
          selectRowHeader = _react2.default.createElement('col', { key: 'select-col', style: style });
        }
      }
      if (expandColumnOptions.expandColumnVisible) {
        var _style = {
          width: expandColumnOptions.columnWidth || 30,
          minWidth: expandColumnOptions.columnWidth || 30
        };
        expandRowHeader = _react2.default.createElement('col', { key: 'expand-col', style: _style });
      }
      var theader = columns.map(function (column, i) {
        var style = {
          display: column.hidden ? 'none' : null
        };
        if (column.width) {
          var width = !isNaN(column.width) ? column.width + 'px' : column.width;
          style.width = width;
          /** add min-wdth to fix user assign column width
          not eq offsetWidth in large column table **/
          style.minWidth = width;
        }
        return _react2.default.createElement('col', { style: style, key: i, className: column.className });
      });
  
      return _react2.default.createElement(
        'colgroup',
        null,
        expandColumnOptions.expandColumnVisible && expandColumnOptions.expandColumnBeforeSelectColumn && expandRowHeader,
        selectRowHeader,
        expandColumnOptions.expandColumnVisible && !expandColumnOptions.expandColumnBeforeSelectColumn && expandRowHeader,
        theader
      );
    }
  }; /* eslint react/display-name: 0 */
  
  exports.default = _default;
  ;
  
  var _temp = function () {
    if (typeof __REACT_HOT_LOADER__ === 'undefined') {
      return;
    }
  
    __REACT_HOT_LOADER__.register(_default, 'default', '/Users/allen/Node/react-bootstrap-table-new/react-bootstrap-table/src/util.js');
  }();
  
  ;