function t(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const e=(t,e,n)=>n>e?e:n/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),i=t=>"object"==typeof t&&null!==t,r=t=>/^0[^.\s]+$/u.test(t);function a(t){let e;return()=>(void 0===e&&(e=t()),e)}const o=t=>t,l=(...t)=>t.reduce((t,e)=>n=>e(t(n))),u=(t,e,n)=>{const s=e-t;return s?(n-t)/s:1};class h{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;i1e3*t,d=t=>t/1e3,f=(t,e)=>e?t*(1e3/e):0,p=(t,e,n)=>t*(3*(1-t)*((1-t)*e+t*n)+t*t);function m(t,e,n,s){return t===e&&n===s?o:i=>{let r=0,a=1,o=i;for(let e=0;;e++){o>=r&&o<=a||(o=(r+a)/2);const s=p(o,t,n)-i;if(s*s<1e-28||40===e)break;s>0?a=o:r=o,o-=1e-7*s/(p(o+1e-7,t,n)-i-s)}return p(o,e,s)}}const g=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,y=t=>e=>1-t(1-e),v=m(.33,1.53,.69,.99),b=y(v),T=g(b),A=t=>t>=1?1:(t*=2)<1?.5*b(t):.5*(2-Math.pow(2,-10*(t-1))),w=t=>1-Math.sin(Math.acos(t)),M=y(w),k=g(w),S=m(.42,0,1,1),x=m(0,0,.58,1),D=m(.42,0,.58,1),C=t=>Array.isArray(t)&&"number"!=typeof t[0];function E(t,e){return C(t)?t[((t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t})(0,t.length,e)]:t}const V=t=>Array.isArray(t)&&"number"==typeof t[0],F={linear:o,easeIn:S,easeInOut:D,easeOut:x,circIn:w,circInOut:k,circOut:M,backIn:b,backInOut:T,backOut:v,anticipate:A},P=t=>{if(V(t)){t.length;const[e,n,s,i]=t;return m(e,n,s,i)}return"string"==typeof t?F[t]:t},R={delta:0,timestamp:0,isProcessing:!1};let O;function I(){O=void 0}const K={now:()=>(void 0===O&&K.set(R.isProcessing||n.useManualTiming?R.timestamp:performance.now()),O),set:t=>{O=t,queueMicrotask(I)}},W=t=>Math.round(1e5*t)/1e5,N=(t=>e=>"string"==typeof e&&e.startsWith(t))("var(--"),B=t=>!!N(t)&&$.test(t.split("/*")[0].trim()),$=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function j(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const Y={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},_={...Y,transform:t=>e(0,1,t)},X={...Y,default:1},U=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const z=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Z=(t,e)=>n=>Boolean("string"==typeof n&&z.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),L=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[i,r,a,o]=s.match(U);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(a),alpha:void 0!==o?parseFloat(o):1}},q={...Y,transform:t=>Math.round((t=>e(0,255,t))(t))},J={test:Z("rgb","red"),parse:L("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+q.transform(t)+", "+q.transform(e)+", "+q.transform(n)+", "+W(_.transform(s))+")"};const G={test:Z("#"),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:J.transform},H=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Q=H("deg"),tt=H("%"),et=H("px"),nt=H("vh"),st=H("vw"),it=(()=>({...tt,parse:t=>tt.parse(t)/100,transform:t=>tt.transform(100*t)}))(),rt={test:Z("hsl","hue"),parse:L("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+tt.transform(W(e))+", "+tt.transform(W(n))+", "+W(_.transform(s))+")"},at={test:t=>J.test(t)||G.test(t)||rt.test(t),parse:t=>J.test(t)?J.parse(t):rt.test(t)?rt.parse(t):G.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?J.transform(t):rt.transform(t),getAnimatableNone:t=>{const e=at.parse(t);return e.alpha=0,at.transform(e)}},ot=new RegExp(U.source),lt=new RegExp(/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu.source,"i");const ut="number",ht="color",ct=/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+)(?![a-z]*\()/giu;function dt(t){const e=t.toString();return ot.test(e)||lt.test(e)}function ft(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(ct,t=>(at.test(t)?(s.color.push(r),i.push(ht),n.push(at.parse(t))):t.startsWith("var(")?(s.var.push(r),i.push("var"),n.push(t)):(s.number.push(r),i.push(ut),n.push(parseFloat(t))),++r,"${}")).split("${}");return{values:n,split:a,indexes:s,types:i}}function pt({split:t,types:e}){const n=t.length;return s=>{let i="";for(let r=0;r{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:at.test(n)?at.getAnimatableNone(n):n;var n};const gt={test:function(t){return isNaN(t)&&"string"==typeof t&&(ot.test(t)||lt.test(t))},parse:function(t){return ft(t).values},createTransformer:function(t){return pt(ft(t))},getAnimatableNone:function(t){const e=ft(t);return pt(e)(e.values.map((t,n)=>mt(t,e.split[n])))}};function yt(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 vt(t,e){return n=>n>0?e:t}const bt=(t,e,n)=>t+(e-t)*n,Tt=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},At=[G,J,rt];function wt(t){const e=(n=t,At.find(t=>t.test(n)));var n;if(!e)return!1;let s=e.parse(t);return e===rt&&(s=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=yt(o,s,t+1/3),r=yt(o,s,t),a=yt(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}}(s)),s}const Mt=(t,e)=>{const n=wt(t),s=wt(e);if(!n||!s)return vt(t,e);const i={...n};return t=>(i.red=Tt(n.red,s.red,t),i.green=Tt(n.green,s.green,t),i.blue=Tt(n.blue,s.blue,t),i.alpha=bt(n.alpha,s.alpha,t),J.transform(i))},kt=new Set(["none","hidden"]);function St(t,e){return n=>bt(t,e,n)}function xt(t){return"number"==typeof t?St:"string"==typeof t?B(t)?vt:at.test(t)?Mt:Et:Array.isArray(t)?Dt:"object"==typeof t?at.test(t)?Mt:Ct:vt}function Dt(t,e){const n=[...t],s=n.length,i=t.map((t,n)=>xt(t)(t,e[n]));return t=>{for(let e=0;e{for(const e in s)n[e]=s[e](t);return n}}const Et=(t,e)=>{const n=gt.createTransformer(e),s=ft(t),i=ft(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?kt.has(t)&&!i.values.length||kt.has(e)&&!s.values.length?function(t,e){return kt.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):l(Dt(function(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;iW(bt(r,a,t))+i}(t,e);if(n)return n}return xt(t)(t,e)}const Pt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Rt(t,e,s={delta:0,timestamp:0,isProcessing:!1}){let i=!1,r=!0;const a=()=>i=!0,o=Pt.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:h,preUpdate:c,update:d,preRender:f,render:p,postRender:m}=o,g=()=>{const a=n.useManualTiming,o=a?s.timestamp:performance.now();i=!1,a||(s.delta=r?1e3/60:Math.max(Math.min(o-s.timestamp,40),1)),s.timestamp=o,s.isProcessing=!0,l.process(s),u.process(s),h.process(s),c.process(s),d.process(s),f.process(s),p.process(s),m.process(s),s.isProcessing=!1,i&&e&&(r=!1,t(g))};return{schedule:Pt.reduce((e,n)=>{const a=o[n];return e[n]=(e,n=!1,o=!1)=>(i||(i=!0,r=!0,s.isProcessing||t(g)),a.schedule(e,n,o)),e},{}),cancel:t=>{for(let e=0;e{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>Ot.update(e,t),stop:()=>It(e),now:()=>R.isProcessing?R.timestamp:K.now()}},Wt=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let e=0;e=n?1/0:i}function $t(t,e=100,n){const{keyframes:s,velocity:i}=t,r=s&&s[s.length-1]-s[0],a=n({...t,velocity:i&&r?i*e/r:i,keyframes:[0,e]}),o=Math.min(Bt(a),Nt);return{type:"keyframes",ease:t=>a.next(o*t).value/e,duration:d(o)}}const jt=100,Yt=10,_t=1,Xt=800,Ut=.3,zt=.3,Zt={granular:.01,default:2},Lt={granular:.005,default:.5},qt=.01,Jt=10,Gt=.05,Ht=t=>t<0?1/Math.max(1+t,Gt):Math.max(1-t,Gt);function Qt(t,e){if(!(t>1))return 1;const n=Math.sqrt(t*t-1),s=t-n,i=t+n,r=2*n*Math.exp(-e)*(1+e);return ne(t=>i*Math.exp(-s*t)-s*Math.exp(-i*t)-r,t=>Math.exp(-i*t)-Math.exp(-s*t),e)/e}function te(t,e){return t*Math.sqrt(1-e*e)}const ee=12;function ne(t,e,n){let s=n;for(let n=1;n(e?t>=0:t>0)&&t<1/0;function re(t,e){if(ie(t,e))return t}function ae(t){const n=re(t.stiffness),s=re(t.damping,!0),i=re(t.mass),r={...t,stiffness:n??jt,damping:s??Yt,mass:i??_t,isResolvedFromDuration:!1,isTimeDefined:void 0===(n??s??i)&&(void 0!==t.duration||void 0!==t.bounce)};if(r.isTimeDefined){if(t.visualDuration){const e=Ht(t.bounce||0),n=2*Math.PI/(1.2*t.visualDuration)*Qt(e,2*Math.PI/1.2);r.stiffness=n*n,r.damping=2*e*Math.sqrt(r.stiffness)}else Object.assign(r,function({duration:t=Xt,bounce:n=Ut}){let s,i;const r=Ht(n);t=e(qt,Jt,d(t)),r<1?(s=e=>{const n=e*r,s=n*t,i=te(e,r),a=Math.exp(-s);return se-n/i*a},i=e=>{const n=e*r*t,i=r*r*e*e*t,a=Math.exp(-n),o=te(e*e,r);return(-s(e)+se>0?-1:1)*-i*a/o}):(s=e=>Math.exp(-e*t)*(e*t+1)-.001,i=e=>Math.exp(-e*t)*(t*t*-e));const a=ne(s,i,5/t),o=a*Qt(r,a*t),l=o*o;return{stiffness:l,damping:2*r*Math.sqrt(l),duration:c(t)}}(r)),r.isResolvedFromDuration=!0;ie(r.stiffness)&&ie(r.damping,!0)||(r.stiffness=jt,r.damping=Yt)}return r}function oe(t=zt,e=Ut){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,isResolvedFromDuration:h,isTimeDefined:f}=ae({...n}),p=t=>f?0:-d(t),m=o/(2*Math.sqrt(a*l)),g=d(Math.sqrt(a/l)),y=m*g,v={target:i,delta:i-s,velocity:p(n.velocity||0)||0,restSpeed:0,restDelta:0},b=()=>{const t=Math.abs(v.delta)<5;v.restSpeed=n.restSpeed||(t?Zt.granular:Zt.default),v.restDelta=n.restDelta||(t?Lt.granular:Lt.default)};let T,A,w;if(b(),m<1){const t=te(g,m),e={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};w=()=>{e.A=(v.velocity+y*v.delta)/t,e.sinC=y*e.A+v.delta*t,e.cosC=y*v.delta-e.A*t};const n=n=>{n!==e.t&&(e.t=n,e.env=Math.exp(-y*n),e.sin=Math.sin(t*n),e.cos=Math.cos(t*n))};T=t=>(n(t),v.target-e.env*(e.A*e.sin+v.delta*e.cos)),A=t=>(n(t),e.env*(e.sinC*e.sin+e.cosC*e.cos))}else if(1===m){T=t=>v.target-Math.exp(-g*t)*(v.delta+(v.velocity+g*v.delta)*t);const t={C:0};w=()=>{t.C=v.velocity+g*v.delta},A=e=>Math.exp(-g*e)*(g*t.C*e-v.velocity)}else{const t=g*Math.sqrt(m*m-1),e=y-t,n=y+t,s=f?1/0:300/t,i=(t,e)=>Math.exp(e>s?-t*s-y*(e-s):-t*e),r={S:0,F:0};w=()=>{const e=(v.velocity+y*v.delta)/t;r.S=(v.delta+e)/2,r.F=(v.delta-e)/2},T=t=>v.target-r.S*i(e,t)-r.F*i(n,t),A=t=>e*r.S*i(e,t)+n*r.F*i(n,t)}w();const M=h&&u||null,k={calculatedDuration:M,retarget:(t,e)=>{v.target=t[t.length-1],v.delta=v.target-t[0],v.velocity=p(e),n.restSpeed&&n.restDelta||b(),k.calculatedDuration=M,r.done=!1,w()},velocity:t=>c(A(t)),next:t=>{const e=T(t);if(h)r.done=t>=u;else{const n=c(A(t));r.done=Math.abs(n)<=v.restSpeed&&Math.abs(v.target-e)<=v.restDelta}return r.value=r.done?v.target:e,r},toString:()=>{const t=Math.min(Bt(k),Nt),e=Wt(e=>k.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return k}function le({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:h}){const c=t[0],d={done:!1,value:c},f=t=>void 0===o?l:void 0===l||Math.abs(o-t)-p*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 A=t=>{var e;((e=d.value)l)&&(b=t,T=oe({keyframes:[d.value,f(d.value)],velocity:-y(t)/s*1e3,damping:i,stiffness:r,restDelta:u,restSpeed:h}))};return A(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==b||(e=!0,v(t),A(t)),void 0!==b&&t>=b?T.next(t-b):(!e&&v(t),d)}}}function ue(t,s,{clamp:i=!0,ease:r,mixer:a}={}){const h=t.length;if(s.length,1===h)return()=>s[0];if(2===h&&s[0]===s[1])return()=>s[1];const c=t[0]===t[1];t[0]>t[h-1]&&(t=[...t].reverse(),s=[...s].reverse());const d=function(t,e,s){const i=[],r=s||n.mix||Ft,a=t.length-1;for(let n=0;n{if(c&&e1)for(;np(e(t[0],t[h-1],n)):p}function he(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=u(0,e,s);t.push(bt(n,1,i))}}function ce(t){const e=[0];return he(e,t.length-1),e}function de({duration:t=300,keyframes:s,times:i,ease:r="easeInOut"}){const a=C(r)?r.map(P):P(r)||D,o={done:!1,value:s[0]};if(2===s.length&&!Array.isArray(a)&&(!i||2!==i.length||0===i[0]&&1===i[1])){const[i,r]=s,l=i===r?void 0:(n.mix||Ft)(i,r);return{calculatedDuration:t,next:n=>(o.value=l?l(a(t>0?e(0,1,n/t):1)):r,o.done=n>=t,o)}}const l=function(t,e){return t.map(t=>t*e)}(i&&i.length===s.length?i:ce(s),t),u=ue(l,s,{ease:Array.isArray(a)?a:(h=s,c=a,h.map(()=>c||D).splice(0,h.length-1))});var h,c;return{calculatedDuration:t,next:e=>(o.value=u(e),o.done=e>=t,o)}}oe.applyToOptions=t=>{const e=$t(t,100,oe);return t.ease=e.ease,t.duration=c(e.duration),t.type="keyframes",t};function fe(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 f(n-t(s),e-s)}(e=>t.next(e).value,e,t.next(e).value)}const pe=t=>null!==t;function me(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(pe),a=i<0||e&&"loop"!==n&&e%2==1?0:r.length-1;return a&&void 0!==s?s:r[a]}const ge={decay:le,inertia:le,tween:de,keyframes:de,spring:oe};function ye(t){"string"==typeof t.type&&(t.type=ge[t.type])}const ve=(t,e)=>e-t>40&&!n.useManualTiming?e:t;function be(t,e){return{kind:t,animation:e,timestamp:K.now(),frameTimestamp:R.timestamp,frameIsProcessing:R.isProcessing}}function Te(t,e,n){const s=globalThis.__MOTION_INSPECT__;if(s)try{s({...be("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 we=t=>t/100,Me=t=>Math.round(1e4*t)/1e4;class ke 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!==K.now()&&this.tick(K.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause(),Te(this,this.options)}initAnimation(){const{options:t}=this;ye(t);const{type:e=de,repeat:n=0,repeatDelay:s=0,repeatType:i,velocity:r=0}=t;let{keyframes:a}=t;const o=e||de;o!==de&&"number"!=typeof a[0]&&(this.mixKeyframes=l(we,Ft(a[0],a[1])),a=[0,100]);const u=o(a===t.keyframes?t:{...t,keyframes:a});"mirror"===i&&(this.mirroredGenerator=o({...t,keyframes:[...a].reverse(),velocity:-r})),null===u.calculatedDuration&&(u.calculatedDuration=Bt(u));const{calculatedDuration:h}=u;this.calculatedDuration=h,this.resolvedDuration=h+s,this.totalDuration=this.resolvedDuration*(n+1)-s,this.generator=u}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:s,calculatedDuration:i}=this;if(null===this.startTime)return n.next(0);const{delay:r=0,keyframes:a,type:o,onUpdate:l,finalKeyframe:u}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=ve(this.startTime,t)),this.pendingStartTime=void 0,this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const h=this.currentTime-r*(this.playbackSpeed>=0?1:-1),c=this.playbackSpeed>=0?h<0:h>s;this.currentTime=Math.max(h,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=s);const d=this.generate(this.currentTime,c);let{done:f}=d;c||null===i||(f=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const p=null===this.holdTime&&("finished"===this.state||"running"===this.state&&f);return p&&o!==le&&(d.value=me(a,this.options,u,this.speed)),l&&l(d.value),p&&this.finish(),d}at(t){return this.holdTime??Me((t-this.startTime)*this.playbackSpeed)}sampleAt(t,e){const{options:n,totalDuration:s}=this,i=this.at(t)-(n.delay||0);return i>=s&&n.type!==le?me(n.keyframes,n,e?void 0:n.finalKeyframe):this.generate(Math.max(i,0),i<0).value}generate(t,n){const{generator:s,totalDuration:i,mixKeyframes:r,mirroredGenerator:a,resolvedDuration:o}=this,{keyframes:l,repeat:u,repeatType:h,repeatDelay:c}=this.options;let d,f=t,p=s;if(u){const n=Math.min(t,i)/o;let s=Math.floor(n),r=n%1;!r&&n>=1&&(r=1),1===r&&s--,s=Math.min(s,u+1);Boolean(s%2)&&("reverse"===h?(r=1-r,c&&(r-=c/o)):"mirror"===h&&(p=a)),f=e(0,1,r)*o}return n?(this.delayState.value=l[0],d=this.delayState):d=p.next(f),r&&!n&&(d.value=r(d.value)),d}then(t,e){return this.finished.then(t,e)}get duration(){return d(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+d(t)}get time(){return d(this.currentTime)}set time(t){t=c(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 fe(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(K.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=d(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Kt,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.playbackSpeed||1):this.startTime||(this.startTime=e??(this.pendingStartTime=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(K.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 Se=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(U)||[];if(!s)return t;const i=n.replace(s,"");let r=Se.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const De=/\b([a-z-]*)\(.*?\)/gu,Ce={...gt,getAnimatableNone:t=>{const e=t.match(De);return e?e.map(xe).join(" "):t}},Ee={...gt,getAnimatableNone:t=>{const e=gt.parse(t);return gt.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},Ve={...Y,transform:Math.round},Fe={rotate:Q,pathRotation:Q,rotateX:Q,rotateY:Q,rotateZ:Q,scale:X,scaleX:X,scaleY:X,scaleZ:X,skew:Q,skewX:Q,skewY:Q,distance:et,translateX:et,translateY:et,translateZ:et,x:et,y:et,z:et,perspective:et,transformPerspective:et,opacity:_,originX:it,originY:it,originZ:et},Pe={borderWidth:et,borderTopWidth:et,borderRightWidth:et,borderBottomWidth:et,borderLeftWidth:et,borderRadius:et,borderTopLeftRadius:et,borderTopRightRadius:et,borderBottomRightRadius:et,borderBottomLeftRadius:et,width:et,maxWidth:et,height:et,maxHeight:et,top:et,right:et,bottom:et,left:et,inset:et,insetBlock:et,insetBlockStart:et,insetBlockEnd:et,insetInline:et,insetInlineStart:et,insetInlineEnd:et,padding:et,paddingTop:et,paddingRight:et,paddingBottom:et,paddingLeft:et,paddingBlock:et,paddingBlockStart:et,paddingBlockEnd:et,paddingInline:et,paddingInlineStart:et,paddingInlineEnd:et,margin:et,marginTop:et,marginRight:et,marginBottom:et,marginLeft:et,marginBlock:et,marginBlockStart:et,marginBlockEnd:et,marginInline:et,marginInlineStart:et,marginInlineEnd:et,fontSize:et,backgroundPositionX:et,backgroundPositionY:et,...Fe,zIndex:Ve,fillOpacity:_,strokeOpacity:_,numOctaves:Ve},Re={...Pe,color:at,backgroundColor:at,outlineColor:at,fill:at,stroke:at,borderColor:at,borderTopColor:at,borderRightColor:at,borderBottomColor:at,borderLeftColor:at,filter:Ce,WebkitFilter:Ce,mask:Ee,WebkitMask:Ee},Oe=new Set([Ce,Ee]);function Ie(t,e){let n=(t=>Re[t])(t);return Oe.has(n)||(n=gt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Ke=t=>180*t/Math.PI,We=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,scaleZ:()=>1,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:We,rotateZ:We,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),$e=t=>Math.hypot(t[0],t[1]),je=t=>Math.hypot(t[4],t[5]),Ye={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:$e,scaleY:je,scaleZ:t=>Math.hypot(t[8],t[9],t[10]),scale:t=>($e(t)+je(t))/2,rotateX:t=>Be(Ke(Math.atan2(t[6],t[5]))),rotateY:t=>Be(Ke(Math.atan2(-t[2],t[0]))),rotateZ:We,rotate:We,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 _e(t){return t.includes("scale")?1:0}function Xe(t,e){if(!t||"none"===t)return _e(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Ye,i=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Ne,i=e}if(!i)return _e(e);const r=s[e],a=i[1].split(",").map(Ue);return"function"==typeof r?r(a):a[r]}function Ue(t){return parseFloat(t.trim())}const ze=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","scaleZ","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ze=(()=>new Set([...ze,"pathRotation"]))(),Le=t=>t===Y||t===et,qe=new Set(["x","y","z"]),Je=ze.filter(t=>!qe.has(t));const Ge=new Set(["bottom","right"]);function He(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)=>He(t,i,"x",e,n,s),height:({height:t,paddingTop:e="0",paddingBottom:n="0",boxSizing:s},i)=>He(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})=>Xe(t,"x"),y:({transform:t})=>Xe(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),Ge.has(s.name)&&n.add(s.element))});const s=new Map;n.forEach(t=>{const e=function(t){const e=[];return Je.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,Ot.read(an),Ot.resolveKeyframes(rn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const a=i?.get(),o=t[t.length-1];if(void 0!==a)t[0]=a;else if(n&&e){const i=function(t,e,n){if("string"==typeof t){if(s(t)||r(t))return parseFloat(t);if(!gt.test(t)&>.test(n))return Ie(e,n)}return t??void 0}(n.readValue(e,o),e,o);void 0!==i&&(t[0]=i)}void 0===t[0]&&(t[0]=o),i&&void 0===a&&i.set(t[0])}!function(t){for(let e=1;et.startsWith("--");function un(t,e,n){ln(e)?t.style.setProperty(e,n):t.style[e]=n}const hn={};function cn(t,e){const n=a(t);return()=>hn[e]??n()}const dn=cn(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),fn=cn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),pn=([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:pn([0,.65,.55,1]),circOut:pn([.55,0,1,.45]),backIn:pn([.31,.01,.66,-.59]),backOut:pn([.33,1.53,.69,.99])};function gn(t,e){return t?"function"==typeof t?fn()?Wt(t,e):"ease-out":V(t)?pn(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 h={[e]:n};l&&(h.offset=l);const c=gn(o,i);Array.isArray(c)&&(h.easing=c);const d={delay:s,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===a?"alternate":"normal"};return u&&(d.pseudoElement=u),t.animate(h,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:i,allowFlatten:r=!1,finalKeyframe:a,onComplete:o}=t;this.isPseudoElement=Boolean(i),this.allowFlatten=r,this.options=t,t.type;const l=function({type:t,...e}){return vn(t)&&fn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=yn(e,n,s,l,i),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const t=me(s,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(t),un(e,n,t),this.animation.cancel()}o?.(),this.notifyFinished()},Te(this,t,l)}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 d(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+d(t)}get time(){return d(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=c(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,onAttach:e,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&dn()?(this.animation.timeline=t,e?.(this.animation),o):n(this)}}const Tn={anticipate:A,backInOut:T,circInOut:k};function An(t){"string"==typeof t.ease&&t.ease in Tn&&(t.ease=Tn[t.ease])}class wn extends bn{constructor(t){An(t),ye(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}elapsed(){return"running"===this.state?(K.now()-this.startTime)*this.speed:1e3*this.time}sample(t){if(!this.sampler){const{motionValue:t,onUpdate:e,onComplete:n,onPlay:s,onStop:i,element:r,...a}=this.options;this.sampler=new ke({...a,autoplay:!1}),this.sampler.stop()}return this.sampler.sample(Math.max(0,t)).value}liveValue(){const{state:t}=this;if("running"===t||"paused"===t)return this.sample(this.elapsed())}updateMotionValue(t){const{motionValue:n,element:s,name:i}=this.options;if(!n)return;if(void 0!==t)return void n.set(t);const{speed:r}=this,a=this.elapsed(),o="running"===this.state&&r?e(0,10,a):0,l=this.sample(a);s&&i&&un(s,i,l),n.setWithVelocity(this.sample(a-o*Math.sign(r)),l,o/Math.abs(r||1))}}const Mn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!gt.test(t)&&"0"!==t||t.startsWith("url(")));function kn(t){t.duration=0,t.type="keyframes"}const Sn=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),xn=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const Dn=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Cn=a(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function En(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:a,keyframes:o}=t;if(!n||!Sn.has(n)&&!Dn.has(n))return!1;const l=e?.owner?.current;if(!(l instanceof HTMLElement||l instanceof SVGElement))return!1;const{onUpdate:u,transformTemplate:h}=e.owner.getProps();return Cn()&&(Sn.has(n)||Dn.has(n)&&function(t){for(let e=0;ee&&"number"==typeof t?e.transform(t):t,Fn={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Pn=ze.length;const Rn=new WeakMap,On=.001,In=(t,e)=>t-e,Kn=(t,e,n)=>{const s=[];for(let i=0;i<=n;i++)s.push(bt(t,e,i/n));return s},Wn=t=>t.motionValue.owner,Nn=t=>Rn.get(t),Bn=(t,e)=>t.latestValues?t.latestValues[e]:t.getValue(e)?.get();class $n extends ke{constructor(t){const e=Wn(t).current,{driver:n=Kt}=t;let s;const i=function(t){const e=Wn(t),{onUpdate:n,transformTemplate:s}=e.getProps();return!(t.isHandoff||n||t.hasOnUpdate||s||"inertia"===t.type||"none"!==(Bn(e,"transform")||"none")||Bn(e,"pathRotation")||e.projection?.isProjecting())}(t);t.driver=t=>{const i=n(t);return{js:i,now:i.now,start:(t=!0)=>{const n=Nn(e);!n||n.isJS?i.start(t):n.schedule(!1,!t)},stop:()=>{i.stop();const t=Nn(e);t&&!t.isFinishing&&t.release(s)}}},super(t),s=this,this.canAccelerate=i;const{stop:r}=this;this.stop=()=>{this.isAccelerated()&&this.sync(),r()}}get group(){return Nn(Wn(this.options).current)}get js(){return this.driver?.js}get name(){return this.options.name}timing(){const{startTime:t,speed:e,totalDuration:n}=this,{delay:s=0,repeatType:i}=this.options;return null!==this.holdTime?[1/0,0]:n===1/0?[t+s/e,this.resolvedDuration*("loop"===i?1:2)/e||1]:[t+(s+n)/e,0]}isAccelerated(){const{group:t,state:e}=this;return t?.tracks.has(this)&&!t.isJS&&this.canAccelerate&&("running"===e||"paused"===e)}liveValue(){return this.isAccelerated()?this.sampleAt(K.now()):void 0}tween(){const{keyframes:t,type:e,ease:n,times:s,repeat:i,delay:r=0}=this.options,a=V(n)?pn(n):(t=>/^(linear|ease(In|Out|InOut))$/.test(t))(n)&&mn[n];if(a&&!i&&!s&&2===t.length&&e===de&&null===this.holdTime){const t=this.startTime+r/this.speed;return[t,t+this.resolvedDuration/this.speed,a]}}boundaries(t,e){const{startTime:n,speed:s,resolvedDuration:i,options:r}=this,{delay:a=0,repeat:o=0,repeatDelay:l=0,repeatType:u,times:h,keyframes:c,type:d}=r,f=(d||de)===de?h||ce(c):[0,1],p=n+a/s,m=[];if(null!==this.holdTime||!(i>0))return m;for(let n=Math.max(0,Math.floor((t-p)*s/i));n<=o;n++){const r=p+n*i/s;if(r>e)break;for(const a of f){const o=r+(n%2&&u&&"loop"!==u?1-a:a)*(i-l)/s;o>t&&o{for(const e of n)if(e.name===t)return!0},m=(e,n)=>{const a={};for(const o of void 0===e?ze:r){const r=s.get(o),l=void 0===e?Bn(t,o):r?r.sampleAt(n>e&&!r.timing()[1]?n:e):i[o];void 0!==l&&(a[o]=l)}return a},g=(t,e)=>{let n="";const s=m(t,e);for(const t in s)n+=(Fn[t]||t)+"("+Vn(s[t],Pe[t])+") ";return n||"none"},y=(t=m())=>{e.style.transform=function(t,e,n){let s="",i=!0;for(let e=0;e{t&&y(),o.forEach(({animation:t})=>t.cancel()),o=[]},b=(t,e,n=1/0)=>{const s={animation:t,offset:e,end:n};t.startTime=K.now()+e,n<1/0&&(t.onfinish=()=>{s.isDone=!0,o.some(t=>t.end===1/0)&&(t.cancel(),o=o.filter(t=>t!==s)),E.schedule(!1)}),t.oncancel=()=>o.includes(s)&&E.demote(),o.push(s)},T=(t,e,n)=>{const s=(e,n)=>Math.abs(t(n)-t(e)),i=s(e,n);for(;n-e>.01;){const t=(e+n)/2;s(e,t)>s(t,n)?n=t:e=t}return s(e,n)>i/2?[e,n]:[]},A=(t,e,n,s)=>{const i=Math.min(200,Math.max(2,Math.ceil((n-e)/10)));if(4*s.length>i)return;const r=Kn(e,n,i).concat(s).sort(In),a=t=>u(e,n,t);let o,l;for(const e of t){const t=r.map(t=>e.numberAt(t)),[n]=t,s=t.map(t=>t-n),i=s[s.length-1],a=s.some(t=>Math.abs(t)*On>Math.abs(i))?0:i,u=s.map(t=>a?t/a:t);if(a)if(o){if(u.some((t,e)=>!(Math.abs(t-o[e])<=On)))return}else o=u,l=t=>(e.numberAt(t)-n)/a;else if(u.some(t=>!(Math.abs(t)<=On)))return}if(!o||o.every((t,e)=>Math.abs(t-a(r[e]))<=On))return"linear";const h=[],c=(t,e=l(t))=>h.push(Me(e)+" "+Me(100*a(t))+"%");return o.forEach((t,e)=>{e&&Math.abs(t-o[e-1])>.2&&T(l,r[e-1],r[e]).forEach(t=>c(t)),c(r[e],t)}),"linear("+h+")"},w=(t,e,n,s)=>{const i=[e],r=(e,n)=>t.every(t=>!(Math.abs(t.numberAt((e+n)/2)-(t.numberAt(e)+t.numberAt(n))/2)>(t.name.startsWith("scale")?.001:.1))),a=(e,n,s)=>{if(n-e<1||r(e,n))i.push(n);else if(s<4)a(e,(e+n)/2,s+1),a((e+n)/2,n,s+1);else{for(const s of t)i.push(...T(t=>s.numberAt(t),e,n));i.push(n)}},o=Kn(e,n,Math.ceil((n-e)/100));for(const t of s)o.push(t,Math.min(t+.01,n));let l=e;for(const t of o.sort(In))t>l&&a(l,t,0),l=t;return i.sort(In)},M=t=>{let e;for(const n of t){const t=n.tween();if(!t||e?.some((e,n)=>n<2?Math.abs(t[n]-e)>1:t[n]!==e))return;e=t}return e},k=(t,n,s,i={fill:"both"},r,a)=>{const o=t.flatMap(t=>t.boundaries(n,s)),l=a||A(t,n,s,o),h=l?[n,s]:w(t,n,s,o),c=h.map(t=>g(t,r));let d={transform:c};return l||(d.offset=h.map(t=>u(n,s,t))),c.every(t=>t===c[0])&&(y(m(n,r)),d=null),e.animate(d,{...i,duration:s-n,easing:l||"linear"})},S=l=>{let u=l,h=0,c=0;const d=[],f=[],p=new Set;s.clear(),a=new Map;for(const t of n){s.set(t.name,t);const[e,n]=t.timing(),i=e===1/0;if(a.set(t,[t.at(l),t.speed,i]),i)t.sync();else{if(t.speed<0)return;if(n){if(h){const t=(e-c)/n;if(Math.abs(n-h)>1||Math.abs(t-Math.round(t))*h>1)return}else h=n,c=e;f.push(t)}else p.add(e);d.push(t),u=Math.max(u,e)}}i={},r=ze.filter(e=>{if(s.has(e))return!0;const n=i[e]=Bn(t,e);return void 0!==n&&parseFloat(n)!==(e.startsWith("scale")?1:0)}),v(!1);const m=!h&&M(d);try{if(m&&m[1]>l){const[t,e,n]=m;b(k(d,t,e,void 0,void 0,n),t-l,e-t)}else u>l&&(b(k(d,l,u),0,u-l),p.forEach(t=>t{let e,s=0;for(const i of n){const n=a.get(i);if(!n)return!1;const[r,o,l]=n,u=i.at(t),h=i.timing()[0]===1/0;if(l){if(h&&u===r)continue;return!1}const c=(u-r)/o,d=h?0:i.speed/o;if(void 0===e)e=c,s=d;else if(Math.abs(c-e)>1||d!==s)return!1}if(void 0===e)return!0;if(!o.length)return!1;for(const{offset:t,end:n,isDone:s}of o){const i=e-t;if(n<1/0&&(s?i=n))return!1}for(const{animation:n,offset:i,isDone:r}of o){if(r)continue;const a=e-i;s?(n.playbackRate=s,n.startTime=t-a/s):(n.pause(),n.currentTime=a)}return!0},D=()=>!n.size&&(c=!0,Rn.delete(e),E.isJS||v(),!0),C=()=>{const e=K.now();if(E.isJS||(E.isFinishing=!0,n.forEach(n=>{const[s,r]=n.timing();"running"===n.state&&n.speed>0&&!r&&s<=e+1&&(n.complete(),i[n.name]=Bn(t,n.name),a.has(n)||(l=!0))}),E.isFinishing=!1),h=!1,c)return;if(n.forEach(({state:t},e)=>{"idle"!==t&&"finished"!==t||n.delete(e)}),D())return;for(const t of n)if(!t.canAccelerate)return E.demote(!0);E.isJS&&(E.isJS=!1,l=!0,n.forEach(t=>t.js?.stop()));const s=l,r=d;if(l=d=!1,s||!x(e)){if(r){if(e-f<100)return E.demote();f=e}if(!S(e))return E.demote()}},E={tracks:n,isJS:!1,isFinishing:!1,schedule(t,e){c||(l||(l=t),d||(d=!!e),h||(h=!0,R.isProcessing?Ot.render(C,!1,!0):queueMicrotask(C)))},release(t){const{state:e}=t;"idle"!==e&&"finished"!==e||n.delete(t),D()||E.schedule(!0)},check(){if(!E.isJS)for(const e in i)if(Bn(t,e)!==i[e]&&!p(e))return E.schedule(!0,!0)},demote(t){E.isJS||c||(n.forEach(e=>{e.isAccelerated()&&e.sync(),t||(e.canAccelerate=!1)}),E.isJS=!0,a=new Map,v(),n.forEach(t=>"running"===t.state&&t.js?.start()))}};return Rn.set(e,E),E}(Wn(this.options))).tracks.add(this),super.play())}pause(){super.pause(),this.isAccelerated()&&(this.sync(),this.group.schedule(!1))}complete(){super.complete();const{group:t}=this;t&&!t.isJS&&this.canAccelerate&&this.tick(K.now())}get time(){return this.isAccelerated()?d(e(0,this.totalDuration,this.at(K.now())-(this.options.delay||0))):super.time}set time(t){super.time=t,this.isAccelerated()&&this.sync()}attachTimeline(t){return this.canAccelerate=!1,this.group?.demote(!0),super.attachTimeline(t)}}class jn extends Ae{constructor(t){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=K.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,s,i){this.keyframeResolver=void 0;const{name:r,type:a,velocity:o,delay:l,isHandoff:u,onUpdate:h}=s;this.resolvedAt=K.now();let c=!0;(function(t,e,n,s){const i=t[0];if(null===i)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],a=Mn(i,e),o=Mn(r,e);return!(!a||!o)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n{d?.(),this.notifyFinished()};const f=c&&!u&&En(s),p=!f&&(({name:t,motionValue:e})=>t&&ze.includes(t)&&e?.owner?.current instanceof HTMLElement&&Cn()&&fn())(s);let m;if(i&&(f||p||this.resolvedAt!==this.createdAt)&&(s.startTime??(s.startTime=ve(this.createdAt,this.resolvedAt))),f){s.element=s.motionValue?.owner?.current;try{m=new wn(s)}catch{m=new ke(s)}}else m=p?new $n(s):new ke(s);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(()=>{})}liveValue(){return this._animation?.liveValue?.()}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 Yn{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;ne.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 _n(this.animations,"duration")}get iterationDuration(){return _n(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 _n(t,e){let n=0;for(let s=0;sn&&(n=i)}return n}class Xn extends Yn{then(t,e){return this.finished.finally(t).then(()=>{})}}class Un{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=K.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=K.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 h)).add(e)}onChangeSubscribe(t){const{events:e}=this;return e.change||this.changeSubscriber?(e.change||(e.change=new h,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(){Ot.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(){const t=this.animation?.liveValue?.();return void 0===t?this.current:t}getCurrent(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=K.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return f(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 zn(t,e){return new Un(t,e)}const Zn={type:"spring",stiffness:500,damping:25,restSpeed:10},Ln={type:"keyframes",duration:.8},qn={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Jn=(t,{keyframes:e})=>e.length>2?Ln:Ze.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Zn:qn,Gn=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);const Hn=(t,e,s,i={},r,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}(i,t)||{},l=o.delay||i.delay||0;let{elapsed:u=0}=i;u-=c(l);const h={keyframes:Array.isArray(s)?s:[null,s],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:r,hasOnUpdate:!!o.onUpdate};(function(t){for(const e in t)if(!Gn.has(e))return!0;return!1})(o)||Object.assign(h,Jn(t,h)),h.duration&&(h.duration=c(h.duration)),h.repeatDelay&&(h.repeatDelay=c(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let d=!1;if((!1===h.type||0===h.duration&&!h.repeatDelay)&&(kn(h),0===h.delay&&(d=!0)),(n.instantAnimations||n.skipAnimations||r?.shouldSkipAnimations||o.skipAnimations)&&(d=!0,kn(h),h.delay=0),h.allowFlatten=!o.type&&!o.ease,d&&void 0!==e.get()){const t=me(h.keyframes,o);if(void 0!==t)return void Ot.update(()=>{h.onUpdate(t),h.onComplete()})}return o.isSync?new ke(h):new jn(h)},Qn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ts(t,e,n=1){const[i,r]=function(t){const e=Qn.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}(t);if(!i)return;const a=window.getComputedStyle(e).getPropertyValue(i);if(a){const t=a.trim();return s(t)?parseFloat(t):t}return B(r)?ts(r,e,n+1):r}const es=new Set(["width","height","top","left","right","bottom",...ze]),ns=t=>Boolean(t&&t.getVelocity);function ss(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const is=[Y,et,tt,Q,st,nt,{test:t=>"auto"===t,parse:t=>t}],rs=t=>is.find((t=>e=>e.test(t))(t));function as(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||r(t))}const os=new Set(["auto","none","0"]);class ls extends on{constructor(t,e,n,s,i){super(t,e,n,s,i,!0)}scheduleResolve(){if(this.canReadNow()&&(this.readKeyframes(),!this.needsMeasurement))return this.complete();super.scheduleResolve()}canReadNow(){const{unresolvedKeyframes:t,element:e,motionValue:n}=this,s=t[0]??n?.get();if(!e?.current||void 0===s)return!1;for(let e=0;et.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 us=[];function hs(e){t(us,e)}function cs(t){return us.find(e=>e.test(t))}function ds(t,e,n={},s){const i=[],{velocity:r,path:a}=n,o=n.reduceMotion??s?.shouldReduceMotion;a?.animateValues&&s&&(e={...e},a.animateValues(t,e,n,0,i));for(const a in e){if("transition"===a||"transitionEnd"===a)continue;const l=e[a];if(void 0===l)continue;const u=t(a),h=u.get();void 0===h||u.isAnimating()||Array.isArray(l)||l!==h||r?(u.start(Hn(a,u,l,o&&es.has(a)?{type:!1}:n,s)),u.animation&&i.push(u.animation)):Ot.update(()=>u.set(l))}const{transitionEnd:l}=e;if(l){const e=()=>Ot.update(()=>{for(const e in l)t(e).set(l[e])});i.length?Promise.all(i).then(e):e()}return i}function fs(t,e,n,s,i){return ds(s=>{let r=t.get(e,s);if(!r){let a;if(!i){const i=n[s];a=function(t){const e=Array.isArray(t)?t[0]:void 0;return null===e?void 0:e}(i)??t.read(e,s,i)}r=zn(a,{owner:i}),t(e,{[s]:r})}return r},n,s,i)}function ps(t){return i(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}function ms(t){return i(t)&&"ownerSVGElement"in t}class gs{constructor(t=Ot.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;nn&&this.schedule(n);void 0!==e.get()&&i();const r=e.on("change",i),a=()=>{r(),n&&!s&&this.cancel(n),this.values.get(t)?.onRemove===a&&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{const r=s.get(n)??new gs(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 vs={};const bs=new Set(["originX","originY","originZ"]),Ts=(t,e)=>Vn(t.get(e)?.get(),Pe[e]),As=(t,e,n,s)=>{let i,r;if(Ze.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")||(ps(t)||e.get("transformBox")||As(t,e,"transformBox",new Un("fill-box")),e.set("transform",new Un("none"),()=>{Rn.get(t)?.check(),t.style.transform=function(t){let e="";const{transformKeys:n=[],transformValues:s={}}=t;for(let t=0;t{const n=Ts(e,"originX")??"50%",s=Ts(e,"originY")??"50%",i=Ts(e,"originZ")??0;t.style.transformOrigin=`${n} ${s} ${i}`}),r=e.get("transformOrigin")):i=ln(n)?()=>{t.style.setProperty(n,s.getCurrent())}:()=>{t.style[n]=Vn(s.getCurrent(),Pe[n])};return e.set(n,s,i,r)},ws=(t,e)=>{if(Ze.has(e))return((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Xe(n,e)})(t,e);const n=getComputedStyle(t),s=ln(e)?n.getPropertyValue(e):n[e];return"string"==typeof s&&s.trim()||0},Ms=ys(As,{test:t=>ps(t)||ms(t),read:ws}),ks=["transform","opacity","clipPath","filter","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];const Ss=(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=ss(i));const a=Pe[n]||Pe[i],o=r?()=>{t[i]=Vn(s.get(),Pe[n])}:()=>{const e=Vn(s.get(),a);null==e?t.removeAttribute(i):t.setAttribute(i,String(e))};return e.set(n,s,o)};const xs=ys((t,e,n,s)=>{if(n.startsWith("path")&&!Ze.has(n))return function(t,e,n,s){return Ot.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 Un("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 Ss(t,e,n,s,Ds(n));return(Ze.has(n)||bs.has(n)||ln(n)||n in t.style?As:Ss)(t,e,n,s)},{test:ms,read:(t,e)=>Ze.has(e)?Pe[e]?.default||0:ln(e)||ks.includes(e)?ws(t,e)||t.getAttribute(ss(e))||0:(e=Ds(e),t.getAttribute(ss(e))??t.getAttribute(e)??void 0)});function Ds(t){return t.replace(/^attr([A-Z])/,(t,e)=>e.toLowerCase())}const Cs={};class Es{constructor(t,e){this.effect=t,this.current=e,this.KeyframeResolver=ls}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 Cs}}function Vs(t,e,n,s){if(s)return ds(t=>s.getValue(t,null),e,n,s);const i=(t=>ms(t)?xs:Ms)(t);return fs(i,t,e,n,new Es(i,t))}const Fs=ys((t,e,n,s)=>e.set(n,s,()=>{t[n]=s.get()}),{test:t=>i(t),read:(t,e)=>{const n=t[e];return"string"==typeof n||"number"==typeof n?n:void 0}}),Ps=new WeakMap;function Rs(t){return"object"==typeof t&&!Array.isArray(t)}function Os(t,e,n,s){return null==t?[]:"string"==typeof t&&Rs(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 Is(t,e,n){return t*(e+1)+n*e}function Ks(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 Ws(e,n,s,i,r,a){!function(e,n,s){for(let i=0;in&&r.at"number"==typeof t,Us=t=>t.every(Xs);function zs(t,e,n,s){const i=[];if(function(t,e){return ns(t)||"number"==typeof t||"string"==typeof t&&!Rs(e)}(t,e))i.push(function(t,e,n){const s=ns(t)?t:zn(t);return s.start(Hn("",s,e,n)),s.animation}(t,Rs(e)&&e.default||e,n&&n.default||n));else{if(null==t)return i;const r=Os(t,e,s),a=r.length;for(let t=0;t{const l=Ys(t),{delay:u=0,times:h=ce(l),type:d=e.type||"keyframes",repeat:m,repeatType:g,repeatDelay:b=0,...T}=n;let{ease:A=e.ease||"easeOut",duration:w}=n;const M="function"==typeof u?u(a,o):u,k=l.length,S=vn(d)?d:i?.[d||"keyframes"];if(k<=2&&S){let t=100;if(2===k&&Us(l)){const e=l[1]-l[0];t=Math.abs(e)}const n={...e,...T};void 0!==w&&(n.duration=c(w));const s=$t(n,t,S);A=s.ease,w=s.duration}w??(w=r);const x=f+M;1===h.length&&0===h[0]&&(h[1]=1);const D=h.length-l.length;if(D>0&&he(h,D),1===l.length&&l.unshift(null),m&&m<20){const t=w>0?b/w:0;w=Is(w,m,b);const e=[...l],n=[...h];A=Array.isArray(A)?[...A]:[A];const s=[...A],i="reverse"===g||"mirror"===g;let r=e,a=s;i&&(r=[...e].reverse(),"reverse"===g&&(a=[...s].reverse().map(t=>"function"==typeof t?y(t):t)));for(let o=0;o0&&(l.push(l[l.length-1]),h.push(f),A.push("linear")),l.push(...c);for(let t=0;t{for(const i in t){const r=t[i];r.sort(Bs);const o=[],l=[],h=[];for(let t=0;t{if(Array.isArray(t)&&"function"==typeof t[0]){const e=t[0],n=zn(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:oe});return i.forEach(({keyframes:t,transition:e},n)=>{s.push(...zs(n,t,e))}),s}function Ls(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),h=e,Array.isArray(h)&&h.some(Array.isArray)){const{onComplete:t,...s}=r||{};"function"==typeof t&&(o=t),l=Zs(e,{...u,...s},n)}else{const{onComplete:t,...s}=a||{};"function"==typeof t&&(o=t),l=zs(e,r,{...u,...s},n)}var h;const c=new Xn(l);return o&&c.finished.then(o),n&&(n.animations.push(c),c.finished.then(()=>{t(n.animations,c)})),c}}const qs=Object.assign(Ls(),{addEffect:function(t){"function"==typeof t.test&&t.read,hs(t),us.unshift(t)},removeEffect:hs});export{qs as animate,Ls as createScopedAnimate}; //# sourceMappingURL=size-rollup-animate.js.map