'use strict';

var isControllingVariants = require('../../../../../../../motion-dom@12.38.0/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.js');
var isVariantLabel = require('../../../../../../../motion-dom@12.38.0/node_modules/motion-dom/dist/es/render/utils/is-variant-label.js');

function getCurrentTreeVariants(props, context) {
    if (isControllingVariants.isControllingVariants(props)) {
        const { initial, animate } = props;
        return {
            initial: initial === false || isVariantLabel.isVariantLabel(initial)
                ? initial
                : undefined,
            animate: isVariantLabel.isVariantLabel(animate) ? animate : undefined,
        };
    }
    return props.inherit !== false ? context : {};
}

exports.getCurrentTreeVariants = getCurrentTreeVariants;
