"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.graphReducer = void 0;
const graph_updated_1 = require("../actions/graph-updated");
const user_input_1 = require("../actions/user-input");
const user_input_2 = require("./user-input");
const graph_status_1 = require("./graph-status");
const defaultState = {
    services: [],
    packages: [],
    nodeSelected: null,
    scheduler: null,
};
exports.graphReducer = (state = defaultState, action) => {
    switch (action.type) {
        case user_input_1.DOWN_ARROW_PRESSED:
        case user_input_1.UP_ARROW_PRESSED:
        case user_input_1.ENTER_PRESSED:
        case user_input_1.ESCAPE_PRESSED:
        case user_input_1.Q_PRESSED:
            return user_input_2.userInputs(state, action);
        case graph_updated_1.SET_SCHEDULER:
        case graph_updated_1.SET_GRAPH:
        case graph_updated_1.UPDATE_PACKAGE_STATUS:
        case graph_updated_1.UPDATE_SERVICE_STATUS:
            return graph_status_1.graphStatus(state, action);
        default:
            return state;
    }
};
//# sourceMappingURL=graph.js.map