'use strict';

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

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, _temp; /* eslint "react/no-string-refs": "warn" */


var _react = require('react');

var _react2 = _interopRequireDefault(_react);

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

var _reactImmutableProptypes2 = _interopRequireDefault(_reactImmutableProptypes);

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

var _lib2 = _interopRequireDefault(_lib);

var _RichContentRenderer = require('quiz-interactions/lib/components/common/components/rce/RichContentRenderer');

var _RichContentRenderer2 = _interopRequireDefault(_RichContentRenderer);

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

var _makeScrollable2 = _interopRequireDefault(_makeScrollable);

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

var _theme2 = _interopRequireDefault(_theme);

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

// ================================
// renders the quiz instructions on
// the Preview and Take pages
// ================================

var styles = {
  template: function template(theme) {
    return '/*  imported from styles.css  */\n\n._2JDhO5IA9hXzerMIUs5BPe {\n  position: relative;\n  width: 100%;\n  box-sizing: border-box;\n  padding-left: ' + theme.wrapperPadding + ';\n}\n\n._2JDhO5IA9hXzerMIUs5BPe::after {\n  clear: both;\n  content: "";\n  display: table;\n}\n\n[dir="ltr"] ._2JDhO5IA9hXzerMIUs5BPe::after {\n  clear: both;\n}\n\n[dir="rtl"] ._2JDhO5IA9hXzerMIUs5BPe::after {\n  clear: both;\n}\n\n._1dfnReNXOTf9WV6UskEmoU {\n  font-size: ' + theme.textFontSize + ';\n}\n';
  },
  'wrapper': '_2JDhO5IA9hXzerMIUs5BPe',
  'text': '_1dfnReNXOTf9WV6UskEmoU'
};
var QuizInstructions = exports.QuizInstructions = (_dec = (0, _lib2.default)(_theme2.default, styles), _dec(_class = (_temp = _class2 = function (_Component) {
  (0, _inherits3.default)(QuizInstructions, _Component);

  function QuizInstructions() {
    (0, _classCallCheck3.default)(this, QuizInstructions);
    return (0, _possibleConstructorReturn3.default)(this, (QuizInstructions.__proto__ || Object.getPrototypeOf(QuizInstructions)).apply(this, arguments));
  }

  (0, _createClass3.default)(QuizInstructions, [{
    key: 'render',
    value: function render() {
      return _react2.default.createElement(
        'div',
        { ref: 'instructionsPreview', className: styles.wrapper },
        _react2.default.createElement(_RichContentRenderer2.default, {
          customStyles: styles.text,
          content: this.props.quiz.instructions
        })
      );
    }
  }]);
  QuizInstructions.displayName = 'QuizInstructions'
  ;
  return QuizInstructions;
}(_react.Component), _class2.propTypes = {
  quiz: _reactImmutableProptypes2.default.record.isRequired
}, _temp)) || _class);
exports.default = (0, _makeScrollable2.default)(QuizInstructions);