var _createMergedDefaultS;
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import createAction from "./utils/createMetaAction";
import createMergedDefaultStateReducer from "./utils/createMergedDefaultStateReducer";

//this determines whether or not to
var initialSupportedTypes = {
  parts: true,
  features: true,
  translations: true,
  primers: true,
  cutsites: true,
  orfs: true,
  warnings: true,
  assemblyPieces: true,
  lineageAnnotations: true
};

// ------------------------------------
// Actions
// ------------------------------------
export var annotationSupportToggle = createAction("annotationSupportToggle");
//eg: annotationSupportToggle('features')
export var annotationSupportOn = createAction("annotationSupportOn");
export var annotationSupportOff = createAction("annotationSupportOff");

// ------------------------------------
// Reducer
// ------------------------------------
export default createMergedDefaultStateReducer((_createMergedDefaultS = {}, _createMergedDefaultS[annotationSupportToggle] = function (state, payload) {
  var _extends2;
  return _extends({}, state, (_extends2 = {}, _extends2[payload] = !state[payload], _extends2));
}, _createMergedDefaultS[annotationSupportOn] = function (state, payload) {
  var _extends3;
  return _extends({}, state, (_extends3 = {}, _extends3[payload] = false, _extends3));
}, _createMergedDefaultS[annotationSupportOff] = function (state, payload) {
  var _extends4;
  return _extends({}, state, (_extends4 = {}, _extends4[payload] = true, _extends4));
}, _createMergedDefaultS), initialSupportedTypes);

// import createAction from "./utils/createMetaAction";
// import createMergedDefaultStateReducer from "./utils/createMergedDefaultStateReducer";

// //this determines whether or not to
// const initialSupportedTypes = {
//   parts: true,
//   features: true,
//   translations: true,
//   primers: true,
//   cutsites: true,
//   orfs: true,
//   warnings: true,
//   assemblyPieces: true,
//   lineageAnnotations: true
// };

// // ------------------------------------
// // Actions
// // ------------------------------------
// export const annotationSupportToggle = createAction(
//   "ANNOTATION_SUPPORT_TOGGLE"
// );

// export const annotationSupportOn = createAction("ANNOTATION_SUPPORT_ON");
// export const annotationSupportOff = createAction("ANNOTATION_SUPPORT_OFF");

// export default function (state = initialSupportedTypes, action) {
//   switch (action.type) {
//     case "ANNOTATION_SUPPORT_TOGGLE":
//       return {
//         ...state,
//         [action.payload]: !state[action.payload]
//       };
//     case "ANNOTATION_SUPPORT_ON":
//       return {
//         ...state,
//         [action.payload]: true
//       };
//     case "ANNOTATION_SUPPORT_OFF":
//       return {
//         ...state,
//         [action.payload]: false
//       };
//     default:
//       if (action.mergeStateDeep) {
//         return {
//           ...initialSupportedTypes,
//           ...state
//         };
//       }
//       return state;
//   }
// }