var selector = 'a[href], area[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex="0"], [contenteditable], audio[controls], video[controls], summary, [tabindex^="0"], [tabindex^="1"], [tabindex^="2"], [tabindex^="3"], [tabindex^="4"], [tabindex^="5"], [tabindex^="6"], [tabindex^="7"], [tabindex^="8"], [tabindex^="9"]';
export default function focusable(node) {
  return ['matches', 'msMatchesSelector', 'webkitMatchesSelector', 'mozMatchesSelector'].some(function (method) {
    return method in node && node[method](selector);
  });
}
export function findFirstFocusableElement(node) {
  return node.querySelector(selector);
}
export function findFocusableElements(node) {
  return Array.from(node.querySelectorAll(selector));
}
export function findFocusableParent(node, root) {
  var parentElement = node.parentElement;

  if (parentElement) {
    if (focusable(parentElement)) {
      return parentElement;
    }

    if (root && parentElement === root) {
      return null;
    }

    return findFocusableParent(parentElement, root);
  }

  return null;
}
//# sourceMappingURL=focusable.js.map
