import { tooltipLegacyDriverFactory as coreTooltipDriverFactory } from '../Tooltip/Tooltip.driver';
import { circularProgressBarCoreDriverFactory } from './CircularProgressBarCore/CircularProgressBarCore.driver';
import { dataHooks } from './constants';
const circularProgressBarDriverFactory = ({ element, eventTrigger, wrapper, }) => {
    const getElementByDataHook = dataHook => element.querySelector(`[data-hook='${dataHook}']`);
    const createTooltipDriver = () => coreTooltipDriverFactory({
        element: getElementByDataHook(dataHooks.tooltip),
        wrapper,
        eventTrigger,
    });
    const coreProgressBarDriver = circularProgressBarCoreDriverFactory({
        element,
        wrapper,
        eventTrigger,
    });
    return {
        ...coreProgressBarDriver,
        isErrorIconShown: () => !!getElementByDataHook(dataHooks.errorIcon),
        isSuccessIconShown: () => !!getElementByDataHook(dataHooks.successIcon),
        getSize: () => getElementByDataHook(dataHooks.circularProgressBar).getAttribute('data-size'),
        getTooltipErrorMessage: () => {
            const tooltipDriver = createTooltipDriver();
            return tooltipDriver.getTooltipText();
        },
        hasSkin: skinName => getElementByDataHook(dataHooks.circularProgressBar).getAttribute('data-skin') === skinName,
    };
};
export default circularProgressBarDriverFactory;
//# sourceMappingURL=CircularProgressBar.driver.js.map