'use strict';

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

var _immutable = require('immutable');

var _constants = require('../../constants');

exports.default = function () {
  var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (0, _immutable.Map)({ isOpen: false });
  var action = arguments[1];

  switch (action.type) {
    case _constants.TOGGLE_SIDEBAR:
      return state.set('isOpen', !state.get('isOpen'));
    case _constants.SET_SIDEBAR_STIMULUS_IS_SHOWING:
      return state.set(action.payload.stimulusId, action.payload.bool);
    default:
      return state;
  }
};