'use strict';

var index = require('./index-Bc25FxCt.js');

/**
 * Wait for the component has been rendered.
 *
 * @param {HTMLStencilElement} componentRef - The reference to the component that needs to be rendered.
 * @returns {Promise<unknown>} A promise that resolves when the component has been rendered.
 */
const waitForComponentDidRender = async (componentRef) => {
    return new Promise((resolve) => {
        const observer = new index.Observer(isAcceptableComponentDidRender.bind(null), () => {
            index.ChangeManager.unregister(index.domNodeSubjectFactory.getSubject(componentRef, index.VegaInternalComponentDidRender), observer);
            resolve(null);
        });
        index.ChangeManager.register(index.domNodeSubjectFactory.getSubject(componentRef, index.VegaInternalComponentDidRender), observer);
    });
};
/**
 * Determines whether the observer should accept changes.
 *
 * @returns {boolean} Always returns true in the current implementation.
 */
const isAcceptableComponentDidRender = () => {
    return true;
};

exports.waitForComponentDidRender = waitForComponentDidRender;
