"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getSubComponentParentId = getSubComponentParentId;
exports.getComponentSubComponentParentId = getComponentSubComponentParentId;
function getSubComponentParentId(spec, unitId) {
    return getComponentSubComponentParentId(spec.component, unitId);
}
function getComponentSubComponentParentId(componentSpec, unitId) {
    const { subComponents } = componentSpec;
    for (const subComponentId in subComponents) {
        const subComponent = subComponents[subComponentId];
        const { children = [] } = subComponent;
        for (const childId of children) {
            if (childId === unitId) {
                return subComponentId;
            }
        }
    }
    return null;
}
//# sourceMappingURL=component.js.map