UNPKG

@salla.sa/twilight-components

Version:
4 lines 17.7 kB
/*! * Crafted with ❤ by Salla */ var n={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0},r={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},t=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],e={CSS:{},springs:{}};function u(n,r,t){return Math.min(Math.max(n,r),t)}function a(n,r){return n.indexOf(r)>-1}function o(n,r){return n.apply(null,r)}var i={arr:function(n){return Array.isArray(n)},obj:function(n){return a(Object.prototype.toString.call(n),"Object")},pth:function(n){return i.obj(n)&&n.hasOwnProperty("totalLength")},svg:function(n){return n instanceof SVGElement},inp:function(n){return n instanceof HTMLInputElement},dom:function(n){return n.nodeType||i.svg(n)},str:function(n){return"string"==typeof n},fnc:function(n){return"function"==typeof n},und:function(n){return void 0===n},nil:function(n){return i.und(n)||null===n},hex:function(n){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(n)},rgb:function(n){return/^rgb/.test(n)},hsl:function(n){return/^hsl/.test(n)},col:function(n){return i.hex(n)||i.rgb(n)||i.hsl(n)},key:function(t){return!n.hasOwnProperty(t)&&!r.hasOwnProperty(t)&&"targets"!==t&&"keyframes"!==t}};function c(n){var r=/\(([^)]+)\)/.exec(n);return r?r[1].split(",").map((function(n){return parseFloat(n)})):[]}function f(n,r){var t=c(n),a=u(i.und(t[0])?1:t[0],.1,100),o=u(i.und(t[1])?100:t[1],.1,100),f=u(i.und(t[2])?10:t[2],.1,100),v=u(i.und(t[3])?0:t[3],.1,100),s=Math.sqrt(o/a),l=f/(2*Math.sqrt(o*a)),d=l<1?s*Math.sqrt(1-l*l):0,h=l<1?(l*s-v)/d:-v+s;function p(n){var t=r?r*n/1e3:n;return t=l<1?Math.exp(-t*l*s)*(1*Math.cos(d*t)+h*Math.sin(d*t)):(1+h*t)*Math.exp(-t*s),0===n||1===n?n:1-t}return r?p:function(){var r=e.springs[n];if(r)return r;for(var t=1/6,u=0,a=0;;)if(1===p(u+=t)){if(++a>=16)break}else a=0;var o=u*t*1e3;return e.springs[n]=o,o}}function v(n){return void 0===n&&(n=10),function(r){return Math.ceil(u(r,1e-6,1)*n)*(1/n)}}var s,l,d=function(){var n=.1;function r(n,r){return 1-3*r+3*n}function t(n,r){return 3*r-6*n}function e(n){return 3*n}function u(n,u,a){return((r(u,a)*n+t(u,a))*n+e(u))*n}function a(n,u,a){return 3*r(u,a)*n*n+2*t(u,a)*n+e(u)}return function(r,t,e,o){if(0<=r&&r<=1&&0<=e&&e<=1){var i=new Float32Array(11);if(r!==t||e!==o)for(var c=0;c<11;++c)i[c]=u(c*n,r,e);return function(c){return r===t&&e===o||0===c||1===c?c:u(function(t){for(var o=0,c=1;10!==c&&i[c]<=t;++c)o+=n;--c;var f=o+(t-i[c])/(i[c+1]-i[c])*n,v=a(f,r,e);return v>=.001?function(n,r,t,e){for(var o=0;o<4;++o){var i=a(r,t,e);if(0===i)return r;r-=(u(r,t,e)-n)/i}return r}(t,f,r,e):0===v?f:function(n,r,t,e,a){var o,i,c=0;do{(o=u(i=r+(t-r)/2,e,a)-n)>0?t=i:r=i}while(Math.abs(o)>1e-7&&++c<10);return i}(t,o,o+n,r,e)}(c),t,o)}}}}(),h=(s={linear:function(){return function(n){return n}}},l={Sine:function(){return function(n){return 1-Math.cos(n*Math.PI/2)}},Expo:function(){return function(n){return n?Math.pow(2,10*n-10):0}},Circ:function(){return function(n){return 1-Math.sqrt(1-n*n)}},Back:function(){return function(n){return n*n*(3*n-2)}},Bounce:function(){return function(n){for(var r,t=4;n<((r=Math.pow(2,--t))-1)/11;);return 1/Math.pow(4,3-t)-7.5625*Math.pow((3*r-2)/22-n,2)}},Elastic:function(n,r){void 0===n&&(n=1),void 0===r&&(r=.5);var t=u(n,1,10),e=u(r,.1,2);return function(n){return 0===n||1===n?n:-t*Math.pow(2,10*(n-1))*Math.sin((n-1-e/(2*Math.PI)*Math.asin(1/t))*(2*Math.PI)/e)}}},["Quad","Cubic","Quart","Quint"].forEach((function(n,r){l[n]=function(){return function(n){return Math.pow(n,r+2)}}})),Object.keys(l).forEach((function(n){var r=l[n];s["easeIn"+n]=r,s["easeOut"+n]=function(n,t){return function(e){return 1-r(n,t)(1-e)}},s["easeInOut"+n]=function(n,t){return function(e){return e<.5?r(n,t)(2*e)/2:1-r(n,t)(-2*e+2)/2}},s["easeOutIn"+n]=function(n,t){return function(e){return e<.5?(1-r(n,t)(1-2*e))/2:(r(n,t)(2*e-1)+1)/2}}})),s);function p(n,r){if(i.fnc(n))return n;var t=n.split("(")[0],e=h[t],u=c(n);switch(t){case"spring":return f(n,r);case"cubicBezier":return o(d,u);case"steps":return o(v,u);default:return o(e,u)}}function m(n){try{return document.querySelectorAll(n)}catch(n){return}}function M(n,r){for(var t=n.length,e=arguments.length>=2?arguments[1]:void 0,u=[],a=0;a<t;a++)if(a in n){var o=n[a];r.call(e,o,a,n)&&u.push(o)}return u}function g(n){return n.reduce((function(n,r){return n.concat(i.arr(r)?g(r):r)}),[])}function y(n){return i.arr(n)?n:(i.str(n)&&(n=m(n)||n),n instanceof NodeList||n instanceof HTMLCollection?[].slice.call(n):[n])}function b(n,r){return n.some((function(n){return n===r}))}function w(n){var r={};for(var t in n)r[t]=n[t];return r}function x(n,r){var t=w(n);for(var e in n)t[e]=r.hasOwnProperty(e)?r[e]:n[e];return t}function F(n,r){var t=w(n);for(var e in r)t[e]=i.und(n[e])?r[e]:n[e];return t}function C(n){var r=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(n);if(r)return r[1]}function I(n,r){return i.fnc(n)?n(r.target,r.id,r.total):n}function k(n,r){return n.getAttribute(r)}function B(n,r,t){if(b([t,"deg","rad","turn"],C(r)))return r;var u=e.CSS[r+t];if(!i.und(u))return u;var a=document.createElement(n.tagName),o=n.parentNode&&n.parentNode!==document?n.parentNode:document.body;o.appendChild(a),a.style.position="absolute",a.style.width=100+t;var c=100/a.offsetWidth;o.removeChild(a);var f=c*parseFloat(r);return e.CSS[r+t]=f,f}function O(n,r,t){if(r in n.style){var e=r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),u=n.style[r]||getComputedStyle(n).getPropertyValue(e)||"0";return t?B(n,u,t):u}}function A(n,r){return i.dom(n)&&!i.inp(n)&&(!i.nil(k(n,r))||i.svg(n)&&n[r])?"attribute":i.dom(n)&&b(t,r)?"transform":i.dom(n)&&"transform"!==r&&O(n,r)?"css":null!=n[r]?"object":void 0}function j(n){if(i.dom(n)){for(var r,t=n.style.transform||"",e=/(\w+)\(([^)]*)\)/g,u=new Map;r=e.exec(t);)u.set(r[1],r[2]);return u}}function E(n,r,t,e){switch(A(n,r)){case"transform":return function(n,r,t,e){var u=a(r,"scale")?1:0+function(n){return a(n,"translate")||"perspective"===n?"px":a(n,"rotate")||a(n,"skew")?"deg":void 0}(r),o=j(n).get(r)||u;return t&&(t.transforms.list.set(r,o),t.transforms.last=r),e?B(n,o,e):o}(n,r,e,t);case"css":return O(n,r,t);case"attribute":return k(n,r);default:return n[r]||0}}function $(n,r){var t=/^(\*=|\+=|-=)/.exec(n);if(!t)return n;var e=C(n)||0,u=parseFloat(r),a=parseFloat(n.replace(t[0],""));switch(t[0][0]){case"+":return u+a+e;case"-":return u-a+e;case"*":return u*a+e}}function N(n,r){if(i.col(n))return function(n){return i.rgb(n)?(t=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(r=n))?"rgba("+t[1]+",1)":r:i.hex(n)?function(n){var r=n.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(n,r,t,e){return r+r+t+t+e+e})),t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r);return"rgba("+parseInt(t[1],16)+","+parseInt(t[2],16)+","+parseInt(t[3],16)+",1)"}(n):i.hsl(n)?function(n){var r,t,e,u=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(n)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(n),a=parseInt(u[1],10)/360,o=parseInt(u[2],10)/100,i=parseInt(u[3],10)/100,c=u[4]||1;function f(n,r,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+6*(r-n)*t:t<.5?r:t<2/3?n+(r-n)*(2/3-t)*6:n}if(0==o)r=t=e=i;else{var v=i<.5?i*(1+o):i+o-i*o,s=2*i-v;r=f(s,v,a+1/3),t=f(s,v,a),e=f(s,v,a-1/3)}return"rgba("+255*r+","+255*t+","+255*e+","+c+")"}(n):void 0;var r,t}(n);if(/\s/g.test(n))return n;var t=C(n),e=t?n.substr(0,n.length-t.length):n;return r?e+r:e}function L(n,r){return Math.sqrt(Math.pow(r.x-n.x,2)+Math.pow(r.y-n.y,2))}function S(n){for(var r,t=n.points,e=0,u=0;u<t.numberOfItems;u++){var a=t.getItem(u);u>0&&(e+=L(r,a)),r=a}return e}function X(n){if(n.getTotalLength)return n.getTotalLength();switch(n.tagName.toLowerCase()){case"circle":return function(n){return 2*Math.PI*k(n,"r")}(n);case"rect":return function(n){return 2*k(n,"width")+2*k(n,"height")}(n);case"line":return function(n){return L({x:k(n,"x1"),y:k(n,"y1")},{x:k(n,"x2"),y:k(n,"y2")})}(n);case"polyline":return S(n);case"polygon":return function(n){var r=n.points;return S(n)+L(r.getItem(r.numberOfItems-1),r.getItem(0))}(n)}}function Y(n,r){var t=r||{},e=t.el||function(n){for(var r=n.parentNode;i.svg(r)&&i.svg(r.parentNode);)r=r.parentNode;return r}(n),u=e.getBoundingClientRect(),a=k(e,"viewBox"),o=u.width,c=u.height,f=t.viewBox||(a?a.split(" "):[0,0,o,c]);return{el:e,viewBox:f,x:f[0]/1,y:f[1]/1,w:o,h:c,vW:f[2],vH:f[3]}}function Z(n,r,t){function e(t){return void 0===t&&(t=0),n.el.getPointAtLength(r+t>=1?r+t:0)}var u=Y(n.el,n.svg),a=e(),o=e(-1),i=e(1),c=t?1:u.w/u.vW,f=t?1:u.h/u.vH;switch(n.property){case"x":return(a.x-u.x)*c;case"y":return(a.y-u.y)*f;case"angle":return 180*Math.atan2(i.y-o.y,i.x-o.x)/Math.PI}}function D(n,r){var t=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,e=N(i.pth(n)?n.totalLength:n,r)+"";return{original:e,numbers:e.match(t)?e.match(t).map(Number):[0],strings:i.str(n)||r?e.split(t):[]}}function H(n){return M(n?g(i.arr(n)?n.map(y):y(n)):[],(function(n,r,t){return t.indexOf(n)===r}))}function Q(n){var r=H(n);return r.map((function(n,t){return{target:n,id:t,total:r.length,transforms:{list:j(n)}}}))}function q(n,r){var t=w(r);if(/^spring/.test(t.easing)&&(t.duration=f(t.easing)),i.arr(n)){var e=n.length;2!==e||i.obj(n[0])?i.fnc(r.duration)||(t.duration=r.duration/e):n={value:n}}var u=i.arr(n)?n:[n];return u.map((function(n,t){var e=i.obj(n)&&!i.pth(n)?n:{value:n};return i.und(e.delay)&&(e.delay=t?0:r.delay),i.und(e.endDelay)&&(e.endDelay=t===u.length-1?r.endDelay:0),e})).map((function(n){return F(n,t)}))}var z={css:function(n,r,t){return n.style[r]=t},attribute:function(n,r,t){return n.setAttribute(r,t)},object:function(n,r,t){return n[r]=t},transform:function(n,r,t,e,u){if(e.list.set(r,t),r===e.last||u){var a="";e.list.forEach((function(n,r){a+=r+"("+n+") "})),n.style.transform=a}}};function P(n,r){Q(n).forEach((function(n){for(var t in r){var e=I(r[t],n),u=n.target,a=C(e),o=E(u,t,a,n),i=$(N(e,a||C(o)),o),c=A(u,t);z[c](u,t,i,n.transforms,!0)}}))}function T(n,r){return M(g(n.map((function(n){return r.map((function(r){return function(n,r){var t=A(n.target,r.name);if(t){var e=function(n,r){var t;return n.tweens.map((function(e){var u=function(n,r){var t={};for(var e in n){var u=I(n[e],r);i.arr(u)&&1===(u=u.map((function(n){return I(n,r)}))).length&&(u=u[0]),t[e]=u}return t.duration=parseFloat(t.duration),t.delay=parseFloat(t.delay),t}(e,r),a=u.value,o=i.arr(a)?a[1]:a,c=C(o),f=E(r.target,n.name,c,r),v=t?t.to.original:f,s=i.arr(a)?a[0]:v,l=C(s)||C(f),d=c||l;return i.und(o)&&(o=v),u.from=D(s,d),u.to=D($(o,s),d),u.start=t?t.end:0,u.end=u.start+u.delay+u.duration+u.endDelay,u.easing=p(u.easing,u.duration),u.isPath=i.pth(a),u.isPathTargetInsideSVG=u.isPath&&i.svg(r.target),u.isColor=i.col(u.from.original),u.isColor&&(u.round=1),t=u,u}))}(r,n),u=e[e.length-1];return{type:t,property:r.name,animatable:n,tweens:e,duration:u.end,delay:e[0].delay,endDelay:u.endDelay}}}(n,r)}))}))),(function(n){return!i.und(n)}))}function G(n,r){var t=n.length,e=function(n){return n.timelineOffset?n.timelineOffset:0},u={};return u.duration=t?Math.max.apply(Math,n.map((function(n){return e(n)+n.duration}))):r.duration,u.delay=t?Math.min.apply(Math,n.map((function(n){return e(n)+n.delay}))):r.delay,u.endDelay=t?u.duration-Math.max.apply(Math,n.map((function(n){return e(n)+n.duration-n.endDelay}))):r.endDelay,u}var V=0,W=[],J=function(){var n;function r(t){for(var e=W.length,u=0;u<e;){var a=W[u];a.paused?(W.splice(u,1),e--):(a.tick(t),u++)}n=u>0?requestAnimationFrame(r):void 0}return"undefined"!=typeof document&&document.addEventListener("visibilitychange",(function(){R.suspendWhenDocumentHidden&&(K()?n=cancelAnimationFrame(n):(W.forEach((function(n){return n._onDocumentVisibility()})),J()))})),function(){n||K()&&R.suspendWhenDocumentHidden||!(W.length>0)||(n=requestAnimationFrame(r))}}();function K(){return!!document&&document.hidden}function R(t){void 0===t&&(t={});var e,a=0,o=0,c=0,f=0,v=null;function s(n){var r=window.Promise&&new Promise((function(n){return v=n}));return n.finished=r,r}var l=function(t){var e=x(n,t),u=x(r,t),a=function(n,r){var t=[],e=r.keyframes;for(var u in e&&(r=F(function(n){for(var r=M(g(n.map((function(n){return Object.keys(n)}))),(function(n){return i.key(n)})).reduce((function(n,r){return n.indexOf(r)<0&&n.push(r),n}),[]),t={},e=function(e){var u=r[e];t[u]=n.map((function(n){var r={};for(var t in n)i.key(t)?t==u&&(r.value=n[t]):r[t]=n[t];return r}))},u=0;u<r.length;u++)e(u);return t}(e),r)),r)i.key(u)&&t.push({name:u,tweens:q(r[u],n)});return t}(u,t),o=Q(t.targets),c=T(o,a),f=G(c,u),v=V;return V++,F(e,{id:v,children:[],animatables:o,animations:c,duration:f.duration,delay:f.delay,endDelay:f.endDelay})}(t);function d(){var n=l.direction;"alternate"!==n&&(l.direction="normal"!==n?"normal":"reverse"),l.reversed=!l.reversed,e.forEach((function(n){return n.reversed=l.reversed}))}function h(n){return l.reversed?l.duration-n:n}function p(){a=0,o=h(l.currentTime)*(1/R.speed)}function m(n,r){r&&r.seek(n-r.timelineOffset)}function y(n){for(var r=0,t=l.animations,e=t.length;r<e;){var a=t[r],o=a.animatable,i=a.tweens,c=i.length-1,f=i[c];c&&(f=M(i,(function(r){return n<r.end}))[0]||f);for(var v=u(n-f.start-f.delay,0,f.duration)/f.duration,s=isNaN(v)?1:f.easing(v),d=f.to.strings,h=f.round,p=[],m=f.to.numbers.length,g=void 0,y=0;y<m;y++){var b=void 0,w=f.to.numbers[y],x=f.from.numbers[y]||0;b=f.isPath?Z(f.value,s*w,f.isPathTargetInsideSVG):x+s*(w-x),h&&(f.isColor&&y>2||(b=Math.round(b*h)/h)),p.push(b)}var F=d.length;if(F){g=d[0];for(var C=0;C<F;C++){var I=d[C+1],k=p[C];isNaN(k)||(g+=I?k+I:k+" ")}}else g=p[0];z[a.type](o.target,a.property,g,o.transforms),a.currentValue=g,r++}}function b(n){l[n]&&!l.passThrough&&l[n](l)}function w(n){var r=l.duration,t=l.delay,i=r-l.endDelay,p=h(n);l.progress=u(p/r*100,0,100),l.reversePlayback=p<l.currentTime,e&&function(n){if(l.reversePlayback)for(var r=f;r--;)m(n,e[r]);else for(var t=0;t<f;t++)m(n,e[t])}(p),!l.began&&l.currentTime>0&&(l.began=!0,b("begin")),!l.loopBegan&&l.currentTime>0&&(l.loopBegan=!0,b("loopBegin")),p<=t&&0!==l.currentTime&&y(0),(p>=i&&l.currentTime!==r||!r)&&y(r),p>t&&p<i?(l.changeBegan||(l.changeBegan=!0,l.changeCompleted=!1,b("changeBegin")),b("change"),y(p)):l.changeBegan&&(l.changeCompleted=!0,l.changeBegan=!1,b("changeComplete")),l.currentTime=u(p,0,r),l.began&&b("update"),n>=r&&(o=0,l.remaining&&!0!==l.remaining&&l.remaining--,l.remaining?(a=c,b("loopComplete"),l.loopBegan=!1,"alternate"===l.direction&&d()):(l.paused=!0,l.completed||(l.completed=!0,b("loopComplete"),b("complete"),!l.passThrough&&"Promise"in window&&(v(),s(l)))))}return s(l),l.reset=function(){var n=l.direction;l.passThrough=!1,l.currentTime=0,l.progress=0,l.paused=!0,l.began=!1,l.loopBegan=!1,l.changeBegan=!1,l.completed=!1,l.changeCompleted=!1,l.reversePlayback=!1,l.reversed="reverse"===n,l.remaining=l.loop;for(var r=f=(e=l.children).length;r--;)l.children[r].reset();(l.reversed&&!0!==l.loop||"alternate"===n&&1===l.loop)&&l.remaining++,y(l.reversed?l.duration:0)},l._onDocumentVisibility=p,l.set=function(n,r){return P(n,r),l},l.tick=function(n){c=n,a||(a=c),w((c+(o-a))*R.speed)},l.seek=function(n){w(h(n))},l.pause=function(){l.paused=!0,p()},l.play=function(){l.paused&&(l.completed&&l.reset(),l.paused=!1,W.push(l),p(),J())},l.reverse=function(){d(),l.completed=!l.reversed,p()},l.restart=function(){l.reset(),l.play()},l.remove=function(n){_(H(n),l)},l.reset(),l.autoplay&&l.play(),l}function U(n,r){for(var t=r.length;t--;)b(n,r[t].animatable.target)&&r.splice(t,1)}function _(n,r){var t=r.animations,e=r.children;U(n,t);for(var u=e.length;u--;){var a=e[u],o=a.animations;U(n,o),o.length||a.children.length||e.splice(u,1)}t.length||e.length||r.pause()}R.version="3.2.1",R.speed=1,R.suspendWhenDocumentHidden=!0,R.running=W,R.remove=function(n){for(var r=H(n),t=W.length;t--;)_(r,W[t])},R.get=E,R.set=P,R.convertPx=B,R.path=function(n,r){var t=i.str(n)?m(n)[0]:n,e=r||100;return function(n){return{property:n,el:t,svg:Y(t),totalLength:X(t)*(e/100)}}},R.setDashoffset=function(n){var r=X(n);return n.setAttribute("stroke-dasharray",r),r},R.stagger=function(n,r){void 0===r&&(r={});var t=r.direction||"normal",e=r.easing?p(r.easing):null,u=r.grid,a=r.axis,o=r.from||0,c="first"===o,f="center"===o,v="last"===o,s=i.arr(n),l=s?parseFloat(n[0]):parseFloat(n),d=s?parseFloat(n[1]):0,h=C(s?n[1]:n)||0,m=r.start||0+(s?l:0),M=[],g=0;return function(n,r,i){if(c&&(o=0),f&&(o=(i-1)/2),v&&(o=i-1),!M.length){for(var p=0;p<i;p++){if(u){var y=f?(u[0]-1)/2:o%u[0],b=f?(u[1]-1)/2:Math.floor(o/u[0]),w=y-p%u[0],x=b-Math.floor(p/u[0]),F=Math.sqrt(w*w+x*x);"x"===a&&(F=-w),"y"===a&&(F=-x),M.push(F)}else M.push(Math.abs(o-p));g=Math.max.apply(Math,M)}e&&(M=M.map((function(n){return e(n/g)*g}))),"reverse"===t&&(M=M.map((function(n){return a?n<0?-1*n:-n:Math.abs(g-n)})))}return m+(s?(d-l)/g:l)*(Math.round(100*M[r])/100)+h}},R.timeline=function(n){void 0===n&&(n={});var t=R(n);return t.duration=0,t.add=function(e,u){var a=W.indexOf(t),o=t.children;function c(n){n.passThrough=!0}a>-1&&W.splice(a,1);for(var f=0;f<o.length;f++)c(o[f]);var v=F(e,x(r,n));v.targets=v.targets||n.targets;var s=t.duration;v.autoplay=!1,v.direction=t.direction,v.timelineOffset=i.und(u)?s:$(u,s),c(t),t.seek(v.timelineOffset);var l=R(v);c(l),o.push(l);var d=G(o,n);return t.delay=d.delay,t.endDelay=d.endDelay,t.duration=d.duration,t.seek(0),t.reset(),t.autoplay&&t.play(),t},t},R.easing=p,R.penner=h,R.random=function(n,r){return Math.floor(Math.random()*(r-n+1))+n};export{R as a}