"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var static_testkit_exports = {};
__export(static_testkit_exports, {
  createStaticToolbarTestkit: () => createStaticToolbarTestkit
});
module.exports = __toCommonJS(static_testkit_exports);
var import_wix_rich_content_common = require("./../../../../wix-rich-content-common/index.js");
var import__ = require("../index.js");
const createStaticToolbarTestkit = (getBase, createStaticToolbarPluginTestkits) => {
  const getStaticToolbar = () => getBase().$((0, import_wix_rich_content_common.dataHook)(import__.STATIC_TOOLBAR_DATA_HOOK));
  return {
    exists: async () => {
      return getStaticToolbar().exists();
    },
    waitForElement: async () => {
      const staticToolbar = getStaticToolbar();
      await staticToolbar.wait();
      return staticToolbar;
    },
    getButtonsAmount: async () => {
      const buttons = getStaticToolbar().$$("button");
      return await buttons.count();
    },
    scrollToElementByIndex: async (index) => {
      const button = getStaticToolbar().$$("button").get(index);
      if (!button) {
        throw new Error(`Static toolbar doesn't have a button at index ${index}`);
      }
      await button.scrollIntoView?.();
    },
    plugins: createStaticToolbarPluginTestkits(getStaticToolbar)
  };
};
//# sourceMappingURL=static.testkit.js.map
