import { getStatePath, getSubstatePath } from '../../utils/paths';
import { getEntityType } from './get-entity-type';
export const getParentState = (path) => {
    var _a;
    if (!path) {
        return undefined;
    }
    const type = getEntityType(path);
    if (type === 'state' || type === 'substate') {
        return undefined;
    }
    return (_a = getSubstatePath(path)) !== null && _a !== void 0 ? _a : getStatePath(path);
};
