"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const DOMutils = require("./utils/DOMutils.js");
const allAffected = require("./utils/all-affected.js");
const array = require("./utils/array.js");
const getActiveElement = require("./utils/getActiveElement.js");
var focusInFrame = function(frame) {
  return frame === document.activeElement;
};
var focusInsideIframe = function(topNode) {
  return Boolean(array.toArray(topNode.querySelectorAll("iframe")).some(function(node) {
    return focusInFrame(node);
  }));
};
var focusInside = function(topNode) {
  var activeElement = document && getActiveElement.getActiveElement();
  if (!activeElement || activeElement.dataset && activeElement.dataset.focusGuard) {
    return false;
  }
  return allAffected.getAllAffectedNodes(topNode).some(function(node) {
    return DOMutils.contains(node, activeElement) || focusInsideIframe(node);
  });
};
exports.focusInside = focusInside;
//# sourceMappingURL=focusInside.js.map
