"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ojDateTimePicker = exports.OjDateTimePicker = void 0;
const __1 = require("../../");
const OjDateTimePicker_1 = require("./OjDateTimePicker");
Object.defineProperty(exports, "OjDateTimePicker", { enumerable: true, get: function () { return OjDateTimePicker_1.OjDateTimePicker; } });
/**
 * Retrieve an instance of [OjDateTimePicker](../classes/elements.OjDateTimePicker.html).
 * @example
 * ```javascript
 * import { ojDateTimePicker } from '@oracle/oraclejet-webdriver/elements';
 * const el = await ojDateTimePicker(driver, By.id('my-oj-date-time-picker'));
 * ```
 * @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 ojDateTimePicker(driver, by) {
    const webEl = await driver.findElement(by);
    // Check that the element is of type OjDateTimePicker
    if (!(webEl instanceof OjDateTimePicker_1.OjDateTimePicker)) {
        const tagName = await webEl.getTagName();
        let supplemental = '';
        if (webEl.constructor.name === 'OjDateTimePicker') {
            supplemental = 'You likely have multiple installations of this package.';
        }
        throw Error(`ojDateTimePicker(${by}) created ${webEl.constructor.name} for <${tagName}>, but expected ${OjDateTimePicker_1.OjDateTimePicker.name}. ${supplemental}`);
    }
    return webEl;
}
exports.ojDateTimePicker = ojDateTimePicker;
(0, __1.register)('oj-date-time-picker', OjDateTimePicker_1.OjDateTimePicker);
//# sourceMappingURL=index.js.map