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