"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ojColorPalette = exports.OjColorPalette = void 0;
const __1 = require("../../");
const OjColorPalette_1 = require("./OjColorPalette");
Object.defineProperty(exports, "OjColorPalette", { enumerable: true, get: function () { return OjColorPalette_1.OjColorPalette; } });
/**
 * Retrieve an instance of [OjColorPalette](../classes/elements.OjColorPalette.html).
 * @example
 * ```javascript
 * import { ojColorPalette } from '@oracle/oraclejet-webdriver/elements';
 * const el = await ojColorPalette(driver, By.id('my-oj-color-palette'));
 * ```
 * @param driver A WebDriver/WebElement instance from where the element will be
 * searched. If WebDriver is passed, the element will be searched globally in the
 * document. If WebElement is passed, the search will be relative to this element.
 * @param by The locator with which to find the element
 */
async function ojColorPalette(driver, by) {
    const webEl = await driver.findElement(by);
    // Check that the element is of type OjColorPalette
    if (!(webEl instanceof OjColorPalette_1.OjColorPalette)) {
        const tagName = await webEl.getTagName();
        let supplemental = '';
        if (webEl.constructor.name === 'OjColorPalette') {
            supplemental = 'You likely have multiple installations of this package.';
        }
        throw Error(`ojColorPalette(${by}) created ${webEl.constructor.name} for <${tagName}>, but expected ${OjColorPalette_1.OjColorPalette.name}. ${supplemental}`);
    }
    return webEl;
}
exports.ojColorPalette = ojColorPalette;
(0, __1.register)('oj-color-palette', OjColorPalette_1.OjColorPalette);
//# sourceMappingURL=index.js.map