import { resolveFinalValueInKeyframes } from "./dist-es-utils-resolve-value.js";
import { motionValue } from "./dist-es-value-index.js";
import { resolveVariant } from "./dist-es-render-utils-resolve-dynamic-variants.js";
function setMotionValue(visualElement, key, value) {
  if (visualElement.hasValue(key)) {
    visualElement.getValue(key).set(value);
  } else {
    visualElement.addValue(key, motionValue(value));
  }
}
function setTarget(visualElement, definition) {
  const resolved = resolveVariant(visualElement, definition);
  let { transitionEnd = {}, transition = {}, ...target } = resolved || {};
  target = { ...target, ...transitionEnd };
  for (const key in target) {
    const value = resolveFinalValueInKeyframes(target[key]);
    setMotionValue(visualElement, key, value);
  }
}
export {
  setTarget
};
//# sourceMappingURL=dist-es-render-utils-setters.js.map
