{"size": 7097, "ext": "js", "max_stars_repo_path": "src/vendor/jquerykeyframe.js", "max_stars_repo_name": "gorgos/Highstakes-SmartRoulette", "max_stars_repo_stars_event_min_datetime": "2018-07-20T15:21:04.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-21T00:07:07.000Z", "max_issues_repo_path": "src/vendor/jquerykeyframe.js", "max_issues_repo_name": "gorgos/RouletteContract", "max_issues_repo_issues_event_min_datetime": "2018-04-12T12:52:25.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-17T08:03:36.000Z", "max_forks_repo_path": "src/vendor/jquerykeyframe.js", "max_forks_repo_name": "gorgos/RouletteContract", "max_forks_repo_forks_event_min_datetime": "2018-12-12T03:55:36.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-26T14:16:00.000Z"}
{"max_stars_count": 13, "max_issues_count": 4, "max_forks_count": 4, "avg_line_length": 30.2, "max_line_length": 502, "alphanum_fraction": 0.61039876}
/* eslint-disable */
import $ from 'jquery';

(function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}return e})()({1:[function(require,module,exports){
"use strict";

var _core = _interopRequireDefault(require("@keyframes/core"));

function _interopRequireDefault(obj) {
  return obj && obj.__esModule ? obj : {
    default: obj
  };
}

(function () {
  var doForEach = function doForEach($el, cb) {
    $el.each(function (index, elem) {
      if (elem.Keyframes) {
        cb(elem.Keyframes);
      } else {
        elem.Keyframes = new _core.default(elem);
        cb(elem.Keyframes);
      }
    });
  };

  $.keyframe = {
    isSupported: _core.default.isSupported,
    generate: _core.default.generate,
    define: _core.default.define
  };

  $.fn.resetKeyframe = function (cb) {
    doForEach(this, function (kf) {
      return kf.reset(cb);
    });
  };

  $.fn.pauseKeyframe = function () {
    doForEach(this, function (kf) {
      return kf.pause();
    });
  };

  $.fn.resumeKeyframe = function () {
    doForEach(this, function (kf) {
      return kf.resume();
    });
  };

  $.fn.playKeyframe = function (frameOptions, callback) {
    doForEach(this, function (kf) {
      return kf.play(frameOptions, callback);
    });
  };
})();

},{"@keyframes/core":2}],2:[function(require,module,exports){
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }

var Keyframes =
/*#__PURE__*/
function () {
  function Keyframes(elem) {
    _classCallCheck(this, Keyframes);

    this.elem = elem;
  }

  _createClass(Keyframes, [{
    key: "isSupported",
    value: function isSupported() {
      return document.body.style.animationName !== undefined;
    }
  }, {
    key: "reset",
    value: function reset(callback) {
      this.removeEvents();
      this.elem.style.animationPlayState = 'running';
      this.elem.style.animation = 'none';

      if (callback) {
        setTimeout(callback, 0);
      }
    }
  }, {
    key: "pause",
    value: function pause() {
      this.elem.style.animationPlayState = 'paused';
    }
  }, {
    key: "resume",
    value: function resume() {
      this.elem.style.animationPlayState = 'running';
    }
  }, {
    key: "play",
    value: function play(frameOptions, callback) {
      var _this = this;

      if (this.elem.style.animationName === frameOptions.name) {
        this.reset(function () {
          return _this.play(frameOptions, callback);
        });
        return this;
      }

      var animObjToStr = function animObjToStr(obj) {
        var newObj = Object.assign({}, {
          duration: '0s',
          timingFunction: 'ease',
          delay: '0s',
          iterationCount: 1,
          direction: 'normal',
          fillMode: 'forwards'
        }, obj);
        return [newObj.name, newObj.duration, newObj.timingFunction, newObj.delay, newObj.iterationCount, newObj.direction, newObj.fillMode].join(' ');
      };

      var animationcss = '';

      if (frameOptions.constructor === Array) {
        var frameOptionsStrings = [];

        for (var i = 0; i < frameOptions.length; i += 1) {
          frameOptionsStrings.push(typeof frameOptions[i] === 'string' ? frameOptions[i] : animObjToStr(frameOptions[i]));
        }

        animationcss = frameOptionsStrings.join(', ');
      } else if (typeof frameOptions === 'string') {
        animationcss = frameOptions;
      } else {
        animationcss = animObjToStr(frameOptions);
      }

      var addEvent = function addEvent(type, eventCallback) {
        var listenerName = "".concat(type, "Listener");

        _this.elem.removeEventListener(type, _this[listenerName]);

        _this[listenerName] = eventCallback;

        _this.elem.addEventListener(type, _this[listenerName]);
      };

      this.elem.style.animationPlayState = 'running';
      this.elem.style.animation = animationcss;
      this.frameOptions = frameOptions;
      addEvent('animationiteration', callback || frameOptions.complete);
      addEvent('animationend', callback || frameOptions.complete);
      return this;
    }
  }, {
    key: "removeEvents",
    value: function removeEvents() {
      this.elem.removeEventListener('animationiteration', this.animationiterationListener);
      this.elem.removeEventListener('animationend', this.animationendListener);
    }
  }], [{
    key: "createKeyframeTag",
    value: function createKeyframeTag(id, css) {
      var elem = document.createElement('style');
      elem.innerHTML = css;
      elem.setAttribute('class', 'keyframe-style');
      elem.setAttribute('id', id);
      elem.setAttribute('type', 'text/css');
      document.getElementsByTagName('head')[0].appendChild(elem);
    }
  }, {
    key: "generate",
    value: function generate(frameData) {
      var frameName = frameData.name || '';
      var css = "@keyframes ".concat(frameName, " {");

      for (var key in frameData) {
        if (key !== 'name' && key !== 'media' && key !== 'complete') {
          css += "".concat(key, " {");

          for (var property in frameData[key]) {
            css += "".concat(property, ":").concat(frameData[key][property], ";");
          }

          css += '}';
        }
      }

      if (frameData.media) {
        css = "@media ".concat(frameData.media, "{").concat(css, "}");
      }

      var kfTagId = "Keyframes".concat(frameName);
      var frameStyle = document.getElementById(kfTagId);

      if (frameStyle) {
        frameStyle.innerHTML = css;
      } else {
        Keyframes.createKeyframeTag(kfTagId, css);
      }
    }
  }, {
    key: "define",
    value: function define(frameData) {
      if (frameData.length) {
        for (var i = 0; i < frameData.length; i += 1) {
          this.generate(frameData[i]);
        }
      } else {
        this.generate(frameData);
      }
    }
  }, {
    key: "plugin",
    value: function plugin(pluginFunc) {
      pluginFunc(Keyframes);
    }
  }]);

  return Keyframes;
}();

exports.default = Keyframes;

},{}]},{},[1]);
