"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const errors = require("../motion-utils/dist-es-errors.cjs");
const noop = require("../motion-utils/dist-es-noop.cjs");
const isBezierDefinition = require("../motion-dom/dist-es-utils-is-bezier-definition.cjs");
const anticipate = require("./dist-es-easing-anticipate.cjs");
const back = require("./dist-es-easing-back.cjs");
const circ = require("./dist-es-easing-circ.cjs");
const cubicBezier = require("./dist-es-easing-cubic-bezier.cjs");
const ease = require("./dist-es-easing-ease.cjs");
const easingLookup = {
  linear: noop.noop,
  easeIn: ease.easeIn,
  easeInOut: ease.easeInOut,
  easeOut: ease.easeOut,
  circIn: circ.circIn,
  circInOut: circ.circInOut,
  circOut: circ.circOut,
  backIn: back.backIn,
  backInOut: back.backInOut,
  backOut: back.backOut,
  anticipate: anticipate.anticipate
};
const easingDefinitionToFunction = (definition) => {
  if (isBezierDefinition.isBezierDefinition(definition)) {
    errors.invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`);
    const [x1, y1, x2, y2] = definition;
    return cubicBezier.cubicBezier(x1, y1, x2, y2);
  } else if (typeof definition === "string") {
    errors.invariant(easingLookup[definition] !== void 0, `Invalid easing type '${definition}'`);
    return easingLookup[definition];
  }
  return definition;
};
exports.easingDefinitionToFunction = easingDefinitionToFunction;
//# sourceMappingURL=dist-es-easing-utils-map.cjs.map
