import { SidePanelUniDriver } from '@wix/design-system/dist/testkit/unidriver';
export function ArchivedItemsPanelUniDriver(base, body, dataHook = 'custom-columns') {
    // Main container with overlay
    const containerBase = () => base.$(`[data-hook="${dataHook}-archived-items-panel-container"]`);
    // The SidePanel inside the container - use the design system driver
    const panelBase = () => containerBase().$(`[data-hook="${dataHook}-archived-items-panel"]`);
    const panel = () => SidePanelUniDriver(panelBase(), body);
    const list = () => panelBase().$(`[data-hook="${dataHook}-archived-items-list"]`);
    // Get all TableListItem elements (archived items) - direct children divs
    // Must use full selector path, not chained
    const getArchivedPanelItems = () => panelBase().$$(`[data-hook="${dataHook}-archived-items-list"] > div`);
    const getItemByIdBase = (id) => list().$(`[data-hook="${dataHook}-archived-item-${id}"]`);
    const getItemMenuBase = (id) => panelBase().$(`[data-hook="${dataHook}-archived-item-options-${id}"]`);
    const getItemMenuTrigger = (id) => getItemMenuBase(id).$(`[data-hook="${dataHook}-archived-item-options-trigger"]`);
    // Note: The 'Restore' and 'Delete' buttons appear in the body via PopoverMenu when an item's menu is opened.
    // Thus clickItemMenuTrigger must be invoked before so only the buttons on the relevant item's menu can be clicked
    const getItemRestoreButton = () => body.$(`[data-hook="${dataHook}-archived-item-options-restore"]`);
    const getItemDeleteButton = () => body.$(`[data-hook="${dataHook}-archived-item-options-delete"]`);
    return {
        getContainer: () => containerBase(),
        exists: () => containerBase().exists(),
        isVisible: () => containerBase().exists(),
        getTitle: () => panel().getTitleText(),
        getSubtitle: () => panel().getSubtitleText(),
        backButtonExists: () => panel().isBackButtonExists(),
        clickBackButton: () => panel().clickBack(),
        clickCloseButton: () => panel().clickClose(),
        getItemsCount: () => getArchivedPanelItems().count(),
        getItemText: (id) => getItemByIdBase(id).$(`[data-hook="${dataHook}-archived-item-label"]`).text(),
        clickItemMenuTrigger: (id) => getItemMenuTrigger(id).click(),
        clickRestore: () => getItemRestoreButton().click(),
        clickDelete: () => getItemDeleteButton().click(),
    };
}
//# sourceMappingURL=ArchivedItemsPanel.uni.driver.js.map