"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Functional_1 = require("../../../../Class/Functional");
const Async_1 = require("../../../../types/interface/async/Async");
const clone_1 = require("../../../../util/clone");
const _ids_1 = require("../../../_ids");
class Bundle extends Functional_1.Functional {
    constructor(system) {
        super({
            i: ['graph', 'opt'],
            o: ['bundle'],
        }, {
            input: {
                graph: {
                    ref: true,
                },
            },
        }, system, _ids_1.ID_BUNDLE);
    }
    f({ graph, opt }, done) {
        graph = (0, Async_1.Async)(graph, ['G'], this.__system.async);
        const { snapshot = false } = opt;
        graph.$getBundle({ deep: snapshot }, (bundle) => {
            bundle = (0, clone_1.clone)(bundle);
            done({
                bundle,
            });
        });
    }
}
exports.default = Bundle;
//# sourceMappingURL=index.js.map