UNPKG

framer-motion

Version:

A simple and powerful JavaScript animation library

3 lines 54.7 kB
function t(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const e=(t,e,n)=>n>e?e:n<t?t:n;function n(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let s=()=>{},i=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(s=(t,e,s)=>{t||"undefined"==typeof console||console.warn(n(e,s))},i=(t,e,s)=>{if(!t)throw new Error(n(e,s))});const r={},a=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),o=t=>"object"==typeof t&&null!==t,l=t=>/^0[^.\s]+$/u.test(t);function u(t){let e;return()=>(void 0===e&&(e=t()),e)}const c=t=>t,h=(...t)=>t.reduce((t,e)=>n=>e(t(n))),d=(t,e,n)=>{const s=e-t;return s?(n-t)/s:1};class p{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>this.remove(t)}remove(e){t(this.subscriptions,e)}notify(t,e,n){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,n);else for(let i=0;i<s;i++){const s=this.subscriptions[i];s&&s(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const f=t=>1e3*t,m=t=>t/1e3,g=(t,e)=>e?t*(1e3/e):0,y=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function v(t,e,n,s){if(t===e&&n===s)return c;const i=e=>function(t,e,n,s,i){let r,a,o=0;do{a=e+(n-e)/2,r=y(a,s,i)-t,r>0?n=a:e=a}while(Math.abs(r)>1e-7&&++o<12);return a}(e,0,1,t,n);return t=>0===t||1===t?t:y(i(t),e,s)}const b=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,T=t=>e=>1-t(1-e),w=v(.33,1.53,.69,.99),A=T(w),k=b(A),S=t=>t>=1?1:(t*=2)<1?.5*A(t):.5*(2-Math.pow(2,-10*(t-1))),M=t=>1-Math.sin(Math.acos(t)),x=T(M),C=b(M),E=v(.42,0,1,1),P=v(0,0,.58,1),D=v(.42,0,.58,1),O=t=>Array.isArray(t)&&"number"!=typeof t[0];function F(t,e){return O(t)?t[((t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t})(0,t.length,e)]:t}const R=t=>Array.isArray(t)&&"number"==typeof t[0],V={linear:c,easeIn:E,easeInOut:D,easeOut:P,circIn:M,circInOut:C,circOut:x,backIn:A,backInOut:k,backOut:w,anticipate:S},I=t=>{if(R(t)){i(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,s,r]=t;return v(e,n,s,r)}return"string"==typeof t?(i(void 0!==V[t],`Invalid easing type '${t}'`,"invalid-easing-type"),V[t]):t},K=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function $(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=K.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,s=!1,i=!1;const r=new Set;let a={delta:0,timestamp:0,isProcessing:!1};function o(e){r.has(e)&&(n.add(e),t()),e(a)}const l={schedule:(t,i=!1,a=!1)=>{const o=a&&s?e:n;return i&&r.add(t),o.add(t),t},cancel:t=>{n.delete(t),r.delete(t)},process:t=>{if(a=t,s)return void(i=!0);s=!0;const r=e;e=n,n=r,e.forEach(o),e.clear(),s=!1,i&&(i=!1,l.process(t))}};return l}(a),t),{}),{setup:l,read:u,resolveKeyframes:c,preUpdate:h,update:d,preRender:p,render:f,postRender:m}=o,g=()=>{const a=r.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=s?1e3/60:Math.max(Math.min(o-i.timestamp,40),1)),i.timestamp=o,i.isProcessing=!0,l.process(i),u.process(i),c.process(i),h.process(i),d.process(i),p.process(i),f.process(i),m.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(g))};return{schedule:K.reduce((e,r)=>{const a=o[r];return e[r]=(e,r=!1,o=!1)=>(n||(n=!0,s=!0,i.isProcessing||t(g)),a.schedule(e,r,o)),e},{}),cancel:t=>{for(let e=0;e<K.length;e++)o[K[e]].cancel(t)},state:i,steps:o}}const{schedule:N,cancel:B,state:W}=$("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:c,!0);let Y;function _(){Y=void 0}const X={now:()=>(void 0===Y&&X.set(W.isProcessing||r.useManualTiming?W.timestamp:performance.now()),Y),set:t=>{Y=t,queueMicrotask(_)}},j=t=>Math.round(1e5*t)/1e5,q=(t=>e=>"string"==typeof e&&e.startsWith(t))("var(--"),z=t=>!!q(t)&&U.test(t.split("/*")[0].trim()),U=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function L(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const Z={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},G={...Z,transform:t=>e(0,1,t)},H={...Z,default:1},J=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Q=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,tt=(t,e)=>n=>Boolean("string"==typeof n&&Q.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),et=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[i,r,a,o]=s.match(J);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(a),alpha:void 0!==o?parseFloat(o):1}},nt={...Z,transform:t=>Math.round((t=>e(0,255,t))(t))},st={test:tt("rgb","red"),parse:et("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+nt.transform(t)+", "+nt.transform(e)+", "+nt.transform(n)+", "+j(G.transform(s))+")"};const it={test:tt("#"),parse:function(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}},transform:st.transform},rt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),at=rt("deg"),ot=rt("%"),lt=rt("px"),ut=rt("vh"),ct=rt("vw"),ht=(()=>({...ot,parse:t=>ot.parse(t)/100,transform:t=>ot.transform(100*t)}))(),dt={test:tt("hsl","hue"),parse:et("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+ot.transform(j(e))+", "+ot.transform(j(n))+", "+j(G.transform(s))+")"},pt={test:t=>st.test(t)||it.test(t)||dt.test(t),parse:t=>st.test(t)?st.parse(t):dt.test(t)?dt.parse(t):it.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?st.transform(t):dt.transform(t),getAnimatableNone:t=>{const e=pt.parse(t);return e.alpha=0,pt.transform(e)}},ft=new RegExp(J.source),mt=new RegExp(/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu.source,"i");const gt="number",yt="color",vt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function bt(t){const e=t.toString();return ft.test(e)||mt.test(e)}function Tt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(vt,t=>(pt.test(t)?(s.color.push(r),i.push(yt),n.push(pt.parse(t))):t.startsWith("var(")?(s.var.push(r),i.push("var"),n.push(t)):(s.number.push(r),i.push(gt),n.push(parseFloat(t))),++r,"${}")).split("${}");return{values:n,split:a,indexes:s,types:i}}function wt({split:t,types:e}){const n=t.length;return s=>{let i="";for(let r=0;r<n;r++)if(i+=t[r],void 0!==s[r]){const t=e[r];i+=t===gt?j(s[r]):t===yt?pt.transform(s[r]):s[r]}return i}}const At=(t,e)=>{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:pt.test(n)?pt.getAnimatableNone(n):n;var n};const kt={test:function(t){return isNaN(t)&&"string"==typeof t&&(ft.test(t)||mt.test(t))},parse:function(t){return Tt(t).values},createTransformer:function(t){return wt(Tt(t))},getAnimatableNone:function(t){const e=Tt(t);return wt(e)(e.values.map((t,n)=>At(t,e.split[n])))}};function St(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Mt(t,e){return n=>n>0?e:t}const xt=(t,e,n)=>t+(e-t)*n,Ct=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Et=[it,st,dt];function Pt(t){const e=(n=t,Et.find(t=>t.test(n)));var n;if(!e)return s(!1,`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!1;let i=e.parse(t);return e===dt&&(i=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let i=0,r=0,a=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,o=2*n-s;i=St(o,s,t+1/3),r=St(o,s,t),a=St(o,s,t-1/3)}else i=r=a=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*a),alpha:s}}(i)),i}const Dt=(t,e)=>{const n=Pt(t),s=Pt(e);if(!n||!s)return Mt(t,e);const i={...n};return t=>(i.red=Ct(n.red,s.red,t),i.green=Ct(n.green,s.green,t),i.blue=Ct(n.blue,s.blue,t),i.alpha=xt(n.alpha,s.alpha,t),st.transform(i))},Ot=new Set(["none","hidden"]);function Ft(t,e){return n=>xt(t,e,n)}function Rt(t){return"number"==typeof t?Ft:"string"==typeof t?z(t)?Mt:pt.test(t)?Dt:Kt:Array.isArray(t)?Vt:"object"==typeof t?pt.test(t)?Dt:It:Mt}function Vt(t,e){const n=[...t],s=n.length,i=t.map((t,n)=>Rt(t)(t,e[n]));return t=>{for(let e=0;e<s;e++)n[e]=i[e](t);return n}}function It(t,e){const n={...t,...e},s={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(s[i]=Rt(t[i])(t[i],e[i]));return t=>{for(const e in s)n[e]=s[e](t);return n}}const Kt=(t,e)=>{const n=kt.createTransformer(e),i=Tt(t),r=Tt(e);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?Ot.has(t)&&!r.values.length||Ot.has(e)&&!i.values.length?function(t,e){return Ot.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):h(Vt(function(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const r=e.types[i],a=t.indexes[r][s[r]],o=t.values[a]??0;n[i]=o,s[r]++}return n}(i,r),r.values),n):(s(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Mt(t,e))},$t=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function Nt(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return xt(t,e,n);if("string"==typeof t&&"string"==typeof e){const n=function(t,e){const n=$t.exec(t);if(!n)return;const s=$t.exec(e);if(!s||n[2]!==s[2])return;const i=n[2],r=parseFloat(n[1]),a=parseFloat(s[1]);return t=>j(xt(r,a,t))+i}(t,e);if(n)return n}return Rt(t)(t,e)}const Bt=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>N.update(e,t),stop:()=>B(e),now:()=>W.isProcessing?W.timestamp:X.now()}},Wt=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let e=0;e<i;e++)s+=Math.round(1e4*t(e/(i-1)))/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},Yt=2e4;function _t(t,e=50,n=2e4,s){let i=0,r=t.next(i);for(;!r.done&&i<n;)i+=e,r=t.next(i);return i>=n?1/0:i}function Xt(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(_t(s),Yt);return{type:"keyframes",ease:t=>s.next(i*t).value/e,duration:m(i)}}const jt=100,qt=10,zt=1,Ut=0,Lt=800,Zt=.3,Gt=.3,Ht={granular:.01,default:2},Jt={granular:.005,default:.5},Qt=.01,te=10,ee=.05,ne=1;function se(t,e){return t*Math.sqrt(1-e*e)}const ie=.001;const re=["duration","bounce"],ae=["stiffness","damping","mass"];function oe(t,e){return e.some(e=>void 0!==t[e])}function le(t){let n={velocity:Ut,stiffness:jt,damping:qt,mass:zt,isResolvedFromDuration:!1,...t};if(!oe(t,ae)&&oe(t,re))if(n.velocity=0,t.visualDuration){const s=t.visualDuration,i=2*Math.PI/(1.2*s),r=i*i,a=2*e(.05,1,1-(t.bounce||0))*Math.sqrt(r);n={...n,mass:zt,stiffness:r,damping:a}}else{const i=function({duration:t=Lt,bounce:n=Zt,velocity:i=Ut,mass:r=zt}){let a,o;s(t<=f(te),"Spring duration must be 10 seconds or less","spring-duration-limit");let l=1-n;l=e(ee,ne,l),t=e(Qt,te,m(t)),l<1?(a=e=>{const n=e*l,s=n*t,r=n-i,a=se(e,l),o=Math.exp(-s);return ie-r/a*o},o=e=>{const n=e*l*t,s=n*i+i,r=l*l*e*e*t,o=Math.exp(-n),u=se(e*e,l);return(-a(e)+ie>0?-1:1)*((s-r)*o)/u}):(a=e=>Math.exp(-e*t)*((e-i)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(i-e)));const u=function(t,e,n){let s=n;for(let n=1;n<12;n++)s-=t(s)/e(s);return s}(a,o,5/t);if(t=f(t),isNaN(u))return{stiffness:jt,damping:qt,duration:t};{const e=u*u*r;return{stiffness:e,damping:2*l*Math.sqrt(r*e),duration:t}}}({...t,velocity:0});n={...n,...i,mass:zt},n.isResolvedFromDuration=!0}return n}function ue(t=Gt,e=Zt){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t,s=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],r={done:!1,value:s},{stiffness:a,damping:o,mass:l,duration:u,velocity:c,isResolvedFromDuration:h}=le({...n,velocity:-m(n.velocity||0)}),d=o/(2*Math.sqrt(a*l)),p=m(Math.sqrt(a/l)),g=d*p,y={target:i,delta:i-s,velocity:c||0,restSpeed:0,restDelta:0},v=()=>{const t=Math.abs(y.delta)<5;y.restSpeed=n.restSpeed||(t?Ht.granular:Ht.default),y.restDelta=n.restDelta||(t?Jt.granular:Jt.default)};let b,T,w;if(v(),d<1){const t=se(p,d),e={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};w=()=>{e.A=(y.velocity+g*y.delta)/t,e.sinC=g*e.A+y.delta*t,e.cosC=g*y.delta-e.A*t};const n=n=>{n!==e.t&&(e.t=n,e.env=Math.exp(-g*n),e.sin=Math.sin(t*n),e.cos=Math.cos(t*n))};b=t=>(n(t),y.target-e.env*(e.A*e.sin+y.delta*e.cos)),T=t=>(n(t),e.env*(e.sinC*e.sin+e.cosC*e.cos))}else if(1===d){b=t=>y.target-Math.exp(-p*t)*(y.delta+(y.velocity+p*y.delta)*t);const t={C:0};w=()=>{t.C=y.velocity+p*y.delta},T=e=>Math.exp(-p*e)*(p*t.C*e-y.velocity)}else{const t=p*Math.sqrt(d*d-1);b=e=>{const n=Math.exp(-g*e),s=Math.min(t*e,300);return y.target-n*((y.velocity+g*y.delta)*Math.sinh(s)+t*y.delta*Math.cosh(s))/t};const e={P:0,sinh:0,cosh:0};w=()=>{e.P=(y.velocity+g*y.delta)/t,e.sinh=g*e.P-y.delta*t,e.cosh=g*y.delta-e.P*t},T=n=>{const s=Math.exp(-g*n),i=Math.min(t*n,300);return s*(e.sinh*Math.sinh(i)+e.cosh*Math.cosh(i))}}w();const A=!oe(n,ae)&&oe(n,re),k=h&&u||null,S={calculatedDuration:k,retarget:(t,e)=>{y.target=t[t.length-1],y.delta=y.target-t[0],y.velocity=A?0:-m(e),n.restSpeed&&n.restDelta||v(),S.calculatedDuration=k,r.done=!1,w()},velocity:t=>f(T(t)),next:t=>{const e=b(t);if(h)r.done=t>=u;else{const n=f(T(t));r.done=Math.abs(n)<=y.restSpeed&&Math.abs(y.target-e)<=y.restDelta}return r.value=r.done?y.target:e,r},toString:()=>{const t=Math.min(_t(S),Yt),e=Wt(e=>S.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return S}function ce({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:a,min:o,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=t=>void 0===o?l:void 0===l||Math.abs(o-t)<Math.abs(l-t)?o:l;let f=n*e;const m=h+f,g=void 0===a?m:a(m);g!==m&&(f=g-h);const y=t=>-f*Math.exp(-t/s),v=t=>{const e=y(t);d.done=Math.abs(e)<=u,d.value=d.done?g:g+e};let b,T;const w=t=>{var e;((e=d.value)<o||e>l)&&(b=t,T=ue({keyframes:[d.value,p(d.value)],velocity:-y(t)/s*1e3,damping:i,stiffness:r,restDelta:u,restSpeed:c}))};return w(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==b||(e=!0,v(t),w(t)),void 0!==b&&t>=b?T.next(t-b):(!e&&v(t),d)}}}function he(t,n,{clamp:s=!0,ease:a,mixer:o}={}){const l=t.length;if(i(l===n.length,"Both input and output ranges must be the same length","range-length"),1===l)return()=>n[0];if(2===l&&n[0]===n[1])return()=>n[1];const u=t[0]===t[1];t[0]>t[l-1]&&(t=[...t].reverse(),n=[...n].reverse());const p=function(t,e,n){const s=[],i=n||r.mix||Nt,a=t.length-1;for(let n=0;n<a;n++){let r=i(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||c:e;r=h(t,r)}s.push(r)}return s}(n,a,o),f=p.length,m=e=>{if(u&&e<t[0])return n[0];let s=0;if(f>1)for(;s<t.length-2&&!(e<t[s+1]);s++);const i=d(t[s],t[s+1],e);return p[s](i)};return s?n=>m(e(t[0],t[l-1],n)):m}function de(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=d(0,e,s);t.push(xt(n,1,i))}}function pe(t){const e=[0];return de(e,t.length-1),e}function fe({duration:t=300,keyframes:n,times:s,ease:i="easeInOut"}){const a=O(i)?i.map(I):I(i),o={done:!1,value:n[0]};if(2===n.length&&!Array.isArray(a)&&(!s||2!==s.length||0===s[0]&&1===s[1])){const[s,i]=n,l=s===i?void 0:(r.mix||Nt)(s,i);return{calculatedDuration:t,next:n=>(o.value=l?l(a(t>0?e(0,1,n/t):1)):i,o.done=n>=t,o)}}const l=function(t,e){return t.map(t=>t*e)}(s&&s.length===n.length?s:pe(n),t),u=he(l,n,{ease:Array.isArray(a)?a:(c=n,h=a,c.map(()=>h||D).splice(0,c.length-1))});var c,h;return{calculatedDuration:t,next:e=>(o.value=u(e),o.done=e>=t,o)}}ue.applyToOptions=t=>{const e=Xt(t,100,ue);return t.ease=e.ease,t.duration=f(e.duration),t.type="keyframes",t};function me(t,e,n=0){return e<=0?n:t.velocity?t.velocity(e):function(t,e,n){const s=Math.max(e-5,0);return g(n-t(s),e-s)}(e=>t.next(e).value,e,t.next(e).value)}const ge=t=>null!==t;function ye(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(ge),a=i<0||e&&"loop"!==n&&e%2==1?0:r.length-1;return a&&void 0!==s?s:r[a]}const ve={decay:ce,inertia:ce,tween:fe,keyframes:fe,spring:ue};function be(t){"string"==typeof t.type&&(t.type=ve[t.type])}function Te(t,e){return{kind:t,animation:e,timestamp:X.now(),frameTimestamp:W.timestamp,frameIsProcessing:W.isProcessing}}function we(t,e,n){const s=globalThis.__MOTION_INSPECT__;if(s)try{s({...Te("animation-start",t),options:n?{...e,...n}:e})}catch{}}class Ae{constructor(){this.isResolved=!1}get finished(){return this._finished||(this._finished=this.isResolved?Promise.resolve():new Promise(t=>{this._resolve=t})),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(t,e){return this.finished.then(t,e)}}const ke=t=>t/100;class Se extends Ae{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==X.now()&&this.tick(X.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause(),we(this,this.options)}initAnimation(){const{options:t}=this;be(t);const{type:e=fe,repeat:n=0,repeatDelay:s=0,repeatType:i,velocity:r=0}=t;let{keyframes:a}=t;const o=e||fe;o!==fe&&"number"!=typeof a[0]&&(this.mixKeyframes=h(ke,Nt(a[0],a[1])),a=[0,100]);const l=o(a===t.keyframes?t:{...t,keyframes:a});"mirror"===i&&(this.mirroredGenerator=o({...t,keyframes:[...a].reverse(),velocity:-r})),null===l.calculatedDuration&&(l.calculatedDuration=_t(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(n+1)-s,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,n=!1){const{generator:s,totalDuration:i,mixKeyframes:r,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:l}=this;if(null===this.startTime)return s.next(0);const{delay:u=0,keyframes:c,repeat:h,repeatType:d,repeatDelay:p,type:f,onUpdate:m,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const y=this.currentTime-u*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let b,T=this.currentTime,w=s;if(h){const t=Math.min(this.currentTime,i)/o;let n=Math.floor(t),s=t%1;!s&&t>=1&&(s=1),1===s&&n--,n=Math.min(n,h+1);Boolean(n%2)&&("reverse"===d?(s=1-s,p&&(s-=p/o)):"mirror"===d&&(w=a)),T=e(0,1,s)*o}v?(this.delayState.value=c[0],b=this.delayState):b=w.next(T),r&&!v&&(b.value=r(b.value));let{done:A}=b;v||null===l||(A=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const k=null===this.holdTime&&("finished"===this.state||"running"===this.state&&A);return k&&f!==ce&&(b.value=ye(c,this.options,g,this.speed)),m&&m(b.value),k&&this.finish(),b}then(t,e){return this.finished.then(t,e)}get duration(){return m(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+m(t)}get time(){return m(this.currentTime)}set time(t){t=f(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){return me(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(X.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=m(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Bt,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(X.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const Me=new Set(["brightness","contrast","saturate","opacity"]);function xe(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(J)||[];if(!s)return t;const i=n.replace(s,"");let r=Me.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const Ce=/\b([a-z-]*)\(.*?\)/gu,Ee={...kt,getAnimatableNone:t=>{const e=t.match(Ce);return e?e.map(xe).join(" "):t}},Pe={...kt,getAnimatableNone:t=>{const e=kt.parse(t);return kt.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},De={...Z,transform:Math.round},Oe={rotate:at,pathRotation:at,rotateX:at,rotateY:at,rotateZ:at,scale:H,scaleX:H,scaleY:H,scaleZ:H,skew:at,skewX:at,skewY:at,distance:lt,translateX:lt,translateY:lt,translateZ:lt,x:lt,y:lt,z:lt,perspective:lt,transformPerspective:lt,opacity:G,originX:ht,originY:ht,originZ:lt},Fe={borderWidth:lt,borderTopWidth:lt,borderRightWidth:lt,borderBottomWidth:lt,borderLeftWidth:lt,borderRadius:lt,borderTopLeftRadius:lt,borderTopRightRadius:lt,borderBottomRightRadius:lt,borderBottomLeftRadius:lt,width:lt,maxWidth:lt,height:lt,maxHeight:lt,top:lt,right:lt,bottom:lt,left:lt,inset:lt,insetBlock:lt,insetBlockStart:lt,insetBlockEnd:lt,insetInline:lt,insetInlineStart:lt,insetInlineEnd:lt,padding:lt,paddingTop:lt,paddingRight:lt,paddingBottom:lt,paddingLeft:lt,paddingBlock:lt,paddingBlockStart:lt,paddingBlockEnd:lt,paddingInline:lt,paddingInlineStart:lt,paddingInlineEnd:lt,margin:lt,marginTop:lt,marginRight:lt,marginBottom:lt,marginLeft:lt,marginBlock:lt,marginBlockStart:lt,marginBlockEnd:lt,marginInline:lt,marginInlineStart:lt,marginInlineEnd:lt,fontSize:lt,backgroundPositionX:lt,backgroundPositionY:lt,...Oe,zIndex:De,fillOpacity:G,strokeOpacity:G,numOctaves:De},Re={...Fe,color:pt,backgroundColor:pt,outlineColor:pt,fill:pt,stroke:pt,borderColor:pt,borderTopColor:pt,borderRightColor:pt,borderBottomColor:pt,borderLeftColor:pt,filter:Ee,WebkitFilter:Ee,mask:Pe,WebkitMask:Pe},Ve=new Set([Ee,Pe]);function Ie(t,e){let n=(t=>Re[t])(t);return Ve.has(n)||(n=kt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Ke=t=>180*t/Math.PI,$e=t=>{const e=Ke(Math.atan2(t[1],t[0]));return Be(e)},Ne={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:$e,rotateZ:$e,skewX:t=>Ke(Math.atan(t[1])),skewY:t=>Ke(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Be=t=>((t%=360)<0&&(t+=360),t),We=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Ye=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),_e={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:We,scaleY:Ye,scale:t=>(We(t)+Ye(t))/2,rotateX:t=>Be(Ke(Math.atan2(t[6],t[5]))),rotateY:t=>Be(Ke(Math.atan2(-t[2],t[0]))),rotateZ:$e,rotate:$e,skewX:t=>Ke(Math.atan(t[4])),skewY:t=>Ke(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Xe(t){return t.includes("scale")?1:0}function je(t,e){if(!t||"none"===t)return Xe(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=_e,i=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Ne,i=e}if(!i)return Xe(e);const r=s[e],a=i[1].split(",").map(qe);return"function"==typeof r?r(a):a[r]}function qe(t){return parseFloat(t.trim())}const ze=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ue=(()=>new Set([...ze,"pathRotation"]))(),Le=t=>t===Z||t===lt,Ze=new Set(["x","y","z"]),Ge=ze.filter(t=>!Ze.has(t));const He=new Set(["bottom","right"]);function Je(t,e,n,s,i,r){const a=parseFloat(t);if(!isNaN(a))return a;const{min:o,max:l}=e()[n],u=l-o;return"border-box"===r?u:u-parseFloat(s)-parseFloat(i)}const Qe={width:({width:t,paddingLeft:e="0",paddingRight:n="0",boxSizing:s},i)=>Je(t,i,"x",e,n,s),height:({height:t,paddingTop:e="0",paddingBottom:n="0",boxSizing:s},i)=>Je(t,i,"y",e,n,s),top:({top:t})=>parseFloat(t),left:({left:t})=>parseFloat(t),bottom:({top:t},e)=>{const{y:n}=e();return parseFloat(t)+(n.max-n.min)},right:({left:t},e)=>{const{x:n}=e();return parseFloat(t)+(n.max-n.min)},x:({transform:t})=>je(t,"x"),y:({transform:t})=>je(t,"y")};Qe.translateX=Qe.x,Qe.translateY=Qe.y;const tn=new Set;let en=!1,nn=!1,sn=!1;function rn(){if(nn){const t=[],e=new Set,n=new Set;tn.forEach(s=>{s.needsMeasurement&&(t.push(s),e.add(s.element),He.has(s.name)&&n.add(s.element))});const s=new Map;n.forEach(t=>{const e=function(t){const e=[];return Ge.forEach(n=>{const s=t.getValue(n);if(void 0!==s){const t=s.get(),i=n.startsWith("scale")?1:0;if(t===i)return;e.push([n,t]),s.set(i)}}),e}(t);e.length&&(s.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=s.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}nn=!1,en=!1,tn.forEach(t=>t.complete(sn)),tn.clear()}function an(){tn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(nn=!0)})}class on{constructor(t,e,n,s,i,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=s,this.element=i,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(tn.add(this),en||(en=!0,N.read(an),N.resolveKeyframes(rn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;if(null===t[0]){const i=s?.get(),r=t[t.length-1];if(void 0!==i)t[0]=i;else if(n&&e){const s=function(t,e,n){if("string"==typeof t){if(a(t)||l(t))return parseFloat(t);if(!kt.test(t)&&kt.test(n))return Ie(e,n)}return t??void 0}(n.readValue(e,r),e,r);void 0!==s&&(t[0]=s)}void 0===t[0]&&(t[0]=r),s&&void 0===i&&s.set(t[0])}!function(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),tn.delete(this)}cancel(){"scheduled"===this.state&&(tn.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const ln=t=>t.startsWith("--");function un(t,e,n){ln(e)?t.style.setProperty(e,n):t.style[e]=n}const cn={};function hn(t,e){const n=u(t);return()=>cn[e]??n()}const dn=hn(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),pn=hn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),fn=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,mn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:fn([0,.65,.55,1]),circOut:fn([.55,0,1,.45]),backIn:fn([.31,.01,.66,-.59]),backOut:fn([.33,1.53,.69,.99])};function gn(t,e){return t?"function"==typeof t?pn()?Wt(t,e):"ease-out":R(t)?fn(t):Array.isArray(t)?t.map(t=>gn(t,e)||mn.easeOut):mn[t]:void 0}function yn(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:a="loop",ease:o="easeOut",times:l}={},u=void 0){const c={[e]:n};l&&(c.offset=l);const h=gn(o,i);Array.isArray(h)&&(c.easing=h);const d={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:"reverse"===a?"alternate":"normal"};return u&&(d.pseudoElement=u),t.animate(c,d)}function vn(t){return"function"==typeof t&&"applyToOptions"in t}class bn extends Ae{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:n,keyframes:s,pseudoElement:r,allowFlatten:a=!1,finalKeyframe:o,onComplete:l}=t;this.isPseudoElement=Boolean(r),this.allowFlatten=a,this.options=t,i("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const u=function({type:t,...e}){return vn(t)&&pn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=yn(e,n,s,u,r),!1===u.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const t=ye(s,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(t),un(e,n,t),this.animation.cancel()}l?.(),this.notifyFinished()},we(this,t,u)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return m(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+m(t)}get time(){return m(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=f(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:n,observe:s}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&dn()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),n&&(this.animation.rangeEnd=n),c):s(this)}}const Tn={anticipate:S,backInOut:k,circInOut:C};function wn(t){"string"==typeof t.ease&&t.ease in Tn&&(t.ease=Tn[t.ease])}class An extends bn{constructor(t){wn(t),be(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:s,onComplete:i,element:r,...a}=this.options;if(!n)return;if(void 0!==t)return void n.set(t);const o=new Se({...a,autoplay:!1}),l=Math.max(10,X.now()-this.startTime),u=e(0,10,l-10),c=o.sample(l).value,{name:h}=this.options;r&&h&&un(r,h,c),n.setWithVelocity(o.sample(Math.max(0,l-u)).value,c,u),o.stop()}}const kn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!kt.test(t)&&"0"!==t||t.startsWith("url(")));function Sn(t){t.duration=0,t.type="keyframes"}const Mn=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),xn=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const Cn=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),En=u(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Pn(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:a,keyframes:o}=t;if(!n||!Mn.has(n)&&!Cn.has(n))return!1;const l=e?.owner?.current;if(!(l instanceof HTMLElement||l instanceof SVGElement))return!1;const{onUpdate:u,transformTemplate:c}=e.owner.getProps();return En()&&(Mn.has(n)||Cn.has(n)&&function(t){for(let e=0;e<t.length;e++)if("string"==typeof t[e]&&xn.test(t[e]))return!0;return!1}(o))&&("transform"!==n||!c)&&!u&&!s&&"mirror"!==i&&0!==r&&"inertia"!==a}class Dn extends Ae{constructor(t){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=X.now();const{keyframes:e,name:n,motionValue:s,element:i}=t,r=t;r.autoplay??(r.autoplay=!0),r.delay??(r.delay=0),r.type??(r.type="keyframes"),r.repeat??(r.repeat=0),r.repeatDelay??(r.repeatDelay=0),r.repeatType??(r.repeatType="loop");const a=i?.KeyframeResolver||on;this.keyframeResolver=new a(e,(t,e,n)=>this.onKeyframesResolved(t,e,r,!n),n,s,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,i){this.keyframeResolver=void 0;const{name:a,type:o,velocity:l,delay:u,isHandoff:c,onUpdate:h}=n;this.resolvedAt=X.now();let d=!0;(function(t,e,n,i){const r=t[0];if(null===r)return!1;if("display"===e||"visibility"===e)return!0;const a=t[t.length-1],o=kn(r,e),l=kn(a,e);return o&&l?function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||vn(n))&&i:(o!==l&&s(!1,`You are trying to animate ${e} from "${r}" to "${a}". "${o?a:r}" is not an animatable value.`,"value-not-animatable"),!1)})(t,a,o,l)||(d=!1,!r.instantAnimations&&u||h?.(ye(t,n,e)),t[0]=t[t.length-1],Sn(n),n.repeat=0);const p=i?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,{onComplete:f}=n;n.startTime??(n.startTime=p),n.finalKeyframe=e,n.keyframes=t,n.onComplete=()=>{f?.(),this.notifyFinished()};let m;if(d&&!c&&Pn(n)){n.element=n.motionValue?.owner?.current;try{m=new An(n)}catch{m=new Se(n)}}else m=new Se(n);this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),sn=!0,an(),rn(),sn=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class On{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t){const e=this.animations.map(e=>e.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return Fn(this.animations,"duration")}get iterationDuration(){return Fn(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function Fn(t,e){let n=0;for(let s=0;s<t.length;s++){const i=t[s][e];null!==i&&i>n&&(n=i)}return n}class Rn extends On{then(t,e){return this.finished.finally(t).then(()=>{})}}class Vn{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=X.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.notifyChange(),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=X.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){var n;return"change"===t?this.onChangeSubscribe(e):((n=this.events)[t]||(n[t]=new p)).add(e)}onChangeSubscribe(t){const{events:e}=this;return e.change||this.changeSubscriber?(e.change||(e.change=new p,e.change.add(this.changeSubscriber),this.changeSubscriber=void 0),e.change.add(t)):this.changeSubscriber=t,()=>{this.changeSubscriber===t?this.changeSubscriber=void 0:e.change?.remove(t),this.stopIfUnobserved()}}stopIfUnobserved(){N.read(()=>{this.changeSubscriber||this.events.change?.getSize()||this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.notifyChange()}notifyChange(){const{current:t,changeSubscriber:e}=this;e?e(t):this.events.change?.notify(t)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=X.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return g(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0;let n,s=!1;n=t(()=>{s=!0,this.events.animationComplete?.notify(),this.animation===n&&this.clearAnimation(),e()}),s||(this.animation=n),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function In(t,e){return new Vn(t,e)}const Kn={type:"spring",stiffness:500,damping:25,restSpeed:10},$n={type:"keyframes",duration:.8},Nn={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Bn=(t,{keyframes:e})=>e.length>2?$n:Ue.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Kn:Nn,Wn=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);const Yn=(t,e,n,s={},i,a)=>a=>{const o=function(t,e){const n=t?.[e]??t?.default??t;return n!==t?function(t,e){if(t?.inherit&&e){const{inherit:n,...s}=t;return{...e,...s}}return t}(n,t):n}(s,t)||{},l=o.delay||s.delay||0;let{elapsed:u=0}=s;u-=f(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...o,delay:-u,onUpdate:t=>{e.set(t),o.onUpdate&&o.onUpdate(t)},onComplete:()=>{a(),o.onComplete&&o.onComplete()},name:t,motionValue:e,element:i};(function(t){for(const e in t)if(!Wn.has(e))return!0;return!1})(o)||Object.assign(c,Bn(t,c)),c.duration&&(c.duration=f(c.duration)),c.repeatDelay&&(c.repeatDelay=f(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let h=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(Sn(c),0===c.delay&&(h=!0)),(r.instantAnimations||r.skipAnimations||i?.shouldSkipAnimations||o.skipAnimations)&&(h=!0,Sn(c),c.delay=0),c.allowFlatten=!o.type&&!o.ease,h&&void 0!==e.get()){const t=ye(c.keyframes,o);if(void 0!==t)return void N.update(()=>{c.onUpdate(t),c.onComplete()})}return o.isSync?new Se(c):new Dn(c)},_n=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Xn(t,e,n=1){i(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,r]=function(t){const e=_n.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const t=o.trim();return a(t)?parseFloat(t):t}return z(r)?Xn(r,e,n+1):r}const jn=new Set(["width","height","top","left","right","bottom",...ze]),qn=t=>Boolean(t&&t.getVelocity);function zn(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Un=[Z,lt,ot,at,ct,ut,{test:t=>"auto"===t,parse:t=>t}],Ln=t=>Un.find((t=>e=>e.test(t))(t));function Zn(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||l(t))}const Gn=new Set(["auto","none","0"]);class Hn extends on{constructor(t,e,n,s,i){super(t,e,n,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let s=t[n];if("string"==typeof s&&(s=s.trim(),z(s))){const i=Xn(s,e.current);void 0!==i&&(t[n]=i),n===t.length-1&&(this.finalKeyframe=s)}}if(this.resolveNoneKeyframes(),!jn.has(n)||2!==t.length)return;const[s,i]=t;if("number"==typeof s&&"number"==typeof i)return;const r=Ln(s),a=Ln(i);if(L(s)!==L(i)&&Qe[n])this.needsMeasurement=!0;else if(r!==a)if(Le(r)&&Le(a))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else Qe[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||Zn(t[e]))&&n.push(e);n.length&&function(t,e,n){let s,i=0;for(;i<t.length&&!s;){const e=t[i];"string"==typeof e&&!Gn.has(e)&&bt(e)&&(s=t[i]),i++}if(s&&n)for(const i of e)t[i]!==s&&(t[i]=Ie(n,s))}(t,n,e)}measure(){const{element:t,name:e}=this;return Qe[e](window.getComputedStyle(t.current),()=>t.measureViewportBox())}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),e[0]=this.measuredOrigin;const s=e[e.length-1];void 0!==s&&this.motionValue?.jump(s,!1)}measureEndState(){const{element:t,unresolvedKeyframes:e}=this;if(!t||!t.current)return;this.motionValue?.jump(this.measuredOrigin,!1);const n=e.length-1,s=e[n];e[n]=this.measure(),null!==s&&void 0===this.finalKeyframe&&(this.finalKeyframe=s),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const Jn=[];function Qn(e){t(Jn,e)}function ts(t){return Jn.find(e=>e.test(t))}function es(t,e,n={},s){const i=[],{velocity:r}=n,a=n.reduceMotion??s?.shouldReduceMotion;for(const o in e){if("transition"===o||"transitionEnd"===o)continue;const l=e[o];if(void 0===l)continue;const u=t(o),c=u.get();void 0===c||u.isAnimating()||Array.isArray(l)||l!==c||r?(u.start(Yn(o,u,l,a&&jn.has(o)?{type:!1}:n,s)),u.animation&&i.push(u.animation)):N.update(()=>u.set(l))}const{transitionEnd:o}=e;if(o){const e=()=>N.update(()=>{for(const e in o)t(e).set(o[e])});i.length?Promise.all(i).then(e):e()}return i}function ns(t,e,n,s,r){return es(s=>{let a=t.get(e,s);if(!a){let o;if(!r){const r=n[s];o=function(t){const e=Array.isArray(t)?t[0]:void 0;return null===e?void 0:e}(r)??t.read(e,s,r),i(void 0!==o,`"${s}" can't be read from the animated subject. Provide [from, to] keyframes.`,"effect-unreadable-value")}a=In(o,{owner:r}),t(e,{[s]:a})}return a},n,s,r)}function ss(t){return o(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}function is(t){return o(t)&&"ownerSVGElement"in t}const rs=(t,e)=>e&&"number"==typeof t?e.transform(t):t;class as{constructor(t=N.render){this.step=t,this.values=new Map,this.pending=[],this.numPending=0,this.flush=()=>{const{pending:t,numPending:e}=this;this.numPending=0;for(let n=0;n<e;n++)t[n]()}}set(t,e,n,s){if(this.values.get(t)?.onRemove(),s)for(const t of this.values.values())t.value===s&&(n=t.render);const i=()=>n&&this.schedule(n);void 0!==e.get()&&i();const r=e.on("change",i),a=()=>{r(),n&&!s&&this.cancel(n),this.values.delete(t)};return this.values.set(t,{value:e,render:s?void 0:n,onRemove:a}),a}get(t){return this.values.get(t)?.value}release(){const t=new Map;return this.values.forEach((e,n)=>{t.set(n,e.value),e.onRemove()}),this.transformKeys=this.transformValues=void 0,t}schedule(t){const{pending:e,numPending:n}=this;for(let s=0;s<n;s++)if(e[s]===t)return;n||this.step(this.flush),e[this.numPending++]=t}cancel(t){const{pending:e}=this;for(let n=0;n<this.numPending;n++)if(e[n]===t)return void(e[n]=e[--this.numPending])}}function os(t,{step:e,...n}={}){const s=new WeakMap;return Object.assign((n,i)=>{const r=s.get(n)??new as(e);s.set(n,r);const a=[];for(const e in i){const s=i[e],o=t(n,r,e,s);a.push(o)}return()=>{for(const t of a)t()}},n,{get:(t,e)=>s.get(t)?.get(e),flush:t=>s.get(t)?.flush(),state:t=>s.get(t)})}const ls={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},us={};const cs=new Set(["originX","originY","originZ"]),hs=(t,e)=>rs(t.get(e)?.get(),Fe[e]),ds=(t,e,n,s)=>{let i,r;if(Ue.has(n)){if("pathRotation"!==n){const t=e.transformKeys??(e.transformKeys=[]);(e.transformValues??(e.transformValues={}))[n]=s,t.includes(n)||(t.push(n),t.sort((t,e)=>ze.indexOf(t)-ze.indexOf(e)))}e.get("transform")||(ss(t)||e.get("transformBox")||ds(t,e,"transformBox",new Vn("fill-box")),e.set("transform",new Vn("none"),()=>{t.style.transform=function(t){let e="";const{transformKeys:n=[],transformValues:s={}}=t;for(let t=0;t<n.length;t++){const i=n[t],r=s[i].get();void 0!==r&&(("number"==typeof r?r:parseFloat(r))!==(i.startsWith("scale")?1:0)&&(e+=(e&&" ")+(us[i]||(us[i]=(ls[i]||i)+"("))+rs(r,Oe[i])+")"))}const i=t.get("pathRotation")?.get();return i&&(e+=(e&&" ")+"rotate("+rs(i,Oe.pathRotation)+")"),e||"none"}(e)})),r=e.get("transform")}else cs.has(n)?(e.get("transformOrigin")||e.set("transformOrigin",new Vn(""),()=>{const n=hs(e,"originX")??"50%",s=hs(e,"originY")??"50%",i=hs(e,"originZ")??0;t.style.transformOrigin=`${n} ${s} ${i}`}),r=e.get("transformOrigin")):i=ln(n)?()=>{t.style.setProperty(n,s.get())}:()=>{t.style[n]=rs(s.get(),Fe[n])};return e.set(n,s,i,r)},ps=(t,e)=>{if(Ue.has(e))return((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return je(n,e)})(t,e);const n=getComputedStyle(t),s=ln(e)?n.getPropertyValue(e):n[e];return"string"==typeof s&&s.trim()||0},fs=os(ds,{test:t=>ss(t)||is(t),read:ps}),ms=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];const gs=(t,e,n,s,i=n)=>{const r=function(t,e){if(!(e in t))return!1;const n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),e)||Object.getOwnPropertyDescriptor(t,e);return n&&"function"==typeof n.set}(t,i);r||!i.startsWith("data")&&!i.startsWith("aria")||(i=zn(i));const a=Fe[n]||Fe[i],o=r?()=>{t[i]=rs(s.get(),Fe[n])}:()=>{const e=rs(s.get(),a);null==e?t.removeAttribute(i):t.setAttribute(i,String(e))};return e.set(n,s,o)};const ys=os((t,e,n,s)=>{if(n.startsWith("path"))return function(t,e,n,s){return N.render(()=>t.setAttribute("pathLength","1")),"pathOffset"===n?e.set(n,s,()=>{const e=s.get();t.setAttribute("stroke-dashoffset",""+-e)}):(e.get("stroke-dasharray")||e.set("stroke-dasharray",new Vn("1 1"),()=>{const n=e.get("pathLength")?.get()??1,s=e.get("pathSpacing")?.get();t.setAttribute("stroke-dasharray",`${n} ${s??1-Number(n)}`)}),e.set(n,s,void 0,e.get("stroke-dasharray")))}(t,e,n,s);if(n.startsWith("attr"))return gs(t,e,n,s,vs(n));return(n in t.style?ds:gs)(t,e,n,s)},{test:is,read:(t,e)=>Ue.has(e)?Fe[e]?.default||0:ms.includes(e)?ps(t,e):(e=vs(e),t.getAttribute(zn(e))??t.getAttribute(e)??void 0)});function vs(t){return t.replace(/^attr([A-Z])/,(t,e)=>e.toLowerCase())}const bs={};class Ts{constructor(t,e){this.effect=t,this.current=e,this.KeyframeResolver=Hn}getValue(t){return this.effect.get(this.current,t)}readValue(t,e){return this.effect.read(this.current,t,e)}render(){this.effect.flush(this.current)}measureViewportBox(){return function({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}(this.current.getBoundingClientRect())}getProps(){return bs}}function ws(t,e,n,s){if(s)return es(t=>s.getValue(t,null),e,n,s);const i=(t=>is(t)?ys:fs)(t);return ns(i,t,e,n,new Ts(i,t))}const As=os((t,e,n,s)=>e.set(n,s,()=>{t[n]=s.get()}),{test:t=>o(t),read:(t,e)=>{const n=t[e];return"string"==typeof n||"number"==typeof n?n:void 0}}),ks=new WeakMap;function Ss(t){return"object"==typeof t&&!Array.isArray(t)}function Ms(t,e,n,s){return null==t?[]:"string"==typeof t&&Ss(e)?function(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let s=document;e&&(s=e.current);const i=n?.[t]??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(t=>null!=t)}(t,n,s):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(t=>null!=t):[t]}function xs(t,e,n){return t*(e+1)+n*e}function Cs(t,e,n,s){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):s.get(e)??t}function Es(e,n,s,i,r,a){!function(e,n,s){for(let i=0;i<e.length;i++){const r=e[i];r.at>n&&r.at<s&&(t(e,r),i--)}}(e,r,a);for(let t=0;t<n.length;t++)e.push({value:n[t],at:xt(r,a,i[t]),easing:F(s,t)})}function Ps(t,e,n=0){const s=e+1+e*n;for(let e=0;e<t.length;e++)t[e]=t[e]/s}function Ds(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function Os(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function Fs(t,e){return e[t]||(e[t]=[]),e[t]}function Rs(t){return Array.isArray(t)?t:[t]}function Vs(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const Is=t=>"number"==typeof t,Ks=t=>t.every(Is);function $s(t,e,n,s){const r=[];if(function(t,e){return qn(t)||"number"==typeof t||"string"==typeof t&&!Ss(e)}(t,e))r.push(function(t,e,n){const s=qn(t)?t:In(t);return s.start(Yn("",s,e,n)),s.animation}(t,Ss(e)&&e.default||e,n&&n.default||n));else{if(null==t)return r;const a=Ms(t,e,s),o=a.length;i(Boolean(o),"No valid elements provided.","no-valid-elements");for(let t=0;t<o;t++){const s=a[t],i={...n};"delay"in i&&"function"==typeof i.delay&&(i.delay=i.delay(t,o)),s instanceof Element?r.push(...ws(s,e,i,ks.get(s))):r.push(...ns(ts(s)??As,s,e,i))}}return r}function Ns(t,e,n){const i=[],r=function(t,{defaultTransition:e={},...n}={},i,r){const a=e.duration||.3,o=new Map,l=new Map,u={},c=new Map;let h=0,p=0,m=0;for(let n=0;n<t.length;n++){const o=t[n];if("string"==typeof o){c.set(o,p);continue}if(!Array.isArray(o)){c.set(o.name,Cs(p,o.at,h,c));continue}let[d,g,y={}]=o;void 0!==y.at&&(p=Cs(p,y.at,h,c));let v=0;const b=(t,n,i,o=0,l=0)=>{const u=Rs(t),{delay:c=0,times:h=pe(u),type:d=e.type||"keyframes",repeat:g,repeatType:y,repeatDelay:b=0,...w}=n;let{ease:A=e.ease||"easeOut",duration:k}=n;const S="function"==typeof c?c(o,l):c,M=u.length,x=vn(d)?d:r?.[d||"keyframes"];if(M<=2&&x){let t=100;if(2===M&&Ks(u)){const e=u[1]-u[0];t=Math.abs(e)}const n={...e,...w};void 0!==k&&(n.duration=f(k));const s=Xt(n,t,x);A=s.ease,k=s.duration}k??(k=a);const C=p+S;1===h.length&&0===h[0]&&(h[1]=1);const E=h.length-u.length;if(E>0&&de(h,E),1===u.length&&u.unshift(null),g&&s(g<20,`Sequence segments can't repeat ${g} times — ignoring repeat option. Use a value below 20 or apply repeat at the sequence level instead.`),g&&g<20){const t=k>0?b/k:0;k=xs(k,g,b);const e=[...u],n=[...h];A=Array.isArray(A)?[...A]:[A];const s=[...A],i="reverse"===y||"mirror"===y;let r=e,a=s;i&&(r=[...e].reverse(),"reverse"===y&&(a=[...s].reverse().map(t=>"function"==typeof t?T(t):t)));for(let o=0;o<g;o++){const l=i&&o%2==0,c=l?r:e,d=l?a:s,p=(o+1)*(1+t);t>0&&(u.push(u[u.length-1]),h.push(p),A.push("linear")),u.push(...c);for(let t=0;t<c.length;t++)h.push(n[t]+p),A.push(0===t?"linear":F(d,t-1))}Ps(h,g,t)}const P=C+k;Es(i,u,A,h,C,P),v=Math.max(S+k,v),m=Math.max(P,m)};if(qn(d))b(g,y,Fs("default",Os(d,l)));else{const t=Ms(d,g,i,u),e=t.length;for(let n=0;n<e;n++){const s=Os(t[n],l);for(const t in g)b(g[t],Vs(y,t),Fs(t,s),n,e)}}h=p,p+=v}return l.forEach((t,s)=>{for(const i in t){const r=t[i];r.sort(Ds);const a=[],l=[],u=[];for(let t=0;t<r.length;t++){const{at:e,value:n,easing:s}=r[t];a.push(n),l.push(d(0,m,e)),u.push(s||"easeOut")}0!==l[0]&&(l.unshift(0),a.unshift(a[0]),u.unshift("easeInOut")),1!==l[l.length-1]&&(l.push(1),a.push(null)),o.has(s)||o.set(s,{keyframes:{},transition:{}});const c=o.get(s);c.keyframes[i]=a;const{type:h,...p}=e;c.transition[i]={...p,duration:m,ease:u,times:l,...n}}}),o}(t.map(t=>{if(Array.isArray(t)&&"function"==typeof t[0]){const e=t[0],n=In(0);return n.on("change",e),1===t.length?[n,[0,1]]:2===t.length?[n,[0,1],t[1]]:[n,t[1],t[2]]}return t}),e,n,{spring:ue});return r.forEach(({keyframes:t,transition:e},n)=>{i.push(...$s(n,t,e))}),i}function Bs(e={}){const{scope:n,reduceMotion:s,skipAnimations:i}=e;return function(e,r,a){let o,l=[];const u={};if(void 0!==s&&(u.reduceMotion=s),void 0!==i&&(u.skipAnimations=i),c=e,Array.isArray(c)&&c.some(Array.isArray)){const{onComplete:t,...s}=r||{};"function"==typeof t&&(o=t),l=Ns(e,{...u,...s},n)}else{const{onComplete:t,...s}=a||{};"function"==typeof t&&(o=t),l=$s(e,r,{...u,...s},n)}var c;const h=new Rn(l);return o&&h.finished.then(o),n&&(n.animations.push(h),h.finished.then(()=>{t(n.animations,h)})),h}}const Ws=Object.assign(Bs(),{addEffect:function(t){i("function"==typeof t.test&&"function"==typeof t.read,"Effects passed to animate.addEffect() need test() and read().","effect-missing-test"),Qn(t),Jn.unshift(t)},removeEffect:Qn});export{Ws as animate,Bs as createScopedAnimate};
//# sourceMappingURL=size-rollup-animate.js.map