class IframeManager {
    constructor(options) {
        this.iframes = new WeakMap();
        this.mutationCb = options.mutationCb;
    }
    addIframe(iframeEl) {
        this.iframes.set(iframeEl, true);
    }
    addLoadListener(cb) {
        this.loadListener = cb;
    }
    attachIframe(iframeEl, childSn, mirror) {
        var _a;
        this.mutationCb({
            adds: [
                {
                    parentId: mirror.getId(iframeEl),
                    nextId: null,
                    node: childSn,
                },
            ],
            removes: [],
            texts: [],
            attributes: [],
            isAttachIframe: true,
        });
        (_a = this.loadListener) === null || _a === void 0 ? void 0 : _a.call(this, iframeEl);
    }
}

export { IframeManager };
