/*!
 * Copyright (c) 2026 Vertex Software LLC. All rights reserved.
 */
import { UUID } from "@vertexvis/utils";
import { BaseInteractionHandler } from "./baseInteractionHandler";
export class MultiElementInteractionHandler extends BaseInteractionHandler {
    constructor() {
        super(...arguments);
        this.registeredExternalElements = {};
    }
    registerAdditionalElement(external) {
        const id = UUID.create();
        const disposable = this.addEventListenersToElement(external);
        this.registeredExternalElements[id] = disposable;
        return disposable;
    }
    deregisterAdditionalElementById(id) {
        const externalElement = this.registeredExternalElements[id];
        externalElement.dispose();
        this.registeredExternalElements = Object.fromEntries(Object.entries(this.registeredExternalElements).filter(([key]) => key !== id));
    }
    deregisterAllListeners() {
        Object.keys(this.registeredExternalElements).forEach((id) => this.deregisterAdditionalElementById(id));
    }
}
//# sourceMappingURL=multiElementInteractionHandler.js.map
