import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
import * as __WEBPACK_EXTERNAL_MODULE__useGetAriaLabelOfModal_mjs__ from "./useGetAriaLabelOfModal.mjs";
function useSetAriaLabelForModal(visible) {
    const { getAriaLabel } = (0, __WEBPACK_EXTERNAL_MODULE__useGetAriaLabelOfModal_mjs__.useGetAriaLabelOfModal)();
    (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
        if (visible) setTimeout(()=>{
            const wrappers = [
                ...document.querySelectorAll('.ant-modal-content')
            ];
            const masks = [
                ...document.querySelectorAll('.ant-modal-wrap')
            ];
            const currentMask = masks[masks.length - 1];
            const currentWrapper = wrappers[wrappers.length - 1];
            if (currentMask) {
                currentMask.setAttribute('role', 'button');
                currentMask.setAttribute('aria-label', getAriaLabel('mask'));
            }
            if (currentWrapper) {
                currentWrapper.setAttribute('role', 'button');
                currentWrapper.setAttribute('data-testid', getAriaLabel());
                currentWrapper.setAttribute('aria-label', getAriaLabel());
            }
        });
    }, [
        getAriaLabel,
        visible
    ]);
}
export { useSetAriaLabelForModal };
