"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.listenFocusOut = exports.makeFocusOutListener = void 0;
function makeFocusOutListener(listener) {
    return (component) => {
        return listenFocusOut(component, listener);
    };
}
exports.makeFocusOutListener = makeFocusOutListener;
function listenFocusOut(component, listener) {
    const { $element } = component;
    const focusInListener = (_event) => {
        const { relatedTarget } = _event;
        listener({ relatedTarget }, _event);
    };
    $element.addEventListener('focusout', focusInListener);
    return () => {
        $element.removeEventListener('focusout', focusInListener);
    };
}
exports.listenFocusOut = listenFocusOut;
//# sourceMappingURL=focusout.js.map