Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

es6-tween

Package Overview
Dependencies
Maintainers
1
Versions
127
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

es6-tween - npm Package Compare versions

Comparing version 1.0.4 to 1.2.1

CHANGELOG.md

510

dist/Tween.js

@@ -76,3 +76,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 7);
/******/ return __webpack_require__(__webpack_require__.s = 11);
/******/ })

@@ -346,3 +346,5 @@ /************************************************************************/

// Adapted from https://github.com/michaelvillar/dynamics.js
// Credits:
// @michaelvillar for dynamics.js easing/physics
// Adapted by @dalisoft
get bezier() {

@@ -719,180 +721,29 @@ var b, d;

});
// TWEEN.js
var _tweens = [];
var _time = 0;
var isStarted = false;
var _autoPlay = false;
var _tick = void 0;
var _events = {};
var getAll = function getAll() {
return _tweens;
};
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var autoPlay = function autoPlay(state) {
_autoPlay = state;
};
var _createClass = 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var removeAll = function removeAll() {
_tweens = [];
};
var _core = __webpack_require__(4);
var emit = function emit(ev) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
var _Easing = __webpack_require__(0);
if (_events[ev] !== undefined) {
_events[ev].map(function (event) {
return event.apply(undefined, args);
});
}
};
var _Easing2 = _interopRequireDefault(_Easing);
var off = function off(ev, fn) {
if (ev === undefined || _events[ev] === undefined) {
return;
}
if (fn !== undefined) {
var eventsList = _events[name],
i = 0;
while (i < eventsList.length) {
if (eventsList[i] === fn) {
eventsList.splice(i, 1);
}
i++;
}
} else {
_events[name] = [];
}
};
var _Interpolation = __webpack_require__(1);
var add = function add(tween) {
_tweens.push(tween);
var _Interpolation2 = _interopRequireDefault(_Interpolation);
if (_autoPlay && !isStarted) {
autoStart(now());
isStarted = true;
emit('start');
}
emit('add', tween, _tweens);
};
var _clone = __webpack_require__(3);
var on = function on(ev, fn) {
if (_events[ev] === undefined) {
_events[ev] = [];
}
_events[ev].push(fn);
};
var _clone2 = _interopRequireDefault(_clone);
var once = function once(ev, fn) {
if (_events[ev] === undefined) {
_events[ev] = [];
}
on(ev, function () {
fn.apply(undefined, arguments);
off(ev);
});
};
var _joinToString = __webpack_require__(9);
var remove = function remove(tween) {
_tweens.filter(function (tweens) {
return tweens !== tween;
});
var i = 0,
tweenFind = void 0;
while (i < _tweens.length) {
tweenFind = _tweens[i];
if (tweenFind === tween) {
emit('remove', tween, _tweens);
_tweens.splice(i, 1);
}
i++;
}
};
var _joinToString2 = _interopRequireDefault(_joinToString);
var now = function now() {
return _time;
};
var _toNumber = __webpack_require__(10);
var update = function update() {
var time = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : now();
var preserve = arguments[1];
var _toNumber2 = _interopRequireDefault(_toNumber);
time = time !== undefined ? time : now();
_time = time;
emit('update', time, _tweens);
if (_tweens.length === 0) {
return false;
}
emit('realupdate', time, _tweens);
var i = 0;
while (i < _tweens.length) {
if (_tweens[i].update(time) || preserve) {
i++;
} else {
_tweens.splice(i, 1);
}
}
return true;
};
function autoStart(time) {
if (update(_time)) {
_time = time;
_tick = requestAnimationFrame(autoStart);
emit('autostart', time);
} else {
isStarted = false;
cancelAnimationFrame(_tick);
emit('stop', time);
}
}
exports.getAll = getAll;
exports.removeAll = removeAll;
exports.remove = remove;
exports.add = add;
exports.now = now;
exports.update = update;
exports.autoPlay = autoPlay;
exports.on = on;
exports.once = once;
exports.off = off;
exports.emit = emit;
/***/ }),
/* 3 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _createClass = 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _core = __webpack_require__(2);
var _Easing = __webpack_require__(0);
var _Easing2 = _interopRequireDefault(_Easing);
var _Interpolation = __webpack_require__(1);
var _Interpolation2 = _interopRequireDefault(_Interpolation);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -902,2 +753,7 @@

// Credits:
// @jkroso for string parse library
// Optimized, Extended by @dalisoft
var Number_Match_RegEx = /\s+|([A-Za-z?().,{}:""\[\]#]+)|([-+\/*%]+=)?([-+*\/%]+)?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/gi;
var Tween = function () {

@@ -1095,3 +951,3 @@ function Tween() {

this._duration = amount;
this._duration = typeof amount === "function" ? amount(this._duration) : amount;

@@ -1131,3 +987,2 @@ return this;

_valuesStart = this._valuesStart,
_valuesStartRepeat = this._valuesStartRepeat,
object = this.object;

@@ -1143,11 +998,26 @@

// Check if an Array was provided as property value
if (typeof object[property] === "number" && _valuesEnd[property] instanceof Array) {
if (_typeof(_valuesEnd[property]) === "object") {
if (Array.isArray(_valuesEnd[property])) {
if (typeof object[property] === "number") {
this._valuesEnd[property] = [object[property]].concat(_valuesEnd[property]);
} else {
var clonedTween = (0, _clone2.default)(this, { object: object[property], _valuesEnd: _valuesEnd[property] }).start().stop();
if (_valuesEnd[property].length === 0) {
continue;
this._valuesEnd[property] = clonedTween;
}
} else {
var _clonedTween = (0, _clone2.default)(this, { object: object[property], _valuesEnd: _valuesEnd[property] }).start().stop();
this._valuesEnd[property] = _clonedTween;
}
} else if (typeof _valuesEnd[property] === "string" && typeof object[property] === "string" && Number_Match_RegEx.test(object[property]) && Number_Match_RegEx.test(_valuesEnd[property])) {
// Create a local copy of the Array with the start value at the front
this._valuesEnd[property] = [object[property]].concat(_valuesEnd[property]);
var __get__Start = object[property].match(Number_Match_RegEx);
__get__Start = __get__Start.map(_toNumber2.default);
var __get__End = _valuesEnd[property].match(Number_Match_RegEx);
__get__End = __get__End.map(_toNumber2.default);
var _clonedTween2 = (0, _clone2.default)(this, { object: __get__Start, _valuesEnd: __get__End }).start().stop();
_clonedTween2.join = true; // For string tweening
this._valuesEnd[property] = _clonedTween2;
}

@@ -1161,2 +1031,8 @@

// If duplicate or non-tweening numerics matched,
// we should delete from _valuesEnd
if (object[property] === _valuesEnd[property]) {
continue;
}
this._valuesStart[property] = object[property];

@@ -1177,3 +1053,2 @@

var _isPlaying = this._isPlaying,
_onStopCallback = this._onStopCallback,
object = this.object;

@@ -1285,3 +1160,3 @@

this.update(time);
return this._object;
return this.object;
}

@@ -1305,3 +1180,2 @@ }, {

_valuesStart = this._valuesStart,
_valuesStartRepeat = this._valuesStartRepeat,
_valuesEnd = this._valuesEnd,

@@ -1341,4 +1215,15 @@ object = this.object;

if (end instanceof Array) {
if (end instanceof Tween) {
var getValue = end.get(time);
if (end.join) {
object[property] = (0, _joinToString2.default)(getValue);
} else {
object[property] = getValue;
}
} else if (Array.isArray(end)) {
object[property] = _interpolationFunction(end, value);

@@ -1423,2 +1308,35 @@ } else {

/***/ }),
/* 3 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = cloneTween;
var _Tween = __webpack_require__(2);
var _Tween2 = _interopRequireDefault(_Tween);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function cloneTween() {
var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var configs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var copyTween = new _Tween2.default({ x: 0 });
for (var config in obj) {
if (configs[config] !== undefined) {
copyTween[config] = configs[config];
} else {
copyTween[config] = obj[config];
}
}
return copyTween;
}
/***/ }),
/* 4 */

@@ -1430,2 +1348,180 @@ /***/ (function(module, exports, __webpack_require__) {

Object.defineProperty(exports, "__esModule", {
value: true
});
// TWEEN.js
var _tweens = [];
var _time = 0;
var isStarted = false;
var _autoPlay = false;
var _tick = void 0;
var _events = {};
var getAll = function getAll() {
return _tweens;
};
var autoPlay = function autoPlay(state) {
_autoPlay = state;
};
var removeAll = function removeAll() {
_tweens = [];
};
var emit = function emit(ev) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
if (_events[ev] !== undefined) {
_events[ev].map(function (event) {
return event.apply(undefined, args);
});
}
};
var off = function off(ev, fn) {
if (ev === undefined || _events[ev] === undefined) {
return;
}
if (fn !== undefined) {
var eventsList = _events[name],
i = 0;
while (i < eventsList.length) {
if (eventsList[i] === fn) {
eventsList.splice(i, 1);
}
i++;
}
} else {
_events[name] = [];
}
};
var add = function add(tween) {
_tweens.push(tween);
if (_autoPlay && !isStarted) {
autoStart(now());
isStarted = true;
emit('start');
}
emit('add', tween, _tweens);
};
var on = function on(ev, fn) {
if (_events[ev] === undefined) {
_events[ev] = [];
}
_events[ev].push(fn);
};
var once = function once(ev, fn) {
if (_events[ev] === undefined) {
_events[ev] = [];
}
on(ev, function () {
fn.apply(undefined, arguments);
off(ev);
});
};
var remove = function remove(tween) {
_tweens.filter(function (tweens) {
return tweens !== tween;
});
var i = 0,
tweenFind = void 0;
while (i < _tweens.length) {
tweenFind = _tweens[i];
if (tweenFind === tween) {
emit('remove', tween, _tweens);
_tweens.splice(i, 1);
}
i++;
}
};
var now = function now() {
return _time;
};
var update = function update() {
var time = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : now();
var preserve = arguments[1];
time = time !== undefined ? time : now();
_time = time;
emit('update', time, _tweens);
if (_tweens.length === 0) {
return false;
}
emit('realupdate', time, _tweens);
var i = 0;
while (i < _tweens.length) {
if (_tweens[i].update(time) || preserve) {
i++;
} else {
_tweens.splice(i, 1);
}
}
return true;
};
function autoStart(time) {
if (update(_time)) {
_time = time;
_tick = requestAnimationFrame(autoStart);
emit('autostart', time);
} else {
isStarted = false;
cancelAnimationFrame(_tick);
emit('stop', time);
}
}
exports.getAll = getAll;
exports.removeAll = removeAll;
exports.remove = remove;
exports.add = add;
exports.now = now;
exports.update = update;
exports.autoPlay = autoPlay;
exports.on = on;
exports.once = once;
exports.off = off;
exports.emit = emit;
/***/ }),
/* 5 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
if (Array.isArray === undefined) {
Array.isArray = function (arrayLike) {
return arrayLike !== undefined && (typeof arrayLike === "undefined" ? "undefined" : _typeof(arrayLike)) === "object" && arrayLike.length && arrayLike.push !== undefined && arrayLike.splice !== undefined;
};
}
/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
if (Object.assign === undefined) {

@@ -1448,3 +1544,3 @@ Object.assign = function () {

/***/ }),
/* 5 */
/* 7 */
/***/ (function(module, exports, __webpack_require__) {

@@ -1504,6 +1600,6 @@

}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6)))
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)))
/***/ }),
/* 6 */
/* 8 */
/***/ (function(module, exports, __webpack_require__) {

@@ -1538,3 +1634,3 @@

/***/ }),
/* 7 */
/* 9 */
/***/ (function(module, exports, __webpack_require__) {

@@ -1546,11 +1642,48 @@

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = joinToString;
function joinToString(__array__like) {
var str = '';
for (var i = 0, len = __array__like.length; i < len; i++) {
str += __array__like[i];
}
return str;
}
/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = toNumber;
function toNumber(val) {
var floatedVal = parseFloat(val);
return typeof floatedVal === "number" && !isNaN(floatedVal) ? floatedVal : val;
}
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Interpolation = exports.Easing = exports.Tween = exports.now = exports.autoPlay = exports.update = exports.remove = exports.removeAll = exports.add = exports.getAll = undefined;
exports.Interpolation = exports.Easing = exports.Tween = exports.now = exports.autoPlay = exports.cloneTween = exports.update = exports.remove = exports.removeAll = exports.add = exports.getAll = undefined;
__webpack_require__(4);
__webpack_require__(6);
__webpack_require__(7);
__webpack_require__(5);
var _core = __webpack_require__(2);
var _core = __webpack_require__(4);

@@ -1561,3 +1694,3 @@ var _Easing = __webpack_require__(0);

var _Tween = __webpack_require__(3);
var _Tween = __webpack_require__(2);

@@ -1570,2 +1703,6 @@ var _Tween2 = _interopRequireDefault(_Tween);

var _clone = __webpack_require__(3);
var _clone2 = _interopRequireDefault(_clone);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -1578,2 +1715,3 @@

exports.update = _core.update;
exports.cloneTween = _clone2.default;
exports.autoPlay = _core.autoPlay;

@@ -1580,0 +1718,0 @@ exports.now = _core.now;

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.TWEEN=e():t.TWEEN=e()}(this,function(){return function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=7)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(-10*t,2)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(-Math.pow(-10*(t-1),2)+2)}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){return 0===t?0:1===t?1:-Math.pow(10*(t-1),2)*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(-10*t,2)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2,t<1?-.5*Math.pow(10*(t-1),2)*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(-10*(t-1),2)*Math.sin(5*(t-1.1)*Math.PI)+1)}},Back:{In:function(t){var e=1.70158;return t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?.5*(t*t*((e+1)*t-e)):.5*((t-=2)*t*((e+1)*t+e)+2)}},Bounce:{In:function(t){return 1-i.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*i.Bounce.In(2*t):.5*i.Bounce.Out(2*t-1)+.5}},Stepped:function(t){return function(e){return Math.floor(e*t)/t}},Noisy:function(t,e){var n=1-t;return function(i){return t*Math.random()+n*e(i)}},get bezier(){var t,e;return t=function(t,e,n,i,r){var o=Math.pow(1-t,3),u=3*Math.pow(1-t,2)*t,a=3*(1-t)*Math.pow(t,2);return t=Math.pow(t,3),{x:o*e.x+u*n.x+a*i.x+t*r.x,y:o*e.y+u*n.y+a*i.y+t*r.y}},e=function(t,e){var n,i,r=0,o=0,u=e.length,a=0,s=1,c=(s+a)/2;for(n=null;o<u&&(i=e[o],t>=i(0).x&&t<=i(1).x&&(n=i),null===n);)o++;if(!n)return 1;for(i=n(c).x;1e-4<Math.abs(t-i)&&100>r;)t>i?a=c:s=c,c=(s+a)/2,i=n(c).x,r++;return n(c).y},function(n){null==n&&(n={});var i=n.points,r=function(){var e,n=0,o=i.length;for(r=[],e=function(e,n){return r.push(function(i){return t(i,e,e.cp[e.cp.length-1],n.cp[0],n)})};n<o&&!(n>=i.length-1);)e(i[n],i[n+1]),n++;return r}();return function(t){return e(t,r)}}},easeInOut:function(t){var e,n;return null==t&&(t={}),e=null!=(n=t.friction)?n:i.easeInOut.defaults.friction,i.bezier({points:[{x:0,y:0,cp:[{x:.92-e/1e3,y:0}]},{x:1,y:1,cp:[{x:.08+e/1e3,y:1}]}]})},easeIn:function(t){var e,n;return null==t&&(t={}),e=null!=(n=t.friction)?n:i.easeIn.defaults.friction,i.bezier({points:[{x:0,y:0,cp:[{x:.92-e/1e3,y:0}]},{x:1,y:1,cp:[{x:1,y:1}]}]})},easeOut:function(t){var e,n;return null==t&&(t={}),e=null!=(n=t.friction)?n:i.easeOut.defaults.friction,i.bezier({points:[{x:0,y:0,cp:[{x:0,y:0}]},{x:1,y:1,cp:[{x:.08+e/1e3,y:1}]}]})},spring:function(t){var e,n,r,o,u;return null==t&&(t={}),Tools.extend(t,i.spring.defaults,!0),r=Math.max(1,t.frequency/20),o=Math.pow(20,t.friction/100),u=t.anticipationSize/1e3,e=function(e){var n,i;return i=u/(1-u),n=(i-0)/(i-0),(.8-n)/i*e*t.anticipationStrength/100+n},n=function(t){return Math.pow(o/10,-t)*(1-t)},function(t){var i,o,a,s;return s=t/(1-u)-u/(1-u),t<u?(a=u/(1-u)-u/(1-u),i=0/(1-u)-u/(1-u),a=Math.acos(1/e(a)),o=(Math.acos(1/e(i))-a)/(r*-u),i=e):(i=n,a=0,o=1),1-i(s)*Math.cos(r*(t-u)*o+a)}},bounce:function(t){var e,n,r,o;return null==t&&(t={}),Tools.extend(t,i.bounce.defaults),r=Math.max(1,t.frequency/20),o=Math.pow(20,t.friction/100),e=function(t){return Math.pow(o/10,-t)*(1-t)},n=function(t){return e(t)*Math.cos(r*t*1+-1.57)},n.initialForce=!0,n},gravity:function(t){var e,n,r,o,u,a;return null==t&&(t={}),Tools.extend(t,i.gravity.defaults),n=Math.min(t.bounciness/1250,.8),o=t.elasticity/1e3,r=[],e=function(){var i;for(i=Math.sqrt(.02),i={a:-i,b:i,H:1},t.initialForce&&(i.a=0,i.b*=2);.001<i.H;)e=i.b-i.a,i={a:i.b,b:i.b+e*n,H:i.H*n*n};return i.b}(),a=function(n,i,r,o){return e=i-n,n=2/e*o-1-2*n/e,r=n*n*r-r+1,t.initialForce&&(r=1-r),r},function(){var i,u,a;for(i=Math.sqrt(2/(100*e*e)),u={a:-i,b:i,H:1},t.initialForce&&(u.a=0,u.b*=2),r.push(u),a=[];1>u.b&&.001<u.H;)i=u.b-u.a,u={a:u.b,b:u.b+i*n,H:u.H*o},a.push(r.push(u));return a}(),u=function e(n){var i,e;for(e=0,i=r[e];!(n>=i.a&&n<=i.b)&&(e+=1,i=r[e]););return i?a(i.a,i.b,i.H,n):t.initialForce?0:1},u.initialForce=t.initialForce,u},forceWithGravity:function(t){return null==t&&(t={}),Tools.extend(t,i.forceWithGravity.defaults),t.initialForce=!0,i.gravity(t)}};i.spring.defaults={frequency:300,friction:200,anticipationSize:0,anticipationStrength:0},i.bounce.defaults={frequency:300,friction:200},i.forceWithGravity.defaults=i.gravity.defaults={bounciness:400,elasticity:200},i.easeInOut.defaults=i.easeIn.defaults=i.easeOut.defaults={friction:500},e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={Linear:function(t,e){var n=t.length-1,r=n*e,o=Math.floor(r),u=i.Utils.Linear;return e<0?u(t[0],t[1],r):e>1?u(t[n],t[n-1],n-r):u(t[o],t[o+1>n?n:o+1],r-o)},Bezier:function(t,e){for(var n=0,r=t.length-1,o=Math.pow,u=i.Utils.Bernstein,a=0;a<=r;a++)n+=o(1-e,r-a)*o(e,a)*t[a]*u(r,a);return n},CatmullRom:function(t,e){var n=t.length-1,r=n*e,o=Math.floor(r),u=i.Utils.CatmullRom;return t[0]===t[n]?(e<0&&(o=Math.floor(r=n*(1+e))),u(t[(o-1+n)%n],t[o],t[(o+1)%n],t[(o+2)%n],r-o)):e<0?t[0]-(u(t[0],t[0],t[1],t[1],-r)-t[0]):e>1?t[n]-(u(t[n],t[n],t[n-1],t[n-1],r-n)-t[n]):u(t[o?o-1:0],t[o],t[n<o+1?n:o+1],t[n<o+2?n:o+2],r-o)},Utils:{Linear:function(t,e,n){return(e-t)*n+t},Bernstein:function(t,e){var n=i.Utils.Factorial;return n(t)/n(e)/n(t-e)},Factorial:function(){var t=[1];return function(e){var n=1;if(t[e])return t[e];for(var i=e;i>1;i--)n*=i;return t[e]=n,n}}(),CatmullRom:function(t,e,n,i,r){var o=.5*(n-t),u=.5*(i-e),a=r*r,s=r*a;return(2*e-2*n+o+u)*s+(-3*e+3*n-2*o-u)*a+o*r+e}}};e.default=i},function(t,e,n){"use strict";function i(t){g(o)?(o=t,s=requestAnimationFrame(i),v("autostart",t)):(u=!1,cancelAnimationFrame(s),v("stop",t))}Object.defineProperty(e,"__esModule",{value:!0});var r=[],o=0,u=!1,a=!1,s=void 0,c={},f=function(){return r},l=function(t){a=t},h=function(){r=[]},v=function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];void 0!==c[t]&&c[t].map(function(t){return t.apply(void 0,n)})},d=function(t,e){if(void 0!==t&&void 0!==c[t])if(void 0!==e)for(var n=c[name],i=0;i<n.length;)n[i]===e&&n.splice(i,1),i++;else c[name]=[]},p=function(t){r.push(t),a&&!u&&(i(b()),u=!0,v("start")),v("add",t,r)},y=function(t,e){void 0===c[t]&&(c[t]=[]),c[t].push(e)},m=function(t,e){void 0===c[t]&&(c[t]=[]),y(t,function(){e.apply(void 0,arguments),d(t)})},_=function(t){r.filter(function(e){return e!==t});for(var e=0,n=void 0;e<r.length;)n=r[e],n===t&&(v("remove",t,r),r.splice(e,1)),e++},b=function(){return o},g=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b(),e=arguments[1];if(t=void 0!==t?t:b(),o=t,v("update",t,r),0===r.length)return!1;v("realupdate",t,r);for(var n=0;n<r.length;)r[n].update(t)||e?n++:r.splice(n,1);return!0};e.getAll=f,e.removeAll=h,e.remove=_,e.add=p,e.now=b,e.update=g,e.autoPlay=l,e.on=y,e.once=m,e.off=d,e.emit=v},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),a=n(2),s=n(0),c=i(s),f=n(1),l=i(f),h=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r(this,t),this.object=e,this._valuesStart=t.createEmptyConst(e),this._valuesStartRepeat=t.createEmptyConst(e),this._valuesEnd=t.createEmptyConst(e),this._chainedTweens=[],this._duration=1e3,this._easingFunction=c.default.Linear.None,this._interpolationFunction=l.default.None,this._startTime=0,this._delayTime=0,this._repeat=0,this._r=0,this._isPlaying=!1,this._yoyo=!1,this._reversed=!1,this._onStartCallbackFired=!1,this._events={},this._pausedTime=0,this}return u(t,[{key:"isPlaying",value:function(){return this._isPlaying}},{key:"isStarted",value:function(){return this._onStartCallbackFired}},{key:"reverse",value:function(){var t=this._valuesStartRepeat,e=this._yoyo,n=this._valuesEnd,i=this._valuesStart;for(var r in t){if("string"==typeof n[r]&&(t[r]=t[r]+parseFloat(n[r])),e){var o=t[r];t[r]=n[r],n[r]=o}i[r]=t[r]}return this._reversed=!this._reversed,this}},{key:"off",value:function(t,e){if(void 0===this._events[t])return this;if(void 0!==t&&void 0!==e)for(var n=this._events[t],i=0;i<n.length;)n[i]===e&&n.splice(i,1),i++;else void 0!==t&&void 0===e&&(this._events[t]=[]);return this}},{key:"on",value:function(t,e){return void 0===this._events[t]&&(this._events[t]=[]),this._events[t].push(e),this}},{key:"once",value:function(t,e){var n=this;return void 0===this._events[t]&&(this._events[t]=[]),this.on(t,function(){for(var i=arguments.length,r=Array(i),o=0;o<i;o++)r[o]=arguments[o];e.call.apply(e,[n].concat(r)),n.off(t)})}},{key:"emit",value:function(t){for(var e=this,n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return void 0===this._events[t]?this:(this._events[t].map(function(t){t.call.apply(t,[e].concat(i))}),this)}},{key:"pause",value:function(){return this._isPlaying?(this._isPlaying=!1,(0,a.remove)(this),this._pausedTime=(0,a.now)(),this.emit("pause",this.object)):this}},{key:"play",value:function(){return this._isPlaying?this:(this._isPlaying=!0,this._startTime+=(0,a.now)()-this._pausedTime,(0,a.add)(this),this._pausedTime=(0,a.now)(),this.emit("play",this.object))}},{key:"restart",value:function(t){return this._repeat=this._r,this._startTime=(0,a.now)()+(t?0:this._delayTime),this._isPlaying||(0,a.add)(this),this.emit("restart",this._object)}},{key:"seek",value:function(t,e){return this._startTime=(0,a.now)()+Math.max(0,Math.min(t,this._duration)),this.emit("seek",t,this._object),e?this:this.pause()}},{key:"duration",value:function(t){return this._duration=t,this}},{key:"to",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;if("number"==typeof t){var n={Number:t};this._valuesEnd=n}else this._valuesEnd=t;if("number"==typeof e)this._duration=e;else if("object"===("undefined"==typeof e?"undefined":o(e)))for(var i in e)this[i](e[i]);return this}},{key:"start",value:function(e){var n=this._startTime,i=this._delayTime,r=this._valuesEnd,o=this._valuesStart,u=(this._valuesStartRepeat,this.object);n=void 0!==e?e:(0,a.now)(),n+=i,this._startTime=n;for(var s in r){if("number"==typeof u[s]&&r[s]instanceof Array){if(0===r[s].length)continue;this._valuesEnd[s]=[u[s]].concat(r[s])}t.checkValidness(u[s])!==!1&&(this._valuesStart[s]=u[s],this._valuesStartRepeat[s]=o[s]||0)}return(0,a.add)(this),this._isPlaying=!0,this}},{key:"stop",value:function(){var t=this._isPlaying,e=(this._onStopCallback,this.object);return t?((0,a.remove)(this),this._isPlaying=!1,this.stopChainedTweens(),this.emit("stop",e)):this}},{key:"end",value:function(){var t=this._startTime,e=this._duration;return this.update(t+e)}},{key:"stopChainedTweens",value:function(){var t=this._chainedTweens;return t.map(function(t){return t.stop()}),this}},{key:"delay",value:function(t){return this._delayTime=t,this}},{key:"repeat",value:function(t){return this._repeat=t,this._r=t,this}},{key:"repeatDelay",value:function(t){return this._repeatDelayTime=t,this}},{key:"reverseDelay",value:function(t){return this._reverseDelayTime=t,this}},{key:"yoyo",value:function(t){return this._yoyo=t,this}},{key:"easing",value:function(t){return this._easingFunction=t,this}},{key:"interpolation",value:function(t){return this._interpolationFunction=t,this}},{key:"chain",value:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return this._chainedTweens=e,this}},{key:"get",value:function(t){return this.update(t),this._object}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,a.now)(),e=this._onStartCallbackFired,n=this._chainedTweens,i=this._easingFunction,r=this._interpolationFunction,o=this._repeat,u=this._repeatDelayTime,s=this._reverseDelayTime,c=this._delayTime,f=this._yoyo,l=this._reversed,h=this._startTime,v=this._duration,d=this._valuesStart,p=(this._valuesStartRepeat,this._valuesEnd),y=this.object,m=void 0,_=void 0,b=void 0;if(t<h)return!0;e===!1&&(this.emit("start",y),this._onStartCallbackFired=!0),_=(t-h)/v,_=_>1?1:_,b=i(_);for(m in p)if(void 0!==d[m]){var g=d[m],M=p[m];M instanceof Array?y[m]=r(M,b):("string"==typeof M&&(M="+"===M.charAt(0)||"-"===M.charAt(0)?g+parseFloat(M):parseFloat(M)),"number"==typeof M&&(y[m]=g+(M-g)*b))}return this.emit("update",y,_),1!==_||(o>0?(isFinite(o)&&this._repeat--,this.reverse(),this.emit(l?"reverse":"repeat",y),f&&(this._reversed=!l),l||void 0===u?l&&void 0!==s?this._startTime+=v+s:this._startTime+=v+c:this._startTime+=v+u,!0):(this.emit("complete",y),n.map(function(t){return t.start(h+v)}),!1))}}],[{key:"createEmptyConst",value:function(t){return"number"==typeof t?0:Array.isArray(t)?[]:"object"===("undefined"==typeof t?"undefined":o(t))?{}:""}},{key:"checkValidness",value:function(t){return void 0!==t&&null!==t&&""!==t&&NaN!==t&&t!==1/0}}]),t}();e.default=h},function(t,e,n){"use strict";void 0===Object.assign&&(Object.assign=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];var i=e.shift();return e.map(function(t){for(var e in t)i[e]=t[e]}),i})},function(t,e,n){"use strict";(function(t){var e="undefined"!=typeof window?window:"undefined"!=typeof t?t:void 0,n=["webkit","moz","ms","o"],i="AnimationFrame",r="Request"+i,o="Cancel"+i,u="CancelRequest"+i,a=setTimeout,s=clearTimeout;if(void 0===e.requestAnimationFrame){var c=void 0,f=void 0,l=Date.now(),h=50/3,v=h;n.map(function(t){void 0===(c=e[t+r])&&(c=function(t){return a(function(){f=Date.now(),t(f-l),v=h+(Date.now()-f)},v)})}),void 0!==c&&(e.requestAnimationFrame=c)}if(void 0===e.cancelAnimationFrame&&void 0===(e.cancelAnimationFrame=e.cancelRequestAnimationFrame)){var d=void 0;n.map(function(t){void 0===(d=e[t+o])&&void 0===(d=e[t+u])&&(d=function(t){return s(t)})}),void 0!==d&&(e.cancelAnimationFrame=d)}}).call(e,n(6))},function(t,e,n){"use strict";var i,r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(t){"object"===("undefined"==typeof window?"undefined":r(window))&&(i=window)}t.exports=i},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.Interpolation=e.Easing=e.Tween=e.now=e.autoPlay=e.update=e.remove=e.removeAll=e.add=e.getAll=void 0,n(4),n(5);var r=n(2),o=n(0),u=i(o),a=n(3),s=i(a),c=n(1),f=i(c);e.getAll=r.getAll,e.add=r.add,e.removeAll=r.removeAll,e.remove=r.remove,e.update=r.update,e.autoPlay=r.autoPlay,e.now=r.now,e.Tween=s.default,e.Easing=u.default,e.Interpolation=f.default}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.TWEEN=e():t.TWEEN=e()}(this,function(){return function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=11)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(-10*t,2)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(-Math.pow(-10*(t-1),2)+2)}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){return 0===t?0:1===t?1:-Math.pow(10*(t-1),2)*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(-10*t,2)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2,t<1?-.5*Math.pow(10*(t-1),2)*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(-10*(t-1),2)*Math.sin(5*(t-1.1)*Math.PI)+1)}},Back:{In:function(t){var e=1.70158;return t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?.5*(t*t*((e+1)*t-e)):.5*((t-=2)*t*((e+1)*t+e)+2)}},Bounce:{In:function(t){return 1-i.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*i.Bounce.In(2*t):.5*i.Bounce.Out(2*t-1)+.5}},Stepped:function(t){return function(e){return Math.floor(e*t)/t}},Noisy:function(t,e){var n=1-t;return function(i){return t*Math.random()+n*e(i)}},get bezier(){var t,e;return t=function(t,e,n,i,r){var o=Math.pow(1-t,3),u=3*Math.pow(1-t,2)*t,a=3*(1-t)*Math.pow(t,2);return t=Math.pow(t,3),{x:o*e.x+u*n.x+a*i.x+t*r.x,y:o*e.y+u*n.y+a*i.y+t*r.y}},e=function(t,e){var n,i,r=0,o=0,u=e.length,a=0,s=1,c=(s+a)/2;for(n=null;o<u&&(i=e[o],t>=i(0).x&&t<=i(1).x&&(n=i),null===n);)o++;if(!n)return 1;for(i=n(c).x;1e-4<Math.abs(t-i)&&100>r;)t>i?a=c:s=c,c=(s+a)/2,i=n(c).x,r++;return n(c).y},function(n){null==n&&(n={});var i=n.points,r=function(){var e,n=0,o=i.length;for(r=[],e=function(e,n){return r.push(function(i){return t(i,e,e.cp[e.cp.length-1],n.cp[0],n)})};n<o&&!(n>=i.length-1);)e(i[n],i[n+1]),n++;return r}();return function(t){return e(t,r)}}},easeInOut:function(t){var e,n;return null==t&&(t={}),e=null!=(n=t.friction)?n:i.easeInOut.defaults.friction,i.bezier({points:[{x:0,y:0,cp:[{x:.92-e/1e3,y:0}]},{x:1,y:1,cp:[{x:.08+e/1e3,y:1}]}]})},easeIn:function(t){var e,n;return null==t&&(t={}),e=null!=(n=t.friction)?n:i.easeIn.defaults.friction,i.bezier({points:[{x:0,y:0,cp:[{x:.92-e/1e3,y:0}]},{x:1,y:1,cp:[{x:1,y:1}]}]})},easeOut:function(t){var e,n;return null==t&&(t={}),e=null!=(n=t.friction)?n:i.easeOut.defaults.friction,i.bezier({points:[{x:0,y:0,cp:[{x:0,y:0}]},{x:1,y:1,cp:[{x:.08+e/1e3,y:1}]}]})},spring:function(t){var e,n,r,o,u;return null==t&&(t={}),Tools.extend(t,i.spring.defaults,!0),r=Math.max(1,t.frequency/20),o=Math.pow(20,t.friction/100),u=t.anticipationSize/1e3,e=function(e){var n,i;return i=u/(1-u),n=(i-0)/(i-0),(.8-n)/i*e*t.anticipationStrength/100+n},n=function(t){return Math.pow(o/10,-t)*(1-t)},function(t){var i,o,a,s;return s=t/(1-u)-u/(1-u),t<u?(a=u/(1-u)-u/(1-u),i=0/(1-u)-u/(1-u),a=Math.acos(1/e(a)),o=(Math.acos(1/e(i))-a)/(r*-u),i=e):(i=n,a=0,o=1),1-i(s)*Math.cos(r*(t-u)*o+a)}},bounce:function(t){var e,n,r,o;return null==t&&(t={}),Tools.extend(t,i.bounce.defaults),r=Math.max(1,t.frequency/20),o=Math.pow(20,t.friction/100),e=function(t){return Math.pow(o/10,-t)*(1-t)},n=function(t){return e(t)*Math.cos(r*t*1+-1.57)},n.initialForce=!0,n},gravity:function(t){var e,n,r,o,u,a;return null==t&&(t={}),Tools.extend(t,i.gravity.defaults),n=Math.min(t.bounciness/1250,.8),o=t.elasticity/1e3,r=[],e=function(){var i;for(i=Math.sqrt(.02),i={a:-i,b:i,H:1},t.initialForce&&(i.a=0,i.b*=2);.001<i.H;)e=i.b-i.a,i={a:i.b,b:i.b+e*n,H:i.H*n*n};return i.b}(),a=function(n,i,r,o){return e=i-n,n=2/e*o-1-2*n/e,r=n*n*r-r+1,t.initialForce&&(r=1-r),r},function(){var i,u,a;for(i=Math.sqrt(2/(100*e*e)),u={a:-i,b:i,H:1},t.initialForce&&(u.a=0,u.b*=2),r.push(u),a=[];1>u.b&&.001<u.H;)i=u.b-u.a,u={a:u.b,b:u.b+i*n,H:u.H*o},a.push(r.push(u));return a}(),u=function e(n){var i,e;for(e=0,i=r[e];!(n>=i.a&&n<=i.b)&&(e+=1,i=r[e]););return i?a(i.a,i.b,i.H,n):t.initialForce?0:1},u.initialForce=t.initialForce,u},forceWithGravity:function(t){return null==t&&(t={}),Tools.extend(t,i.forceWithGravity.defaults),t.initialForce=!0,i.gravity(t)}};i.spring.defaults={frequency:300,friction:200,anticipationSize:0,anticipationStrength:0},i.bounce.defaults={frequency:300,friction:200},i.forceWithGravity.defaults=i.gravity.defaults={bounciness:400,elasticity:200},i.easeInOut.defaults=i.easeIn.defaults=i.easeOut.defaults={friction:500},e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={Linear:function(t,e){var n=t.length-1,r=n*e,o=Math.floor(r),u=i.Utils.Linear;return e<0?u(t[0],t[1],r):e>1?u(t[n],t[n-1],n-r):u(t[o],t[o+1>n?n:o+1],r-o)},Bezier:function(t,e){for(var n=0,r=t.length-1,o=Math.pow,u=i.Utils.Bernstein,a=0;a<=r;a++)n+=o(1-e,r-a)*o(e,a)*t[a]*u(r,a);return n},CatmullRom:function(t,e){var n=t.length-1,r=n*e,o=Math.floor(r),u=i.Utils.CatmullRom;return t[0]===t[n]?(e<0&&(o=Math.floor(r=n*(1+e))),u(t[(o-1+n)%n],t[o],t[(o+1)%n],t[(o+2)%n],r-o)):e<0?t[0]-(u(t[0],t[0],t[1],t[1],-r)-t[0]):e>1?t[n]-(u(t[n],t[n],t[n-1],t[n-1],r-n)-t[n]):u(t[o?o-1:0],t[o],t[n<o+1?n:o+1],t[n<o+2?n:o+2],r-o)},Utils:{Linear:function(t,e,n){return(e-t)*n+t},Bernstein:function(t,e){var n=i.Utils.Factorial;return n(t)/n(e)/n(t-e)},Factorial:function(){var t=[1];return function(e){var n=1;if(t[e])return t[e];for(var i=e;i>1;i--)n*=i;return t[e]=n,n}}(),CatmullRom:function(t,e,n,i,r){var o=.5*(n-t),u=.5*(i-e),a=r*r,s=r*a;return(2*e-2*n+o+u)*s+(-3*e+3*n-2*o-u)*a+o*r+e}}};e.default=i},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),a=n(4),s=n(0),c=i(s),f=n(1),l=i(f),h=n(3),d=i(h),v=n(9),y=i(v),p=n(10),m=i(p),_=/\s+|([A-Za-z?().,{}:""\[\]#]+)|([-+\/*%]+=)?([-+*\/%]+)?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/gi,b=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r(this,t),this.object=e,this._valuesStart=t.createEmptyConst(e),this._valuesStartRepeat=t.createEmptyConst(e),this._valuesEnd=t.createEmptyConst(e),this._chainedTweens=[],this._duration=1e3,this._easingFunction=c.default.Linear.None,this._interpolationFunction=l.default.None,this._startTime=0,this._delayTime=0,this._repeat=0,this._r=0,this._isPlaying=!1,this._yoyo=!1,this._reversed=!1,this._onStartCallbackFired=!1,this._events={},this._pausedTime=0,this}return u(t,[{key:"isPlaying",value:function(){return this._isPlaying}},{key:"isStarted",value:function(){return this._onStartCallbackFired}},{key:"reverse",value:function(){var t=this._valuesStartRepeat,e=this._yoyo,n=this._valuesEnd,i=this._valuesStart;for(var r in t){if("string"==typeof n[r]&&(t[r]=t[r]+parseFloat(n[r])),e){var o=t[r];t[r]=n[r],n[r]=o}i[r]=t[r]}return this._reversed=!this._reversed,this}},{key:"off",value:function(t,e){if(void 0===this._events[t])return this;if(void 0!==t&&void 0!==e)for(var n=this._events[t],i=0;i<n.length;)n[i]===e&&n.splice(i,1),i++;else void 0!==t&&void 0===e&&(this._events[t]=[]);return this}},{key:"on",value:function(t,e){return void 0===this._events[t]&&(this._events[t]=[]),this._events[t].push(e),this}},{key:"once",value:function(t,e){var n=this;return void 0===this._events[t]&&(this._events[t]=[]),this.on(t,function(){for(var i=arguments.length,r=Array(i),o=0;o<i;o++)r[o]=arguments[o];e.call.apply(e,[n].concat(r)),n.off(t)})}},{key:"emit",value:function(t){for(var e=this,n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return void 0===this._events[t]?this:(this._events[t].map(function(t){t.call.apply(t,[e].concat(i))}),this)}},{key:"pause",value:function(){return this._isPlaying?(this._isPlaying=!1,(0,a.remove)(this),this._pausedTime=(0,a.now)(),this.emit("pause",this.object)):this}},{key:"play",value:function(){return this._isPlaying?this:(this._isPlaying=!0,this._startTime+=(0,a.now)()-this._pausedTime,(0,a.add)(this),this._pausedTime=(0,a.now)(),this.emit("play",this.object))}},{key:"restart",value:function(t){return this._repeat=this._r,this._startTime=(0,a.now)()+(t?0:this._delayTime),this._isPlaying||(0,a.add)(this),this.emit("restart",this._object)}},{key:"seek",value:function(t,e){return this._startTime=(0,a.now)()+Math.max(0,Math.min(t,this._duration)),this.emit("seek",t,this._object),e?this:this.pause()}},{key:"duration",value:function(t){return this._duration="function"==typeof t?t(this._duration):t,this}},{key:"to",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;if("number"==typeof t){var n={Number:t};this._valuesEnd=n}else this._valuesEnd=t;if("number"==typeof e)this._duration=e;else if("object"===("undefined"==typeof e?"undefined":o(e)))for(var i in e)this[i](e[i]);return this}},{key:"start",value:function(e){var n=this._startTime,i=this._delayTime,r=this._valuesEnd,u=this._valuesStart,s=this.object;n=void 0!==e?e:(0,a.now)(),n+=i,this._startTime=n;for(var c in r){if("object"===o(r[c]))if(Array.isArray(r[c]))if("number"==typeof s[c])this._valuesEnd[c]=[s[c]].concat(r[c]);else{var f=(0,d.default)(this,{object:s[c],_valuesEnd:r[c]}).start().stop();this._valuesEnd[c]=f}else{var l=(0,d.default)(this,{object:s[c],_valuesEnd:r[c]}).start().stop();this._valuesEnd[c]=l}else if("string"==typeof r[c]&&"string"==typeof s[c]&&_.test(s[c])&&_.test(r[c])){var h=s[c].match(_);h=h.map(m.default);var v=r[c].match(_);v=v.map(m.default);var y=(0,d.default)(this,{object:h,_valuesEnd:v}).start().stop();y.join=!0,this._valuesEnd[c]=y}t.checkValidness(s[c])!==!1&&s[c]!==r[c]&&(this._valuesStart[c]=s[c],this._valuesStartRepeat[c]=u[c]||0)}return(0,a.add)(this),this._isPlaying=!0,this}},{key:"stop",value:function(){var t=this._isPlaying,e=this.object;return t?((0,a.remove)(this),this._isPlaying=!1,this.stopChainedTweens(),this.emit("stop",e)):this}},{key:"end",value:function(){var t=this._startTime,e=this._duration;return this.update(t+e)}},{key:"stopChainedTweens",value:function(){var t=this._chainedTweens;return t.map(function(t){return t.stop()}),this}},{key:"delay",value:function(t){return this._delayTime=t,this}},{key:"repeat",value:function(t){return this._repeat=t,this._r=t,this}},{key:"repeatDelay",value:function(t){return this._repeatDelayTime=t,this}},{key:"reverseDelay",value:function(t){return this._reverseDelayTime=t,this}},{key:"yoyo",value:function(t){return this._yoyo=t,this}},{key:"easing",value:function(t){return this._easingFunction=t,this}},{key:"interpolation",value:function(t){return this._interpolationFunction=t,this}},{key:"chain",value:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return this._chainedTweens=e,this}},{key:"get",value:function(t){return this.update(t),this.object}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,a.now)(),n=this._onStartCallbackFired,i=this._chainedTweens,r=this._easingFunction,o=this._interpolationFunction,u=this._repeat,s=this._repeatDelayTime,c=this._reverseDelayTime,f=this._delayTime,l=this._yoyo,h=this._reversed,d=this._startTime,v=this._duration,p=this._valuesStart,m=this._valuesEnd,_=this.object,b=void 0,g=void 0,M=void 0;if(e<d)return!0;n===!1&&(this.emit("start",_),this._onStartCallbackFired=!0),g=(e-d)/v,g=g>1?1:g,M=r(g);for(b in m)if(void 0!==p[b]){var w=p[b],O=m[b];if(O instanceof t){var T=O.get(e);O.join?_[b]=(0,y.default)(T):_[b]=T}else Array.isArray(O)?_[b]=o(O,M):("string"==typeof O&&(O="+"===O.charAt(0)||"-"===O.charAt(0)?w+parseFloat(O):parseFloat(O)),"number"==typeof O&&(_[b]=w+(O-w)*M))}return this.emit("update",_,g),1!==g||(u>0?(isFinite(u)&&this._repeat--,this.reverse(),this.emit(h?"reverse":"repeat",_),l&&(this._reversed=!h),h||void 0===s?h&&void 0!==c?this._startTime+=v+c:this._startTime+=v+f:this._startTime+=v+s,!0):(this.emit("complete",_),i.map(function(t){return t.start(d+v)}),!1))}}],[{key:"createEmptyConst",value:function(t){return"number"==typeof t?0:Array.isArray(t)?[]:"object"===("undefined"==typeof t?"undefined":o(t))?{}:""}},{key:"checkValidness",value:function(t){return void 0!==t&&null!==t&&""!==t&&NaN!==t&&t!==1/0}}]),t}();e.default=b},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new u.default({x:0});for(var i in t)void 0!==e[i]?n[i]=e[i]:n[i]=t[i];return n}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var o=n(2),u=i(o)},function(t,e,n){"use strict";function i(t){g(o)?(o=t,s=requestAnimationFrame(i),d("autostart",t)):(u=!1,cancelAnimationFrame(s),d("stop",t))}Object.defineProperty(e,"__esModule",{value:!0});var r=[],o=0,u=!1,a=!1,s=void 0,c={},f=function(){return r},l=function(t){a=t},h=function(){r=[]},d=function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];void 0!==c[t]&&c[t].map(function(t){return t.apply(void 0,n)})},v=function(t,e){if(void 0!==t&&void 0!==c[t])if(void 0!==e)for(var n=c[name],i=0;i<n.length;)n[i]===e&&n.splice(i,1),i++;else c[name]=[]},y=function(t){r.push(t),a&&!u&&(i(b()),u=!0,d("start")),d("add",t,r)},p=function(t,e){void 0===c[t]&&(c[t]=[]),c[t].push(e)},m=function(t,e){void 0===c[t]&&(c[t]=[]),p(t,function(){e.apply(void 0,arguments),v(t)})},_=function(t){r.filter(function(e){return e!==t});for(var e=0,n=void 0;e<r.length;)n=r[e],n===t&&(d("remove",t,r),r.splice(e,1)),e++},b=function(){return o},g=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b(),e=arguments[1];if(t=void 0!==t?t:b(),o=t,d("update",t,r),0===r.length)return!1;d("realupdate",t,r);for(var n=0;n<r.length;)r[n].update(t)||e?n++:r.splice(n,1);return!0};e.getAll=f,e.removeAll=h,e.remove=_,e.add=y,e.now=b,e.update=g,e.autoPlay=l,e.on=p,e.once=m,e.off=v,e.emit=d},function(t,e,n){"use strict";var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};void 0===Array.isArray&&(Array.isArray=function(t){return void 0!==t&&"object"===("undefined"==typeof t?"undefined":i(t))&&t.length&&void 0!==t.push&&void 0!==t.splice})},function(t,e,n){"use strict";void 0===Object.assign&&(Object.assign=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];var i=e.shift();return e.map(function(t){for(var e in t)i[e]=t[e]}),i})},function(t,e,n){"use strict";(function(t){var e="undefined"!=typeof window?window:"undefined"!=typeof t?t:void 0,n=["webkit","moz","ms","o"],i="AnimationFrame",r="Request"+i,o="Cancel"+i,u="CancelRequest"+i,a=setTimeout,s=clearTimeout;if(void 0===e.requestAnimationFrame){var c=void 0,f=void 0,l=Date.now(),h=50/3,d=h;n.map(function(t){void 0===(c=e[t+r])&&(c=function(t){return a(function(){f=Date.now(),t(f-l),d=h+(Date.now()-f)},d)})}),void 0!==c&&(e.requestAnimationFrame=c)}if(void 0===e.cancelAnimationFrame&&void 0===(e.cancelAnimationFrame=e.cancelRequestAnimationFrame)){var v=void 0;n.map(function(t){void 0===(v=e[t+o])&&void 0===(v=e[t+u])&&(v=function(t){return s(t)})}),void 0!==v&&(e.cancelAnimationFrame=v)}}).call(e,n(8))},function(t,e,n){"use strict";var i,r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(t){"object"===("undefined"==typeof window?"undefined":r(window))&&(i=window)}t.exports=i},function(t,e,n){"use strict";function i(t){for(var e="",n=0,i=t.length;n<i;n++)e+=t[n];return e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=i},function(t,e,n){"use strict";function i(t){var e=parseFloat(t);return"number"!=typeof e||isNaN(e)?t:e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=i},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.Interpolation=e.Easing=e.Tween=e.now=e.autoPlay=e.cloneTween=e.update=e.remove=e.removeAll=e.add=e.getAll=void 0,n(6),n(7),n(5);var r=n(4),o=n(0),u=i(o),a=n(2),s=i(a),c=n(1),f=i(c),l=n(3),h=i(l);e.getAll=r.getAll,e.add=r.add,e.removeAll=r.removeAll,e.remove=r.remove,e.update=r.update,e.cloneTween=h.default,e.autoPlay=r.autoPlay,e.now=r.now,e.Tween=s.default,e.Easing=u.default,e.Interpolation=f.default}])});
{
"name": "es6-tween",
"version": "1.0.4",
"version": "1.2.1",
"description": "ES6 implementation of amazing tween.js",

@@ -5,0 +5,0 @@ "main": "dist/Tween.js",

@@ -331,3 +331,5 @@ const Easing = {

// Adapted from https://github.com/michaelvillar/dynamics.js
// Credits:
// @michaelvillar for dynamics.js easing/physics
// Adapted by @dalisoft
get bezier() {

@@ -334,0 +336,0 @@ var b

@@ -9,3 +9,11 @@ import {

import Interpolation from './Interpolation';
import cloneTween from './clone';
import joinToString from './joinToString';
import toNumber from './toNumber';
// Credits:
// @jkroso for string parse library
// Optimized, Extended by @dalisoft
const Number_Match_RegEx = /\s+|([A-Za-z?().,{}:""\[\]#]+)|([-+\/*%]+=)?([-+*\/%]+)?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/gi;
class Tween {

@@ -15,5 +23,5 @@ constructor( object = {} ) {

this.object = object;
this._valuesStart = Tween.createEmptyConst(object);
this._valuesStartRepeat = Tween.createEmptyConst(object);
this._valuesEnd = Tween.createEmptyConst(object);
this._valuesStart = Tween.createEmptyConst( object );
this._valuesStartRepeat = Tween.createEmptyConst( object );
this._valuesEnd = Tween.createEmptyConst( object );
this._chainedTweens = [];

@@ -40,6 +48,6 @@

}
static createEmptyConst (oldObject) {
return typeof(oldObject) === "number" ? 0 : Array.isArray(oldObject) ? [] : typeof(oldObject) === "object" ? {} : '';
static createEmptyConst( oldObject ) {
return typeof( oldObject ) === "number" ? 0 : Array.isArray( oldObject ) ? [] : typeof( oldObject ) === "object" ? {} : '';
}
static checkValidness ( valid ) {
static checkValidness( valid ) {
return valid !== undefined && valid !== null && valid !== '' && valid !== NaN && valid !== Infinity;

@@ -90,7 +98,7 @@ }

let eventsList = this._events[ name ], i = 0;
while (i < eventsList.length) {
if ( eventsList[i] === fn ) {
eventsList.splice(i, 1);
while ( i < eventsList.length ) {
if ( eventsList[ i ] === fn ) {
eventsList.splice( i, 1 );
}
i++
i++;
}

@@ -180,3 +188,3 @@ } else if ( name !== undefined && fn === undefined ) {

this._duration = amount;
this._duration = typeof(amount) === "function" ? amount(this._duration) : amount;

@@ -198,3 +206,3 @@ return this;

for ( let prop in duration ) {
this[prop](duration[prop]);
this[ prop ]( duration[ prop ] );
}

@@ -213,3 +221,2 @@ }

, _valuesStart
, _valuesStartRepeat
, object

@@ -225,12 +232,33 @@ } = this;

// Check if an Array was provided as property value
if (typeof object[property] === "number" && _valuesEnd[property] instanceof Array) {
if ( typeof _valuesEnd[ property ] === "object" ) {
if ( Array.isArray( _valuesEnd[ property ] ) ) {
if ( typeof object[ property ] === "number" ) {
this._valuesEnd[ property ] = [ object[ property ] ].concat( _valuesEnd[ property ] );
} else {
let clonedTween = cloneTween( this, { object: object[ property ], _valuesEnd: _valuesEnd[ property ] } )
.start()
.stop();
if (_valuesEnd[property].length === 0) {
continue;
this._valuesEnd[ property ] = clonedTween;
}
} else {
let clonedTween = cloneTween( this, { object: object[ property ], _valuesEnd: _valuesEnd[ property ] } )
.start()
.stop();
this._valuesEnd[ property ] = clonedTween;
}
} else if ( typeof _valuesEnd[ property ] === "string" && typeof object[ property ] === "string" && Number_Match_RegEx.test(object[ property]) && Number_Match_RegEx.test(_valuesEnd[property]) ) {
// Create a local copy of the Array with the start value at the front
this._valuesEnd[property] = [object[property]].concat(_valuesEnd[property]);
let __get__Start = object[ property ].match(Number_Match_RegEx);
__get__Start = __get__Start.map(toNumber);
let __get__End = _valuesEnd[ property ].match(Number_Match_RegEx);
__get__End = __get__End.map(toNumber);
let clonedTween = cloneTween( this, { object: __get__Start, _valuesEnd: __get__End } )
.start()
.stop();
clonedTween.join = true; // For string tweening
this._valuesEnd[ property ] = clonedTween;
}

@@ -240,11 +268,17 @@

// we should not set that property in the object
if (Tween.checkValidness(object[property]) === false) {
if ( Tween.checkValidness( object[ property ] ) === false ) {
continue;
}
this._valuesStart[property] = object[property];
// If duplicate or non-tweening numerics matched,
// we should delete from _valuesEnd
if ( object[ property ] === _valuesEnd[ property ] ) {
continue;
}
this._valuesStartRepeat[property] = _valuesStart[property] || 0;
this._valuesStart[ property ] = object[ property ];
this._valuesStartRepeat[ property ] = _valuesStart[ property ] || 0;
}

@@ -263,3 +297,2 @@

_isPlaying
, _onStopCallback
, object

@@ -357,5 +390,5 @@ } = this;

}
get ( time ) {
get( time ) {
this.update( time );
return this._object;
return this.object;
}

@@ -378,3 +411,2 @@ update( time = now() ) {

, _valuesStart
, _valuesStartRepeat
, _valuesEnd

@@ -407,3 +439,3 @@ , object

// Don't update properties that do not exist in the source object
if (_valuesStart[property] === undefined) {
if ( _valuesStart[ property ] === undefined ) {
continue;

@@ -415,4 +447,18 @@ }

if ( end instanceof Array ) {
if ( end instanceof Tween ) {
let getValue = end.get( time );
if ( end.join ) {
object[ property ] = joinToString(getValue);
} else {
object[ property ] = getValue;
}
} else if ( Array.isArray( end ) ) {
object[ property ] = _interpolationFunction( end, value );

@@ -419,0 +465,0 @@

@@ -5,2 +5,4 @@ import './shim/object_assign';

import './shim/isArray';
import { getAll, add, removeAll, remove, update, autoPlay, now } from './dist/core';

@@ -14,2 +16,4 @@

export { getAll, add, removeAll, remove, update, autoPlay, now, Tween, Easing, Interpolation };
import cloneTween from './dist/clone';
export { getAll, add, removeAll, remove, update, cloneTween, autoPlay, now, Tween, Easing, Interpolation };

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc