Socket
Socket
Sign inDemoInstall

motion

Package Overview
Dependencies
Maintainers
1
Versions
207
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

motion - npm Package Compare versions

Comparing version 10.3.1 to 10.3.2

6

CHANGELOG.md

@@ -5,2 +5,8 @@ # Changelog

## [10.3.2] [2021-10-18]
### Fixed
- Fixing animation interruption for independent transform animations in Safari and Firefox. [Issue (sponsors only)](https://github.com/motiondivision/motion/issues/27)
## [10.3.1] [2021-10-12]

@@ -7,0 +13,0 @@

2

dist/motion.min.js

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

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={})}(this,(function(t){"use strict";const e=new WeakMap;function n(t){return e.has(t)||e.set(t,{transforms:[],animations:{},generators:{},prevGeneratorState:{}}),e.get(t)}function a(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const i=()=>{},s=t=>t,r=["","X","Y","Z"],o={x:"translateX",y:"translateY",z:"translateZ"},l={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},c={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:l,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:s},skew:l},u=new Map,h=t=>`--motion-${t}`,f=["x","y","z"];["translate","scale","rotate","skew"].forEach((t=>{r.forEach((e=>{f.push(t+e),u.set(h(t+e),c[t])}))}));const d=(t,e)=>f.indexOf(t)-f.indexOf(e),p=new Set(f),y=t=>p.has(t),m=t=>t.sort(d).reduce(g,"").trim(),g=(t,e)=>`${t} ${e}(var(${h(e)}))`,v=t=>t.startsWith("--"),b=new Set;const M=t=>1e3*t,x=t=>"number"==typeof t,S=t=>Array.isArray(t)&&!x(t[0]),T=t=>"object"==typeof t&&Boolean(t.createAnimation),O=t=>(t=>Array.isArray(t)&&x(t[0]))(t)?w(t):t,w=([t,e,n,a])=>`cubic-bezier(${t}, ${e}, ${n}, ${a})`,j=t=>document.createElement("div").animate(t,{duration:.001}),D={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{j({opacity:[1]})}catch(t){return!1}return!0},finished:()=>Boolean(j({opacity:[0,1]}).finished)},k={},A={};for(const t in D)A[t]=()=>(void 0===k[t]&&(k[t]=D[t]()),k[t]);const P={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},R=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function $(t,e,n,a){if(t===e&&n===a)return s;const i=e=>function(t,e,n,a,i){let s,r,o=0;do{r=e+(n-e)/2,s=R(r,a,i)-t,s>0?n=r:e=r}while(Math.abs(s)>1e-7&&++o<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:R(i(t),e,a)}const E=(t,e="end")=>n=>{const a=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,i="end"===e?Math.floor(a):Math.ceil(a);return s=0,r=1,o=i/t,Math.min(Math.max(o,s),r);var s,r,o},V={ease:$(.25,.1,.25,1),"ease-in":$(.42,0,1,1),"ease-in-out":$(.42,0,.58,1),"ease-out":$(0,0,.58,1)},q=/\((.*?)\)/;function W(t){if("function"==typeof t)return t;if(Array.isArray(t))return $(...t);if(V[t])return V[t];if(t.startsWith("steps")){const e=q.exec(t);if(e){const t=e[1].split(",");return E(parseFloat(t[0]),t[1].trim())}}return s}const F=(t,e,n)=>-n*t+n*e+t,U=(t,e,n)=>e-t==0?1:(n-t)/(e-t);function B(t,e){return S(t)?t[((t,e,n)=>{const a=e-t;return((n-t)%a+a)%a+t})(0,t.length,e)]:t}function C(t,e){const n=t[t.length-1];for(let a=1;a<=e;a++){const i=U(0,e,a);t.push(F(n,1,i))}}function z(t){const e=[0];return C(e,t-1),e}function G(t,e=z(t.length),n=s){const a=t.length,i=a-e.length;return i>0&&C(e,i),i=>{let s=0;for(;s<a-2&&!(i<e[s+1]);s++);let r=(o=U(e[s],e[s+1],i),Math.min(1,Math.max(o,0)));var o;return r=B(n,s)(r),F(t[s],t[s+1],r)}}class K{constructor(t,e=[0,1],{easing:n=P.easing,duration:a=P.duration,delay:i=P.delay,endDelay:s=P.endDelay,repeat:r=P.repeat,offset:o,direction:l="normal"}={}){this.startTime=0,this.rate=1,this.t=0,this.cancelT=0,this.playState="idle",this.finished=new Promise(((t,e)=>{this.resolve=t,this.reject=e}));const c=a*(r+1);T(n)&&(n="ease");const u=G(e,o,S(n)?n.map(W):W(n));this.tick=e=>{this.pauseTime&&(e=this.pauseTime);let n=(e-this.startTime)*this.rate;this.t=n,n/=1e3,n=Math.max(n-i,0),"finished"===this.playState&&(n=c);const r=n/a;let o=Math.floor(r),h=r%1;!h&&r>=1&&(h=1),1===h&&o--;const f=o%2;("reverse"===l||"alternate"===l&&f||"alternate-reverse"===l&&!f)&&(h=1-h);const d=u(n>=c?1:Math.min(h,1));t(d);"finished"===this.playState||n>=c+s?(this.playState="finished",this.resolve(d)):"idle"!==this.playState&&requestAnimationFrame(this.tick)},this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime?this.startTime=t-(this.pauseTime-this.startTime):this.startTime||(this.startTime=t),this.pauseTime=void 0,requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=performance.now()}finish(){this.playState="finished",this.tick(0)}cancel(){this.playState="idle",this.tick(this.cancelT),this.reject(!1)}reverse(){this.rate*=-1}commitStyles(){this.cancelT=this.t}get currentTime(){return this.t}set currentTime(t){this.pauseTime||0===this.rate?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}const X=t=>Array.isArray(t)?t:[t],Y=(t,e)=>{let n=v(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!n&&0!==n){const t=u.get(e);t&&(n=t.initialValue)}return n};function Z(t){if(t)try{"finished"!==t.playState&&t.commitStyles(),t.cancel()}catch(t){}}function _(t,e,a,s={}){let r,{duration:l=P.duration,delay:c=P.delay,endDelay:f=P.endDelay,repeat:d=P.repeat,easing:p=P.easing,direction:g,offset:w,allowWebkitAcceleration:j=!1}=s;const D=n(t);let k=A.waapi(),R=i;const $=y(e);$&&((t,e)=>{o[e]&&(e=o[e]);const{transforms:a}=n(t);var i,s;s=e,-1===(i=a).indexOf(s)&&i.push(s),t.style.transform=m(a)})(t,e);const E=function(t){return o[t]&&(t=o[t]),y(t)?h(t):t}(e),V=u.get(E);return Z(D.animations[E]),()=>{const e=()=>{var e,n;return null!==(n=null!==(e=Y(t,E))&&void 0!==e?e:null==V?void 0:V.initialValue)&&void 0!==n?n:0};let n=function(t,e){for(let n=0;n<t.length;n++)null===t[n]&&(t[n]=n?t[n-1]:e());return t}(X(a),e);if(T(p)){const t=p.createAnimation(n,e,$,E,D);p=t.easing,void 0!==t.keyframes&&(n=t.keyframes),void 0!==t.duration&&(l=t.duration)}if(v(E)?(R=((t,e)=>n=>t.style.setProperty(e,n))(t,E),A.cssRegisterProperty()?function(t){if(!b.has(t)){b.add(t);try{const{syntax:e,initialValue:n}=u.has(t)?u.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:n})}catch(t){}}}(E):k=!1):R=((t,e)=>n=>t.style[e]=n)(t,E),k){V&&(n=n.map((t=>x(t)?V.toDefaultUnit(t):t))),A.partialKeyframes()||1!==n.length||n.unshift(e());const a={delay:M(c),duration:M(l),endDelay:M(f),easing:S(p)?void 0:O(p),direction:g,iterations:d+1,fill:"both"};r=t.animate({[E]:n,offset:w,easing:S(p)?p.map(O):void 0},a),r.finished||(r.finished=new Promise(((t,e)=>{r.onfinish=t,r.oncancel=e})));const s=n[n.length-1];r.finished.then((()=>{R(s),r.cancel()})).catch(i),j||(r.playbackRate=1.000001)}else if($&&n.every(x)){if(1===n.length&&n.unshift(parseFloat(e())),V){const t=R;R=e=>t(V.toDefaultUnit(e))}r=new K(R,n,Object.assign(Object.assign({},s),{duration:l,easing:p}))}else{const t=n[n.length-1];R(V&&x(t)?V.toDefaultUnit(t):t)}return D.animations[E]=r,null==r||r.finished.then((()=>{D.animations[E]=void 0,D.generators[E]=void 0,D.prevGeneratorState[E]=void 0})).catch(i),r}}const I=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function H(t,e){var n;return"string"==typeof t?e?(null!==(n=e[t])&&void 0!==n||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t)}const J=t=>t(),L=(t,e)=>new Proxy({animations:t.map(J).filter(Boolean),duration:e},Q),N=t=>t.animations[0],Q={get:(t,e)=>{var n,a;switch(e){case"duration":return t.duration;case"currentTime":let s=(null===(n=N(t))||void 0===n?void 0:n[e])||0;return s?s/1e3:0;case"playbackRate":return null===(a=N(t))||void 0===a?void 0:a[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(tt)).catch(i)),t.finished;case"stop":return()=>t.animations.forEach(Z);default:return()=>t.animations.forEach((t=>t[e]()))}},set:(t,e,n)=>{switch(e){case"currentTime":n=M(n);case"currentTime":case"playbackRate":for(let a=0;a<t.animations.length;a++)t.animations[a][e]=n;return!0}return!1}},tt=t=>t.finished;function et(t,e,n){return"function"==typeof t?t(e,n):t}function nt(t,e,n,a){var i;return x(e)?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:null!==(i=a.get(e))&&void 0!==i?i:t}function at(t,e,n,i,s,r){!function(t,e,n){for(let i=0;i<t.length;i++){const s=t[i];s.at>e&&s.at<n&&(a(t,s),i--)}}(t,s,r);for(let a=0;a<e.length;a++)t.push({value:e[a],at:F(s,r,i[a]),easing:B(n,a)})}function it(t,e){return t.at===e.at?null===t.value?1:-1:t.at-e.at}function st(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function rt(t,e){return e[t]||(e[t]=[]),e[t]}const ot=({stiffness:t=100,damping:e=10,mass:n=1,from:a=0,to:i=1,velocity:s=0,restSpeed:r=2,restDistance:o=.5}={})=>{const l={done:!1,value:a,target:i,velocity:s=s?s/1e3:0,hasReachedTarget:!1},c=((t=100,e=10,n=1)=>e/(2*Math.sqrt(t*n)))(t,e,n),u=i-a,h=Math.sqrt(t/n)/1e3,f=((t,e)=>t*Math.sqrt(1-e*e))(h,c);let d;return d=c<1?t=>i-Math.exp(-c*h*t)*((c*h*u-s)/f*Math.sin(f*t)+u*Math.cos(f*t)):t=>i-Math.exp(-h*t)*(u+(s+h*u)*t),{next:t=>{l.value=d(t),l.velocity=0===t?s:lt(d,t,l.value);const e=Math.abs(l.velocity)<=r,n=Math.abs(i-l.value)<=o;var c,u,h;return l.done=e&&n,l.hasReachedTarget=(c=a,u=i,h=l.value,c<u&&h>=u||c>u&&h<=u),l}}};function lt(t,e,n){const a=Math.max(e-5,0);return i=n-t(a),(s=5)?i*(1e3/s):0;var i,s}function ct(t){const e=new WeakMap;return(n={})=>{const a=new Map,i=(e=0,i=100,s=0,r=!1)=>{const o=`${e}-${i}-${s}-${r}`;return a.has(o)||a.set(o,t(Object.assign({from:e,to:i,velocity:s,restSpeed:r?.05:2,restDistance:r?.01:.5},n))),a.get(o)},s=t=>(e.has(t)||e.set(t,function(t){let e,n=10,a=t.next(0);const i=[a.value];for(;!a.done&&n<1e4;)a=t.next(n),i.push(a.done?a.target:a.value),void 0===e&&a.hasReachedTarget&&(e=n),n+=10;const s=n-10;return 1===i.length&&i.push(a.value),{keyframes:i,duration:s/1e3,overshootDuration:(null!=e?e:s)/1e3}}(t)),e.get(t));return{createAnimation:(t,e,n,a,r)=>{let o,l;const c=t.length;if(n&&c<=2&&t.every(ut)){const n=a&&r&&r.prevGeneratorState[a],u=n&&(1===c||2===c&&null===t[0])?n.velocity:0,h=t[c-1],f=1===c?null:t[0],d=null===f?n?n.value:parseFloat(e()):f;l=i(d,h,u,null==a?void 0:a.includes("scale"));const p=s(l);o=Object.assign(Object.assign({},p),{easing:"linear"})}else{l=i(0,100);o={easing:"ease",duration:s(l).overshootDuration}}return l&&r&&a&&(r.generators[a]=l),o}}}}const ut=t=>"string"!=typeof t,ht=ct(ot),ft=ct((({from:t=0,velocity:e=0,power:n=.8,decay:a=.325,bounceDamping:i,bounceStiffness:s,changeTarget:r,min:o,max:l,restDistance:c=.5,restSpeed:u})=>{a=M(a);const h={value:t,target:t,velocity:e,hasReachedTarget:!1,done:!1},f=t=>void 0===o?l:void 0===l||Math.abs(o-t)<Math.abs(l-t)?o:l;let d=n*e;const p=t+d,y=void 0===r?p:r(p);h.target=y,y!==p&&(d=y-t);const m=t=>-d*Math.exp(-t/a),g=t=>y+m(t),v=t=>{const n=m(t),a=g(t);h.done=Math.abs(n)<=c,h.value=h.done?y:a,h.velocity=0===t?e:lt(g,t,h.value)};let b,x;const S=t=>{var e;(e=h.value,void 0!==o&&e<o||void 0!==l&&e>l)&&(b=t,x=ot({from:h.value,to:f(h.value),velocity:h.velocity,damping:i,stiffness:s,restDistance:c,restSpeed:u}))};return S(0),{next:t=>{let e=!1;return x||void 0!==b||(e=!0,v(t),S(t)),void 0!==b&&t>b?(h.hasReachedTarget=!0,x.next(t-b)):(h.hasReachedTarget=!1,!e&&v(t),h)}}}));t.animate=function(t,e,n={}){var a;const i=(t=H(t)).length,s=[];for(let a=0;a<i;a++){const r=t[a];for(const t in e){const o=I(n,t);o.delay=et(o.delay,a,i);const l=_(r,t,e[t],o);s.push(l)}}return L(s,null!==(a=n.duration)&&void 0!==a?a:P.duration)},t.animateStyle=_,t.glide=ft,t.spring=ht,t.stagger=function(t=.1,{start:e=0,from:n=0,easing:a}={}){return(i,s)=>{const r=x(n)?n:function(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}(n,s),o=Math.abs(r-i);let l=t*o;if(a){const t=s*i;l=W(a)(l/t)*t}return e+l}},t.timeline=function(t,e={}){var n,a;const i=function(t,e={}){var{defaultOptions:n={}}=e,a=function(t,e){var n={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(n[a]=t[a]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(a=Object.getOwnPropertySymbols(t);i<a.length;i++)e.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(t,a[i])&&(n[a[i]]=t[a[i]])}return n}(e,["defaultOptions"]);const i=[],s=new Map,r={},o=new Map;let l=0,c=0,u=0;for(let e=0;e<t.length;e++){const[a,i,h={}]=t[e];void 0!==h.at&&(c=nt(c,h.at,l,o));let f=0;const d=H(a,r),p=d.length;for(let t=0;t<p;t++){const e=st(d[t],s);for(const a in i){const s=rt(a,e),r=X(i[a]),o=I(h,a);let{duration:l=n.duration||P.duration,easing:d=n.easing||P.easing}=o;const y=et(h.delay,t,p)||0,m=c+y,g=m+l;let{offset:v=z(r.length)}=o;1===v.length&&0===v[0]&&(v[1]=1);const b=length-r.length;b>0&&C(v,b),1===r.length&&r.unshift(null),at(s,r,d,v,m,g),f=Math.max(y+l,f),u=Math.max(g,u)}}l=c,c+=f}return s.forEach(((t,e)=>{for(const s in t){const r=t[s];r.sort(it);const o=[],l=[],c=[];for(let t=0;t<r.length;t++){const{at:e,value:n,easing:a}=r[t];o.push(n),l.push(U(0,u,e)),c.push(a||P.easing)}0!==l[0]&&(l.unshift(0),o.unshift(o[0]),c.unshift("linear")),1!==l[l.length-1]&&(l.push(1),o.push(null)),i.push([e,s,o,Object.assign(Object.assign(Object.assign({},n),{duration:u,easing:c,offset:l}),a)])}})),i}(t,e),s=i.map((t=>_(...t))).filter(Boolean);return L(s,null!==(a=null===(n=i[0])||void 0===n?void 0:n[3].duration)&&void 0!==a?a:P.duration)},Object.defineProperty(t,"__esModule",{value:!0})}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={})}(this,(function(t){"use strict";const e=new WeakMap;function n(t){return e.has(t)||e.set(t,{transforms:[],animations:{},generators:{},prevGeneratorState:{}}),e.get(t)}function a(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const i=()=>{},s=t=>t,r=["","X","Y","Z"],o={x:"translateX",y:"translateY",z:"translateZ"},l={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},c={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:l,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:s},skew:l},u=new Map,h=t=>`--motion-${t}`,f=["x","y","z"];["translate","scale","rotate","skew"].forEach((t=>{r.forEach((e=>{f.push(t+e),u.set(h(t+e),c[t])}))}));const d=(t,e)=>f.indexOf(t)-f.indexOf(e),p=new Set(f),m=t=>p.has(t),y=t=>t.sort(d).reduce(g,"").trim(),g=(t,e)=>`${t} ${e}(var(${h(e)}))`,v=t=>t.startsWith("--"),b=new Set;const M=t=>1e3*t,x=t=>"number"==typeof t,S=t=>Array.isArray(t)&&!x(t[0]),T=t=>"object"==typeof t&&Boolean(t.createAnimation),O=t=>(t=>Array.isArray(t)&&x(t[0]))(t)?w(t):t,w=([t,e,n,a])=>`cubic-bezier(${t}, ${e}, ${n}, ${a})`,j=t=>document.createElement("div").animate(t,{duration:.001}),D={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{j({opacity:[1]})}catch(t){return!1}return!0},finished:()=>Boolean(j({opacity:[0,1]}).finished)},k={},A={};for(const t in D)A[t]=()=>(void 0===k[t]&&(k[t]=D[t]()),k[t]);const P={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},R=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function $(t,e,n,a){if(t===e&&n===a)return s;const i=e=>function(t,e,n,a,i){let s,r,o=0;do{r=e+(n-e)/2,s=R(r,a,i)-t,s>0?n=r:e=r}while(Math.abs(s)>1e-7&&++o<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:R(i(t),e,a)}const E=(t,e="end")=>n=>{const a=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,i="end"===e?Math.floor(a):Math.ceil(a);return s=0,r=1,o=i/t,Math.min(Math.max(o,s),r);var s,r,o},V={ease:$(.25,.1,.25,1),"ease-in":$(.42,0,1,1),"ease-in-out":$(.42,0,.58,1),"ease-out":$(0,0,.58,1)},q=/\((.*?)\)/;function W(t){if("function"==typeof t)return t;if(Array.isArray(t))return $(...t);if(V[t])return V[t];if(t.startsWith("steps")){const e=q.exec(t);if(e){const t=e[1].split(",");return E(parseFloat(t[0]),t[1].trim())}}return s}const F=(t,e,n)=>-n*t+n*e+t,U=(t,e,n)=>e-t==0?1:(n-t)/(e-t);function B(t,e){return S(t)?t[((t,e,n)=>{const a=e-t;return((n-t)%a+a)%a+t})(0,t.length,e)]:t}function C(t,e){const n=t[t.length-1];for(let a=1;a<=e;a++){const i=U(0,e,a);t.push(F(n,1,i))}}function z(t){const e=[0];return C(e,t-1),e}function G(t,e=z(t.length),n=s){const a=t.length,i=a-e.length;return i>0&&C(e,i),i=>{let s=0;for(;s<a-2&&!(i<e[s+1]);s++);let r=(o=U(e[s],e[s+1],i),Math.min(1,Math.max(o,0)));var o;return r=B(n,s)(r),F(t[s],t[s+1],r)}}class K{constructor(t,e=[0,1],{easing:n=P.easing,duration:a=P.duration,delay:i=P.delay,endDelay:s=P.endDelay,repeat:r=P.repeat,offset:o,direction:l="normal"}={}){this.startTime=0,this.rate=1,this.t=0,this.cancelTimestamp=0,this.playState="idle",this.finished=new Promise(((t,e)=>{this.resolve=t,this.reject=e}));const c=a*(r+1);T(n)&&(n="ease");const u=G(e,o,S(n)?n.map(W):W(n));this.tick=e=>{this.pauseTime&&(e=this.pauseTime);let n=(e-this.startTime)*this.rate;this.t=n,n/=1e3,n=Math.max(n-i,0),"finished"===this.playState&&(n=c);const r=n/a;let o=Math.floor(r),h=r%1;!h&&r>=1&&(h=1),1===h&&o--;const f=o%2;("reverse"===l||"alternate"===l&&f||"alternate-reverse"===l&&!f)&&(h=1-h);const d=u(n>=c?1:Math.min(h,1));t(d);"finished"===this.playState||n>=c+s?(this.playState="finished",this.resolve(d)):"idle"!==this.playState&&requestAnimationFrame(this.tick)},this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime?this.startTime=t-(this.pauseTime-this.startTime):this.startTime||(this.startTime=t),this.pauseTime=void 0,requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=performance.now()}finish(){this.playState="finished",this.tick(0)}cancel(){this.playState="idle",this.tick(this.cancelTimestamp),this.reject(!1)}reverse(){this.rate*=-1}commitStyles(){this.cancelTimestamp=performance.now()}get currentTime(){return this.t}set currentTime(t){this.pauseTime||0===this.rate?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}const X=t=>Array.isArray(t)?t:[t],Y=(t,e)=>{let n=v(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!n&&0!==n){const t=u.get(e);t&&(n=t.initialValue)}return n};function Z(t){if(t)try{"finished"!==t.playState&&t.commitStyles(),t.cancel()}catch(t){}}function _(t,e,a,s={}){let r,{duration:l=P.duration,delay:c=P.delay,endDelay:f=P.endDelay,repeat:d=P.repeat,easing:p=P.easing,direction:g,offset:w,allowWebkitAcceleration:j=!1}=s;const D=n(t);let k=A.waapi(),R=i;const $=m(e);$&&((t,e)=>{o[e]&&(e=o[e]);const{transforms:a}=n(t);var i,s;s=e,-1===(i=a).indexOf(s)&&i.push(s),t.style.transform=y(a)})(t,e);const E=function(t){return o[t]&&(t=o[t]),m(t)?h(t):t}(e),V=u.get(E);return Z(D.animations[E]),()=>{const e=()=>{var e,n;return null!==(n=null!==(e=Y(t,E))&&void 0!==e?e:null==V?void 0:V.initialValue)&&void 0!==n?n:0};let n=function(t,e){for(let n=0;n<t.length;n++)null===t[n]&&(t[n]=n?t[n-1]:e());return t}(X(a),e);if(T(p)){const t=p.createAnimation(n,e,$,E,D);p=t.easing,void 0!==t.keyframes&&(n=t.keyframes),void 0!==t.duration&&(l=t.duration)}if(v(E)?(R=((t,e)=>n=>t.style.setProperty(e,n))(t,E),A.cssRegisterProperty()?function(t){if(!b.has(t)){b.add(t);try{const{syntax:e,initialValue:n}=u.has(t)?u.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:n})}catch(t){}}}(E):k=!1):R=((t,e)=>n=>t.style[e]=n)(t,E),k){V&&(n=n.map((t=>x(t)?V.toDefaultUnit(t):t))),A.partialKeyframes()||1!==n.length||n.unshift(e());const a={delay:M(c),duration:M(l),endDelay:M(f),easing:S(p)?void 0:O(p),direction:g,iterations:d+1,fill:"both"};r=t.animate({[E]:n,offset:w,easing:S(p)?p.map(O):void 0},a),r.finished||(r.finished=new Promise(((t,e)=>{r.onfinish=t,r.oncancel=e})));const s=n[n.length-1];r.finished.then((()=>{R(s),r.cancel()})).catch(i),j||(r.playbackRate=1.000001)}else if($&&n.every(x)){if(1===n.length&&n.unshift(parseFloat(e())),V){const t=R;R=e=>t(V.toDefaultUnit(e))}r=new K(R,n,Object.assign(Object.assign({},s),{duration:l,easing:p}))}else{const t=n[n.length-1];R(V&&x(t)?V.toDefaultUnit(t):t)}return D.animations[E]=r,null==r||r.finished.then((()=>{D.animations[E]=void 0,D.generators[E]=void 0,D.prevGeneratorState[E]=void 0})).catch(i),r}}const I=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function H(t,e){var n;return"string"==typeof t?e?(null!==(n=e[t])&&void 0!==n||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t)}const J=t=>t(),L=(t,e)=>new Proxy({animations:t.map(J).filter(Boolean),duration:e},Q),N=t=>t.animations[0],Q={get:(t,e)=>{var n,a;switch(e){case"duration":return t.duration;case"currentTime":let s=(null===(n=N(t))||void 0===n?void 0:n[e])||0;return s?s/1e3:0;case"playbackRate":return null===(a=N(t))||void 0===a?void 0:a[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(tt)).catch(i)),t.finished;case"stop":return()=>t.animations.forEach(Z);default:return()=>t.animations.forEach((t=>t[e]()))}},set:(t,e,n)=>{switch(e){case"currentTime":n=M(n);case"currentTime":case"playbackRate":for(let a=0;a<t.animations.length;a++)t.animations[a][e]=n;return!0}return!1}},tt=t=>t.finished;function et(t,e,n){return"function"==typeof t?t(e,n):t}function nt(t,e,n,a){var i;return x(e)?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:null!==(i=a.get(e))&&void 0!==i?i:t}function at(t,e,n,i,s,r){!function(t,e,n){for(let i=0;i<t.length;i++){const s=t[i];s.at>e&&s.at<n&&(a(t,s),i--)}}(t,s,r);for(let a=0;a<e.length;a++)t.push({value:e[a],at:F(s,r,i[a]),easing:B(n,a)})}function it(t,e){return t.at===e.at?null===t.value?1:-1:t.at-e.at}function st(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function rt(t,e){return e[t]||(e[t]=[]),e[t]}const ot=({stiffness:t=100,damping:e=10,mass:n=1,from:a=0,to:i=1,velocity:s=0,restSpeed:r=2,restDistance:o=.5}={})=>{const l={done:!1,value:a,target:i,velocity:s=s?s/1e3:0,hasReachedTarget:!1},c=((t=100,e=10,n=1)=>e/(2*Math.sqrt(t*n)))(t,e,n),u=i-a,h=Math.sqrt(t/n)/1e3,f=((t,e)=>t*Math.sqrt(1-e*e))(h,c);let d;return d=c<1?t=>i-Math.exp(-c*h*t)*((c*h*u-s)/f*Math.sin(f*t)+u*Math.cos(f*t)):t=>i-Math.exp(-h*t)*(u+(s+h*u)*t),{next:t=>{l.value=d(t),l.velocity=0===t?s:lt(d,t,l.value);const e=Math.abs(l.velocity)<=r,n=Math.abs(i-l.value)<=o;var c,u,h;return l.done=e&&n,l.hasReachedTarget=(c=a,u=i,h=l.value,c<u&&h>=u||c>u&&h<=u),l}}};function lt(t,e,n){const a=Math.max(e-5,0);return i=n-t(a),(s=5)?i*(1e3/s):0;var i,s}function ct(t){const e=new WeakMap;return(n={})=>{const a=new Map,i=(e=0,i=100,s=0,r=!1)=>{const o=`${e}-${i}-${s}-${r}`;return a.has(o)||a.set(o,t(Object.assign({from:e,to:i,velocity:s,restSpeed:r?.05:2,restDistance:r?.01:.5},n))),a.get(o)},s=t=>(e.has(t)||e.set(t,function(t){let e,n=10,a=t.next(0);const i=[a.value];for(;!a.done&&n<1e4;)a=t.next(n),i.push(a.done?a.target:a.value),void 0===e&&a.hasReachedTarget&&(e=n),n+=10;const s=n-10;return 1===i.length&&i.push(a.value),{keyframes:i,duration:s/1e3,overshootDuration:(null!=e?e:s)/1e3}}(t)),e.get(t));return{createAnimation:(t,e,n,a,r)=>{let o,l;const c=t.length;if(n&&c<=2&&t.every(ut)){const n=a&&r&&r.prevGeneratorState[a],u=n&&(1===c||2===c&&null===t[0])?n.velocity:0,h=t[c-1],f=1===c?null:t[0],d=null===f?n?n.value:parseFloat(e()):f;l=i(d,h,u,null==a?void 0:a.includes("scale"));const p=s(l);o=Object.assign(Object.assign({},p),{easing:"linear"})}else{l=i(0,100);o={easing:"ease",duration:s(l).overshootDuration}}return l&&r&&a&&(r.generators[a]=l),o}}}}const ut=t=>"string"!=typeof t,ht=ct(ot),ft=ct((({from:t=0,velocity:e=0,power:n=.8,decay:a=.325,bounceDamping:i,bounceStiffness:s,changeTarget:r,min:o,max:l,restDistance:c=.5,restSpeed:u})=>{a=M(a);const h={value:t,target:t,velocity:e,hasReachedTarget:!1,done:!1},f=t=>void 0===o?l:void 0===l||Math.abs(o-t)<Math.abs(l-t)?o:l;let d=n*e;const p=t+d,m=void 0===r?p:r(p);h.target=m,m!==p&&(d=m-t);const y=t=>-d*Math.exp(-t/a),g=t=>m+y(t),v=t=>{const n=y(t),a=g(t);h.done=Math.abs(n)<=c,h.value=h.done?m:a,h.velocity=0===t?e:lt(g,t,h.value)};let b,x;const S=t=>{var e;(e=h.value,void 0!==o&&e<o||void 0!==l&&e>l)&&(b=t,x=ot({from:h.value,to:f(h.value),velocity:h.velocity,damping:i,stiffness:s,restDistance:c,restSpeed:u}))};return S(0),{next:t=>{let e=!1;return x||void 0!==b||(e=!0,v(t),S(t)),void 0!==b&&t>b?(h.hasReachedTarget=!0,x.next(t-b)):(h.hasReachedTarget=!1,!e&&v(t),h)}}}));t.animate=function(t,e,n={}){var a;const i=(t=H(t)).length,s=[];for(let a=0;a<i;a++){const r=t[a];for(const t in e){const o=I(n,t);o.delay=et(o.delay,a,i);const l=_(r,t,e[t],o);s.push(l)}}return L(s,null!==(a=n.duration)&&void 0!==a?a:P.duration)},t.animateStyle=_,t.glide=ft,t.spring=ht,t.stagger=function(t=.1,{start:e=0,from:n=0,easing:a}={}){return(i,s)=>{const r=x(n)?n:function(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}(n,s),o=Math.abs(r-i);let l=t*o;if(a){const t=s*i;l=W(a)(l/t)*t}return e+l}},t.timeline=function(t,e={}){var n,a;const i=function(t,e={}){var{defaultOptions:n={}}=e,a=function(t,e){var n={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(n[a]=t[a]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(a=Object.getOwnPropertySymbols(t);i<a.length;i++)e.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(t,a[i])&&(n[a[i]]=t[a[i]])}return n}(e,["defaultOptions"]);const i=[],s=new Map,r={},o=new Map;let l=0,c=0,u=0;for(let e=0;e<t.length;e++){const[a,i,h={}]=t[e];void 0!==h.at&&(c=nt(c,h.at,l,o));let f=0;const d=H(a,r),p=d.length;for(let t=0;t<p;t++){const e=st(d[t],s);for(const a in i){const s=rt(a,e),r=X(i[a]),o=I(h,a);let{duration:l=n.duration||P.duration,easing:d=n.easing||P.easing}=o;const m=et(h.delay,t,p)||0,y=c+m,g=y+l;let{offset:v=z(r.length)}=o;1===v.length&&0===v[0]&&(v[1]=1);const b=length-r.length;b>0&&C(v,b),1===r.length&&r.unshift(null),at(s,r,d,v,y,g),f=Math.max(m+l,f),u=Math.max(g,u)}}l=c,c+=f}return s.forEach(((t,e)=>{for(const s in t){const r=t[s];r.sort(it);const o=[],l=[],c=[];for(let t=0;t<r.length;t++){const{at:e,value:n,easing:a}=r[t];o.push(n),l.push(U(0,u,e)),c.push(a||P.easing)}0!==l[0]&&(l.unshift(0),o.unshift(o[0]),c.unshift("linear")),1!==l[l.length-1]&&(l.push(1),o.push(null)),i.push([e,s,o,Object.assign(Object.assign(Object.assign({},n),{duration:u,easing:c,offset:l}),a)])}})),i}(t,e),s=i.map((t=>_(...t))).filter(Boolean);return L(s,null!==(a=null===(n=i[0])||void 0===n?void 0:n[3].duration)&&void 0!==a?a:P.duration)},Object.defineProperty(t,"__esModule",{value:!0})}));

@@ -347,3 +347,3 @@ (function (global, factory) {

this.t = 0;
this.cancelT = 0;
this.cancelTimestamp = 0;
this.playState = "idle";

@@ -449,3 +449,3 @@ this.finished = new Promise((resolve, reject) => {

this.playState = "idle";
this.tick(this.cancelT);
this.tick(this.cancelTimestamp);
this.reject(false);

@@ -457,3 +457,3 @@ }

commitStyles() {
this.cancelT = this.t;
this.cancelTimestamp = performance.now();
}

@@ -460,0 +460,0 @@ get currentTime() {

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

const t=new WeakMap;function e(e){return t.has(e)||t.set(e,{transforms:[],animations:{},generators:{},prevGeneratorState:{}}),t.get(e)}const n=()=>{},a=t=>t,i=["","X","Y","Z"],r={x:"translateX",y:"translateY",z:"translateZ"},s={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},o={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:s,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:a},skew:s},l=new Map,c=t=>`--motion-${t}`,u=["x","y","z"];["translate","scale","rotate","skew"].forEach((t=>{i.forEach((e=>{u.push(t+e),l.set(c(t+e),o[t])}))}));const h=(t,e)=>u.indexOf(t)-u.indexOf(e),f=new Set(u),d=t=>f.has(t),m=t=>t.sort(h).reduce(y,"").trim(),y=(t,e)=>`${t} ${e}(var(${c(e)}))`,p=t=>t.startsWith("--"),g=new Set;const v=t=>1e3*t,S=t=>"number"==typeof t,T=t=>Array.isArray(t)&&!S(t[0]),w=t=>"object"==typeof t&&Boolean(t.createAnimation),b=t=>(t=>Array.isArray(t)&&S(t[0]))(t)?x(t):t,x=([t,e,n,a])=>`cubic-bezier(${t}, ${e}, ${n}, ${a})`,k=t=>document.createElement("div").animate(t,{duration:.001}),A={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{k({opacity:[1]})}catch(t){return!1}return!0},finished:()=>Boolean(k({opacity:[0,1]}).finished)},M={},D={};for(const t in A)D[t]=()=>(void 0===M[t]&&(M[t]=A[t]()),M[t]);const O={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},P=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function j(t,e,n,i){if(t===e&&n===i)return a;const r=e=>function(t,e,n,a,i){let r,s,o=0;do{s=e+(n-e)/2,r=P(s,a,i)-t,r>0?n=s:e=s}while(Math.abs(r)>1e-7&&++o<12);return s}(e,0,1,t,n);return t=>0===t||1===t?t:P(r(t),e,i)}const V=(t,e="end")=>n=>{const a=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,i="end"===e?Math.floor(a):Math.ceil(a);return r=0,s=1,o=i/t,Math.min(Math.max(o,r),s);var r,s,o},$={ease:j(.25,.1,.25,1),"ease-in":j(.42,0,1,1),"ease-in-out":j(.42,0,.58,1),"ease-out":j(0,0,.58,1)},E=/\((.*?)\)/;function R(t){if("function"==typeof t)return t;if(Array.isArray(t))return j(...t);if($[t])return $[t];if(t.startsWith("steps")){const e=E.exec(t);if(e){const t=e[1].split(",");return V(parseFloat(t[0]),t[1].trim())}}return a}const U=(t,e,n)=>-n*t+n*e+t,q=(t,e,n)=>e-t==0?1:(n-t)/(e-t);function C(t,e){const n=t[t.length-1];for(let a=1;a<=e;a++){const i=q(0,e,a);t.push(U(n,1,i))}}function F(t,e=function(t){const e=[0];return C(e,t-1),e}(t.length),n=a){const i=t.length,r=i-e.length;return r>0&&C(e,r),a=>{let r=0;for(;r<i-2&&!(a<e[r+1]);r++);let s=(o=q(e[r],e[r+1],a),Math.min(1,Math.max(o,0)));var o;const l=function(t,e){return T(t)?t[((t,e,n)=>{const a=e-t;return((n-t)%a+a)%a+t})(0,t.length,e)]:t}(n,r);return s=l(s),U(t[r],t[r+1],s)}}class W{constructor(t,e=[0,1],{easing:n=O.easing,duration:a=O.duration,delay:i=O.delay,endDelay:r=O.endDelay,repeat:s=O.repeat,offset:o,direction:l="normal"}={}){this.startTime=0,this.rate=1,this.t=0,this.cancelT=0,this.playState="idle",this.finished=new Promise(((t,e)=>{this.resolve=t,this.reject=e}));const c=a*(s+1);w(n)&&(n="ease");const u=F(e,o,T(n)?n.map(R):R(n));this.tick=e=>{this.pauseTime&&(e=this.pauseTime);let n=(e-this.startTime)*this.rate;this.t=n,n/=1e3,n=Math.max(n-i,0),"finished"===this.playState&&(n=c);const s=n/a;let o=Math.floor(s),h=s%1;!h&&s>=1&&(h=1),1===h&&o--;const f=o%2;("reverse"===l||"alternate"===l&&f||"alternate-reverse"===l&&!f)&&(h=1-h);const d=u(n>=c?1:Math.min(h,1));t(d);"finished"===this.playState||n>=c+r?(this.playState="finished",this.resolve(d)):"idle"!==this.playState&&requestAnimationFrame(this.tick)},this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime?this.startTime=t-(this.pauseTime-this.startTime):this.startTime||(this.startTime=t),this.pauseTime=void 0,requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=performance.now()}finish(){this.playState="finished",this.tick(0)}cancel(){this.playState="idle",this.tick(this.cancelT),this.reject(!1)}reverse(){this.rate*=-1}commitStyles(){this.cancelT=this.t}get currentTime(){return this.t}set currentTime(t){this.pauseTime||0===this.rate?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}const z=(t,e)=>{let n=p(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!n&&0!==n){const t=l.get(e);t&&(n=t.initialValue)}return n};function B(t){if(t)try{"finished"!==t.playState&&t.commitStyles(),t.cancel()}catch(t){}}function G(t,a,i,s={}){let o,{duration:u=O.duration,delay:h=O.delay,endDelay:f=O.endDelay,repeat:y=O.repeat,easing:x=O.easing,direction:k,offset:A,allowWebkitAcceleration:M=!1}=s;const P=e(t);let j=D.waapi(),V=n;const $=d(a);$&&((t,n)=>{r[n]&&(n=r[n]);const{transforms:a}=e(t);var i,s;s=n,-1===(i=a).indexOf(s)&&i.push(s),t.style.transform=m(a)})(t,a);const E=function(t){return r[t]&&(t=r[t]),d(t)?c(t):t}(a),R=l.get(E);return B(P.animations[E]),()=>{const e=()=>{var e,n;return null!==(n=null!==(e=z(t,E))&&void 0!==e?e:null==R?void 0:R.initialValue)&&void 0!==n?n:0};let a=function(t,e){for(let n=0;n<t.length;n++)null===t[n]&&(t[n]=n?t[n-1]:e());return t}((t=>Array.isArray(t)?t:[t])(i),e);if(w(x)){const t=x.createAnimation(a,e,$,E,P);x=t.easing,void 0!==t.keyframes&&(a=t.keyframes),void 0!==t.duration&&(u=t.duration)}if(p(E)?(V=((t,e)=>n=>t.style.setProperty(e,n))(t,E),D.cssRegisterProperty()?function(t){if(!g.has(t)){g.add(t);try{const{syntax:e,initialValue:n}=l.has(t)?l.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:n})}catch(t){}}}(E):j=!1):V=((t,e)=>n=>t.style[e]=n)(t,E),j){R&&(a=a.map((t=>S(t)?R.toDefaultUnit(t):t))),D.partialKeyframes()||1!==a.length||a.unshift(e());const i={delay:v(h),duration:v(u),endDelay:v(f),easing:T(x)?void 0:b(x),direction:k,iterations:y+1,fill:"both"};o=t.animate({[E]:a,offset:A,easing:T(x)?x.map(b):void 0},i),o.finished||(o.finished=new Promise(((t,e)=>{o.onfinish=t,o.oncancel=e})));const r=a[a.length-1];o.finished.then((()=>{V(r),o.cancel()})).catch(n),M||(o.playbackRate=1.000001)}else if($&&a.every(S)){if(1===a.length&&a.unshift(parseFloat(e())),R){const t=V;V=e=>t(R.toDefaultUnit(e))}o=new W(V,a,Object.assign(Object.assign({},s),{duration:u,easing:x}))}else{const t=a[a.length-1];V(R&&S(t)?R.toDefaultUnit(t):t)}return P.animations[E]=o,null==o||o.finished.then((()=>{P.animations[E]=void 0,P.generators[E]=void 0,P.prevGeneratorState[E]=void 0})).catch(n),o}}const K=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);const X=t=>t(),Y=t=>t.animations[0],Z={get:(t,e)=>{var a,i;switch(e){case"duration":return t.duration;case"currentTime":let r=(null===(a=Y(t))||void 0===a?void 0:a[e])||0;return r?r/1e3:0;case"playbackRate":return null===(i=Y(t))||void 0===i?void 0:i[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(H)).catch(n)),t.finished;case"stop":return()=>t.animations.forEach(B);default:return()=>t.animations.forEach((t=>t[e]()))}},set:(t,e,n)=>{switch(e){case"currentTime":n=v(n);case"currentTime":case"playbackRate":for(let a=0;a<t.animations.length;a++)t.animations[a][e]=n;return!0}return!1}},H=t=>t.finished;function I(t,e,n){return"function"==typeof t?t(e,n):t}function J(t,e,n={}){var a;t=function(t,e){var n;return"string"==typeof t?e?(null!==(n=e[t])&&void 0!==n||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t)}(t);const i=t.length,r=[];for(let a=0;a<i;a++){const s=t[a];for(const t in e){const o=K(n,t);o.delay=I(o.delay,a,i);const l=G(s,t,e[t],o);r.push(l)}}return s=r,o=null!==(a=n.duration)&&void 0!==a?a:O.duration,new Proxy({animations:s.map(X).filter(Boolean),duration:o},Z);var s,o}export{J as animate};
const t=new WeakMap;function e(e){return t.has(e)||t.set(e,{transforms:[],animations:{},generators:{},prevGeneratorState:{}}),t.get(e)}const n=()=>{},a=t=>t,i=["","X","Y","Z"],r={x:"translateX",y:"translateY",z:"translateZ"},s={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},o={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:s,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:a},skew:s},c=new Map,l=t=>`--motion-${t}`,u=["x","y","z"];["translate","scale","rotate","skew"].forEach((t=>{i.forEach((e=>{u.push(t+e),c.set(l(t+e),o[t])}))}));const h=(t,e)=>u.indexOf(t)-u.indexOf(e),f=new Set(u),m=t=>f.has(t),d=t=>t.sort(h).reduce(p,"").trim(),p=(t,e)=>`${t} ${e}(var(${l(e)}))`,y=t=>t.startsWith("--"),g=new Set;const v=t=>1e3*t,S=t=>"number"==typeof t,T=t=>Array.isArray(t)&&!S(t[0]),w=t=>"object"==typeof t&&Boolean(t.createAnimation),b=t=>(t=>Array.isArray(t)&&S(t[0]))(t)?x(t):t,x=([t,e,n,a])=>`cubic-bezier(${t}, ${e}, ${n}, ${a})`,k=t=>document.createElement("div").animate(t,{duration:.001}),A={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{k({opacity:[1]})}catch(t){return!1}return!0},finished:()=>Boolean(k({opacity:[0,1]}).finished)},M={},D={};for(const t in A)D[t]=()=>(void 0===M[t]&&(M[t]=A[t]()),M[t]);const O={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},P=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function j(t,e,n,i){if(t===e&&n===i)return a;const r=e=>function(t,e,n,a,i){let r,s,o=0;do{s=e+(n-e)/2,r=P(s,a,i)-t,r>0?n=s:e=s}while(Math.abs(r)>1e-7&&++o<12);return s}(e,0,1,t,n);return t=>0===t||1===t?t:P(r(t),e,i)}const V=(t,e="end")=>n=>{const a=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,i="end"===e?Math.floor(a):Math.ceil(a);return r=0,s=1,o=i/t,Math.min(Math.max(o,r),s);var r,s,o},$={ease:j(.25,.1,.25,1),"ease-in":j(.42,0,1,1),"ease-in-out":j(.42,0,.58,1),"ease-out":j(0,0,.58,1)},E=/\((.*?)\)/;function R(t){if("function"==typeof t)return t;if(Array.isArray(t))return j(...t);if($[t])return $[t];if(t.startsWith("steps")){const e=E.exec(t);if(e){const t=e[1].split(",");return V(parseFloat(t[0]),t[1].trim())}}return a}const U=(t,e,n)=>-n*t+n*e+t,q=(t,e,n)=>e-t==0?1:(n-t)/(e-t);function C(t,e){const n=t[t.length-1];for(let a=1;a<=e;a++){const i=q(0,e,a);t.push(U(n,1,i))}}function F(t,e=function(t){const e=[0];return C(e,t-1),e}(t.length),n=a){const i=t.length,r=i-e.length;return r>0&&C(e,r),a=>{let r=0;for(;r<i-2&&!(a<e[r+1]);r++);let s=(o=q(e[r],e[r+1],a),Math.min(1,Math.max(o,0)));var o;const c=function(t,e){return T(t)?t[((t,e,n)=>{const a=e-t;return((n-t)%a+a)%a+t})(0,t.length,e)]:t}(n,r);return s=c(s),U(t[r],t[r+1],s)}}class W{constructor(t,e=[0,1],{easing:n=O.easing,duration:a=O.duration,delay:i=O.delay,endDelay:r=O.endDelay,repeat:s=O.repeat,offset:o,direction:c="normal"}={}){this.startTime=0,this.rate=1,this.t=0,this.cancelTimestamp=0,this.playState="idle",this.finished=new Promise(((t,e)=>{this.resolve=t,this.reject=e}));const l=a*(s+1);w(n)&&(n="ease");const u=F(e,o,T(n)?n.map(R):R(n));this.tick=e=>{this.pauseTime&&(e=this.pauseTime);let n=(e-this.startTime)*this.rate;this.t=n,n/=1e3,n=Math.max(n-i,0),"finished"===this.playState&&(n=l);const s=n/a;let o=Math.floor(s),h=s%1;!h&&s>=1&&(h=1),1===h&&o--;const f=o%2;("reverse"===c||"alternate"===c&&f||"alternate-reverse"===c&&!f)&&(h=1-h);const m=u(n>=l?1:Math.min(h,1));t(m);"finished"===this.playState||n>=l+r?(this.playState="finished",this.resolve(m)):"idle"!==this.playState&&requestAnimationFrame(this.tick)},this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime?this.startTime=t-(this.pauseTime-this.startTime):this.startTime||(this.startTime=t),this.pauseTime=void 0,requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=performance.now()}finish(){this.playState="finished",this.tick(0)}cancel(){this.playState="idle",this.tick(this.cancelTimestamp),this.reject(!1)}reverse(){this.rate*=-1}commitStyles(){this.cancelTimestamp=performance.now()}get currentTime(){return this.t}set currentTime(t){this.pauseTime||0===this.rate?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}const z=(t,e)=>{let n=y(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!n&&0!==n){const t=c.get(e);t&&(n=t.initialValue)}return n};function B(t){if(t)try{"finished"!==t.playState&&t.commitStyles(),t.cancel()}catch(t){}}function G(t,a,i,s={}){let o,{duration:u=O.duration,delay:h=O.delay,endDelay:f=O.endDelay,repeat:p=O.repeat,easing:x=O.easing,direction:k,offset:A,allowWebkitAcceleration:M=!1}=s;const P=e(t);let j=D.waapi(),V=n;const $=m(a);$&&((t,n)=>{r[n]&&(n=r[n]);const{transforms:a}=e(t);var i,s;s=n,-1===(i=a).indexOf(s)&&i.push(s),t.style.transform=d(a)})(t,a);const E=function(t){return r[t]&&(t=r[t]),m(t)?l(t):t}(a),R=c.get(E);return B(P.animations[E]),()=>{const e=()=>{var e,n;return null!==(n=null!==(e=z(t,E))&&void 0!==e?e:null==R?void 0:R.initialValue)&&void 0!==n?n:0};let a=function(t,e){for(let n=0;n<t.length;n++)null===t[n]&&(t[n]=n?t[n-1]:e());return t}((t=>Array.isArray(t)?t:[t])(i),e);if(w(x)){const t=x.createAnimation(a,e,$,E,P);x=t.easing,void 0!==t.keyframes&&(a=t.keyframes),void 0!==t.duration&&(u=t.duration)}if(y(E)?(V=((t,e)=>n=>t.style.setProperty(e,n))(t,E),D.cssRegisterProperty()?function(t){if(!g.has(t)){g.add(t);try{const{syntax:e,initialValue:n}=c.has(t)?c.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:n})}catch(t){}}}(E):j=!1):V=((t,e)=>n=>t.style[e]=n)(t,E),j){R&&(a=a.map((t=>S(t)?R.toDefaultUnit(t):t))),D.partialKeyframes()||1!==a.length||a.unshift(e());const i={delay:v(h),duration:v(u),endDelay:v(f),easing:T(x)?void 0:b(x),direction:k,iterations:p+1,fill:"both"};o=t.animate({[E]:a,offset:A,easing:T(x)?x.map(b):void 0},i),o.finished||(o.finished=new Promise(((t,e)=>{o.onfinish=t,o.oncancel=e})));const r=a[a.length-1];o.finished.then((()=>{V(r),o.cancel()})).catch(n),M||(o.playbackRate=1.000001)}else if($&&a.every(S)){if(1===a.length&&a.unshift(parseFloat(e())),R){const t=V;V=e=>t(R.toDefaultUnit(e))}o=new W(V,a,Object.assign(Object.assign({},s),{duration:u,easing:x}))}else{const t=a[a.length-1];V(R&&S(t)?R.toDefaultUnit(t):t)}return P.animations[E]=o,null==o||o.finished.then((()=>{P.animations[E]=void 0,P.generators[E]=void 0,P.prevGeneratorState[E]=void 0})).catch(n),o}}const K=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);const X=t=>t(),Y=t=>t.animations[0],Z={get:(t,e)=>{var a,i;switch(e){case"duration":return t.duration;case"currentTime":let r=(null===(a=Y(t))||void 0===a?void 0:a[e])||0;return r?r/1e3:0;case"playbackRate":return null===(i=Y(t))||void 0===i?void 0:i[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(H)).catch(n)),t.finished;case"stop":return()=>t.animations.forEach(B);default:return()=>t.animations.forEach((t=>t[e]()))}},set:(t,e,n)=>{switch(e){case"currentTime":n=v(n);case"currentTime":case"playbackRate":for(let a=0;a<t.animations.length;a++)t.animations[a][e]=n;return!0}return!1}},H=t=>t.finished;function I(t,e,n){return"function"==typeof t?t(e,n):t}function J(t,e,n={}){var a;t=function(t,e){var n;return"string"==typeof t?e?(null!==(n=e[t])&&void 0!==n||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t)}(t);const i=t.length,r=[];for(let a=0;a<i;a++){const s=t[a];for(const t in e){const o=K(n,t);o.delay=I(o.delay,a,i);const c=G(s,t,e[t],o);r.push(c)}}return s=r,o=null!==(a=n.duration)&&void 0!==a?a:O.duration,new Proxy({animations:s.map(X).filter(Boolean),duration:o},Z);var s,o}export{J as animate};

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

const t=new WeakMap;function e(e){return t.has(e)||t.set(e,{transforms:[],animations:{},generators:{},prevGeneratorState:{}}),t.get(e)}const a=()=>{},n=t=>t,i=["","X","Y","Z"],s={x:"translateX",y:"translateY",z:"translateZ"},r={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},o={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:r,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:n},skew:r},l=new Map,c=t=>`--motion-${t}`,h=["x","y","z"];["translate","scale","rotate","skew"].forEach((t=>{i.forEach((e=>{h.push(t+e),l.set(c(t+e),o[t])}))}));const u=(t,e)=>h.indexOf(t)-h.indexOf(e),f=new Set(h),p=t=>f.has(t),y=t=>t.sort(u).reduce(d,"").trim(),d=(t,e)=>`${t} ${e}(var(${c(e)}))`,m=t=>t.startsWith("--"),g=new Set;const v=t=>1e3*t,S=t=>"number"==typeof t,T=t=>Array.isArray(t)&&!S(t[0]),w=t=>"object"==typeof t&&Boolean(t.createAnimation),x=t=>(t=>Array.isArray(t)&&S(t[0]))(t)?b(t):t,b=([t,e,a,n])=>`cubic-bezier(${t}, ${e}, ${a}, ${n})`,k=t=>document.createElement("div").animate(t,{duration:.001}),M={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{k({opacity:[1]})}catch(t){return!1}return!0},finished:()=>Boolean(k({opacity:[0,1]}).finished)},A={},D={};for(const t in M)D[t]=()=>(void 0===A[t]&&(A[t]=M[t]()),A[t]);const P={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},O=(t,e,a)=>(((1-3*a+3*e)*t+(3*a-6*e))*t+3*e)*t;function V(t,e,a,i){if(t===e&&a===i)return n;const s=e=>function(t,e,a,n,i){let s,r,o=0;do{r=e+(a-e)/2,s=O(r,n,i)-t,s>0?a=r:e=r}while(Math.abs(s)>1e-7&&++o<12);return r}(e,0,1,t,a);return t=>0===t||1===t?t:O(s(t),e,i)}const $=(t,e="end")=>a=>{const n=(a="end"===e?Math.min(a,.999):Math.max(a,.001))*t,i="end"===e?Math.floor(n):Math.ceil(n);return s=0,r=1,o=i/t,Math.min(Math.max(o,s),r);var s,r,o},j={ease:V(.25,.1,.25,1),"ease-in":V(.42,0,1,1),"ease-in-out":V(.42,0,.58,1),"ease-out":V(0,0,.58,1)},U=/\((.*?)\)/;function R(t){if("function"==typeof t)return t;if(Array.isArray(t))return V(...t);if(j[t])return j[t];if(t.startsWith("steps")){const e=U.exec(t);if(e){const t=e[1].split(",");return $(parseFloat(t[0]),t[1].trim())}}return n}const C=(t,e,a)=>-a*t+a*e+t,E=(t,e,a)=>e-t==0?1:(a-t)/(e-t);function F(t,e){const a=t[t.length-1];for(let n=1;n<=e;n++){const i=E(0,e,n);t.push(C(a,1,i))}}function W(t,e=function(t){const e=[0];return F(e,t-1),e}(t.length),a=n){const i=t.length,s=i-e.length;return s>0&&F(e,s),n=>{let s=0;for(;s<i-2&&!(n<e[s+1]);s++);let r=(o=E(e[s],e[s+1],n),Math.min(1,Math.max(o,0)));var o;const l=function(t,e){return T(t)?t[((t,e,a)=>{const n=e-t;return((a-t)%n+n)%n+t})(0,t.length,e)]:t}(a,s);return r=l(r),C(t[s],t[s+1],r)}}class z{constructor(t,e=[0,1],{easing:a=P.easing,duration:n=P.duration,delay:i=P.delay,endDelay:s=P.endDelay,repeat:r=P.repeat,offset:o,direction:l="normal"}={}){this.startTime=0,this.rate=1,this.t=0,this.cancelT=0,this.playState="idle",this.finished=new Promise(((t,e)=>{this.resolve=t,this.reject=e}));const c=n*(r+1);w(a)&&(a="ease");const h=W(e,o,T(a)?a.map(R):R(a));this.tick=e=>{this.pauseTime&&(e=this.pauseTime);let a=(e-this.startTime)*this.rate;this.t=a,a/=1e3,a=Math.max(a-i,0),"finished"===this.playState&&(a=c);const r=a/n;let o=Math.floor(r),u=r%1;!u&&r>=1&&(u=1),1===u&&o--;const f=o%2;("reverse"===l||"alternate"===l&&f||"alternate-reverse"===l&&!f)&&(u=1-u);const p=h(a>=c?1:Math.min(u,1));t(p);"finished"===this.playState||a>=c+s?(this.playState="finished",this.resolve(p)):"idle"!==this.playState&&requestAnimationFrame(this.tick)},this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime?this.startTime=t-(this.pauseTime-this.startTime):this.startTime||(this.startTime=t),this.pauseTime=void 0,requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=performance.now()}finish(){this.playState="finished",this.tick(0)}cancel(){this.playState="idle",this.tick(this.cancelT),this.reject(!1)}reverse(){this.rate*=-1}commitStyles(){this.cancelT=this.t}get currentTime(){return this.t}set currentTime(t){this.pauseTime||0===this.rate?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}const q=(t,e)=>{let a=m(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!a&&0!==a){const t=l.get(e);t&&(a=t.initialValue)}return a};function B(t,n,i,r={}){let o,{duration:h=P.duration,delay:u=P.delay,endDelay:f=P.endDelay,repeat:d=P.repeat,easing:b=P.easing,direction:k,offset:M,allowWebkitAcceleration:A=!1}=r;const O=e(t);let V=D.waapi(),$=a;const j=p(n);j&&((t,a)=>{s[a]&&(a=s[a]);const{transforms:n}=e(t);var i,r;r=a,-1===(i=n).indexOf(r)&&i.push(r),t.style.transform=y(n)})(t,n);const U=function(t){return s[t]&&(t=s[t]),p(t)?c(t):t}(n),R=l.get(U);return function(t){if(t)try{"finished"!==t.playState&&t.commitStyles(),t.cancel()}catch(t){}}(O.animations[U]),()=>{const e=()=>{var e,a;return null!==(a=null!==(e=q(t,U))&&void 0!==e?e:null==R?void 0:R.initialValue)&&void 0!==a?a:0};let n=function(t,e){for(let a=0;a<t.length;a++)null===t[a]&&(t[a]=a?t[a-1]:e());return t}((t=>Array.isArray(t)?t:[t])(i),e);if(w(b)){const t=b.createAnimation(n,e,j,U,O);b=t.easing,void 0!==t.keyframes&&(n=t.keyframes),void 0!==t.duration&&(h=t.duration)}if(m(U)?($=((t,e)=>a=>t.style.setProperty(e,a))(t,U),D.cssRegisterProperty()?function(t){if(!g.has(t)){g.add(t);try{const{syntax:e,initialValue:a}=l.has(t)?l.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:a})}catch(t){}}}(U):V=!1):$=((t,e)=>a=>t.style[e]=a)(t,U),V){R&&(n=n.map((t=>S(t)?R.toDefaultUnit(t):t))),D.partialKeyframes()||1!==n.length||n.unshift(e());const i={delay:v(u),duration:v(h),endDelay:v(f),easing:T(b)?void 0:x(b),direction:k,iterations:d+1,fill:"both"};o=t.animate({[U]:n,offset:M,easing:T(b)?b.map(x):void 0},i),o.finished||(o.finished=new Promise(((t,e)=>{o.onfinish=t,o.oncancel=e})));const s=n[n.length-1];o.finished.then((()=>{$(s),o.cancel()})).catch(a),A||(o.playbackRate=1.000001)}else if(j&&n.every(S)){if(1===n.length&&n.unshift(parseFloat(e())),R){const t=$;$=e=>t(R.toDefaultUnit(e))}o=new z($,n,Object.assign(Object.assign({},r),{duration:h,easing:b}))}else{const t=n[n.length-1];$(R&&S(t)?R.toDefaultUnit(t):t)}return O.animations[U]=o,null==o||o.finished.then((()=>{O.animations[U]=void 0,O.generators[U]=void 0,O.prevGeneratorState[U]=void 0})).catch(a),o}}export{B as animateStyle};
const t=new WeakMap;function e(e){return t.has(e)||t.set(e,{transforms:[],animations:{},generators:{},prevGeneratorState:{}}),t.get(e)}const a=()=>{},n=t=>t,i=["","X","Y","Z"],s={x:"translateX",y:"translateY",z:"translateZ"},r={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},o={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:r,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:n},skew:r},l=new Map,c=t=>`--motion-${t}`,h=["x","y","z"];["translate","scale","rotate","skew"].forEach((t=>{i.forEach((e=>{h.push(t+e),l.set(c(t+e),o[t])}))}));const u=(t,e)=>h.indexOf(t)-h.indexOf(e),f=new Set(h),p=t=>f.has(t),m=t=>t.sort(u).reduce(y,"").trim(),y=(t,e)=>`${t} ${e}(var(${c(e)}))`,d=t=>t.startsWith("--"),g=new Set;const v=t=>1e3*t,S=t=>"number"==typeof t,T=t=>Array.isArray(t)&&!S(t[0]),w=t=>"object"==typeof t&&Boolean(t.createAnimation),x=t=>(t=>Array.isArray(t)&&S(t[0]))(t)?b(t):t,b=([t,e,a,n])=>`cubic-bezier(${t}, ${e}, ${a}, ${n})`,k=t=>document.createElement("div").animate(t,{duration:.001}),M={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{k({opacity:[1]})}catch(t){return!1}return!0},finished:()=>Boolean(k({opacity:[0,1]}).finished)},A={},D={};for(const t in M)D[t]=()=>(void 0===A[t]&&(A[t]=M[t]()),A[t]);const P={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},O=(t,e,a)=>(((1-3*a+3*e)*t+(3*a-6*e))*t+3*e)*t;function V(t,e,a,i){if(t===e&&a===i)return n;const s=e=>function(t,e,a,n,i){let s,r,o=0;do{r=e+(a-e)/2,s=O(r,n,i)-t,s>0?a=r:e=r}while(Math.abs(s)>1e-7&&++o<12);return r}(e,0,1,t,a);return t=>0===t||1===t?t:O(s(t),e,i)}const $=(t,e="end")=>a=>{const n=(a="end"===e?Math.min(a,.999):Math.max(a,.001))*t,i="end"===e?Math.floor(n):Math.ceil(n);return s=0,r=1,o=i/t,Math.min(Math.max(o,s),r);var s,r,o},j={ease:V(.25,.1,.25,1),"ease-in":V(.42,0,1,1),"ease-in-out":V(.42,0,.58,1),"ease-out":V(0,0,.58,1)},U=/\((.*?)\)/;function R(t){if("function"==typeof t)return t;if(Array.isArray(t))return V(...t);if(j[t])return j[t];if(t.startsWith("steps")){const e=U.exec(t);if(e){const t=e[1].split(",");return $(parseFloat(t[0]),t[1].trim())}}return n}const C=(t,e,a)=>-a*t+a*e+t,E=(t,e,a)=>e-t==0?1:(a-t)/(e-t);function F(t,e){const a=t[t.length-1];for(let n=1;n<=e;n++){const i=E(0,e,n);t.push(C(a,1,i))}}function W(t,e=function(t){const e=[0];return F(e,t-1),e}(t.length),a=n){const i=t.length,s=i-e.length;return s>0&&F(e,s),n=>{let s=0;for(;s<i-2&&!(n<e[s+1]);s++);let r=(o=E(e[s],e[s+1],n),Math.min(1,Math.max(o,0)));var o;const l=function(t,e){return T(t)?t[((t,e,a)=>{const n=e-t;return((a-t)%n+n)%n+t})(0,t.length,e)]:t}(a,s);return r=l(r),C(t[s],t[s+1],r)}}class z{constructor(t,e=[0,1],{easing:a=P.easing,duration:n=P.duration,delay:i=P.delay,endDelay:s=P.endDelay,repeat:r=P.repeat,offset:o,direction:l="normal"}={}){this.startTime=0,this.rate=1,this.t=0,this.cancelTimestamp=0,this.playState="idle",this.finished=new Promise(((t,e)=>{this.resolve=t,this.reject=e}));const c=n*(r+1);w(a)&&(a="ease");const h=W(e,o,T(a)?a.map(R):R(a));this.tick=e=>{this.pauseTime&&(e=this.pauseTime);let a=(e-this.startTime)*this.rate;this.t=a,a/=1e3,a=Math.max(a-i,0),"finished"===this.playState&&(a=c);const r=a/n;let o=Math.floor(r),u=r%1;!u&&r>=1&&(u=1),1===u&&o--;const f=o%2;("reverse"===l||"alternate"===l&&f||"alternate-reverse"===l&&!f)&&(u=1-u);const p=h(a>=c?1:Math.min(u,1));t(p);"finished"===this.playState||a>=c+s?(this.playState="finished",this.resolve(p)):"idle"!==this.playState&&requestAnimationFrame(this.tick)},this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime?this.startTime=t-(this.pauseTime-this.startTime):this.startTime||(this.startTime=t),this.pauseTime=void 0,requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=performance.now()}finish(){this.playState="finished",this.tick(0)}cancel(){this.playState="idle",this.tick(this.cancelTimestamp),this.reject(!1)}reverse(){this.rate*=-1}commitStyles(){this.cancelTimestamp=performance.now()}get currentTime(){return this.t}set currentTime(t){this.pauseTime||0===this.rate?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}const q=(t,e)=>{let a=d(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!a&&0!==a){const t=l.get(e);t&&(a=t.initialValue)}return a};function B(t,n,i,r={}){let o,{duration:h=P.duration,delay:u=P.delay,endDelay:f=P.endDelay,repeat:y=P.repeat,easing:b=P.easing,direction:k,offset:M,allowWebkitAcceleration:A=!1}=r;const O=e(t);let V=D.waapi(),$=a;const j=p(n);j&&((t,a)=>{s[a]&&(a=s[a]);const{transforms:n}=e(t);var i,r;r=a,-1===(i=n).indexOf(r)&&i.push(r),t.style.transform=m(n)})(t,n);const U=function(t){return s[t]&&(t=s[t]),p(t)?c(t):t}(n),R=l.get(U);return function(t){if(t)try{"finished"!==t.playState&&t.commitStyles(),t.cancel()}catch(t){}}(O.animations[U]),()=>{const e=()=>{var e,a;return null!==(a=null!==(e=q(t,U))&&void 0!==e?e:null==R?void 0:R.initialValue)&&void 0!==a?a:0};let n=function(t,e){for(let a=0;a<t.length;a++)null===t[a]&&(t[a]=a?t[a-1]:e());return t}((t=>Array.isArray(t)?t:[t])(i),e);if(w(b)){const t=b.createAnimation(n,e,j,U,O);b=t.easing,void 0!==t.keyframes&&(n=t.keyframes),void 0!==t.duration&&(h=t.duration)}if(d(U)?($=((t,e)=>a=>t.style.setProperty(e,a))(t,U),D.cssRegisterProperty()?function(t){if(!g.has(t)){g.add(t);try{const{syntax:e,initialValue:a}=l.has(t)?l.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:a})}catch(t){}}}(U):V=!1):$=((t,e)=>a=>t.style[e]=a)(t,U),V){R&&(n=n.map((t=>S(t)?R.toDefaultUnit(t):t))),D.partialKeyframes()||1!==n.length||n.unshift(e());const i={delay:v(u),duration:v(h),endDelay:v(f),easing:T(b)?void 0:x(b),direction:k,iterations:y+1,fill:"both"};o=t.animate({[U]:n,offset:M,easing:T(b)?b.map(x):void 0},i),o.finished||(o.finished=new Promise(((t,e)=>{o.onfinish=t,o.oncancel=e})));const s=n[n.length-1];o.finished.then((()=>{$(s),o.cancel()})).catch(a),A||(o.playbackRate=1.000001)}else if(j&&n.every(S)){if(1===n.length&&n.unshift(parseFloat(e())),R){const t=$;$=e=>t(R.toDefaultUnit(e))}o=new z($,n,Object.assign(Object.assign({},r),{duration:h,easing:b}))}else{const t=n[n.length-1];$(R&&S(t)?R.toDefaultUnit(t):t)}return O.animations[U]=o,null==o||o.finished.then((()=>{O.animations[U]=void 0,O.generators[U]=void 0,O.prevGeneratorState[U]=void 0})).catch(a),o}}export{B as animateStyle};

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

import*as t from"react";import{useRef as e,useEffect as n,useState as r,createContext as i,useContext as s,forwardRef as o,createElement as a,useMemo as c}from"react";const l=new WeakMap;function u(t){return l.has(t)||l.set(t,{transforms:[],animations:{},generators:{},prevGeneratorState:{}}),l.get(t)}const h=()=>{},p=t=>t,f=["","X","Y","Z"],y={x:"translateX",y:"translateY",z:"translateZ"},d={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},m={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:d,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:p},skew:d},g=new Map,v=t=>`--motion-${t}`,w=["x","y","z"];["translate","scale","rotate","skew"].forEach((t=>{f.forEach((e=>{w.push(t+e),g.set(v(t+e),m[t])}))}));const b=(t,e)=>w.indexOf(t)-w.indexOf(e),O=new Set(w),S=t=>O.has(t),x=t=>t.sort(b).reduce(j,"").trim(),j=(t,e)=>`${t} ${e}(var(${v(e)}))`,P=t=>t.startsWith("--"),T=new Set;const V=t=>1e3*t,A=t=>"number"==typeof t,k=t=>Array.isArray(t)&&!A(t[0]),M=t=>"object"==typeof t&&Boolean(t.createAnimation),D=t=>(t=>Array.isArray(t)&&A(t[0]))(t)?E(t):t,E=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,$=t=>document.createElement("div").animate(t,{duration:.001}),C={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{$({opacity:[1]})}catch(t){return!1}return!0},finished:()=>Boolean($({opacity:[0,1]}).finished)},L={},U={};for(const t in C)U[t]=()=>(void 0===L[t]&&(L[t]=C[t]()),L[t]);const I={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},R=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function B(t,e,n,r){if(t===e&&n===r)return p;const i=e=>function(t,e,n,r,i){let s,o,a=0;do{o=e+(n-e)/2,s=R(o,r,i)-t,s>0?n=o:e=o}while(Math.abs(s)>1e-7&&++a<12);return o}(e,0,1,t,n);return t=>0===t||1===t?t:R(i(t),e,r)}const F=(t,e="end")=>n=>{const r=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,i="end"===e?Math.floor(r):Math.ceil(r);return s=0,o=1,a=i/t,Math.min(Math.max(a,s),o);var s,o,a},W={ease:B(.25,.1,.25,1),"ease-in":B(.42,0,1,1),"ease-in-out":B(.42,0,.58,1),"ease-out":B(0,0,.58,1)},z=/\((.*?)\)/;function q(t){if("function"==typeof t)return t;if(Array.isArray(t))return B(...t);if(W[t])return W[t];if(t.startsWith("steps")){const e=z.exec(t);if(e){const t=e[1].split(",");return F(parseFloat(t[0]),t[1].trim())}}return p}const G=(t,e,n)=>-n*t+n*e+t,K=(t,e,n)=>e-t==0?1:(n-t)/(e-t);function X(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const i=K(0,e,r);t.push(G(n,1,i))}}function Y(t,e=function(t){const e=[0];return X(e,t-1),e}(t.length),n=p){const r=t.length,i=r-e.length;return i>0&&X(e,i),i=>{let s=0;for(;s<r-2&&!(i<e[s+1]);s++);let o=(a=K(e[s],e[s+1],i),Math.min(1,Math.max(a,0)));var a;const c=function(t,e){return k(t)?t[((t,e,n)=>{const r=e-t;return((n-t)%r+r)%r+t})(0,t.length,e)]:t}(n,s);return o=c(o),G(t[s],t[s+1],o)}}class Z{constructor(t,e=[0,1],{easing:n=I.easing,duration:r=I.duration,delay:i=I.delay,endDelay:s=I.endDelay,repeat:o=I.repeat,offset:a,direction:c="normal"}={}){this.startTime=0,this.rate=1,this.t=0,this.cancelT=0,this.playState="idle",this.finished=new Promise(((t,e)=>{this.resolve=t,this.reject=e}));const l=r*(o+1);M(n)&&(n="ease");const u=Y(e,a,k(n)?n.map(q):q(n));this.tick=e=>{this.pauseTime&&(e=this.pauseTime);let n=(e-this.startTime)*this.rate;this.t=n,n/=1e3,n=Math.max(n-i,0),"finished"===this.playState&&(n=l);const o=n/r;let a=Math.floor(o),h=o%1;!h&&o>=1&&(h=1),1===h&&a--;const p=a%2;("reverse"===c||"alternate"===c&&p||"alternate-reverse"===c&&!p)&&(h=1-h);const f=u(n>=l?1:Math.min(h,1));t(f);"finished"===this.playState||n>=l+s?(this.playState="finished",this.resolve(f)):"idle"!==this.playState&&requestAnimationFrame(this.tick)},this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime?this.startTime=t-(this.pauseTime-this.startTime):this.startTime||(this.startTime=t),this.pauseTime=void 0,requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=performance.now()}finish(){this.playState="finished",this.tick(0)}cancel(){this.playState="idle",this.tick(this.cancelT),this.reject(!1)}reverse(){this.rate*=-1}commitStyles(){this.cancelT=this.t}get currentTime(){return this.t}set currentTime(t){this.pauseTime||0===this.rate?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}const H=(t,e)=>{let n=P(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!n&&0!==n){const t=g.get(e);t&&(n=t.initialValue)}return n};function J(t,e,n,r={}){let i,{duration:s=I.duration,delay:o=I.delay,endDelay:a=I.endDelay,repeat:c=I.repeat,easing:l=I.easing,direction:p,offset:f,allowWebkitAcceleration:d=!1}=r;const m=u(t);let w=U.waapi(),b=h;const O=S(e);O&&((t,e)=>{y[e]&&(e=y[e]);const{transforms:n}=u(t);var r,i;i=e,-1===(r=n).indexOf(i)&&r.push(i),t.style.transform=x(n)})(t,e);const j=function(t){return y[t]&&(t=y[t]),S(t)?v(t):t}(e),E=g.get(j);return function(t){if(t)try{"finished"!==t.playState&&t.commitStyles(),t.cancel()}catch(t){}}(m.animations[j]),()=>{const e=()=>{var e,n;return null!==(n=null!==(e=H(t,j))&&void 0!==e?e:null==E?void 0:E.initialValue)&&void 0!==n?n:0};let u=function(t,e){for(let n=0;n<t.length;n++)null===t[n]&&(t[n]=n?t[n-1]:e());return t}((t=>Array.isArray(t)?t:[t])(n),e);if(M(l)){const t=l.createAnimation(u,e,O,j,m);l=t.easing,void 0!==t.keyframes&&(u=t.keyframes),void 0!==t.duration&&(s=t.duration)}if(P(j)?(b=((t,e)=>n=>t.style.setProperty(e,n))(t,j),U.cssRegisterProperty()?function(t){if(!T.has(t)){T.add(t);try{const{syntax:e,initialValue:n}=g.has(t)?g.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:n})}catch(t){}}}(j):w=!1):b=((t,e)=>n=>t.style[e]=n)(t,j),w){E&&(u=u.map((t=>A(t)?E.toDefaultUnit(t):t))),U.partialKeyframes()||1!==u.length||u.unshift(e());const n={delay:V(o),duration:V(s),endDelay:V(a),easing:k(l)?void 0:D(l),direction:p,iterations:c+1,fill:"both"};i=t.animate({[j]:u,offset:f,easing:k(l)?l.map(D):void 0},n),i.finished||(i.finished=new Promise(((t,e)=>{i.onfinish=t,i.oncancel=e})));const r=u[u.length-1];i.finished.then((()=>{b(r),i.cancel()})).catch(h),d||(i.playbackRate=1.000001)}else if(O&&u.every(A)){if(1===u.length&&u.unshift(parseFloat(e())),E){const t=b;b=e=>t(E.toDefaultUnit(e))}i=new Z(b,u,Object.assign(Object.assign({},r),{duration:s,easing:l}))}else{const t=u[u.length-1];b(E&&A(t)?E.toDefaultUnit(t):t)}return m.animations[j]=i,null==i||i.finished.then((()=>{m.animations[j]=void 0,m.generators[j]=void 0,m.prevGeneratorState[j]=void 0})).catch(h),i}}const N=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function Q(t,r,i,s,o,a){const c=e(r);n((()=>{const e={};if(new Set([...Object.keys(i),...Object.keys(c.current)]).forEach((t=>{let n=i[t];var r,s;(r=n,s=c.current[t],typeof r==typeof s&&(Array.isArray(r)&&Array.isArray(s)?function(t,e){const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}(r,s):r===s))||(e[t]=n)})),Object.keys(e).length&&t.current){null==o||o(e);const n=[];for(const r in e){const i=J(t.current,r,e[r],N(s,r));n.push(i)}const r=n.map((t=>t())).filter(Boolean);Promise.all(r.map((t=>t.finished))).then((()=>null==a?void 0:a(e))).catch(h)}c.current=i}))}function _(t,e,n={}){return t?"string"==typeof t?n[t]:t:e?n[e]:void 0}function tt(t,e,n){if(n)for(const r in n)"options"!==r&&(t[r]=n[r],n.options&&(e[r]=N(n.options,r)))}function et(t,e,n,i,s){const[o,a]=r(!1);return(o||i)&&tt(t,e,_(n,i,s)),[o||Boolean(i),a]}var nt=i(null);var rt=0,it=function(){return rt++},st=function(){return t=it,null===(n=e(null)).current&&(n.current=t()),n.current;var t,n};function ot(t,e,{exit:r,poses:i},{exit:o}){const[a,c]=function(){var t=s(nt);if(null===t)return[!0,null];var e=t.isPresent,r=t.onExitComplete,i=t.register,o=st();return n((function(){return i(o)}),[]),!e&&r?[!1,function(){return null==r?void 0:r(o)}]:[!0]}();if(n((()=>{r||null==c||c()}),[a]),r&&!a)return tt(t,e,_(r,o,i)),c}const at=i({});function ct(r){return o((function(i,o){const l=e(null),{options:u,style:h,initial:p,hover:f,press:d,exit:m,inViewport:w,viewport:b,poses:O,onStart:j,onComplete:P,onViewportEnter:T,onViewportLeave:V,inherit:k=!0}=i,M=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(i,["options","style","initial","hover","press","exit","inViewport","viewport","poses","onStart","onComplete","onViewportEnter","onViewportLeave","inherit"]),D={initial:!0,style:!0};let E=s(at);k||(E={});const $=_(h,E.style,O),C=_(p,E.initial,O),L=Object.assign(Object.assign({},$),C),U=Object.assign(Object.assign({},C),$),I=Object.assign(Object.assign({},u),null==$?void 0:$.options),R=e(null);R.current||(R.current=function(t){const e={},n=[];for(let r in t){const i=t[r];S(r)&&(y[r]&&(r=y[r]),n.push(r),r=v(r));let s=Array.isArray(i)?i[0]:i;const o=g.get(r);o&&(s=A(i)?o.toDefaultUnit(i):i),e[r]=s}return n.length&&(e.transform=x(n)),e}(L));const B=function(t,e,{hover:n,onPointerEnter:r,onPointerLeave:i,poses:s}={},{hover:o},a){const[c,l]=et(t,e,n,o,s);return a.hover=c,n?{onPointerEnter:t=>{null==r||r(t),l(!0)},onPointerLeave:t=>{null==i||i(t),l(!1)}}:{}}(U,I,i,E,D),F=function(t,e,{press:n,onPointerDown:r,poses:i}={},{press:s},o){const[a,c]=et(t,e,n,s,i);if(o.press=a,!n)return{};const l=()=>{c(!1),window.removeEventListener("pointerup",l)};return{onPointerDown:t=>{null==r||r(t),c(!0),window.addEventListener("pointerup",l)}}}(U,I,i,E,D);!function(t,e,r,{inViewport:i,poses:s,viewport:o={},onViewportEnter:a,onViewportLeave:c},{inViewport:l},u){const{root:h,margin:p,once:f,threshold:y}=o,[d,m]=et(e,r,i,l,s);u.inViewport=d;let g=!!i||!!a||!!c;f&&d&&(g=!1),n((()=>{if(!g||"undefined"==typeof IntersectionObserver)return;const e=new IntersectionObserver((([t])=>{m(t.isIntersecting);const e=t.isIntersecting?a:c;e&&e(t)}),{root:null==h?void 0:h.current,rootMargin:p,threshold:y});return e.observe(t.current),()=>e.disconnect()}),[i,a,c,h,p,y])}(l,U,I,i,E,D);const W=ot(U,I,i,E);Q(l,L,U,I,j,(t=>{P&&P(t),W&&W()}));const z=a(r,Object.assign({},M,B,F,{style:R.current,ref:l})),q=lt.reduce(((t,e)=>(t[e]=void 0,i[e]?"string"==typeof i[e]&&D[e]&&(t[e]=i[e]):E[e]&&(t[e]=E[e]),t)),{}),G=c((()=>q),Object.values(q));return t.createElement(at.Provider,{value:G},z)}))}const lt=["initial","style","hover","press","inViewport","exit"],ut=new Map,ht=new Proxy({},{get:(t,e)=>(ut.has(e)||ut.set(e,ct(e)),ut.get(e))});export{ht as animated};
import*as t from"react";import{useRef as e,useEffect as n,useState as r,createContext as i,useContext as s,forwardRef as o,createElement as a,useMemo as c}from"react";const l=new WeakMap;function u(t){return l.has(t)||l.set(t,{transforms:[],animations:{},generators:{},prevGeneratorState:{}}),l.get(t)}const p=()=>{},h=t=>t,f=["","X","Y","Z"],y={x:"translateX",y:"translateY",z:"translateZ"},m={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},d={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:m,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:h},skew:m},g=new Map,v=t=>`--motion-${t}`,w=["x","y","z"];["translate","scale","rotate","skew"].forEach((t=>{f.forEach((e=>{w.push(t+e),g.set(v(t+e),d[t])}))}));const b=(t,e)=>w.indexOf(t)-w.indexOf(e),O=new Set(w),S=t=>O.has(t),x=t=>t.sort(b).reduce(j,"").trim(),j=(t,e)=>`${t} ${e}(var(${v(e)}))`,P=t=>t.startsWith("--"),T=new Set;const V=t=>1e3*t,A=t=>"number"==typeof t,k=t=>Array.isArray(t)&&!A(t[0]),M=t=>"object"==typeof t&&Boolean(t.createAnimation),D=t=>(t=>Array.isArray(t)&&A(t[0]))(t)?E(t):t,E=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,$=t=>document.createElement("div").animate(t,{duration:.001}),C={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{$({opacity:[1]})}catch(t){return!1}return!0},finished:()=>Boolean($({opacity:[0,1]}).finished)},L={},U={};for(const t in C)U[t]=()=>(void 0===L[t]&&(L[t]=C[t]()),L[t]);const I={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},R=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function B(t,e,n,r){if(t===e&&n===r)return h;const i=e=>function(t,e,n,r,i){let s,o,a=0;do{o=e+(n-e)/2,s=R(o,r,i)-t,s>0?n=o:e=o}while(Math.abs(s)>1e-7&&++a<12);return o}(e,0,1,t,n);return t=>0===t||1===t?t:R(i(t),e,r)}const F=(t,e="end")=>n=>{const r=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,i="end"===e?Math.floor(r):Math.ceil(r);return s=0,o=1,a=i/t,Math.min(Math.max(a,s),o);var s,o,a},W={ease:B(.25,.1,.25,1),"ease-in":B(.42,0,1,1),"ease-in-out":B(.42,0,.58,1),"ease-out":B(0,0,.58,1)},z=/\((.*?)\)/;function q(t){if("function"==typeof t)return t;if(Array.isArray(t))return B(...t);if(W[t])return W[t];if(t.startsWith("steps")){const e=z.exec(t);if(e){const t=e[1].split(",");return F(parseFloat(t[0]),t[1].trim())}}return h}const G=(t,e,n)=>-n*t+n*e+t,K=(t,e,n)=>e-t==0?1:(n-t)/(e-t);function X(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const i=K(0,e,r);t.push(G(n,1,i))}}function Y(t,e=function(t){const e=[0];return X(e,t-1),e}(t.length),n=h){const r=t.length,i=r-e.length;return i>0&&X(e,i),i=>{let s=0;for(;s<r-2&&!(i<e[s+1]);s++);let o=(a=K(e[s],e[s+1],i),Math.min(1,Math.max(a,0)));var a;const c=function(t,e){return k(t)?t[((t,e,n)=>{const r=e-t;return((n-t)%r+r)%r+t})(0,t.length,e)]:t}(n,s);return o=c(o),G(t[s],t[s+1],o)}}class Z{constructor(t,e=[0,1],{easing:n=I.easing,duration:r=I.duration,delay:i=I.delay,endDelay:s=I.endDelay,repeat:o=I.repeat,offset:a,direction:c="normal"}={}){this.startTime=0,this.rate=1,this.t=0,this.cancelTimestamp=0,this.playState="idle",this.finished=new Promise(((t,e)=>{this.resolve=t,this.reject=e}));const l=r*(o+1);M(n)&&(n="ease");const u=Y(e,a,k(n)?n.map(q):q(n));this.tick=e=>{this.pauseTime&&(e=this.pauseTime);let n=(e-this.startTime)*this.rate;this.t=n,n/=1e3,n=Math.max(n-i,0),"finished"===this.playState&&(n=l);const o=n/r;let a=Math.floor(o),p=o%1;!p&&o>=1&&(p=1),1===p&&a--;const h=a%2;("reverse"===c||"alternate"===c&&h||"alternate-reverse"===c&&!h)&&(p=1-p);const f=u(n>=l?1:Math.min(p,1));t(f);"finished"===this.playState||n>=l+s?(this.playState="finished",this.resolve(f)):"idle"!==this.playState&&requestAnimationFrame(this.tick)},this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime?this.startTime=t-(this.pauseTime-this.startTime):this.startTime||(this.startTime=t),this.pauseTime=void 0,requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=performance.now()}finish(){this.playState="finished",this.tick(0)}cancel(){this.playState="idle",this.tick(this.cancelTimestamp),this.reject(!1)}reverse(){this.rate*=-1}commitStyles(){this.cancelTimestamp=performance.now()}get currentTime(){return this.t}set currentTime(t){this.pauseTime||0===this.rate?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}const H=(t,e)=>{let n=P(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!n&&0!==n){const t=g.get(e);t&&(n=t.initialValue)}return n};function J(t,e,n,r={}){let i,{duration:s=I.duration,delay:o=I.delay,endDelay:a=I.endDelay,repeat:c=I.repeat,easing:l=I.easing,direction:h,offset:f,allowWebkitAcceleration:m=!1}=r;const d=u(t);let w=U.waapi(),b=p;const O=S(e);O&&((t,e)=>{y[e]&&(e=y[e]);const{transforms:n}=u(t);var r,i;i=e,-1===(r=n).indexOf(i)&&r.push(i),t.style.transform=x(n)})(t,e);const j=function(t){return y[t]&&(t=y[t]),S(t)?v(t):t}(e),E=g.get(j);return function(t){if(t)try{"finished"!==t.playState&&t.commitStyles(),t.cancel()}catch(t){}}(d.animations[j]),()=>{const e=()=>{var e,n;return null!==(n=null!==(e=H(t,j))&&void 0!==e?e:null==E?void 0:E.initialValue)&&void 0!==n?n:0};let u=function(t,e){for(let n=0;n<t.length;n++)null===t[n]&&(t[n]=n?t[n-1]:e());return t}((t=>Array.isArray(t)?t:[t])(n),e);if(M(l)){const t=l.createAnimation(u,e,O,j,d);l=t.easing,void 0!==t.keyframes&&(u=t.keyframes),void 0!==t.duration&&(s=t.duration)}if(P(j)?(b=((t,e)=>n=>t.style.setProperty(e,n))(t,j),U.cssRegisterProperty()?function(t){if(!T.has(t)){T.add(t);try{const{syntax:e,initialValue:n}=g.has(t)?g.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:n})}catch(t){}}}(j):w=!1):b=((t,e)=>n=>t.style[e]=n)(t,j),w){E&&(u=u.map((t=>A(t)?E.toDefaultUnit(t):t))),U.partialKeyframes()||1!==u.length||u.unshift(e());const n={delay:V(o),duration:V(s),endDelay:V(a),easing:k(l)?void 0:D(l),direction:h,iterations:c+1,fill:"both"};i=t.animate({[j]:u,offset:f,easing:k(l)?l.map(D):void 0},n),i.finished||(i.finished=new Promise(((t,e)=>{i.onfinish=t,i.oncancel=e})));const r=u[u.length-1];i.finished.then((()=>{b(r),i.cancel()})).catch(p),m||(i.playbackRate=1.000001)}else if(O&&u.every(A)){if(1===u.length&&u.unshift(parseFloat(e())),E){const t=b;b=e=>t(E.toDefaultUnit(e))}i=new Z(b,u,Object.assign(Object.assign({},r),{duration:s,easing:l}))}else{const t=u[u.length-1];b(E&&A(t)?E.toDefaultUnit(t):t)}return d.animations[j]=i,null==i||i.finished.then((()=>{d.animations[j]=void 0,d.generators[j]=void 0,d.prevGeneratorState[j]=void 0})).catch(p),i}}const N=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function Q(t,r,i,s,o,a){const c=e(r);n((()=>{const e={};if(new Set([...Object.keys(i),...Object.keys(c.current)]).forEach((t=>{let n=i[t];var r,s;(r=n,s=c.current[t],typeof r==typeof s&&(Array.isArray(r)&&Array.isArray(s)?function(t,e){const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}(r,s):r===s))||(e[t]=n)})),Object.keys(e).length&&t.current){null==o||o(e);const n=[];for(const r in e){const i=J(t.current,r,e[r],N(s,r));n.push(i)}const r=n.map((t=>t())).filter(Boolean);Promise.all(r.map((t=>t.finished))).then((()=>null==a?void 0:a(e))).catch(p)}c.current=i}))}function _(t,e,n={}){return t?"string"==typeof t?n[t]:t:e?n[e]:void 0}function tt(t,e,n){if(n)for(const r in n)"options"!==r&&(t[r]=n[r],n.options&&(e[r]=N(n.options,r)))}function et(t,e,n,i,s){const[o,a]=r(!1);return(o||i)&&tt(t,e,_(n,i,s)),[o||Boolean(i),a]}var nt=i(null);var rt=0,it=function(){return rt++},st=function(){return t=it,null===(n=e(null)).current&&(n.current=t()),n.current;var t,n};function ot(t,e,{exit:r,poses:i},{exit:o}){const[a,c]=function(){var t=s(nt);if(null===t)return[!0,null];var e=t.isPresent,r=t.onExitComplete,i=t.register,o=st();return n((function(){return i(o)}),[]),!e&&r?[!1,function(){return null==r?void 0:r(o)}]:[!0]}();if(n((()=>{r||null==c||c()}),[a]),r&&!a)return tt(t,e,_(r,o,i)),c}const at=i({});function ct(r){return o((function(i,o){const l=e(null),{options:u,style:p,initial:h,hover:f,press:m,exit:d,inViewport:w,viewport:b,poses:O,onStart:j,onComplete:P,onViewportEnter:T,onViewportLeave:V,inherit:k=!0}=i,M=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(i,["options","style","initial","hover","press","exit","inViewport","viewport","poses","onStart","onComplete","onViewportEnter","onViewportLeave","inherit"]),D={initial:!0,style:!0};let E=s(at);k||(E={});const $=_(p,E.style,O),C=_(h,E.initial,O),L=Object.assign(Object.assign({},$),C),U=Object.assign(Object.assign({},C),$),I=Object.assign(Object.assign({},u),null==$?void 0:$.options),R=e(null);R.current||(R.current=function(t){const e={},n=[];for(let r in t){const i=t[r];S(r)&&(y[r]&&(r=y[r]),n.push(r),r=v(r));let s=Array.isArray(i)?i[0]:i;const o=g.get(r);o&&(s=A(i)?o.toDefaultUnit(i):i),e[r]=s}return n.length&&(e.transform=x(n)),e}(L));const B=function(t,e,{hover:n,onPointerEnter:r,onPointerLeave:i,poses:s}={},{hover:o},a){const[c,l]=et(t,e,n,o,s);return a.hover=c,n?{onPointerEnter:t=>{null==r||r(t),l(!0)},onPointerLeave:t=>{null==i||i(t),l(!1)}}:{}}(U,I,i,E,D),F=function(t,e,{press:n,onPointerDown:r,poses:i}={},{press:s},o){const[a,c]=et(t,e,n,s,i);if(o.press=a,!n)return{};const l=()=>{c(!1),window.removeEventListener("pointerup",l)};return{onPointerDown:t=>{null==r||r(t),c(!0),window.addEventListener("pointerup",l)}}}(U,I,i,E,D);!function(t,e,r,{inViewport:i,poses:s,viewport:o={},onViewportEnter:a,onViewportLeave:c},{inViewport:l},u){const{root:p,margin:h,once:f,threshold:y}=o,[m,d]=et(e,r,i,l,s);u.inViewport=m;let g=!!i||!!a||!!c;f&&m&&(g=!1),n((()=>{if(!g||"undefined"==typeof IntersectionObserver)return;const e=new IntersectionObserver((([t])=>{d(t.isIntersecting);const e=t.isIntersecting?a:c;e&&e(t)}),{root:null==p?void 0:p.current,rootMargin:h,threshold:y});return e.observe(t.current),()=>e.disconnect()}),[i,a,c,p,h,y])}(l,U,I,i,E,D);const W=ot(U,I,i,E);Q(l,L,U,I,j,(t=>{P&&P(t),W&&W()}));const z=a(r,Object.assign({},M,B,F,{style:R.current,ref:l})),q=lt.reduce(((t,e)=>(t[e]=void 0,i[e]?"string"==typeof i[e]&&D[e]&&(t[e]=i[e]):E[e]&&(t[e]=E[e]),t)),{}),G=c((()=>q),Object.values(q));return t.createElement(at.Provider,{value:G},z)}))}const lt=["initial","style","hover","press","inViewport","exit"],ut=new Map,pt=new Proxy({},{get:(t,e)=>(ut.has(e)||ut.set(e,ct(e)),ut.get(e))});export{pt as animated};

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

const t=(t,e,n)=>e-t==0?1:(n-t)/(e-t),e=()=>{},n=t=>t,a=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function i(t,e,i,s){if(t===e&&i===s)return n;const r=e=>function(t,e,n,i,s){let r,o,l=0;do{o=e+(n-e)/2,r=a(o,i,s)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++l<12);return o}(e,0,1,t,i);return t=>0===t||1===t?t:a(r(t),e,s)}const s=(t,e="end")=>n=>{const a=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,i="end"===e?Math.floor(a):Math.ceil(a);return s=0,r=1,o=i/t,Math.min(Math.max(o,s),r);var s,r,o},r={ease:i(.25,.1,.25,1),"ease-in":i(.42,0,1,1),"ease-in-out":i(.42,0,.58,1),"ease-out":i(0,0,.58,1)},o=/\((.*?)\)/;function l(t){if("function"==typeof t)return t;if(Array.isArray(t))return i(...t);if(r[t])return r[t];if(t.startsWith("steps")){const e=o.exec(t);if(e){const t=e[1].split(",");return s(parseFloat(t[0]),t[1].trim())}}return n}const c=t=>"number"==typeof t;function u(t,e,n){return"function"==typeof t?t(e,n):t}const h=(t,e,n)=>-n*t+n*e+t;function f(e,n){const a=e[e.length-1];for(let i=1;i<=n;i++){const s=t(0,n,i);e.push(h(a,1,s))}}function d(t){const e=[0];return f(e,t-1),e}const p=new WeakMap;function m(t){return p.has(t)||p.set(t,{transforms:[],animations:{},generators:{},prevGeneratorState:{}}),p.get(t)}function y(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const g=["","X","Y","Z"],v={x:"translateX",y:"translateY",z:"translateZ"},b={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},O={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:b,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:n},skew:b},S=new Map,w=t=>`--motion-${t}`,x=["x","y","z"];["translate","scale","rotate","skew"].forEach((t=>{g.forEach((e=>{x.push(t+e),S.set(w(t+e),O[t])}))}));const T=(t,e)=>x.indexOf(t)-x.indexOf(e),M=new Set(x),j=t=>M.has(t),k=t=>t.sort(T).reduce(A,"").trim(),A=(t,e)=>`${t} ${e}(var(${w(e)}))`,P=t=>t.startsWith("--"),D=new Set;const E=t=>1e3*t,V=t=>Array.isArray(t)&&!c(t[0]),$=t=>"object"==typeof t&&Boolean(t.createAnimation),R=t=>(t=>Array.isArray(t)&&c(t[0]))(t)?U(t):t,U=([t,e,n,a])=>`cubic-bezier(${t}, ${e}, ${n}, ${a})`,W=t=>document.createElement("div").animate(t,{duration:.001}),F={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{W({opacity:[1]})}catch(t){return!1}return!0},finished:()=>Boolean(W({opacity:[0,1]}).finished)},q={},B={};for(const t in F)B[t]=()=>(void 0===q[t]&&(q[t]=F[t]()),q[t]);const C={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"};function z(t,e){return V(t)?t[((t,e,n)=>{const a=e-t;return((n-t)%a+a)%a+t})(0,t.length,e)]:t}function G(e,a=d(e.length),i=n){const s=e.length,r=s-a.length;return r>0&&f(a,r),n=>{let r=0;for(;r<s-2&&!(n<a[r+1]);r++);let o=(l=t(a[r],a[r+1],n),Math.min(1,Math.max(l,0)));var l;return o=z(i,r)(o),h(e[r],e[r+1],o)}}class K{constructor(t,e=[0,1],{easing:n=C.easing,duration:a=C.duration,delay:i=C.delay,endDelay:s=C.endDelay,repeat:r=C.repeat,offset:o,direction:c="normal"}={}){this.startTime=0,this.rate=1,this.t=0,this.cancelT=0,this.playState="idle",this.finished=new Promise(((t,e)=>{this.resolve=t,this.reject=e}));const u=a*(r+1);$(n)&&(n="ease");const h=G(e,o,V(n)?n.map(l):l(n));this.tick=e=>{this.pauseTime&&(e=this.pauseTime);let n=(e-this.startTime)*this.rate;this.t=n,n/=1e3,n=Math.max(n-i,0),"finished"===this.playState&&(n=u);const r=n/a;let o=Math.floor(r),l=r%1;!l&&r>=1&&(l=1),1===l&&o--;const f=o%2;("reverse"===c||"alternate"===c&&f||"alternate-reverse"===c&&!f)&&(l=1-l);const d=h(n>=u?1:Math.min(l,1));t(d);"finished"===this.playState||n>=u+s?(this.playState="finished",this.resolve(d)):"idle"!==this.playState&&requestAnimationFrame(this.tick)},this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime?this.startTime=t-(this.pauseTime-this.startTime):this.startTime||(this.startTime=t),this.pauseTime=void 0,requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=performance.now()}finish(){this.playState="finished",this.tick(0)}cancel(){this.playState="idle",this.tick(this.cancelT),this.reject(!1)}reverse(){this.rate*=-1}commitStyles(){this.cancelT=this.t}get currentTime(){return this.t}set currentTime(t){this.pauseTime||0===this.rate?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}const X=t=>Array.isArray(t)?t:[t],Y=(t,e)=>{let n=P(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!n&&0!==n){const t=S.get(e);t&&(n=t.initialValue)}return n};function Z(t){if(t)try{"finished"!==t.playState&&t.commitStyles(),t.cancel()}catch(t){}}function I(t,n,a,i={}){let s,{duration:r=C.duration,delay:o=C.delay,endDelay:l=C.endDelay,repeat:u=C.repeat,easing:h=C.easing,direction:f,offset:d,allowWebkitAcceleration:p=!1}=i;const y=m(t);let g=B.waapi(),b=e;const O=j(n);O&&((t,e)=>{v[e]&&(e=v[e]);const{transforms:n}=m(t);var a,i;i=e,-1===(a=n).indexOf(i)&&a.push(i),t.style.transform=k(n)})(t,n);const x=function(t){return v[t]&&(t=v[t]),j(t)?w(t):t}(n),T=S.get(x);return Z(y.animations[x]),()=>{const n=()=>{var e,n;return null!==(n=null!==(e=Y(t,x))&&void 0!==e?e:null==T?void 0:T.initialValue)&&void 0!==n?n:0};let m=function(t,e){for(let n=0;n<t.length;n++)null===t[n]&&(t[n]=n?t[n-1]:e());return t}(X(a),n);if($(h)){const t=h.createAnimation(m,n,O,x,y);h=t.easing,void 0!==t.keyframes&&(m=t.keyframes),void 0!==t.duration&&(r=t.duration)}if(P(x)?(b=((t,e)=>n=>t.style.setProperty(e,n))(t,x),B.cssRegisterProperty()?function(t){if(!D.has(t)){D.add(t);try{const{syntax:e,initialValue:n}=S.has(t)?S.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:n})}catch(t){}}}(x):g=!1):b=((t,e)=>n=>t.style[e]=n)(t,x),g){T&&(m=m.map((t=>c(t)?T.toDefaultUnit(t):t))),B.partialKeyframes()||1!==m.length||m.unshift(n());const a={delay:E(o),duration:E(r),endDelay:E(l),easing:V(h)?void 0:R(h),direction:f,iterations:u+1,fill:"both"};s=t.animate({[x]:m,offset:d,easing:V(h)?h.map(R):void 0},a),s.finished||(s.finished=new Promise(((t,e)=>{s.onfinish=t,s.oncancel=e})));const i=m[m.length-1];s.finished.then((()=>{b(i),s.cancel()})).catch(e),p||(s.playbackRate=1.000001)}else if(O&&m.every(c)){if(1===m.length&&m.unshift(parseFloat(n())),T){const t=b;b=e=>t(T.toDefaultUnit(e))}s=new K(b,m,Object.assign(Object.assign({},i),{duration:r,easing:h}))}else{const t=m[m.length-1];b(T&&c(t)?T.toDefaultUnit(t):t)}return y.animations[x]=s,null==s||s.finished.then((()=>{y.animations[x]=void 0,y.generators[x]=void 0,y.prevGeneratorState[x]=void 0})).catch(e),s}}const H=t=>t(),J=t=>t.animations[0],L={get:(t,n)=>{var a,i;switch(n){case"duration":return t.duration;case"currentTime":let s=(null===(a=J(t))||void 0===a?void 0:a[n])||0;return s?s/1e3:0;case"playbackRate":return null===(i=J(t))||void 0===i?void 0:i[n];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(N)).catch(e)),t.finished;case"stop":return()=>t.animations.forEach(Z);default:return()=>t.animations.forEach((t=>t[n]()))}},set:(t,e,n)=>{switch(e){case"currentTime":n=E(n);case"currentTime":case"playbackRate":for(let a=0;a<t.animations.length;a++)t.animations[a][e]=n;return!0}return!1}},N=t=>t.finished,Q=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function _(t,e){var n;return"string"==typeof t?e?(null!==(n=e[t])&&void 0!==n||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t)}function tt(t,e,n,a){var i;return c(e)?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:null!==(i=a.get(e))&&void 0!==i?i:t}function et(t,e,n,a,i,s){!function(t,e,n){for(let a=0;a<t.length;a++){const i=t[a];i.at>e&&i.at<n&&(y(t,i),a--)}}(t,i,s);for(let r=0;r<e.length;r++)t.push({value:e[r],at:h(i,s,a[r]),easing:z(n,r)})}function nt(t,e){return t.at===e.at?null===t.value?1:-1:t.at-e.at}function at(t,e={}){var n,a;const i=it(t,e),s=i.map((t=>I(...t))).filter(Boolean);return r=s,o=null!==(a=null===(n=i[0])||void 0===n?void 0:n[3].duration)&&void 0!==a?a:C.duration,new Proxy({animations:r.map(H).filter(Boolean),duration:o},L);var r,o}function it(e,n={}){var{defaultOptions:a={}}=n,i=function(t,e){var n={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(n[a]=t[a]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(a=Object.getOwnPropertySymbols(t);i<a.length;i++)e.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(t,a[i])&&(n[a[i]]=t[a[i]])}return n}(n,["defaultOptions"]);const s=[],r=new Map,o={},l=new Map;let c=0,h=0,p=0;for(let t=0;t<e.length;t++){const[n,i,s={}]=e[t];void 0!==s.at&&(h=tt(h,s.at,c,l));let m=0;const y=_(n,o),g=y.length;for(let t=0;t<g;t++){const e=st(y[t],r);for(const n in i){const r=rt(n,e),o=X(i[n]),l=Q(s,n);let{duration:c=a.duration||C.duration,easing:y=a.easing||C.easing}=l;const v=u(s.delay,t,g)||0,b=h+v,O=b+c;let{offset:S=d(o.length)}=l;1===S.length&&0===S[0]&&(S[1]=1);const w=length-o.length;w>0&&f(S,w),1===o.length&&o.unshift(null),et(r,o,y,S,b,O),m=Math.max(v+c,m),p=Math.max(O,p)}}c=h,h+=m}return r.forEach(((e,n)=>{for(const r in e){const o=e[r];o.sort(nt);const l=[],c=[],u=[];for(let e=0;e<o.length;e++){const{at:n,value:a,easing:i}=o[e];l.push(a),c.push(t(0,p,n)),u.push(i||C.easing)}0!==c[0]&&(c.unshift(0),l.unshift(l[0]),u.unshift("linear")),1!==c[c.length-1]&&(c.push(1),l.push(null)),s.push([n,r,l,Object.assign(Object.assign(Object.assign({},a),{duration:p,easing:u,offset:c}),i)])}})),s}function st(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function rt(t,e){return e[t]||(e[t]=[]),e[t]}export{it as createAnimationsFromTimeline,at as timeline};
const t=(t,e,n)=>e-t==0?1:(n-t)/(e-t),e=()=>{},n=t=>t,a=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function i(t,e,i,s){if(t===e&&i===s)return n;const r=e=>function(t,e,n,i,s){let r,o,l=0;do{o=e+(n-e)/2,r=a(o,i,s)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++l<12);return o}(e,0,1,t,i);return t=>0===t||1===t?t:a(r(t),e,s)}const s=(t,e="end")=>n=>{const a=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,i="end"===e?Math.floor(a):Math.ceil(a);return s=0,r=1,o=i/t,Math.min(Math.max(o,s),r);var s,r,o},r={ease:i(.25,.1,.25,1),"ease-in":i(.42,0,1,1),"ease-in-out":i(.42,0,.58,1),"ease-out":i(0,0,.58,1)},o=/\((.*?)\)/;function l(t){if("function"==typeof t)return t;if(Array.isArray(t))return i(...t);if(r[t])return r[t];if(t.startsWith("steps")){const e=o.exec(t);if(e){const t=e[1].split(",");return s(parseFloat(t[0]),t[1].trim())}}return n}const c=t=>"number"==typeof t;function u(t,e,n){return"function"==typeof t?t(e,n):t}const h=(t,e,n)=>-n*t+n*e+t;function f(e,n){const a=e[e.length-1];for(let i=1;i<=n;i++){const s=t(0,n,i);e.push(h(a,1,s))}}function p(t){const e=[0];return f(e,t-1),e}const d=new WeakMap;function m(t){return d.has(t)||d.set(t,{transforms:[],animations:{},generators:{},prevGeneratorState:{}}),d.get(t)}function y(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const g=["","X","Y","Z"],v={x:"translateX",y:"translateY",z:"translateZ"},b={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},w={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:b,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:n},skew:b},O=new Map,S=t=>`--motion-${t}`,x=["x","y","z"];["translate","scale","rotate","skew"].forEach((t=>{g.forEach((e=>{x.push(t+e),O.set(S(t+e),w[t])}))}));const T=(t,e)=>x.indexOf(t)-x.indexOf(e),M=new Set(x),j=t=>M.has(t),k=t=>t.sort(T).reduce(A,"").trim(),A=(t,e)=>`${t} ${e}(var(${S(e)}))`,P=t=>t.startsWith("--"),D=new Set;const E=t=>1e3*t,V=t=>Array.isArray(t)&&!c(t[0]),$=t=>"object"==typeof t&&Boolean(t.createAnimation),R=t=>(t=>Array.isArray(t)&&c(t[0]))(t)?U(t):t,U=([t,e,n,a])=>`cubic-bezier(${t}, ${e}, ${n}, ${a})`,W=t=>document.createElement("div").animate(t,{duration:.001}),F={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{W({opacity:[1]})}catch(t){return!1}return!0},finished:()=>Boolean(W({opacity:[0,1]}).finished)},q={},B={};for(const t in F)B[t]=()=>(void 0===q[t]&&(q[t]=F[t]()),q[t]);const C={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"};function z(t,e){return V(t)?t[((t,e,n)=>{const a=e-t;return((n-t)%a+a)%a+t})(0,t.length,e)]:t}function G(e,a=p(e.length),i=n){const s=e.length,r=s-a.length;return r>0&&f(a,r),n=>{let r=0;for(;r<s-2&&!(n<a[r+1]);r++);let o=(l=t(a[r],a[r+1],n),Math.min(1,Math.max(l,0)));var l;return o=z(i,r)(o),h(e[r],e[r+1],o)}}class K{constructor(t,e=[0,1],{easing:n=C.easing,duration:a=C.duration,delay:i=C.delay,endDelay:s=C.endDelay,repeat:r=C.repeat,offset:o,direction:c="normal"}={}){this.startTime=0,this.rate=1,this.t=0,this.cancelTimestamp=0,this.playState="idle",this.finished=new Promise(((t,e)=>{this.resolve=t,this.reject=e}));const u=a*(r+1);$(n)&&(n="ease");const h=G(e,o,V(n)?n.map(l):l(n));this.tick=e=>{this.pauseTime&&(e=this.pauseTime);let n=(e-this.startTime)*this.rate;this.t=n,n/=1e3,n=Math.max(n-i,0),"finished"===this.playState&&(n=u);const r=n/a;let o=Math.floor(r),l=r%1;!l&&r>=1&&(l=1),1===l&&o--;const f=o%2;("reverse"===c||"alternate"===c&&f||"alternate-reverse"===c&&!f)&&(l=1-l);const p=h(n>=u?1:Math.min(l,1));t(p);"finished"===this.playState||n>=u+s?(this.playState="finished",this.resolve(p)):"idle"!==this.playState&&requestAnimationFrame(this.tick)},this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime?this.startTime=t-(this.pauseTime-this.startTime):this.startTime||(this.startTime=t),this.pauseTime=void 0,requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=performance.now()}finish(){this.playState="finished",this.tick(0)}cancel(){this.playState="idle",this.tick(this.cancelTimestamp),this.reject(!1)}reverse(){this.rate*=-1}commitStyles(){this.cancelTimestamp=performance.now()}get currentTime(){return this.t}set currentTime(t){this.pauseTime||0===this.rate?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}const X=t=>Array.isArray(t)?t:[t],Y=(t,e)=>{let n=P(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!n&&0!==n){const t=O.get(e);t&&(n=t.initialValue)}return n};function Z(t){if(t)try{"finished"!==t.playState&&t.commitStyles(),t.cancel()}catch(t){}}function I(t,n,a,i={}){let s,{duration:r=C.duration,delay:o=C.delay,endDelay:l=C.endDelay,repeat:u=C.repeat,easing:h=C.easing,direction:f,offset:p,allowWebkitAcceleration:d=!1}=i;const y=m(t);let g=B.waapi(),b=e;const w=j(n);w&&((t,e)=>{v[e]&&(e=v[e]);const{transforms:n}=m(t);var a,i;i=e,-1===(a=n).indexOf(i)&&a.push(i),t.style.transform=k(n)})(t,n);const x=function(t){return v[t]&&(t=v[t]),j(t)?S(t):t}(n),T=O.get(x);return Z(y.animations[x]),()=>{const n=()=>{var e,n;return null!==(n=null!==(e=Y(t,x))&&void 0!==e?e:null==T?void 0:T.initialValue)&&void 0!==n?n:0};let m=function(t,e){for(let n=0;n<t.length;n++)null===t[n]&&(t[n]=n?t[n-1]:e());return t}(X(a),n);if($(h)){const t=h.createAnimation(m,n,w,x,y);h=t.easing,void 0!==t.keyframes&&(m=t.keyframes),void 0!==t.duration&&(r=t.duration)}if(P(x)?(b=((t,e)=>n=>t.style.setProperty(e,n))(t,x),B.cssRegisterProperty()?function(t){if(!D.has(t)){D.add(t);try{const{syntax:e,initialValue:n}=O.has(t)?O.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:n})}catch(t){}}}(x):g=!1):b=((t,e)=>n=>t.style[e]=n)(t,x),g){T&&(m=m.map((t=>c(t)?T.toDefaultUnit(t):t))),B.partialKeyframes()||1!==m.length||m.unshift(n());const a={delay:E(o),duration:E(r),endDelay:E(l),easing:V(h)?void 0:R(h),direction:f,iterations:u+1,fill:"both"};s=t.animate({[x]:m,offset:p,easing:V(h)?h.map(R):void 0},a),s.finished||(s.finished=new Promise(((t,e)=>{s.onfinish=t,s.oncancel=e})));const i=m[m.length-1];s.finished.then((()=>{b(i),s.cancel()})).catch(e),d||(s.playbackRate=1.000001)}else if(w&&m.every(c)){if(1===m.length&&m.unshift(parseFloat(n())),T){const t=b;b=e=>t(T.toDefaultUnit(e))}s=new K(b,m,Object.assign(Object.assign({},i),{duration:r,easing:h}))}else{const t=m[m.length-1];b(T&&c(t)?T.toDefaultUnit(t):t)}return y.animations[x]=s,null==s||s.finished.then((()=>{y.animations[x]=void 0,y.generators[x]=void 0,y.prevGeneratorState[x]=void 0})).catch(e),s}}const H=t=>t(),J=t=>t.animations[0],L={get:(t,n)=>{var a,i;switch(n){case"duration":return t.duration;case"currentTime":let s=(null===(a=J(t))||void 0===a?void 0:a[n])||0;return s?s/1e3:0;case"playbackRate":return null===(i=J(t))||void 0===i?void 0:i[n];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(N)).catch(e)),t.finished;case"stop":return()=>t.animations.forEach(Z);default:return()=>t.animations.forEach((t=>t[n]()))}},set:(t,e,n)=>{switch(e){case"currentTime":n=E(n);case"currentTime":case"playbackRate":for(let a=0;a<t.animations.length;a++)t.animations[a][e]=n;return!0}return!1}},N=t=>t.finished,Q=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function _(t,e){var n;return"string"==typeof t?e?(null!==(n=e[t])&&void 0!==n||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t)}function tt(t,e,n,a){var i;return c(e)?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:null!==(i=a.get(e))&&void 0!==i?i:t}function et(t,e,n,a,i,s){!function(t,e,n){for(let a=0;a<t.length;a++){const i=t[a];i.at>e&&i.at<n&&(y(t,i),a--)}}(t,i,s);for(let r=0;r<e.length;r++)t.push({value:e[r],at:h(i,s,a[r]),easing:z(n,r)})}function nt(t,e){return t.at===e.at?null===t.value?1:-1:t.at-e.at}function at(t,e={}){var n,a;const i=it(t,e),s=i.map((t=>I(...t))).filter(Boolean);return r=s,o=null!==(a=null===(n=i[0])||void 0===n?void 0:n[3].duration)&&void 0!==a?a:C.duration,new Proxy({animations:r.map(H).filter(Boolean),duration:o},L);var r,o}function it(e,n={}){var{defaultOptions:a={}}=n,i=function(t,e){var n={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(n[a]=t[a]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(a=Object.getOwnPropertySymbols(t);i<a.length;i++)e.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(t,a[i])&&(n[a[i]]=t[a[i]])}return n}(n,["defaultOptions"]);const s=[],r=new Map,o={},l=new Map;let c=0,h=0,d=0;for(let t=0;t<e.length;t++){const[n,i,s={}]=e[t];void 0!==s.at&&(h=tt(h,s.at,c,l));let m=0;const y=_(n,o),g=y.length;for(let t=0;t<g;t++){const e=st(y[t],r);for(const n in i){const r=rt(n,e),o=X(i[n]),l=Q(s,n);let{duration:c=a.duration||C.duration,easing:y=a.easing||C.easing}=l;const v=u(s.delay,t,g)||0,b=h+v,w=b+c;let{offset:O=p(o.length)}=l;1===O.length&&0===O[0]&&(O[1]=1);const S=length-o.length;S>0&&f(O,S),1===o.length&&o.unshift(null),et(r,o,y,O,b,w),m=Math.max(v+c,m),d=Math.max(w,d)}}c=h,h+=m}return r.forEach(((e,n)=>{for(const r in e){const o=e[r];o.sort(nt);const l=[],c=[],u=[];for(let e=0;e<o.length;e++){const{at:n,value:a,easing:i}=o[e];l.push(a),c.push(t(0,d,n)),u.push(i||C.easing)}0!==c[0]&&(c.unshift(0),l.unshift(l[0]),u.unshift("linear")),1!==c[c.length-1]&&(c.push(1),l.push(null)),s.push([n,r,l,Object.assign(Object.assign(Object.assign({},a),{duration:d,easing:u,offset:c}),i)])}})),s}function st(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function rt(t,e){return e[t]||(e[t]=[]),e[t]}export{it as createAnimationsFromTimeline,at as timeline};

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

var t={d:(e,n)=>{for(var a in n)t.o(n,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{j:()=>H});const n=new WeakMap;function a(t){return n.has(t)||n.set(t,{transforms:[],animations:{},generators:{},prevGeneratorState:{}}),n.get(t)}const i=()=>{},r=t=>t,s=["","X","Y","Z"],o={x:"translateX",y:"translateY",z:"translateZ"},l={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},c={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:l,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:r},skew:l},u=new Map,h=t=>`--motion-${t}`,f=["x","y","z"];["translate","scale","rotate","skew"].forEach((t=>{s.forEach((e=>{f.push(t+e),u.set(h(t+e),c[t])}))}));const d=(t,e)=>f.indexOf(t)-f.indexOf(e),m=new Set(f),p=t=>m.has(t),y=(t,e)=>`${t} ${e}(var(${h(e)}))`,g=t=>t.startsWith("--"),v=new Set,S=t=>1e3*t,b=t=>"number"==typeof t,T=t=>Array.isArray(t)&&!b(t[0]),w=t=>"object"==typeof t&&Boolean(t.createAnimation),x=t=>(t=>Array.isArray(t)&&b(t[0]))(t)?k(t):t,k=([t,e,n,a])=>`cubic-bezier(${t}, ${e}, ${n}, ${a})`,A=t=>document.createElement("div").animate(t,{duration:.001}),O={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{A({opacity:[1]})}catch(t){return!1}return!0},finished:()=>Boolean(A({opacity:[0,1]}).finished)},j={},M={};for(const t in O)M[t]=()=>(void 0===j[t]&&(j[t]=O[t]()),j[t]);const P={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},D=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function V(t,e,n,a){if(t===e&&n===a)return r;return i=>0===i||1===i?i:D(function(t,e,n,a,i){let r,s,o=0;do{s=e+(n-e)/2,r=D(s,a,i)-t,r>0?n=s:e=s}while(Math.abs(r)>1e-7&&++o<12);return s}(i,0,1,t,n),e,a)}const $={ease:V(.25,.1,.25,1),"ease-in":V(.42,0,1,1),"ease-in-out":V(.42,0,.58,1),"ease-out":V(0,0,.58,1)},E=/\((.*?)\)/;function R(t){if("function"==typeof t)return t;if(Array.isArray(t))return V(...t);if($[t])return $[t];if(t.startsWith("steps")){const e=E.exec(t);if(e){const t=e[1].split(",");return((t,e="end")=>n=>{const a=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t;return i=("end"===e?Math.floor(a):Math.ceil(a))/t,Math.min(Math.max(i,0),1);var i})(parseFloat(t[0]),t[1].trim())}}return r}const U=(t,e,n)=>-n*t+n*e+t,C=(t,e,n)=>e-t==0?1:(n-t)/(e-t);function F(t,e){const n=t[t.length-1];for(let a=1;a<=e;a++){const i=C(0,e,a);t.push(U(n,1,i))}}class W{constructor(t,e=[0,1],{easing:n=P.easing,duration:a=P.duration,delay:i=P.delay,endDelay:s=P.endDelay,repeat:o=P.repeat,offset:l,direction:c="normal"}={}){this.startTime=0,this.rate=1,this.t=0,this.cancelT=0,this.playState="idle",this.finished=new Promise(((t,e)=>{this.resolve=t,this.reject=e}));const u=a*(o+1);w(n)&&(n="ease");const h=function(t,e=function(t){const e=[0];return F(e,t-1),e}(t.length),n=r){const a=t.length,i=a-e.length;return i>0&&F(e,i),i=>{let r=0;for(;r<a-2&&!(i<e[r+1]);r++);let s=(o=C(e[r],e[r+1],i),Math.min(1,Math.max(o,0)));var o;const l=function(t,e){return T(t)?t[((t,e,n)=>{const a=e-0;return((n-0)%a+a)%a+0})(0,t.length,e)]:t}(n,r);return s=l(s),U(t[r],t[r+1],s)}}(e,l,T(n)?n.map(R):R(n));this.tick=e=>{this.pauseTime&&(e=this.pauseTime);let n=(e-this.startTime)*this.rate;this.t=n,n/=1e3,n=Math.max(n-i,0),"finished"===this.playState&&(n=u);const r=n/a;let o=Math.floor(r),l=r%1;!l&&r>=1&&(l=1),1===l&&o--;const f=o%2;("reverse"===c||"alternate"===c&&f||"alternate-reverse"===c&&!f)&&(l=1-l);const d=h(n>=u?1:Math.min(l,1));t(d),"finished"===this.playState||n>=u+s?(this.playState="finished",this.resolve(d)):"idle"!==this.playState&&requestAnimationFrame(this.tick)},this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime?this.startTime=t-(this.pauseTime-this.startTime):this.startTime||(this.startTime=t),this.pauseTime=void 0,requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=performance.now()}finish(){this.playState="finished",this.tick(0)}cancel(){this.playState="idle",this.tick(this.cancelT),this.reject(!1)}reverse(){this.rate*=-1}commitStyles(){this.cancelT=this.t}get currentTime(){return this.t}set currentTime(t){this.pauseTime||0===this.rate?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}function q(t){if(t)try{"finished"!==t.playState&&t.commitStyles(),t.cancel()}catch(t){}}function z(t,e,n,r={}){let s,{duration:l=P.duration,delay:c=P.delay,endDelay:f=P.endDelay,repeat:m=P.repeat,easing:k=P.easing,direction:A,offset:O,allowWebkitAcceleration:j=!1}=r;const D=a(t);let V=M.waapi(),$=i;const E=p(e);E&&((t,e)=>{o[e]&&(e=o[e]);const{transforms:n}=a(t);var i,r;r=e,-1===(i=n).indexOf(r)&&i.push(r),t.style.transform=(t=>t.sort(d).reduce(y,"").trim())(n)})(t,e);const R=function(t){return o[t]&&(t=o[t]),p(t)?h(t):t}(e),U=u.get(R);return q(D.animations[R]),()=>{const e=()=>{var e,n;return null!==(n=null!==(e=((t,e)=>{let n=g(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!n&&0!==n){const t=u.get(e);t&&(n=t.initialValue)}return n})(t,R))&&void 0!==e?e:null==U?void 0:U.initialValue)&&void 0!==n?n:0};let a=function(t,e){for(let n=0;n<t.length;n++)null===t[n]&&(t[n]=n?t[n-1]:e());return t}((t=>Array.isArray(t)?t:[t])(n),e);if(w(k)){const t=k.createAnimation(a,e,E,R,D);k=t.easing,void 0!==t.keyframes&&(a=t.keyframes),void 0!==t.duration&&(l=t.duration)}if(g(R)?($=((t,e)=>n=>t.style.setProperty(e,n))(t,R),M.cssRegisterProperty()?function(t){if(!v.has(t)){v.add(t);try{const{syntax:e,initialValue:n}=u.has(t)?u.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:n})}catch(t){}}}(R):V=!1):$=((t,e)=>n=>t.style[e]=n)(t,R),V){U&&(a=a.map((t=>b(t)?U.toDefaultUnit(t):t))),M.partialKeyframes()||1!==a.length||a.unshift(e());const n={delay:S(c),duration:S(l),endDelay:S(f),easing:T(k)?void 0:x(k),direction:A,iterations:m+1,fill:"both"};s=t.animate({[R]:a,offset:O,easing:T(k)?k.map(x):void 0},n),s.finished||(s.finished=new Promise(((t,e)=>{s.onfinish=t,s.oncancel=e})));const r=a[a.length-1];s.finished.then((()=>{$(r),s.cancel()})).catch(i),j||(s.playbackRate=1.000001)}else if(E&&a.every(b)){if(1===a.length&&a.unshift(parseFloat(e())),U){const t=$;$=e=>t(U.toDefaultUnit(e))}s=new W($,a,Object.assign(Object.assign({},r),{duration:l,easing:k}))}else{const t=a[a.length-1];$(U&&b(t)?U.toDefaultUnit(t):t)}return D.animations[R]=s,null==s||s.finished.then((()=>{D.animations[R]=void 0,D.generators[R]=void 0,D.prevGeneratorState[R]=void 0})).catch(i),s}}const B=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t),G=t=>t(),K=t=>t.animations[0],X={get:(t,e)=>{var n,a;switch(e){case"duration":return t.duration;case"currentTime":let r=(null===(n=K(t))||void 0===n?void 0:n[e])||0;return r?r/1e3:0;case"playbackRate":return null===(a=K(t))||void 0===a?void 0:a[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(Y)).catch(i)),t.finished;case"stop":return()=>t.animations.forEach(q);default:return()=>t.animations.forEach((t=>t[e]()))}},set:(t,e,n)=>{switch(e){case"currentTime":n=S(n);case"currentTime":case"playbackRate":for(let a=0;a<t.animations.length;a++)t.animations[a][e]=n;return!0}return!1}},Y=t=>t.finished;function Z(t,e,n){return"function"==typeof t?t(e,n):t}function H(t,e,n={}){var a;const i=(t=function(t,e){return"string"==typeof t?t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t)}(t)).length,r=[];for(let a=0;a<i;a++){const s=t[a];for(const t in e){const o=B(n,t);o.delay=Z(o.delay,a,i);const l=z(s,t,e[t],o);r.push(l)}}return s=r,o=null!==(a=n.duration)&&void 0!==a?a:P.duration,new Proxy({animations:s.map(G).filter(Boolean),duration:o},X);var s,o}var I=e.j;export{I as animate};
var t={d:(e,n)=>{for(var a in n)t.o(n,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{j:()=>H});const n=new WeakMap;function a(t){return n.has(t)||n.set(t,{transforms:[],animations:{},generators:{},prevGeneratorState:{}}),n.get(t)}const i=()=>{},r=t=>t,s=["","X","Y","Z"],o={x:"translateX",y:"translateY",z:"translateZ"},l={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},c={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:l,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:r},skew:l},u=new Map,h=t=>`--motion-${t}`,f=["x","y","z"];["translate","scale","rotate","skew"].forEach((t=>{s.forEach((e=>{f.push(t+e),u.set(h(t+e),c[t])}))}));const m=(t,e)=>f.indexOf(t)-f.indexOf(e),d=new Set(f),p=t=>d.has(t),y=(t,e)=>`${t} ${e}(var(${h(e)}))`,g=t=>t.startsWith("--"),v=new Set,S=t=>1e3*t,b=t=>"number"==typeof t,w=t=>Array.isArray(t)&&!b(t[0]),T=t=>"object"==typeof t&&Boolean(t.createAnimation),x=t=>(t=>Array.isArray(t)&&b(t[0]))(t)?k(t):t,k=([t,e,n,a])=>`cubic-bezier(${t}, ${e}, ${n}, ${a})`,A=t=>document.createElement("div").animate(t,{duration:.001}),O={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{A({opacity:[1]})}catch(t){return!1}return!0},finished:()=>Boolean(A({opacity:[0,1]}).finished)},j={},M={};for(const t in O)M[t]=()=>(void 0===j[t]&&(j[t]=O[t]()),j[t]);const P={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},D=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function V(t,e,n,a){if(t===e&&n===a)return r;return i=>0===i||1===i?i:D(function(t,e,n,a,i){let r,s,o=0;do{s=e+(n-e)/2,r=D(s,a,i)-t,r>0?n=s:e=s}while(Math.abs(r)>1e-7&&++o<12);return s}(i,0,1,t,n),e,a)}const $={ease:V(.25,.1,.25,1),"ease-in":V(.42,0,1,1),"ease-in-out":V(.42,0,.58,1),"ease-out":V(0,0,.58,1)},E=/\((.*?)\)/;function R(t){if("function"==typeof t)return t;if(Array.isArray(t))return V(...t);if($[t])return $[t];if(t.startsWith("steps")){const e=E.exec(t);if(e){const t=e[1].split(",");return((t,e="end")=>n=>{const a=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t;return i=("end"===e?Math.floor(a):Math.ceil(a))/t,Math.min(Math.max(i,0),1);var i})(parseFloat(t[0]),t[1].trim())}}return r}const U=(t,e,n)=>-n*t+n*e+t,C=(t,e,n)=>e-t==0?1:(n-t)/(e-t);function F(t,e){const n=t[t.length-1];for(let a=1;a<=e;a++){const i=C(0,e,a);t.push(U(n,1,i))}}class W{constructor(t,e=[0,1],{easing:n=P.easing,duration:a=P.duration,delay:i=P.delay,endDelay:s=P.endDelay,repeat:o=P.repeat,offset:l,direction:c="normal"}={}){this.startTime=0,this.rate=1,this.t=0,this.cancelTimestamp=0,this.playState="idle",this.finished=new Promise(((t,e)=>{this.resolve=t,this.reject=e}));const u=a*(o+1);T(n)&&(n="ease");const h=function(t,e=function(t){const e=[0];return F(e,t-1),e}(t.length),n=r){const a=t.length,i=a-e.length;return i>0&&F(e,i),i=>{let r=0;for(;r<a-2&&!(i<e[r+1]);r++);let s=(o=C(e[r],e[r+1],i),Math.min(1,Math.max(o,0)));var o;const l=function(t,e){return w(t)?t[((t,e,n)=>{const a=e-0;return((n-0)%a+a)%a+0})(0,t.length,e)]:t}(n,r);return s=l(s),U(t[r],t[r+1],s)}}(e,l,w(n)?n.map(R):R(n));this.tick=e=>{this.pauseTime&&(e=this.pauseTime);let n=(e-this.startTime)*this.rate;this.t=n,n/=1e3,n=Math.max(n-i,0),"finished"===this.playState&&(n=u);const r=n/a;let o=Math.floor(r),l=r%1;!l&&r>=1&&(l=1),1===l&&o--;const f=o%2;("reverse"===c||"alternate"===c&&f||"alternate-reverse"===c&&!f)&&(l=1-l);const m=h(n>=u?1:Math.min(l,1));t(m),"finished"===this.playState||n>=u+s?(this.playState="finished",this.resolve(m)):"idle"!==this.playState&&requestAnimationFrame(this.tick)},this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime?this.startTime=t-(this.pauseTime-this.startTime):this.startTime||(this.startTime=t),this.pauseTime=void 0,requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=performance.now()}finish(){this.playState="finished",this.tick(0)}cancel(){this.playState="idle",this.tick(this.cancelTimestamp),this.reject(!1)}reverse(){this.rate*=-1}commitStyles(){this.cancelTimestamp=performance.now()}get currentTime(){return this.t}set currentTime(t){this.pauseTime||0===this.rate?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}function q(t){if(t)try{"finished"!==t.playState&&t.commitStyles(),t.cancel()}catch(t){}}function z(t,e,n,r={}){let s,{duration:l=P.duration,delay:c=P.delay,endDelay:f=P.endDelay,repeat:d=P.repeat,easing:k=P.easing,direction:A,offset:O,allowWebkitAcceleration:j=!1}=r;const D=a(t);let V=M.waapi(),$=i;const E=p(e);E&&((t,e)=>{o[e]&&(e=o[e]);const{transforms:n}=a(t);var i,r;r=e,-1===(i=n).indexOf(r)&&i.push(r),t.style.transform=(t=>t.sort(m).reduce(y,"").trim())(n)})(t,e);const R=function(t){return o[t]&&(t=o[t]),p(t)?h(t):t}(e),U=u.get(R);return q(D.animations[R]),()=>{const e=()=>{var e,n;return null!==(n=null!==(e=((t,e)=>{let n=g(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!n&&0!==n){const t=u.get(e);t&&(n=t.initialValue)}return n})(t,R))&&void 0!==e?e:null==U?void 0:U.initialValue)&&void 0!==n?n:0};let a=function(t,e){for(let n=0;n<t.length;n++)null===t[n]&&(t[n]=n?t[n-1]:e());return t}((t=>Array.isArray(t)?t:[t])(n),e);if(T(k)){const t=k.createAnimation(a,e,E,R,D);k=t.easing,void 0!==t.keyframes&&(a=t.keyframes),void 0!==t.duration&&(l=t.duration)}if(g(R)?($=((t,e)=>n=>t.style.setProperty(e,n))(t,R),M.cssRegisterProperty()?function(t){if(!v.has(t)){v.add(t);try{const{syntax:e,initialValue:n}=u.has(t)?u.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:n})}catch(t){}}}(R):V=!1):$=((t,e)=>n=>t.style[e]=n)(t,R),V){U&&(a=a.map((t=>b(t)?U.toDefaultUnit(t):t))),M.partialKeyframes()||1!==a.length||a.unshift(e());const n={delay:S(c),duration:S(l),endDelay:S(f),easing:w(k)?void 0:x(k),direction:A,iterations:d+1,fill:"both"};s=t.animate({[R]:a,offset:O,easing:w(k)?k.map(x):void 0},n),s.finished||(s.finished=new Promise(((t,e)=>{s.onfinish=t,s.oncancel=e})));const r=a[a.length-1];s.finished.then((()=>{$(r),s.cancel()})).catch(i),j||(s.playbackRate=1.000001)}else if(E&&a.every(b)){if(1===a.length&&a.unshift(parseFloat(e())),U){const t=$;$=e=>t(U.toDefaultUnit(e))}s=new W($,a,Object.assign(Object.assign({},r),{duration:l,easing:k}))}else{const t=a[a.length-1];$(U&&b(t)?U.toDefaultUnit(t):t)}return D.animations[R]=s,null==s||s.finished.then((()=>{D.animations[R]=void 0,D.generators[R]=void 0,D.prevGeneratorState[R]=void 0})).catch(i),s}}const B=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t),G=t=>t(),K=t=>t.animations[0],X={get:(t,e)=>{var n,a;switch(e){case"duration":return t.duration;case"currentTime":let r=(null===(n=K(t))||void 0===n?void 0:n[e])||0;return r?r/1e3:0;case"playbackRate":return null===(a=K(t))||void 0===a?void 0:a[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(Y)).catch(i)),t.finished;case"stop":return()=>t.animations.forEach(q);default:return()=>t.animations.forEach((t=>t[e]()))}},set:(t,e,n)=>{switch(e){case"currentTime":n=S(n);case"currentTime":case"playbackRate":for(let a=0;a<t.animations.length;a++)t.animations[a][e]=n;return!0}return!1}},Y=t=>t.finished;function Z(t,e,n){return"function"==typeof t?t(e,n):t}function H(t,e,n={}){var a;const i=(t=function(t,e){return"string"==typeof t?t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t)}(t)).length,r=[];for(let a=0;a<i;a++){const s=t[a];for(const t in e){const o=B(n,t);o.delay=Z(o.delay,a,i);const l=z(s,t,e[t],o);r.push(l)}}return s=r,o=null!==(a=n.duration)&&void 0!==a?a:P.duration,new Proxy({animations:s.map(G).filter(Boolean),duration:o},X);var s,o}var I=e.j;export{I as animate};

@@ -15,3 +15,3 @@ 'use strict';

this.t = 0;
this.cancelT = 0;
this.cancelTimestamp = 0;
this.playState = "idle";

@@ -117,3 +117,3 @@ this.finished = new Promise((resolve, reject) => {

this.playState = "idle";
this.tick(this.cancelT);
this.tick(this.cancelTimestamp);
this.reject(false);

@@ -125,3 +125,3 @@ }

commitStyles() {
this.cancelT = this.t;
this.cancelTimestamp = performance.now();
}

@@ -128,0 +128,0 @@ get currentTime() {

@@ -11,3 +11,3 @@ import { defaults } from '../dom/utils/defaults.es.js';

this.t = 0;
this.cancelT = 0;
this.cancelTimestamp = 0;
this.playState = "idle";

@@ -113,3 +113,3 @@ this.finished = new Promise((resolve, reject) => {

this.playState = "idle";
this.tick(this.cancelT);
this.tick(this.cancelTimestamp);
this.reject(false);

@@ -121,3 +121,3 @@ }

commitStyles() {
this.cancelT = this.t;
this.cancelTimestamp = performance.now();
}

@@ -124,0 +124,0 @@ get currentTime() {

{
"name": "motion",
"version": "10.3.1",
"version": "10.3.2",
"description": "The Motion library for the web",

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

@@ -10,3 +10,3 @@ import { AnimationControls, AnimationOptions } from "../dom/types";

private t;
private cancelT;
private cancelTimestamp;
playState: AnimationPlayState;

@@ -13,0 +13,0 @@ constructor(output: (v: number) => void, keyframes?: number[], { easing, duration, delay, endDelay, repeat, offset, direction, }?: AnimationOptions);

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