"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GRAPH_EVENT_TO_EXTRACT = exports.GRAPH_EVENT_TO_WATCH = void 0;
exports.watchGraphInternal = watchGraphInternal;
const callAll_1 = require("../../util/call/callAll");
const watchGraphAddMergeEvent_1 = require("./watchGraphAddMergeEvent");
const watchGraphAddPinToMergeEvent_1 = require("./watchGraphAddPinToMergeEvent");
const watchGraphAddUnitEvent_1 = require("./watchGraphAddUnitEvent");
const watchGraphBulkEditEvent_1 = require("./watchGraphBulkEditEvent");
const watchGraphCoverPinEvent_1 = require("./watchGraphCoverPinEvent");
const watchGraphCoverPinSetEvent_1 = require("./watchGraphCoverPinSetEvent");
const watchGraphDestroyEvent_1 = require("./watchGraphDestroyEvent");
const watchGraphExposePinEvent_1 = require("./watchGraphExposePinEvent");
const watchGraphExposePinSetEvent_1 = require("./watchGraphExposePinSetEvent");
const watchGraphForkEvent_1 = require("./watchGraphForkEvent");
const watchGraphMetadataEvent_1 = require("./watchGraphMetadataEvent");
const watchGraphMoveSubComponentRoot_1 = require("./watchGraphMoveSubComponentRoot");
const watchGraphMoveSubgraphIntoEvent_1 = require("./watchGraphMoveSubgraphIntoEvent");
const watchGraphMoveSubgraphOutEvent_1 = require("./watchGraphMoveSubgraphOutEvent");
const watchGraphPlugPinEvent_1 = require("./watchGraphPlugPinEvent");
const watchGraphRemoveMergeEvent_1 = require("./watchGraphRemoveMergeEvent");
const watchGraphRemovePinFromMergeEvent_1 = require("./watchGraphRemovePinFromMergeEvent");
const watchGraphRemoveUnitPinDataEvent_1 = require("./watchGraphRemoveUnitPinDataEvent");
const watchGraphReorderSubComponent_1 = require("./watchGraphReorderSubComponent");
const watchGraphSetForkEvent_1 = require("./watchGraphSetForkEvent");
const watchGraphSetNameEvent_1 = require("./watchGraphSetNameEvent");
const watchGraphSetPinSetDefaultIgnored_1 = require("./watchGraphSetPinSetDefaultIgnored");
const watchGraphSetPinSetFunctionalEvent_1 = require("./watchGraphSetPinSetFunctionalEvent");
const watchGraphSetPinSetIdEvent_1 = require("./watchGraphSetPinSetIdEvent");
const watchGraphSetUnitIdEvent_1 = require("./watchGraphSetUnitIdEvent");
const watchGraphSetUnitPinConstantEvent_1 = require("./watchGraphSetUnitPinConstantEvent");
const watchGraphSetUnitPinDataEvent_1 = require("./watchGraphSetUnitPinDataEvent");
const watchGraphSetUnitPinIgnoredEvent_1 = require("./watchGraphSetUnitPinIgnoredEvent");
const watchGraphSetUnitPinSetIdEvent_1 = require("./watchGraphSetUnitPinSetIdEvent");
const watchGraphUnplugPinEvent_1 = require("./watchGraphUnplugPinEvent");
exports.GRAPH_EVENT_TO_WATCH = {
    fork: watchGraphForkEvent_1.watchGraphForkEvent,
    set_name: watchGraphSetNameEvent_1.watchGraphSetNameEvent,
    add_unit: watchGraphAddUnitEvent_1.watchGraphAddUnitEvent,
    remove_unit: watchGraphAddUnitEvent_1.watchGraphAddUnitEvent,
    add_merge: watchGraphAddMergeEvent_1.watchGraphAddMergeEvent,
    remove_merge: watchGraphRemoveMergeEvent_1.watchGraphRemoveMergeEvent,
    add_pin_to_merge: watchGraphAddPinToMergeEvent_1.watchGraphAddPinToMergeEvent,
    remove_pin_from_merge: watchGraphRemovePinFromMergeEvent_1.watchGraphRemovePinFromMergeEvent,
    expose_pin: watchGraphExposePinEvent_1.watchGraphExposePinEvent,
    cover_pin: watchGraphCoverPinEvent_1.watchGraphCoverPinEvent,
    expose_pin_set: watchGraphExposePinSetEvent_1.watchGraphExposePinSetEvent,
    cover_pin_set: watchGraphCoverPinSetEvent_1.watchGraphCoverPinSetEvent,
    plug_pin: watchGraphPlugPinEvent_1.watchGraphPlugPinEvent,
    unplug_pin: watchGraphUnplugPinEvent_1.watchGraphUnplugPinEvent,
    move_subgraph_into: watchGraphMoveSubgraphIntoEvent_1.watchGraphMoveSubgraphIntoEvent,
    move_subgraph_out_of: watchGraphMoveSubgraphOutEvent_1.watchGraphMoveSubgraphOutOfEvent,
    reorder_sub_component: watchGraphReorderSubComponent_1.watchGraphReorderSubComponent,
    move_sub_component_root: watchGraphMoveSubComponentRoot_1.watchGraphMoveSubComponentRoot,
    set_unit_pin_constant: watchGraphSetUnitPinConstantEvent_1.watchGraphSetUnitPinConstant,
    set_unit_pin_set_id: watchGraphSetUnitPinSetIdEvent_1.watchGraphSetUnitPinSetId,
    set_unit_pin_ignored: watchGraphSetUnitPinIgnoredEvent_1.watchGraphSetUnitPinIgnored,
    set_pin_set_functional: watchGraphSetPinSetFunctionalEvent_1.watchGraphSetUnitPinFunctional,
    set_pin_set_id: watchGraphSetPinSetIdEvent_1.watchGraphSetPinSetId,
    set_pin_set_default_ignored: watchGraphSetPinSetDefaultIgnored_1.watchGraphSetPinSetDefaultIgnored,
    set_unit_pin_data: watchGraphSetUnitPinDataEvent_1.watchGraphSetUnitPinData,
    remove_unit_pin_data: watchGraphRemoveUnitPinDataEvent_1.watchGraphRemoveUnitPinData,
    set_unit_id: watchGraphSetUnitIdEvent_1.watchGraphSetUnitIdEvent,
    bulk_edit: watchGraphBulkEditEvent_1.watchGraphBulkEditEvent,
    destroy: watchGraphDestroyEvent_1.watchGraphDestroyEvent,
    set_fork: watchGraphSetForkEvent_1.watchGraphSetForkEvent,
    set_metadata: watchGraphMetadataEvent_1.watchGraphSetMetadataEvent,
};
exports.GRAPH_EVENT_TO_EXTRACT = {
    fork: watchGraphForkEvent_1.extractForkEventData,
    set_name: watchGraphSetNameEvent_1.extractSetNameEventData,
    add_unit: watchGraphAddUnitEvent_1.extractAddUnitEventData,
    remove_unit: watchGraphAddUnitEvent_1.extractAddUnitEventData,
    add_merge: watchGraphAddMergeEvent_1.extractAddMergeEventData,
    remove_merge: watchGraphRemoveMergeEvent_1.extractRemoveMergeEventData,
    add_pin_to_merge: watchGraphAddPinToMergeEvent_1.extractAddPinToMergeEventData,
    remove_pin_from_merge: watchGraphRemovePinFromMergeEvent_1.extractRemovePinFromMergeEventData,
    expose_pin: watchGraphExposePinEvent_1.extractExposePinEventData,
    cover_pin: watchGraphCoverPinEvent_1.extractCoverPinEventData,
    expose_pin_set: watchGraphExposePinSetEvent_1.extractExposePinSetEventData,
    cover_pin_set: watchGraphCoverPinSetEvent_1.extractCoverPinSetEventData,
    plug_pin: watchGraphPlugPinEvent_1.extractPlugPinEventData,
    unplug_pin: watchGraphUnplugPinEvent_1.extractUnplugPinEventData,
    move_subgraph_into: watchGraphMoveSubgraphIntoEvent_1.extractMoveSubgraphIntoEventData,
    move_subgraph_out_of: watchGraphMoveSubgraphOutEvent_1.extractMoveSubgraphOutOfEventData,
    reorder_sub_component: watchGraphReorderSubComponent_1.extractReorderSubComponentEventData,
    move_sub_component_root: watchGraphMoveSubComponentRoot_1.extractMoveSubComponentRootEventData,
    set_unit_pin_constant: watchGraphSetUnitPinConstantEvent_1.extractSetUnitPinConstantEventData,
    set_unit_pin_set_id: watchGraphSetUnitPinSetIdEvent_1.extractSetUnitPinSetIdEventData,
    set_unit_pin_ignored: watchGraphSetUnitPinIgnoredEvent_1.extractSetUnitPinIgnoredEventData,
    set_pin_set_functional: watchGraphSetPinSetFunctionalEvent_1.extractSetPinSetFunctionalEventData,
    set_pin_set_id: watchGraphSetPinSetIdEvent_1.extractSetPinSetIdEventData,
    set_pin_set_default_ignored: watchGraphSetPinSetDefaultIgnored_1.extractSetPinSetDefaultIgnoredEventData,
    set_unit_pin_data: watchGraphSetUnitPinDataEvent_1.extractSetUnitPinDataEventData,
    remove_unit_pin_data: watchGraphRemoveUnitPinDataEvent_1.extractRemoveUnitPinDataEventData,
    set_unit_id: watchGraphSetUnitIdEvent_1.extractSetUnitIdEventData,
    bulk_edit: watchGraphBulkEditEvent_1.extractBulkEditEventData,
    destroy: watchGraphDestroyEvent_1.extractDestroyEventData,
    set_fork: watchGraphSetForkEvent_1.extractSetForkEventData,
    set_metadata: watchGraphMetadataEvent_1.extractSetMetadataEventData,
};
function watchGraphInternal(graph, events, callback) {
    const all = [];
    for (const event in exports.GRAPH_EVENT_TO_WATCH) {
        if (events.includes(event)) {
            const watchEvent = exports.GRAPH_EVENT_TO_WATCH[event];
            all.push(watchEvent(event, graph, callback));
        }
    }
    const unlisten = (0, callAll_1.callAll)(all);
    return unlisten;
}
//# sourceMappingURL=watchGraphInternal.js.map