import { invariant } from "../../errors.js";
import { noop } from "../../noop.js";
import { anticipate } from "../anticipate.js";
import { backOut, backInOut, backIn } from "../back.js";
import { circOut, circInOut, circIn } from "../circ.js";
import { cubicBezier } from "../cubic-bezier.js";
import { easeOut, easeInOut, easeIn } from "../ease.js";
import { isBezierDefinition } from "./is-bezier-definition.js";
const easingLookup = {
  linear: noop,
  easeIn,
  easeInOut,
  easeOut,
  circIn,
  circInOut,
  circOut,
  backIn,
  backInOut,
  backOut,
  anticipate
};
const isValidEasing = (easing) => {
  return typeof easing === "string";
};
const easingDefinitionToFunction = (definition) => {
  if (isBezierDefinition(definition)) {
    invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`);
    const [x1, y1, x2, y2] = definition;
    return cubicBezier(x1, y1, x2, y2);
  } else if (isValidEasing(definition)) {
    invariant(easingLookup[definition] !== void 0, `Invalid easing type '${definition}'`);
    return easingLookup[definition];
  }
  return definition;
};
export {
  easingDefinitionToFunction
};
//# sourceMappingURL=map.js.map
