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

popmotion

Package Overview
Dependencies
Maintainers
1
Versions
312
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

popmotion - npm Package Compare versions

Comparing version 9.4.0 to 9.4.1

14

dist/es/utils/mix-complex.js

@@ -7,3 +7,3 @@ import { __spreadArray, __assign } from 'tslib';

import { pipe } from './pipe.js';
import { invariant } from 'hey-listen';
import { warning } from 'hey-listen';

@@ -72,8 +72,14 @@ function getMixer(origin, target) {

var targetStats = analyse(target);
invariant(originStats.numHSL === targetStats.numHSL &&
var canInterpolate = originStats.numHSL === targetStats.numHSL &&
originStats.numRGB === targetStats.numRGB &&
originStats.numNumbers >= targetStats.numNumbers, "Complex values '" + origin + "' and '" + target + "' too different to mix. Ensure all colors are of the same type.");
return pipe(mixArray(originStats.parsed, targetStats.parsed), template);
originStats.numNumbers >= targetStats.numNumbers;
if (canInterpolate) {
return pipe(mixArray(originStats.parsed, targetStats.parsed), template);
}
else {
warning(true, "Complex values '" + origin + "' and '" + target + "' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.");
return function (p) { return (p > 0 ? target : origin); };
}
};
export { mixArray, mixComplex, mixObject };

@@ -332,6 +332,12 @@ 'use strict';

var targetStats = analyse(target);
heyListen.invariant(originStats.numHSL === targetStats.numHSL &&
var canInterpolate = originStats.numHSL === targetStats.numHSL &&
originStats.numRGB === targetStats.numRGB &&
originStats.numNumbers >= targetStats.numNumbers, "Complex values '" + origin + "' and '" + target + "' too different to mix. Ensure all colors are of the same type.");
return pipe(mixArray(originStats.parsed, targetStats.parsed), template);
originStats.numNumbers >= targetStats.numNumbers;
if (canInterpolate) {
return pipe(mixArray(originStats.parsed, targetStats.parsed), template);
}
else {
heyListen.warning(true, "Complex values '" + origin + "' and '" + target + "' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.");
return function (p) { return (p > 0 ? target : origin); };
}
};

@@ -338,0 +344,0 @@

@@ -596,6 +596,12 @@ (function (global, factory) {

var targetStats = analyse(target);
invariant(originStats.numHSL === targetStats.numHSL &&
var canInterpolate = originStats.numHSL === targetStats.numHSL &&
originStats.numRGB === targetStats.numRGB &&
originStats.numNumbers >= targetStats.numNumbers, "Complex values '" + origin + "' and '" + target + "' too different to mix. Ensure all colors are of the same type.");
return pipe(mixArray(originStats.parsed, targetStats.parsed), template);
originStats.numNumbers >= targetStats.numNumbers;
if (canInterpolate) {
return pipe(mixArray(originStats.parsed, targetStats.parsed), template);
}
else {
warning(true, "Complex values '" + origin + "' and '" + target + "' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.");
return function (p) { return (p > 0 ? target : origin); };
}
};

@@ -602,0 +608,0 @@

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

!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((n="undefined"!=typeof globalThis?globalThis:n||self).popmotion={})}(this,(function(n){"use strict";var r=function(){return(r=Object.assign||function(n){for(var r,t=1,e=arguments.length;t<e;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o]);return n}).apply(this,arguments)};function t(n,r){var t={};for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&r.indexOf(e)<0&&(t[e]=n[e]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(e=Object.getOwnPropertySymbols(n);o<e.length;o++)r.indexOf(e[o])<0&&Object.prototype.propertyIsEnumerable.call(n,e[o])&&(t[e[o]]=n[e[o]])}return t}var e=function(n,r,t){return Math.min(Math.max(t,n),r)},o=.001;function a(n){var r,t,a=n.duration,i=void 0===a?800:a,f=n.bounce,s=void 0===f?.25:f,c=n.velocity,v=void 0===c?0:c,p=n.mass,l=void 0===p?1:p,d=1-s;d=e(.05,1,d),i=e(.01,10,i/1e3),d<1?(r=function(n){var r=n*d,t=r*i,e=r-v,a=u(n,d),f=Math.exp(-t);return o-e/a*f},t=function(n){var t=n*d*i,e=t*v+v,a=Math.pow(d,2)*Math.pow(n,2)*i,f=Math.exp(-t),s=u(Math.pow(n,2),d);return(-r(n)+o>0?-1:1)*((e-a)*f)/s}):(r=function(n){return Math.exp(-n*i)*((n-v)*i+1)-.001},t=function(n){return Math.exp(-n*i)*(i*i*(v-n))});var h=function(n,r,t){for(var e=t,o=1;o<12;o++)e-=n(e)/r(e);return e}(r,t,5/i);if(i*=1e3,isNaN(h))return{stiffness:100,damping:10,duration:i};var m=Math.pow(h,2)*l;return{stiffness:m,damping:2*d*Math.sqrt(l*m),duration:i}}function u(n,r){return n*Math.sqrt(1-r*r)}var i=["duration","bounce"],f=["stiffness","damping","mass"];function s(n,r){return r.some((function(r){return void 0!==n[r]}))}function c(n){var e=n.from,o=void 0===e?0:e,c=n.to,p=void 0===c?1:c,l=n.restSpeed,d=void 0===l?2:l,h=n.restDelta,m=t(n,["from","to","restSpeed","restDelta"]),y={done:!1,value:o},g=function(n){var t=r({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},n);if(!s(n,f)&&s(n,i)){var e=a(n);(t=r(r(r({},t),e),{velocity:0,mass:1})).isResolvedFromDuration=!0}return t}(m),M=g.stiffness,b=g.damping,x=g.mass,w=g.velocity,O=g.duration,I=g.isResolvedFromDuration,P=v,A=v;function D(){var n=w?-w/1e3:0,r=p-o,t=b/(2*Math.sqrt(M*x)),e=Math.sqrt(M/x)/1e3;if(null!=h||(h=Math.abs(p-o)<=1?.01:.4),t<1){var a=u(e,t);P=function(o){var u=Math.exp(-t*e*o);return p-u*((n+t*e*r)/a*Math.sin(a*o)+r*Math.cos(a*o))},A=function(o){var u=Math.exp(-t*e*o);return t*e*u*(Math.sin(a*o)*(n+t*e*r)/a+r*Math.cos(a*o))-u*(Math.cos(a*o)*(n+t*e*r)-a*r*Math.sin(a*o))}}else if(1===t)P=function(t){return p-Math.exp(-e*t)*(r+(n+e*r)*t)};else{var i=e*Math.sqrt(t*t-1);P=function(o){var a=Math.exp(-t*e*o),u=Math.min(i*o,300);return p-a*((n+t*e*r)*Math.sinh(u)+i*r*Math.cosh(u))/i}}}return D(),{next:function(n){var r=P(n);if(I)y.done=n>=O;else{var t=1e3*A(n),e=Math.abs(t)<=d,o=Math.abs(p-r)<=h;y.done=e&&o}return y.value=y.done?p:r,y},flipTarget:function(){var n;w=-w,o=(n=[p,o])[0],p=n[1],D()}}}c.needsInterpolation=function(n,r){return"string"==typeof n||"string"==typeof r};var v=function(n){return 0},p=function(n,r,t){var e=r-n;return 0===e?1:(t-n)/e},l=function(n,r,t){return-t*n+t*r+n},d=function(){return(d=Object.assign||function(n){for(var r,t=1,e=arguments.length;t<e;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o]);return n}).apply(this,arguments)},h=function(n,r){return function(t){return Math.max(Math.min(t,r),n)}},m=function(n){return n%1?Number(n.toFixed(5)):n},y=/(-)?([\d]*\.?[\d])+/g,g=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi,M=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function b(n){return"string"==typeof n}var x={test:function(n){return"number"==typeof n},parse:parseFloat,transform:function(n){return n}},w=d(d({},x),{transform:h(0,1)});d(d({},x),{default:1});var O,I=(O="%",{test:function(n){return b(n)&&n.endsWith(O)&&1===n.split(" ").length},parse:parseFloat,transform:function(n){return""+n+O}});d(d({},I),{parse:function(n){return I.parse(n)/100},transform:function(n){return I.transform(100*n)}});var P=function(n,r){return function(t){return Boolean(b(t)&&M.test(t)&&t.startsWith(n)||r&&Object.prototype.hasOwnProperty.call(t,r))}},A=function(n,r,t){return function(e){var o;if(!b(e))return e;var a=e.match(y),u=a[0],i=a[1],f=a[2],s=a[3];return(o={})[n]=parseFloat(u),o[r]=parseFloat(i),o[t]=parseFloat(f),o.alpha=void 0!==s?parseFloat(s):1,o}},D={test:P("hsl","hue"),parse:A("hue","saturation","lightness"),transform:function(n){var r=n.hue,t=n.saturation,e=n.lightness,o=n.alpha,a=void 0===o?1:o;return"hsla("+Math.round(r)+", "+I.transform(m(t))+", "+I.transform(m(e))+", "+m(w.transform(a))+")"}},T=h(0,255),F=d(d({},x),{transform:function(n){return Math.round(T(n))}}),S={test:P("rgb","red"),parse:A("red","green","blue"),transform:function(n){var r=n.red,t=n.green,e=n.blue,o=n.alpha,a=void 0===o?1:o;return"rgba("+F.transform(r)+", "+F.transform(t)+", "+F.transform(e)+", "+m(w.transform(a))+")"}};var j={test:P("#"),parse:function(n){var r="",t="",e="",o="";return n.length>5?(r=n.substr(1,2),t=n.substr(3,2),e=n.substr(5,2),o=n.substr(7,2)):(r=n.substr(1,1),t=n.substr(2,1),e=n.substr(3,1),o=n.substr(4,1),r+=r,t+=t,e+=e,o+=o),{red:parseInt(r,16),green:parseInt(t,16),blue:parseInt(e,16),alpha:o?parseInt(o,16)/255:1}},transform:S.transform},C=function(n){return S.test(n)||j.test(n)||D.test(n)},R=function(n){return S.test(n)?S.parse(n):D.test(n)?D.parse(n):j.parse(n)},k=function(n){return b(n)?n:n.hasOwnProperty("red")?S.transform(n):D.transform(n)},q="${c}",N="${n}";function E(n){var r=[],t=0,e=n.match(g);e&&(t=e.length,n=n.replace(g,q),r.push.apply(r,e.map(R)));var o=n.match(y);return o&&(n=n.replace(y,N),r.push.apply(r,o.map(x.parse))),{values:r,numColors:t,tokenised:n}}function U(n){return E(n).values}function z(n){var r=E(n),t=r.values,e=r.numColors,o=r.tokenised,a=t.length;return function(n){for(var r=o,t=0;t<a;t++)r=r.replace(t<e?q:N,t<e?k(n[t]):m(n[t]));return r}}var B=function(n){return"number"==typeof n?0:n};var W={test:function(n){var r,t,e,o;return isNaN(n)&&b(n)&&(null!==(t=null===(r=n.match(y))||void 0===r?void 0:r.length)&&void 0!==t?t:0)+(null!==(o=null===(e=n.match(g))||void 0===e?void 0:e.length)&&void 0!==o?o:0)>0},parse:U,createTransformer:z,getAnimatableNone:function(n){var r=U(n);return z(n)(r.map(B))}},$=function(n,r,t){var e=n*n,o=r*r;return Math.sqrt(Math.max(0,t*(o-e)+e))},_=[j,S,D],G=function(n){return _.find((function(r){return r.test(n)}))},H=function(n,t){var e=G(n),o=G(t);e.transform,o.transform;var a=e.parse(n),u=o.parse(t),i=r({},a),f=e===D?l:$;return function(n){for(var r in i)"alpha"!==r&&(i[r]=f(a[r],u[r],n));return i.alpha=l(a.alpha,u.alpha,n),e.transform(i)}},L={x:0,y:0,z:0},V=function(n){return"number"==typeof n},J=function(n,r){return function(t){return r(n(t))}},K=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return n.reduce(J)};function Q(n,r){return V(n)?function(t){return l(n,r,t)}:C(n)?H(n,r):nn(n,r)}var X=function(n,r){var t=function(n,r){for(var t=0,e=r.length,o=n.length;t<e;t++,o++)n[o]=r[t];return n}([],n),e=t.length,o=n.map((function(n,t){return Q(n,r[t])}));return function(n){for(var r=0;r<e;r++)t[r]=o[r](n);return t}},Y=function(n,t){var e=r(r({},n),t),o={};for(var a in e)void 0!==n[a]&&void 0!==t[a]&&(o[a]=Q(n[a],t[a]));return function(n){for(var r in o)e[r]=o[r](n);return e}};function Z(n){for(var r=W.parse(n),t=r.length,e=0,o=0,a=0,u=0;u<t;u++)e||"number"==typeof r[u]?e++:void 0!==r[u].hue?a++:o++;return{parsed:r,numNumbers:e,numRGB:o,numHSL:a}}var nn=function(n,r){var t=W.createTransformer(r),e=Z(n),o=Z(r);return K(X(e.parsed,o.parsed),t)},rn=function(n,r){return function(t){return l(n,r,t)}};function tn(n,r,t){for(var e,o=[],a=t||("number"==typeof(e=n[0])?rn:"string"==typeof e?C(e)?H:nn:Array.isArray(e)?X:"object"==typeof e?Y:void 0),u=n.length-1,i=0;i<u;i++){var f=a(n[i],n[i+1]);if(r){var s=Array.isArray(r)?r[i]:r;f=K(s,f)}o.push(f)}return o}function en(n,r,t){var o=void 0===t?{}:t,a=o.clamp,u=void 0===a||a,i=o.ease,f=o.mixer,s=n.length;r.length,!i||!Array.isArray(i)||i.length,n[0]>n[s-1]&&(n=[].concat(n),r=[].concat(r),n.reverse(),r.reverse());var c=tn(r,i,f),v=2===s?function(n,r){var t=n[0],e=n[1],o=r[0];return function(n){return o(p(t,e,n))}}(n,c):function(n,r){var t=n.length,e=t-1;return function(o){var a=0,u=!1;if(o<=n[0]?u=!0:o>=n[e]&&(a=e-1,u=!0),!u){for(var i=1;i<t&&!(n[i]>o||i===e);i++);a=i-1}var f=p(n[a],n[a+1],o);return r[a](f)}}(n,c);return u?function(r){return v(e(n[0],n[s-1],r))}:v}var on=function(n){return function(r){return 1-n(1-r)}},an=function(n){return function(r){return r<=.5?n(2*r)/2:(2-n(2*(1-r)))/2}},un=function(n){return function(r){return Math.pow(r,n)}},fn=function(n){return function(r){return r*r*((n+1)*r-n)}},sn=function(n){var r=fn(n);return function(n){return(n*=2)<1?.5*r(n):.5*(2-Math.pow(2,-10*(n-1)))}},cn=function(n){return n},vn=un(2),pn=on(vn),ln=an(vn),dn=function(n){return 1-Math.sin(Math.acos(n))},hn=on(dn),mn=an(hn),yn=fn(1.525),gn=on(yn),Mn=an(yn),bn=sn(1.525),xn=function(n){if(1===n||0===n)return n;var r=n*n;return n<.36363636363636365?7.5625*r:n<.7272727272727273?9.075*r-9.9*n+3.4:n<.9?12.066481994459833*r-19.63545706371191*n+8.898060941828255:10.8*n*n-20.52*n+10.72},wn=on(xn);function On(n,r){return n.map((function(){return r||ln})).splice(0,n.length-1)}function In(n){var r=n.from,t=void 0===r?0:r,e=n.to,o=void 0===e?1:e,a=n.ease,u=n.offset,i=n.duration,f=void 0===i?300:i,s={done:!1,value:t},c=Array.isArray(o)?o:[t,o],v=function(n,r){return n.map((function(n){return n*r}))}(u&&u.length===c.length?u:function(n){var r=n.length;return n.map((function(n,t){return 0!==t?t/(r-1):0}))}(c),f);function p(){return en(v,c,{ease:Array.isArray(a)?a:On(c,a)})}var l=p();return{next:function(n){return s.value=l(n),s.done=n>=f,s},flipTarget:function(){c.reverse(),l=p()}}}function Pn(n){var r=n.velocity,t=void 0===r?0:r,e=n.from,o=void 0===e?0:e,a=n.power,u=void 0===a?.8:a,i=n.timeConstant,f=void 0===i?350:i,s=n.restDelta,c=void 0===s?.5:s,v=n.modifyTarget,p={done:!1,value:o},l=u*t,d=o+l,h=void 0===v?d:v(d);return h!==d&&(l=h-o),{next:function(n){var r=-l*Math.exp(-n/f);return p.done=!(r>c||r<-c),p.value=p.done?h:h+r,p},flipTarget:function(){}}}var An={keyframes:In,spring:c,decay:Pn};var Dn=1/60*1e3,Tn="undefined"!=typeof performance?function(){return performance.now()}:function(){return Date.now()},Fn="undefined"!=typeof window?function(n){return window.requestAnimationFrame(n)}:function(n){return setTimeout((function(){return n(Tn())}),Dn)};var Sn=!0,jn=!1,Cn=!1,Rn={delta:0,timestamp:0},kn=["read","update","preRender","render","postRender"],qn=kn.reduce((function(n,r){return n[r]=function(n){var r=[],t=[],e=0,o=!1,a=new WeakSet,u={schedule:function(n,u,i){void 0===u&&(u=!1),void 0===i&&(i=!1);var f=i&&o,s=f?r:t;return u&&a.add(n),-1===s.indexOf(n)&&(s.push(n),f&&o&&(e=r.length)),n},cancel:function(n){var r=t.indexOf(n);-1!==r&&t.splice(r,1),a.delete(n)},process:function(i){var f;if(o=!0,r=(f=[t,r])[0],(t=f[1]).length=0,e=r.length)for(var s=0;s<e;s++){var c=r[s];c(i),a.has(c)&&(u.schedule(c),n())}o=!1}};return u}((function(){return jn=!0})),n}),{}),Nn=kn.reduce((function(n,r){var t=qn[r];return n[r]=function(n,r,e){return void 0===r&&(r=!1),void 0===e&&(e=!1),jn||Bn(),t.schedule(n,r,e)},n}),{}),En=kn.reduce((function(n,r){return n[r]=qn[r].cancel,n}),{}),Un=function(n){return qn[n].process(Rn)},zn=function(n){jn=!1,Rn.delta=Sn?Dn:Math.max(Math.min(n-Rn.timestamp,40),1),Rn.timestamp=n,Cn=!0,kn.forEach(Un),Cn=!1,jn&&(Sn=!1,Fn(zn))},Bn=function(){jn=!0,Sn=!0,Cn||Fn(zn)},Wn=function(){return Rn};function $n(n,r,t){return void 0===t&&(t=0),n-r-t}var _n=function(n){var r=function(r){var t=r.delta;return n(t)};return{start:function(){return Nn.update(r,!0)},stop:function(){return En.update(r)}}};function Gn(n){var e,o,a,u,i,f=n.from,s=n.autoplay,v=void 0===s||s,p=n.driver,l=void 0===p?_n:p,d=n.elapsed,h=void 0===d?0:d,m=n.repeat,y=void 0===m?0:m,g=n.repeatType,M=void 0===g?"loop":g,b=n.repeatDelay,x=void 0===b?0:b,w=n.onPlay,O=n.onStop,I=n.onComplete,P=n.onRepeat,A=n.onUpdate,D=t(n,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]),T=D.to,F=0,S=D.duration,j=!1,C=!0,R=function(n){if(Array.isArray(n.to))return In;if(An[n.type])return An[n.type];var r=new Set(Object.keys(n));return r.has("ease")||r.has("duration")&&!r.has("dampingRatio")?In:r.has("dampingRatio")||r.has("stiffness")||r.has("mass")||r.has("damping")||r.has("restSpeed")||r.has("restDelta")?c:In}(D);(null===(o=(e=R).needsInterpolation)||void 0===o?void 0:o.call(e,f,T))&&(i=en([0,100],[f,T],{clamp:!1}),f=0,T=100);var k=R(r(r({},D),{from:f,to:T}));function q(){F++,"reverse"===M?h=function(n,r,t,e){return void 0===t&&(t=0),void 0===e&&(e=!0),e?$n(r+-n,r,t):r-(n-r)+t}(h,S,x,C=F%2==0):(h=$n(h,S,x),"mirror"===M&&k.flipTarget()),j=!1,P&&P()}function N(n){if(C||(n=-n),h+=n,!j){var r=k.next(Math.max(0,h));u=r.value,i&&(u=i(u)),j=C?r.done:h<=0}null==A||A(u),j&&(0===F&&(null!=S||(S=h)),F<y?function(n,r,t,e){return e?n>=r+t:n<=-t}(h,S,x,C)&&q():(a.stop(),I&&I()))}return v&&(null==w||w(),(a=l(N)).start()),{stop:function(){null==O||O(),a.stop()}}}function Hn(n,r){return r?n*(1e3/r):0}var Ln=function(n){return 180*n/Math.PI},Vn=function(n){return n},Jn=function(n){return void 0===n&&(n=Vn),function(r,t,e){var o=t-e,a=-(0-r+1)*(0-n(Math.abs(o)));return o<=0?t+a:t-a}},Kn=Jn(),Qn=Jn(Math.sqrt),Xn=function(n){return n*Math.PI/180},Yn=function(n){return n.hasOwnProperty("x")&&n.hasOwnProperty("y")},Zn=function(n){return Yn(n)&&n.hasOwnProperty("z")},nr=function(n,r){return Math.abs(n-r)};var rr=function(n,r){return void 0===r&&(r=2),r=Math.pow(10,r),Math.round(n*r)/r},tr=function(n,r,t,e){return void 0===e&&(e=0),rr(n+t*(r-n)/Math.max(e,t))};var er=function(n,r){return 1-3*r+3*n},or=function(n,r){return 3*r-6*n},ar=function(n){return 3*n},ur=function(n,r,t){return((er(r,t)*n+or(r,t))*n+ar(r))*n},ir=function(n,r,t){return 3*er(r,t)*n*n+2*or(r,t)*n+ar(r)};var fr=.1;n.angle=function(n,r){return void 0===r&&(r=L),Ln(Math.atan2(r.y-n.y,r.x-n.x))},n.animate=Gn,n.anticipate=bn,n.applyOffset=function(n,r){var t=!0;return void 0===r&&(r=n,t=!1),function(e){return t?e-n+r:(n=e,t=!0,r)}},n.attract=Kn,n.attractExpo=Qn,n.backIn=yn,n.backInOut=Mn,n.backOut=gn,n.bounceIn=wn,n.bounceInOut=function(n){return n<.5?.5*(1-xn(1-2*n)):.5*xn(2*n-1)+.5},n.bounceOut=xn,n.circIn=dn,n.circInOut=mn,n.circOut=hn,n.clamp=e,n.createAnticipate=sn,n.createAttractor=Jn,n.createBackIn=fn,n.createExpoIn=un,n.cubicBezier=function(n,r,t,e){if(n===r&&t===e)return cn;for(var o=new Float32Array(11),a=0;a<11;++a)o[a]=ur(a*fr,n,t);function u(r){for(var e=0,a=1;10!==a&&o[a]<=r;++a)e+=fr;--a;var u=e+(r-o[a])/(o[a+1]-o[a])*fr,i=ir(u,n,t);return i>=.001?function(n,r,t,e){for(var o=0;o<8;++o){var a=ir(r,t,e);if(0===a)return r;r-=(ur(r,t,e)-n)/a}return r}(r,u,n,t):0===i?u:function(n,r,t,e,o){var a,u,i=0;do{(a=ur(u=r+(t-r)/2,e,o)-n)>0?t=u:r=u}while(Math.abs(a)>1e-7&&++i<10);return u}(r,e,e+fr,n,t)}return function(n){return 0===n||1===n?n:ur(u(n),r,e)}},n.decay=Pn,n.degreesToRadians=Xn,n.distance=function(n,r){if(V(n)&&V(r))return nr(n,r);if(Yn(n)&&Yn(r)){var t=nr(n.x,r.x),e=nr(n.y,r.y),o=Zn(n)&&Zn(r)?nr(n.z,r.z):0;return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(o,2))}},n.easeIn=vn,n.easeInOut=ln,n.easeOut=pn,n.inertia=function(n){var t,e=n.from,o=void 0===e?0:e,a=n.velocity,u=void 0===a?0:a,i=n.min,f=n.max,s=n.power,c=void 0===s?.8:s,v=n.timeConstant,p=void 0===v?750:v,l=n.bounceStiffness,d=void 0===l?500:l,h=n.bounceDamping,m=void 0===h?10:h,y=n.restDelta,g=void 0===y?1:y,M=n.modifyTarget,b=n.driver,x=n.onUpdate,w=n.onComplete,O=n.onStop;function I(n){return void 0!==i&&n<i||void 0!==f&&n>f}function P(n){return void 0===i?f:void 0===f||Math.abs(i-n)<Math.abs(f-n)?i:f}function A(n){null==t||t.stop(),t=Gn(r(r({},n),{driver:b,onUpdate:function(r){var t;null==x||x(r),null===(t=n.onUpdate)||void 0===t||t.call(n,r)},onComplete:w,onStop:O}))}function D(n){A(r({type:"spring",stiffness:d,damping:m,restDelta:g},n))}if(I(o))D({from:o,velocity:u,to:P(o)});else{var T=c*u+o;void 0!==M&&(T=M(T));var F,S,j=P(T),C=j===i?-1:1;A({type:"decay",from:o,velocity:u,timeConstant:p,power:c,restDelta:g,modifyTarget:M,onUpdate:I(T)?function(n){F=S,S=n,u=Hn(n-F,Wn().delta),(1===C&&n>j||-1===C&&n<j)&&D({from:n,to:j,velocity:u})}:void 0})}return{stop:function(){return null==t?void 0:t.stop()}}},n.interpolate=en,n.isPoint=Yn,n.isPoint3D=Zn,n.keyframes=In,n.linear=cn,n.mirrorEasing=an,n.mix=l,n.mixColor=H,n.mixComplex=nn,n.pipe=K,n.pointFromVector=function(n,r,t){return r=Xn(r),{x:t*Math.cos(r)+n.x,y:t*Math.sin(r)+n.y}},n.progress=p,n.radiansToDegrees=Ln,n.reverseEasing=on,n.smooth=function(n){void 0===n&&(n=50);var r=0,t=0;return function(e){var o=Wn().timestamp,a=o!==t?o-t:0,u=a?tr(r,e,a,n):r;return t=o,r=u,u}},n.smoothFrame=tr,n.snap=function(n){if("number"==typeof n)return function(r){return Math.round(r/n)*n};var r=0,t=n.length;return function(e){var o=Math.abs(n[0]-e);for(r=1;r<t;r++){var a=n[r],u=Math.abs(a-e);if(0===u)return a;if(u>o)return n[r-1];if(r===t-1)return a;o=u}}},n.spring=c,n.steps=function(n,r){return void 0===r&&(r="end"),function(t){var o=(t="end"===r?Math.min(t,.999):Math.max(t,.001))*n,a="end"===r?Math.floor(o):Math.ceil(o);return e(0,1,a/n)}},n.toDecimal=rr,n.velocityPerFrame=function(n,r){return n/(1e3/r)},n.velocityPerSecond=Hn,n.wrap=function(n,r,t){var e=r-n;return((t-n)%e+e)%e+n},Object.defineProperty(n,"__esModule",{value:!0})}));
!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((n="undefined"!=typeof globalThis?globalThis:n||self).popmotion={})}(this,(function(n){"use strict";var r=function(){return(r=Object.assign||function(n){for(var r,t=1,e=arguments.length;t<e;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o]);return n}).apply(this,arguments)};function t(n,r){var t={};for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&r.indexOf(e)<0&&(t[e]=n[e]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(e=Object.getOwnPropertySymbols(n);o<e.length;o++)r.indexOf(e[o])<0&&Object.prototype.propertyIsEnumerable.call(n,e[o])&&(t[e[o]]=n[e[o]])}return t}var e=function(n,r,t){return Math.min(Math.max(t,n),r)},o=.001;function a(n){var r,t,a=n.duration,i=void 0===a?800:a,f=n.bounce,s=void 0===f?.25:f,c=n.velocity,v=void 0===c?0:c,p=n.mass,l=void 0===p?1:p,d=1-s;d=e(.05,1,d),i=e(.01,10,i/1e3),d<1?(r=function(n){var r=n*d,t=r*i,e=r-v,a=u(n,d),f=Math.exp(-t);return o-e/a*f},t=function(n){var t=n*d*i,e=t*v+v,a=Math.pow(d,2)*Math.pow(n,2)*i,f=Math.exp(-t),s=u(Math.pow(n,2),d);return(-r(n)+o>0?-1:1)*((e-a)*f)/s}):(r=function(n){return Math.exp(-n*i)*((n-v)*i+1)-.001},t=function(n){return Math.exp(-n*i)*(i*i*(v-n))});var h=function(n,r,t){for(var e=t,o=1;o<12;o++)e-=n(e)/r(e);return e}(r,t,5/i);if(i*=1e3,isNaN(h))return{stiffness:100,damping:10,duration:i};var m=Math.pow(h,2)*l;return{stiffness:m,damping:2*d*Math.sqrt(l*m),duration:i}}function u(n,r){return n*Math.sqrt(1-r*r)}var i=["duration","bounce"],f=["stiffness","damping","mass"];function s(n,r){return r.some((function(r){return void 0!==n[r]}))}function c(n){var e=n.from,o=void 0===e?0:e,c=n.to,p=void 0===c?1:c,l=n.restSpeed,d=void 0===l?2:l,h=n.restDelta,m=t(n,["from","to","restSpeed","restDelta"]),y={done:!1,value:o},g=function(n){var t=r({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},n);if(!s(n,f)&&s(n,i)){var e=a(n);(t=r(r(r({},t),e),{velocity:0,mass:1})).isResolvedFromDuration=!0}return t}(m),M=g.stiffness,b=g.damping,x=g.mass,w=g.velocity,O=g.duration,I=g.isResolvedFromDuration,P=v,A=v;function D(){var n=w?-w/1e3:0,r=p-o,t=b/(2*Math.sqrt(M*x)),e=Math.sqrt(M/x)/1e3;if(null!=h||(h=Math.abs(p-o)<=1?.01:.4),t<1){var a=u(e,t);P=function(o){var u=Math.exp(-t*e*o);return p-u*((n+t*e*r)/a*Math.sin(a*o)+r*Math.cos(a*o))},A=function(o){var u=Math.exp(-t*e*o);return t*e*u*(Math.sin(a*o)*(n+t*e*r)/a+r*Math.cos(a*o))-u*(Math.cos(a*o)*(n+t*e*r)-a*r*Math.sin(a*o))}}else if(1===t)P=function(t){return p-Math.exp(-e*t)*(r+(n+e*r)*t)};else{var i=e*Math.sqrt(t*t-1);P=function(o){var a=Math.exp(-t*e*o),u=Math.min(i*o,300);return p-a*((n+t*e*r)*Math.sinh(u)+i*r*Math.cosh(u))/i}}}return D(),{next:function(n){var r=P(n);if(I)y.done=n>=O;else{var t=1e3*A(n),e=Math.abs(t)<=d,o=Math.abs(p-r)<=h;y.done=e&&o}return y.value=y.done?p:r,y},flipTarget:function(){var n;w=-w,o=(n=[p,o])[0],p=n[1],D()}}}c.needsInterpolation=function(n,r){return"string"==typeof n||"string"==typeof r};var v=function(n){return 0},p=function(n,r,t){var e=r-n;return 0===e?1:(t-n)/e},l=function(n,r,t){return-t*n+t*r+n},d=function(){return(d=Object.assign||function(n){for(var r,t=1,e=arguments.length;t<e;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o]);return n}).apply(this,arguments)},h=function(n,r){return function(t){return Math.max(Math.min(t,r),n)}},m=function(n){return n%1?Number(n.toFixed(5)):n},y=/(-)?([\d]*\.?[\d])+/g,g=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi,M=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function b(n){return"string"==typeof n}var x={test:function(n){return"number"==typeof n},parse:parseFloat,transform:function(n){return n}},w=d(d({},x),{transform:h(0,1)});d(d({},x),{default:1});var O,I=(O="%",{test:function(n){return b(n)&&n.endsWith(O)&&1===n.split(" ").length},parse:parseFloat,transform:function(n){return""+n+O}});d(d({},I),{parse:function(n){return I.parse(n)/100},transform:function(n){return I.transform(100*n)}});var P=function(n,r){return function(t){return Boolean(b(t)&&M.test(t)&&t.startsWith(n)||r&&Object.prototype.hasOwnProperty.call(t,r))}},A=function(n,r,t){return function(e){var o;if(!b(e))return e;var a=e.match(y),u=a[0],i=a[1],f=a[2],s=a[3];return(o={})[n]=parseFloat(u),o[r]=parseFloat(i),o[t]=parseFloat(f),o.alpha=void 0!==s?parseFloat(s):1,o}},D={test:P("hsl","hue"),parse:A("hue","saturation","lightness"),transform:function(n){var r=n.hue,t=n.saturation,e=n.lightness,o=n.alpha,a=void 0===o?1:o;return"hsla("+Math.round(r)+", "+I.transform(m(t))+", "+I.transform(m(e))+", "+m(w.transform(a))+")"}},S=h(0,255),T=d(d({},x),{transform:function(n){return Math.round(S(n))}}),F={test:P("rgb","red"),parse:A("red","green","blue"),transform:function(n){var r=n.red,t=n.green,e=n.blue,o=n.alpha,a=void 0===o?1:o;return"rgba("+T.transform(r)+", "+T.transform(t)+", "+T.transform(e)+", "+m(w.transform(a))+")"}};var j={test:P("#"),parse:function(n){var r="",t="",e="",o="";return n.length>5?(r=n.substr(1,2),t=n.substr(3,2),e=n.substr(5,2),o=n.substr(7,2)):(r=n.substr(1,1),t=n.substr(2,1),e=n.substr(3,1),o=n.substr(4,1),r+=r,t+=t,e+=e,o+=o),{red:parseInt(r,16),green:parseInt(t,16),blue:parseInt(e,16),alpha:o?parseInt(o,16)/255:1}},transform:F.transform},R=function(n){return F.test(n)||j.test(n)||D.test(n)},C=function(n){return F.test(n)?F.parse(n):D.test(n)?D.parse(n):j.parse(n)},k=function(n){return b(n)?n:n.hasOwnProperty("red")?F.transform(n):D.transform(n)},q="${c}",N="${n}";function B(n){var r=[],t=0,e=n.match(g);e&&(t=e.length,n=n.replace(g,q),r.push.apply(r,e.map(C)));var o=n.match(y);return o&&(n=n.replace(y,N),r.push.apply(r,o.map(x.parse))),{values:r,numColors:t,tokenised:n}}function E(n){return B(n).values}function U(n){var r=B(n),t=r.values,e=r.numColors,o=r.tokenised,a=t.length;return function(n){for(var r=o,t=0;t<a;t++)r=r.replace(t<e?q:N,t<e?k(n[t]):m(n[t]));return r}}var z=function(n){return"number"==typeof n?0:n};var G={test:function(n){var r,t,e,o;return isNaN(n)&&b(n)&&(null!==(t=null===(r=n.match(y))||void 0===r?void 0:r.length)&&void 0!==t?t:0)+(null!==(o=null===(e=n.match(g))||void 0===e?void 0:e.length)&&void 0!==o?o:0)>0},parse:E,createTransformer:U,getAnimatableNone:function(n){var r=E(n);return U(n)(r.map(z))}},H=function(n,r,t){var e=n*n,o=r*r;return Math.sqrt(Math.max(0,t*(o-e)+e))},L=[j,F,D],W=function(n){return L.find((function(r){return r.test(n)}))},$=function(n,t){var e=W(n),o=W(t);e.transform,o.transform;var a=e.parse(n),u=o.parse(t),i=r({},a),f=e===D?l:H;return function(n){for(var r in i)"alpha"!==r&&(i[r]=f(a[r],u[r],n));return i.alpha=l(a.alpha,u.alpha,n),e.transform(i)}},_={x:0,y:0,z:0},V=function(n){return"number"==typeof n},J=function(n,r){return function(t){return r(n(t))}},K=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return n.reduce(J)};function Q(n,r){return V(n)?function(t){return l(n,r,t)}:R(n)?$(n,r):nn(n,r)}var X=function(n,r){var t=function(n,r){for(var t=0,e=r.length,o=n.length;t<e;t++,o++)n[o]=r[t];return n}([],n),e=t.length,o=n.map((function(n,t){return Q(n,r[t])}));return function(n){for(var r=0;r<e;r++)t[r]=o[r](n);return t}},Y=function(n,t){var e=r(r({},n),t),o={};for(var a in e)void 0!==n[a]&&void 0!==t[a]&&(o[a]=Q(n[a],t[a]));return function(n){for(var r in o)e[r]=o[r](n);return e}};function Z(n){for(var r=G.parse(n),t=r.length,e=0,o=0,a=0,u=0;u<t;u++)e||"number"==typeof r[u]?e++:void 0!==r[u].hue?a++:o++;return{parsed:r,numNumbers:e,numRGB:o,numHSL:a}}var nn=function(n,r){var t=G.createTransformer(r),e=Z(n),o=Z(r);return e.numHSL===o.numHSL&&e.numRGB===o.numRGB&&e.numNumbers>=o.numNumbers?K(X(e.parsed,o.parsed),t):function(t){return t>0?r:n}},rn=function(n,r){return function(t){return l(n,r,t)}};function tn(n,r,t){for(var e,o=[],a=t||("number"==typeof(e=n[0])?rn:"string"==typeof e?R(e)?$:nn:Array.isArray(e)?X:"object"==typeof e?Y:void 0),u=n.length-1,i=0;i<u;i++){var f=a(n[i],n[i+1]);if(r){var s=Array.isArray(r)?r[i]:r;f=K(s,f)}o.push(f)}return o}function en(n,r,t){var o=void 0===t?{}:t,a=o.clamp,u=void 0===a||a,i=o.ease,f=o.mixer,s=n.length;r.length,!i||!Array.isArray(i)||i.length,n[0]>n[s-1]&&(n=[].concat(n),r=[].concat(r),n.reverse(),r.reverse());var c=tn(r,i,f),v=2===s?function(n,r){var t=n[0],e=n[1],o=r[0];return function(n){return o(p(t,e,n))}}(n,c):function(n,r){var t=n.length,e=t-1;return function(o){var a=0,u=!1;if(o<=n[0]?u=!0:o>=n[e]&&(a=e-1,u=!0),!u){for(var i=1;i<t&&!(n[i]>o||i===e);i++);a=i-1}var f=p(n[a],n[a+1],o);return r[a](f)}}(n,c);return u?function(r){return v(e(n[0],n[s-1],r))}:v}var on=function(n){return function(r){return 1-n(1-r)}},an=function(n){return function(r){return r<=.5?n(2*r)/2:(2-n(2*(1-r)))/2}},un=function(n){return function(r){return Math.pow(r,n)}},fn=function(n){return function(r){return r*r*((n+1)*r-n)}},sn=function(n){var r=fn(n);return function(n){return(n*=2)<1?.5*r(n):.5*(2-Math.pow(2,-10*(n-1)))}},cn=function(n){return n},vn=un(2),pn=on(vn),ln=an(vn),dn=function(n){return 1-Math.sin(Math.acos(n))},hn=on(dn),mn=an(hn),yn=fn(1.525),gn=on(yn),Mn=an(yn),bn=sn(1.525),xn=function(n){if(1===n||0===n)return n;var r=n*n;return n<.36363636363636365?7.5625*r:n<.7272727272727273?9.075*r-9.9*n+3.4:n<.9?12.066481994459833*r-19.63545706371191*n+8.898060941828255:10.8*n*n-20.52*n+10.72},wn=on(xn);function On(n,r){return n.map((function(){return r||ln})).splice(0,n.length-1)}function In(n){var r=n.from,t=void 0===r?0:r,e=n.to,o=void 0===e?1:e,a=n.ease,u=n.offset,i=n.duration,f=void 0===i?300:i,s={done:!1,value:t},c=Array.isArray(o)?o:[t,o],v=function(n,r){return n.map((function(n){return n*r}))}(u&&u.length===c.length?u:function(n){var r=n.length;return n.map((function(n,t){return 0!==t?t/(r-1):0}))}(c),f);function p(){return en(v,c,{ease:Array.isArray(a)?a:On(c,a)})}var l=p();return{next:function(n){return s.value=l(n),s.done=n>=f,s},flipTarget:function(){c.reverse(),l=p()}}}function Pn(n){var r=n.velocity,t=void 0===r?0:r,e=n.from,o=void 0===e?0:e,a=n.power,u=void 0===a?.8:a,i=n.timeConstant,f=void 0===i?350:i,s=n.restDelta,c=void 0===s?.5:s,v=n.modifyTarget,p={done:!1,value:o},l=u*t,d=o+l,h=void 0===v?d:v(d);return h!==d&&(l=h-o),{next:function(n){var r=-l*Math.exp(-n/f);return p.done=!(r>c||r<-c),p.value=p.done?h:h+r,p},flipTarget:function(){}}}var An={keyframes:In,spring:c,decay:Pn};var Dn=1/60*1e3,Sn="undefined"!=typeof performance?function(){return performance.now()}:function(){return Date.now()},Tn="undefined"!=typeof window?function(n){return window.requestAnimationFrame(n)}:function(n){return setTimeout((function(){return n(Sn())}),Dn)};var Fn=!0,jn=!1,Rn=!1,Cn={delta:0,timestamp:0},kn=["read","update","preRender","render","postRender"],qn=kn.reduce((function(n,r){return n[r]=function(n){var r=[],t=[],e=0,o=!1,a=new WeakSet,u={schedule:function(n,u,i){void 0===u&&(u=!1),void 0===i&&(i=!1);var f=i&&o,s=f?r:t;return u&&a.add(n),-1===s.indexOf(n)&&(s.push(n),f&&o&&(e=r.length)),n},cancel:function(n){var r=t.indexOf(n);-1!==r&&t.splice(r,1),a.delete(n)},process:function(i){var f;if(o=!0,r=(f=[t,r])[0],(t=f[1]).length=0,e=r.length)for(var s=0;s<e;s++){var c=r[s];c(i),a.has(c)&&(u.schedule(c),n())}o=!1}};return u}((function(){return jn=!0})),n}),{}),Nn=kn.reduce((function(n,r){var t=qn[r];return n[r]=function(n,r,e){return void 0===r&&(r=!1),void 0===e&&(e=!1),jn||zn(),t.schedule(n,r,e)},n}),{}),Bn=kn.reduce((function(n,r){return n[r]=qn[r].cancel,n}),{}),En=function(n){return qn[n].process(Cn)},Un=function(n){jn=!1,Cn.delta=Fn?Dn:Math.max(Math.min(n-Cn.timestamp,40),1),Cn.timestamp=n,Rn=!0,kn.forEach(En),Rn=!1,jn&&(Fn=!1,Tn(Un))},zn=function(){jn=!0,Fn=!0,Rn||Tn(Un)},Gn=function(){return Cn};function Hn(n,r,t){return void 0===t&&(t=0),n-r-t}var Ln=function(n){var r=function(r){var t=r.delta;return n(t)};return{start:function(){return Nn.update(r,!0)},stop:function(){return Bn.update(r)}}};function Wn(n){var e,o,a,u,i,f=n.from,s=n.autoplay,v=void 0===s||s,p=n.driver,l=void 0===p?Ln:p,d=n.elapsed,h=void 0===d?0:d,m=n.repeat,y=void 0===m?0:m,g=n.repeatType,M=void 0===g?"loop":g,b=n.repeatDelay,x=void 0===b?0:b,w=n.onPlay,O=n.onStop,I=n.onComplete,P=n.onRepeat,A=n.onUpdate,D=t(n,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]),S=D.to,T=0,F=D.duration,j=!1,R=!0,C=function(n){if(Array.isArray(n.to))return In;if(An[n.type])return An[n.type];var r=new Set(Object.keys(n));return r.has("ease")||r.has("duration")&&!r.has("dampingRatio")?In:r.has("dampingRatio")||r.has("stiffness")||r.has("mass")||r.has("damping")||r.has("restSpeed")||r.has("restDelta")?c:In}(D);(null===(o=(e=C).needsInterpolation)||void 0===o?void 0:o.call(e,f,S))&&(i=en([0,100],[f,S],{clamp:!1}),f=0,S=100);var k=C(r(r({},D),{from:f,to:S}));function q(){T++,"reverse"===M?h=function(n,r,t,e){return void 0===t&&(t=0),void 0===e&&(e=!0),e?Hn(r+-n,r,t):r-(n-r)+t}(h,F,x,R=T%2==0):(h=Hn(h,F,x),"mirror"===M&&k.flipTarget()),j=!1,P&&P()}function N(n){if(R||(n=-n),h+=n,!j){var r=k.next(Math.max(0,h));u=r.value,i&&(u=i(u)),j=R?r.done:h<=0}null==A||A(u),j&&(0===T&&(null!=F||(F=h)),T<y?function(n,r,t,e){return e?n>=r+t:n<=-t}(h,F,x,R)&&q():(a.stop(),I&&I()))}return v&&(null==w||w(),(a=l(N)).start()),{stop:function(){null==O||O(),a.stop()}}}function $n(n,r){return r?n*(1e3/r):0}var _n=function(n){return 180*n/Math.PI},Vn=function(n){return n},Jn=function(n){return void 0===n&&(n=Vn),function(r,t,e){var o=t-e,a=-(0-r+1)*(0-n(Math.abs(o)));return o<=0?t+a:t-a}},Kn=Jn(),Qn=Jn(Math.sqrt),Xn=function(n){return n*Math.PI/180},Yn=function(n){return n.hasOwnProperty("x")&&n.hasOwnProperty("y")},Zn=function(n){return Yn(n)&&n.hasOwnProperty("z")},nr=function(n,r){return Math.abs(n-r)};var rr=function(n,r){return void 0===r&&(r=2),r=Math.pow(10,r),Math.round(n*r)/r},tr=function(n,r,t,e){return void 0===e&&(e=0),rr(n+t*(r-n)/Math.max(e,t))};var er=function(n,r){return 1-3*r+3*n},or=function(n,r){return 3*r-6*n},ar=function(n){return 3*n},ur=function(n,r,t){return((er(r,t)*n+or(r,t))*n+ar(r))*n},ir=function(n,r,t){return 3*er(r,t)*n*n+2*or(r,t)*n+ar(r)};var fr=.1;n.angle=function(n,r){return void 0===r&&(r=_),_n(Math.atan2(r.y-n.y,r.x-n.x))},n.animate=Wn,n.anticipate=bn,n.applyOffset=function(n,r){var t=!0;return void 0===r&&(r=n,t=!1),function(e){return t?e-n+r:(n=e,t=!0,r)}},n.attract=Kn,n.attractExpo=Qn,n.backIn=yn,n.backInOut=Mn,n.backOut=gn,n.bounceIn=wn,n.bounceInOut=function(n){return n<.5?.5*(1-xn(1-2*n)):.5*xn(2*n-1)+.5},n.bounceOut=xn,n.circIn=dn,n.circInOut=mn,n.circOut=hn,n.clamp=e,n.createAnticipate=sn,n.createAttractor=Jn,n.createBackIn=fn,n.createExpoIn=un,n.cubicBezier=function(n,r,t,e){if(n===r&&t===e)return cn;for(var o=new Float32Array(11),a=0;a<11;++a)o[a]=ur(a*fr,n,t);function u(r){for(var e=0,a=1;10!==a&&o[a]<=r;++a)e+=fr;--a;var u=e+(r-o[a])/(o[a+1]-o[a])*fr,i=ir(u,n,t);return i>=.001?function(n,r,t,e){for(var o=0;o<8;++o){var a=ir(r,t,e);if(0===a)return r;r-=(ur(r,t,e)-n)/a}return r}(r,u,n,t):0===i?u:function(n,r,t,e,o){var a,u,i=0;do{(a=ur(u=r+(t-r)/2,e,o)-n)>0?t=u:r=u}while(Math.abs(a)>1e-7&&++i<10);return u}(r,e,e+fr,n,t)}return function(n){return 0===n||1===n?n:ur(u(n),r,e)}},n.decay=Pn,n.degreesToRadians=Xn,n.distance=function(n,r){if(V(n)&&V(r))return nr(n,r);if(Yn(n)&&Yn(r)){var t=nr(n.x,r.x),e=nr(n.y,r.y),o=Zn(n)&&Zn(r)?nr(n.z,r.z):0;return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(o,2))}},n.easeIn=vn,n.easeInOut=ln,n.easeOut=pn,n.inertia=function(n){var t,e=n.from,o=void 0===e?0:e,a=n.velocity,u=void 0===a?0:a,i=n.min,f=n.max,s=n.power,c=void 0===s?.8:s,v=n.timeConstant,p=void 0===v?750:v,l=n.bounceStiffness,d=void 0===l?500:l,h=n.bounceDamping,m=void 0===h?10:h,y=n.restDelta,g=void 0===y?1:y,M=n.modifyTarget,b=n.driver,x=n.onUpdate,w=n.onComplete,O=n.onStop;function I(n){return void 0!==i&&n<i||void 0!==f&&n>f}function P(n){return void 0===i?f:void 0===f||Math.abs(i-n)<Math.abs(f-n)?i:f}function A(n){null==t||t.stop(),t=Wn(r(r({},n),{driver:b,onUpdate:function(r){var t;null==x||x(r),null===(t=n.onUpdate)||void 0===t||t.call(n,r)},onComplete:w,onStop:O}))}function D(n){A(r({type:"spring",stiffness:d,damping:m,restDelta:g},n))}if(I(o))D({from:o,velocity:u,to:P(o)});else{var S=c*u+o;void 0!==M&&(S=M(S));var T,F,j=P(S),R=j===i?-1:1;A({type:"decay",from:o,velocity:u,timeConstant:p,power:c,restDelta:g,modifyTarget:M,onUpdate:I(S)?function(n){T=F,F=n,u=$n(n-T,Gn().delta),(1===R&&n>j||-1===R&&n<j)&&D({from:n,to:j,velocity:u})}:void 0})}return{stop:function(){return null==t?void 0:t.stop()}}},n.interpolate=en,n.isPoint=Yn,n.isPoint3D=Zn,n.keyframes=In,n.linear=cn,n.mirrorEasing=an,n.mix=l,n.mixColor=$,n.mixComplex=nn,n.pipe=K,n.pointFromVector=function(n,r,t){return r=Xn(r),{x:t*Math.cos(r)+n.x,y:t*Math.sin(r)+n.y}},n.progress=p,n.radiansToDegrees=_n,n.reverseEasing=on,n.smooth=function(n){void 0===n&&(n=50);var r=0,t=0;return function(e){var o=Gn().timestamp,a=o!==t?o-t:0,u=a?tr(r,e,a,n):r;return t=o,r=u,u}},n.smoothFrame=tr,n.snap=function(n){if("number"==typeof n)return function(r){return Math.round(r/n)*n};var r=0,t=n.length;return function(e){var o=Math.abs(n[0]-e);for(r=1;r<t;r++){var a=n[r],u=Math.abs(a-e);if(0===u)return a;if(u>o)return n[r-1];if(r===t-1)return a;o=u}}},n.spring=c,n.steps=function(n,r){return void 0===r&&(r="end"),function(t){var o=(t="end"===r?Math.min(t,.999):Math.max(t,.001))*n,a="end"===r?Math.floor(o):Math.ceil(o);return e(0,1,a/n)}},n.toDecimal=rr,n.velocityPerFrame=function(n,r){return n/(1e3/r)},n.velocityPerSecond=$n,n.wrap=function(n,r,t){var e=r-n;return((t-n)%e+e)%e+n},Object.defineProperty(n,"__esModule",{value:!0})}));

@@ -7,3 +7,3 @@ import { __assign, __spreadArray } from "tslib";

import { pipe } from "./pipe";
import { invariant } from "hey-listen";
import { warning } from "hey-listen";
function getMixer(origin, target) {

@@ -71,7 +71,13 @@ if (isNum(origin)) {

var targetStats = analyse(target);
invariant(originStats.numHSL === targetStats.numHSL &&
var canInterpolate = originStats.numHSL === targetStats.numHSL &&
originStats.numRGB === targetStats.numRGB &&
originStats.numNumbers >= targetStats.numNumbers, "Complex values '" + origin + "' and '" + target + "' too different to mix. Ensure all colors are of the same type.");
return pipe(mixArray(originStats.parsed, targetStats.parsed), template);
originStats.numNumbers >= targetStats.numNumbers;
if (canInterpolate) {
return pipe(mixArray(originStats.parsed, targetStats.parsed), template);
}
else {
warning(true, "Complex values '" + origin + "' and '" + target + "' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.");
return function (p) { return (p > 0 ? target : origin); };
}
};
//# sourceMappingURL=mix-complex.js.map
{
"name": "popmotion",
"version": "9.4.0",
"version": "9.4.1",
"description": "The animator's toolbox",

@@ -5,0 +5,0 @@ "author": "Matt Perry",

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