"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread"));

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));

var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));

var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));

var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));

var _immutable = require("immutable");

var _Bank = _interopRequireDefault(require("../../../../common/records/Bank"));

var _Item2 = _interopRequireDefault(require("../../../../common/records/Item"));

var _QuizEntry2 = _interopRequireDefault(require("../../../../common/records/QuizEntry"));

var _Stimulus = _interopRequireDefault(require("../../../../common/records/Stimulus"));

var _default = {
  permutations: [{
    sidebarOpen: [false, true]
  }],
  renderProps: function renderProps(props) {
    var smallStimulusEntry = new FakeQuizEntry(new _Stimulus.default({
      title: 'Small Stimulus'
    }), {
      id: 'small-stimulus',
      nestedEntryCount: 2
    });
    var largeStimulusEntry = new FakeQuizEntry(new _Stimulus.default({
      title: 'Large Stimulus'
    }), {
      id: 'large-stimulus',
      nestedEntryCount: 6
    });
    return {
      componentProps: {
        connectDropTarget: function connectDropTarget(el) {
          return el;
        },
        quizEntries: (0, _immutable.List)([new FakeQuizEntry(new FakeItem()), new FakeQuizEntry(new _Bank.default({
          itemEntryCount: 3
        })), smallStimulusEntry].concat((0, _toConsumableArray2.default)(smallStimulusEntry.getNestedEntries().toArray()), [largeStimulusEntry], (0, _toConsumableArray2.default)(largeStimulusEntry.getNestedEntries().toArray()))),
        screenreaderNotification: Function.prototype,
        scrollToItem: Function.prototype,
        toggleSidebar: Function.prototype
      }
    };
  }
};
exports.default = _default;

var FakeItem =
/*#__PURE__*/
function (_Item) {
  (0, _inherits2.default)(FakeItem, _Item);

  function FakeItem() {
    (0, _classCallCheck2.default)(this, FakeItem);
    return (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(FakeItem).apply(this, arguments));
  }

  (0, _createClass2.default)(FakeItem, [{
    key: "getInteractionType",
    value: function getInteractionType() {
      return {
        name: 'Interaction Type Name'
      };
    }
  }]);
  return FakeItem;
}(_Item2.default);

var FakeQuizEntry =
/*#__PURE__*/
function (_QuizEntry) {
  (0, _inherits2.default)(FakeQuizEntry, _QuizEntry);

  function FakeQuizEntry(entry) {
    var _this;

    var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

    var _ref$nestedEntryCount = _ref.nestedEntryCount,
        nestedEntryCount = _ref$nestedEntryCount === void 0 ? 0 : _ref$nestedEntryCount,
        params = (0, _objectWithoutProperties2.default)(_ref, ["nestedEntryCount"]);
    (0, _classCallCheck2.default)(this, FakeQuizEntry);
    var id = (++quizEntryId).toString();
    _this = (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(FakeQuizEntry).call(this, (0, _objectSpread2.default)({
      id: id,
      entryType: entry.constructor.name.replace(/^Fake/, '')
    }, params)));
    _this._entry = entry;
    var nestedEntries = [];

    for (var i = 0; i < nestedEntryCount; i++) {
      nestedEntries.push(new FakeQuizEntry(new FakeItem(), {
        stimulusQuizEntryId: id
      }));
    }

    _this._nestedEntries = (0, _immutable.List)(nestedEntries);
    return _this;
  }

  (0, _createClass2.default)(FakeQuizEntry, [{
    key: "getEntry",
    value: function getEntry() {
      return this._entry;
    }
  }, {
    key: "getNestedEntries",
    value: function getNestedEntries() {
      return this._nestedEntries;
    }
  }]);
  return FakeQuizEntry;
}(_QuizEntry2.default);

var quizEntryId = 0;