"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isRefMerge = void 0;
const spec_1 = require("../../spec/util/spec");
const object_1 = require("../../util/object");
function isRefMerge(graph, mergeSpec) {
    let isRef = false;
    if ((0, spec_1.getMergePinCount)(mergeSpec) > 0) {
        const sampleMergeUnitId = (0, object_1.getObjSingleKey)(mergeSpec);
        const sampeMergeUnit = mergeSpec[sampleMergeUnitId];
        const sampleMergeUnitType = (0, object_1.getObjSingleKey)(sampeMergeUnit);
        const sampleMergeUnitPinId = (0, object_1.getObjSingleKey)(sampeMergeUnit[sampleMergeUnitType]);
        const unit = graph.getUnit(sampleMergeUnitId);
        const ref = unit.isPinRef(sampleMergeUnitType, sampleMergeUnitPinId);
        if (ref) {
            isRef = true;
        }
    }
    return isRef;
}
exports.isRefMerge = isRefMerge;
//# sourceMappingURL=isRefMerge.js.map