import inputDriverFactory from '../Input/Input.driver';
import { DATA_HOOKS } from './constants';
const rangeDriverFactory = ({ element, eventTrigger }) => {
    const getElementByDataHook = el => dataHook => el.querySelector(`[data-hook='${dataHook}']`);
    const label = () => getElementByDataHook(element)(DATA_HOOKS.label);
    const input = () => getElementByDataHook(element)(DATA_HOOKS.inputWrapper);
    const firstInputElement = () => getElementByDataHook(input().childNodes[0])(DATA_HOOKS.inputElement);
    const lastInputElement = () => getElementByDataHook(input().childNodes[1])(DATA_HOOKS.inputElement);
    return {
        ...inputDriverFactory({ element }),
        getInput: input,
        clickFirstInput: () => {
            eventTrigger.click(firstInputElement());
            eventTrigger.focus(firstInputElement());
        },
        clickLastInput: () => {
            eventTrigger.click(lastInputElement());
            eventTrigger.focus(lastInputElement());
        },
        hasInput: () => !!input().childNodes[0],
        getLabel: label,
        hasLabel: () => !!label,
    };
};
export default rangeDriverFactory;
//# sourceMappingURL=Range.driver.js.map