import { dataHook } from "./../../wix-rich-content-common/index.js";
import {
  LIST_ITEM_SELECT_PREFIX,
  LIST_ITEM_SELECT_SUBTITLE,
  LIST_ITEM_SELECT_SUFFIX,
  LIST_ITEM_SELECT_TITLE
} from "./data-hooks.js";
const createListItemSelectDriver = (getBase) => {
  const title = getBase().$(dataHook(LIST_ITEM_SELECT_TITLE));
  const subtitle = getBase().$(dataHook(LIST_ITEM_SELECT_SUBTITLE));
  const prefix = getBase().$(dataHook(LIST_ITEM_SELECT_PREFIX));
  const suffix = getBase().$(dataHook(LIST_ITEM_SELECT_SUFFIX));
  return {
    exists: getBase().exists,
    click: getBase().click,
    isSelected: async () => await getBase().attr("aria-selected") === "true",
    isDisabled: async () => await getBase().attr("aria-disabled") === "true",
    getTitle: title.text,
    getSubtitle: async () => {
      if (await subtitle.exists()) {
        return subtitle.text();
      }
      return null;
    },
    prefixExists: prefix.exists,
    suffixExists: suffix.exists
  };
};
export {
  createListItemSelectDriver
};
//# sourceMappingURL=list-item-select-uni-driver.js.map
