"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.TableFoldersUniDriver = TableFoldersUniDriver;
exports.default = void 0;
var _ToolbarCollectionErrorStateUni = require("../ErrorState/ToolbarCollectionErrorState.uni.driver");
var _CollectionEmptyStateUni = require("../EmptyState/CollectionEmptyState.uni.driver");
var _CollectionToolbarUni = require("../CollectionToolbar/CollectionToolbar.uni.driver");
var _AppliedFiltersTagListUni = require("../AppliedFiltersTagList/AppliedFiltersTagList.uni.driver");
var _TableUni = _interopRequireDefault(require("../Table/Table.uni.driver"));
var _SummaryBarUni = require("../SummaryBar/SummaryBar.uni.driver");
var _CollectionPremiumEmptyStateUni = require("../EmptyState/CollectionPremiumEmptyState.uni.driver");
var _CollectionNoResultsStateUni = require("../EmptyState/CollectionNoResultsState.uni.driver");
function TableFoldersUniDriver(base, body) {
  const toolbarBase = () => base.$('[data-hook="collection-toolbar"]');
  const toolbar = () => (0, _CollectionToolbarUni.CollectionToolbarUniDriver)(toolbarBase(), body);
  const table = (0, _TableUni.default)(base, body);
  const loadingStateExists = () => base.$('[data-hook="placeholder-states-loading-state"]').exists();
  const getSummaryBar = () => (0, _SummaryBarUni.SummaryBarUniDriver)(base, body);
  const getEmptyStateByDataHook = (dataHook = 'collection-empty-state') => (0, _CollectionEmptyStateUni.CollectionEmptyStateUniDriver)(base.$(`[data-hook="${dataHook}"]`), body);
  const getPremiumEmptyStateByDataHook = dataHook => (0, _CollectionPremiumEmptyStateUni.CollectionPremiumEmptyStateUniDriver)(base.$(`[data-hook="${dataHook}"]`), body);
  const getNoResultsStateByDataHook = (dataHook = 'collection-empty-state') => (0, _CollectionNoResultsStateUni.CollectionNoResultsStateUniDriver)(base.$(`[data-hook="${dataHook}"]`), body);
  return {
    ...table,
    toolbar: () => toolbar(),
    getErrorStateByDataHook: (dataHook = 'placeholder-states-error-state') => (0, _ToolbarCollectionErrorStateUni.ToolbarCollectionErrorStateUniDriver)(base.$(`[data-hook="${dataHook}"]`), body),
    /** Get collection empty state within the table that by a specific data hook */
    getEmptyStateByDataHook,
    /** Get premium empty state within the table that by a specific data hook */
    getPremiumEmptyStateByDataHook,
    /** Get collection no results state within the table that by a specific data hook */
    getNoResultsStateByDataHook,
    loadingStateExists,
    folderIconExistsAt: async (row, col = 0) => (await table.getRowByIndex(row).$$('td').get(col)).$('[data-hook="folder-icon"]').exists(),
    avatarExistsAt: async (row, col) => (await table.getRowByIndex(row).$$('td').get(col)).$('[data-hook="item-avatar"]').exists(),
    subToolbar: () => (0, _AppliedFiltersTagListUni.AppliedFiltersTagListUniDriver)(base.$('[data-hook="collection-table-sub-toolbar"]'), body),
    /**
     * Gets collection summary bar
     */
    getSummaryBar
  };
}
var _default = exports.default = TableFoldersUniDriver;
//# sourceMappingURL=TableFolders.uni.driver.js.map