/* @oracle/oraclejet-preact: undefined */
'use strict';

var Layer = require('./Layer-2352de5e.js');

const getLogicalParent = (node) => {
    if (node && Object.prototype.hasOwnProperty.call(node, Layer.LOGICAL_PARENT)) {
        const layerElement = node;
        return layerElement[Layer.LOGICAL_PARENT];
    }
    return undefined;
};
const isLogicalAncestor = (ancestorNode, node) => {
    let parentNode = node;
    while (parentNode) {
        if (parentNode === ancestorNode) {
            return true;
        }
        const logicalParent = getLogicalParent(parentNode);
        if (logicalParent) {
            parentNode = logicalParent;
        }
        else {
            parentNode = parentNode.parentNode;
        }
    }
    return false;
};

exports.isLogicalAncestor = isLogicalAncestor;
//# sourceMappingURL=popupUtils-79b1d484.js.map
