import { isHTMLElement } from "../../../utils/is-html-element.js";
import { memo } from "../../../../../../motion-utils/dist/es/memo.js";
const acceleratedValues = /* @__PURE__ */ new Set([
  "opacity",
  "clipPath",
  "filter",
  "transform"
  // TODO: Could be re-enabled now we have support for linear() easing
  // "background-color"
]);
const supportsWaapi = /* @__PURE__ */ memo(() => Object.hasOwnProperty.call(Element.prototype, "animate"));
function supportsBrowserAnimation(options) {
  const { motionValue, name, repeatDelay, repeatType, damping, type } = options;
  if (!isHTMLElement(motionValue?.owner?.current)) {
    return false;
  }
  const { onUpdate, transformTemplate } = motionValue.owner.getProps();
  return supportsWaapi() && name && acceleratedValues.has(name) && (name !== "transform" || !transformTemplate) && /**
   * If we're outputting values to onUpdate then we can't use WAAPI as there's
   * no way to read the value from WAAPI every frame.
   */
  !onUpdate && !repeatDelay && repeatType !== "mirror" && damping !== 0 && type !== "inertia";
}
export {
  supportsBrowserAnimation
};
//# sourceMappingURL=waapi.js.map
