define(["require", "exports", "../focus", "./getDocument"], function (require, exports, focus_1, getDocument_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getFirstVisibleElementFromSelector = getFirstVisibleElementFromSelector; /** * Gets the first visible element that matches the given selector * @param selector - The selector to use to find potential visible elements * @returns The first visible element that matches the selector, otherwise undefined * * @public */ function getFirstVisibleElementFromSelector(selector) { var doc = (0, getDocument_1.getDocument)(); var elements = doc.querySelectorAll(selector); // Iterate across the elements that match the selector and return the first visible/non-hidden element return Array.from(elements).find(function (element) { var _a; return (0, focus_1.isElementVisibleAndNotHidden)(element, (_a = doc.defaultView) !== null && _a !== void 0 ? _a : undefined); }); } }); //# sourceMappingURL=getFirstVisibleElementFromSelector.js.map