"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.makeDragOverListener = makeDragOverListener;
exports.listenDragOver = listenDragOver;
const pointer_1 = require("../pointer");
function makeDragOverListener(listener, _global = false) {
    return (component) => {
        return listenDragOver(component, listener, _global);
    };
}
function listenDragOver(component, listener, _global = false) {
    const { $element } = component;
    const dragOverListener = (_event) => {
        const { $context } = component;
        const event = {
            ...(0, pointer_1.applyContextTransformToPointerEvent)($context, _event),
            dataTransfer: null,
        };
        listener(event, _event);
    };
    $element.addEventListener('dragover', dragOverListener, _global);
    return () => {
        $element.removeEventListener('dragover', dragOverListener, _global);
    };
}
//# sourceMappingURL=dragover.js.map