/*!
 * Built by ShiftSoftware
 * Copyright (c)
 */
export function parentsWithTag(root, tag) {
    const matchedParents = [];
    let current = root;
    while (current) {
        if (current.nodeType === Node.ELEMENT_NODE) {
            const el = current;
            if (el.tagName.toLowerCase().startsWith(tag) && el !== root)
                matchedParents.push(el);
        }
        if (current.parentNode)
            current = current.parentNode;
        else if (current.host)
            current = current.host;
        else
            break;
    }
    return matchedParents;
}
