import { useEffect, useRef } from 'react';
export const useIframeClickBlock = () => {
    const iframeClickRef = useRef({});
    useEffect(() => {
        const onMessage = (e) => {
            const data = e.data;
            if (!data || typeof data !== 'object')
                return;
            if (data.type === 'IFRAME_CLICK' && data.id) {
                iframeClickRef.current[data.id] = true;
                setTimeout(() => {
                    iframeClickRef.current[data.id] = false;
                }, 0);
            }
        };
        window.addEventListener('message', onMessage);
        return () => window.removeEventListener('message', onMessage);
    }, []);
    return iframeClickRef;
};
//# sourceMappingURL=useIframeClickBlock.js.map