"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
var target = typeof window === "undefined" ? global : window;
var vendors = ["webkit", "ms", "moz", "o"];
exports.raf = target.requestAnimationFrame;
exports.caf = target.cancelAnimationFrame;
if (!exports.raf || !exports.caf) {
  vendors.some(function(prefix) {
    exports.raf = target[prefix + "RequestAnimationFrame"];
    exports.caf = target[prefix + "CancelAnimationFrame"] || target[prefix + "CancelRequestAnimationFrame"];
    return exports.raf && exports.caf;
  });
  if (!exports.raf || !exports.caf) {
    var lastTime_1 = 0;
    exports.raf = function(cb) {
      var currentTime = Date.now();
      var diff = Math.max(0, 16 - (currentTime - lastTime_1));
      var timer = setTimeout(function() {
        cb();
        lastTime_1 = currentTime + diff;
      }, diff);
      return timer;
    };
    exports.caf = function(timer) {
      clearTimeout(timer);
    };
  }
}
exports.raf = exports.raf.bind(target);
exports.caf = exports.caf.bind(target);
//# sourceMappingURL=raf.js.map
