// returns the active element in the shadow context of the element in question.
export function getRootActiveElement(element) {
    const rootNode = element.getRootNode();
    if (rootNode instanceof ShadowRoot) {
        return rootNode.activeElement;
    }
    return document.activeElement;
}
