'use strict';

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

var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');

function focusedPathReducer(state, action) {
  switch (action.type) {
    case 'reset':
      {
        return [];
      }
    case 'set_initial_focus':
      {
        return [0];
      }
    case 'change_last_focus':
      {
        return [].concat(_rollupPluginBabelHelpers.toConsumableArray(state.slice(0, -1)), [action.value]);
      }
    case 'add_focus':
      {
        return [].concat(_rollupPluginBabelHelpers.toConsumableArray(state), [action.value]);
      }
    case 'return_prev_focus':
      {
        return _rollupPluginBabelHelpers.toConsumableArray(state.slice(0, -1));
      }
    default:
      {
        return state;
      }
  }
}

exports.focusedPathReducer = focusedPathReducer;
