import { baseUniDriverFactory } from '../../../../unidriver';
import { CustomModalLayoutUniDriver, TagUniDriver, SearchUniDriver, AddItemUniDriver, ListItemEditableUniDriver, TextButtonUniDriver, FormFieldUniDriver, IconButtonUniDriver, MessageModalLayoutUniDriver, FloatingNotificationUniDriver, } from '@wix/design-system/dist/testkit/unidriver';
export function ManageTagsModalUniDriver(base, body) {
    const modalBase = () => body.$(`[data-hook="manage-tags-modal-layout"]`);
    const getManageTagsModal = () => CustomModalLayoutUniDriver(modalBase(), body);
    const exists = () => getManageTagsModal().exists();
    const getModalTitle = () => getManageTagsModal().getTitleText();
    const getTags = () => body.$$(`[data-hook="manage-tags-modal-tag"]`);
    const getTagsCount = () => getTags().count();
    const getTagByIdx = (idx) => TagUniDriver(getTags().get(idx), body);
    const getTagById = (tagId) => TagUniDriver(body.$(`[id="${tagId}"]`), body);
    const getTagRows = () => body.$$(`[data-hook="manage-tags-modal-tag-row"]`);
    const getTagRowByIdx = (idx) => getTagRows().get(idx);
    const clickTagRenameButtonByIdx = (idx) => IconButtonUniDriver(getTagRowByIdx(idx).$(`[data-hook="manage-tags-modal-tag-action-edit"]`), body).click();
    const clickTagDeleteButtonByIdx = (idx) => IconButtonUniDriver(getTagRowByIdx(idx).$(`[data-hook="manage-tags-modal-tag-action-delete"]`), body).click();
    const getCreateBtnDriver = () => TextButtonUniDriver(body.$(`[data-hook="manage-tags-modal-create-btn"]`), body);
    const getNotificationDriver = () => FloatingNotificationUniDriver(body.$(`[data-hook="manage-tags-modal-notification"]`), body);
    const getNotificationButtonExists = () => body
        .$(`[data-hook="manage-tags-modal-notification"]`)
        .$(`[data-hook="floating-notification-text-button"]`)
        .exists();
    const clickCloseButton = async () => {
        await getManageTagsModal().clickCloseButton();
    };
    const getSearchDriver = () => SearchUniDriver(body.$('[data-hook="manage-tags-modal-search"]'), body);
    const getAddItem = () => AddItemUniDriver(body.$(`[data-hook="manage-tags-modal-list-add"]`), body);
    const getFormField = () => FormFieldUniDriver(body.$(`[data-hook="manage-tags-modal-tag-form-field"]`), body);
    const getListItemEditable = () => ListItemEditableUniDriver(body.$(`[data-hook="manage-tags-modal-tag-editable"]`), body);
    const getMessageModalLayout = () => MessageModalLayoutUniDriver(body.$(`[data-hook="manage-tags-modal-confirm-delete-modal"]`), body);
    return {
        ...baseUniDriverFactory(base),
        exists,
        getTagsCount,
        getTagByIdx,
        getTagById,
        getModalTitle,
        getCreateBtnDriver,
        getNotificationDriver,
        getNotificationButtonExists,
        clickCloseButton,
        getSearchDriver,
        getAddItem,
        getFormField,
        getListItemEditable,
        clickTagRenameButtonByIdx,
        clickTagDeleteButtonByIdx,
        getTagRows,
        getMessageModalLayout,
    };
}
//# sourceMappingURL=ManageTagsModal.uni.driver.js.map