'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)({});
  var action = arguments[1];

  switch (action.type) {
    case _constants.SCROLL_TO_COMPONENT:
      return state.set('scrolledComponentKey', action.payload).set('scrollingFocus', action.scrollingFocus);
    case _constants.CLEAR_SCROLLED_COMPONENT:
      return state.set('scrolledComponentKey', null).set('scrollingFocus', null);
    default:
      return state;
  }
};