'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = require('babel-runtime/helpers/createClass');

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = require('babel-runtime/helpers/inherits');

var _inherits3 = _interopRequireDefault(_inherits2);

var _dec, _class, _class2, _temp2;

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _propTypes = require('prop-types');

var _propTypes2 = _interopRequireDefault(_propTypes);

var _redux = require('redux');

var _reactImmutableProptypes = require('react-immutable-proptypes');

var _reactImmutableProptypes2 = _interopRequireDefault(_reactImmutableProptypes);

var _lib = require('@instructure/ui-themeable/lib');

var _lib2 = _interopRequireDefault(_lib);

var _makeScrollable = require('../../../../../../common/components/shared/functionality/makeScrollable');

var _makeScrollable2 = _interopRequireDefault(_makeScrollable);

var _TakeItem = require('../../TakeItem');

var _TakeItem2 = _interopRequireDefault(_TakeItem);

var _theme = require('./theme');

var _theme2 = _interopRequireDefault(_theme);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var styles = {
  template: function template(theme) {
    return '/*  imported from styles.css  */\n\n._1LGf_Z7teqbVtYGYPFO02d {\n  border-top: ' + theme.itemWrapperBorderWidth + ' solid ' + theme.itemWrapperBorderColor + ';\n}\n\n._1LGf_Z7teqbVtYGYPFO02d:first-child {\n  border-color: transparent;\n}\n\n._1LGf_Z7teqbVtYGYPFO02d {\n  display: flex;\n}\n\n._2Mlh2IdCkNOV2POEpWOpTW {\n  flex: 1 1 auto;\n}\n\n@media screen and (--phoneBreakPoint) {\n  .sblcuvy3-saaqqzVX-qnp {\n    flex: 0 0 1rem;\n\n    border-left: ' + theme.phoneConnectingLinesBorderWidth + ' dotted;\n    border-bottom: ' + theme.phoneConnectingLinesBorderWidth + ' dotted;\n    border-color: ' + theme.phoneConnectingLinesBorderColor + ';\n\n    margin-top: ' + theme.phoneConnectingLinesMargin + ';\n    margin-right: ' + theme.phoneConnectingLinesMargin + ';\n    height: 2rem;\n    width: 1.5rem;\n  }\n}\n';
  },
  'itemWrapper': '_1LGf_Z7teqbVtYGYPFO02d',
  'stimulusItem': '_2Mlh2IdCkNOV2POEpWOpTW',
  'connectingLines': 'sblcuvy3-saaqqzVX-qnp'
};
var StimulusItems = (_dec = (0, _lib2.default)(_theme2.default, styles), _dec(_class = (_temp2 = _class2 = function (_Component) {
  (0, _inherits3.default)(StimulusItems, _Component);

  function StimulusItems() {
    var _ref;

    var _temp, _this, _ret;

    (0, _classCallCheck3.default)(this, StimulusItems);

    for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = StimulusItems.__proto__ || Object.getPrototypeOf(StimulusItems)).call.apply(_ref, [this].concat(args))), _this), _this.renderItem = function (sessionItem) {
      return _react2.default.createElement(
        'div',
        { key: sessionItem.position, className: styles.itemWrapper },
        _react2.default.createElement('div', { className: styles.connectingLines }),
        _react2.default.createElement(
          'div',
          { className: styles.stimulusItem },
          _react2.default.createElement(_TakeItem2.default, {
            quizSessionId: _this.props.quizSessionId,
            sessionItem: sessionItem,
            scrollToInfo: _this.props.scrollToInfo
          })
        )
      );
    }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);
  }

  (0, _createClass3.default)(StimulusItems, [{
    key: 'render',
    value: function render() {
      return _react2.default.createElement(
        'div',
        null,
        this.props.items.toArray().map(this.renderItem)
      );
    }
  }]);
  StimulusItems.displayName = 'StimulusItems'
  ;
  return StimulusItems;
}(_react.Component), _class2.propTypes = {
  items: _reactImmutableProptypes2.default.listOf(_reactImmutableProptypes2.default.record).isRequired,
  quizSessionId: _propTypes2.default.string.isRequired,
  scrollToInfo: _propTypes2.default.func.isRequired
}, _temp2)) || _class);
exports.default = (0, _redux.compose)(_makeScrollable2.default)(StimulusItems);