Liferay.Loader.define("layout-content-page-editor-web@2.0.157/page_editor/plugins/experience/reducers/index", ['module', 'exports', 'require', '../actions', './createExperience', './deleteExperience', './selectExperience', './updateExperience', './updateExperiencesList'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.default = void 0;

    var _actions = require("../actions");

    var _createExperience = _interopRequireDefault(require("./createExperience"));

    var _deleteExperience = _interopRequireDefault(require("./deleteExperience"));

    var _selectExperience = _interopRequireDefault(require("./selectExperience"));

    var _updateExperience = _interopRequireDefault(require("./updateExperience"));

    var _updateExperiencesList = _interopRequireDefault(require("./updateExperiencesList"));

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

    /**
     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
     *
     * This library is free software; you can redistribute it and/or modify it under
     * the terms of the GNU Lesser General Public License as published by the Free
     * Software Foundation; either version 2.1 of the License, or (at your option)
     * any later version.
     *
     * This library is distributed in the hope that it will be useful, but WITHOUT
     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
     * details.
     */
    var reducer = function reducer(state, action) {
      var nextState = state;

      switch (action.type) {
        case _actions.CREATE_SEGMENTS_EXPERIENCE:
          nextState = (0, _createExperience.default)(nextState, {
            fragmentEntryLinks: action.payload.fragmentEntryLinks,
            layoutData: action.payload.layoutData,
            segmentsExperience: action.payload.segmentsExperience
          });
          nextState = (0, _selectExperience.default)(nextState, {
            segmentsExperienceId: action.payload.segmentsExperience.segmentsExperienceId
          });
          break;

        case _actions.DELETE_SEGMENTS_EXPERIENCE:
          nextState = (0, _deleteExperience.default)(nextState, {
            segmentsExperienceId: action.payload.segmentsExperienceId
          });
          break;

        case _actions.SELECT_SEGMENTS_EXPERIENCE:
          nextState = (0, _selectExperience.default)(nextState, {
            segmentsExperienceId: action.payload.segmentsExperienceId
          });
          break;

        case _actions.UPDATE_SEGMENTS_EXPERIENCE:
          nextState = (0, _updateExperience.default)(nextState, {
            updatedExperience: action.payload
          });
          break;

        case _actions.UPDATE_SEGMENTS_EXPERIENCES_LIST:
          nextState = (0, _updateExperiencesList.default)(nextState, {
            availableSegmentsExperiences: action.payload.availableSegmentsExperiences
          });
          break;

        default:
          break;
      }

      return nextState;
    };

    var _default = reducer;
    exports.default = _default;
    //# sourceMappingURL=index.js.map
  }
});
//# sourceMappingURL=index.js.map